diff options
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r-- | llvm/lib/TableGen/Record.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index c94bd59c8ad..80c0973644b 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -141,6 +141,10 @@ bool RecordRecTy::typeIsConvertibleTo(const RecTy *RHS) const { if (RTy->getRecord() == Rec || Rec->isSubClassOf(RTy->getRecord())) return true; + for (const auto &SCPair : RTy->getRecord()->getSuperClasses()) + if (Rec->isSubClassOf(SCPair.first)) + return true; + return false; } @@ -169,16 +173,6 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { return NewType2; } } - - if (ListRecTy *ListTy1 = dyn_cast<ListRecTy>(T1)) { - if (ListRecTy *ListTy2 = dyn_cast<ListRecTy>(T2)) { - RecTy* NewType = resolveTypes(ListTy1->getElementType(), - ListTy2->getElementType()); - if (NewType) - return NewType->getListTy(); - } - } - return nullptr; } |