Move void_list_node init to common code

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.
This commit is contained in:
Richard Biener 2022-09-14 15:59:37 +02:00
parent e3220adc44
commit 8ff2a92a04
11 changed files with 3 additions and 31 deletions

View 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);

View 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

View 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);

View 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 *

View 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)
{

View 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,

View 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 ();

View 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

View 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

View 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));

View 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));