Name mangling scheme

Hi,

As we start adding C++ support to clang, we will need to mangle name in
codegen. Which scheme should be used?

The same as gcc 3.x? I didn't found any real documentation on it.

Well, Itanium C++ ABI is *the* documentation on "gnu-v3" C++ name
mangling scheme. I'm not sure why you think it's not a "real"
documentation.

Perhaps the scheme should be configurable and selectable, but I am not sure
this is a good idea.

I think Microsoft C++-compatible name mangling could be useful.

>
> The same as gcc 3.x? I didn't found any real documentation on it.

Well, Itanium C++ ABI is *the* documentation on "gnu-v3" C++ name
mangling scheme. I'm not sure why you think it's not a "real"
documentation.

What I mean is that in the g++ documentation, I didn't found any indication that it use the itanium c++ name mangling.

> Perhaps the scheme should be configurable and selectable, but I am
not sure
> this is a good idea.

I think Microsoft C++-compatible name mangling could be useful.

The problem I can see (perhaps) is that (citing Wikipedia):

" Name mangling is only one of several application binary interface issues in a C++ implementation. Other ABI issues like exception handling, virtual table layout, structure padding, etc. cause differing C++ implementations to be incompatible. "

If we do MS compatible mangling but don't follow the MS ABI on other point, it would allow linking with dll not compatible, introducing runtime bug, potentially hard to understand.

And the only information I found on it are reverse engineered incomplet document like these:

http://mearie.org/documents/mscmangle
http://www.kegel.com/mangle.html
http://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B_Name_Mangling

C├ędric

Dan's link here actually gives you all of the information you need on the g++ version as well.

-eric