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
This commit is contained in:
Bruno Cardoso Lopes 2010-06-17 23:00:16 +00:00
parent 3bf9125933
commit 93583c97f8

View File

@ -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;
}