<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 29, 2014 at 8:08 AM, Rodney M. Bates <span dir="ltr"><<a href="mailto:rodney_bates@lcwb.coop" target="_blank">rodney_bates@lcwb.coop</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am working on a project that entails writing calls in Modula3 code to C<br>
and C++ code in the llvm infrastructure.  For C, things are fine.  For C++,<br>
they are working, but I am having to put the mangled linker name in my binding.<br>
<br>
My questions are<br>
<br>
1) Does the mangled linker name of a C++ nonmember function depend only on the<br>
   function signature?<br></blockquote><div><br></div><div>Yes (mangling is there to support overloading and namespaces - since the underlying symbol system doesn't support either, mangling is the task of putting all the unique data about a function into the (mangled) name)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2) Do gcc and clang both mangle the same?<br></blockquote><div><br>Yes - this is necessary for C++ libraries compiled with Clang to link successfully with C++ libraries compiled with GCC.<br><br>(modulo bugs, edge cases, etc)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If not, then I will probably need to do more work to produce C bindings<br>
similar to those in llvm-c/Core.h<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Rodney Bates<br>
<a href="mailto:rodney.m.bates@acm.org" target="_blank">rodney.m.bates@acm.org</a><br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>