Adapt to new interface function materialization interface
authorChris Lattner <sabre@nondot.org>
Fri, 7 Jul 2006 17:18:09 +0000 (17:18 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Jul 2006 17:18:09 +0000 (17:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29051 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JIT.cpp

index 7cb5a37ed67fd3f09ead384a71b1c6bc2044641d..2bf0e13baf4a65ce07c43b11c0dddc2653afc463 100644 (file)
@@ -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());