From: Richard Henderson Date: Wed, 16 Jun 2004 20:23:02 +0000 (-0700) Subject: c-common.def (ASM_STMT): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e130a54b78b1f9b096a5ab1b98debfb263e16663;p=gcc.git c-common.def (ASM_STMT): Remove. * c-common.def (ASM_STMT): Remove. * c-common.h (c_common_stmt_codes): Remove ASM_STMT. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * c-typeck.c (build_asm_expr): Use ASM_EXPR. * tree.h: Fix commentary. cp/ * parser.c (cp_parser_asm_definition): Update commentary. * pt.c (tsubst_expr): Use ASM_EXPR. * semantics.c (finish_asm_stmt): Likewise. From-SVN: r83260 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e04fb23095..3ba6fa70782 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-06-16 Richard Henderson + + * c-common.def (ASM_STMT): Remove. + * c-common.h (c_common_stmt_codes): Remove ASM_STMT. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-typeck.c (build_asm_expr): Use ASM_EXPR. + * tree.h: Fix commentary. + 2004-06-16 Richard Henderson * c-common.def (GOTO_STMT, LABEL_STMT): Remove. diff --git a/gcc/c-common.def b/gcc/c-common.def index 434af64fb9b..a78cfc16d3d 100644 --- a/gcc/c-common.def +++ b/gcc/c-common.def @@ -71,9 +71,6 @@ DEFTREECODE (CONTINUE_STMT, "continue_stmt", 'e', 0) SWITCH_COND, SWITCH_BODY and SWITCH_TYPE, respectively. */ DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 3) -/* Used to represent an inline assembly statement. */ -DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 4) - /* Used to represent a CASE_LABEL. The operands are CASE_LOW and CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a 'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case diff --git a/gcc/c-common.h b/gcc/c-common.h index aa2b06fad1b..6dbb5167f54 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 0: TREE_NEGATED_INT (in INTEGER_CST). IDENTIFIER_MARKED (used by search routines). DECL_PRETTY_FUNCTION_P (in VAR_DECL) - ASM_INPUT_P (in ASM_STMT) STMT_EXPR_NO_SCOPE (in STMT_EXPR) 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL) STMT_IS_FULL_EXPR_P (in _STMT) @@ -1009,7 +1008,7 @@ enum c_tree_code { DECL_STMT, IF_STMT, FOR_STMT, \ WHILE_STMT, DO_STMT, RETURN_STMT, \ BREAK_STMT, CONTINUE_STMT, \ - SWITCH_STMT, ASM_STMT, CASE_LABEL + SWITCH_STMT, CASE_LABEL /* TRUE if a code represents a statement. The front end init langhook should take care of initialization of this array. */ diff --git a/gcc/c-dump.c b/gcc/c-dump.c index b0790efa209..db03dfb566b 100644 --- a/gcc/c-dump.c +++ b/gcc/c-dump.c @@ -63,17 +63,6 @@ c_dump_tree (void *dump_info, tree t) dump_string (di, "bitfield"); break; - case ASM_STMT: - dump_stmt (di, t); - if (ASM_VOLATILE_P (t)) - dump_string (di, "volatile"); - dump_child ("strg", ASM_STRING (t)); - dump_child ("outs", ASM_OUTPUTS (t)); - dump_child ("ins", ASM_INPUTS (t)); - dump_child ("clbr", ASM_CLOBBERS (t)); - dump_next_stmt (di, t); - break; - case BREAK_STMT: case CONTINUE_STMT: dump_stmt (di, t); diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index e0b262d03e8..3b84cd981de 100644 --- a/gcc/c-gimplify.c +++ b/gcc/c-gimplify.c @@ -283,18 +283,6 @@ c_gimplify_stmt (tree *stmt_p) ret = GS_OK; break; - case ASM_STMT: - { - tree new_stmt = build (ASM_EXPR, void_type_node, ASM_STRING (stmt), - ASM_OUTPUTS (stmt), ASM_INPUTS (stmt), - ASM_CLOBBERS (stmt)); - ASM_INPUT_P (new_stmt) = ASM_INPUT_P (stmt); - ASM_VOLATILE_P (new_stmt) = ASM_VOLATILE_P (stmt); - stmt = new_stmt; - ret = GS_OK; - } - break; - default: if (lang_gimplify_stmt && (*lang_gimplify_stmt) (&stmt)) { diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index c1d9d60ee72..e5eb8e3dbb0 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -2117,37 +2117,6 @@ pp_c_statement (c_pretty_printer *pp, tree stmt) pp_needs_newline (pp) = true; break; - case ASM_STMT: - { - bool has_volatile_p = ASM_VOLATILE_P (stmt); - bool is_extended = has_volatile_p || ASM_INPUTS (stmt) - || ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt); - pp_c_identifier (pp, is_extended ? "__asm__" : "asm"); - if (has_volatile_p) - pp_c_identifier (pp, "__volatile__"); - pp_space (pp); - pp_c_left_paren (pp); - pp_c_string_literal (pp, ASM_STRING (stmt)); - if (is_extended) - { - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_OUTPUTS (stmt)) - pp_expression (pp, ASM_OUTPUTS (stmt)); - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_INPUTS (stmt)) - pp_expression (pp, ASM_INPUTS (stmt)); - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_CLOBBERS (stmt)) - pp_expression (pp, ASM_CLOBBERS (stmt)); - } - pp_c_right_paren (pp); - pp_newline (pp); - } - break; - default: pp_unsupported_tree (pp, stmt); } diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index af7fd03abdf..32bf24a4193 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -6124,7 +6124,7 @@ process_init_element (tree value) /* Build a complete asm-statement, whose components are a CV_QUALIFIER (guaranteed to be 'volatile' or null) and ARGS (represented using - an ASM_STMT node). */ + an ASM_EXPR node). */ tree build_asm_stmt (tree cv_qualifier, tree args) { @@ -6137,7 +6137,7 @@ build_asm_stmt (tree cv_qualifier, tree args) some INPUTS, and some CLOBBERS. The latter three may be NULL. SIMPLE indicates whether there was anything at all after the string in the asm expression -- asm("blah") and asm("blah" : ) - are subtly different. We use a ASM_STMT node to represent this. */ + are subtly different. We use a ASM_EXPR node to represent this. */ tree build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers, bool simple) @@ -6188,7 +6188,7 @@ build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers, for (tail = inputs; tail; tail = TREE_CHAIN (tail)) TREE_VALUE (tail) = default_function_array_conversion (TREE_VALUE (tail)); - args = build_stmt (ASM_STMT, string, outputs, inputs, clobbers); + args = build_stmt (ASM_EXPR, string, outputs, inputs, clobbers); /* Simple asm statements are treated as volatile. */ if (simple) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3238043bab8..90636b0cc5c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-06-16 Richard Henderson + + * parser.c (cp_parser_asm_definition): Update commentary. + * pt.c (tsubst_expr): Use ASM_EXPR. + * semantics.c (finish_asm_stmt): Likewise. + 2004-06-16 Richard Henderson * decl.c (finish_destructor_body): Use LABEL_EXPR. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 4d4561cebc2..863c9a29582 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10035,12 +10035,12 @@ cp_parser_asm_definition (cp_parser* parser) /*consume_paren=*/true); cp_parser_require (parser, CPP_SEMICOLON, "`;'"); - /* Create the ASM_STMT. */ + /* Create the ASM_EXPR. */ if (at_function_scope_p ()) { asm_stmt = finish_asm_stmt (volatile_p, string, outputs, inputs, clobbers); - /* If the extended syntax was not used, mark the ASM_STMT. */ + /* If the extended syntax was not used, mark the ASM_EXPR. */ if (!extended_p) ASM_INPUT_P (asm_stmt) = 1; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0bbec66fa5f..a1e0a37d8c7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7997,7 +7997,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) finish_goto_stmt (tmp); break; - case ASM_STMT: + case ASM_EXPR: prep_stmt (t); tmp = finish_asm_stmt (ASM_VOLATILE_P (t), diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1b4f4677016..8961d8f6e46 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1073,7 +1073,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands, } } - r = build_stmt (ASM_STMT, string, + r = build_stmt (ASM_EXPR, string, output_operands, input_operands, clobbers); ASM_VOLATILE_P (r) = volatile_p; diff --git a/gcc/tree.h b/gcc/tree.h index a1db1f049d2..aa1511fc4de 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1081,7 +1081,7 @@ struct tree_vec GTY(()) a goto statement. */ #define GOTO_DESTINATION(NODE) TREE_OPERAND ((NODE), 0) -/* ASM_STMT accessors. ASM_STRING returns a STRING_CST for the +/* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and ASM_CLOBBERS represent the outputs, inputs, and clobbers for the statement. */