diff options
author | Sean Silva <silvas@purdue.edu> | 2012-10-10 20:24:47 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2012-10-10 20:24:47 +0000 |
commit | 3f7b7f8ce0b050fc6a0100839d9c5a84198b2aed (patch) | |
tree | b229fa1cc21ace68695e23723471305c15eaf0d1 /utils/TableGen/CodeGenInstruction.cpp | |
parent | 6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b (diff) | |
download | external_llvm-3f7b7f8ce0b050fc6a0100839d9c5a84198b2aed.zip external_llvm-3f7b7f8ce0b050fc6a0100839d9c5a84198b2aed.tar.gz external_llvm-3f7b7f8ce0b050fc6a0100839d9c5a84198b2aed.tar.bz2 |
tblgen: Use semantically correct RTTI functions.
Also, some minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r-- | utils/TableGen/CodeGenInstruction.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index 82335cf..99d2f17 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -80,9 +80,8 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) { MIOpInfo = Rec->getValueAsDag("MIOperandInfo"); // Verify that MIOpInfo has an 'ops' root value. - if (!dyn_cast<DefInit>(MIOpInfo->getOperator()) || - dyn_cast<DefInit>(MIOpInfo->getOperator()) - ->getDef()->getName() != "ops") + if (!isa<DefInit>(MIOpInfo->getOperator()) || + cast<DefInit>(MIOpInfo->getOperator())->getDef()->getName() != "ops") throw "Bad value for MIOperandInfo in operand '" + Rec->getName() + "'\n"; @@ -446,7 +445,7 @@ bool CodeGenInstAlias::tryAliasOpMatch(DagInit *Result, unsigned AliasOpNo, DagInit *DI = InstOpRec->getValueAsDag("MIOperandInfo"); // The operand info should only have a single (register) entry. We // want the register class of it. - InstOpRec = dyn_cast<DefInit>(DI->getArg(0))->getDef(); + InstOpRec = cast<DefInit>(DI->getArg(0))->getDef(); } if (InstOpRec->isSubClassOf("RegisterOperand")) @@ -575,7 +574,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) { } else { DagInit *MIOI = ResultInst->Operands[i].MIOperandInfo; for (unsigned SubOp = 0; SubOp != NumSubOps; ++SubOp) { - Record *SubRec = dyn_cast<DefInit>(MIOI->getArg(SubOp))->getDef(); + Record *SubRec = cast<DefInit>(MIOI->getArg(SubOp))->getDef(); // Take care to instantiate each of the suboperands with the correct // nomenclature: $foo.bar @@ -596,7 +595,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) { for (unsigned SubOp = 0; SubOp != NumSubOps; ++SubOp) { if (AliasOpNo >= Result->getNumArgs()) throw TGError(R->getLoc(), "not enough arguments for instruction!"); - Record *SubRec = dyn_cast<DefInit>(MIOI->getArg(SubOp))->getDef(); + Record *SubRec = cast<DefInit>(MIOI->getArg(SubOp))->getDef(); if (tryAliasOpMatch(Result, AliasOpNo, SubRec, false, R->getLoc(), T, ResOp)) { ResultOperands.push_back(ResOp); |