mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 20:33:15 +00:00
Teach the regular pass manager how to materialize functions as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99dca4fde7
commit
124b55dded
@ -1444,8 +1444,16 @@ bool FPPassManager::runOnFunction(Function &F) {
|
||||
bool FPPassManager::runOnModule(Module &M) {
|
||||
bool Changed = doInitialization(M);
|
||||
|
||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
|
||||
Function &F = *I;
|
||||
if (F.isMaterializable()) {
|
||||
std::string errstr;
|
||||
if (F.Materialize(&errstr))
|
||||
report_fatal_error("Error reading bitcode file: " + Twine(errstr));
|
||||
}
|
||||
|
||||
runOnFunction(*I);
|
||||
}
|
||||
|
||||
return doFinalization(M) || Changed;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user