[LLVMdev] runtime library for jitted code

Joseph Blomstedt Joseph.Blomstedt at colorado.edu
Tue Jun 16 11:07:50 PDT 2009


If you're simply looking to write a generator that spits out LLVM code
that you can link into your language, you should be able to throw
together something that uses the "undname.exe" utility from Visual
Studio that demangles all the names listed in a provided file.
Something like a script that's part of your build process and
generates the necessary stub code to link in by using dumpbin and
undname.

If you're interested in doing this "on the fly" during JIT for some
reason, there's the Microsoft APIs UnDecorateSymbolName and _unDName.
The first is a publicly documented API, the second is internal but
more feature rich. An Internet search should provide insight into
these. There's also open-source Wine code for _unDName I believe.


On Tue, Jun 16, 2009 at 11:57 AM, Victor
Zverovich<victor.zverovich at googlemail.com> wrote:
> Hi,
> The question about the name mangling gave me an idea that it can be used to
> automate registration of DLL functions. Instead of manually creating
> Function objects specifying a return type and argument types which is
> error-prone and time-consuming one can get a list of functions exported from
> a DLL using Windows API, demangle each name and construct a Function object
> from it. Is there any support for Visual C++ style (de)mangling in LLVM or
> related project? In any case I think it won't be difficult for me to write
> such a converter from mangled names to LLVM function declarations.
> Best regards,
> Victor



More information about the llvm-dev mailing list