1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Teach the regular pass manager how to materialize functions as needed.

llvm-svn: 103493
This commit is contained in:
Dan Gohman 2010-05-11 19:58:43 +00:00
parent 5f389dacab
commit 4c44e690d7

View File

@ -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;
}