//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Gordon Henriksen and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "llvm-c/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include <cstring>
using namespace llvm;
assert(0 && "LLVMGenericValueToFloat supports only float and double.");
break;
}
+ return 0; // Not reached
}
void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal) {
LLVMModuleProviderRef MP,
char **OutError) {
std::string Error;
- if (ExecutionEngine *Interp = ExecutionEngine::create(unwrap(MP), &Error)) {
+ if (ExecutionEngine *Interp =
+ ExecutionEngine::create(unwrap(MP), true, &Error)) {
*OutInterp = wrap(Interp);
return 0;
}
}
return 1;
}
+
+LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE) {
+ return wrap(unwrap(EE)->getTargetData());
+}
+
+void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+ void* Addr) {
+ unwrap(EE)->addGlobalMapping(unwrap<GlobalValue>(Global), Addr);
+}