OSDN Git Service

llvm-c: Add LLVMGetPointerToFunction
authorAnders Waldenborg <anders@0x63.nu>
Thu, 19 Sep 2013 19:55:06 +0000 (19:55 +0000)
committerAnders Waldenborg <anders@0x63.nu>
Thu, 19 Sep 2013 19:55:06 +0000 (19:55 +0000)
Differential Revision: http://llvm-reviews.chandlerc.com/D1715

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191030 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/ExecutionEngine.h
lib/ExecutionEngine/ExecutionEngineBindings.cpp

index 50fdb6b..696d871 100644 (file)
@@ -141,6 +141,8 @@ LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
                                     unsigned NumArgs,
                                     LLVMGenericValueRef *Args);
 
+void *LLVMGetPointerToFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
+
 void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
 
 void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M);
index 88e73bf..f7abf95 100644 (file)
@@ -276,6 +276,10 @@ LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
   return wrap(Result);
 }
 
+void *LLVMGetPointerToFunction(LLVMExecutionEngineRef EE, LLVMValueRef F) {
+  return unwrap(EE)->getPointerToFunction(unwrap<Function>(F));
+}
+
 void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F) {
   unwrap(EE)->freeMachineCodeForFunction(unwrap<Function>(F));
 }