mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230037 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -57,7 +57,6 @@ public:
|
|||||||
/// in the machine code. It inserts labels at safe points and populates a
|
/// in the machine code. It inserts labels at safe points and populates a
|
||||||
/// GCMetadata record for each function.
|
/// GCMetadata record for each function.
|
||||||
class GCMachineCodeAnalysis : public MachineFunctionPass {
|
class GCMachineCodeAnalysis : public MachineFunctionPass {
|
||||||
const TargetMachine *TM;
|
|
||||||
GCFunctionInfo *FI;
|
GCFunctionInfo *FI;
|
||||||
MachineModuleInfo *MMI;
|
MachineModuleInfo *MMI;
|
||||||
const TargetInstrInfo *TII;
|
const TargetInstrInfo *TII;
|
||||||
@@ -312,7 +311,7 @@ void GCMachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) {
|
void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) {
|
||||||
const TargetFrameLowering *TFI = TM->getSubtargetImpl()->getFrameLowering();
|
const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
|
||||||
assert(TFI && "TargetRegisterInfo not available!");
|
assert(TFI && "TargetRegisterInfo not available!");
|
||||||
|
|
||||||
for (GCFunctionInfo::roots_iterator RI = FI->roots_begin();
|
for (GCFunctionInfo::roots_iterator RI = FI->roots_begin();
|
||||||
@@ -336,9 +335,8 @@ bool GCMachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
if (!FI->getStrategy().needsSafePoints())
|
if (!FI->getStrategy().needsSafePoints())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TM = &MF.getTarget();
|
|
||||||
MMI = &getAnalysis<MachineModuleInfo>();
|
MMI = &getAnalysis<MachineModuleInfo>();
|
||||||
TII = TM->getSubtargetImpl()->getInstrInfo();
|
TII = MF.getSubtarget().getInstrInfo();
|
||||||
|
|
||||||
// Find the size of the stack frame.
|
// Find the size of the stack frame.
|
||||||
FI->setFrameSize(MF.getFrameInfo()->getStackSize());
|
FI->setFrameSize(MF.getFrameInfo()->getStackSize());
|
||||||
|
@@ -46,14 +46,13 @@ namespace {
|
|||||||
initializePPCTLSDynamicCallPass(*PassRegistry::getPassRegistry());
|
initializePPCTLSDynamicCallPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
|
|
||||||
const PPCTargetMachine *TM;
|
|
||||||
const PPCInstrInfo *TII;
|
const PPCInstrInfo *TII;
|
||||||
LiveIntervals *LIS;
|
LiveIntervals *LIS;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool processBlock(MachineBasicBlock &MBB) {
|
bool processBlock(MachineBasicBlock &MBB) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
bool Is64Bit = TM->getSubtargetImpl()->isPPC64();
|
bool Is64Bit = MBB.getParent()->getSubtarget<PPCSubtarget>().isPPC64();
|
||||||
|
|
||||||
for (MachineBasicBlock::iterator I = MBB.begin(), IE = MBB.end();
|
for (MachineBasicBlock::iterator I = MBB.begin(), IE = MBB.end();
|
||||||
I != IE; ++I) {
|
I != IE; ++I) {
|
||||||
@@ -133,8 +132,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool runOnMachineFunction(MachineFunction &MF) override {
|
bool runOnMachineFunction(MachineFunction &MF) override {
|
||||||
TM = static_cast<const PPCTargetMachine *>(&MF.getTarget());
|
TII = MF.getSubtarget<PPCSubtarget>().getInstrInfo();
|
||||||
TII = TM->getSubtargetImpl()->getInstrInfo();
|
|
||||||
LIS = &getAnalysis<LiveIntervals>();
|
LIS = &getAnalysis<LiveIntervals>();
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
Reference in New Issue
Block a user