#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;
}
int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
LLVMModuleProviderRef MP,
+ int Fast,
char **OutError) {
std::string Error;
- if (ExecutionEngine *JIT = ExecutionEngine::createJIT(unwrap(MP), &Error)) {
+ if (ExecutionEngine *JIT = ExecutionEngine::createJIT(unwrap(MP), &Error, 0,
+ Fast != 0)) {
*OutJIT = wrap(JIT);
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);
+}