It appears that somehow we forgot to add support for code variables.
authorChris Lattner <sabre@nondot.org>
Mon, 4 Aug 2003 04:53:50 +0000 (04:53 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Aug 2003 04:53:50 +0000 (04:53 +0000)
Fix bug: TableGen/2003-08-03-PassCode.td

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7561 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/Record.cpp
support/tools/TableGen/Record.h
utils/TableGen/Record.cpp
utils/TableGen/Record.h

index 968f367bd7a832f14b85db8aa92e0cbca4aec501..616c790f06b6e33a6ef0a7a45c2e496cf06d0fa6 100644 (file)
@@ -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;
index 4573af0ee7f4c453003b27d2f8e2da0d441eb24c..cb42f03532935ec39f931380f9ff063dc00cf0b2 100644 (file)
@@ -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"; }
 
index 968f367bd7a832f14b85db8aa92e0cbca4aec501..616c790f06b6e33a6ef0a7a45c2e496cf06d0fa6 100644 (file)
@@ -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;
index 4573af0ee7f4c453003b27d2f8e2da0d441eb24c..cb42f03532935ec39f931380f9ff063dc00cf0b2 100644 (file)
@@ -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"; }