summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-08-23 05:17:11 +0000
committerMatthias Braun <matze@braunis.de>2016-08-23 05:17:11 +0000
commit7f66202d38148a7c5b1cf6723de9d442f5566e46 (patch)
tree286a6404f2a0fcd2d8842ed5ab363c42857bc854 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parentfd936841ebefb39a383fe651126998f6728efcbc (diff)
downloadbcm5719-llvm-7f66202d38148a7c5b1cf6723de9d442f5566e46.tar.gz
bcm5719-llvm-7f66202d38148a7c5b1cf6723de9d442f5566e46.zip
Revert "(HEAD -> master, origin/master, origin/HEAD) CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses"
Reverting while tracking down a use after free. This reverts commit r279502. llvm-svn: 279503
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index e5678ba5585..9ed61c6685b 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -15,6 +15,7 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/BasicTTIImpl.h"
+#include "llvm/CodeGen/MachineFunctionAnalysis.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
@@ -102,15 +103,19 @@ TargetIRAnalysis LLVMTargetMachine::getTargetIRAnalysis() {
}
MachineModuleInfo &
-LLVMTargetMachine::addMachineModuleInfo(PassManagerBase &PM,
- MachineFunctionInitializer *MFI) const {
- MachineModuleInfo *MMI = new MachineModuleInfo(*this, *getMCAsmInfo(),
+LLVMTargetMachine::addMachineModuleInfo(PassManagerBase &PM) const {
+ MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo(),
*getMCRegisterInfo(),
- getObjFileLowering(), MFI);
+ getObjFileLowering());
PM.add(MMI);
return *MMI;
}
+void LLVMTargetMachine::addMachineFunctionAnalysis(PassManagerBase &PM,
+ MachineFunctionInitializer *MFInitializer) const {
+ PM.add(new MachineFunctionAnalysis(*this, MFInitializer));
+}
+
/// addPassesToX helper drives creation and initialization of TargetPassConfig.
static MCContext *
addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,
@@ -145,7 +150,8 @@ addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,
PassConfig->addISelPrepare();
- MachineModuleInfo &MMI = TM->addMachineModuleInfo(PM, MFInitializer);
+ MachineModuleInfo &MMI = TM->addMachineModuleInfo(PM);
+ TM->addMachineFunctionAnalysis(PM, MFInitializer);
// Enable FastISel with -fast, but allow that to be overridden.
TM->setO0WantsFastISel(EnableFastISelOption != cl::BOU_FALSE);
OpenPOWER on IntegriCloud