<div dir="ltr">I believe LLVM's demangler (llvm-cxxfilt?) is built on a reusable library that probably provides you with APIs for inspecting the resulting name in some ways like what you want - but I don't know for sure.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 26, 2020 at 10:55 PM zxhuan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>I'm wondering if there is a way to write an llvm pass to get the class name of the functions. I am not talking about the simple self-written functions like foo::bar(...), but those STL container functions like _ZNKSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEclERKS5_S8_, demangles as std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const. In this case, the class name should be std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, and the function name is operator().</div><div><br></div><div>I have tried to do this with clang tools, but the template parameters are not expanded and you can get pretty less information, which is not what I am looking for.</div><div><br></div><div>PS. This is specifically for C++.</div><div><br></div><div>Any help would be appreciated!</div><div><br></div><div>Jason</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>