summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GCRootLowering.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-02-20 18:44:15 +0000
committerEric Christopher <echristo@gmail.com>2015-02-20 18:44:15 +0000
commit1df0c519fc3576519f35427a3b8763fd3a210a35 (patch)
tree933183ca6cd5ecbea84281ef949869b8a0cdb442 /llvm/lib/CodeGen/GCRootLowering.cpp
parent7a9e76216b4ce12ce29135cd851fb5f22f77fe22 (diff)
downloadbcm5719-llvm-1df0c519fc3576519f35427a3b8763fd3a210a35.tar.gz
bcm5719-llvm-1df0c519fc3576519f35427a3b8763fd3a210a35.zip
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine. llvm-svn: 230037
Diffstat (limited to 'llvm/lib/CodeGen/GCRootLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/GCRootLowering.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/GCRootLowering.cpp b/llvm/lib/CodeGen/GCRootLowering.cpp
index d69bb0ff805..9d38e4cad13 100644
--- a/llvm/lib/CodeGen/GCRootLowering.cpp
+++ b/llvm/lib/CodeGen/GCRootLowering.cpp
@@ -57,7 +57,6 @@ public:
/// in the machine code. It inserts labels at safe points and populates a
/// GCMetadata record for each function.
class GCMachineCodeAnalysis : public MachineFunctionPass {
- const TargetMachine *TM;
GCFunctionInfo *FI;
MachineModuleInfo *MMI;
const TargetInstrInfo *TII;
@@ -312,7 +311,7 @@ void GCMachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
}
void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) {
- const TargetFrameLowering *TFI = TM->getSubtargetImpl()->getFrameLowering();
+ const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
assert(TFI && "TargetRegisterInfo not available!");
for (GCFunctionInfo::roots_iterator RI = FI->roots_begin();
@@ -336,9 +335,8 @@ bool GCMachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) {
if (!FI->getStrategy().needsSafePoints())
return false;
- TM = &MF.getTarget();
MMI = &getAnalysis<MachineModuleInfo>();
- TII = TM->getSubtargetImpl()->getInstrInfo();
+ TII = MF.getSubtarget().getInstrInfo();
// Find the size of the stack frame.
FI->setFrameSize(MF.getFrameInfo()->getStackSize());
OpenPOWER on IntegriCloud