[PATCH 08/10] Implement C++14 numeric separators

Tom Tromey tom@tromey.com
Wed Apr 24 21:42:33 GMT 2024


>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

>> For the name canonicalizer, there's at least one compiler that can
>> emit constants with this form, see bug 30845.

John> I guess this is the only separator allowed so far?

Yeah.  It was added in C++14.

John> Longer term I
John> do think it might be easier to understand the code if you always
John> allocate a new string and copy valid characters into just using a
John> 'continue' to skip characters you want to drop.  Perhaps though
John> this is a hot path where the extra allocation would be noticable?

In c-exp.y, probably not.

In cp-name-parser.y -- maybe.  That code is run when demangling, and
sometimes that means it is run quite a bit.

John> I also wonder if there might be benefit in a commit prior to
John> this that pulls out the shared code here into a single routine
John> that these files share?  (Or is that not quite as doable with
John> yacc?)

I tried that and it was pretty messy.  It could be done but I just took
an easier route out of laziness I guess.

Tom


More information about the Gdb-patches mailing list