diff options
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 7cb5a37ed6..2bf0e13baf 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -256,18 +256,14 @@ void *JIT::getPointerToFunction(Function *F) { return Addr; // Check if function already code gen'd // Make sure we read in the function if it exists in this Module - if (F->hasNotBeenReadFromBytecode()) - try { - MP->materializeFunction(F); - } catch ( std::string& errmsg ) { + if (F->hasNotBeenReadFromBytecode()) { + std::string ErrorMsg; + if (MP->materializeFunction(F, &ErrorMsg)) { std::cerr << "Error reading function '" << F->getName() - << "' from bytecode file: " << errmsg << "\n"; - abort(); - } catch (...) { - std::cerr << "Error reading function '" << F->getName() - << "from bytecode file!\n"; + << "' from bytecode file: " << ErrorMsg << "\n"; abort(); } + } if (F->isExternal()) { void *Addr = getPointerToNamedFunction(F->getName()); |