mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Replace some uses of getSubtargetImpl with the cached version
off of the MachineFunction or with the version that takes a Function reference as an argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227185 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
df01caffa4
commit
ad5a857bc5
5 files changed
+8
-9
No files matched your search
@@ -600,8 +600,7 @@ MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
|
|||||||
assert(MBB && "MBB must be valid");
|
assert(MBB && "MBB must be valid");
|
||||||
const MachineFunction *MF = MBB->getParent();
|
const MachineFunction *MF = MBB->getParent();
|
||||||
assert(MF && "MBB must be part of a MachineFunction");
|
assert(MF && "MBB must be part of a MachineFunction");
|
||||||
const TargetMachine &TM = MF->getTarget();
|
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
|
||||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
|
||||||
BitVector BV(TRI->getNumRegs());
|
BitVector BV(TRI->getNumRegs());
|
||||||
|
|
||||||
// Before CSI is calculated, no registers are considered pristine. They can be
|
// Before CSI is calculated, no registers are considered pristine. They can be
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ static cl::opt<bool> StressSchedOpt(
|
|||||||
void SchedulingPriorityQueue::anchor() { }
|
void SchedulingPriorityQueue::anchor() { }
|
||||||
|
|
||||||
ScheduleDAG::ScheduleDAG(MachineFunction &mf)
|
ScheduleDAG::ScheduleDAG(MachineFunction &mf)
|
||||||
: TM(mf.getTarget()), TII(TM.getSubtargetImpl()->getInstrInfo()),
|
: TM(mf.getTarget()), TII(mf.getSubtarget().getInstrInfo()),
|
||||||
TRI(TM.getSubtargetImpl()->getRegisterInfo()), MF(mf),
|
TRI(mf.getSubtarget().getRegisterInfo()), MF(mf),
|
||||||
MRI(mf.getRegInfo()), EntrySU(), ExitSU() {
|
MRI(mf.getRegInfo()), EntrySU(), ExitSU() {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
StressSched = StressSchedOpt;
|
StressSched = StressSchedOpt;
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ Value *SjLjEHPrepare::setupFunctionContext(Function &F,
|
|||||||
// Create an alloca for the incoming jump buffer ptr and the new jump buffer
|
// Create an alloca for the incoming jump buffer ptr and the new jump buffer
|
||||||
// that needs to be restored on all exits from the function. This is an alloca
|
// that needs to be restored on all exits from the function. This is an alloca
|
||||||
// because the value needs to be added to the global context list.
|
// because the value needs to be added to the global context list.
|
||||||
const TargetLowering *TLI = TM->getSubtargetImpl()->getTargetLowering();
|
const TargetLowering *TLI = TM->getSubtargetImpl(F)->getTargetLowering();
|
||||||
unsigned Align =
|
unsigned Align =
|
||||||
TLI->getDataLayout()->getPrefTypeAlignment(FunctionContextTy);
|
TLI->getDataLayout()->getPrefTypeAlignment(FunctionContextTy);
|
||||||
FuncCtx = new AllocaInst(FunctionContextTy, nullptr, Align, "fn_context",
|
FuncCtx = new AllocaInst(FunctionContextTy, nullptr, Align, "fn_context",
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ bool StackProtector::runOnFunction(Function &Fn) {
|
|||||||
DominatorTreeWrapperPass *DTWP =
|
DominatorTreeWrapperPass *DTWP =
|
||||||
getAnalysisIfAvailable<DominatorTreeWrapperPass>();
|
getAnalysisIfAvailable<DominatorTreeWrapperPass>();
|
||||||
DT = DTWP ? &DTWP->getDomTree() : nullptr;
|
DT = DTWP ? &DTWP->getDomTree() : nullptr;
|
||||||
TLI = TM->getSubtargetImpl()->getTargetLowering();
|
TLI = TM->getSubtargetImpl(Fn)->getTargetLowering();
|
||||||
|
|
||||||
Attribute Attr = Fn.getAttributes().getAttribute(
|
Attribute Attr = Fn.getAttributes().getAttribute(
|
||||||
AttributeSet::FunctionIndex, "stack-protector-buffer-size");
|
AttributeSet::FunctionIndex, "stack-protector-buffer-size");
|
||||||
|
|||||||
@@ -1515,9 +1515,9 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &Func) {
|
|||||||
MF = &Func;
|
MF = &Func;
|
||||||
const TargetMachine &TM = MF->getTarget();
|
const TargetMachine &TM = MF->getTarget();
|
||||||
MRI = &MF->getRegInfo();
|
MRI = &MF->getRegInfo();
|
||||||
TII = TM.getSubtargetImpl()->getInstrInfo();
|
TII = MF->getSubtarget().getInstrInfo();
|
||||||
TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
TRI = MF->getSubtarget().getRegisterInfo();
|
||||||
InstrItins = TM.getSubtargetImpl()->getInstrItineraryData();
|
InstrItins = MF->getSubtarget().getInstrItineraryData();
|
||||||
LV = getAnalysisIfAvailable<LiveVariables>();
|
LV = getAnalysisIfAvailable<LiveVariables>();
|
||||||
LIS = getAnalysisIfAvailable<LiveIntervals>();
|
LIS = getAnalysisIfAvailable<LiveIntervals>();
|
||||||
AA = &getAnalysis<AliasAnalysis>();
|
AA = &getAnalysis<AliasAnalysis>();
|
||||||
|
|||||||
Reference in new issue
Block a user