[cfe-dev] Demangled function name in FunctionPass?

Bjorn Reese breese at mail1.stofanet.dk
Mon Jul 12 09:06:43 PDT 2010


On 2010-07-10 19:32, Chris Lattner wrote:
>
> On Jul 10, 2010, at 8:47 AM, Bjorn Reese wrote:
>
>> If I use the "Hello World Pass" example from "Writing an LLVM Pass",
>> then the C++ function names (from Function::getName) are mangled.
>>
>> Is it possible to get the demangled function name instead?
>
> You should be able to demangle it yourself.  libstdc++ provides the __cxa_demangle function that will do this for you:
> http://idlebox.net/2008/0901-stacktrace-demangled/cxa_demangle.htt
>
> LLVM doesn't provide any direct capabilities to do this.

Is there any way to detect that the function names have been mangled
by the C++ ABI rules (or that we are optimizing C++ code)?



More information about the cfe-dev mailing list