diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-03 18:19:18 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-03 18:19:18 +0000 |
| commit | 603682ad1d5f422b5565b8d29cd08bb28f8a8edb (patch) | |
| tree | d1cd766ae01d3e2512e4b934108046621e1e590f /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
| parent | 30ed3bdaf21b4928bb2d73a3cd176dc679c9d796 (diff) | |
| download | bcm5719-llvm-603682ad1d5f422b5565b8d29cd08bb28f8a8edb.tar.gz bcm5719-llvm-603682ad1d5f422b5565b8d29cd08bb28f8a8edb.zip | |
Deal with error handling better.
llvm-svn: 34887
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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 |

