aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-04-18 09:19:38 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-18 09:19:38 +0000
commit0cb5c2a7ce78df98164d7aa140f5d09766b24427 (patch)
tree858fd8b23dc90bb0f5d1b4815aa52186e80a3bc1 /gcc/ada/utils.c
parentc993ae60a95a8bb72f38225c3389e637c009f383 (diff)
downloadgcc-0cb5c2a7ce78df98164d7aa140f5d09766b24427.zip
gcc-0cb5c2a7ce78df98164d7aa140f5d09766b24427.tar.gz
gcc-0cb5c2a7ce78df98164d7aa140f5d09766b24427.tar.bz2
gigi.h (create_var_decl_1): Declare.
* gigi.h (create_var_decl_1): Declare. (create_var_decl): Turn into a macro invoking create_var_decl_1. (create_true_var_decl): Likewise. * utils.c (create_var_decl_1): Make global and reorder parameters. (create_var_decl): Delete. (create_true_var_decl): Likewise. From-SVN: r134429
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c52
1 files changed, 10 insertions, 42 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 96a8558..cafcc2d 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -1418,31 +1418,31 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
return type_decl;
}
-/* Helper for create_var_decl and create_true_var_decl. Returns a GCC VAR_DECL
- or CONST_DECL node.
+/* Return a VAR_DECL or CONST_DECL node.
VAR_NAME gives the name of the variable. ASM_NAME is its assembler name
(if provided). TYPE is its data type (a GCC ..._TYPE node). VAR_INIT is
the GCC tree for an optional initial expression; NULL_TREE if none.
CONST_FLAG is true if this variable is constant, in which case we might
- return a CONST_DECL node unless CONST_DECL_ALLOWED_FLAG is false.
+ return a CONST_DECL node unless CONST_DECL_ALLOWED_P is false.
PUBLIC_FLAG is true if this definition is to be made visible outside of
the current compilation unit. This flag should be set when processing the
- variable definitions in a package specification. EXTERN_FLAG is nonzero
- when processing an external variable declaration (as opposed to a
- definition: no storage is to be allocated for the variable here).
+ variable definitions in a package specification.
+
+ EXTERN_FLAG is nonzero when processing an external variable declaration (as
+ opposed to a definition: no storage is to be allocated for the variable).
STATIC_FLAG is only relevant when not at top level. In that case
it indicates whether to always allocate storage to the variable.
GNAT_NODE is used for the position of the decl. */
-static tree
+tree
create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
- bool const_flag, bool const_decl_allowed_flag,
- bool public_flag, bool extern_flag, bool static_flag,
+ bool const_flag, bool public_flag, bool extern_flag,
+ bool static_flag, bool const_decl_allowed_p,
struct attrib *attr_list, Node_Id gnat_node)
{
bool init_const
@@ -1464,7 +1464,7 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
/* The actual DECL node. CONST_DECL was initially intended for enumerals
and may be used for scalars in general but not for aggregates. */
tree var_decl
- = build_decl ((constant_p && const_decl_allowed_flag
+ = build_decl ((constant_p && const_decl_allowed_p
&& !AGGREGATE_TYPE_P (type)) ? CONST_DECL : VAR_DECL,
var_name, type);
@@ -1528,38 +1528,6 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
return var_decl;
}
-
-/* Wrapper around create_var_decl_1 for cases where we don't care whether
- a VAR or a CONST decl node is created. */
-
-tree
-create_var_decl (tree var_name, tree asm_name, tree type, tree var_init,
- bool const_flag, bool public_flag, bool extern_flag,
- bool static_flag, struct attrib *attr_list,
- Node_Id gnat_node)
-{
- return create_var_decl_1 (var_name, asm_name, type, var_init,
- const_flag, true,
- public_flag, extern_flag, static_flag,
- attr_list, gnat_node);
-}
-
-/* Wrapper around create_var_decl_1 for cases where a VAR_DECL node is
- required. The primary intent is for DECL_CONST_CORRESPONDING_VARs, which
- must be VAR_DECLs and on which we want TREE_READONLY set to have them
- possibly assigned to a readonly data section. */
-
-tree
-create_true_var_decl (tree var_name, tree asm_name, tree type, tree var_init,
- bool const_flag, bool public_flag, bool extern_flag,
- bool static_flag, struct attrib *attr_list,
- Node_Id gnat_node)
-{
- return create_var_decl_1 (var_name, asm_name, type, var_init,
- const_flag, false,
- public_flag, extern_flag, static_flag,
- attr_list, gnat_node);
-}
/* Return true if TYPE, an aggregate type, contains (or is) an array. */