[llvm-commits] CVS: llvm/utils/TableGen/Record.cpp Record.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Aug 4 00:00:45 PDT 2003
Changes in directory llvm/utils/TableGen:
Record.cpp updated: 1.20 -> 1.21
Record.h updated: 1.25 -> 1.26
---
Log message:
Fix bug: TableGen/IntBitInit.td
---
Diffs of the changes:
Index: llvm/utils/TableGen/Record.cpp
diff -u llvm/utils/TableGen/Record.cpp:1.20 llvm/utils/TableGen/Record.cpp:1.21
--- llvm/utils/TableGen/Record.cpp:1.20 Sun Aug 3 13:24:34 2003
+++ llvm/utils/TableGen/Record.cpp Sun Aug 3 13:29:51 2003
@@ -93,6 +93,10 @@
return 0;
}
+Init *IntRecTy::convertValue(BitInit *BI) {
+ return new IntInit(BI->getValue());
+}
+
Init *IntRecTy::convertValue(BitsInit *BI) {
int Result = 0;
for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i)
@@ -105,7 +109,7 @@
}
Init *IntRecTy::convertValue(TypedInit *TI) {
- if (dynamic_cast<IntRecTy*>(TI->getType()))
+ if (TI->getType()->typeIsConvertibleTo(this))
return TI; // Accept variable if already of the right type!
return 0;
}
Index: llvm/utils/TableGen/Record.h
diff -u llvm/utils/TableGen/Record.h:1.25 llvm/utils/TableGen/Record.h:1.26
--- llvm/utils/TableGen/Record.h:1.25 Sun Aug 3 13:16:55 2003
+++ llvm/utils/TableGen/Record.h Sun Aug 3 13:29:51 2003
@@ -145,6 +145,7 @@
struct IntRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; }
+ Init *convertValue(BitInit *BI);
Init *convertValue(BitsInit *BI);
Init *convertValue(TypedInit *TI);
More information about the llvm-commits
mailing list