aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-12-08 12:01:59 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-12-08 12:01:59 +0000
commitcb97d97deebd67dc9988b51210f1432ecb924145 (patch)
treeaf1bbb1acd95fad4ba7823197532eaeafdd00ff3 /gcc/cp
parent18d6067bcd57dcc02099060cf91717faaca0b05b (diff)
downloadgcc-cb97d97deebd67dc9988b51210f1432ecb924145.zip
gcc-cb97d97deebd67dc9988b51210f1432ecb924145.tar.gz
gcc-cb97d97deebd67dc9988b51210f1432ecb924145.tar.bz2
c-lex.c (c_lex): Peek a token ahead for a string to concatenate...
* c-lex.c (c_lex): Peek a token ahead for a string to concatenate, using combine_strings to do the concatenation. * c-parse.in: Replace uses of the string non-terminal with STRING. Don't attempt string concatenation. (OBJC_STRING): New terminal. (string): Remove non-terminal. (_yylex): Call combine_strings on function names. Generate OBJC_STRING terminals; don't pass '@' on to yacc. * c-typeck.c (simple_asm_stmt): Don't concatenate strings here. (build_asm_stmt): Similarly. cp: * parse.y: Replace uses of the string non-terminal with STRING. Don't perform string concatentaion here. (string): Remove non-terminal. * semantics.c (finish_asm_stmt): Don't concatenate strings here. From-SVN: r47792
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parse.y46
-rw-r--r--gcc/cp/semantics.c3
3 files changed, 25 insertions, 31 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 443f07f..8329fb3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-08 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * parse.y: Replace uses of the string non-terminal with STRING.
+ Don't perform string concatentaion here.
+ (string): Remove non-terminal.
+ * semantics.c (finish_asm_stmt): Don't concatenate strings here.
+
2001-12-05 Jason Merrill <jason@redhat.com>
* cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Define.
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index a27f288..e5bedd3 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.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 2a31da0..75cfa69 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -883,9 +883,6 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
tree r;
tree t;
- if (TREE_CHAIN (string))
- string = combine_strings (string);
-
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
{