[llvm-dev] Get the class name of the function (original) (raw)
David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Sat Feb 29 14:49:01 PST 2020
- Previous message: [llvm-dev] Get the class name of the function
- Next message: [llvm-dev] TBAA for struct fields
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
On Wed, Feb 26, 2020 at 10:55 PM zxhuan via llvm-dev < llvm-dev at lists.llvm.org> wrote:
Hey guys,
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_cxx1112basicstringIcSt11chartraitsIcESaIcEEEEclERKS5S8, demangles as std::less<std::_cxx11::basicstring<char,_ _std::chartraits, std::allocator > _>::operator()(std::cxx11::basicstring<char, std::chartraits, _std::allocator > const&, std::cxx11::basicstring<char,_ _std::chartraits, std::allocator > const&) const. In this case, the class name should be std::less<std::_cxx11::basicstring<char,_ _std::chartraits, std::allocator > >, and the function name is operator(). 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. PS. This is specifically for C++. Any help would be appreciated! Jason
LLVM Developers mailing list llvm-dev at lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200229/373a2e4e/attachment.html>
- Previous message: [llvm-dev] Get the class name of the function
- Next message: [llvm-dev] TBAA for struct fields
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]