summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 1506a7171ac..3b8ce00a33d 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -185,13 +185,12 @@ bool TGParser::AddSubClass(Record *CurRec, SubClassReference &SubClass) {
// Since everything went well, we can now set the "superclass" list for the
// current record.
- ArrayRef<Record *> SCs = SC->getSuperClasses();
- ArrayRef<SMRange> SCRanges = SC->getSuperClassRanges();
- for (unsigned i = 0, e = SCs.size(); i != e; ++i) {
- if (CurRec->isSubClassOf(SCs[i]))
+ ArrayRef<std::pair<Record *, SMRange>> SCs = SC->getSuperClasses();
+ for (const auto &SCPair : SCs) {
+ if (CurRec->isSubClassOf(SCPair.first))
return Error(SubClass.RefRange.Start,
- "Already subclass of '" + SCs[i]->getName() + "'!\n");
- CurRec->addSuperClass(SCs[i], SCRanges[i]);
+ "Already subclass of '" + SCPair.first->getName() + "'!\n");
+ CurRec->addSuperClass(SCPair.first, SCPair.second);
}
if (CurRec->isSubClassOf(SC))
OpenPOWER on IntegriCloud