This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 6/7] [D] libiberty: Improve support for demangling D2 templates


On 14 May 2015 at 15:24, Jeff Law <law@redhat.com> wrote:
> On 05/13/2015 02:51 AM, Iain Buclaw wrote:
>>
>> In my tests, this gives the demangler near-complete support.  Of a
>> sample of about 75k symbols pulled from the standard library
>> unittester, all but 20 were successfully parsed.
>>
>> ---
>> libiberty/ChangeLog:
>>
>> 2015-05-13 Iain Buclaw<ibuclaw@gdcproject.org>
>>
>>      * d-demangle.c (dlang_symbol_kinds): New enum.
>>      (dlang_parse_symbol): Update signature.  Handle an ambiguity between
>> mangle
>>      symbol for pascal and template value arguments.  Only check for a
>> type
>>      if parsing a function, or at the top level.  Return failure if the
>>      entire symbol was not successfully demangled.
>>      (dlang_identifier): Update signature.  Handle an ambiguity between
>> two
>>      adjacent digits in a mangled symbol string.
>>      (dlang_type): Update call to dlang_parse_symbol.
>>      (dlang_template_args): Likewise.
>>      (dlang_parse_template): Likewise.
>>      (dlang_demangle): Likewise.
>>      * testsuite/d-demangle-expected: Fix bad tests found, and add
>> problematic
>>      examples to the unittests.
>
> OK.
>
> I'm going to trust the code to dis-ambiguate the adjacent digits in
> dlang_identifier is correct.  The rest of the changes were pretty easy to
> follow :-0
>
> Jeff
>

Actually, the one snippest that we should be OK without in that
dis-ambiguate section is the while loop with the comment: "handle any
overflow".

On another note, I've found out why the remaining 20 symbols in my 75k
sample failed.  They don't fail at all!  It's just that they were all
greater than 33,000 characters in length, and my test used c++filt,
which trims anything bigger than 32767 (whoops!).

Iain.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]