diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-17 22:11:00 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-17 22:11:00 +0200 |
commit | 8e7014b45585b89418564db079f9ad469a581ea2 (patch) | |
tree | 288005a9e12bb983c162c9ab78066db8227ce818 /gcc/ada/gcc-interface/misc.c | |
parent | eaf95345d33a727885761fa48d7481405614351a (diff) | |
download | gcc-8e7014b45585b89418564db079f9ad469a581ea2.zip gcc-8e7014b45585b89418564db079f9ad469a581ea2.tar.gz gcc-8e7014b45585b89418564db079f9ad469a581ea2.tar.bz2 |
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
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 081a63a..5083c71 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -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 |