[Bf-blender-cvs] [c1267d9e012] functions: allow passing function pointer name

Jacques Lucke noreply at git.blender.org
Fri May 3 12:43:40 CEST 2019


Commit: c1267d9e012a3040f8c945f48f64c872a9ab4a26
Author: Jacques Lucke
Date:   Fri May 3 12:18:35 2019 +0200
Branches: functions
https://developer.blender.org/rBc1267d9e012a3040f8c945f48f64c872a9ab4a26

allow passing function pointer name

===================================================================

M	source/blender/functions/backends/llvm/builder.cpp
M	source/blender/functions/backends/llvm/builder.hpp

===================================================================

diff --git a/source/blender/functions/backends/llvm/builder.cpp b/source/blender/functions/backends/llvm/builder.cpp
index 106134fb826..1eda0673df9 100644
--- a/source/blender/functions/backends/llvm/builder.cpp
+++ b/source/blender/functions/backends/llvm/builder.cpp
@@ -65,26 +65,29 @@ llvm::Value *CodeBuilder::CreateCallPointer(void *func_ptr,
 
 llvm::Value *CodeBuilder::CreateCallPointer(void *func_ptr,
                                             llvm::FunctionType *ftype,
-                                            const LLVMValues &args)
+                                            const LLVMValues &args,
+                                            const char *function_name)
 {
-  return this->CreateCallPointer(func_ptr, ftype, LLVMValuesRef(args));
+  return this->CreateCallPointer(func_ptr, ftype, LLVMValuesRef(args), function_name);
 }
 
 llvm::Value *CodeBuilder::CreateCallPointer(void *func_ptr,
                                             LLVMValuesRef args,
-                                            llvm::Type *return_type)
+                                            llvm::Type *return_type,
+                                            const char *function_name)
 {
   LLVMTypes arg_types = this->types_of_values(args);
   llvm::FunctionType *ftype = llvm::FunctionType::get(
       return_type, to_llvm_array_ref(arg_types), false);
-  return this->CreateCallPointer(func_ptr, ftype, args);
+  return this->CreateCallPointer(func_ptr, ftype, args, function_name);
 }
 
 llvm::Value *CodeBuilder::CreateCallPointer(void *func_ptr,
                                             const LLVMValues &args,
-                                            llvm::Type *return_type)
+                                            llvm::Type *return_type,
+                                            const char *function_name)
 {
-  return this->CreateCallPointer(func_ptr, LLVMValuesRef(args), return_type);
+  return this->CreateCallPointer(func_ptr, LLVMValuesRef(args), return_type, function_name);
 }
 
 static void simple_print(const char *str)
diff --git a/source/blender/functions/backends/llvm/builder.hpp b/source/blender/functions/backends/llvm/builder.hpp
index ce0e58503dd..a5731ba9147 100644
--- a/source/blender/functions/backends/llvm/builder.hpp
+++ b/source/blender/functions/backends/llvm/builder.hpp
@@ -299,9 +299,16 @@ class CodeBuilder {
                                  const char *function_name = "");
   llvm::Value *CreateCallPointer(void *func_ptr,
                                  llvm::FunctionType *ftype,
-                                 const LLVMValues &args);
-  llvm::Value *CreateCallPointer(void *func_ptr, LLVMValuesRef args, llvm::Type *return_type);
-  llvm::Value *CreateCallPointer(void *func_ptr, const LLVMValues &args, llvm::Type *return_type);
+                                 const LLVMValues &args,
+                                 const char *function_name = "");
+  llvm::Value *CreateCallPointer(void *func_ptr,
+                                 LLVMValuesRef args,
+                                 llvm::Type *return_type,
+                                 const char *function_name = "");
+  llvm::Value *CreateCallPointer(void *func_ptr,
+                                 const LLVMValues &args,
+                                 llvm::Type *return_type,
+                                 const char *function_name = "");
 
   llvm::Value *CreateCall(llvm::Function *function, LLVMValuesRef args)
   {



More information about the Bf-blender-cvs mailing list