mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Deal with error handling better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user