mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Using addPassesToEmitWholeFile is not a good idea here.
Use FunctionPassManager to do the job. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30160 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
76ed7b1cf5
commit
998051a221
@ -282,11 +282,24 @@ static enum LTOStatus lto_optimize(Module *M, std::ostream &Out,
|
||||
// Make sure everything is still good.
|
||||
Passes.add(createVerifierPass());
|
||||
|
||||
Target.addPassesToEmitWholeFile(Passes, Out, TargetMachine::AssemblyFile, true);
|
||||
FunctionPassManager *CodeGenPasses =
|
||||
new FunctionPassManager(new ExistingModuleProvider(M));
|
||||
|
||||
CodeGenPasses->add(new TargetData(*Target.getTargetData()));
|
||||
Target.addPassesToEmitFile(*CodeGenPasses, Out, TargetMachine::AssemblyFile,
|
||||
true);
|
||||
|
||||
// Run our queue of passes all at once now, efficiently.
|
||||
Passes.run(*M);
|
||||
|
||||
// Run the code generator, if present.
|
||||
CodeGenPasses->doInitialization();
|
||||
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
||||
if (!I->isExternal())
|
||||
CodeGenPasses->run(*I);
|
||||
}
|
||||
CodeGenPasses->doFinalization();
|
||||
|
||||
return LTO_OPT_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user