Skip to content

Commit 64591f2

Browse files
committed
[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.
1 parent 37ca7a7 commit 64591f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/utils/TableGen/CodeGenDAGPatterns.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1632,12 +1632,12 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
16321632
// have an integer type that is smaller than the VT.
16331633
if (!NodeToApply->isLeaf() ||
16341634
!isa<DefInit>(NodeToApply->getLeafValue()) ||
1635-
!static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()
1635+
!cast<DefInit>(NodeToApply->getLeafValue())->getDef()
16361636
->isSubClassOf("ValueType")) {
16371637
TP.error(N->getOperator()->getName() + " expects a VT operand!");
16381638
return false;
16391639
}
1640-
DefInit *DI = static_cast<DefInit*>(NodeToApply->getLeafValue());
1640+
DefInit *DI = cast<DefInit>(NodeToApply->getLeafValue());
16411641
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
16421642
auto VVT = getValueTypeByHwMode(DI->getDef(), T.getHwModes());
16431643
TypeSetByHwMode TypeListTmp(VVT);
@@ -3832,7 +3832,7 @@ void CodeGenDAGPatterns::parseInstructionPattern(
38323832
InstInputs.erase(OpName); // It occurred, remove from map.
38333833

38343834
if (InVal->isLeaf() && isa<DefInit>(InVal->getLeafValue())) {
3835-
Record *InRec = static_cast<DefInit*>(InVal->getLeafValue())->getDef();
3835+
Record *InRec = cast<DefInit>(InVal->getLeafValue())->getDef();
38363836
if (!checkOperandClass(Op, InRec))
38373837
I.error("Operand $" + OpName + "'s register class disagrees"
38383838
" between the operand and pattern");

0 commit comments

Comments
 (0)