diff options
Diffstat (limited to 'gcc/cp/parse.y')
-rw-r--r-- | gcc/cp/parse.y | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index a27f288eedc..e5bedd3ed1d 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -259,8 +259,7 @@ cp_parse_init () yylval contains an IDENTIFIER_NODE which indicates which one. */ %token VAR_FUNC_NAME -/* String constants in raw form. - yylval is a STRING_CST node. */ +/* String constants as arrays of a suitable type. */ %token STRING /* "...", used for functions with variable arglists. */ @@ -329,7 +328,7 @@ cp_parse_init () %type <ttype> PFUNCNAME maybe_identifier %type <ttype> paren_expr_or_null nontrivial_exprlist SELFNAME %type <ttype> expr_no_commas expr_no_comma_rangle -%type <ttype> cast_expr unary_expr primary string STRING +%type <ttype> cast_expr unary_expr primary STRING %type <ttype> reserved_declspecs boolean.literal %type <ttype> reserved_typespecquals %type <ttype> SCSPEC TYPESPEC CV_QUALIFIER maybe_cv_qualifier @@ -497,9 +496,8 @@ extdef: { do_pending_inlines (); } | template_def { do_pending_inlines (); } - | asm_keyword '(' string ')' ';' - { if (TREE_CHAIN ($3)) $3 = combine_strings ($3); - assemble_asm ($3); } + | asm_keyword '(' STRING ')' ';' + { assemble_asm ($3); } | extern_lang_string '{' extdefs_opt '}' { pop_lang_context (); } | extern_lang_string .hush_warning fndef .warning_ok eat_saved_input @@ -1547,9 +1545,8 @@ primary: } | CONSTANT | boolean.literal - | string + | STRING { - $$ = combine_strings ($$); /* combine_strings doesn't set up TYPE_MAIN_VARIANT of a const array the way we want, so fix it. */ if (flag_const_strings) @@ -1751,13 +1748,6 @@ boolean.literal: { $$ = boolean_false_node; } ; -/* Produces a STRING_CST with perhaps more STRING_CSTs chained onto it. */ -string: - STRING - | string STRING - { $$ = chainon ($$, $2); } - ; - nodecls: /* empty */ { @@ -2041,8 +2031,8 @@ nomods_initdecls: maybeasm: /* empty */ { $$ = NULL_TREE; } - | asm_keyword '(' string ')' - { if (TREE_CHAIN ($3)) $3 = combine_strings ($3); $$ = $3; } + | asm_keyword '(' STRING ')' + { $$ = $3; } ; initdcl: @@ -3439,27 +3429,27 @@ simple_stmt: { $$ = finish_return_stmt (NULL_TREE); } | RETURN_KEYWORD expr ';' { $$ = finish_return_stmt ($2); } - | asm_keyword maybe_cv_qualifier '(' string ')' ';' + | asm_keyword maybe_cv_qualifier '(' STRING ')' ';' { $$ = finish_asm_stmt ($2, $4, NULL_TREE, NULL_TREE, NULL_TREE); ASM_INPUT_P ($$) = 1; } /* This is the case with just output operands. */ - | asm_keyword maybe_cv_qualifier '(' string ':' asm_operands ')' ';' + | asm_keyword maybe_cv_qualifier '(' STRING ':' asm_operands ')' ';' { $$ = finish_asm_stmt ($2, $4, $6, NULL_TREE, NULL_TREE); } /* This is the case with input operands as well. */ - | asm_keyword maybe_cv_qualifier '(' string ':' asm_operands ':' + | asm_keyword maybe_cv_qualifier '(' STRING ':' asm_operands ':' asm_operands ')' ';' { $$ = finish_asm_stmt ($2, $4, $6, $8, NULL_TREE); } - | asm_keyword maybe_cv_qualifier '(' string SCOPE asm_operands ')' ';' + | asm_keyword maybe_cv_qualifier '(' STRING SCOPE asm_operands ')' ';' { $$ = finish_asm_stmt ($2, $4, NULL_TREE, $6, NULL_TREE); } /* This is the case with clobbered registers as well. */ - | asm_keyword maybe_cv_qualifier '(' string ':' asm_operands ':' + | asm_keyword maybe_cv_qualifier '(' STRING ':' asm_operands ':' asm_operands ':' asm_clobbers ')' ';' { $$ = finish_asm_stmt ($2, $4, $6, $8, $10); } - | asm_keyword maybe_cv_qualifier '(' string SCOPE asm_operands ':' + | asm_keyword maybe_cv_qualifier '(' STRING SCOPE asm_operands ':' asm_clobbers ')' ';' { $$ = finish_asm_stmt ($2, $4, NULL_TREE, $6, $8); } - | asm_keyword maybe_cv_qualifier '(' string ':' asm_operands SCOPE + | asm_keyword maybe_cv_qualifier '(' STRING ':' asm_operands SCOPE asm_clobbers ')' ';' { $$ = finish_asm_stmt ($2, $4, $6, NULL_TREE, $8); } | GOTO '*' expr ';' @@ -3614,10 +3604,10 @@ asm_operand: ; asm_clobbers: - string - { $$ = tree_cons (NULL_TREE, combine_strings ($1), NULL_TREE);} - | asm_clobbers ',' string - { $$ = tree_cons (NULL_TREE, combine_strings ($3), $1); } + STRING + { $$ = tree_cons (NULL_TREE, $1, NULL_TREE);} + | asm_clobbers ',' STRING + { $$ = tree_cons (NULL_TREE, $3, $1); } ; /* This is what appears inside the parens in a function declarator. |