summaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:55:02 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:55:02 +0000
commitce45a448519f33c37b3ab6819fed86b28c267ab8 (patch)
treeb888315cd5fd9c69beb9093c01225e1f84fa5bf1 /gcc/java
parent8141f7d041fe04427d56c29ecbfc450c335ff292 (diff)
downloadgcc-ce45a448519f33c37b3ab6819fed86b28c267ab8.tar.gz
2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
Zack Weinberg <zack@codesourcery.com> * alias.c (find_base_decl): Remove unreachable case '3' block. * expr.c (safe_from_p): Abort if passed a type. * tree-gimple.c (recalculate_side_effects): Abort if passed anything other than an expression. * tree-ssa-pre.c (phi_translate): Return expr immediately if is_gimple_min_invariant is true for it. Reorder cases for clarity. Abort on un-handled tree classes. (valid_in_set): Likewise. * tree.c (tree_code_class_strings): New static data. * tree.h (enum tree_code_class): New. (tree_code_class_strings): Declare. (TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P) (REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P) (STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros. (TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS) (checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update. * tree.def, c-common.def, objc/objc-tree.def: Use tree_code_class enumeration constants instead of code letters. * alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c * c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c * emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c * langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c * tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c * tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c * tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c * tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c * tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c * tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c * tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c * config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c * config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c Update to match. * LANGUAGES: Add note about change. ada: * 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. cp: * cp-tree.def: Use tree_code_class enumeration constants instead of code letters. * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c * mangle.c, pt.c, semantics.c, tree.c, typeck.c: Update for new tree-class enumeration constants. fortran: * f95-lang.c, trans-expr.c, trans.c: Update for new tree-class enumeration constants. java: * java-tree.def: Use tree_code_class enumeration constants instead of code letters. * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for new tree-class enumeration constants. treelang: * treetree.c: Update for new tree-class enumeration constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog14
-rw-r--r--gcc/java/java-gimplify.c3
-rw-r--r--gcc/java/java-tree.def44
-rw-r--r--gcc/java/jcf-write.c3
-rw-r--r--gcc/java/lang.c10
-rw-r--r--gcc/java/parse.y10
6 files changed, 46 insertions, 38 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index ecb2cad4e8d..f0311cc5049 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * java-tree.def: Use tree_code_class enumeration constants
+ instead of code letters.
+ * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for
+ new tree-class enumeration constants.
+
2004-09-13 Tom Tromey <tromey@redhat.com>
PR java/17216:
@@ -131,7 +139,7 @@
* class.c (build_utf8_ref, build_static_field_ref,
make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table): Likewise.
- * constants.c (get_tag_node, build_ref_from_constant_pool,
+ * constants.c (get_tag_node, build_ref_from_constant_pool,
build_constants_constructor): Likewise.
* decl.c (java_init_decl_processing): Likewise.
* expr.c (build_java_array_length_access, build_newarray,
@@ -627,7 +635,7 @@
set_nested_class_simple_name_value.
2004-06-22 Andrew Haley <aph@redhat.com>
- Ranjit Mathew <rmathew@hotmail.com>
+ Ranjit Mathew <rmathew@hotmail.com>
Fixes PR java/16113.
* decl.c (force_poplevels): Remove call to expand_end_bindings.
@@ -699,7 +707,7 @@
of unordered conditionals. Add comment.
2004-05-29 Ranjit Mathew <rmathew@hotmail.com>
- Per Bothner <per@bothner.com>
+ Per Bothner <per@bothner.com>
* java-tree.h (DECL_LOCAL_FINAL_IUD): New macro to test if a
local variable was initialised upon declaration.
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 6632e934e8a..54d5c754472 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -141,7 +141,8 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
Parameter lists, maybe? Or perhaps that's unnecessary because
the front end already generates SAVE_EXPRs. */
- if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<')
+ if (TREE_CODE_CLASS (code) == tcc_binary
+ || TREE_CODE_CLASS (code) == tcc_comparison)
{
enum gimplify_status stat
= gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
diff --git a/gcc/java/java-tree.def b/gcc/java/java-tree.def
index 25ee5386205..2f2b9f467eb 100644
--- a/gcc/java/java-tree.def
+++ b/gcc/java/java-tree.def
@@ -1,33 +1,34 @@
/* Shift right, logical. */
-DEFTREECODE (URSHIFT_EXPR, "urshift_expr", '2', 2)
+DEFTREECODE (URSHIFT_EXPR, "urshift_expr", tcc_binary, 2)
/* Return -1, 0, 1 depending on whether the first argument is
less, equal, or greater to the second argument. */
-DEFTREECODE (COMPARE_EXPR, "compare_expr", '2', 2)
+DEFTREECODE (COMPARE_EXPR, "compare_expr", tcc_binary, 2)
/* Same as COMPARE_EXPR, but if either value is NaN, the result is -1. */
-DEFTREECODE (COMPARE_L_EXPR, "compare_l_expr", '2', 2)
+DEFTREECODE (COMPARE_L_EXPR, "compare_l_expr", tcc_binary, 2)
/* Same as COMPARE_EXPR, but if either value is NaN, the result is 1. */
-DEFTREECODE (COMPARE_G_EXPR, "compare_g_expr", '2', 2)
+DEFTREECODE (COMPARE_G_EXPR, "compare_g_expr", tcc_binary, 2)
/* Unary plus. Operand 0 is the expression the unary plus is applied
to */
-DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", '1', 1)
+DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1)
/* New array creation expression.
Operand 0 is the array base type.
Operand 1 is the list of dimension expressions.
Operand 2 is the number of other dimensions of unspecified range.
Once patched, the node will bear the type of the created array. */
-DEFTREECODE (NEW_ARRAY_EXPR, "new_array_expr", 'e', 3)
+DEFTREECODE (NEW_ARRAY_EXPR, "new_array_expr", tcc_expression, 3)
/* New anonymous array creation expression.
Operand 0 is the base type of the anonymous array.
Operand 1 is the signature of the dimensions this array contains.
Operand 2 is the anonymous array initializer.
Once patched, the node will bear the type of the created array. */
-DEFTREECODE (NEW_ANONYMOUS_ARRAY_EXPR, "new_anonymous_array", 'e', 3)
+DEFTREECODE (NEW_ANONYMOUS_ARRAY_EXPR, "new_anonymous_array",
+ tcc_expression, 3)
/* New class creation expression.
Operand 0 is the name of the class to be created
@@ -35,68 +36,69 @@ DEFTREECODE (NEW_ANONYMOUS_ARRAY_EXPR, "new_anonymous_array", 'e', 3)
There is no operand 2. That slot is used for the
CALL_EXPR_RTL macro (see preexpand_calls).
The type should be the one of the created class. */
-DEFTREECODE (NEW_CLASS_EXPR, "new_class_expr", 'e', 3)
+DEFTREECODE (NEW_CLASS_EXPR, "new_class_expr", tcc_expression, 3)
/* Defines `this' as an expression. */
-DEFTREECODE (THIS_EXPR, "this", '1', 0)
+DEFTREECODE (THIS_EXPR, "this", tcc_unary, 0)
/* Case statement expression.
Operand 1 is the case value. */
-DEFTREECODE (CASE_EXPR, "case", 'e', 1)
+DEFTREECODE (CASE_EXPR, "case", tcc_expression, 1)
/* Default statement expression. */
-DEFTREECODE (DEFAULT_EXPR, "default", 'e', 0)
+DEFTREECODE (DEFAULT_EXPR, "default", tcc_expression, 0)
/* Try expression
Operand 0 is the tried block,
Operand 1 contains chained catch nodes. */
-DEFTREECODE (TRY_EXPR, "try-catch", 'e', 2)
+DEFTREECODE (TRY_EXPR, "try-catch", tcc_expression, 2)
/* Catch clause.
Operand 0 is the catch clause block, which contains the declaration of
the catch clause parameter. */
-DEFTREECODE (JAVA_CATCH_EXPR, "catch", '1', 1)
+DEFTREECODE (JAVA_CATCH_EXPR, "catch", tcc_unary, 1)
/* Synchronized statement.
Operand 0 is the expression on which we wish to synchronize,
Operand 1 is the synchronized expression block. */
-DEFTREECODE (SYNCHRONIZED_EXPR, "synchronized", 'e', 2)
+DEFTREECODE (SYNCHRONIZED_EXPR, "synchronized", tcc_expression, 2)
/* Throw statement.
Operand 0 is the throw expression. */
-DEFTREECODE (THROW_EXPR, "throw", '1', 1)
+DEFTREECODE (THROW_EXPR, "throw", tcc_unary, 1)
/* Conditional operator.
Operand 0 is the condition expression
Operand 1 is the then-value
Operand 2 is the else-value. */
-DEFTREECODE (CONDITIONAL_EXPR, "?:", 'e', 3)
+DEFTREECODE (CONDITIONAL_EXPR, "?:", tcc_expression, 3)
/* instanceof operator.
Operand 0 is the expression that is getting tested
Operand 1 is the class used for the test. */
-DEFTREECODE (INSTANCEOF_EXPR, "instanceof", 'e', 2)
+DEFTREECODE (INSTANCEOF_EXPR, "instanceof", tcc_expression, 2)
/* Array initializers.
Operand 0 is the (sub) array target to initialize, left to NULL_TREE
when the node is created.
Operand 1 is a CONSTRUCTOR node. */
-DEFTREECODE (NEW_ARRAY_INIT, "new_array_init", '1', 1)
+DEFTREECODE (NEW_ARRAY_INIT, "new_array_init", tcc_unary, 1)
/* Class literal.
Operand 0 is the name of the class we're trying to build a
reference from. */
-DEFTREECODE (CLASS_LITERAL, "class_literal", '1', 1)
+DEFTREECODE (CLASS_LITERAL, "class_literal", tcc_unary, 1)
/* The Java object within the exception object from the runtime. */
-DEFTREECODE (JAVA_EXC_OBJ_EXPR, "java_exc_obj_expr", 'e', 0)
+DEFTREECODE (JAVA_EXC_OBJ_EXPR, "java_exc_obj_expr", tcc_expression, 0)
/* Annotates a tree node (usually an expression) with source location
information: a file name (EXPR_WFL_FILENAME); a line number
(EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO). It is
expanded as the contained node (EXPR_WFL_NODE); a line note should
be emitted first if EXPR_WFL_EMIT_LINE_NOTE. */
-DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3)
+DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location",
+ tcc_expression, 3)
/*
Local variables:
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 7b5bdcce7f1..5137eecf292 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2036,8 +2036,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
/* If the rhs is a binary expression and the left operand is
`==' to the lhs then we have an OP= expression. In this
case we must do some special processing. */
- if (TREE_CODE_CLASS (TREE_CODE (rhs)) == '2'
- && lhs == TREE_OPERAND (rhs, 0))
+ if (BINARY_CLASS_P (rhs) && lhs == TREE_OPERAND (rhs, 0))
{
if (TREE_CODE (lhs) == COMPONENT_REF)
{
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index b9429a1fade..d1c69770787 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -78,9 +78,9 @@ static void java_clear_binding_stack (void);
#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 "java-tree.def"
};
#undef DEFTREECODE
@@ -430,8 +430,7 @@ put_decl_node (tree node)
node = TREE_TYPE (node);
was_pointer = 1;
}
- if (TREE_CODE_CLASS (TREE_CODE (node)) == 'd'
- && DECL_NAME (node) != NULL_TREE)
+ if (DECL_P (node) && DECL_NAME (node) != NULL_TREE)
{
if (TREE_CODE (node) == FUNCTION_DECL)
{
@@ -464,8 +463,7 @@ put_decl_node (tree node)
else
put_decl_node (DECL_NAME (node));
}
- else if (TREE_CODE_CLASS (TREE_CODE (node)) == 't'
- && TYPE_NAME (node) != NULL_TREE)
+ else if (TYPE_P (node) && TYPE_NAME (node) != NULL_TREE)
{
if (TREE_CODE (node) == RECORD_TYPE && TYPE_ARRAY_P (node))
{
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 499627152bc..377c195323b 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -1687,7 +1687,7 @@ do_statement:
for_statement:
for_begin SC_TK expression SC_TK for_update CP_TK statement
{
- if (TREE_CODE_CLASS (TREE_CODE ($3)) == 'c')
+ if (CONSTANT_CLASS_P ($3))
$3 = build_wfl_node ($3);
$$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7);
}
@@ -3126,7 +3126,7 @@ find_expr_with_wfl (tree node)
{
while (node)
{
- char code;
+ enum tree_code_class code;
tree to_return;
switch (TREE_CODE (node))
@@ -3152,7 +3152,8 @@ find_expr_with_wfl (tree node)
default:
code = TREE_CODE_CLASS (TREE_CODE (node));
- if (((code == '1') || (code == '2') || (code == 'e'))
+ if (((code == tcc_unary) || (code == tcc_binary)
+ || (code == tcc_expression))
&& EXPR_WFL_LINECOL (node))
return node;
return NULL_TREE;
@@ -14895,8 +14896,7 @@ finish_for_loop (int location, tree condition, tree update, tree body)
{
/* Try to detect constraint violations. These would be
programming errors somewhere. */
- if (! IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (up2)))
- || TREE_CODE (up2) == LOOP_EXPR)
+ if (! EXPR_P (up2) || TREE_CODE (up2) == LOOP_EXPR)
abort ();
SUPPRESS_UNREACHABLE_ERROR (up2) = 1;
}