summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--support/tools/TableGen/Record.cpp6
-rw-r--r--support/tools/TableGen/Record.h1
-rw-r--r--utils/TableGen/Record.cpp6
-rw-r--r--utils/TableGen/Record.h1
4 files changed, 14 insertions, 0 deletions
diff --git a/support/tools/TableGen/Record.cpp b/support/tools/TableGen/Record.cpp
index 968f367bd7..616c790f06 100644
--- a/support/tools/TableGen/Record.cpp
+++ b/support/tools/TableGen/Record.cpp
@@ -146,6 +146,12 @@ Init *ListRecTy::convertValue(TypedInit *TI) {
return 0;
}
+Init *CodeRecTy::convertValue(TypedInit *TI) {
+ if (TI->getType()->typeIsConvertibleTo(this))
+ return TI;
+ return 0;
+}
+
Init *DagRecTy::convertValue(TypedInit *TI) {
if (TI->getType()->typeIsConvertibleTo(this))
return TI;
diff --git a/support/tools/TableGen/Record.h b/support/tools/TableGen/Record.h
index 4573af0ee7..cb42f03532 100644
--- a/support/tools/TableGen/Record.h
+++ b/support/tools/TableGen/Record.h
@@ -207,6 +207,7 @@ public:
struct CodeRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue( CodeInit *CI) { return (Init*)CI; }
+ Init *convertValue(TypedInit *TI);
void print(std::ostream &OS) const { OS << "code"; }
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index 968f367bd7..616c790f06 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -146,6 +146,12 @@ Init *ListRecTy::convertValue(TypedInit *TI) {
return 0;
}
+Init *CodeRecTy::convertValue(TypedInit *TI) {
+ if (TI->getType()->typeIsConvertibleTo(this))
+ return TI;
+ return 0;
+}
+
Init *DagRecTy::convertValue(TypedInit *TI) {
if (TI->getType()->typeIsConvertibleTo(this))
return TI;
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index 4573af0ee7..cb42f03532 100644
--- a/utils/TableGen/Record.h
+++ b/utils/TableGen/Record.h
@@ -207,6 +207,7 @@ public:
struct CodeRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue( CodeInit *CI) { return (Init*)CI; }
+ Init *convertValue(TypedInit *TI);
void print(std::ostream &OS) const { OS << "code"; }