diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-11 19:58:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-11 19:58:43 +0000 |
commit | 124b55ddedb46d087c261f8ef84d2382a399315b (patch) | |
tree | 3486a797e05d25bcba99ca476d369c9bfae701e9 /lib/VMCore | |
parent | 99dca4fde746eb76253e737cca166261c767412d (diff) | |
download | external_llvm-124b55ddedb46d087c261f8ef84d2382a399315b.zip external_llvm-124b55ddedb46d087c261f8ef84d2382a399315b.tar.gz external_llvm-124b55ddedb46d087c261f8ef84d2382a399315b.tar.bz2 |
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index a56938c..6883e9f 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -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; } |