summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/llc/llc.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 51ce3c0f2bf..6d24204b193 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -411,18 +411,19 @@ static int compileModule(char **argv, LLVMContext &Context) {
errs() << argv[0] << ": run-pass needs a .mir input.\n";
return 1;
}
+ LLVMTargetMachine &LLVMTM = static_cast<LLVMTargetMachine&>(*Target);
+ TargetPassConfig *TPC = LLVMTM.createPassConfig(PM);
+ PM.add(TPC);
+ LLVMTM.addMachineModuleInfo(PM);
+ LLVMTM.addMachineFunctionAnalysis(PM, MIR.get());
+ TPC->printAndVerify("");
+
for (std::string &RunPassName : *RunPassNames) {
const PassInfo *PI = PR->getPassInfo(RunPassName);
if (!PI) {
errs() << argv[0] << ": run-pass " << RunPassName << " is not registered.\n";
return 1;
}
- LLVMTargetMachine &LLVMTM = static_cast<LLVMTargetMachine&>(*Target);
- TargetPassConfig *TPC = LLVMTM.createPassConfig(PM);
- PM.add(TPC);
- LLVMTM.addMachineModuleInfo(PM);
- LLVMTM.addMachineFunctionAnalysis(PM, MIR.get());
- TPC->printAndVerify("");
Pass *P;
if (PI->getTargetMachineCtor())
OpenPOWER on IntegriCloud