[llvm] r292965 - Demangle: avoid butchering parameter type
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 06:51:18 PST 2017
On Tue, Jan 24, 2017 at 9:25 PM, Saleem Abdulrasool
<compnerd at compnerd.org> wrote:
> Yes, there is: I added one to libc++abi in fact. This has been a previous
> point of contention between myself and others. I feel like we should be
> duplicating the libc++abi test suite for demangling (which is a pretty large
> set) in LLVM as we duplicate the demangler.
Ah, thank you for adding the test and the explanation. :-)
~Aaron
>
> On Tue, Jan 24, 2017 at 11:08 AM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
>>
>> On Tue, Jan 24, 2017 at 1:52 PM, Saleem Abdulrasool via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>> > Author: compnerd
>> > Date: Tue Jan 24 12:52:19 2017
>> > New Revision: 292965
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=292965&view=rev
>> > Log:
>> > Demangle: avoid butchering parameter type
>> >
>> > When demangling a CV-qualified function type with a final parameter with
>> > a reference type, we would insert the CV qualification on the parameter
>> > rather than the function, and in the process adjust the insertion point
>> > by one extra, splitting the type name. This avoids doing so, even
>> > though the attribution is still incorrect.
>> >
>> > Modified:
>> > llvm/trunk/lib/Demangle/ItaniumDemangle.cpp
>>
>> Is there a way to provide a test case for this?
>>
>> ~Aaron
>>
>> >
>> > Modified: llvm/trunk/lib/Demangle/ItaniumDemangle.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/ItaniumDemangle.cpp?rev=292965&r1=292964&r2=292965&view=diff
>> >
>> > ==============================================================================
>> > --- llvm/trunk/lib/Demangle/ItaniumDemangle.cpp (original)
>> > +++ llvm/trunk/lib/Demangle/ItaniumDemangle.cpp Tue Jan 24 12:52:19 2017
>> > @@ -1665,9 +1665,9 @@ static const char *parse_type(const char
>> > if (is_function) {
>> > size_t p = db.names[k].second.size();
>> > if (db.names[k].second[p - 2] == '&')
>> > - p -= 3;
>> > - else if (db.names[k].second.back() == '&')
>> > p -= 2;
>> > + else if (db.names[k].second.back() == '&')
>> > + p -= 1;
>> > if (cv & 1) {
>> > db.names[k].second.insert(p, " const");
>> > p += 6;
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
More information about the llvm-commits
mailing list