<div dir="ltr">The simplest long-term solution would probably be to just add demangling in a portable way to libSupport. Then we don't need to conditionalize or anything. We just call llvm::demangle(). This is the only viable solution for proper cross-linking anyway.<div><br></div><div>Given that there should be existing demanglers we can reuse, I'm not sure that this long term solution is significantly more difficult than the short term solution you are proposing.<br><div><br></div><div>-- Sean Silva</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 1, 2014 at 9:19 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick, Bigcheese,<br>
<br>
When lld is used to link C++ code, it would be required to demangle symbol names by default/user driven option.<br>
<br>
The Gnu linker has the following options :-<br>
<br>
--demangle=[style]<br>
--no-demangle<br>
<br>
I found that clang/llvm-symbolizer use __cxx_demangle function.<br>
<br>
I would think that lld also need to call the same function, and I think the way we want to demangle is to have the function in LinkingContext as various flavors may choose to use different API's to demangle symbol names.<br>
<br>
The API's that would be in LinkingContext would be :-<br>
<br>
        * virtual bool canDemangle()  = 0; // Does the flavor provide a way to demangle symbol names ?<br>
        * virtual std::string demangle(StringRef symbolName) = 0; // demangle the symbol name<br>
<br>
Thoughts / Suggestions ?<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
<br>
Shankar Easwaran<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</font></span></blockquote></div></div>