From f89cdd04911e4acc9c045f2de6d1f50acec8e271 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 28 Feb 2017 18:06:33 +0100 Subject: Core: MCJIT functions need unique names We will use newer MCJIT with newer LLVM versions. But it needs unique names of functions or a wrong function can be called. So prepend "dispatcher_" to function names (even for older LLVMs). Signed-off-by: Jiri Slaby --- lib/Core/ExternalDispatcher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index 01c5f935..984e3ab2 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -207,10 +207,11 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in std::vector nullary; + // MCJIT functions need unique names, or wrong function can be called Function *dispatcher = Function::Create(FunctionType::get(Type::getVoidTy(ctx), nullary, false), GlobalVariable::ExternalLinkage, - "", + "dispatcher_" + target->getName().str(), dispatchModule); -- cgit 1.4.1