diff options
author | Sean Silva <silvas@purdue.edu> | 2012-10-10 20:24:43 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2012-10-10 20:24:43 +0000 |
commit | 6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b (patch) | |
tree | 792b0800194da285c83f814a8ac1d93c59d0bcab /utils/TableGen/FixedLenDecoderEmitter.cpp | |
parent | b0c6fa3b4b74d9cd03beb5a4cb9702abc85ac169 (diff) | |
download | external_llvm-6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b.zip external_llvm-6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b.tar.gz external_llvm-6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b.tar.bz2 |
tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.
Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.
There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/FixedLenDecoderEmitter.cpp')
-rw-r--r-- | utils/TableGen/FixedLenDecoderEmitter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp index b5f62d8..aa4dd8a 100644 --- a/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -142,7 +142,7 @@ static int Value(bit_value_t V) { return ValueNotSet(V) ? -1 : (V == BIT_FALSE ? 0 : 1); } static bit_value_t bitFromBits(const BitsInit &bits, unsigned index) { - if (BitInit *bit = dynamic_cast<BitInit*>(bits.getBit(index))) + if (BitInit *bit = dyn_cast<BitInit>(bits.getBit(index))) return bit->getValue() ? BIT_TRUE : BIT_FALSE; // The bit is uninitialized. @@ -1757,7 +1757,7 @@ static bool populateInstruction(const CodeGenInstruction &CGI, unsigned Opc, // for decoding register classes. // FIXME: This need to be extended to handle instructions with custom // decoder methods, and operands with (simple) MIOperandInfo's. - TypedInit *TI = dynamic_cast<TypedInit*>(NI->first); + TypedInit *TI = dyn_cast<TypedInit>(NI->first); RecordRecTy *Type = dyn_cast<RecordRecTy>(TI->getType()); Record *TypeRecord = Type->getRecord(); bool isReg = false; @@ -1770,7 +1770,7 @@ static bool populateInstruction(const CodeGenInstruction &CGI, unsigned Opc, RecordVal *DecoderString = TypeRecord->getValue("DecoderMethod"); StringInit *String = DecoderString ? - dynamic_cast<StringInit*>(DecoderString->getValue()) : 0; + dyn_cast<StringInit>(DecoderString->getValue()) : 0; if (!isReg && String && String->getValue() != "") Decoder = String->getValue(); @@ -1781,11 +1781,11 @@ static bool populateInstruction(const CodeGenInstruction &CGI, unsigned Opc, for (unsigned bi = 0; bi < Bits.getNumBits(); ++bi) { VarInit *Var = 0; - VarBitInit *BI = dynamic_cast<VarBitInit*>(Bits.getBit(bi)); + VarBitInit *BI = dyn_cast<VarBitInit>(Bits.getBit(bi)); if (BI) - Var = dynamic_cast<VarInit*>(BI->getBitVar()); + Var = dyn_cast<VarInit>(BI->getBitVar()); else - Var = dynamic_cast<VarInit*>(Bits.getBit(bi)); + Var = dyn_cast<VarInit>(Bits.getBit(bi)); if (!Var) { if (Base != ~0U) { |