From: Bruno Cardoso Lopes Date: Thu, 17 Jun 2010 23:00:16 +0000 (+0000) Subject: In case Rec is a definition and not a class, do the proper comparison! X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=93583c97f8d265b0e6bf8b561aae0c82dbf2bc06;p=oota-llvm.git 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 --- diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index f0147d328b8..5a69edb615d 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 &SC = Rec->getSuperClasses(); + for (unsigned i = 0, e = SC.size(); i != e; ++i) + if (RHS->getRecord()->isSubClassOf(SC[i])) + return true; + + return false; }