[LLVMdev] C++ demangling in LLVM

Villmow, Micah Micah.Villmow at amd.com
Tue Aug 14 15:11:23 PDT 2012


Was there any resolution about if bringing this into the LLVM Support directory should be done or not? I have a need of being able to use this, not just for demangling, but also to verify correctness of a mangled function, and can only rely on LLVM core.

Thanks,
Micah

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Chris Lattner
> Sent: Saturday, July 21, 2012 5:30 PM
> To: Michael Spencer
> Cc: Dmitry Vyukov; LLVM Developers Mailing List
> Subject: Re: [LLVMdev] C++ demangling in LLVM
> 
> On Jul 4, 2012, at 12:43 PM, Michael Spencer wrote:
> > On Wed, Jul 4, 2012 at 8:33 AM, Alexey Samsonov <samsonov at google.com>
> wrote:
> >> Hello!
> >>
> >> We want to implement in-process symbolizer for
> >> {Address,Thread}Sanitizer testing tools that would be based on LLVM
> libraries.
> >> I've noticed that llvm-nm (as well as other tools) doesn't demangle
> >> C++ names. Is it true, that LLVM doesn't have the code that is
> >> capable of that, and if yes, are there any plans to add it?
> >> Depending on something like libiberty.a doesn't seem like a good or
> >> portable solution.
> >>
> >> --
> >> Alexey Samsonov, MSK
> >>
> >
> > Yes, LLVM currently has no C++ demangler, and it needs one. Although I
> > have no idea where it should live. It would be nice if it could live
> > in clang next to the mangler, but clang doesn't even need a demangler.
> > llvm tools, lld, and compiler-rt do.
> 
> libc++abi provides a full C++ demangler, along with an extended API that
> provides a tree-based representation of the demangled name (implemented
> for LLDB).
> http://llvm.org/viewvc/llvm-
> project/libcxxabi/trunk/include/cxa_demangle.h?revision=HEAD&view=markup
> 
> 
> On Jul 4, 2012, at 10:08 PM, Chandler Carruth wrote:
> > In the same way that the core LLVM libraries have support routines for
> DWARF, I think that both mangling and demangling should be provided as
> well.
> 
> You can't really implement mangling without a full C++ (or whatever) AST
> of some sort to come from.  Demangling is a much easier problem, at
> least structurally. :)
> 
> -Chris
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev






More information about the llvm-dev mailing list