aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/PseudoLoweringEmitter.cpp
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2012-10-10 20:24:43 +0000
committerSean Silva <silvas@purdue.edu>2012-10-10 20:24:43 +0000
commit6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b (patch)
tree792b0800194da285c83f814a8ac1d93c59d0bcab /utils/TableGen/PseudoLoweringEmitter.cpp
parentb0c6fa3b4b74d9cd03beb5a4cb9702abc85ac169 (diff)
downloadexternal_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/PseudoLoweringEmitter.cpp')
-rw-r--r--utils/TableGen/PseudoLoweringEmitter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/TableGen/PseudoLoweringEmitter.cpp b/utils/TableGen/PseudoLoweringEmitter.cpp
index 1896a7b..b0241c7 100644
--- a/utils/TableGen/PseudoLoweringEmitter.cpp
+++ b/utils/TableGen/PseudoLoweringEmitter.cpp
@@ -74,7 +74,7 @@ addDagOperandMapping(Record *Rec, DagInit *Dag, CodeGenInstruction &Insn,
IndexedMap<OpData> &OperandMap, unsigned BaseIdx) {
unsigned OpsAdded = 0;
for (unsigned i = 0, e = Dag->getNumArgs(); i != e; ++i) {
- if (DefInit *DI = dynamic_cast<DefInit*>(Dag->getArg(i))) {
+ if (DefInit *DI = dyn_cast<DefInit>(Dag->getArg(i))) {
// Physical register reference. Explicit check for the special case
// "zero_reg" definition.
if (DI->getDef()->isSubClassOf("Register") ||
@@ -100,11 +100,11 @@ addDagOperandMapping(Record *Rec, DagInit *Dag, CodeGenInstruction &Insn,
for (unsigned I = 0, E = Insn.Operands[i].MINumOperands; I != E; ++I)
OperandMap[BaseIdx + i + I].Kind = OpData::Operand;
OpsAdded += Insn.Operands[i].MINumOperands;
- } else if (IntInit *II = dynamic_cast<IntInit*>(Dag->getArg(i))) {
+ } else if (IntInit *II = dyn_cast<IntInit>(Dag->getArg(i))) {
OperandMap[BaseIdx + i].Kind = OpData::Imm;
OperandMap[BaseIdx + i].Data.Imm = II->getValue();
++OpsAdded;
- } else if (DagInit *SubDag = dynamic_cast<DagInit*>(Dag->getArg(i))) {
+ } else if (DagInit *SubDag = dyn_cast<DagInit>(Dag->getArg(i))) {
// Just add the operands recursively. This is almost certainly
// a constant value for a complex operand (> 1 MI operand).
unsigned NewOps =
@@ -127,7 +127,7 @@ void PseudoLoweringEmitter::evaluateExpansion(Record *Rec) {
assert(Dag && "Missing result instruction in pseudo expansion!");
DEBUG(dbgs() << " Result: " << *Dag << "\n");
- DefInit *OpDef = dynamic_cast<DefInit*>(Dag->getOperator());
+ DefInit *OpDef = dyn_cast<DefInit>(Dag->getOperator());
if (!OpDef)
throw TGError(Rec->getLoc(), Rec->getName() +
" has unexpected operator type!");