]> gcc.gnu.org Git - gcc.git/commitdiff
Move void_list_node init to common code
authorRichard Biener <rguenther@suse.de>
Wed, 14 Sep 2022 13:59:37 +0000 (15:59 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 15 Sep 2022 12:16:25 +0000 (14:16 +0200)
All frontends replicate this, so move it.

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.cc (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
gcc/c-family/c-common.cc
gcc/c-family/c-common.h
gcc/c/c-decl.cc
gcc/cp/decl.cc
gcc/d/d-builtins.cc
gcc/fortran/f95-lang.cc
gcc/go/go-lang.cc
gcc/jit/dummy-frontend.cc
gcc/lto/lto-lang.cc
gcc/tree.cc

index f2e0cb2299b48f70cdc707231693a4a7bb367298..2d93947cb2649ea9778a4cea9c16dbf6f187d48c 100644 (file)
@@ -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);
 
index 0a5b7e120c9777aef827d2bf960b151940c362f9..c0f15f4cab1918bc7894af4bd54b7d23910ef737 100644 (file)
@@ -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
index ce971a29b5dfb74c911b06b71447f57c54ba672a..2f592f5cd58afb27a6f07bc466da282afef4b797 100644 (file)
@@ -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);
index 34f8feda897f76b22b877afe66b7fc315da76b0a..b09c6393b91049fd99b296123e969aa280326c7d 100644 (file)
@@ -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 *
index 006e9affcba7585d88972f696b9e1e4693642baa..070f673c3a285a04628108e4c9fda44ba00ca46c 100644 (file)
@@ -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)
 {
index c2ef0c836e16f6b2c5ecae42676e26f786329b9e..5997e5dcaf4cfeef06530a13f8aa5242e4056695 100644 (file)
@@ -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,
index ff4bf800e497349ee2de8d072794a7c6374803d6..a6750bea787c65fcf98216b5f36910bd7c9bc44a 100644 (file)
@@ -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 ();
index d519a69e64723cf09922ca56000fd7346ec625cb..4743370ff66ad70b08f9386652c17faf994b9b9e 100644 (file)
@@ -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
index 84ff359bfe3f14275e89626bf1639169398057b8..0687567bc883d14d7b13b3720798f350119030dd 100644 (file)
@@ -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
index 972a0336f759799cfc88ed33afb058c873219128..d36453ba25dfc77080e0df1c521b80e9807eab9b 100644 (file)
@@ -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));
index 0546c8f402569adcd3692e4e61a13ba5978aba07..4165cbd7c3bbc2ffd4507d67a0d4a7ef3b9ae63b 100644 (file)
@@ -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));
 
This page took 0.138579 seconds and 5 git commands to generate.