[Bf-blender-cvs] [894511d] object_nodes: Fix for regenerating functions with MCJIT.

Lukas Tönne noreply at git.blender.org
Thu May 12 17:57:51 CEST 2016


Commit: 894511d56882a5870496feda283e5f58d4a857ec
Author: Lukas Tönne
Date:   Thu May 12 17:51:54 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB894511d56882a5870496feda283e5f58d4a857ec

Fix for regenerating functions with MCJIT.

LLVM was reusing old machine code, apparently regenerating it explicitly
with EE->generateCodeForModule() fixes this.

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

M	source/blender/blenvm/llvm/llvm_codegen.cc

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

diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc b/source/blender/blenvm/llvm/llvm_codegen.cc
index ed444d2..6862de4 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -406,6 +406,7 @@ FunctionLLVM *LLVMCompiler::compile_function(const string &name, const NodeGraph
 	
 	/* Note: Adding module to exec engine before creating the function prevents compilation! */
 	llvm_execution_engine()->addModule(module());
+	llvm_execution_engine()->generateCodeForModule(module());
 	uint64_t address = llvm_execution_engine()->getFunctionAddress(name);
 	BLI_assert(address != 0);




More information about the Bf-blender-cvs mailing list