Use use_empty() instead of getNumUses(), avoiding a use list traversal.
[oota-llvm.git] / lib / ExecutionEngine / ExecutionEngineBindings.cpp
index 4dc0add06990ccbeba2350e58e04c3899f0669b6..54340fba9aa17fd24edce08105cee344f8731e88 100644 (file)
@@ -78,6 +78,7 @@ double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal) {
     assert(0 && "LLVMGenericValueToFloat supports only float and double.");
     break;
   }
+  return 0; // Not reached
 }
 
 void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal) {
@@ -103,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;
   }
@@ -191,3 +192,8 @@ 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);
+}