diff options
author | YamaArashi <shadow962@live.com> | 2016-02-12 15:21:09 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-02-12 15:21:09 -0800 |
commit | 8e9f3932d7e21ece4840965a5018bcd3c23c5a1b (patch) | |
tree | bdcde1004e64486518406f85bb7c0815cd26b711 /gcc | |
parent | fb95ff91be532f3b63786339ea3cb28694aef172 (diff) |
remove more objc stuff
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/Makefile.in | 12 | ||||
-rwxr-xr-x | gcc/c-common.c | 7 | ||||
-rwxr-xr-x | gcc/c-decl.c | 12 | ||||
-rwxr-xr-x | gcc/c-lang.c | 163 | ||||
-rwxr-xr-x | gcc/c-lex.c | 63 | ||||
-rw-r--r-- | gcc/c-parse.c | 668 | ||||
-rwxr-xr-x | gcc/c-parse.in | 2 | ||||
-rwxr-xr-x | gcc/c-tree.h | 17 | ||||
-rwxr-xr-x | gcc/c-typeck.c | 32 | ||||
-rwxr-xr-x | gcc/defaults.h | 10 | ||||
-rwxr-xr-x | gcc/print-tree.c | 2 | ||||
-rwxr-xr-x | gcc/testsuite/lib/f-torture.exp | 317 | ||||
-rwxr-xr-x | gcc/testsuite/lib/g++-dg.exp | 83 | ||||
-rwxr-xr-x | gcc/testsuite/lib/g++.exp | 235 | ||||
-rwxr-xr-x | gcc/testsuite/lib/g77.exp | 274 | ||||
-rwxr-xr-x | gcc/testsuite/lib/mike-g++.exp | 264 | ||||
-rwxr-xr-x | gcc/testsuite/lib/mike-g77.exp | 262 | ||||
-rwxr-xr-x | gcc/testsuite/lib/objc-torture.exp | 316 | ||||
-rwxr-xr-x | gcc/testsuite/lib/objc.exp | 269 | ||||
-rwxr-xr-x | gcc/toplev.c | 66 | ||||
-rwxr-xr-x | gcc/tree.c | 4 | ||||
-rwxr-xr-x | gcc/tree.h | 21 |
22 files changed, 370 insertions, 2729 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 5e3173a..8b8deef 100755 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1197,13 +1197,13 @@ stmp-multilib-sub: # C language specific files. # CYGNUS LOCAL: built in build directory -c-parse.o : c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \ +c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \ c-tree.h input.h flags.h system.h toplev.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c c-parse.c + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c c-parse.h : c-parse.c -c-parse.c : c-parse.y - @echo expect 46 shift/reduce conflicts. - $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c +#c-parse.c : c-parse.y +# @echo expect 46 shift/reduce conflicts. +# $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c c-parse.y : $(srcdir)/c-parse.in echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \ @@ -1221,8 +1221,6 @@ c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \ output.h toplev.h c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \ output.h $(EXPR_H) $(RTL_H) toplev.h -c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h toplev.h \ - output.h # CYGNUS LOCAL: built in build directory c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \ c-parse.h input.h flags.h c-gperf.h c-pragma.h \ diff --git a/gcc/c-common.c b/gcc/c-common.c index 19e9207..a55df35 100755 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -2796,6 +2796,13 @@ unsigned char *yy_cur, *yy_lim; #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ()) #define UNGETC(c) ((c), yy_cur--) +void cpplib_init() +{ + cpp_reader_init (&parse_in); + parse_in.opts = &parse_options; + cpp_options_init (&parse_options); +} + int yy_get_token () { diff --git a/gcc/c-decl.c b/gcc/c-decl.c index f61b499..71bf948 100755 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2615,9 +2615,6 @@ implicitly_declare (functionid) If flag_traditional is set, pushdecl does it top-level. */ pushdecl (decl); - /* This is a no-op in c-lang.c or something real in objc-actions.c. */ - maybe_objc_check_decl (decl); - rest_of_decl_compilation (decl, NULL_PTR, 0, 0); if (mesg_implicit_function_declaration && implicit_warning) @@ -4082,8 +4079,6 @@ finish_decl (decl, init, asmspec_tree) { push_obstacks_nochange (); end_temporary_allocation (); - /* This is a no-op in c-lang.c or something real in objc-actions.c. */ - maybe_objc_check_decl (decl); rest_of_decl_compilation (decl, asmspec, (DECL_CONTEXT (decl) == 0 || TREE_ASM_WRITTEN (decl)), @@ -4092,8 +4087,6 @@ finish_decl (decl, init, asmspec_tree) } else { - /* This is a no-op in c-lang.c or something real in objc-actions.c. */ - maybe_objc_check_decl (decl); rest_of_decl_compilation (decl, asmspec, DECL_CONTEXT (decl) == 0, 0); } @@ -4119,8 +4112,6 @@ finish_decl (decl, init, asmspec_tree) if (TREE_CODE (decl) == TYPE_DECL) { - /* This is a no-op in c-lang.c or something real in objc-actions.c. */ - maybe_objc_check_decl (decl); rest_of_decl_compilation (decl, NULL_PTR, DECL_CONTEXT (decl) == 0, 0); } @@ -5781,7 +5772,6 @@ grokfield (filename, line, declarator, declspecs, width) finish_decl (value, NULL_TREE, NULL_TREE); DECL_INITIAL (value) = width; - maybe_objc_check_decl (value); return value; } @@ -6106,8 +6096,6 @@ finish_struct (t, fieldlist, attributes) && TREE_CODE (decl) != TYPE_DECL) { layout_decl (decl, 0); - /* This is a no-op in c-lang.c or something real in objc-actions.c. */ - maybe_objc_check_decl (decl); rest_of_decl_compilation (decl, NULL_PTR, toplevel, 0); if (! toplevel) expand_decl (decl); diff --git a/gcc/c-lang.c b/gcc/c-lang.c deleted file mode 100755 index 89c371f..0000000 --- a/gcc/c-lang.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Language-specific hook definitions for C front end. - Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -#include "config.h" -#include "system.h" -#include "tree.h" -#include "input.h" -#include "c-tree.h" -#include "c-lex.h" -#include "toplev.h" -#include "output.h" - -#if USE_CPPLIB -#include "cpplib.h" -extern char *yy_cur; -extern cpp_reader parse_in; -extern cpp_options parse_options; -#endif - -/* Each of the functions defined here - is an alternative to a function in objc-actions.c. */ - -int -lang_decode_option (argc, argv) - int argc; - char **argv; -{ - return c_decode_option (argc, argv); -} - -void -lang_init_options () -{ -#if USE_CPPLIB - cpp_reader_init (&parse_in); - parse_in.opts = &parse_options; - cpp_options_init (&parse_options); -#endif -} - -void -lang_init () -{ - /* the beginning of the file is a new line; check for # */ - /* With luck, we discover the real source file's name from that - and put it in input_filename. */ -#if !USE_CPPLIB - ungetc (check_newline (), finput); -#else - check_newline (); - yy_cur--; -#endif -} - -void -lang_finish () -{ -} - -char * -lang_identify () -{ - return "c"; -} - -void -print_lang_statistics () -{ -} - -/* used by print-tree.c */ - -void -lang_print_xnode (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - -/* Used by c-lex.c, but only for objc. */ - -tree -lookup_interface (arg) - tree arg ATTRIBUTE_UNUSED; -{ - return 0; -} - -tree -is_class_name (arg) - tree arg ATTRIBUTE_UNUSED; -{ - return 0; -} - -void -maybe_objc_check_decl (decl) - tree decl ATTRIBUTE_UNUSED; -{ -} - -int -maybe_objc_comptypes (lhs, rhs, reflexive) - tree lhs ATTRIBUTE_UNUSED; - tree rhs ATTRIBUTE_UNUSED; - int reflexive ATTRIBUTE_UNUSED; -{ - return -1; -} - -tree -maybe_objc_method_name (decl) - tree decl ATTRIBUTE_UNUSED; -{ - return 0; -} - -tree -maybe_building_objc_message_expr () -{ - return 0; -} - -int -recognize_objc_keyword () -{ - return 0; -} - -tree -build_objc_string (len, str) - int len ATTRIBUTE_UNUSED; - char *str ATTRIBUTE_UNUSED; -{ - abort (); - return NULL_TREE; -} - -/* Called at end of parsing, but before end-of-file processing. */ - -void -finish_file () -{ -} diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 1b44817..6ddfd81 100755 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -75,10 +75,6 @@ extern int yy_get_token (); used in a context which makes it a reference to a variable. */ tree lastiddecl; -/* Nonzero enables objc features. */ - -int doing_objc_thang; - extern int yydebug; /* File used for outputting assembler code. */ @@ -97,8 +93,7 @@ extern FILE *asm_out_file; static int maxtoken; /* Current nominal length of token buffer. */ char *token_buffer; /* Pointer to token buffer. - Actual allocated length is maxtoken + 2. - This is not static because objc-parse.y uses it. */ + Actual allocated length is maxtoken + 2. */ static int indent_level = 0; /* Number of { minus number of }. */ @@ -272,8 +267,8 @@ init_lex () do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \ if (s) s->name = ""; } while (0) - if (! doing_objc_thang) - UNSET_RESERVED_WORD ("id"); + + UNSET_RESERVED_WORD ("id"); if (flag_traditional) { @@ -1094,7 +1089,6 @@ yylex () register char *p; register int value; int wide_flag = 0; - int objc_flag = 0; #if !USE_CPPLIB if (nextchar >= 0) @@ -1160,23 +1154,8 @@ yylex () goto letter; case '@': - if (!doing_objc_thang) - { - value = c; - break; - } - else - { - /* '@' may start a constant string object. */ - register int c = GETC (); - if (c == '"') - { - objc_flag = 1; - goto string_constant; - } - UNGETC (c); - /* Fall through to treat '@' as the start of an identifier. */ - } + value = c; + break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': @@ -1194,11 +1173,9 @@ yylex () case '$': letter: p = token_buffer; - while (ISALNUM (c) || c == '_' || c == '$' || c == '@') + while (ISALNUM (c) || c == '_' || c == '$') { /* Make sure this char really belongs in an identifier. */ - if (c == '@' && ! doing_objc_thang) - break; if (c == '$') { if (! dollars_in_ident) @@ -1235,16 +1212,6 @@ yylex () yylval.ttype = ridpointers[(int) ptr->rid]; value = (int) ptr->token; - /* Only return OBJECTNAME if it is a typedef. */ - if (doing_objc_thang && value == OBJECTNAME) - { - lastiddecl = lookup_name(yylval.ttype); - - if (lastiddecl == NULL_TREE - || TREE_CODE (lastiddecl) != TYPE_DECL) - value = IDENTIFIER; - } - /* Even if we decided to recognize asm, still perhaps warn. */ if (pedantic && (value == ASM_KEYWORD || value == TYPEOF @@ -1285,16 +1252,6 @@ yylex () TREE_STRING_POINTER (stringval)); value = STRING; } - else if (doing_objc_thang) - { - tree objc_interface_decl = is_class_name (yylval.ttype); - - if (objc_interface_decl) - { - value = CLASSNAME; - yylval.ttype = objc_interface_decl; - } - } } break; @@ -2139,14 +2096,6 @@ yylex () TREE_TYPE (yylval.ttype) = wchar_array_type_node; value = STRING; } - else if (objc_flag) - { - /* Return an Objective-C @"..." constant string object. */ - yylval.ttype = build_objc_string (p - (token_buffer + 1), - token_buffer + 1); - TREE_TYPE (yylval.ttype) = char_array_type_node; - value = OBJC_STRING; - } else { yylval.ttype = build_string (p - (token_buffer + 1), diff --git a/gcc/c-parse.c b/gcc/c-parse.c index c670e59..bde5227 100644 --- a/gcc/c-parse.c +++ b/gcc/c-parse.c @@ -192,7 +192,7 @@ /* Copy the first part of user declarations. */ -#line 56 "c-parse.y" + #include "config.h" #include "system.h" @@ -242,11 +242,11 @@ char *language_string = "GNU C"; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 87 "c-parse.y" + {long itype; tree ttype; enum tree_code code; char *filename; int lineno; int ends_in_label; } /* Line 187 of yacc.c. */ -#line 250 "c-parse.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -256,7 +256,7 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -#line 204 "c-parse.y" + /* Number of statements (loosely speaking) and compound statements seen so far. */ @@ -286,7 +286,7 @@ extern void yyprint PROTO ((FILE *, int, YYSTYPE)); /* Line 216 of yacc.c. */ -#line 290 "c-parse.c" + #ifdef short # undef short @@ -2511,36 +2511,34 @@ yyreduce: switch (yyn) { case 2: -#line 234 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids an empty source file"); - finish_file (); ;} break; case 3: -#line 239 "c-parse.y" + { /* In case there were missing closebraces, get us back to the global binding level. */ while (! global_bindings_p ()) poplevel (0, 0, 0); - finish_file (); ;} break; case 4: -#line 253 "c-parse.y" + {(yyval.ttype) = NULL_TREE; ;} break; case 6: -#line 254 "c-parse.y" + {(yyval.ttype) = NULL_TREE; ;} break; case 10: -#line 261 "c-parse.y" + { STRIP_NOPS ((yyvsp[(3) - (5)].ttype)); if ((TREE_CODE ((yyvsp[(3) - (5)].ttype)) == ADDR_EXPR && TREE_CODE (TREE_OPERAND ((yyvsp[(3) - (5)].ttype), 0)) == STRING_CST) @@ -2551,12 +2549,12 @@ yyreduce: break; case 11: -#line 269 "c-parse.y" + { pedantic = (yyvsp[(1) - (2)].itype); ;} break; case 12: -#line 274 "c-parse.y" + { if (pedantic) error ("ANSI C forbids data definition with no type or storage class"); else if (!flag_traditional) @@ -2569,7 +2567,7 @@ yyreduce: break; case 13: -#line 284 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -2577,7 +2575,7 @@ yyreduce: break; case 14: -#line 289 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -2585,23 +2583,23 @@ yyreduce: break; case 15: -#line 294 "c-parse.y" + { pedwarn ("empty declaration"); ;} break; case 16: -#line 296 "c-parse.y" + { shadow_tag ((yyvsp[(1) - (2)].ttype)); ;} break; case 19: -#line 300 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C does not allow extra `;' outside of a function"); ;} break; case 20: -#line 306 "c-parse.y" + { if (! start_function (current_declspecs, (yyvsp[(3) - (3)].ttype), prefix_attributes, NULL_TREE, 0)) YYERROR1; @@ -2609,12 +2607,12 @@ yyreduce: break; case 21: -#line 311 "c-parse.y" + { store_parm_decls (); ;} break; case 22: -#line 313 "c-parse.y" + { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2623,7 +2621,7 @@ yyreduce: break; case 23: -#line 319 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -2631,7 +2629,7 @@ yyreduce: break; case 24: -#line 324 "c-parse.y" + { if (! start_function (current_declspecs, (yyvsp[(3) - (3)].ttype), prefix_attributes, NULL_TREE, 0)) YYERROR1; @@ -2639,12 +2637,12 @@ yyreduce: break; case 25: -#line 329 "c-parse.y" + { store_parm_decls (); ;} break; case 26: -#line 331 "c-parse.y" + { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2653,7 +2651,7 @@ yyreduce: break; case 27: -#line 337 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -2661,7 +2659,7 @@ yyreduce: break; case 28: -#line 342 "c-parse.y" + { if (! start_function (NULL_TREE, (yyvsp[(2) - (2)].ttype), prefix_attributes, NULL_TREE, 0)) YYERROR1; @@ -2669,12 +2667,12 @@ yyreduce: break; case 29: -#line 347 "c-parse.y" + { store_parm_decls (); ;} break; case 30: -#line 349 "c-parse.y" + { finish_function (0); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -2683,7 +2681,7 @@ yyreduce: break; case 31: -#line 355 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -2691,79 +2689,79 @@ yyreduce: break; case 34: -#line 367 "c-parse.y" + { (yyval.code) = ADDR_EXPR; ;} break; case 35: -#line 369 "c-parse.y" + { (yyval.code) = NEGATE_EXPR; ;} break; case 36: -#line 371 "c-parse.y" + { (yyval.code) = CONVERT_EXPR; ;} break; case 37: -#line 373 "c-parse.y" + { (yyval.code) = PREINCREMENT_EXPR; ;} break; case 38: -#line 375 "c-parse.y" + { (yyval.code) = PREDECREMENT_EXPR; ;} break; case 39: -#line 377 "c-parse.y" + { (yyval.code) = BIT_NOT_EXPR; ;} break; case 40: -#line 379 "c-parse.y" + { (yyval.code) = TRUTH_NOT_EXPR; ;} break; case 41: -#line 383 "c-parse.y" + { (yyval.ttype) = build_compound_expr ((yyvsp[(1) - (1)].ttype)); ;} break; case 42: -#line 388 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 44: -#line 394 "c-parse.y" + { (yyval.ttype) = build_tree_list (NULL_TREE, (yyvsp[(1) - (1)].ttype)); ;} break; case 45: -#line 396 "c-parse.y" + { chainon ((yyvsp[(1) - (3)].ttype), build_tree_list (NULL_TREE, (yyvsp[(3) - (3)].ttype))); ;} break; case 47: -#line 402 "c-parse.y" + { (yyval.ttype) = build_indirect_ref ((yyvsp[(2) - (2)].ttype), "unary *"); ;} break; case 48: -#line 405 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); pedantic = (yyvsp[(1) - (2)].itype); ;} break; case 49: -#line 408 "c-parse.y" + { (yyval.ttype) = build_unary_op ((yyvsp[(1) - (2)].code), (yyvsp[(2) - (2)].ttype), 0); overflow_warning ((yyval.ttype)); ;} break; case 50: -#line 412 "c-parse.y" + { tree label = lookup_label ((yyvsp[(2) - (2)].ttype)); if (pedantic) pedwarn ("ANSI C forbids `&&'"); @@ -2779,7 +2777,7 @@ yyreduce: break; case 51: -#line 440 "c-parse.y" + { skip_evaluation--; if (TREE_CODE ((yyvsp[(2) - (2)].ttype)) == COMPONENT_REF && DECL_C_BIT_FIELD (TREE_OPERAND ((yyvsp[(2) - (2)].ttype), 1))) @@ -2788,58 +2786,58 @@ yyreduce: break; case 52: -#line 446 "c-parse.y" + { skip_evaluation--; (yyval.ttype) = c_sizeof (groktypename ((yyvsp[(3) - (4)].ttype))); ;} break; case 53: -#line 449 "c-parse.y" + { skip_evaluation--; (yyval.ttype) = c_alignof_expr ((yyvsp[(2) - (2)].ttype)); ;} break; case 54: -#line 452 "c-parse.y" + { skip_evaluation--; (yyval.ttype) = c_alignof (groktypename ((yyvsp[(3) - (4)].ttype))); ;} break; case 55: -#line 455 "c-parse.y" + { (yyval.ttype) = build_unary_op (REALPART_EXPR, (yyvsp[(2) - (2)].ttype), 0); ;} break; case 56: -#line 457 "c-parse.y" + { (yyval.ttype) = build_unary_op (IMAGPART_EXPR, (yyvsp[(2) - (2)].ttype), 0); ;} break; case 57: -#line 461 "c-parse.y" + { skip_evaluation++; ;} break; case 58: -#line 465 "c-parse.y" + { skip_evaluation++; ;} break; case 60: -#line 471 "c-parse.y" + { tree type = groktypename ((yyvsp[(2) - (4)].ttype)); (yyval.ttype) = build_c_cast (type, (yyvsp[(4) - (4)].ttype)); ;} break; case 61: -#line 474 "c-parse.y" + { start_init (NULL_TREE, NULL, 0); (yyvsp[(2) - (4)].ttype) = groktypename ((yyvsp[(2) - (4)].ttype)); really_start_incremental_init ((yyvsp[(2) - (4)].ttype)); ;} break; case 62: -#line 478 "c-parse.y" + { char *name; tree result = pop_init_level (0); tree type = (yyvsp[(2) - (7)].ttype); @@ -2867,109 +2865,109 @@ yyreduce: break; case 64: -#line 507 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 65: -#line 509 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 66: -#line 511 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 67: -#line 513 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 68: -#line 515 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 69: -#line 517 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 70: -#line 519 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 71: -#line 521 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 72: -#line 523 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 73: -#line 525 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 74: -#line 527 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 75: -#line 529 "c-parse.y" + { (yyval.ttype) = parser_build_binary_op ((yyvsp[(2) - (3)].code), (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 76: -#line 531 "c-parse.y" + { (yyvsp[(1) - (2)].ttype) = truthvalue_conversion (default_conversion ((yyvsp[(1) - (2)].ttype))); skip_evaluation += (yyvsp[(1) - (2)].ttype) == boolean_false_node; ;} break; case 77: -#line 534 "c-parse.y" + { skip_evaluation -= (yyvsp[(1) - (4)].ttype) == boolean_false_node; (yyval.ttype) = parser_build_binary_op (TRUTH_ANDIF_EXPR, (yyvsp[(1) - (4)].ttype), (yyvsp[(4) - (4)].ttype)); ;} break; case 78: -#line 537 "c-parse.y" + { (yyvsp[(1) - (2)].ttype) = truthvalue_conversion (default_conversion ((yyvsp[(1) - (2)].ttype))); skip_evaluation += (yyvsp[(1) - (2)].ttype) == boolean_true_node; ;} break; case 79: -#line 540 "c-parse.y" + { skip_evaluation -= (yyvsp[(1) - (4)].ttype) == boolean_true_node; (yyval.ttype) = parser_build_binary_op (TRUTH_ORIF_EXPR, (yyvsp[(1) - (4)].ttype), (yyvsp[(4) - (4)].ttype)); ;} break; case 80: -#line 543 "c-parse.y" + { (yyvsp[(1) - (2)].ttype) = truthvalue_conversion (default_conversion ((yyvsp[(1) - (2)].ttype))); skip_evaluation += (yyvsp[(1) - (2)].ttype) == boolean_false_node; ;} break; case 81: -#line 546 "c-parse.y" + { skip_evaluation += (((yyvsp[(1) - (5)].ttype) == boolean_true_node) - ((yyvsp[(1) - (5)].ttype) == boolean_false_node)); ;} break; case 82: -#line 549 "c-parse.y" + { skip_evaluation -= (yyvsp[(1) - (7)].ttype) == boolean_true_node; (yyval.ttype) = build_conditional_expr ((yyvsp[(1) - (7)].ttype), (yyvsp[(4) - (7)].ttype), (yyvsp[(7) - (7)].ttype)); ;} break; case 83: -#line 552 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids omitting the middle term of a ?: expression"); /* Make sure first operand is calculated only once. */ @@ -2979,26 +2977,26 @@ yyreduce: break; case 84: -#line 559 "c-parse.y" + { skip_evaluation -= (yyvsp[(1) - (5)].ttype) == boolean_true_node; (yyval.ttype) = build_conditional_expr ((yyvsp[(1) - (5)].ttype), (yyvsp[(2) - (5)].ttype), (yyvsp[(5) - (5)].ttype)); ;} break; case 85: -#line 562 "c-parse.y" + { (yyval.ttype) = build_modify_expr ((yyvsp[(1) - (3)].ttype), NOP_EXPR, (yyvsp[(3) - (3)].ttype)); C_SET_EXP_ORIGINAL_CODE ((yyval.ttype), MODIFY_EXPR); ;} break; case 86: -#line 565 "c-parse.y" + { (yyval.ttype) = build_modify_expr ((yyvsp[(1) - (3)].ttype), (yyvsp[(2) - (3)].code), (yyvsp[(3) - (3)].ttype)); /* This inhibits warnings in truthvalue_conversion. */ C_SET_EXP_ORIGINAL_CODE ((yyval.ttype), ERROR_MARK); ;} break; case 87: -#line 572 "c-parse.y" + { (yyval.ttype) = lastiddecl; if (!(yyval.ttype) || (yyval.ttype) == error_mark_node) @@ -3099,12 +3097,12 @@ yyreduce: break; case 89: -#line 671 "c-parse.y" + { (yyval.ttype) = combine_strings ((yyvsp[(1) - (1)].ttype)); ;} break; case 90: -#line 673 "c-parse.y" + { char class = TREE_CODE_CLASS (TREE_CODE ((yyvsp[(2) - (3)].ttype))); if (class == 'e' || class == '1' || class == '2' || class == '<') @@ -3113,12 +3111,12 @@ yyreduce: break; case 91: -#line 679 "c-parse.y" + { (yyval.ttype) = error_mark_node; ;} break; case 92: -#line 681 "c-parse.y" + { if (current_function_decl == 0) { error ("braced-group within expression allowed only inside a function"); @@ -3135,7 +3133,7 @@ yyreduce: break; case 93: -#line 695 "c-parse.y" + { tree rtl_exp; if (pedantic) pedwarn ("ANSI C forbids braced-groups within expressions"); @@ -3161,24 +3159,24 @@ yyreduce: break; case 94: -#line 718 "c-parse.y" + { (yyval.ttype) = build_function_call ((yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 95: -#line 720 "c-parse.y" + { (yyval.ttype) = build_array_ref ((yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 96: -#line 722 "c-parse.y" + { (yyval.ttype) = build_component_ref ((yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 97: -#line 726 "c-parse.y" + { tree expr = build_indirect_ref ((yyvsp[(1) - (3)].ttype), "->"); @@ -3187,34 +3185,34 @@ yyreduce: break; case 98: -#line 732 "c-parse.y" + { (yyval.ttype) = build_unary_op (POSTINCREMENT_EXPR, (yyvsp[(1) - (2)].ttype), 0); ;} break; case 99: -#line 734 "c-parse.y" + { (yyval.ttype) = build_unary_op (POSTDECREMENT_EXPR, (yyvsp[(1) - (2)].ttype), 0); ;} break; case 101: -#line 741 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 104: -#line 750 "c-parse.y" + { c_mark_varargs (); if (pedantic) pedwarn ("ANSI C does not permit use of `varargs.h'"); ;} break; case 105: -#line 760 "c-parse.y" + { ;} break; case 110: -#line 776 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3222,7 +3220,7 @@ yyreduce: break; case 111: -#line 781 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3230,23 +3228,23 @@ yyreduce: break; case 112: -#line 786 "c-parse.y" + { shadow_tag_warned ((yyvsp[(1) - (2)].ttype), 1); pedwarn ("empty declaration"); ;} break; case 113: -#line 789 "c-parse.y" + { pedwarn ("empty declaration"); ;} break; case 114: -#line 798 "c-parse.y" + { ;} break; case 119: -#line 813 "c-parse.y" + { (yyval.itype) = suspend_momentary (); pending_xref_error (); declspec_stack = tree_cons (prefix_attributes, @@ -3257,12 +3255,12 @@ yyreduce: break; case 120: -#line 824 "c-parse.y" + { prefix_attributes = chainon (prefix_attributes, (yyvsp[(0) - (0)].ttype)); ;} break; case 121: -#line 829 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3270,7 +3268,7 @@ yyreduce: break; case 122: -#line 834 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3278,7 +3276,7 @@ yyreduce: break; case 123: -#line 839 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3286,7 +3284,7 @@ yyreduce: break; case 124: -#line 844 "c-parse.y" + { current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); declspec_stack = TREE_CHAIN (declspec_stack); @@ -3294,42 +3292,42 @@ yyreduce: break; case 125: -#line 849 "c-parse.y" + { shadow_tag ((yyvsp[(1) - (2)].ttype)); ;} break; case 126: -#line 851 "c-parse.y" + { pedwarn ("empty declaration"); ;} break; case 127: -#line 853 "c-parse.y" + { pedantic = (yyvsp[(1) - (2)].itype); ;} break; case 128: -#line 863 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 129: -#line 865 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(3) - (3)].ttype), tree_cons (NULL_TREE, (yyvsp[(2) - (3)].ttype), (yyvsp[(1) - (3)].ttype))); ;} break; case 130: -#line 869 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 131: -#line 871 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 132: -#line 873 "c-parse.y" + { if (extra_warnings) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER ((yyvsp[(2) - (2)].ttype))); @@ -3337,32 +3335,32 @@ yyreduce: break; case 133: -#line 878 "c-parse.y" + { (yyval.ttype) = tree_cons ((yyvsp[(2) - (2)].ttype), NULL_TREE, (yyvsp[(1) - (2)].ttype)); ;} break; case 134: -#line 883 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 135: -#line 885 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(3) - (3)].ttype), tree_cons (NULL_TREE, (yyvsp[(2) - (3)].ttype), (yyvsp[(1) - (3)].ttype))); ;} break; case 136: -#line 890 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 137: -#line 892 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 138: -#line 894 "c-parse.y" + { if (extra_warnings) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER ((yyvsp[(2) - (2)].ttype))); @@ -3370,44 +3368,44 @@ yyreduce: break; case 139: -#line 907 "c-parse.y" + { (yyval.ttype) = (yyvsp[(1) - (1)].ttype); ;} break; case 140: -#line 909 "c-parse.y" + { (yyval.ttype) = tree_cons ((yyvsp[(1) - (1)].ttype), NULL_TREE, NULL_TREE); ;} break; case 141: -#line 911 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 142: -#line 913 "c-parse.y" + { (yyval.ttype) = tree_cons ((yyvsp[(2) - (2)].ttype), NULL_TREE, (yyvsp[(1) - (2)].ttype)); ;} break; case 143: -#line 918 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (1)].ttype), NULL_TREE); TREE_STATIC ((yyval.ttype)) = 1; ;} break; case 144: -#line 921 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (1)].ttype), NULL_TREE); ;} break; case 145: -#line 923 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); TREE_STATIC ((yyval.ttype)) = 1; ;} break; case 146: -#line 926 "c-parse.y" + { if (extra_warnings && TREE_STATIC ((yyvsp[(1) - (2)].ttype))) warning ("`%s' is not at beginning of declaration", IDENTIFIER_POINTER ((yyvsp[(2) - (2)].ttype))); @@ -3416,69 +3414,69 @@ yyreduce: break; case 147: -#line 940 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 148: -#line 942 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(3) - (3)].ttype), tree_cons (NULL_TREE, (yyvsp[(2) - (3)].ttype), (yyvsp[(1) - (3)].ttype))); ;} break; case 149: -#line 946 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 150: -#line 948 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 153: -#line 958 "c-parse.y" + { /* For a typedef name, record the meaning, not the name. In case of `foo foo, bar;'. */ (yyval.ttype) = lookup_name ((yyvsp[(1) - (1)].ttype)); ;} break; case 154: -#line 962 "c-parse.y" + { (yyval.ttype) = TREE_TYPE ((yyvsp[(3) - (4)].ttype)); ;} break; case 155: -#line 964 "c-parse.y" + { (yyval.ttype) = groktypename ((yyvsp[(3) - (4)].ttype)); ;} break; case 163: -#line 986 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 164: -#line 988 "c-parse.y" + { if (TREE_CHAIN ((yyvsp[(3) - (4)].ttype))) (yyvsp[(3) - (4)].ttype) = combine_strings ((yyvsp[(3) - (4)].ttype)); (yyval.ttype) = (yyvsp[(3) - (4)].ttype); ;} break; case 165: -#line 995 "c-parse.y" + { (yyval.ttype) = start_decl ((yyvsp[(1) - (4)].ttype), current_declspecs, 1, (yyvsp[(3) - (4)].ttype), prefix_attributes); start_init ((yyval.ttype), (yyvsp[(2) - (4)].ttype), global_bindings_p ()); ;} break; case 166: -#line 1000 "c-parse.y" + { finish_init (); finish_decl ((yyvsp[(5) - (6)].ttype), (yyvsp[(6) - (6)].ttype), (yyvsp[(2) - (6)].ttype)); ;} break; case 167: -#line 1003 "c-parse.y" + { tree d = start_decl ((yyvsp[(1) - (3)].ttype), current_declspecs, 0, (yyvsp[(3) - (3)].ttype), prefix_attributes); finish_decl (d, NULL_TREE, (yyvsp[(2) - (3)].ttype)); @@ -3486,88 +3484,88 @@ yyreduce: break; case 168: -#line 1011 "c-parse.y" + { (yyval.ttype) = start_decl ((yyvsp[(1) - (4)].ttype), current_declspecs, 1, (yyvsp[(3) - (4)].ttype), prefix_attributes); start_init ((yyval.ttype), (yyvsp[(2) - (4)].ttype), global_bindings_p ()); ;} break; case 169: -#line 1016 "c-parse.y" + { finish_init (); decl_attributes ((yyvsp[(5) - (6)].ttype), (yyvsp[(3) - (6)].ttype), prefix_attributes); finish_decl ((yyvsp[(5) - (6)].ttype), (yyvsp[(6) - (6)].ttype), (yyvsp[(2) - (6)].ttype)); ;} break; case 170: -#line 1020 "c-parse.y" + { tree d = start_decl ((yyvsp[(1) - (3)].ttype), current_declspecs, 0, (yyvsp[(3) - (3)].ttype), prefix_attributes); finish_decl (d, NULL_TREE, (yyvsp[(2) - (3)].ttype)); ;} break; case 171: -#line 1028 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 172: -#line 1030 "c-parse.y" + { (yyval.ttype) = (yyvsp[(1) - (1)].ttype); ;} break; case 173: -#line 1035 "c-parse.y" + { (yyval.ttype) = (yyvsp[(1) - (1)].ttype); ;} break; case 174: -#line 1037 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 175: -#line 1042 "c-parse.y" + { (yyval.ttype) = (yyvsp[(4) - (6)].ttype); ;} break; case 176: -#line 1047 "c-parse.y" + { (yyval.ttype) = (yyvsp[(1) - (1)].ttype); ;} break; case 177: -#line 1049 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 178: -#line 1054 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 179: -#line 1056 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (1)].ttype), NULL_TREE); ;} break; case 180: -#line 1058 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (4)].ttype), build_tree_list (NULL_TREE, (yyvsp[(3) - (4)].ttype))); ;} break; case 181: -#line 1060 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (6)].ttype), tree_cons (NULL_TREE, (yyvsp[(3) - (6)].ttype), (yyvsp[(5) - (6)].ttype))); ;} break; case 182: -#line 1062 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 188: -#line 1080 "c-parse.y" + { really_start_incremental_init (NULL_TREE); /* Note that the call to clear_momentary is in process_init_element. */ @@ -3575,7 +3573,7 @@ yyreduce: break; case 189: -#line 1085 "c-parse.y" + { (yyval.ttype) = pop_init_level (0); if ((yyval.ttype) == error_mark_node && ! (yychar == STRING || yychar == CONSTANT)) @@ -3585,53 +3583,53 @@ yyreduce: break; case 190: -#line 1093 "c-parse.y" + { (yyval.ttype) = error_mark_node; ;} break; case 191: -#line 1099 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids empty initializer braces"); ;} break; case 197: -#line 1115 "c-parse.y" + { set_init_label ((yyvsp[(1) - (2)].ttype)); ;} break; case 200: -#line 1122 "c-parse.y" + { push_init_level (0); ;} break; case 201: -#line 1124 "c-parse.y" + { process_init_element (pop_init_level (0)); ;} break; case 202: -#line 1126 "c-parse.y" + { process_init_element ((yyvsp[(1) - (1)].ttype)); ;} break; case 206: -#line 1137 "c-parse.y" + { set_init_label ((yyvsp[(2) - (2)].ttype)); ;} break; case 207: -#line 1142 "c-parse.y" + { set_init_index ((yyvsp[(2) - (5)].ttype), (yyvsp[(4) - (5)].ttype)); ;} break; case 208: -#line 1144 "c-parse.y" + { set_init_index ((yyvsp[(2) - (3)].ttype), NULL_TREE); ;} break; case 209: -#line 1149 "c-parse.y" + { push_c_function_context (); if (! start_function (current_declspecs, (yyvsp[(1) - (1)].ttype), prefix_attributes, NULL_TREE, 1)) @@ -3643,18 +3641,18 @@ yyreduce: break; case 210: -#line 1158 "c-parse.y" + { store_parm_decls (); ;} break; case 211: -#line 1166 "c-parse.y" + { finish_function (1); pop_c_function_context (); ;} break; case 212: -#line 1172 "c-parse.y" + { push_c_function_context (); if (! start_function (current_declspecs, (yyvsp[(1) - (1)].ttype), prefix_attributes, NULL_TREE, 1)) @@ -3666,53 +3664,53 @@ yyreduce: break; case 213: -#line 1181 "c-parse.y" + { store_parm_decls (); ;} break; case 214: -#line 1189 "c-parse.y" + { finish_function (1); pop_c_function_context (); ;} break; case 217: -#line 1205 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (3)].ttype); ;} break; case 218: -#line 1207 "c-parse.y" + { (yyval.ttype) = build_nt (CALL_EXPR, (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype), NULL_TREE); ;} break; case 219: -#line 1212 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 220: -#line 1214 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (3)].ttype), NULL_TREE); ;} break; case 221: -#line 1216 "c-parse.y" + { (yyval.ttype) = make_pointer_declarator ((yyvsp[(2) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 222: -#line 1223 "c-parse.y" + { (yyval.ttype) = (yyvsp[(3) - (3)].ttype); ;} break; case 224: -#line 1234 "c-parse.y" + { (yyval.ttype) = build_nt (CALL_EXPR, (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype), NULL_TREE); ;} break; case 225: -#line 1239 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), NULL_TREE); if (! flag_isoc9x) error ("`[*]' in parameter declaration only allowed in ISO C 9x"); @@ -3720,42 +3718,42 @@ yyreduce: break; case 226: -#line 1244 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 227: -#line 1246 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (3)].ttype), NULL_TREE); ;} break; case 228: -#line 1248 "c-parse.y" + { (yyval.ttype) = make_pointer_declarator ((yyvsp[(2) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 229: -#line 1255 "c-parse.y" + { (yyval.ttype) = (yyvsp[(3) - (3)].ttype); ;} break; case 231: -#line 1264 "c-parse.y" + { (yyval.ttype) = build_nt (CALL_EXPR, (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype), NULL_TREE); ;} break; case 232: -#line 1269 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (3)].ttype); ;} break; case 233: -#line 1271 "c-parse.y" + { (yyval.ttype) = make_pointer_declarator ((yyvsp[(2) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 234: -#line 1273 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), NULL_TREE); if (! flag_isoc9x) error ("`[*]' in parameter declaration only allowed in ISO C 9x"); @@ -3763,160 +3761,160 @@ yyreduce: break; case 235: -#line 1278 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 236: -#line 1280 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (3)].ttype), NULL_TREE); ;} break; case 237: -#line 1287 "c-parse.y" + { (yyval.ttype) = (yyvsp[(3) - (3)].ttype); ;} break; case 239: -#line 1293 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 240: -#line 1295 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); ;} break; case 241: -#line 1300 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 242: -#line 1302 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); ;} break; case 243: -#line 1307 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 244: -#line 1309 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); ;} break; case 245: -#line 1314 "c-parse.y" + { (yyval.ttype) = start_struct (RECORD_TYPE, (yyvsp[(2) - (3)].ttype)); /* Start scope of tag before parsing components. */ ;} break; case 246: -#line 1318 "c-parse.y" + { (yyval.ttype) = finish_struct ((yyvsp[(4) - (7)].ttype), (yyvsp[(5) - (7)].ttype), chainon ((yyvsp[(1) - (7)].ttype), (yyvsp[(7) - (7)].ttype))); ;} break; case 247: -#line 1320 "c-parse.y" + { (yyval.ttype) = finish_struct (start_struct (RECORD_TYPE, NULL_TREE), (yyvsp[(3) - (5)].ttype), chainon ((yyvsp[(1) - (5)].ttype), (yyvsp[(5) - (5)].ttype))); ;} break; case 248: -#line 1324 "c-parse.y" + { (yyval.ttype) = xref_tag (RECORD_TYPE, (yyvsp[(2) - (2)].ttype)); ;} break; case 249: -#line 1326 "c-parse.y" + { (yyval.ttype) = start_struct (UNION_TYPE, (yyvsp[(2) - (3)].ttype)); ;} break; case 250: -#line 1328 "c-parse.y" + { (yyval.ttype) = finish_struct ((yyvsp[(4) - (7)].ttype), (yyvsp[(5) - (7)].ttype), chainon ((yyvsp[(1) - (7)].ttype), (yyvsp[(7) - (7)].ttype))); ;} break; case 251: -#line 1330 "c-parse.y" + { (yyval.ttype) = finish_struct (start_struct (UNION_TYPE, NULL_TREE), (yyvsp[(3) - (5)].ttype), chainon ((yyvsp[(1) - (5)].ttype), (yyvsp[(5) - (5)].ttype))); ;} break; case 252: -#line 1334 "c-parse.y" + { (yyval.ttype) = xref_tag (UNION_TYPE, (yyvsp[(2) - (2)].ttype)); ;} break; case 253: -#line 1336 "c-parse.y" + { (yyvsp[(3) - (3)].itype) = suspend_momentary (); (yyval.ttype) = start_enum ((yyvsp[(2) - (3)].ttype)); ;} break; case 254: -#line 1339 "c-parse.y" + { (yyval.ttype)= finish_enum ((yyvsp[(4) - (8)].ttype), nreverse ((yyvsp[(5) - (8)].ttype)), chainon ((yyvsp[(1) - (8)].ttype), (yyvsp[(8) - (8)].ttype))); resume_momentary ((yyvsp[(3) - (8)].itype)); ;} break; case 255: -#line 1342 "c-parse.y" + { (yyvsp[(2) - (2)].itype) = suspend_momentary (); (yyval.ttype) = start_enum (NULL_TREE); ;} break; case 256: -#line 1345 "c-parse.y" + { (yyval.ttype)= finish_enum ((yyvsp[(3) - (7)].ttype), nreverse ((yyvsp[(4) - (7)].ttype)), chainon ((yyvsp[(1) - (7)].ttype), (yyvsp[(7) - (7)].ttype))); resume_momentary ((yyvsp[(2) - (7)].itype)); ;} break; case 257: -#line 1348 "c-parse.y" + { (yyval.ttype) = xref_tag (ENUMERAL_TYPE, (yyvsp[(2) - (2)].ttype)); ;} break; case 261: -#line 1359 "c-parse.y" + { if (pedantic && ! flag_isoc9x) pedwarn ("comma at end of enumerator list"); ;} break; case 262: -#line 1365 "c-parse.y" + { (yyval.ttype) = (yyvsp[(1) - (1)].ttype); ;} break; case 263: -#line 1367 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); pedwarn ("no semicolon at end of struct or union"); ;} break; case 264: -#line 1372 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 265: -#line 1374 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), (yyvsp[(2) - (3)].ttype)); ;} break; case 266: -#line 1376 "c-parse.y" + { if (pedantic) pedwarn ("extra semicolon in struct or union specified"); ;} break; case 267: -#line 1391 "c-parse.y" + { (yyval.ttype) = (yyvsp[(3) - (3)].ttype); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -3925,7 +3923,7 @@ yyreduce: break; case 268: -#line 1397 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids member declarations with no members"); shadow_tag((yyvsp[(1) - (1)].ttype)); @@ -3933,7 +3931,7 @@ yyreduce: break; case 269: -#line 1402 "c-parse.y" + { (yyval.ttype) = (yyvsp[(3) - (3)].ttype); current_declspecs = TREE_VALUE (declspec_stack); prefix_attributes = TREE_PURPOSE (declspec_stack); @@ -3942,7 +3940,7 @@ yyreduce: break; case 270: -#line 1408 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids member declarations with no members"); shadow_tag((yyvsp[(1) - (1)].ttype)); @@ -3950,41 +3948,41 @@ yyreduce: break; case 271: -#line 1413 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 272: -#line 1415 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); pedantic = (yyvsp[(1) - (2)].itype); ;} break; case 274: -#line 1422 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 275: -#line 1427 "c-parse.y" + { (yyval.ttype) = grokfield ((yyvsp[(1) - (4)].filename), (yyvsp[(2) - (4)].lineno), (yyvsp[(3) - (4)].ttype), current_declspecs, NULL_TREE); decl_attributes ((yyval.ttype), (yyvsp[(4) - (4)].ttype), prefix_attributes); ;} break; case 276: -#line 1431 "c-parse.y" + { (yyval.ttype) = grokfield ((yyvsp[(1) - (6)].filename), (yyvsp[(2) - (6)].lineno), (yyvsp[(3) - (6)].ttype), current_declspecs, (yyvsp[(5) - (6)].ttype)); decl_attributes ((yyval.ttype), (yyvsp[(6) - (6)].ttype), prefix_attributes); ;} break; case 277: -#line 1434 "c-parse.y" + { (yyval.ttype) = grokfield ((yyvsp[(1) - (5)].filename), (yyvsp[(2) - (5)].lineno), NULL_TREE, current_declspecs, (yyvsp[(4) - (5)].ttype)); decl_attributes ((yyval.ttype), (yyvsp[(5) - (5)].ttype), prefix_attributes); ;} break; case 279: -#line 1446 "c-parse.y" + { if ((yyvsp[(1) - (3)].ttype) == error_mark_node) (yyval.ttype) = (yyvsp[(1) - (3)].ttype); else @@ -3992,102 +3990,102 @@ yyreduce: break; case 280: -#line 1451 "c-parse.y" + { (yyval.ttype) = error_mark_node; ;} break; case 281: -#line 1457 "c-parse.y" + { (yyval.ttype) = build_enumerator ((yyvsp[(1) - (1)].ttype), NULL_TREE); ;} break; case 282: -#line 1459 "c-parse.y" + { (yyval.ttype) = build_enumerator ((yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 283: -#line 1464 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 284: -#line 1466 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (2)].ttype), (yyvsp[(2) - (2)].ttype)); ;} break; case 285: -#line 1471 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 287: -#line 1477 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(1) - (1)].ttype), NULL_TREE); ;} break; case 288: -#line 1479 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 289: -#line 1484 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 290: -#line 1486 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, (yyvsp[(2) - (2)].ttype), (yyvsp[(1) - (2)].ttype)); ;} break; case 291: -#line 1491 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (3)].ttype); ;} break; case 292: -#line 1494 "c-parse.y" + { (yyval.ttype) = make_pointer_declarator ((yyvsp[(2) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 293: -#line 1496 "c-parse.y" + { (yyval.ttype) = make_pointer_declarator ((yyvsp[(2) - (2)].ttype), NULL_TREE); ;} break; case 294: -#line 1498 "c-parse.y" + { (yyval.ttype) = build_nt (CALL_EXPR, (yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype), NULL_TREE); ;} break; case 295: -#line 1500 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 296: -#line 1502 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, (yyvsp[(1) - (3)].ttype), NULL_TREE); ;} break; case 297: -#line 1504 "c-parse.y" + { (yyval.ttype) = build_nt (CALL_EXPR, NULL_TREE, (yyvsp[(2) - (2)].ttype), NULL_TREE); ;} break; case 298: -#line 1506 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, NULL_TREE, (yyvsp[(2) - (3)].ttype)); ;} break; case 299: -#line 1508 "c-parse.y" + { (yyval.ttype) = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ;} break; case 300: -#line 1519 "c-parse.y" + { if (pedantic && (yyvsp[(1) - (1)].ends_in_label)) pedwarn ("ANSI C forbids label at end of compound statement"); @@ -4095,17 +4093,17 @@ yyreduce: break; case 302: -#line 1528 "c-parse.y" + { (yyval.ends_in_label) = (yyvsp[(2) - (2)].ends_in_label); ;} break; case 303: -#line 1530 "c-parse.y" + { (yyval.ends_in_label) = 0; ;} break; case 307: -#line 1542 "c-parse.y" + { emit_line_note (input_filename, lineno); pushlevel (0); clear_last_expr (); @@ -4115,13 +4113,13 @@ yyreduce: break; case 309: -#line 1555 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids label declarations"); ;} break; case 312: -#line 1566 "c-parse.y" + { tree link; for (link = (yyvsp[(2) - (3)].ttype); link; link = TREE_CHAIN (link)) { @@ -4133,22 +4131,22 @@ yyreduce: break; case 313: -#line 1580 "c-parse.y" + {;} break; case 315: -#line 1584 "c-parse.y" + { compstmt_count++; ;} break; case 316: -#line 1587 "c-parse.y" + { (yyval.ttype) = convert (void_type_node, integer_zero_node); ;} break; case 317: -#line 1589 "c-parse.y" + { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), 1, 0); (yyval.ttype) = poplevel (1, 1, 0); @@ -4159,7 +4157,7 @@ yyreduce: break; case 318: -#line 1597 "c-parse.y" + { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), kept_level_p (), 0); (yyval.ttype) = poplevel (kept_level_p (), 0, 0); @@ -4170,7 +4168,7 @@ yyreduce: break; case 319: -#line 1605 "c-parse.y" + { emit_line_note (input_filename, lineno); expand_end_bindings (getdecls (), kept_level_p (), 0); (yyval.ttype) = poplevel (kept_level_p (), 0, 0); @@ -4181,7 +4179,7 @@ yyreduce: break; case 322: -#line 1625 "c-parse.y" + { emit_line_note ((yyvsp[(-1) - (4)].filename), (yyvsp[(0) - (4)].lineno)); c_expand_start_cond (truthvalue_conversion ((yyvsp[(3) - (4)].ttype)), 0, compstmt_count); @@ -4192,7 +4190,7 @@ yyreduce: break; case 323: -#line 1639 "c-parse.y" + { stmt_count++; compstmt_count++; emit_line_note ((yyvsp[(-1) - (1)].filename), (yyvsp[(0) - (1)].lineno)); @@ -4203,52 +4201,52 @@ yyreduce: break; case 324: -#line 1647 "c-parse.y" + { expand_loop_continue_here (); ;} break; case 325: -#line 1651 "c-parse.y" + { (yyval.filename) = input_filename; ;} break; case 326: -#line 1655 "c-parse.y" + { (yyval.lineno) = lineno; ;} break; case 327: -#line 1660 "c-parse.y" + { ;} break; case 328: -#line 1665 "c-parse.y" + { ;} break; case 329: -#line 1670 "c-parse.y" + { (yyval.ends_in_label) = (yyvsp[(3) - (3)].ends_in_label); ;} break; case 330: -#line 1675 "c-parse.y" + { (yyval.ends_in_label) = 0; ;} break; case 331: -#line 1677 "c-parse.y" + { (yyval.ends_in_label) = 1; ;} break; case 332: -#line 1683 "c-parse.y" + { stmt_count++; ;} break; case 334: -#line 1686 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (2)].filename), (yyvsp[(0) - (2)].lineno)); /* It appears that this should not be done--that a non-lvalue array @@ -4268,21 +4266,21 @@ yyreduce: break; case 335: -#line 1703 "c-parse.y" + { c_expand_start_else (); (yyvsp[(1) - (2)].itype) = stmt_count; position_after_white_space (); ;} break; case 336: -#line 1707 "c-parse.y" + { c_expand_end_cond (); if (extra_warnings && stmt_count == (yyvsp[(1) - (4)].itype)) warning ("empty body in an else-statement"); ;} break; case 337: -#line 1711 "c-parse.y" + { c_expand_end_cond (); /* This warning is here instead of in simple_if, because we do not want a warning if an empty if is followed by an @@ -4294,12 +4292,12 @@ yyreduce: break; case 338: -#line 1723 "c-parse.y" + { c_expand_end_cond (); ;} break; case 339: -#line 1725 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (1)].filename), (yyvsp[(0) - (1)].lineno)); /* The emit_nop used to come before emit_line_note, @@ -4312,7 +4310,7 @@ yyreduce: break; case 340: -#line 1735 "c-parse.y" + { /* Don't start the loop till we have succeeded in parsing the end test. This is to make sure that we end every loop we start. */ @@ -4324,12 +4322,12 @@ yyreduce: break; case 341: -#line 1744 "c-parse.y" + { expand_end_loop (); ;} break; case 342: -#line 1747 "c-parse.y" + { emit_line_note (input_filename, lineno); expand_exit_loop_if_false (NULL_PTR, truthvalue_conversion ((yyvsp[(3) - (5)].ttype))); @@ -4338,13 +4336,13 @@ yyreduce: break; case 343: -#line 1754 "c-parse.y" + { expand_end_loop (); clear_momentary (); ;} break; case 344: -#line 1758 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (4)].filename), (yyvsp[(0) - (4)].lineno)); /* See comment in `while' alternative, above. */ @@ -4358,13 +4356,13 @@ yyreduce: break; case 345: -#line 1770 "c-parse.y" + { (yyvsp[(7) - (7)].lineno) = lineno; (yyval.filename) = input_filename; ;} break; case 346: -#line 1773 "c-parse.y" + { /* Start the loop. Doing this after parsing all the expressions ensures we will end the loop. */ @@ -4383,7 +4381,7 @@ yyreduce: break; case 347: -#line 1789 "c-parse.y" + { /* Emit the increment expression, with a line number. */ emit_line_note ((yyvsp[(8) - (12)].filename), (yyvsp[(7) - (12)].lineno)); expand_loop_continue_here (); @@ -4397,7 +4395,7 @@ yyreduce: break; case 348: -#line 1800 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (4)].filename), (yyvsp[(0) - (4)].lineno)); c_expand_start_case ((yyvsp[(3) - (4)].ttype)); @@ -4408,7 +4406,7 @@ yyreduce: break; case 349: -#line 1808 "c-parse.y" + { expand_end_case ((yyvsp[(3) - (6)].ttype)); if (yychar == CONSTANT || yychar == STRING) pop_momentary_nofree (); @@ -4417,7 +4415,7 @@ yyreduce: break; case 350: -#line 1814 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (2)].filename), (yyvsp[(0) - (2)].lineno)); if ( ! expand_exit_something ()) @@ -4425,7 +4423,7 @@ yyreduce: break; case 351: -#line 1819 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (2)].filename), (yyvsp[(0) - (2)].lineno)); if (! expand_continue_loop (NULL_PTR)) @@ -4433,21 +4431,21 @@ yyreduce: break; case 352: -#line 1824 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (2)].filename), (yyvsp[(0) - (2)].lineno)); c_expand_return (NULL_TREE); ;} break; case 353: -#line 1828 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (3)].filename), (yyvsp[(0) - (3)].lineno)); c_expand_return ((yyvsp[(2) - (3)].ttype)); ;} break; case 354: -#line 1832 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (6)].filename), (yyvsp[(0) - (6)].lineno)); STRIP_NOPS ((yyvsp[(4) - (6)].ttype)); @@ -4460,7 +4458,7 @@ yyreduce: break; case 355: -#line 1843 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (8)].filename), (yyvsp[(0) - (8)].lineno)); c_expand_asm_operands ((yyvsp[(4) - (8)].ttype), (yyvsp[(6) - (8)].ttype), NULL_TREE, NULL_TREE, @@ -4469,7 +4467,7 @@ yyreduce: break; case 356: -#line 1850 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (10)].filename), (yyvsp[(0) - (10)].lineno)); c_expand_asm_operands ((yyvsp[(4) - (10)].ttype), (yyvsp[(6) - (10)].ttype), (yyvsp[(8) - (10)].ttype), NULL_TREE, @@ -4478,7 +4476,7 @@ yyreduce: break; case 357: -#line 1858 "c-parse.y" + { stmt_count++; emit_line_note ((yyvsp[(-1) - (12)].filename), (yyvsp[(0) - (12)].lineno)); c_expand_asm_operands ((yyvsp[(4) - (12)].ttype), (yyvsp[(6) - (12)].ttype), (yyvsp[(8) - (12)].ttype), (yyvsp[(10) - (12)].ttype), @@ -4487,7 +4485,7 @@ yyreduce: break; case 358: -#line 1864 "c-parse.y" + { tree decl; stmt_count++; emit_line_note ((yyvsp[(-1) - (3)].filename), (yyvsp[(0) - (3)].lineno)); @@ -4501,7 +4499,7 @@ yyreduce: break; case 359: -#line 1875 "c-parse.y" + { if (pedantic) pedwarn ("ANSI C forbids `goto *expr;'"); stmt_count++; @@ -4510,7 +4508,7 @@ yyreduce: break; case 362: -#line 1890 "c-parse.y" + { /* The value returned by this action is */ /* 1 if everything is OK */ @@ -4534,7 +4532,7 @@ yyreduce: break; case 363: -#line 1911 "c-parse.y" + { if ((yyvsp[(5) - (6)].itype)) iterator_for_loop_end ((yyvsp[(3) - (6)].ttype)); @@ -4542,7 +4540,7 @@ yyreduce: break; case 364: -#line 1946 "c-parse.y" + { register tree value = check_case_value ((yyvsp[(2) - (3)].ttype)); register tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); @@ -4576,7 +4574,7 @@ yyreduce: break; case 365: -#line 1977 "c-parse.y" + { register tree value1 = check_case_value ((yyvsp[(2) - (5)].ttype)); register tree value2 = check_case_value ((yyvsp[(4) - (5)].ttype)); register tree label @@ -4610,7 +4608,7 @@ yyreduce: break; case 366: -#line 2008 "c-parse.y" + { tree duplicate; register tree label @@ -4628,7 +4626,7 @@ yyreduce: break; case 367: -#line 2023 "c-parse.y" + { tree label = define_label (input_filename, lineno, (yyvsp[(1) - (3)].ttype)); stmt_count++; emit_nop (); @@ -4641,62 +4639,62 @@ yyreduce: break; case 368: -#line 2038 "c-parse.y" + { emit_line_note (input_filename, lineno); (yyval.ttype) = NULL_TREE; ;} break; case 369: -#line 2041 "c-parse.y" + { emit_line_note (input_filename, lineno); ;} break; case 370: -#line 2046 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 372: -#line 2053 "c-parse.y" + { (yyval.ttype) = NULL_TREE; ;} break; case 375: -#line 2060 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), (yyvsp[(3) - (3)].ttype)); ;} break; case 376: -#line 2065 "c-parse.y" + { (yyval.ttype) = build_tree_list ((yyvsp[(1) - (4)].ttype), (yyvsp[(3) - (4)].ttype)); ;} break; case 377: -#line 2070 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, combine_strings ((yyvsp[(1) - (1)].ttype)), NULL_TREE); ;} break; case 378: -#line 2072 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, combine_strings ((yyvsp[(3) - (3)].ttype)), (yyvsp[(1) - (3)].ttype)); ;} break; case 379: -#line 2078 "c-parse.y" + { pushlevel (0); clear_parm_order (); declare_parm_level (0); ;} break; case 380: -#line 2082 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); parmlist_tags_warning (); poplevel (0, 0, 0); ;} break; case 382: -#line 2090 "c-parse.y" + { tree parm; if (pedantic) pedwarn ("ANSI C forbids forward parameter declarations"); @@ -4707,22 +4705,22 @@ yyreduce: break; case 383: -#line 2098 "c-parse.y" + { (yyval.ttype) = (yyvsp[(4) - (4)].ttype); ;} break; case 384: -#line 2100 "c-parse.y" + { (yyval.ttype) = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ;} break; case 385: -#line 2106 "c-parse.y" + { (yyval.ttype) = get_parm_info (0); ;} break; case 386: -#line 2108 "c-parse.y" + { (yyval.ttype) = get_parm_info (0); /* Gcc used to allow this as an extension. However, it does not work for all targets, and thus has been disabled. @@ -4735,27 +4733,27 @@ yyreduce: break; case 387: -#line 2118 "c-parse.y" + { (yyval.ttype) = get_parm_info (1); ;} break; case 388: -#line 2120 "c-parse.y" + { (yyval.ttype) = get_parm_info (0); ;} break; case 389: -#line 2125 "c-parse.y" + { push_parm_decl ((yyvsp[(1) - (1)].ttype)); ;} break; case 390: -#line 2127 "c-parse.y" + { push_parm_decl ((yyvsp[(3) - (3)].ttype)); ;} break; case 391: -#line 2134 "c-parse.y" + { (yyval.ttype) = build_tree_list (build_tree_list (current_declspecs, (yyvsp[(3) - (4)].ttype)), build_tree_list (prefix_attributes, @@ -4767,7 +4765,7 @@ yyreduce: break; case 392: -#line 2143 "c-parse.y" + { (yyval.ttype) = build_tree_list (build_tree_list (current_declspecs, (yyvsp[(3) - (4)].ttype)), build_tree_list (prefix_attributes, @@ -4779,7 +4777,7 @@ yyreduce: break; case 393: -#line 2152 "c-parse.y" + { (yyval.ttype) = build_tree_list (build_tree_list (current_declspecs, (yyvsp[(3) - (4)].ttype)), build_tree_list (prefix_attributes, @@ -4791,7 +4789,7 @@ yyreduce: break; case 394: -#line 2161 "c-parse.y" + { (yyval.ttype) = build_tree_list (build_tree_list (current_declspecs, (yyvsp[(3) - (4)].ttype)), build_tree_list (prefix_attributes, @@ -4803,7 +4801,7 @@ yyreduce: break; case 395: -#line 2171 "c-parse.y" + { (yyval.ttype) = build_tree_list (build_tree_list (current_declspecs, (yyvsp[(3) - (4)].ttype)), build_tree_list (prefix_attributes, @@ -4815,21 +4813,21 @@ yyreduce: break; case 396: -#line 2185 "c-parse.y" + { pushlevel (0); clear_parm_order (); declare_parm_level (1); ;} break; case 397: -#line 2189 "c-parse.y" + { (yyval.ttype) = (yyvsp[(2) - (2)].ttype); parmlist_tags_warning (); poplevel (0, 0, 0); ;} break; case 399: -#line 2197 "c-parse.y" + { tree t; for (t = (yyvsp[(1) - (2)].ttype); t; t = TREE_CHAIN (t)) if (TREE_VALUE (t) == NULL_TREE) @@ -4838,34 +4836,34 @@ yyreduce: break; case 400: -#line 2207 "c-parse.y" + { (yyval.ttype) = build_tree_list (NULL_TREE, (yyvsp[(1) - (1)].ttype)); ;} break; case 401: -#line 2209 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), build_tree_list (NULL_TREE, (yyvsp[(3) - (3)].ttype))); ;} break; case 402: -#line 2215 "c-parse.y" + { (yyval.ttype) = build_tree_list (NULL_TREE, (yyvsp[(1) - (1)].ttype)); ;} break; case 403: -#line 2217 "c-parse.y" + { (yyval.ttype) = chainon ((yyvsp[(1) - (3)].ttype), build_tree_list (NULL_TREE, (yyvsp[(3) - (3)].ttype))); ;} break; case 404: -#line 2222 "c-parse.y" + { (yyval.itype) = pedantic; pedantic = 0; ;} break; /* Line 1267 of yacc.c. */ -#line 4886 "c-parse.c" + default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -5079,6 +5077,6 @@ yyreturn: } -#line 2226 "c-parse.y" + diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 8e70770..8a09144 100755 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -271,7 +271,6 @@ extern void yyprint PROTO ((FILE *, int, YYSTYPE)); program: /* empty */ { if (pedantic) pedwarn ("ANSI C forbids an empty source file"); - finish_file (); } | extdefs { @@ -279,7 +278,6 @@ program: /* empty */ get us back to the global binding level. */ while (! global_bindings_p ()) poplevel (0, 0, 0); - finish_file (); } ; diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 0249ef5..ebf0d8b 100755 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -160,18 +160,7 @@ struct lang_type /* In a VAR_DECL for an iterator, means we are within an explicit loop over that iterator. */ #define ITERATOR_BOUND_P(NODE) ((NODE)->common.readonly_flag) - -/* in c-lang.c and objc-act.c */ -extern tree lookup_interface PROTO((tree)); -extern tree is_class_name PROTO((tree)); -extern void maybe_objc_check_decl PROTO((tree)); -extern void finish_file PROTO((void)); -extern int maybe_objc_comptypes PROTO((tree, tree, int)); -extern tree maybe_building_objc_message_expr PROTO((void)); -extern tree maybe_objc_method_name PROTO((tree)); -extern int recognize_objc_keyword PROTO((void)); -extern tree build_objc_string PROTO((int, char *)); - + /* in c-aux-info.c */ extern void gen_aux_info_record PROTO((tree, int, int, int)); @@ -550,10 +539,6 @@ extern int warn_long_long; extern int system_header_p; -/* Nonzero enables objc features. */ - -extern int doing_objc_thang; - /* In c-decl.c */ extern void finish_incomplete_decl PROTO((tree)); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index ab3ede7..3d29a95 100755 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -508,11 +508,6 @@ comptypes (type1, type2) break; } - case RECORD_TYPE: - if (maybe_objc_comptypes (t1, t2, 0) == 1) - val = 1; - break; - default: break; } @@ -528,10 +523,6 @@ comp_target_types (ttl, ttr) { int val; - /* Give maybe_objc_comptypes a crack at letting these types through. */ - if ((val = maybe_objc_comptypes (ttl, ttr, 1)) >= 0) - return val; - val = comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (ttl)), TYPE_MAIN_VARIANT (TREE_TYPE (ttr))); @@ -4062,9 +4053,6 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype)) { overflow_warning (rhs); - /* Check for Objective-C protocols. This will issue a warning if - there are protocol violations. No need to use the return value. */ - maybe_objc_comptypes (type, rhstype, 0); return rhs; } @@ -4266,14 +4254,8 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) { if (funname) { - tree selector = maybe_building_objc_message_expr (); - - if (selector && parmnum > 2) - error ("incompatible type for argument %d of `%s'", - parmnum - 2, IDENTIFIER_POINTER (selector)); - else - error ("incompatible type for argument %d of `%s'", - parmnum, IDENTIFIER_POINTER (funname)); + error ("incompatible type for argument %d of `%s'", + parmnum, IDENTIFIER_POINTER (funname)); } else error ("incompatible type for argument %d of indirect function call", @@ -4288,8 +4270,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) /* Print a warning using MSG. It gets OPNAME as its one parameter. If OPNAME is null, it is replaced by "passing arg ARGNUM of `FUNCTION'". - FUNCTION and ARGNUM are handled specially if we are building an - Objective-C selector. */ +*/ static void warn_for_assignment (msg, opname, function, argnum) @@ -4303,13 +4284,6 @@ warn_for_assignment (msg, opname, function, argnum) if (opname == 0) { - tree selector = maybe_building_objc_message_expr (); - - if (selector && argnum > 2) - { - function = selector; - argnum -= 2; - } if (function) { /* Function name is known; supply it. */ diff --git a/gcc/defaults.h b/gcc/defaults.h index 0fbf2b9..cd6f75f 100755 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -95,16 +95,6 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \ while (0) #endif -#ifndef ASM_IDENTIFY_GCC - /* Default the definition, only if ASM_IDENTIFY_GCC is not set, - because if it is set, we might not want ASM_IDENTIFY_LANGUAGE - outputting labels, if we do want it to, then it must be defined - in the tm.h file. */ -#ifndef ASM_IDENTIFY_LANGUAGE -#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE); -#endif -#endif - /* This is how we tell the assembler to equate two values. */ #ifdef SET_ASM_OP #ifndef ASM_OUTPUT_DEF diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 9500250..bee4663 100755 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -684,8 +684,6 @@ print_node (file, prefix, node, indent) break; default: - if (TREE_CODE_CLASS (TREE_CODE (node)) == 'x') - lang_print_xnode (file, node, indent); break; } diff --git a/gcc/testsuite/lib/f-torture.exp b/gcc/testsuite/lib/f-torture.exp deleted file mode 100755 index 6596b6f..0000000 --- a/gcc/testsuite/lib/f-torture.exp +++ /dev/null @@ -1,317 +0,0 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-dejagnu@gnu.org. - -# This file was written by Rob Savoye. (rob@cygnus.com) - -# The default option list can be overridden by -# TORTURE_OPTIONS="{ { list1 } ... { listN } }" - -if ![info exists TORTURE_OPTIONS] { - # FIXME: We should test -g at least once. - set TORTURE_OPTIONS [list \ - { -O0 } { -O1 } { -O2 } \ - { -O2 -fomit-frame-pointer -finline-functions } \ - { -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \ - { -O2 -fomit-frame-pointer -finline-functions -funroll-all-loops } \ - { -Os }] -} - - -# Split TORTURE_OPTIONS into two choices: one for testcases with loops and -# one for testcases without loops. - -set torture_with_loops $TORTURE_OPTIONS -set torture_without_loops "" -foreach option $TORTURE_OPTIONS { - if ![string match "*loop*" $option] { - lappend torture_without_loops $option - } -} - -# -# f-torture-compile -- runs the Tege C-torture test -# -# SRC is the full pathname of the testcase. -# OPTION is the specific compiler flag we're testing (eg: -O2). -# -proc f-torture-compile { src option } { - global output - global srcdir tmpdir - global host_triplet - - set output "$tmpdir/[file tail [file rootname $src]].o" - - regsub "^$srcdir/?" $src "" testcase - # If we couldn't rip $srcdir out of `src' then just do the best we can. - # The point is to reduce the unnecessary noise in the logs. Don't strip - # out too much because different testcases with the same name can confuse - # `test-tool'. - if [string match "/*" $testcase] { - set testcase "[file tail [file dirname $src]]/[file tail $src]" - } - - verbose "Testing $testcase, $option" 1 - - # Run the compiler and analyze the results. - set options "" - lappend options "additional_flags=-w $option" - - set comp_output [g77_target_compile "$src" "$output" object $options]; - - # Set a few common compiler messages. - set fatal_signal "*77*: Internal compiler error: program*got fatal signal" - - if [string match "$fatal_signal 6" $comp_output] then { - g77_fail $testcase "Got Signal 6, $option" - remote_file build delete $output - return - } - - if [string match "$fatal_signal 11" $comp_output] then { - g77_fail $testcase "Got Signal 11, $option" - remote_file build delete $output - return - } - - # We shouldn't get these because of -w, but just in case. - if [string match "*77*:*warning:*" $comp_output] then { - warning "$testcase: (with warnings) $option" - send_log "$comp_output\n" - unresolved "$testcase, $option" - remote_file build delete $output - return - } - - set comp_output [prune_warnings $comp_output] - - set unsupported_message [g77_check_unsupported_p $comp_output] - if { $unsupported_message != "" } { - unsupported "$testcase: $unsupported_message" - remote_file build delete $output - return - } - - # remove any leftover LF/CR to make sure any output is legit - regsub -all -- "\[\r\n\]*" $comp_output "" comp_output - # If any message remains, we fail. - if ![string match "" $comp_output] then { - g77_fail $testcase $option - remote_file build delete $output - return - } - - g77_pass $testcase $option - remote_file build delete $output -} - -# -# f-torture-execute -- utility to compile and execute a testcase -# -# SRC is the full pathname of the testcase. -# -# If the testcase has an associated .x file, we source that to run the -# test instead. We use .x so that we don't lengthen the existing filename -# to more than 14 chars. -# -proc f-torture-execute { src } { - global tmpdir tool srcdir output - - # Check for alternate driver. - if [file exists [file rootname $src].x] { - verbose "Using alternate driver [file rootname [file tail $src]].x" 2 - set done_p 0 - catch "set done_p \[source [file rootname $src].x\]" - if { $done_p } { - return - } - } - - # Look for a loop within the source code - if we don't find one, - # don't pass -funroll[-all]-loops. - global torture_with_loops torture_without_loops - if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then { - set option_list $torture_with_loops - } else { - set option_list $torture_without_loops - } - - set executable $tmpdir/[file tail [file rootname $src].x] - - regsub "^$srcdir/?" $src "" testcase - # If we couldn't rip $srcdir out of `src' then just do the best we can. - # The point is to reduce the unnecessary noise in the logs. Don't strip - # out too much because different testcases with the same name can confuse - # `test-tool'. - if [string match "/*" $testcase] { - set testcase "[file tail [file dirname $src]]/[file tail $src]" - } - - foreach option $option_list { - # torture_{compile,execute}_xfail are set by the .x script - # (if present) - if [info exists torture_compile_xfail] { - setup_xfail $torture_compile_xfail - } - remote_file build delete $executable - verbose "Testing $testcase, $option" 1 - - set options "" - lappend options "additional_flags=-w $option" - set comp_output [g77_target_compile "$src" "$executable" executable $options]; - - # Set a few common compiler messages. - set fatal_signal "*77*: Internal compiler error: program*got fatal signal" - - if [string match "$fatal_signal 6" $comp_output] then { - g77_fail $testcase "Got Signal 6, $option" - remote_file build delete $executable - continue - } - - if [string match "$fatal_signal 11" $comp_output] then { - g77_fail $testcase "Got Signal 11, $option" - remote_file build delete $executable - continue - } - - # We shouldn't get these because of -w, but just in case. - if [string match "*77*:*warning:*" $comp_output] then { - warning "$testcase: (with warnings) $option" - send_log "$comp_output\n" - unresolved "$testcase, $option" - remote_file build delete $executable - continue - } - - set comp_output [prune_warnings $comp_output] - - set unsupported_message [g77_check_unsupported_p $comp_output] - - if { $unsupported_message != "" } { - unsupported "$testcase: $unsupported_message" - continue - } elseif ![file exists $executable] { - if ![is3way] { - fail "$testcase compilation, $option" - untested "$testcase execution, $option" - continue - } else { - # FIXME: since we can't test for the existance of a remote - # file without short of doing an remote file list, we assume - # that since we got no output, it must have compiled. - pass "$testcase compilation, $option" - } - } else { - pass "$testcase compilation, $option" - } - - # See if this source file uses "long long" types, if it does, and - # no_long_long is set, skip execution of the test. - if [target_info exists no_long_long] then { - if [expr [search_for $src "integer\*8"]] then { - untested "$testcase execution, $option" - continue - } - } - - if [info exists torture_execute_xfail] { - setup_xfail $torture_execute_xfail - } - - set result [g77_load "$executable" "" ""] - set status [lindex $result 0]; - set output [lindex $result 1]; - if { $status == "pass" } { - remote_file build delete $executable - } - $status "$testcase execution, $option" - } -} - -# -# search_for -- looks for a string match in a file -# -proc search_for { file pattern } { - set fd [open $file r] - while { [gets $fd cur_line]>=0 } { - set lower [string tolower $cur_line] - if [regexp "$pattern" $lower] then { - close $fd - return 1 - } - } - close $fd - return 0 -} - -# -# f-torture -- the f-torture testcase source file processor -# -# This runs compilation only tests (no execute tests). -# SRC is the full pathname of the testcase, or just a file name in which case -# we prepend $srcdir/$subdir. -# -# If the testcase has an associated .x file, we source that to run the -# test instead. We use .x so that we don't lengthen the existing filename -# to more than 14 chars. -# -proc f-torture { args } { - global srcdir subdir - - set src [lindex $args 0]; - if { [llength $args] > 1 } { - set options [lindex $args 1]; - } else { - set options "" - } - - # Prepend $srdir/$subdir if missing. - if ![string match "*/*" $src] { - set src "$srcdir/$subdir/$src" - } - - # Check for alternate driver. - if [file exists [file rootname $src].x] { - verbose "Using alternate driver [file rootname [file tail $src]].x" 2 - set done_p 0 - catch "set done_p \[source [file rootname $src].x\]" - if { $done_p } { - return - } - } - - # Look for a loop within the source code - if we don't find one, - # don't pass -funroll[-all]-loops. - global torture_with_loops torture_without_loops - if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then { - set option_list $torture_with_loops - } else { - set option_list $torture_without_loops - } - - # loop through all the options - foreach option $option_list { - # torture_compile_xfail is set by the .x script (if present) - if [info exists torture_compile_xfail] { - setup_xfail $torture_compile_xfail - } - - f-torture-compile $src "$option $options" - } -} diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp deleted file mode 100755 index cad429e..0000000 --- a/gcc/testsuite/lib/g++-dg.exp +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 1997, 1999 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-g++@prep.ai.mit.edu - -# Define g++ callbacks for dg.exp. - -load_lib dg.exp - -proc g++-dg-test { prog do_what extra_tool_flags } { - # Set up the compiler flags, based on what we're going to do. - - switch $do_what { - "preprocess" { - set compile_type "preprocess" - set output_file "[file rootname [file tail $prog]].i" - } - "compile" { - set compile_type "assembly" - set output_file "[file rootname [file tail $prog]].s" - } - "assemble" { - set compile_type "object" - set output_file "[file rootname [file tail $prog]].o" - } - "link" { - set compile_type "executable" - set output_file "a.out" - # The following line is needed for targets like the i960 where - # the default output file is b.out. Sigh. - } - "run" { - set compile_type "executable" - # FIXME: "./" is to cope with "." not being in $PATH. - # Should this be handled elsewhere? - # YES. - set output_file "./a.out" - # This is the only place where we care if an executable was - # created or not. If it was, dg.exp will try to run it. - remote_file build delete $output_file; - } - default { - perror "$do_what: not a valid dg-do keyword" - return "" - } - } - set options "" - if { $extra_tool_flags != "" } { - lappend options "additional_flags=$extra_tool_flags" - } - - set comp_output [g++_target_compile "$prog" "$output_file" "$compile_type" $options]; - - return [list $comp_output $output_file] -} - - -proc g++-dg-prune { system text } { - - # If we see "region xxx is full" then the testcase is too big for ram. - # This is tricky to deal with in a large testsuite like c-torture so - # deal with it here. Just mark the testcase as unsupported. - if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $text] { - # The format here is important. See dg.exp. - return "::unsupported::memory full" - } - - return $text -} diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp deleted file mode 100755 index 27b444e..0000000 --- a/gcc/testsuite/lib/g++.exp +++ /dev/null @@ -1,235 +0,0 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-g++@prep.ai.mit.edu - -# This file was written by Rob Savoye (rob@cygnus.com) -# Many modifications by Jeffrey Wheat (cassidy@cygnus.com) -# With modifications by Mike Stump <mrs@cygnus.com>. - -# -# g++ support library routines -# - -# -# GXX_UNDER_TEST is the compiler under test. -# - - -set gpp_compile_options "" - -# -# g++_version -- extract and print the version number of the compiler -# -proc g++_version { } { - global GXX_UNDER_TEST - - # ignore any arguments after the command - set compiler [lindex $GXX_UNDER_TEST 0] - - # verify that the compiler exists - if { [is_remote host] || [which $compiler] != 0 } then { - set tmp [remote_exec host "$compiler -v"] - set status [lindex $tmp 0]; - set output [lindex $tmp 1]; - regexp "version.*$" $output version - if { $status == 0 && [info exists version] } then { - if [is_remote host] { - clone_output "$compiler $version\n" - } else { - clone_output "[which $compiler] $version\n" - } - } else { - clone_output "Couldn't determine version of [which $compiler]\n" - } - } else { - # compiler does not exist (this should have already been detected) - warning "$compiler does not exist" - } -} - -# -# g++_init -- called at the start of each subdir of tests -# - -proc g++_init { args } { - global subdir - global gpp_initialized - global base_dir - global tmpdir - global libdir - global gluefile wrap_flags; - global objdir srcdir - global ALWAYS_CXXFLAGS - global TOOL_EXECUTABLE TOOL_OPTIONS - global GXX_UNDER_TEST - - if ![info exists GXX_UNDER_TEST] then { - if [info exists TOOL_EXECUTABLE] { - set GXX_UNDER_TEST $TOOL_EXECUTABLE; - } else { - if [is_remote host] { - set GXX_UNDER_TEST [transform c++] - } else { - set GXX_UNDER_TEST [findfile $base_dir/../xgcc "$base_dir/../xgcc -B$base_dir/../" [findfile $base_dir/xgcc "$base_dir/xgcc -B$base_dir/" [transform c++]]] - } - } - } - - # Bleah, nasty. Bad taste. - if [ishost "*-dos-*" ] { - regsub "c\\+\\+" "$GXX_UNDER_TEST" "gcc" GXX_UNDER_TEST - } - - if ![is_remote host] { - if { [which $GXX_UNDER_TEST] == 0 } then { - perror "GXX_UNDER_TEST does not exist" - exit 1 - } - } - if ![info exists tmpdir] { - set tmpdir "/tmp" - } - - if [info exists gluefile] { - unset gluefile - } - - if { [target_info needs_status_wrapper] != "" } { - set gluefile ${tmpdir}/testglue.o; - set result [build_wrapper $gluefile]; - if { $result != "" } { - set gluefile [lindex $result 0]; - set wrap_flags [lindex $result 1]; - } else { - unset gluefile - } - } - - set ALWAYS_CXXFLAGS "" - - if ![is_remote host] { - lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags]"; - lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags]"; - lappend ALWAYS_CXXFLAGS "incdir=$base_dir/../include" - } - - if [info exists TOOL_OPTIONS] { - lappend ALWAYS_CXXFLAGS "additional_flags=$TOOL_OPTIONS"; - } - - verbose -log "ALWAYS_CXXFLAGS set to $ALWAYS_CXXFLAGS" - - verbose "g++ is initialized" 3 -} - - -proc g++_target_compile { source dest type options } { - global tmpdir; - global gpp_compile_options - global gluefile wrap_flags - global ALWAYS_CXXFLAGS; - global GXX_UNDER_TEST; - - if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=${wrap_flags}" - } - - lappend options "additional_flags=[libio_include_flags]" - lappend options "compiler=$GXX_UNDER_TEST"; - - set options [concat $options $gpp_compile_options] - - set options [concat $options "$ALWAYS_CXXFLAGS"]; - - if { [regexp "(^| )-frepo( |$)" $options] && \ - [regexp "\.o(|bj)$" $dest] } then { - regsub "\.o(|bj)$" $dest ".rpo" rponame - exec rm -f $rponame - } - - return [target_compile $source $dest $type $options] -} - -proc g++_exit { args } { - global gluefile; - - if [info exists gluefile] { - file_on_build delete $gluefile; - unset gluefile; - } -} - -# If this is an older version of dejagnu (without runtest_file_p), -# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c. -# This can be deleted after the next dejagnu release. - -if { [info procs runtest_file_p] == "" } then { - proc runtest_file_p { runtests testcase } { - if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then { - if { [lsearch $runtests [file tail $testcase]] >= 0 } then { - return 1 - } else { - return 0 - } - } - return 1 - } -} - -# Provide a definition of this if missing (delete after next dejagnu release). - -if { [info procs prune_warnings] == "" } then { - proc prune_warnings { text } { - return $text - } -} - -# Utility used by mike-g++.exp and old-dejagnu.exp. -# Check the compiler(/assembler/linker) output for text indicating that -# the testcase should be marked as "unsupported". -# -# When dealing with a large number of tests, it's difficult to weed out the -# ones that are too big for a particular cpu (eg: 16 bit with a small amount -# of memory). There are various ways to deal with this. Here's one. -# Fortunately, all of the cases where this is likely to happen will be using -# gld so we can tell what the error text will look like. - -proc ${tool}_check_unsupported_p { output } { - if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] { - return "memory full" - } - return "" -} - -proc ${tool}_option_help { } { - send_user "--additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated." -} - -proc ${tool}_option_proc { option } { - if[regexp "^--additional_options," $option] { - global gpp_compile_options - regsub "--additional_options," $option "" option - foreach x [split $option ","] { - lappend gpp_compile_options "additional_flags=$x" - } - return 1; - } else { - return 0 - } -} diff --git a/gcc/testsuite/lib/g77.exp b/gcc/testsuite/lib/g77.exp deleted file mode 100755 index 3b2beb3..0000000 --- a/gcc/testsuite/lib/g77.exp +++ /dev/null @@ -1,274 +0,0 @@ -# Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-g77@prep.ai.mit.edu - -# This file was written by Rob Savoye (rob@cygnus.com) -# Currently maintained by Doug Evans (dje@cygnus.com) - -# This file is loaded by the tool init file (eg: unix.exp). It provides -# default definitions for g77_start, etc. and other supporting cast members. - -# These globals are used by g77_start if no compiler arguments are provided. -# They are also used by the various testsuites to define the environment: -# where to find stdio.h, libc.a, etc. - -# -# G77_UNDER_TEST is the compiler under test. -# - -# -# default_g77_version -- extract and print the version number of the compiler -# - -proc default_g77_version { } { - global G77_UNDER_TEST - - g77_init; - - # ignore any arguments after the command - set compiler [lindex $G77_UNDER_TEST 0] - - if ![is_remote host] { - set compiler_name [which $compiler]; - } else { - set compiler_name $compiler; - } - - # verify that the compiler exists - if { $compiler_name != 0 } then { - set options "" - - lappend options "additional_flags=-v" - set tmp [g77_target_compile "" "" "none" $options] - regexp "g77 version\[^\n\]*" $tmp version - if { [info exists version] } then { - clone_output "$compiler_name $version\n" - } else { - clone_output "Couldn't determine version of $compiler_name: $tmp\n" - } - } else { - # compiler does not exist (this should have already been detected) - warning "$compiler does not exist" - } -} - -# -# Call g77_version. We do it this way so we can override it if needed. -# -proc g77_version { } { - default_g77_version; -} - -# -# g77_init -- called at the start of each .exp script. -# -# There currently isn't much to do, but always using it allows us to -# make some enhancements without having to go back and rewrite the scripts. -# - -set g77_initialized 0 - -proc g77_init { args } { - global tmpdir - global libdir - global gluefile wrap_flags - global g77_initialized - global G77_UNDER_TEST - global TOOL_EXECUTABLE - - if { $g77_initialized == 1 } { return; } - - if ![info exists G77_UNDER_TEST] then { - if [info exists TOOL_EXECUTABLE] { - set G77_UNDER_TEST $TOOL_EXECUTABLE; - } else { - set G77_UNDER_TEST [find_g77] - } - } - - if ![info exists tmpdir] then { - set tmpdir /tmp - } - if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } { - set gluefile ${tmpdir}/testglue.o; - set result [build_wrapper $gluefile]; - if { $result != "" } { - set gluefile [lindex $result 0]; - set wrap_flags [lindex $result 1]; - } else { - unset gluefile - } - } -} - -proc g77_target_compile { source dest type options } { - global tmpdir; - global gluefile wrap_flags; - global G77_UNDER_TEST - global TOOL_OPTIONS - - if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=$wrap_flags" - } - - if [target_info exists g77,stack_size] { - lappend options "additional_flags=-DSTACK_SIZE=[target_info g77,stack_size]" - } - if [target_info exists g77,no_trampolines] { - lappend options "additional_flags=-DNO_TRAMPOLINES" - } - if [target_info exists g77,no_label_values] { - lappend options "additional_flags=-DNO_LABEL_VALUES" - } - if [info exists TOOL_OPTIONS] { - lappend options "additional_flags=$TOOL_OPTIONS" - } - if [target_info exists g77,no_varargs] { - lappend options "additional_flags=-DNO_VARARGS" - } - if ![is_remote host] { - set gccpath "[get_multilibs]" - set libg2c_dir [lookfor_file ${gccpath} libf2c/libg2c.a] - if { $libg2c_dir != "" } { - set libg2c_link_flags "-L[file dirname ${libg2c_dir}]" - lappend options "additional_flags=${libg2c_link_flags}" - } - } - lappend options "compiler=$G77_UNDER_TEST" - return [target_compile $source $dest $type $options] -} - -# -# g77_pass -- utility to record a testcase passed -# - -proc g77_pass { testcase cflags } { - if { "$cflags" == "" } { - pass "$testcase" - } else { - pass "$testcase, $cflags" - } -} - -# -# g77_fail -- utility to record a testcase failed -# - -proc g77_fail { testcase cflags } { - if { "$cflags" == "" } { - fail "$testcase" - } else { - fail "$testcase, $cflags" - } -} - -# -# g77_finish -- called at the end of every .exp script that calls g77_init -# -# The purpose of this proc is to hide all quirks of the testing environment -# from the testsuites. It also exists to undo anything that g77_init did -# (that needs undoing). -# - -proc g77_finish { } { - # The testing harness apparently requires this. - global errorInfo; - - if [info exists errorInfo] then { - unset errorInfo - } - - # Might as well reset these (keeps our caller from wondering whether - # s/he has to or not). - global prms_id bug_id - set prms_id 0 - set bug_id 0 -} - -proc g77_exit { } { - global gluefile; - - if [info exists gluefile] { - file_on_build delete $gluefile; - unset gluefile; - } -} - -# If this is an older version of dejagnu (without runtest_file_p), -# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c. -# This can be deleted after next dejagnu release. - -if { [info procs runtest_file_p] == "" } then { - proc runtest_file_p { runtests testcase } { - if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then { - if { [lsearch $runtests [file tail $testcase]] >= 0 } then { - return 1 - } else { - return 0 - } - } - return 1 - } -} - -# Provide a definition of this if missing (delete after next dejagnu release). - -if { [info procs prune_warnings] == "" } then { - proc prune_warnings { text } { - return $text - } -} - -# Utility used by mike-gcc.exp and c-torture.exp. -# Check the compiler(/assembler/linker) output for text indicating that -# the testcase should be marked as "unsupported". -# -# When dealing with a large number of tests, it's difficult to weed out the -# ones that are too big for a particular cpu (eg: 16 bit with a small amount -# of memory). There are various ways to deal with this. Here's one. -# Fortunately, all of the cases where this is likely to happen will be using -# gld so we can tell what the error text will look like. - -proc ${tool}_check_unsupported_p { output } { - if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] { - return "memory full" - } - return "" -} - -# Prune messages from g77 that aren't useful. - -proc prune_g77_output { text } { - #send_user "Before:$text\n" - regsub -all "(^|\n)\[^\n\]*: In (function|method) \[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*: At top level:\[^\n\]*" $text "" text - - # It would be nice to avoid passing anything to g77 that would cause it to - # issue these messages (since ignoring them seems like a hack on our part), - # but that's too difficult in the general case. For example, sometimes - # you need to use -B to point g77 at crt0.o, but there are some targets - # that don't have crt0.o. - regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text - regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text - - #send_user "After:$text\n" - - return $text -} - diff --git a/gcc/testsuite/lib/mike-g++.exp b/gcc/testsuite/lib/mike-g++.exp deleted file mode 100755 index 10a1d2b..0000000 --- a/gcc/testsuite/lib/mike-g++.exp +++ /dev/null @@ -1,264 +0,0 @@ -# Copyright (C) 1988, 90, 91, 92, 95, 96, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This file was written by Mike Stump <mrs@cygnus.com> - -# Please email any bugs, comments, and/or additions to this file to: -# bug-g++@prep.ai.mit.edu - -# -# mike_cleanup -- remove any files that are created by the testcase -# -proc mike_cleanup { src_code output_file assembly_file } { - remote_file build delete $output_file $assembly_file; -} - -# -# prebase -- sets up a Mike Stump (mrs@cygnus.com) style G++ test -# -proc prebase { } { - global compiler_output - global not_compiler_output - global compiler_result - global not_compiler_result - global program_output - global groups - global run - global actions - global target_regexp - - set compiler_output "^$" - set not_compiler_output ".*Internal compiler error.*" - set compiler_result "" - set not_compiler_result "" - set program_output ".*PASS.*" - set groups {} - set run no - set actions assemble - set target_regexp ".*" -} - -# -# run the test -# -proc postbase { src_code run groups args } { - global verbose - global srcdir - global subdir - global not_compiler_output - global compiler_output - global compiler_result - global not_compiler_result - global program_output - global actions - global target_regexp - global host_triplet - global target_triplet - global tool - global tmpdir - global objdir - global base_dir - - if ![regexp $target_regexp $target_triplet] { - unsupported $subdir/$src_code - return - } - - if { [llength $args] > 0 } { - set comp_options [lindex $args 0]; - } else { - set comp_options "" - } - - set fail_message $subdir/$src_code - set pass_message $subdir/$src_code - - if [info exists GROUP] { - if {[lsearch $groups $GROUP] == -1} { - return - } - } - - if [string match $run yes] { - set actions run - } - - set output_file "$tmpdir/[file tail [file rootname $src_code]]" - set assembly_file "$output_file" - append assembly_file ".S" - - set compile_type "none" - - case $actions { - compile - { - set compile_type "assembly"; - set output_file $assembly_file; - } - assemble - { - set compile_type "object"; - append output_file ".o"; - } - link - { - set compile_type "executable"; - set output_file "$tmpdir/a.out"; - } - run - { - set compile_type "executable"; - set output_file "$tmpdir/a.out"; - set run yes; - } - default - { - set output_file ""; - set compile_type "none"; - } - } - - set src_file "$srcdir/$subdir/$src_code" - set options "" - - if { $comp_options != "" } { - lappend options "additional_flags=$comp_options" - } - - if ![ishost "*-dos-*"] { - lappend options "libs=-lstdc++ -lg++" - } else { - lappend options "libs=-lstdcxx -lgxx" - } - - set comp_output [g++_target_compile $src_file $output_file $compile_type $options] - - set pass no - - # Delete things like "ld.so warning" messages. - set comp_output [prune_warnings $comp_output] - - if [regexp -- $not_compiler_output $comp_output] { - if { $verbose > 1 } { - send_user "\nChecking:\n$not_compiler_output\nto make sure it does not match:\n$comp_output\nbut it does.\n\n" - } else { - send_log "\nCompiler output:\n$comp_output\n\n" - } - fail $fail_message - # The framework doesn't like to see any error remnants, - # so remove them. - uplevel { - if [info exists errorInfo] { - unset errorInfo - } - } - mike_cleanup $src_code $output_file $assembly_file - return - } - - # remove any leftover CRs. - regsub -all -- "\r" $comp_output "" comp_output - - regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output - regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output - - set unsupported_message [${tool}_check_unsupported_p $comp_output] - if { $unsupported_message != "" } { - unsupported "$subdir/$src_code: $unsupported_message" - mike_cleanup $src_code $output_file $assembly_file - return - } - - if { $verbose > 1 } { - send_user "\nChecking:\n$compiler_output\nto see if it matches:\n$comp_output\n" - } else { - send_log "\nCompiler output:\n$comp_output\n\n" - } - if [regexp -- $compiler_output $comp_output] { - if { $verbose > 1 } { - send_user "Yes, it matches.\n\n" - } - set pass yes - if [file exists [file rootname [file tail $src_code]].s] { - set fd [open [file rootname [file tail $src_code]].s r] - set dot_s [read $fd] - close $fd - if { $compiler_result != "" } { - verbose "Checking .s file for $compiler_result" 2 - if [regexp -- $compiler_result $dot_s] { - verbose "Yes, it matches." 2 - } else { - verbose "Nope, doesn't match." 2 - verbose $dot_s 4 - set pass no - } - } - if { $not_compiler_result != "" } { - verbose "Checking .s file for not $not_compiler_result" 2 - if ![regexp -- $not_compiler_result $dot_s] { - verbose "Nope, not found (that's good)." 2 - } else { - verbose "Uh oh, it was found." 2 - verbose $dot_s 4 - set pass no - } - } - } - if [string match $run yes] { - set result [g++_load $output_file] - set status [lindex $result 0]; - set output [lindex $result 1]; - - if { $status == -1 } { - mike_cleanup $src_code $output_file $assembly_file; - return; - } - if { $verbose > 1 } { - send_user "Checking:\n$program_output\nto see if it matches:\n$output\n\n" - } - if ![regexp -- $program_output $output] { - set pass no - if { $verbose > 1 } { - send_user "Nope, does not match.\n\n" - } - } else { - if { $verbose > 1 } { - send_user "Yes, it matches.\n\n" - } - } - } - } else { - if { $verbose > 1 } { - send_user "Nope, does not match.\n\n" - } - } - - if [string match $pass "yes"] { - pass $pass_message - } else { - fail $fail_message - } - - # The framework doesn't like to see any error remnants, - # so remove them. - uplevel { - if [info exists errorInfo] { - unset errorInfo - } - } - - mike_cleanup $src_code $output_file $assembly_file -} diff --git a/gcc/testsuite/lib/mike-g77.exp b/gcc/testsuite/lib/mike-g77.exp deleted file mode 100755 index a3e12d4..0000000 --- a/gcc/testsuite/lib/mike-g77.exp +++ /dev/null @@ -1,262 +0,0 @@ -# Copyright (C) 1988, 90, 91, 92, 95, 96, 97, 1998 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This file was derived from mike-g++.exp written by Mike Stump <mrs@cygnus.com> - -# Please email any bugs, comments, and/or additions to this file to: -# fortran@gnu.org - -# -# mike_cleanup -- remove any files that are created by the testcase -# -proc mike_cleanup { src_code output_file assembly_file } { - remote_file build delete $output_file $assembly_file; -} - -# -# prebase -- sets up a Mike Stump (mrs@cygnus.com) style g77 test -# -proc prebase { } { - global compiler_output - global not_compiler_output - global compiler_result - global not_compiler_result - global program_output - global groups - global run - global actions - global target_regexp - - set compiler_output "^$" - set not_compiler_output ".*Internal compiler error.*" - set compiler_result "" - set not_compiler_result "" - set program_output ".*PASS.*" - set groups {} - set run no - set actions assemble - set target_regexp ".*" -} - -# -# run the test -# -proc postbase { src_code run groups args } { - global verbose - global srcdir - global subdir - global not_compiler_output - global compiler_output - global compiler_result - global not_compiler_result - global program_output - global actions - global target_regexp - global host_triplet - global target_triplet - global tool - global tmpdir - global G77_UNDER_TEST - global GROUP - - if ![info exists G77_UNDER_TEST] { - error "No compiler specified for testing." - } - - if ![regexp $target_regexp $target_triplet] { - unsupported $subdir/$src_code - return - } - - if { [llength $args] > 0 } { - set comp_options [lindex $args 0]; - } else { - set comp_options "" - } - - set fail_message $subdir/$src_code - set pass_message $subdir/$src_code - - if [info exists GROUP] { - if {[lsearch $groups $GROUP] == -1} { - return - } - } - - if [string match $run yes] { - set actions run - } - - set output_file "$tmpdir/[file tail [file rootname $src_code]]" - set assembly_file "$output_file" - append assembly_file ".S" - - set compile_type "none" - - case $actions { - compile - { - set compile_type "assembly"; - set output_file $assembly_file; - } - assemble - { - set compile_type "object"; - append output_file ".o"; - } - link - { - set compile_type "executable"; - set output_file "$tmpdir/a.out"; - } - run - { - set compile_type "executable"; - set output_file "$tmpdir/a.out"; - set run yes; - } - default - { - set output_file ""; - set compile_type "none"; - } - } - - set src_file "$srcdir/$subdir/$src_code" - set options "" - lappend options "compiler=$G77_UNDER_TEST" - - if { $comp_options != "" } { - lappend options "additional_flags=$comp_options" - } - - set comp_output [g77_target_compile $src_file $output_file $compile_type $options]; - - set pass no - - # Delete things like "ld.so warning" messages. - set comp_output [prune_warnings $comp_output] - - if [regexp -- $not_compiler_output $comp_output] { - if { $verbose > 1 } { - send_user "\nChecking:\n$not_compiler_output\nto make sure it does not match:\n$comp_output\nbut it does.\n\n" - } else { - send_log "\nCompiler output:\n$comp_output\n\n" - } - fail $fail_message - # The framework doesn't like to see any error remnants, - # so remove them. - uplevel { - if [info exists errorInfo] { - unset errorInfo - } - } - mike_cleanup $src_code $output_file $assembly_file - return - } - - # remove any leftover CRs. - regsub -all -- "\r" $comp_output "" comp_output - - regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output - regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output - - set unsupported_message [${tool}_check_unsupported_p $comp_output] - if { $unsupported_message != "" } { - unsupported "$subdir/$src_code: $unsupported_message" - mike_cleanup $src_code $output_file $assembly_file - return - } - - if { $verbose > 1 } { - send_user "\nChecking:\n$compiler_output\nto see if it matches:\n$comp_output\n" - } else { - send_log "\nCompiler output:\n$comp_output\n\n" - } - if [regexp -- $compiler_output $comp_output] { - if { $verbose > 1 } { - send_user "Yes, it matches.\n\n" - } - set pass yes - if [file exists [file rootname [file tail $src_code]].s] { - set fd [open [file rootname [file tail $src_code]].s r] - set dot_s [read $fd] - close $fd - if { $compiler_result != "" } { - verbose "Checking .s file for $compiler_result" 2 - if [regexp -- $compiler_result $dot_s] { - verbose "Yes, it matches." 2 - } else { - verbose "Nope, doesn't match." 2 - verbose $dot_s 4 - set pass no - } - } - if { $not_compiler_result != "" } { - verbose "Checking .s file for not $not_compiler_result" 2 - if ![regexp -- $not_compiler_result $dot_s] { - verbose "Nope, not found (that's good)." 2 - } else { - verbose "Uh oh, it was found." 2 - verbose $dot_s 4 - set pass no - } - } - } - if [string match $run yes] { - set result [g77_load $output_file] - set status [lindex $result 0]; - set output [lindex $result 1]; - if { $status == -1 } { - mike_cleanup $src_code $output_file $assembly_file; - return; - } - if { $verbose > 1 } { - send_user "Checking:\n$program_output\nto see if it matches:\n$output\n\n" - } - if ![regexp -- $program_output $output] { - set pass no - if { $verbose > 1 } { - send_user "Nope, does not match.\n\n" - } - } else { - if { $verbose > 1 } { - send_user "Yes, it matches.\n\n" - } - } - } - } else { - if { $verbose > 1 } { - send_user "Nope, does not match.\n\n" - } - } - - if [string match $pass "yes"] { - pass $pass_message - } else { - fail $fail_message - } - - # The framework doesn't like to see any error remnants, - # so remove them. - uplevel { - if [info exists errorInfo] { - unset errorInfo - } - } - - mike_cleanup $src_code $output_file $assembly_file -} diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp deleted file mode 100755 index 5eadd48..0000000 --- a/gcc/testsuite/lib/objc-torture.exp +++ /dev/null @@ -1,316 +0,0 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-dejagnu.prep.ai.mit.edu - -# This file was written by Rob Savoye. (rob@cygnus.com) - -# The default option list can be overridden by -# TORTURE_OPTIONS="{ { list1 } ... { listN } }" - -if ![info exists TORTURE_OPTIONS] { - # FIXME: We should test -g at least once. - set TORTURE_OPTIONS [list { -O }] -} - - -# Split TORTURE_OPTIONS into two choices: one for testcases with loops and -# one for testcases without loops. - -set torture_with_loops $TORTURE_OPTIONS -set torture_without_loops "" -foreach option $TORTURE_OPTIONS { - if ![string match "*loop*" $option] { - lappend torture_without_loops $option - } -} - -# -# objc-torture-compile -- runs the Tege C-torture test -# -# SRC is the full pathname of the testcase. -# OPTION is the specific compiler flag we're testing (eg: -O2). -# -proc objc-torture-compile { src option } { - global output - global srcdir tmpdir - global host_triplet - - set output "$tmpdir/[file tail [file rootname $src]].o" - - regsub "^$srcdir/?" $src "" testcase - # If we couldn't rip $srcdir out of `src' then just do the best we can. - # The point is to reduce the unnecessary noise in the logs. Don't strip - # out too much because different testcases with the same name can confuse - # `test-tool'. - if [string match "/*" $testcase] { - set testcase "[file tail [file dirname $src]]/[file tail $src]" - } - - verbose "Testing $testcase, $option" 1 - - # Run the compiler and analyze the results. - set options "" - lappend options "additional_flags=-w $option" - - set comp_output [objc_target_compile "$src" "$output" object $options]; - - # Set a few common compiler messages. - set fatal_signal "*77*: Internal compiler error: program*got fatal signal" - - if [string match "$fatal_signal 6" $comp_output] then { - objc_fail $testcase "Got Signal 6, $option" - remote_file build delete $output - return - } - - if [string match "$fatal_signal 11" $comp_output] then { - objc_fail $testcase "Got Signal 11, $option" - remote_file build delete $output - return - } - - # We shouldn't get these because of -w, but just in case. - if [string match "*77*:*warning:*" $comp_output] then { - warning "$testcase: (with warnings) $option" - send_log "$comp_output\n" - unresolved "$testcase, $option" - remote_file build delete $output - return - } - - set comp_output [prune_warnings $comp_output] - - set unsupported_message [objc_check_unsupported_p $comp_output] - if { $unsupported_message != "" } { - unsupported "$testcase: $unsupported_message" - remote_file build delete $output - return - } - - # remove any leftover LF/CR to make sure any output is legit - regsub -all -- "\[\r\n\]*" $comp_output "" comp_output - # If any message remains, we fail. - if ![string match "" $comp_output] then { - objc_fail $testcase $option - remote_file build delete $output - return - } - - objc_pass $testcase $option - remote_file build delete $output -} - -# -# objc-torture-execute -- utility to compile and execute a testcase -# -# SRC is the full pathname of the testcase. -# -# If the testcase has an associated .cexp file, we source that to run the -# test instead. We use .cexp instead of .exp so that the testcase is still -# controlled by the main .exp driver (this is useful when one wants to only -# run the compile.exp tests for example - one need only pass compile.exp to -# dejagnu, and not compile.exp, foo1.exp, foo2.exp, etc.). -# -proc objc-torture-execute { src } { - global tmpdir tool srcdir output - - # Check for alternate driver. - if [file exists [file rootname $src].cexp] { - verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2 - set done_p 0 - catch "set done_p \[source [file rootname $src].cexp\]" - if { $done_p } { - return - } - } - - # Look for a loop within the source code - if we don't find one, - # don't pass -funroll[-all]-loops. - global torture_with_loops torture_without_loops - if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then { - set option_list $torture_with_loops - } else { - set option_list $torture_without_loops - } - - set executable $tmpdir/[file tail [file rootname $src].x] - - regsub "^$srcdir/?" $src "" testcase - # If we couldn't rip $srcdir out of `src' then just do the best we can. - # The point is to reduce the unnecessary noise in the logs. Don't strip - # out too much because different testcases with the same name can confuse - # `test-tool'. - if [string match "/*" $testcase] { - set testcase "[file tail [file dirname $src]]/[file tail $src]" - } - - foreach option $option_list { - # torture_{compile,execute}_xfail are set by the .cexp script - # (if present) - if [info exists torture_compile_xfail] { - setup_xfail $torture_compile_xfail - } - remote_file build delete $executable - verbose "Testing $testcase, $option" 1 - - set options "" - lappend options "additional_flags=-w $option -I${srcdir}/../../libobjc" - set comp_output [objc_target_compile "$src" "$executable" executable $options]; - - # Set a few common compiler messages. - set fatal_signal "*77*: Internal compiler error: program*got fatal signal" - - if [string match "$fatal_signal 6" $comp_output] then { - objc_fail $testcase "Got Signal 6, $option" - remote_file build delete $executable - continue - } - - if [string match "$fatal_signal 11" $comp_output] then { - objc_fail $testcase "Got Signal 11, $option" - remote_file build delete $executable - continue - } - - # We shouldn't get these because of -w, but just in case. - if [string match "*77*:*warning:*" $comp_output] then { - warning "$testcase: (with warnings) $option" - send_log "$comp_output\n" - unresolved "$testcase, $option" - remote_file build delete $executable - continue - } - - set comp_output [prune_warnings $comp_output] - - set unsupported_message [objc_check_unsupported_p $comp_output] - - if { $unsupported_message != "" } { - unsupported "$testcase: $unsupported_message" - continue - } elseif ![file exists $executable] { - if ![is3way] { - fail "$testcase compilation, $option" - untested "$testcase execution, $option" - continue - } else { - # FIXME: since we can't test for the existance of a remote - # file without short of doing an remote file list, we assume - # that since we got no output, it must have compiled. - pass "$testcase compilation, $option" - } - } else { - pass "$testcase compilation, $option" - } - - # See if this source file uses "long long" types, if it does, and - # no_long_long is set, skip execution of the test. - if [target_info exists no_long_long] then { - if [expr [search_for $src "integer\*8"]] then { - untested "$testcase execution, $option" - continue - } - } - - if [info exists torture_execute_xfail] { - setup_xfail $torture_execute_xfail - } - - set result [objc_load "$executable" "" ""] - set status [lindex $result 0]; - set output [lindex $result 1]; - if { $status == "pass" } { - remote_file build delete $executable - } - $status "$testcase execution, $option" - } -} - -# -# search_for -- looks for a string match in a file -# -proc search_for { file pattern } { - set fd [open $file r] - while { [gets $fd cur_line]>=0 } { - set lower [string tolower $cur_line] - if [regexp "$pattern" $lower] then { - close $fd - return 1 - } - } - close $fd - return 0 -} - -# -# objc-torture -- the objc-torture testcase source file processor -# -# This runs compilation only tests (no execute tests). -# SRC is the full pathname of the testcase, or just a file name in which case -# we prepend $srcdir/$subdir. -# -# If the testcase has an associated .cexp file, we source that to run the -# test instead. We use .cexp instead of .exp so that the testcase is still -# controlled by the main .exp driver (this is useful when one wants to only -# run the compile.exp tests for example - one need only pass compile.exp to -# dejagnu, and not compile.exp, foo1.exp, foo2.exp, etc.). -# -proc objc-torture { args } { - global srcdir subdir - - set src [lindex $args 0]; - if { [llength $args] > 1 } { - set options [lindex $args 1]; - } else { - set options "" - } - - # Prepend $srdir/$subdir if missing. - if ![string match "*/*" $src] { - set src "$srcdir/$subdir/$src" - } - - # Check for alternate driver. - if [file exists [file rootname $src].cexp] { - verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2 - set done_p 0 - catch "set done_p \[source [file rootname $src].cexp\]" - if { $done_p } { - return - } - } - - # Look for a loop within the source code - if we don't find one, - # don't pass -funroll[-all]-loops. - global torture_with_loops torture_without_loops - if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then { - set option_list $torture_with_loops - } else { - set option_list $torture_without_loops - } - - # loop through all the options - foreach option $option_list { - # torture_compile_xfail is set by the .cexp script (if present) - if [info exists torture_compile_xfail] { - setup_xfail $torture_compile_xfail - } - - objc-torture-compile $src "$option $options" - } -} diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp deleted file mode 100755 index d67ef04..0000000 --- a/gcc/testsuite/lib/objc.exp +++ /dev/null @@ -1,269 +0,0 @@ -# Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This file was written by Rob Savoye (rob@cygnus.com) -# Currently maintained by Doug Evans (dje@cygnus.com) - -# This file is loaded by the tool init file (eg: unix.exp). It provides -# default definitions for objc_start, etc. and other supporting cast members. - -# These globals are used by objc_start if no compiler arguments are provided. -# They are also used by the various testsuites to define the environment: -# where to find stdio.h, libc.a, etc. - -# -# OBJC_UNDER_TEST is the compiler under test. -# - -# -# default_objc_version -- extract and print the version number of the compiler -# - -proc default_objc_version { } { - global OBJC_UNDER_TEST - - objc_init; - - # ignore any arguments after the command - set compiler [lindex $OBJC_UNDER_TEST 0] - - if ![is_remote host] { - set compiler_name [which $compiler]; - } else { - set compiler_name $compiler; - } - - # verify that the compiler exists - if { $compiler_name != 0 } then { - set tmp [remote_exec host "$compiler -v"] - set status [lindex $tmp 0]; - set output [lindex $tmp 1]; - regexp "version.*$" $output version - if { $status == 0 && [info exists version] } then { - clone_output "$compiler_name $version\n" - } else { - clone_output "Couldn't determine version of $compiler_name: $output\n" - } - } else { - # compiler does not exist (this should have already been detected) - warning "$compiler does not exist" - } -} - -# -# Call objc_version. We do it this way so we can override it if needed. -# -proc objc_version { } { - default_objc_version; -} - -# -# objc_init -- called at the start of each .exp script. -# -# There currently isn't much to do, but always using it allows us to -# make some enhancements without having to go back and rewrite the scripts. -# - -set objc_initialized 0 - -proc objc_init { args } { - global tmpdir - global libdir - global gluefile wrap_flags - global objc_initialized - global OBJC_UNDER_TEST - global TOOL_EXECUTABLE - - if { $objc_initialized == 1 } { return; } - - if ![info exists OBJC_UNDER_TEST] then { - if [info exists TOOL_EXECUTABLE] { - set OBJC_UNDER_TEST $TOOL_EXECUTABLE; - } else { - set OBJC_UNDER_TEST [find_gcc] - } - } - - if ![info exists tmpdir] then { - set tmpdir /tmp - } - if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } { - set gluefile ${tmpdir}/testglue.o; - set result [build_wrapper $gluefile]; - if { $result != "" } { - set gluefile [lindex $result 0]; - set wrap_flags [lindex $result 1]; - } else { - unset gluefile - } - } -} - -proc objc_target_compile { source dest type options } { - global tmpdir; - global gluefile wrap_flags; - global OBJC_UNDER_TEST - global TOOL_OPTIONS - - lappend options "libs=-lobjc" - if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { - lappend options "libs=${gluefile}" - lappend options "ldflags=$wrap_flags" - } - - if [target_info exists objc,stack_size] { - lappend options "additional_flags=-DSTACK_SIZE=[target_info objc,stack_size]" - } - if [target_info exists objc,no_trampolines] { - lappend options "additional_flags=-DNO_TRAMPOLINES" - } - if [target_info exists objc,no_label_values] { - lappend options "additional_flags=-DNO_LABEL_VALUES" - } - if [info exists TOOL_OPTIONS] { - lappend options "additional_flags=$TOOL_OPTIONS" - } - if [target_info exists objc,no_varargs] { - lappend options "additional_flags=-DNO_VARARGS" - } - set objcpath "[get_multilibs]" - set libobjc_dir [lookfor_file ${objcpath} libobjc/libobjc.a] - if { $libobjc_dir != "" } { - set objc_link_flags "-L[file dirname ${libobjc_dir}]" - lappend options "additional_flags=${objc_link_flags}" - } - lappend options "compiler=$OBJC_UNDER_TEST" - return [target_compile $source $dest $type $options] -} - -# -# objc_pass -- utility to record a testcase passed -# - -proc objc_pass { testcase cflags } { - if { "$cflags" == "" } { - pass "$testcase" - } else { - pass "$testcase, $cflags" - } -} - -# -# objc_fail -- utility to record a testcase failed -# - -proc objc_fail { testcase cflags } { - if { "$cflags" == "" } { - fail "$testcase" - } else { - fail "$testcase, $cflags" - } -} - -# -# objc_finish -- called at the end of every .exp script that calls objc_init -# -# The purpose of this proc is to hide all quirks of the testing environment -# from the testsuites. It also exists to undo anything that objc_init did -# (that needs undoing). -# - -proc objc_finish { } { - # The testing harness apparently requires this. - global errorInfo; - - if [info exists errorInfo] then { - unset errorInfo - } - - # Might as well reset these (keeps our caller from wondering whether - # s/he has to or not). - global prms_id bug_id - set prms_id 0 - set bug_id 0 -} - -proc objc_exit { } { - global gluefile; - - if [info exists gluefile] { - file_on_build delete $gluefile; - unset gluefile; - } -} - -# If this is an older version of dejagnu (without runtest_file_p), -# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c. -# This can be deleted after next dejagnu release. - -if { [info procs runtest_file_p] == "" } then { - proc runtest_file_p { runtests testcase } { - if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then { - if { [lsearch $runtests [file tail $testcase]] >= 0 } then { - return 1 - } else { - return 0 - } - } - return 1 - } -} - -# Provide a definition of this if missing (delete after next dejagnu release). - -if { [info procs prune_warnings] == "" } then { - proc prune_warnings { text } { - return $text - } -} - -# Utility used by mike-gcc.exp and c-torture.exp. -# Check the compiler(/assembler/linker) output for text indicating that -# the testcase should be marked as "unsupported". -# -# When dealing with a large number of tests, it's difficult to weed out the -# ones that are too big for a particular cpu (eg: 16 bit with a small amount -# of memory). There are various ways to deal with this. Here's one. -# Fortunately, all of the cases where this is likely to happen will be using -# gld so we can tell what the error text will look like. - -proc ${tool}_check_unsupported_p { output } { - if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] { - return "memory full" - } - return "" -} - -# Prune messages from objc that aren't useful. - -proc prune_objc_output { text } { - #send_user "Before:$text\n" - regsub -all "(^|\n)\[^\n\]*: In (function|method) \[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*: At top level:\[^\n\]*" $text "" text - - # It would be nice to avoid passing anything to objc that would cause it to - # issue these messages (since ignoring them seems like a hack on our part), - # but that's too difficult in the general case. For example, sometimes - # you need to use -B to point objc at crt0.o, but there are some targets - # that don't have crt0.o. - regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text - regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text - - #send_user "After:$text\n" - - return $text -} - diff --git a/gcc/toplev.c b/gcc/toplev.c index 3582b76..12dc26c 100755 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -82,6 +82,8 @@ extern char *version_string, *language_string; extern int size_directive_output; extern tree last_assemble_variable_decl; +extern void cpplib_init(); + extern char *init_parse PVPROTO((char *)); extern void finish_parse (); extern void init_decl_processing (); @@ -135,9 +137,6 @@ static void vsorry PROTO((char *, va_list)); static void v_really_sorry PROTO((char *, va_list)) ATTRIBUTE_NORETURN; static void float_signal PROTO((int)) ATTRIBUTE_NORETURN; static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN; -#ifdef ASM_IDENTIFY_LANGUAGE -static void output_lang_identify PROTO((FILE *)); -#endif static void open_dump_file PROTO((char *, char *)); static void close_dump_file PROTO((void (*) (FILE *, rtx), rtx)); static void dump_rtl PROTO((char *, tree, void (*) (FILE *, rtx), rtx)); @@ -1029,28 +1028,7 @@ documented_lang_options[] = { "-nostdinc", "" }, { "-nostdinc++", "" }, { "-trigraphs", "" }, - { "-undef", "" }, - -#define DEFINE_LANG_NAME(NAME) { NULL, NAME }, - - /* These are for obj c. */ - DEFINE_LANG_NAME ("Objective C") - - { "-lang-objc", "" }, - { "-gen-decls", "Dump decls to a .decl file" }, - { "-fgnu-runtime", "Generate code for GNU runtime envrionment" }, - { "-fno-gnu-runtime", "" }, - { "-fnext-runtime", "Generate code for NeXT runtime environment" }, - { "-fno-next-runtime", "" }, - { "-Wselector", "Warn if a selector has multiple methods" }, - { "-Wno-selector", "" }, - { "-Wprotocol", "" }, - { "-Wno-protocol", "Do not warn if inherited methods are unimplemented"}, - { "-print-objc-runtime-info", - "Generate C header of platform specific features" }, - -#include "options.h" - + { "-undef", "" } }; /* Here is a table, controlled by the tm.h file, listing each -m switch @@ -2372,19 +2350,6 @@ output_file_directive (asm_file, input_name) #endif #endif } - -#ifdef ASM_IDENTIFY_LANGUAGE -/* Routine to build language identifier for object file. */ -static void -output_lang_identify (asm_out_file) - FILE *asm_out_file; -{ - int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1; - char *s = (char *) alloca (len); - sprintf (s, "__gnu_compiled_%s", lang_identify ()); - ASM_OUTPUT_LABEL (asm_out_file, s); -} -#endif /* Routine to open a dump file. */ static void @@ -2721,9 +2686,13 @@ compile_file (name) input_file_stack->next = 0; input_file_stack->name = input_filename; - /* Perform language-specific initialization. - This may set main_input_filename. */ - lang_init (); + /* This may set main_input_filename. */ +#if !USE_CPPLIB + ungetc (check_newline (), finput); +#else + check_newline (); + yy_cur--; +#endif /* If the input doesn't start with a #line, use the input name as the official input file name. */ @@ -3002,9 +2971,6 @@ compile_file (name) weak_finish (); - /* Do dbx symbols */ - - #ifdef DWARF2_UNWIND_INFO if (dwarf2out_do_frame ()) dwarf2out_frame_finish (); @@ -3026,10 +2992,7 @@ compile_file (name) ASM_FILE_END (asm_out_file); #endif - - /* Language-specific end of compilation actions. */ finish_syntax: - lang_finish (); /* Close the dump files. */ @@ -4406,8 +4369,9 @@ main (argc, argv) flag_short_enums = DEFAULT_SHORT_ENUMS; #endif - /* Perform language-specific options intialization. */ - lang_init_options (); +#if USE_CPPLIB + cpplib_init(); +#endif /* Scan to see what optimization level has been specified. That will determine the default value of many flags. */ @@ -4517,9 +4481,7 @@ main (argc, argv) if (j != (size_t)-1) { - /* If the option is valid for *some* language, - treat it as valid even if this language doesn't understand it. */ - int strings_processed = lang_decode_option (argc - i, argv + i); + int strings_processed = c_decode_option (argc - i, argv + i); if (!strcmp (argv[i], "--help")) { @@ -4749,8 +4749,7 @@ print_obstack_statistics (str, o) str, n_alloc, n_chunks); } -/* Print debugging information about tree nodes generated during the compile, - and any language-specific information. */ +/* Print debugging information about tree nodes generated during the compile. */ void dump_tree_statistics () @@ -4785,7 +4784,6 @@ dump_tree_statistics () print_obstack_statistics ("momentary_obstack", &momentary_obstack); print_obstack_statistics ("temp_decl_obstack", &temp_decl_obstack); print_inline_obstack_statistics (); - print_lang_statistics (); } #define FILE_FUNCTION_PREFIX_LEN 9 @@ -2036,31 +2036,16 @@ extern void dwarf2out_end_epilogue PROTO((void)); /* The language front-end must define these functions. */ -/* Function of no arguments for initializing options. */ -extern void lang_init_options PROTO((void)); - /* Function of no arguments for initializing lexical scanning. */ extern void init_lex PROTO((void)); /* Function of no arguments for initializing the symbol table. */ extern void init_decl_processing PROTO((void)); -/* Functions called with no arguments at the beginning and end or processing - the input source file. */ -extern void lang_init PROTO((void)); -extern void lang_finish PROTO((void)); - -/* Function to identify which front-end produced the output file. */ -extern char *lang_identify PROTO((void)); - /* Function to replace the DECL_LANG_SPECIFIC field of a DECL with a copy. */ extern void copy_lang_decl PROTO((tree)); /* Function called with no arguments to parse and compile the input. */ extern int yyparse PROTO((void)); -/* Function called with option as argument - to decode options starting with -f or -W or +. - It should return nonzero if it handles the option. */ -extern int lang_decode_option PROTO((int, char **)); /* Functions for processing symbol declarations. */ /* Function to enter a new lexical scope. @@ -2229,9 +2214,6 @@ extern struct rtx_def *emit_line_note_force PROTO ((char *, int)); extern int mark_addressable PROTO ((tree)); extern void incomplete_type_error PROTO ((tree, tree)); -/* In c-lang.c */ -extern void print_lang_statistics PROTO ((void)); - /* In c-common.c */ extern tree truthvalue_conversion PROTO ((tree)); extern int min_precision PROTO ((tree, int)); @@ -2297,9 +2279,6 @@ extern tree case_index_expr_type PROTO ((void)); extern HOST_WIDE_INT all_cases_count PROTO ((tree, int *)); extern void check_for_full_enumeration_handling PROTO ((tree)); extern void declare_nonlocal_label PROTO ((tree)); -#ifdef BUFSIZ -extern void lang_print_xnode PROTO ((FILE *, tree, int)); -#endif /* If KIND=='I', return a suitable global initializer (constructor) name. |