diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-03 18:29:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-03 18:29:51 +0000 |
commit | 08ca97291fe309c24a29beba2f2d770aa75c7653 (patch) | |
tree | d01b980e9040b00dac4d25140c2d8f8f696fad3a /utils/TableGen/Record.cpp | |
parent | a6aff650e8af0275a615be41be3813a008edabf6 (diff) | |
download | external_llvm-08ca97291fe309c24a29beba2f2d770aa75c7653.zip external_llvm-08ca97291fe309c24a29beba2f2d770aa75c7653.tar.gz external_llvm-08ca97291fe309c24a29beba2f2d770aa75c7653.tar.bz2 |
Fix bug: TableGen/IntBitInit.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.cpp')
-rw-r--r-- | utils/TableGen/Record.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 204929e..cf8aa40 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -93,6 +93,10 @@ Init *BitsRecTy::convertValue(TypedInit *VI) { 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(BitsInit *BI) { } 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; } |