public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Ben Boeckel <me@benboeckel.net>, gcc-patches@gcc.gnu.org
Cc: gcc@gcc.gnu.org, jason@redhat.com, brad.king@kitware.com,
	fortran@gcc.gnu.org, Ben Boeckel <ben.boeckel@kitware.com>,
	nathan@acm.org
Subject: Re: [PATCH RESEND 1/1] p1689r5: initial support
Date: Tue, 4 Oct 2022 21:12:03 +0200	[thread overview]
Message-ID: <cb336962-009b-5222-0b27-2905dd452875@gmx.de> (raw)
In-Reply-To: <20221004151200.1275636-2-ben.boeckel@kitware.com>

Am 04.10.22 um 17:12 schrieb Ben Boeckel:
> This patch implements support for [P1689R5][] to communicate to a build
> system the C++20 module dependencies to build systems so that they may
> build `.gcm` files in the proper order.

Is there a reason that you are touching so many frontends?

> diff --git a/gcc/fortran/cpp.cc b/gcc/fortran/cpp.cc
> index 364bd0d2a85..0b9df9c02cd 100644
> --- a/gcc/fortran/cpp.cc
> +++ b/gcc/fortran/cpp.cc
> @@ -712,7 +712,7 @@ gfc_cpp_done (void)
>   	  FILE *f = fopen (gfc_cpp_option.deps_filename, "w");
>   	  if (f)
>   	    {
> -	      cpp_finish (cpp_in, f);
> +	      cpp_finish (cpp_in, f, NULL);
>   	      fclose (f);
>   	    }
>   	  else
> @@ -721,7 +721,7 @@ gfc_cpp_done (void)
>   			     xstrerror (errno));
>   	}
>         else
> -	cpp_finish (cpp_in, stdout);
> +	cpp_finish (cpp_in, stdout, NULL);
>       }
>
>     cpp_undef_all (cpp_in);

Couldn't you simply default the third argument of cpp_finish() to NULL?

> diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
> index 2db1e9cbdfb..90787230a9e 100644
> --- a/libcpp/include/cpplib.h
> +++ b/libcpp/include/cpplib.h
> @@ -298,6 +298,9 @@ typedef CPPCHAR_SIGNED_T cppchar_signed_t;
>   /* Style of header dependencies to generate.  */
>   enum cpp_deps_style { DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM };
>
> +/* Format of header dependencies to generate.  */
> +enum cpp_deps_format { DEPS_FMT_NONE = 0, DEPS_FMT_P1689R5 };
> +
>   /* The possible normalization levels, from most restrictive to least.  */
>   enum cpp_normalize_level {
>     /* In NFKC.  */
> @@ -581,6 +584,9 @@ struct cpp_options
>       /* Style of header dependencies to generate.  */
>       enum cpp_deps_style style;
>
> +    /* Format of header dependencies to generate.  */
> +    enum cpp_deps_format format;
> +
>       /* Assume missing files are generated files.  */
>       bool missing_files;
>
> @@ -1104,9 +1110,9 @@ extern void cpp_post_options (cpp_reader *);
>   extern void cpp_init_iconv (cpp_reader *);
>
>   /* Call this to finish preprocessing.  If you requested dependency
> -   generation, pass an open stream to write the information to,
> -   otherwise NULL.  It is your responsibility to close the stream.  */
> -extern void cpp_finish (cpp_reader *, FILE *deps_stream);
> +   generation, pass open stream(s) to write the information to,
> +   otherwise NULL.  It is your responsibility to close the stream(s).  */
> +extern void cpp_finish (cpp_reader *, FILE *deps_stream, FILE *fdeps_stream);
                                                                  ^^^^^^^
>
>   /* Call this to release the handle at the end of preprocessing.  Any
>      use of the handle after this function returns is invalid.  */



  reply	other threads:[~2022-10-04 19:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 15:11 [PATCH RESEND 0/1] RFC: P1689R5 support Ben Boeckel
2022-10-04 15:12 ` [PATCH RESEND 1/1] p1689r5: initial support Ben Boeckel
2022-10-04 19:12   ` Harald Anlauf [this message]
2022-10-11 11:30     ` Ben Boeckel
2022-10-10 21:04   ` Jason Merrill
2022-10-11 11:42     ` Ben Boeckel
2022-10-18 12:18       ` Ben Boeckel
2022-10-20 15:39         ` Jason Merrill
2022-10-20 17:31           ` Ben Boeckel
2022-10-20 18:22             ` Jason Merrill
2022-10-10 20:21 ` [PATCH RESEND 0/1] RFC: P1689R5 support Jason Merrill
2022-10-13 17:08   ` David Malcolm
2022-10-18 12:22     ` Ben Boeckel
2022-10-19  7:21       ` Martin Liška

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=cb336962-009b-5222-0b27-2905dd452875@gmx.de \
    --to=anlauf@gmx.de \
    --cc=ben.boeckel@kitware.com \
    --cc=brad.king@kitware.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=me@benboeckel.net \
    --cc=nathan@acm.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).