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 | c638088d6f2739f2766801542e81d300e4f59f8f (patch) | |
tree | 6cc090b4dae7ca7bfb09f1e8ee8d67ccec29c264 /lib/VMCore | |
parent | 936c43bb239858d7c4ee617e83fd222c1681ab4e (diff) | |
download | external_llvm-c638088d6f2739f2766801542e81d300e4f59f8f.zip external_llvm-c638088d6f2739f2766801542e81d300e4f59f8f.tar.gz external_llvm-c638088d6f2739f2766801542e81d300e4f59f8f.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index a1d554e..8a3527e 100644 --- a/lib/VMCore/PassManager.cpp +++ b/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); } |