mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-02 23:26:31 +00:00
Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -33,7 +33,7 @@ class SparcDAGToDAGISel : public SelectionDAGISel {
|
||||
/// Subtarget - Keep a pointer to the Sparc Subtarget around so that we can
|
||||
/// make the right decision when generating code for different targets.
|
||||
const SparcSubtarget &Subtarget;
|
||||
SparcTargetMachine& TM;
|
||||
SparcTargetMachine &TM;
|
||||
public:
|
||||
explicit SparcDAGToDAGISel(SparcTargetMachine &tm)
|
||||
: SelectionDAGISel(tm),
|
||||
@@ -67,13 +67,15 @@ private:
|
||||
|
||||
SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
|
||||
unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF);
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI->getPointerTy()).getNode();
|
||||
return CurDAG->getRegister(GlobalBaseReg,
|
||||
getTargetLowering()->getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||
SDValue &Base, SDValue &Offset) {
|
||||
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), TLI->getPointerTy());
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
|
||||
getTargetLowering()->getPointerTy());
|
||||
Offset = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
}
|
||||
@@ -88,7 +90,7 @@ bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||
dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
|
||||
// Constant offset from frame ref.
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
|
||||
TLI->getPointerTy());
|
||||
getTargetLowering()->getPointerTy());
|
||||
} else {
|
||||
Base = Addr.getOperand(0);
|
||||
}
|
||||
@@ -131,7 +133,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
||||
}
|
||||
|
||||
R1 = Addr;
|
||||
R2 = CurDAG->getRegister(SP::G0, TLI->getPointerTy());
|
||||
R2 = CurDAG->getRegister(SP::G0, getTargetLowering()->getPointerTy());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user