[llvm-dev] Function name demangle on clang vs clang++

Syed Ahmed via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 28 15:36:45 PDT 2019


Hi all,

I'm a LLVM newbie and am working on a LLVM 3.5 code base. The project (
https://github.com/zhguanw/lin-analyzer) makes use of clang and reads C
code. I'm trying to make it read C++ code. When I compile a kernel written
in C with clang++, I get the following difference in the IR for a function
declaration:

When compiled with clang:
declare void @convolution3d(float*, float*) #1

When compiled with clang++:
declare void @_Z13convolution3dPfS_(float*, float*) #2

The project breaks if I compile with clang++ because it expects the
function name to not have the @_Z13*PfS. Does anyone know how I can get the
function name in the IR generated by clang++ to not have the mangled
characters? Once again, this is in LLVM 3.5.

Best,

Syed Ahmed
PhD Student
Implementation of Computation Group
UPenn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191028/977f5bca/attachment.html>


More information about the llvm-dev mailing list