Use the cast<> operator in favor of C style casts
authorChris Lattner <sabre@nondot.org>
Sat, 27 Apr 2002 03:14:39 +0000 (03:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 27 Apr 2002 03:14:39 +0000 (03:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2331 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9InstrSelection.cpp

index 9906e5b10910232c666fb37f216dda0b9e1e8db2..cff0a845c2f03051b7e63fa2699ebc60c37e10a2 100644 (file)
@@ -1461,7 +1461,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         M->SetMachineOperandVal(0, MachineOperand::MO_CCRegister,
                                 (Value*) NULL);
         M->SetMachineOperandVal(1, MachineOperand::MO_PCRelativeDisp,
-          ((BranchInst*) subtreeRoot->getInstruction())->getSuccessor(dest));
+          cast<BranchInst>(subtreeRoot->getInstruction())->getSuccessor(dest));
         mvec.push_back(M);
         
         // delay slot
@@ -1477,7 +1477,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister,
                                       subtreeRoot->leftChild()->getValue());
         M->SetMachineOperandVal(1, MachineOperand::MO_PCRelativeDisp,
-              ((BranchInst*) subtreeRoot->getInstruction())->getSuccessor(0));
+              cast<BranchInst>(subtreeRoot->getInstruction())->getSuccessor(0));
         mvec.push_back(M);
 
         // delay slot
@@ -1488,7 +1488,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         M->SetMachineOperandVal(0, MachineOperand::MO_CCRegister,
                                 (Value*) NULL);
         M->SetMachineOperandVal(1, MachineOperand::MO_PCRelativeDisp,
-              ((BranchInst*) subtreeRoot->getInstruction())->getSuccessor(1));
+              cast<BranchInst>(subtreeRoot->getInstruction())->getSuccessor(1));
         mvec.push_back(M);
         
         // delay slot