summaryrefslogtreecommitdiffstats
path: root/gcc/ada
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog30
-rw-r--r--gcc/ada/ada-tree.def23
-rw-r--r--gcc/ada/ada-tree.h2
-rw-r--r--gcc/ada/decl.c7
-rw-r--r--gcc/ada/misc.c4
-rw-r--r--gcc/ada/trans.c24
-rw-r--r--gcc/ada/utils.c20
-rw-r--r--gcc/ada/utils2.c7
8 files changed, 65 insertions, 52 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index babbc34f0dd..92560a9641c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * ada-tree.def: Use tree_code_class enumeration constants
+ instead of code letters.
+ * ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c:
+ Update for new tree-class enumeration constants.
+
2004-09-17 Vincent Celier <celier@gnat.com>
* prj-attr-pm.ads, prj-attr-pm.adb: New files, to split some private
@@ -456,7 +464,7 @@
2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
+
* ada-tree.h (TYPE_RM_SIZE_INT): Use TYPE_LANG_SLOT_1.
2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
@@ -465,7 +473,7 @@
* trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise.
* utils.c (init_gigi_decls): Likewise.
* utils2.c (build_call_raise, build_allocator): Likewise.
-
+
2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
* utils.c (gnat_init_decl_processing): Adjust
@@ -589,7 +597,7 @@
GNAT.Sockets.Thin.Is_Socket_In_Set to account for new specification
and test explicitly for non-zero return value.
- * g-socthi-vms.ads, g-socthi-mingw.ads, g-socthi-vxworks.ads:
+ * g-socthi-vms.ads, g-socthi-mingw.ads, g-socthi-vxworks.ads:
(Is_Socket_In_Set): Declare imported function as returning C.int, to
avoid using a derived boolean type.
@@ -1264,7 +1272,7 @@
(gnat_to_gnu, case N_Compilation_Unit): Just handle nested case here.
(add_stmt): Force walking of sizes and DECL_INITIAL for DECL_EXPR.
(mark_visited): Don't mark dummy type.
- (tree_transform <N_Procedure_Call_Statement>): Unless this is an In
+ (tree_transform <N_Procedure_Call_Statement>): Unless this is an In
parameter, we must remove any LJM building from GNU_NAME.
(gnat_to_gnu, case N_String_Literal): Fill in indices in CONSTRUCTOR.
(pos_to_constructor): Use int_const_binop.
@@ -1471,7 +1479,7 @@
(gnat_to_gnu): If statement and not in procedure, go into elab proc.
Delete calls to add_decl_expr; add arg to create_*_decl.
(gnat_to_gnu, case N_Loop): Recalculate side effects on COND_EXPR.
- (gnat_to_gnu, case N_Subprogram_Body): Move some code to
+ (gnat_to_gnu, case N_Subprogram_Body): Move some code to
begin_subprog_body and call it.
Don't push and pop ggc context.
(gnat_to_gnu, case N_Compilation_Unit): Rework to support elab proc.
@@ -1497,7 +1505,7 @@
(function_nesting_depth): Deleted.
(begin_subprog_body): Delete obsolete code.
* utils2.c (build_call_alloc_dealloc): Add new arg to create_var_decl.
-
+
2004-06-28 Robert Dewar <dewar@gnat.com>
* mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
@@ -1629,8 +1637,8 @@
Lib_Address and Relocatable.
(Default_DLL_Address): Removed.
- * mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
- mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb,
+ * mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
+ mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb,
mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-vxworks.adb:
(Build_Dynamic_Library): Remove parameter Lib_Address and Relocatable.
(Default_DLL_Address): Removed.
@@ -1827,7 +1835,7 @@
(Compile_Sources.Compile): Add switch -gnatez as the last option
(Display): Never display -gnatez
- * Makefile.generic:
+ * Makefile.generic:
When using $(MAIN_OBJECT), always use $(OBJ_DIR)/$(MAIN_OBJECT)
* gnatcmd.adb (Check_Project): New function
@@ -2402,7 +2410,7 @@
opt.adb, par.adb, opt.ads, par-ch11.adb, par-ch3.adb, par-ch4.adb,
par-ch5.adb, par-ch6.adb, par-ch8.adb, par-ch9.adb, par-prag.adb,
par-util.adb, scng.adb, sem_aggr.adb, sem_attr.adb, sem_cat.adb,
- sem_ch10.adb, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch2.adb,
+ sem_ch10.adb, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch2.adb,
sem_ch3.adb, sem_ch3.ads, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb,
sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_eval.adb, sem_prag.adb,
sem_res.adb, sem_type.adb, sem_util.adb, sinfo.ads, snames.adb,
@@ -3027,7 +3035,7 @@
Renaming of target specific files for clarity
- * Makefile.in: Rename GNAT target specific files.
+ * Makefile.in: Rename GNAT target specific files.
* 31soccon.ads, 31soliop.ads 35soccon.ads, 3asoccon.ads,
3bsoccon.ads, 3gsoccon.ads, 3hsoccon.ads, 3psoccon.ads,
diff --git a/gcc/ada/ada-tree.def b/gcc/ada/ada-tree.def
index fe68c633f2c..25ea95ef6ce 100644
--- a/gcc/ada/ada-tree.def
+++ b/gcc/ada/ada-tree.def
@@ -6,7 +6,7 @@
* *
* Specification *
* *
- * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2004 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- *
@@ -28,23 +28,24 @@
to GCC. TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE
is the type of a record containing the template and data. */
-DEFTREECODE (UNCONSTRAINED_ARRAY_TYPE, "unconstrained_array_type", 't', 0)
+DEFTREECODE (UNCONSTRAINED_ARRAY_TYPE, "unconstrained_array_type", tcc_type, 0)
/* A reference to an unconstrained array. This node only exists as an
intermediate node during the translation of a GNAT tree to a GCC tree;
it is never passed to GCC. The only field used is operand 0, which
is the fat pointer object. */
-DEFTREECODE (UNCONSTRAINED_ARRAY_REF, "unconstrained_array_ref", 'r', 1)
+DEFTREECODE (UNCONSTRAINED_ARRAY_REF, "unconstrained_array_ref",
+ tcc_reference, 1)
/* An expression that returns an RTL suitable for its type. Operand 0
is an expression to be evaluated for side effects only. */
-DEFTREECODE (NULL_EXPR, "null_expr", 'e', 1)
+DEFTREECODE (NULL_EXPR, "null_expr", tcc_expression, 1)
/* Same as ADDR_EXPR, except that if the operand represents a bit field,
return the address of the byte containing the bit. This is used
for the 'Address attribute and never shows up in the tree. */
-DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", 'r', 1)
+DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", tcc_reference, 1)
/* Here are the tree codes for the statement types known to Ada. These
must be at the end of this file to allow IS_ADA_STMT to work. */
@@ -53,32 +54,32 @@ DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", 'r', 1)
makes this tree node, whose operand is a statement. The latter inserts
the actual statements into this node. Gimplification consists of
just returning the inner statement. */
-DEFTREECODE (STMT_STMT, "stmt_stmt", 's', 1)
+DEFTREECODE (STMT_STMT, "stmt_stmt", tcc_statement, 1)
/* A loop. LOOP_STMT_TOP_COND and LOOP_STMT_BOT_COND are the tests to exit a
loop at the top and bottom, respectively. LOOP_STMT_UPDATE is the statement
to update the loop iterator at the continue point. LOOP_STMT_BODY are the
statements in the body of the loop. LOOP_STMT_LABEL points to the LABEL_DECL
of the end label of the loop. */
-DEFTREECODE (LOOP_STMT, "loop_stmt", 's', 5)
+DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 5)
/* Conditionally exit a loop. EXIT_STMT_COND is the condition, which, if
true, will cause the loop to be exited. If no condition is specified,
the loop is unconditionally exited. EXIT_STMT_LABEL is the end label
corresponding to the loop to exit. */
-DEFTREECODE (EXIT_STMT, "exit_stmt", 's', 2)
+DEFTREECODE (EXIT_STMT, "exit_stmt", tcc_statement, 2)
/* A exception region. REGION_STMT_BODY is the statement to be executed
inside the region. REGION_STMT_HANDLE is a statement that represents
the exception handlers (usually a BLOCK_STMT of HANDLE_STMTs).
REGION_STMT_BLOCK is the BLOCK node for the declarative region, if any. */
-DEFTREECODE (REGION_STMT, "region_stmt", 's', 3)
+DEFTREECODE (REGION_STMT, "region_stmt", tcc_statement, 3)
/* An exception handler. HANDLER_STMT_ARG is the value to pass to
expand_start_catch, HANDLER_STMT_LIST is the list of statements for the
handler itself, and HANDLER_STMT_BLOCK is the BLOCK node for this
binding. */
-DEFTREECODE (HANDLER_STMT, "handler_stmt", 's', 3)
+DEFTREECODE (HANDLER_STMT, "handler_stmt", tcc_statement, 3)
/* A statement that emits a USE for its single operand. */
-DEFTREECODE (USE_STMT, "use_expr", 's', 1)
+DEFTREECODE (USE_STMT, "use_expr", tcc_statement, 1)
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h
index 21f1cafb2ca..7d4a756a725 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/ada-tree.h
@@ -273,7 +273,7 @@ struct lang_type GTY(()) {tree t; };
/* Define fields and macros for statements.
Start by defining which tree codes are used for statements. */
-#define IS_STMT(NODE) (TREE_CODE_CLASS (TREE_CODE (NODE)) == 's')
+#define IS_STMT(NODE) (STATEMENT_CLASS_P (NODE))
#define IS_ADA_STMT(NODE) (IS_STMT (NODE) \
&& TREE_CODE (NODE) >= STMT_STMT)
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 604c47151d1..08b5176afde 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -761,7 +761,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
just use that declaration or reference as this entity unless
the latter has to be materialized. */
else if ((DECL_P (gnu_expr)
- || TREE_CODE_CLASS (TREE_CODE (gnu_expr)) == 'r')
+ || (REFERENCE_CLASS_P (gnu_expr) == tcc_reference))
&& !Materialize_Entity (gnat_entity)
&& (!global_bindings_p ()
|| (staticp (gnu_expr)
@@ -4553,7 +4553,7 @@ elaborate_expression_1 (Node_Id gnat_expr, Entity_Id gnat_entity,
rely here on the fact that an expression cannot contain both the
discriminant and some other variable. */
- expr_variable = (TREE_CODE_CLASS (TREE_CODE (gnu_expr)) != 'c'
+ expr_variable = (!CONSTANT_CLASS_P (gnu_expr)
&& !(TREE_CODE (gnu_inner_expr) == VAR_DECL
&& TREE_READONLY (gnu_inner_expr))
&& !CONTAINS_PLACEHOLDER_P (gnu_expr));
@@ -5565,8 +5565,7 @@ annotate_value (tree gnu_size)
return No_Uint;
/* See if we've already saved the value for this node. */
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (gnu_size)))
- && TREE_COMPLEXITY (gnu_size))
+ if (EXPR_P (gnu_size) && TREE_COMPLEXITY (gnu_size))
return (Node_Ref_Or_Val) TREE_COMPLEXITY (gnu_size);
/* If we do not return inside this switch, TCODE will be set to the
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index cdaa862bd75..d1631cdb463 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -173,9 +173,9 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-const char tree_code_type[] = {
+const enum tree_code_class tree_code_type[] = {
#include "tree.def"
- 'x',
+ tcc_exceptional,
#include "ada-tree.def"
};
#undef DEFTREECODE
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index eb25be383f9..4defe553e62 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -3219,7 +3219,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* If this is a comparison operator, convert any references to
an unconstrained array value into a reference to the
actual array. */
- if (TREE_CODE_CLASS (code) == '<')
+ if (TREE_CODE_CLASS (code) == tcc_comparison)
{
gnu_lhs = maybe_unconstrained_array (gnu_lhs);
gnu_rhs = maybe_unconstrained_array (gnu_rhs);
@@ -4035,7 +4035,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* Set the location information into the result. If we're supposed to
return something of void_type, it means we have something we're
elaborating for effect, so just return. */
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (gnu_result))))
+ if (EXPR_P (gnu_result))
annotate_with_node (gnu_result, gnat_node);
if (TREE_CODE (gnu_result_type) == VOID_TYPE)
@@ -5712,13 +5712,13 @@ gnat_stabilize_reference_1 (tree e, bool force)
switch (TREE_CODE_CLASS (code))
{
- case 'x':
- case 't':
- case 'd':
- case '<':
- case 's':
- case 'e':
- case 'r':
+ case tcc_exceptional:
+ case tcc_type:
+ case tcc_declaration:
+ case tcc_comparison:
+ case tcc_statement:
+ case tcc_expression:
+ case tcc_reference:
/* If this is a COMPONENT_REF of a fat pointer, save the entire
fat pointer. This may be more efficient, but will also allow
us to more easily find the match for the PLACEHOLDER_EXPR. */
@@ -5734,12 +5734,12 @@ gnat_stabilize_reference_1 (tree e, bool force)
return e;
break;
- case 'c':
+ case tcc_constant:
/* Constants need no processing. In fact, we should never reach
here. */
return e;
- case '2':
+ case tcc_binary:
/* Recursively stabilize each operand. */
result = build2 (code, type,
gnat_stabilize_reference_1 (TREE_OPERAND (e, 0), force),
@@ -5747,7 +5747,7 @@ gnat_stabilize_reference_1 (tree e, bool force)
force));
break;
- case '1':
+ case tcc_unary:
/* Recursively stabilize each operand. */
result = build1 (code, type,
gnat_stabilize_reference_1 (TREE_OPERAND (e, 0),
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 2b5bad74092..1a5afb3d9b1 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2009,11 +2009,11 @@ max_size (tree exp, bool max_p)
switch (TREE_CODE_CLASS (code))
{
- case 'd':
- case 'c':
+ case tcc_declaration:
+ case tcc_constant:
return exp;
- case 'x':
+ case tcc_exceptional:
if (code == TREE_LIST)
return tree_cons (TREE_PURPOSE (exp),
max_size (TREE_VALUE (exp), max_p),
@@ -2021,7 +2021,7 @@ max_size (tree exp, bool max_p)
? max_size (TREE_CHAIN (exp), max_p) : NULL_TREE);
break;
- case 'r':
+ case tcc_reference:
/* If this contains a PLACEHOLDER_EXPR, it is the thing we want to
modify. Otherwise, we treat it like a variable. */
if (!CONTAINS_PLACEHOLDER_P (exp))
@@ -2031,12 +2031,12 @@ max_size (tree exp, bool max_p)
return
max_size (max_p ? TYPE_MAX_VALUE (type) : TYPE_MIN_VALUE (type), true);
- case '<':
+ case tcc_comparison:
return max_p ? size_one_node : size_zero_node;
- case '1':
- case '2':
- case 'e':
+ case tcc_unary:
+ case tcc_binary:
+ case tcc_expression:
switch (TREE_CODE_LENGTH (code))
{
case 1:
@@ -2087,6 +2087,10 @@ max_size (tree exp, bool max_p)
return build3 (CALL_EXPR, type, TREE_OPERAND (exp, 0),
max_size (TREE_OPERAND (exp, 1), max_p), NULL);
}
+
+ /* Other tree classes cannot happen. */
+ default:
+ break;
}
abort ();
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 6341863f061..4611fc8e904 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -290,17 +290,18 @@ contains_null_expr (tree exp)
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
- case '1':
+ case tcc_unary:
return contains_null_expr (TREE_OPERAND (exp, 0));
- case '<': case '2':
+ case tcc_comparison:
+ case tcc_binary:
tem = contains_null_expr (TREE_OPERAND (exp, 0));
if (tem)
return tem;
return contains_null_expr (TREE_OPERAND (exp, 1));
- case 'e':
+ case tcc_expression:
switch (TREE_CODE (exp))
{
case SAVE_EXPR:
OpenPOWER on IntegriCloud