Commit 8e7014b4 by Jakub Jelinek Committed by Jakub Jelinek

langhooks.h (struct lang_hooks): Document that tree_size langhook may be also…

langhooks.h (struct lang_hooks): Document that tree_size langhook may be also called on tcc_type nodes.

	* langhooks.h (struct lang_hooks): Document that tree_size langhook
	may be also called on tcc_type nodes.
	* langhooks.c (lhd_tree_size): Likewise.

	* gcc-interface/misc.c (gnat_tree_size): New function.
	(LANG_HOOKS_TREE_SIZE): Redefine.

From-SVN: r253829
parent eaf95345
2017-10-17 Jakub Jelinek <jakub@redhat.com>
* langhooks.h (struct lang_hooks): Document that tree_size langhook
may be also called on tcc_type nodes.
* langhooks.c (lhd_tree_size): Likewise.
2017-10-17 David Malcolm <dmalcolm@redhat.com>
* gimple-ssa-sprintf.c (fmtwarn): Update for changed signature of
2017-10-17 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/misc.c (gnat_tree_size): New function.
(LANG_HOOKS_TREE_SIZE): Redefine.
2017-10-14 Hristian Kirtchev <kirtchev@adacore.com>
* sem_elab.adb (In_Preelaborated_Context): A generic package subject to
......
......@@ -343,6 +343,23 @@ internal_error_function (diagnostic_context *context, const char *msgid,
Compiler_Abort (sp, sp_loc, true);
}
/* lang_hooks.tree_size: Determine the size of a tree with code C,
which is a language-specific tree code in category tcc_constant,
tcc_exceptional or tcc_type. The default expects never to be called. */
static size_t
gnat_tree_size (enum tree_code code)
{
gcc_checking_assert (code >= NUM_TREE_CODES);
switch (code)
{
case UNCONSTRAINED_ARRAY_TYPE:
return sizeof (tree_type_non_common);
default:
gcc_unreachable ();
}
}
/* Perform all the initialization steps that are language-specific. */
static bool
......@@ -1387,6 +1404,8 @@ get_lang_specific (tree node)
#define LANG_HOOKS_NAME "GNU Ada"
#undef LANG_HOOKS_IDENTIFIER_SIZE
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct tree_identifier)
#undef LANG_HOOKS_TREE_SIZE
#define LANG_HOOKS_TREE_SIZE gnat_tree_size
#undef LANG_HOOKS_INIT
#define LANG_HOOKS_INIT gnat_init
#undef LANG_HOOKS_OPTION_LANG_MASK
......
......@@ -266,8 +266,8 @@ lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED,
}
/* lang_hooks.tree_size: Determine the size of a tree with code C,
which is a language-specific tree code in category tcc_constant or
tcc_exceptional. The default expects never to be called. */
which is a language-specific tree code in category tcc_constant,
tcc_exceptional or tcc_type. The default expects never to be called. */
size_t
lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED)
{
......
......@@ -307,10 +307,10 @@ struct lang_hooks
/* Remove any parts of the tree that are used only by the FE. */
void (*free_lang_data) (tree);
/* Determines the size of any language-specific tcc_constant or
tcc_exceptional nodes. Since it is called from make_node, the
only information available is the tree code. Expected to die
on unrecognized codes. */
/* Determines the size of any language-specific tcc_constant,
tcc_exceptional or tcc_type nodes. Since it is called from
make_node, the only information available is the tree code.
Expected to die on unrecognized codes. */
size_t (*tree_size) (enum tree_code);
/* Return the language mask used for converting argv into a sequence
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment