From: Richard Sandiford <richard.sandiford@arm.com>
To: Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Richard Biener <rguenther@suse.de>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] Move void_list_node init to common code
Date: Thu, 15 Sep 2022 10:31:34 +0100 [thread overview]
Message-ID: <mptwna53rwp.fsf@arm.com> (raw)
In-Reply-To: <20220914140656.640BF134B3@imap2.suse-dmz.suse.de> (Richard Biener via Gcc-patches's message of "Wed, 14 Sep 2022 16:06:55 +0200 (CEST)")
Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> All frontends replicate this, so move it.
>
> Bootstrap and regtest running for all languages on
> x86_64-unknown-linux-gnu.
>
> OK if that succeeds?
LGTM FWIW.
Thanks,
Richard
> Thanks,
> Richard.
>
> gcc/
> * tree.cc (build_common_tree_nodes): Initialize void_list_node
> here.
>
> gcc/ada/
> * gcc-interface/trans.cc (gigi): Do not initialize void_list_node.
>
> gcc/c-family/
> * c-common.h (build_void_list_node): Remove.
> * c-common.cc (c_common_nodes_and_builtins): Do not initialize
> void_list_node.
>
> gcc/c/
> * c-decl.cc (build_void_list_node): Remove.
>
> gcc/cp/
> * decl.cc (cxx_init_decl_processing): Inline last
> build_void_list_node call.
> (build_void_list_node): Remove.
>
> gcc/d/
> * d-builtins.cc (d_build_c_type_nodes): Do not initialize
> void_list_node.
>
> gcc/fortran/
> * f95-lang.c (gfc_init_decl_processing): Do not initialize
> void_list_node.
>
> gcc/go/
> * go-lang.cc (go_langhook_init): Do not initialize
> void_list_node.
>
> gcc/jit/
> * dummy-frontend.cc (jit_langhook_init): Do not initialize
> void_list_node.
>
> gcc/lto/
> * lto-lang.cc (lto_build_c_type_nodes): Do not initialize
> void_list_node.
> ---
> gcc/ada/gcc-interface/trans.cc | 1 -
> gcc/c-family/c-common.cc | 2 --
> gcc/c-family/c-common.h | 1 -
> gcc/c/c-decl.cc | 8 --------
> gcc/cp/decl.cc | 10 +---------
> gcc/d/d-builtins.cc | 1 -
> gcc/fortran/f95-lang.cc | 2 --
> gcc/go/go-lang.cc | 3 ---
> gcc/jit/dummy-frontend.cc | 3 ---
> gcc/lto/lto-lang.cc | 1 -
> gcc/tree.cc | 2 ++
> 11 files changed, 3 insertions(+), 31 deletions(-)
>
> diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
> index f2e0cb2299b..2d93947cb26 100644
> --- a/gcc/ada/gcc-interface/trans.cc
> +++ b/gcc/ada/gcc-interface/trans.cc
> @@ -413,7 +413,6 @@ gigi (Node_Id gnat_root,
> save_gnu_tree (gnat_literal, t, false);
>
> /* Declare the building blocks of function nodes. */
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> void_ftype = build_function_type_list (void_type_node, NULL_TREE);
> ptr_void_ftype = build_pointer_type (void_ftype);
>
> diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
> index 0a5b7e120c9..c0f15f4cab1 100644
> --- a/gcc/c-family/c-common.cc
> +++ b/gcc/c-family/c-common.cc
> @@ -4505,8 +4505,6 @@ c_common_nodes_and_builtins (void)
> TYPE_NAME (void_type_node) = void_name;
> }
>
> - void_list_node = build_void_list_node ();
> -
> /* Make a type to be the domain of a few array types
> whose domains don't really matter.
> 200 is small enough that it always fits in size_t
> diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
> index ce971a29b5d..2f592f5cd58 100644
> --- a/gcc/c-family/c-common.h
> +++ b/gcc/c-family/c-common.h
> @@ -853,7 +853,6 @@ extern tree identifier_global_tag (tree);
> extern bool names_builtin_p (const char *);
> extern tree c_linkage_bindings (tree);
> extern void record_builtin_type (enum rid, const char *, tree);
> -extern tree build_void_list_node (void);
> extern void start_fname_decls (void);
> extern void finish_fname_decls (void);
> extern const char *fname_as_string (int);
> diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
> index 34f8feda897..b09c6393b91 100644
> --- a/gcc/c/c-decl.cc
> +++ b/gcc/c/c-decl.cc
> @@ -10676,14 +10676,6 @@ record_builtin_type (enum rid rid_index, const char *name, tree type)
> debug_hooks->type_decl (decl, false);
> }
>
> -/* Build the void_list_node (void_type_node having been created). */
> -tree
> -build_void_list_node (void)
> -{
> - tree t = build_tree_list (NULL_TREE, void_type_node);
> - return t;
> -}
> -
> /* Return a c_parm structure with the given SPECS, ATTRS and DECLARATOR. */
>
> struct c_parm *
> diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
> index 006e9affcba..070f673c3a2 100644
> --- a/gcc/cp/decl.cc
> +++ b/gcc/cp/decl.cc
> @@ -4623,7 +4623,7 @@ cxx_init_decl_processing (void)
> record_unknown_type (init_list_type_node, "init list");
>
> /* Used when parsing to distinguish parameter-lists () and (void). */
> - explicit_void_list_node = build_void_list_node ();
> + explicit_void_list_node = build_tree_list (NULL_TREE, void_type_node);
>
> {
> /* Make sure we get a unique function type, so we can give
> @@ -18450,14 +18450,6 @@ cp_tree_node_structure (union lang_tree_node * t)
> }
> }
>
> -/* Build the void_list_node (void_type_node having been created). */
> -tree
> -build_void_list_node (void)
> -{
> - tree t = build_tree_list (NULL_TREE, void_type_node);
> - return t;
> -}
> -
> bool
> cp_missing_noreturn_ok_p (tree decl)
> {
> diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc
> index c2ef0c836e1..5997e5dcaf4 100644
> --- a/gcc/d/d-builtins.cc
> +++ b/gcc/d/d-builtins.cc
> @@ -889,7 +889,6 @@ static GTY(()) tree signed_size_type_node;
> static void
> d_build_c_type_nodes (void)
> {
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> string_type_node = build_pointer_type (char_type_node);
> const_string_type_node
> = build_pointer_type (build_qualified_type (char_type_node,
> diff --git a/gcc/fortran/f95-lang.cc b/gcc/fortran/f95-lang.cc
> index ff4bf800e49..a6750bea787 100644
> --- a/gcc/fortran/f95-lang.cc
> +++ b/gcc/fortran/f95-lang.cc
> @@ -530,8 +530,6 @@ gfc_init_decl_processing (void)
> only use it for actual characters, not for INTEGER(1). */
> build_common_tree_nodes (false);
>
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> -
> /* Set up F95 type nodes. */
> gfc_init_kinds ();
> gfc_init_types ();
> diff --git a/gcc/go/go-lang.cc b/gcc/go/go-lang.cc
> index d519a69e647..4743370ff66 100644
> --- a/gcc/go/go-lang.cc
> +++ b/gcc/go/go-lang.cc
> @@ -98,9 +98,6 @@ go_langhook_init (void)
> {
> build_common_tree_nodes (false);
>
> - /* I don't know why this has to be done explicitly. */
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> -
> /* We must create the gogo IR after calling build_common_tree_nodes
> (because Gogo::define_builtin_function_trees refers indirectly
> to, e.g., unsigned_char_type_node) but before calling
> diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
> index 84ff359bfe3..0687567bc88 100644
> --- a/gcc/jit/dummy-frontend.cc
> +++ b/gcc/jit/dummy-frontend.cc
> @@ -594,9 +594,6 @@ jit_langhook_init (void)
>
> build_common_tree_nodes (false);
>
> - /* I don't know why this has to be done explicitly. */
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> -
> build_common_builtin_nodes ();
>
> /* The default precision for floating point numbers. This is used
> diff --git a/gcc/lto/lto-lang.cc b/gcc/lto/lto-lang.cc
> index 972a0336f75..d36453ba25d 100644
> --- a/gcc/lto/lto-lang.cc
> +++ b/gcc/lto/lto-lang.cc
> @@ -1239,7 +1239,6 @@ lto_build_c_type_nodes (void)
> {
> gcc_assert (void_type_node);
>
> - void_list_node = build_tree_list (NULL_TREE, void_type_node);
> string_type_node = build_pointer_type (char_type_node);
> const_string_type_node
> = build_pointer_type (build_qualified_type (char_type_node, TYPE_QUAL_CONST));
> diff --git a/gcc/tree.cc b/gcc/tree.cc
> index 0546c8f4025..4165cbd7c3b 100644
> --- a/gcc/tree.cc
> +++ b/gcc/tree.cc
> @@ -9414,6 +9414,8 @@ build_common_tree_nodes (bool signed_char)
> void_node = make_node (VOID_CST);
> TREE_TYPE (void_node) = void_type_node;
>
> + void_list_node = build_tree_list (NULL_TREE, void_type_node);
> +
> null_pointer_node = build_int_cst (build_pointer_type (void_type_node), 0);
> layout_type (TREE_TYPE (null_pointer_node));
next prev parent reply other threads:[~2022-09-15 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 14:06 Richard Biener
2022-09-15 9:31 ` Richard Sandiford [this message]
2023-02-22 9:33 ` Rust: Move void_list_node init to common code (was: [PATCH] Move void_list_node init to common code) Thomas Schwinge
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=mptwna53rwp.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rguenther@suse.de \
/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).