[cfe-dev] Demangled function name in FunctionPass?

Chris Lattner clattner at apple.com
Sat Jul 10 10:32:09 PDT 2010


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.

-Chris





More information about the cfe-dev mailing list