diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2010-02-15 21:27:56 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2010-02-15 21:27:56 +0000 |
| commit | 94e168f09e948493f2ce029a4435fdb4592734ea (patch) | |
| tree | a59f21497529df8979bf4354b5b3b9715825fa8f /llvm/lib | |
| parent | 780d2fe31929c597af6f41cd06dad75241c38ddf (diff) | |
| download | bcm5719-llvm-94e168f09e948493f2ce029a4435fdb4592734ea.tar.gz bcm5719-llvm-94e168f09e948493f2ce029a4435fdb4592734ea.zip | |
Don't try to materialize a function that isn't materializable anyways. This
fixes a crash using FPM on a Function that isn't owned by a Module.
llvm-svn: 96273
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index a1d554e4ff8..8a3527ea52a 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -1220,9 +1220,11 @@ void FunctionPassManager::add(Pass *P) { /// so, return true. /// bool FunctionPassManager::run(Function &F) { - std::string errstr; - if (F.Materialize(&errstr)) { - llvm_report_error("Error reading bitcode file: " + errstr); + if (F.isMaterializable()) { + std::string errstr; + if (F.Materialize(&errstr)) { + llvm_report_error("Error reading bitcode file: " + errstr); + } } return FPM->run(F); } |

