Mercurial > hg > CbC > CbC_gcc
diff gcc/ada/gcc-interface/gigi.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/ada/gcc-interface/gigi.h Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/ada/gcc-interface/gigi.h Thu Oct 25 07:37:49 2018 +0900 @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2017, Free Software Foundation, Inc. * + * Copyright (C) 1992-2018, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -77,9 +77,9 @@ /* Set the BLOCK node corresponding to the current code group to GNU_BLOCK. */ extern void set_block_for_group (tree); -/* Add a declaration statement for GNU_DECL to the current BLOCK_STMT node. - Get SLOC from GNAT_ENTITY. */ -extern void add_decl_expr (tree gnu_decl, Entity_Id gnat_entity); +/* Add a declaration statement for GNU_DECL to the current statement group. + Get the SLOC to be put onto the statement from GNAT_NODE. */ +extern void add_decl_expr (tree gnu_decl, Node_Id gnat_node); /* Mark nodes rooted at T with TREE_VISITED and types as having their sized gimplified. We use this to indicate all variable sizes and @@ -110,10 +110,6 @@ /* Get the unpadded version of a GNAT type. */ extern tree get_unpadded_type (Entity_Id gnat_entity); -/* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY is - a C++ imported method or equivalent. */ -extern bool is_cplusplus_method (Entity_Id gnat_entity); - /* Create a record type that contains a SIZE bytes long field of TYPE with a starting bit position so that it is aligned to ALIGN bits, and leaving at least ROOM bytes free before the field. BASE_ALIGN is the alignment the @@ -151,6 +147,9 @@ bool is_user_type, bool definition, bool set_rm_size); +/* Return true if padded TYPE was built with an RM size. */ +extern bool pad_type_has_rm_size (tree type); + /* Return a copy of the padded TYPE but with reverse storage order. */ extern tree set_reverse_storage_order_on_pad_type (tree type); @@ -215,9 +214,6 @@ /* Highest number in the front-end node table. */ extern int max_gnat_nodes; -/* Current node being treated, in case abort called. */ -extern Node_Id error_gnat_node; - /* True when gigi is being called on an analyzed but unexpanded tree, and the only purpose of the call is to properly annotate types with representation information. */ @@ -286,7 +282,7 @@ location and false if it doesn't. If CLEAR_COLUMN is true, set the column information to 0. */ extern bool Sloc_to_locus (Source_Ptr Sloc, location_t *locus, - bool clear_column = false); + bool clear_column = false, const_tree decl = 0); /* Post an error message. MSG is the error message, properly annotated. NODE is the node at which to post the error and the node to use for the @@ -545,7 +541,7 @@ /* Return true if EXPR is a useless type conversion. */ extern bool gnat_useless_type_conversion (tree expr); -/* Return true if T, a FUNCTION_TYPE, has the specified list of flags. */ +/* Return true if T, a {FUNCTION,METHOD}_TYPE, has the specified flags. */ extern bool fntype_same_flags_p (const_tree, tree, bool, bool, bool); /* Create an expression whose value is that of EXPR, @@ -1072,7 +1068,7 @@ static inline unsigned HOST_WIDE_INT ceil_pow2 (unsigned HOST_WIDE_INT x) { - return (unsigned HOST_WIDE_INT) 1 << (floor_log2 (x - 1) + 1); + return (unsigned HOST_WIDE_INT) 1 << ceil_log2 (x); } /* Return true if EXP, a CALL_EXPR, is an atomic load. */ @@ -1082,7 +1078,7 @@ { tree fndecl = get_callee_fndecl (exp); - if (!(fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)) + if (!(fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))) return false; enum built_in_function code = DECL_FUNCTION_CODE (fndecl); @@ -1169,3 +1165,16 @@ return type; } + +/* Like build_qualified_type, but TYPE_QUALS is added to the existing + qualifiers on TYPE. */ + +static inline tree +change_qualified_type (tree type, int type_quals) +{ + /* Qualifiers must be put on the associated array type. */ + if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE) + return type; + + return build_qualified_type (type, TYPE_QUALS (type) | type_quals); +}