[Bf-blender-cvs] [8f5e6cf0872] functions: destruct tuple in wrapper
Jacques Lucke
noreply at git.blender.org
Tue Mar 5 16:47:32 CET 2019
Commit: 8f5e6cf08726007cde4612cc5458bbfd0ab6fdbf
Author: Jacques Lucke
Date: Tue Mar 5 13:48:00 2019 +0100
Branches: functions
https://developer.blender.org/rB8f5e6cf08726007cde4612cc5458bbfd0ab6fdbf
destruct tuple in wrapper
===================================================================
M source/blender/functions/backends/llvm/ir_for_tuple_call.cpp
===================================================================
diff --git a/source/blender/functions/backends/llvm/ir_for_tuple_call.cpp b/source/blender/functions/backends/llvm/ir_for_tuple_call.cpp
index 7db6941a379..09e1877eb5d 100644
--- a/source/blender/functions/backends/llvm/ir_for_tuple_call.cpp
+++ b/source/blender/functions/backends/llvm/ir_for_tuple_call.cpp
@@ -25,6 +25,12 @@ namespace FN {
body->call(*fn_in, *fn_out);
}
+ static void destruct_tuple(Tuple *tuple)
+ {
+ tuple->set_all_uninitialized();
+ tuple->~Tuple();
+ }
+
class TupleCallLLVM : public LLVMBuildIRBody {
private:
TupleCallBody *m_tuple_call;
@@ -106,6 +112,8 @@ namespace FN {
void_ty, {byte_ptr_ty, void_ptr_ty}, false);
llvm::FunctionType *call_ftype = llvm::FunctionType::get(
void_ty, {void_ptr_ty, byte_ptr_ty, byte_ptr_ty}, false);
+ llvm::FunctionType *destruct_ftype = llvm::FunctionType::get(
+ void_ty, {byte_ptr_ty}, false);
/* Construct input and output tuple on stack. */
llvm::Value *tuple_in_ptr = alloca_bytes(builder, get_total_tuple_size(m_in_meta));
@@ -144,6 +152,13 @@ namespace FN {
llvm::Value *out = output_type_infos[i]->build_load_ir__relocate(builder, load_from_addr);
output = builder.CreateInsertValue(output, out, i);
}
+
+ /* Destruct tuples */
+ call_pointer(builder, (void *)destruct_tuple,
+ destruct_ftype, {tuple_in_ptr});
+ call_pointer(builder, (void *)destruct_tuple,
+ destruct_ftype, {tuple_out_ptr});
+
builder.CreateRet(output);
}
};
More information about the Bf-blender-cvs
mailing list