char **OutError) {
std::string Error;
if (ExecutionEngine *Interp =
- ExecutionEngine::create(unwrap(MP), false, &Error)) {
+ ExecutionEngine::create(unwrap(MP), true, &Error)) {
*OutInterp = wrap(Interp);
return 0;
}
int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
LLVMModuleProviderRef MP,
+ unsigned OptLevel,
char **OutError) {
std::string Error;
- if (ExecutionEngine *JIT = ExecutionEngine::createJIT(unwrap(MP), &Error)) {
+ if (ExecutionEngine *JIT =
+ ExecutionEngine::createJIT(unwrap(MP), &Error, 0,
+ (CodeGenOpt::Level)OptLevel)) {
*OutJIT = wrap(JIT);
return 0;
}
LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE) {
return wrap(unwrap(EE)->getTargetData());
}
+
+void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+ void* Addr) {
+ unwrap(EE)->addGlobalMapping(unwrap<GlobalValue>(Global), Addr);
+}
+
+void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global) {
+ return unwrap(EE)->getPointerToGlobal(unwrap<GlobalValue>(Global));
+}