summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-01-18 19:52:37 +0000
committerCraig Topper <craig.topper@gmail.com>2016-01-18 19:52:37 +0000
commit0e41d0b963cdd804d12b151216833e1ed65773a1 (patch)
treed5b6775d95b2829dba44b5863f6f52508aacec31 /llvm/lib/TableGen/TGParser.cpp
parentd4d3ebd937553546a4259399d73730d881081f93 (diff)
downloadbcm5719-llvm-0e41d0b963cdd804d12b151216833e1ed65773a1.tar.gz
bcm5719-llvm-0e41d0b963cdd804d12b151216833e1ed65773a1.zip
[TableGen] Merge the SuperClass Record and SMRange vector into a single vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC
llvm-svn: 258065
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