diff options
author | Craig Topper <craig.topper@sifive.com> | 2021-10-16 00:26:59 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2021-10-16 00:27:53 -0700 |
commit | 64591f217d984e955c27942437117f9ee5af570c (patch) | |
tree | 9f1a67471b20f4aa6372597bcae630840aa94b5b /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 37ca7a795b277c20c02a218bf44052278c03344b (diff) | |
download | llvm-64591f217d984e955c27942437117f9ee5af570c.zip llvm-64591f217d984e955c27942437117f9ee5af570c.tar.gz llvm-64591f217d984e955c27942437117f9ee5af570c.tar.bz2 |
[TableGen] Replace static_cast with llvm's cast. NFC
These all appear next to an isa<> and cast<> is much more
common in these cases.
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 2d0694d..4a247050 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1632,12 +1632,12 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, // have an integer type that is smaller than the VT. if (!NodeToApply->isLeaf() || !isa<DefInit>(NodeToApply->getLeafValue()) || - !static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef() + !cast<DefInit>(NodeToApply->getLeafValue())->getDef() ->isSubClassOf("ValueType")) { TP.error(N->getOperator()->getName() + " expects a VT operand!"); return false; } - DefInit *DI = static_cast<DefInit*>(NodeToApply->getLeafValue()); + DefInit *DI = cast<DefInit>(NodeToApply->getLeafValue()); const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo(); auto VVT = getValueTypeByHwMode(DI->getDef(), T.getHwModes()); TypeSetByHwMode TypeListTmp(VVT); @@ -3832,7 +3832,7 @@ void CodeGenDAGPatterns::parseInstructionPattern( InstInputs.erase(OpName); // It occurred, remove from map. if (InVal->isLeaf() && isa<DefInit>(InVal->getLeafValue())) { - Record *InRec = static_cast<DefInit*>(InVal->getLeafValue())->getDef(); + Record *InRec = cast<DefInit>(InVal->getLeafValue())->getDef(); if (!checkOperandClass(Op, InRec)) I.error("Operand $" + OpName + "'s register class disagrees" " between the operand and pattern"); |