diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-06-19 20:51:24 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-06-19 20:51:24 +0000 |
commit | ea44281d5da5096de50ce1cb358ff0c6f20e1a2a (patch) | |
tree | e5921b602a2747efb334a9b13b94d5f090c779fb /lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 2e1dc2d2650c64f8fa57d12eb194dcf57e85ebb7 (diff) | |
download | llvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.gz llvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.bz2 llvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.xz |
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@184349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index ca06bc5a0c..6c9b2e57f3 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -83,7 +83,7 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T, StringRef Triple, } void LLVMTargetMachine::addAnalysisPasses(PassManagerBase &PM) { - PM.add(createBasicTargetTransformInfoPass(getTargetLowering())); + PM.add(createBasicTargetTransformInfoPass(this)); } /// addPassesToX helper drives creation and initialization of TargetPassConfig. @@ -115,7 +115,6 @@ static MCContext *addPassesToGenerateCode(LLVMTargetMachine *TM, new MachineModuleInfo(*TM->getMCAsmInfo(), *TM->getRegisterInfo(), &TM->getTargetLowering()->getObjFileLowering()); PM.add(MMI); - MCContext *Context = &MMI->getContext(); // Return the MCContext by-ref. // Set up a MachineFunction for the rest of CodeGen to work on. PM.add(new MachineFunctionAnalysis(*TM)); @@ -134,7 +133,7 @@ static MCContext *addPassesToGenerateCode(LLVMTargetMachine *TM, PassConfig->setInitialized(); - return Context; + return &MMI->getContext(); } bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, |