public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 08/10] Implement C++14 numeric separators
Date: Mon, 22 Apr 2024 10:29:14 -0700	[thread overview]
Message-ID: <58c5e3fb-5768-4553-b61f-9a9b2616749e@FreeBSD.org> (raw)
In-Reply-To: <20240421-canon-fixes-v1-8-4dc4791d270d@tromey.com>

On 4/21/24 10:00 AM, Tom Tromey wrote:
> C++14 allows the use of the apostrophe as a numeric separator; that
> is, "23000" and "23'000" represent the same number.  This patch
> implements this for gdb's C++ parser and the C++ name canonicalizer.
> 
> I did this unconditionally for all C variants because I think it's
> unambiguous.
> 
> For the name canonicalizer, there's at least one compiler that can
> emit constants with this form, see bug 30845.

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

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

-- 
John Baldwin


  reply	other threads:[~2024-04-22 17:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-21 17:00 [PATCH 00/10] Fix some C++ name canonicalizer problems Tom Tromey
2024-04-21 17:00 ` [PATCH 01/10] Remove test code from cp-name-parser.y Tom Tromey
2024-04-22 17:11   ` John Baldwin
2024-04-21 17:00 ` [PATCH 02/10] Allow initialization functions in .y files Tom Tromey
2024-04-21 17:00 ` [PATCH 03/10] Clean up demangle_parse_info Tom Tromey
2024-04-22 17:12   ` John Baldwin
2024-04-21 17:00 ` [PATCH 04/10] Change storage of demangle_component Tom Tromey
2024-04-22 17:17   ` John Baldwin
2024-04-21 17:00 ` [PATCH 05/10] Fix C++ name canonicalizations of character literals Tom Tromey
2024-04-22 17:19   ` John Baldwin
2024-04-21 17:00 ` [PATCH 06/10] Remove some unnecessary allocations from cpname_state::parse_number Tom Tromey
2024-04-22 17:20   ` John Baldwin
2024-04-21 17:00 ` [PATCH 07/10] Fix C++ canonicalization of hex literals Tom Tromey
2024-04-22 17:22   ` John Baldwin
2024-04-21 17:00 ` [PATCH 08/10] Implement C++14 numeric separators Tom Tromey
2024-04-22 17:29   ` John Baldwin [this message]
2024-04-24 21:42     ` Tom Tromey
2024-04-30 16:33       ` John Baldwin
2024-04-21 17:00 ` [PATCH 09/10] Allow function types as template parameters in name canonicalizer Tom Tromey
2024-04-22 17:30   ` John Baldwin
2024-04-21 17:00 ` [PATCH 10/10] Add spaceship operator to cp-name-parser.y Tom Tromey
2024-04-22 17:31   ` John Baldwin
2024-05-14 19:29 ` [PATCH 00/10] Fix some C++ name canonicalizer problems Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58c5e3fb-5768-4553-b61f-9a9b2616749e@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).