mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
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:
parent
2834a4dd1d
commit
e294753128
@ -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";
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user