diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-07 21:01:38 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-07 21:01:38 +0000 |
commit | e2947531280503a4e73e8d94a6161f68bea857a7 (patch) | |
tree | 4d3327ef434cd56b62be4cdfc3973a566b6a45e2 /lib/VMCore/Pass.cpp | |
parent | 2834a4dd1d947461f53df000e2fba65cf99ba63c (diff) | |
download | external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.zip external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.tar.gz external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.tar.bz2 |
Fix for bug 391.
Improve exeception handling around bcreader invocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 8881329..b37b460 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -92,7 +92,15 @@ FunctionPassManager::~FunctionPassManager() { delete PM; } void FunctionPassManager::add(FunctionPass *P) { PM->add(P); } void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); } bool FunctionPassManager::run(Function &F) { - MP->materializeFunction(&F); + try { + MP->materializeFunction(&F); + } catch (std::string& errstr) { + std::cerr << "Error reading bytecode file: " << errstr << "\n"; + abort(); + } catch (...) { + std::cerr << "Error reading bytecode file:\n"; + abort(); + } return PM->run(F); } |