From 603682ad1d5f422b5565b8d29cd08bb28f8a8edb Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 3 Mar 2007 18:19:18 +0000 Subject: Deal with error handling better. llvm-svn: 34887 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp') diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index ca077fcef05..92e0020ca8f 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -45,6 +45,7 @@ ExecutionEngine::ExecutionEngine(Module *M) { } ExecutionEngine::~ExecutionEngine() { + clearAllGlobalMappings(); for (unsigned i = 0, e = Modules.size(); i != e; ++i) delete Modules[i]; } @@ -252,16 +253,17 @@ int ExecutionEngine::runFunctionAsMain(Function *Fn, /// NULL is returned. /// ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP, - bool ForceInterpreter) { + bool ForceInterpreter, + std::string *ErrorStr) { ExecutionEngine *EE = 0; // Unless the interpreter was explicitly selected, try making a JIT. if (!ForceInterpreter && JITCtor) - EE = JITCtor(MP); + EE = JITCtor(MP, ErrorStr); // If we can't make a JIT, make an interpreter instead. if (EE == 0 && InterpCtor) - EE = InterpCtor(MP); + EE = InterpCtor(MP, ErrorStr); if (EE) { // Make sure we can resolve symbols in the program as well. The zero arg -- cgit v1.2.3