Commit 1cd69e2b by Jason Merrill Committed by Jason Merrill

tree.c (expr_last): New fn.

        * tree.c (expr_last): New fn.
        * tree.h: Declare it.
        * objc/objc-act (expr_last): Rename to objc_expr_last.

From-SVN: r67035
parent a60a9553
2003-05-20 Jason Merrill <jason@redhat.com>
* tree.c (expr_last): New fn.
* tree.h: Declare it.
* objc/objc-act (expr_last): Rename to objc_expr_last.
2003-05-20 J"orn Rennecke <joern.rennecke@superh.com> 2003-05-20 J"orn Rennecke <joern.rennecke@superh.com>
* sh.c (sh_register_move_cost): Add clase for moving between * sh.c (sh_register_move_cost): Add clase for moving between
......
...@@ -217,7 +217,7 @@ static void really_start_method PARAMS ((tree, tree)); ...@@ -217,7 +217,7 @@ static void really_start_method PARAMS ((tree, tree));
static int comp_method_with_proto PARAMS ((tree, tree)); static int comp_method_with_proto PARAMS ((tree, tree));
static int comp_proto_with_proto PARAMS ((tree, tree)); static int comp_proto_with_proto PARAMS ((tree, tree));
static tree get_arg_type_list PARAMS ((tree, int, int)); static tree get_arg_type_list PARAMS ((tree, int, int));
static tree expr_last PARAMS ((tree)); static tree objc_expr_last PARAMS ((tree));
/* Utilities for debugging and error diagnostics. */ /* Utilities for debugging and error diagnostics. */
...@@ -6998,7 +6998,7 @@ encode_field_decl (field_decl, curtype, format) ...@@ -6998,7 +6998,7 @@ encode_field_decl (field_decl, curtype, format)
} }
static tree static tree
expr_last (complex_expr) objc_expr_last (complex_expr)
tree complex_expr; tree complex_expr;
{ {
tree next; tree next;
...@@ -7059,7 +7059,7 @@ start_method_def (method) ...@@ -7059,7 +7059,7 @@ start_method_def (method)
if (arg_decl) if (arg_decl)
{ {
tree last_expr = expr_last (arg_decl); tree last_expr = objc_expr_last (arg_decl);
/* Unite the abstract decl with its name. */ /* Unite the abstract decl with its name. */
TREE_OPERAND (last_expr, 0) = KEYWORD_ARG_NAME (arglist); TREE_OPERAND (last_expr, 0) = KEYWORD_ARG_NAME (arglist);
...@@ -7195,7 +7195,7 @@ really_start_method (method, parmlist) ...@@ -7195,7 +7195,7 @@ really_start_method (method, parmlist)
{ {
/* Unite the complex decl (specified in the abstract decl) with the /* Unite the complex decl (specified in the abstract decl) with the
function decl just synthesized..(int *), (int (*)()), (int (*)[]). */ function decl just synthesized..(int *), (int (*)()), (int (*)[]). */
tree save_expr = expr_last (ret_decl); tree save_expr = objc_expr_last (ret_decl);
TREE_OPERAND (save_expr, 0) = method_decl; TREE_OPERAND (save_expr, 0) = method_decl;
method_decl = ret_decl; method_decl = ret_decl;
......
...@@ -1123,6 +1123,18 @@ tree_cons (purpose, value, chain) ...@@ -1123,6 +1123,18 @@ tree_cons (purpose, value, chain)
return node; return node;
} }
/* Return the last expression in a sequence of COMPOUND_EXPRs. */
tree
expr_last (expr)
tree expr;
{
if (expr == NULL_TREE)
return expr;
while (TREE_CODE (expr) == COMPOUND_EXPR)
expr = TREE_OPERAND (expr, 1);
return expr;
}
/* Return the size nominally occupied by an object of type TYPE /* Return the size nominally occupied by an object of type TYPE
when it resides in memory. The value is measured in units of bytes, when it resides in memory. The value is measured in units of bytes,
......
...@@ -2532,6 +2532,7 @@ extern tree pedantic_non_lvalue PARAMS ((tree)); ...@@ -2532,6 +2532,7 @@ extern tree pedantic_non_lvalue PARAMS ((tree));
extern tree convert PARAMS ((tree, tree)); extern tree convert PARAMS ((tree, tree));
extern unsigned int expr_align PARAMS ((tree)); extern unsigned int expr_align PARAMS ((tree));
extern tree expr_last PARAMS ((tree));
extern tree size_in_bytes PARAMS ((tree)); extern tree size_in_bytes PARAMS ((tree));
extern HOST_WIDE_INT int_size_in_bytes PARAMS ((tree)); extern HOST_WIDE_INT int_size_in_bytes PARAMS ((tree));
extern tree bit_position PARAMS ((tree)); extern tree bit_position PARAMS ((tree));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment