aboutsummaryrefslogtreecommitdiff
path: root/support/tools/TableGen/Record.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'support/tools/TableGen/Record.cpp')
-rw-r--r--support/tools/TableGen/Record.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/support/tools/TableGen/Record.cpp b/support/tools/TableGen/Record.cpp
index 469faa9b01..2aabef408d 100644
--- a/support/tools/TableGen/Record.cpp
+++ b/support/tools/TableGen/Record.cpp
@@ -127,6 +127,15 @@ Init *RecordRecTy::convertValue(DefInit *DI) {
return DI;
}
+Init *RecordRecTy::convertValue(TypedInit *VI) {
+ // Ensure that VI is compatible with Rec.
+ if (RecordRecTy *RRT = dynamic_cast<RecordRecTy*>(VI->getType()))
+ if (RRT->getRecord()->isSubClassOf(getRecord()) ||
+ RRT->getRecord() == getRecord())
+ return VI;
+ return 0;
+}
+
//===----------------------------------------------------------------------===//
// Initializer implementations
//===----------------------------------------------------------------------===//