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
This commit is contained in:
Reid Spencer 2004-07-07 21:01:38 +00:00
parent 2834a4dd1d
commit e294753128
3 changed files with 14 additions and 1 deletions

View File

@ -137,6 +137,8 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
} catch (...) {
std::cerr << "Error creating the interpreter!\n";
}
} catch (std::string& errmsg) {
std::cerr << "Error reading the bytecode file: " << errmsg << "\n";
} catch (...) {
std::cerr << "Error reading the bytecode file!\n";
}

View File

@ -117,6 +117,9 @@ void *JIT::getPointerToFunction(Function *F) {
// Make sure we read in the function if it exists in this Module
try {
MP->materializeFunction(F);
} catch ( std::string& errmsg ) {
std::cerr << "Error parsing bytecode file: " << errmsg << "\n";
abort();
} catch (...) {
std::cerr << "Error parsing bytecode file!\n";
abort();

View File

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