There's code to demangle names in libcxxabi.On Jul 4, 2012, at 8:33 AM, Alexey Samsonov 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.
-- Marshall
Marshall Clow Idio Software <mailto:mclow...@gmail.com>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
-- Yu Suzuki
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.
- Michael Spencer
Yes, LLVM currently has no C++ demangler, and it needs one. Although IOn Wed, Jul 4, 2012 at 8:33 AM, Alexey Samsonov <sams...@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
>
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.
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. I suspect that the 'Support' library is the best we have, although eventually we need to split this library up a bit. That's not really your problem though.The bigger problem is that we don't have any good way of sharing code between runtime libraries (such as libcxxabi, sanitizer runtimes, etc) and LLVM.
One somewhat interesting question, would the APIs exposed by libcxxabi be sufficient for the sanitizer runtimes?
On Thu, Jul 5, 2012 at 9:08 AM, Chandler Carruth <chan...@google.com> 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. I suspect that the 'Support' library is the best we have, although eventually we need to split this library up a bit. That's not really your problem though.The bigger problem is that we don't have any good way of sharing code between runtime libraries (such as libcxxabi, sanitizer runtimes, etc) and LLVM.Yes, surely I want this to happen and would be happy to help if you (or someone else) give some advice or guidance.
One somewhat interesting question, would the APIs exposed by libcxxabi be sufficient for the sanitizer runtimes?How can we use libcxxabi anyway? I mean, is it shipped with compiler so that we can make Clang driver tell to link user program withlibcxxabi in the same way we tell it to link with sanitizer runtimes if flags -fwhatever-sanitizer is present?
On Wed, Jul 4, 2012 at 11:18 PM, Alexey Samsonov <sams...@google.com> wrote:
On Thu, Jul 5, 2012 at 9:08 AM, Chandler Carruth <chan...@google.com> 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. I suspect that the 'Support' library is the best we have, although eventually we need to split this library up a bit. That's not really your problem though.The bigger problem is that we don't have any good way of sharing code between runtime libraries (such as libcxxabi, sanitizer runtimes, etc) and LLVM.Yes, surely I want this to happen and would be happy to help if you (or someone else) give some advice or guidance.Did you see my proposal to llvmdev some time ago about how to do this? If you have thoughts about that, we should move the discussion to that thread.
One somewhat interesting question, would the APIs exposed by libcxxabi be sufficient for the sanitizer runtimes?How can we use libcxxabi anyway? I mean, is it shipped with compiler so that we can make Clang driver tell to link user program withlibcxxabi in the same way we tell it to link with sanitizer runtimes if flags -fwhatever-sanitizer is present?Essentially, it could be. It's more complicated than just that though, so I was just curious if it would work.
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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.
I suspect that the 'Support' library is the best we have, although eventually we need to split this library up a bit. That's not really your problem though.
How would LLVM provide support for mangling? And what tools actually need it? I also wonder if we need more from a demangler than just a string. I know linker diagnostics would benefit from a deeper understanding of the name without having to parse C++ decls.On Jul 5, 2012, at 1:08 AM, Chandler Carruth <chan...@google.com> 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.
15.08.2012, 20:15, "Villmow, Micah" <Micah....@amd.com>:
>> -----Original Message-----
>> From: Konstantin Tokarev [mailto:ann...@yandex.ru]
>> Sent: Wednesday, August 15, 2012 9:10 AM
>> To: Villmow, Micah
>> Cc: Chris Lattner; Dmitry Vyukov; LLVM Developers Mailing List
>> Subject: Re: [LLVMdev] C++ demangling in LLVM
>>
>> 15.08.2012, 19:25, "Villmow, Micah" <Micah....@amd.com>:
>>> Three reasons.
>>> 1) I need to modify the code to support extensions to the standard
>> demangler.
>>> 2) GCC's version is GPL v3.
>> And?
>
> [Villmow, Micah] No GPL code allowed because of its viral nature.
Well, if you just call it from your code you are not affected by this aspect of GPL.
To implement your extensions you can create wrapper function.