* 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
+2004-06-16 Richard Henderson <rth@redhat.com>
+
+ * 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 <rth@redhat.com>
* c-common.def (GOTO_STMT, LABEL_STMT): Remove.
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
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)
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. */
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);
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))
{
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);
}
\f
/* 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)
{
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)
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)
+2004-06-16 Richard Henderson <rth@redhat.com>
+
+ * 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 <rth@redhat.com>
* decl.c (finish_destructor_body): Use LABEL_EXPR.
/*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;
}
finish_goto_stmt (tmp);
break;
- case ASM_STMT:
+ case ASM_EXPR:
prep_stmt (t);
tmp = finish_asm_stmt
(ASM_VOLATILE_P (t),
}
}
- r = build_stmt (ASM_STMT, string,
+ r = build_stmt (ASM_EXPR, string,
output_operands, input_operands,
clobbers);
ASM_VOLATILE_P (r) = volatile_p;
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. */