Use uint8_t and int32_t in {JIT,Machine}CodeEmiters
[oota-llvm.git] / lib / ExecutionEngine / ExecutionEngineBindings.cpp
index 4521d9b1b28d2146711e9999f32eaecc910323ef..83397a586d5372b475959a9771e682eab68f4951 100644 (file)
@@ -104,7 +104,7 @@ int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
                           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;
   }
@@ -114,9 +114,12 @@ int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
 
 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;
   }
@@ -192,3 +195,12 @@ int LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
 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));
+}