<div dir="ltr">Hi David,<br><br>Function names for C++ have to be mangled for various reasons - see <a href="http://en.wikipedia.org/wiki/Name_mangling">http://en.wikipedia.org/wiki/Name_mangling</a> for more details. <br>
You can use a function called __cxa_demangle from libcxxabi to get the demangled function name.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-11 13:45 GMT-07:00 David Glanzman <span dir="ltr"><<a href="mailto:davidglanzman@yahoo.com" target="_blank">davidglanzman@yahoo.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hello all,<br><br></div>I'm getting started on a project using LLVM's opt tool to do static analysis, printing call graphs and such.  When compiling C programs to IR (and eventually to call graphs), function names remain the same (main, function1, function2 etc.), but when compiling the same program as C++, the function names often have cruft added to them (_Z9function1v, _Z9function2v etc.) which doesn't make for a very pretty graph.<br>

<br></div>Why are these extra characters added when going to IR from C++, but not C?  I'm interested in what they're for and if there's anyway to avoid them for the sake of making nice graphs.<br><br></div>Thanks,<br>

</div>David Glanzman<br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>