From 71481150c78d4f093868fc49ae66227f187dc989 Mon Sep 17 00:00:00 2001 From: evghenii Date: Wed, 1 Jan 2014 10:35:25 +0100 Subject: [PATCH] in PTX mode, add ___export to exported function unmangled name --- func.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/func.cpp b/func.cpp index bb2fd785..331d552e 100644 --- a/func.cpp +++ b/func.cpp @@ -581,8 +581,11 @@ Function::GenerateIR() { llvm::FunctionType *ftype = type->LLVMFunctionType(g->ctx, true); llvm::GlobalValue::LinkageTypes linkage = llvm::GlobalValue::ExternalLinkage; std::string functionName = sym->name; + if (g->mangleFunctionsWithTarget) functionName += std::string("_") + g->target->GetISAString(); + + functionName += std::string("___export"); llvm::Function *appFunction = llvm::Function::Create(ftype, linkage, functionName.c_str(), m->module); #if defined(LLVM_3_1)