public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] C++ API database
Date: Wed, 28 Sep 2022 18:59:20 +0200	[thread overview]
Message-ID: <CAP3s5k_2gsY32htNVE4eGReQdf4M4c+qErwq-E-0XE=_o1G1Mw@mail.gmail.com> (raw)
In-Reply-To: <CAP3s5k8RvUw7+Zd3oJT1jxUHmWbgk-QnMMfwsdpoDEHa6bw_gw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3788 bytes --]

Ping.  Anyone having problems with this?  And the governance of the file?

On Mon, Sep 12, 2022 at 1:51 PM Ulrich Drepper <drepper@redhat.com> wrote:

> After my prior inquiry into the use of python as a build tool for
> maintainers didn't produce any negative comments and several active and
> even enthusiastic support message I'm going forward with submitting the
> patch.
>
> To repeat the detail, for the generation of the upcoming C++ standard
> library module and the hints for missing definitions/declarations in the
> std:: namespace we need a list of standard C++ APIs.  The information
> needed for the two use cases is different but the actual APIs overlap
> almost completely and therefore it would be a bad idea to have the data
> separated.
>
> We could opt for a file format that is easy to read in awk and writing the
> appropriate scripts to transform the data into the appropriate output
> format but this looks ugly, is hard to understand, and a nightmare to
> maintain.  On the other hand, writing the code in Python is simple and
> clean.
>
>
> Therefore, Jonathan and I worked on a CSV file which contains the
> necessary information and a Python to create the gperf input file to
> generate std-name-hint.h and also, in future, the complete source of the
> export interface description for the standard library module.  This mode is
> not yet used because the module support isn't ready yet.  The output file
> corresponds to the hand-coded version of the export code Jonathan uses
> right now.
>
> Note that in both of these cases the generated files are static, they
> don't depend on the local configuration and therefore are checked into the
> source code repository.  The script only has to run if the generated files
> are explicitly removed or, in maintainer mode, if the CSV file has
> changed.  For normal compilation from a healthy source code tree the tool
> is not needed.
>
>
> One remaining issue is the responsibility for the CSV file.  The file
> needs to live in the directory of the frontend and therefore nominally
> changes need to be approved by the frontend maintainers.  The content
> entirely consists of information from the standard library, though.  Any
> change that doesn't break the build on one machine (i.e., the Python script
> doesn't fail) will not course any problem because the output format of the
> script is correct.  Therefore we have been wondering whether the CSV file
> should at least have shared ownership between the frontend maintainers and
> the libstdc++ maintainers.
>
> The CSV file contain more hint information than the old hand-coded .gperf
> file.  So, an additional effect of this patch is the extension of the hints
> that are provided but given that the lookup is now fast this shouldn't have
> any negative impact.  The file is not complete, though, this will come over
> time and definitely before the module support is done.
>
> I build my complete set of compilers with this patch without problems.
>
> Any comments?
>
> 2022-09-12  Jonathan Wakely  <jwakely@redhat.com>
>             Ulrich Drepper  <drepper@redhat.com>
>
> contrib/ChangeLog
>         * gcc_update: Add rule to generate gcc/cp/std-name-hint.gperf.
>
> gcc/cp/ChangeLog
>         * Make-lang.in: Add rule to generate gcc/cp/std-name-hint.gperf.
>         Adjust rule to generate $(srcdir)/cp/std-name-hint.h.
>         Add explicit rule to depend cp/name-lookup.o on
>         $(srcdir)/cp/std-name-hint.h.
>         * cxxapi-data.csv: New file.  Database of C++ APIs.
>         * gen-cxxapi-file.py: New file.  Script to generate source code for
>         C++ standard library exports and to generate C++ std:: namespace
>         fix hints.
>         * std-name-hint.gperf: Regenerated.
>         * std-name-hint.h: Regenerated.
>

  reply	other threads:[~2022-09-28 16:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 11:51 Ulrich Drepper
2022-09-28 16:59 ` Ulrich Drepper [this message]
2022-10-18  0:56   ` Jason Merrill
2022-10-18 11:01     ` Ulrich Drepper
2022-10-18 11:04       ` Martin Liška
2022-10-18 11:15       ` Jakub Jelinek

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='CAP3s5k_2gsY32htNVE4eGReQdf4M4c+qErwq-E-0XE=_o1G1Mw@mail.gmail.com' \
    --to=drepper@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).