[cfe-dev] Get mangled names C++

Frank Fuchs fk.fuchs at googlemail.com
Thu Jul 15 12:56:03 PDT 2010


Hi, 

I'm still figuring how to pass functions from my c++ application (which acts as a host to a clang JIT) to the JIT.
Obviously this is possible using extern "C" declarations, but I don't want to declare or wrap everything like this and I'd like to  overload functions as well.
Now as far as I understand this stuff it should be possible to mangle the name and export the functions with their mangled names. 
Also from scrolling through the doxygen documentation it seems to me that there are routines in clang (probably even llvm itself) to do the mangling.
But I have no clue how to use them - are the even part of the API?
I'd prefer calling the llvm/clang internal routined for obvious reasons of compatibility. Beyond that I'm not really afraid of any compatibility issues (should I?), as the host application will be compiled with gcc or llvm-gcc or even clang (as soon as it does Qt, fully).  

So I'd be grateful for any advise how to achieve the name mangling.

-Frank



More information about the cfe-dev mailing list