diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-01-18 19:52:37 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-01-18 19:52:37 +0000 |
commit | 0e41d0b963cdd804d12b151216833e1ed65773a1 (patch) | |
tree | d5b6775d95b2829dba44b5863f6f52508aacec31 /llvm/lib/TableGen/Record.cpp | |
parent | d4d3ebd937553546a4259399d73730d881081f93 (diff) | |
download | bcm5719-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/Record.cpp')
-rw-r--r-- | llvm/lib/TableGen/Record.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 943b101d9a3..dad68c95855 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -167,8 +167,8 @@ bool RecordRecTy::typeIsConvertibleTo(const RecTy *RHS) const { if (RTy->getRecord() == Rec || Rec->isSubClassOf(RTy->getRecord())) return true; - for (Record *SC : RTy->getRecord()->getSuperClasses()) - if (Rec->isSubClassOf(SC)) + for (const auto &SCPair : RTy->getRecord()->getSuperClasses()) + if (Rec->isSubClassOf(SCPair.first)) return true; return false; @@ -186,8 +186,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { // If one is a Record type, check superclasses if (RecordRecTy *RecTy1 = dyn_cast<RecordRecTy>(T1)) { // See if T2 inherits from a type T1 also inherits from - for (Record *SuperRec1 : RecTy1->getRecord()->getSuperClasses()) { - RecordRecTy *SuperRecTy1 = RecordRecTy::get(SuperRec1); + for (const auto &SuperPair1 : RecTy1->getRecord()->getSuperClasses()) { + RecordRecTy *SuperRecTy1 = RecordRecTy::get(SuperPair1.first); RecTy *NewType1 = resolveTypes(SuperRecTy1, T2); if (NewType1) return NewType1; @@ -195,8 +195,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { } if (RecordRecTy *RecTy2 = dyn_cast<RecordRecTy>(T2)) { // See if T1 inherits from a type T2 also inherits from - for (Record *SuperRec2 : RecTy2->getRecord()->getSuperClasses()) { - RecordRecTy *SuperRecTy2 = RecordRecTy::get(SuperRec2); + for (const auto &SuperPair2 : RecTy2->getRecord()->getSuperClasses()) { + RecordRecTy *SuperRecTy2 = RecordRecTy::get(SuperPair2.first); RecTy *NewType2 = resolveTypes(T1, SuperRecTy2); if (NewType2) return NewType2; @@ -1662,11 +1662,11 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const Record &R) { } OS << " {"; - ArrayRef<Record *> SC = R.getSuperClasses(); + ArrayRef<std::pair<Record *, SMRange>> SC = R.getSuperClasses(); if (!SC.empty()) { OS << "\t//"; - for (const Record *Super : SC) - OS << " " << Super->getNameInitAsString(); + for (const auto &SuperPair : SC) + OS << " " << SuperPair.first->getNameInitAsString(); } OS << "\n"; |