mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Use cast instead of dyn_cast when assuming success.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101636 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d858e90f03
commit
b6f778a8f6
@ -301,7 +301,7 @@ namespace {
|
||||
std::vector<Constant*> CV;
|
||||
|
||||
for (size_t i = 0; i < bvNode->getNumOperands(); ++i) {
|
||||
ConstantSDNode *V = dyn_cast<ConstantSDNode > (bvNode->getOperand(i));
|
||||
ConstantSDNode *V = cast<ConstantSDNode > (bvNode->getOperand(i));
|
||||
CV.push_back(const_cast<ConstantInt *>(V->getConstantIntValue()));
|
||||
}
|
||||
|
||||
@ -505,7 +505,7 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
|
||||
|
||||
if (Opc == ISD::FrameIndex) {
|
||||
// Stack frame index must be less than 512 (divided by 16):
|
||||
FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(N);
|
||||
FrameIndexSDNode *FIN = cast<FrameIndexSDNode>(N);
|
||||
int FI = int(FIN->getIndex());
|
||||
DEBUG(errs() << "SelectDFormAddr: ISD::FrameIndex = "
|
||||
<< FI << "\n");
|
||||
@ -526,11 +526,11 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
|
||||
return true;
|
||||
} else if (Op1.getOpcode() == ISD::Constant
|
||||
|| Op1.getOpcode() == ISD::TargetConstant) {
|
||||
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op1);
|
||||
ConstantSDNode *CN = cast<ConstantSDNode>(Op1);
|
||||
int32_t offset = int32_t(CN->getSExtValue());
|
||||
|
||||
if (Op0.getOpcode() == ISD::FrameIndex) {
|
||||
FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Op0);
|
||||
FrameIndexSDNode *FIN = cast<FrameIndexSDNode>(Op0);
|
||||
int FI = int(FIN->getIndex());
|
||||
DEBUG(errs() << "SelectDFormAddr: ISD::ADD offset = " << offset
|
||||
<< " frame index = " << FI << "\n");
|
||||
@ -547,11 +547,11 @@ SPUDAGToDAGISel::DFormAddressPredicate(SDNode *Op, SDValue N, SDValue &Base,
|
||||
}
|
||||
} else if (Op0.getOpcode() == ISD::Constant
|
||||
|| Op0.getOpcode() == ISD::TargetConstant) {
|
||||
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op0);
|
||||
ConstantSDNode *CN = cast<ConstantSDNode>(Op0);
|
||||
int32_t offset = int32_t(CN->getSExtValue());
|
||||
|
||||
if (Op1.getOpcode() == ISD::FrameIndex) {
|
||||
FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Op1);
|
||||
FrameIndexSDNode *FIN = cast<FrameIndexSDNode>(Op1);
|
||||
int FI = int(FIN->getIndex());
|
||||
DEBUG(errs() << "SelectDFormAddr: ISD::ADD offset = " << offset
|
||||
<< " frame index = " << FI << "\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user