diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-06-17 23:00:16 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-06-17 23:00:16 +0000 |
commit | 93583c97f8d265b0e6bf8b561aae0c82dbf2bc06 (patch) | |
tree | 8eb9bf100034a8d302a35f05714c0b213e375b26 /utils/TableGen | |
parent | 3bf912593301152b65accb9d9c37a95172f1df5a (diff) | |
download | external_llvm-93583c97f8d265b0e6bf8b561aae0c82dbf2bc06.zip external_llvm-93583c97f8d265b0e6bf8b561aae0c82dbf2bc06.tar.gz external_llvm-93583c97f8d265b0e6bf8b561aae0c82dbf2bc06.tar.bz2 |
In case Rec is a definition and not a class, do the proper comparison!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/Record.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index f0147d3..5a69edb 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -270,7 +270,15 @@ Init *RecordRecTy::convertValue(TypedInit *TI) { } bool RecordRecTy::baseClassOf(const RecordRecTy *RHS) const { - return Rec == RHS->getRecord() || RHS->getRecord()->isSubClassOf(Rec); + if (Rec == RHS->getRecord() || RHS->getRecord()->isSubClassOf(Rec)) + return true; + + const std::vector<Record*> &SC = Rec->getSuperClasses(); + for (unsigned i = 0, e = SC.size(); i != e; ++i) + if (RHS->getRecord()->isSubClassOf(SC[i])) + return true; + + return false; } |