mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-24 23:22:10 +00:00
[llc] Do not create the pass config several times for run-pass.
Thanks to Matthias Braun for spotting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aef5f640f7
commit
7f8e1c60de
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user