aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
AgeCommit message (Collapse)AuthorFilesLines
2000-10-01c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.Mark Mitchell1-1/+28
* c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only. (lang_mark_false_label_stack): Remove. * c-lex.c (init_c_lex): Add file_info_tree as GC root. Allocate <top level> string in GC area. (mark_splay_tree_node): New function. (mark_splay_tree): Likewise. * except.c (mark_eh_status): Only call lang_mark_false_label_stack if it exists. * ggc-callbacks.c (lang_mark_false_label_stack): Remove. * ggc-common.c (lang_mark_false_label_stack): Change type. * ggc.h (ggc_alloc_string): Add comment. (ggc_strdup): New function. * decl.c (lang_mark_false_label_stack): Remove. * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. * com.c (lang_mark_false_label_stack): Remove. Convert to GC. * Make-lang.in (s-java): Don't depend on ggc-callbacks.o. * Makefile.in (BACKEND): Don't include ggc-callbacks.o. (typeck.o): Depend on ggc.h. * class.c (add_method_1): Use GC functions for allocation. (init_class_processing): Register roots. * decl.c (ggc_p): Set to 1. (pending_local_decls): Make it static. (push_jvm_slot): Use GC functions for allocation. (init_decl_processing): Register roots. (give_name_to_locals): Use GC functions for allocation. (lang_mark_tree): New function. * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC functions for allocation. * jcf-parse.c (jcf_parse_source): Use ggc_strdup. * lex.c (java_lex): Use build_string, rather than replicating it inline. * parse.y (goal): Add more roots. (mark_parser_ctxt): New function. * typeck.c: Include ggc.h. * splay-tree.c (splay_tree_insert): Fix formatting. From-SVN: r36687
2000-09-22c-lex.c (skip_white_space): Just treat CRs as horizontal whitespace.Jason Merrill1-4/+7
* c-lex.c (skip_white_space): Just treat CRs as horizontal whitespace. * dbxout.c (dbxout_symbol_name): Just use DECL_NAME for function-local names. From-SVN: r36570
2000-09-17c-decl.c (grokdeclarator): Reorder tests to avoid looking at ↵Richard Kenner1-1/+1
TYPE_MAIN_VARIANT of ERROR_MARK. * c-decl.c (grokdeclarator): Reorder tests to avoid looking at TYPE_MAIN_VARIANT of ERROR_MARK. * c-lex.c (readescape): Avoid using printf syntax we don't recognize. From-SVN: r36472
2000-09-17splay-tree.c (splay_tree_predecessor): Fix typo in comment.Mark Mitchell1-0/+1
* splay-tree.c (splay_tree_predecessor): Fix typo in comment. Convert the C front-end to use function-at-a-time mode. * c-common.h: Include splay-tree.h. (C_DECLARED_LABEL_FLAG): New macro. (struct language_function): Add x_scope_stmt_stack and x_function_name_declared_p. (RECHAIN_STMTS): Move definition. (lang_statment_code_p): Likewise. (lang_expand_stmt): Likewise. (lang_expand_decl_stmt): New variable. (lang_expand_function_end): Likewise. (current_scope_stmt_stack): New function. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. (mark_stmt_tree): Likewise. (struct c_lang_decl): New structure. (DECL_SAVED_TREE): Define. (c_mark_lang_decl): New function. (c_expand_start_cond): Change prototype. (c_finish_then): New function. (c_finish_else): Likewise. (current_function_name_declared): Remove. (set_current_function_name_declared): Likewise. (mark_c_language_function): Declare. (case_compare): Likewise. (c_add_case_label): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-common.c (lang_expand_function_end): New variable. (struct if_elt): Add if_stmt. (c_expand_start_cond): Add the if-statement to the statement-tree, rather than generating RTL. (c_finish_then): New function. (c_expand_start_else): Don't generate RTL. (c_finish_else): New function. (c_expand_expr_stmt): Don't generate RTL. (statement_code_p): Add SCOPE_STMT. (case_compare): New function. (c_add_case_label): Likewise. (mark_stmt_tree): Likewise. (c_mark_lang_decl): Likewise. (mark_c_language_function): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-decl.c (c_stmt_tree): New variable (c_scope_stmt_stack): Likewise. (c_function_name_declared_p): Likewise. (lang_expand_expr_stmt): Remove. (poplevel): Don't call output_inline_function for nested functions. (pushdecl): Don't set DECL_CONTEXT for a local declaration of an `extern' function. (redeclaration_error_message): Change means of computing whether or not a function is nested. (lookup_label): Don't call label_rtx. (init_decl_processing): Add more GC roots. (start_decl): Add DECL_STMTs to the statement-tree, rather than calling rest_of_decl_compilation. (finish_decl): Don't call expand_decl. (store_parm_decls): Begin the statement-tree, but don't generate RTL. (finish_function): Tie off the statement-tree. Call c_expand_body if appropriate. (c_expand_body): New function. (push_c_function_context): Save more information. (pop_c_function_contxt): Likewise. (copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it. (lang_mark_tree): Mark it. (current_stmt_tree): Adjust. (current_scope_stmt_stack): New function. (do_case): Remove. (set_current_name_declared): Likewise. (c_begin_compound_stmt): Define. (c_expand_decl_stmt): Likewise. * c-lang.c: Include rtl.h and expr.h. (lang_init): Set more language-specific hooks. * c-lex.c: Include expr.h. * c-parse.in: Changes throughout to add statements to the statement-tree, rather than generating RTL after every statement. * c-semantics.c (lang_expand_decl_stmt): Define. (add_decl_stmt): New function. (add_scope_stmt): Likewise. (finish_stmt_tree): Tweak. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Handle local labels, and call lang_expand_decl_stmt if required. (genrtl_for_stmt): Fix line-number handling. (genrtl_case_label): Handle cleanups. (genrtl_asm_stmt): Don't call combine_strings. (genrtl_compound_stmt): Simplify. (expand_stmt): Handle SCOPE_STMTs. * c-tree.h (struct lang_decl): New structure. (C_DECLARED_LABEL_FLAG): Remove. (c_begin_compound_stmt): Declare. (c_expand_decl_stmt): Likewise. (c_expand_start_case): Rename to c_start_case. (c_finish_case): New function. * c-typeck.c (start_init): Tweak setting of constructor_incremental. (c_expand_asm_operands): Tweak error-handling. Add to the statement-tree. (c_expand_return): Add to the statement-tree. (c_expand_start_case): Rename to ... (c_start_case): ... this. (struct c_switch): New type. (switch_stack): New variable. (do_case): Simplify. (c_finish_case): New function. * dependence.c: Include expr.h. (enum dependence_type): Change spelling of enumerals. (check_node_dependence): Adjust. * expr.h (lang_safe_from_p): Declare. (safe_from_p): Likewise. * expr.c (lang_safe_from_p): New variable. (safe_from_p): Give it external linkage. Use lang_safe_from_p. * stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type. * toplev.c (rest_of_decl_compilation): Robustify. * tree.c (contains_placeholder_p): Likewise. * Makefile.in: Update dependencies. * objc/objc-act.h: Adjust calculation of value for dummy_tree_code. * objc/objc-act.c: Include rtl.h, expr.h, and c-common.h. (objc_expand_function_end): New function. (finish_method_def): Use it. (init_objc): Initialize more language-specific hooks. * objc/Make-lang.in: Update dependencies. * cp-tree.h (struct cp_language_function): Remove x_scope_stmt_stack and name_declared. (current_scope_stmt_stack): Remove. (function_name_declared_p): New macro. (struct lang_decl_flags): Use c_lang_decl as a base class. (context): Remove. (struct lang_decl): Replace saved_tree with context. (DECL_FRIEND_CONTEXT): Adjust accordingly. (SET_DECL_FRIEND_CONTEXT): Likewise. (DECL_VIRTUAL_CONTEXT): Likewise. (DECL_SAVED_TREE): Remove. (C_DECLARED_LABEL_FLAG): Likewise. (cplus_expand_expr_stmt): Don't declare. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. * decl.c (mark_stmt_tree): Remove. (case_compare): Likewise. (finish_case_label): Use c_add_case_label. (init_decl_processing): Set more language-specific hooks. (build_enumerator): Fix typo in comment. (cplus_expand_expr_stmt): Remove. (mark_lang_function): Use mark_c_language_function. (lang_mark_tree): Use c_mark_lang_decl. * decl2.c: Change order of inclusion. * except.c: Likewise. * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall back on c_expand_expr. * friend.c: Include expr.h. * init.c: Change order of inclusion. * Makefile.in: Update dependencies. * lex.h (free_lang_decl_chain): Remove. * optimize.c (maybe_clone_body): Use function_name_declared_p. * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if it doesn't exist. (instantiate_decl): Use function_name_declared_p. * semantics.c (lang_expand_expr_stmt): Remove. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (begin_compound_stmt): Use function_name_declared_p. (add_decl_stmt): Remove. (setup_vtbl_ptr): Use function_name_declared_p. (add_scope_stmt): Remove. (current_scope_stmt_stack): New function. (cp_expand_stmt): Don't handle SCOPE_STMTs. (expand_body): Use function_name_declared_p. * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. * typeck.c: Change order of includes. (convert_sequence): Remove. From-SVN: r36464
2000-09-12c-lex.c (lex_string): Use charwidth to compute bytemask.Jakub Jelinek1-1/+1
* c-lex.c (lex_string): Use charwidth to compute bytemask. * expr.c (expand_expr): Don't optimize constant array references initialized with wide string constants. From-SVN: r36380
2000-09-08c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS.Zack Weinberg1-3/+1
* c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS. (init_pragma): Avoid warning if pfile happens to be unused. * c-pragma.h: Never define HANDLE_GENERIC_PRAGMAS. Never define init_pragma to nothing. Always prototype init_pragma. Prototype dispatch_pragma if !USE_CPPLIB. * c-lex.c (process_directive): Always call dispatch_pragma. Initialize entering_c_header to 0. From-SVN: r36277
2000-09-07c-lex.c (process_directive): If not HANDLE_GENERIC_PRAGMAS, do not call ↵Richard Henderson1-11/+2
dispatch_pragma. * c-lex.c (process_directive): If not HANDLE_GENERIC_PRAGMAS, do not call dispatch_pragma. From-SVN: r36257
2000-09-07c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined.Zack Weinberg1-2/+24
* c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined. Duplicate some definitions from cpplib.h. * cpplib.h: Don't typedef struct cpp_reader if c-pragma.h has already done it. * tm.texi: Document HANDLE_PRAGMA as no longer supported. Add documentation for REGISTER_TARGET_PRAGMAS. * c-lex.c: Include cpplib.h before c-pragma.h. Define a default-pragma callback to implement -Wunknown-pragmas if USE_CPPLIB. * c-parse.in: Move all includes to top of file. * c-pragma.c: Include cpplib.h before c-pragma.h. Include tm_p.h. (dispatch_pragma): Put the namespace in the -Wunknown-pragmas warning. (init_pragma): If REGISTER_TARGET_PRAGMAS is defined, call it. * arm.h, arm-protos.h, arm.c, c4x.h, c4x-protos.h, c4x.c, h8300.h, h8300-protos.h, h8300.c, i370.h, i370-protos.h, i370.c, i960.h, i960-protos.h, i960.c, sh.h, sh-protos.h, sh.c, v850.h, v850-protos.h, v850.c: Convert HANDLE_PRAGMA-based pragmata scheme to use REGISTER_TARGET_PRAGMAS instead. * d30v.h: Don't mention HANDLE_PRAGMA in comment. Add multiple include guard. * i370.md (untyped_call): Use GEN_CALL. (umodsi3): Remove unused variable. * sh/elf.h: Don't undef HANDLE_SYSV_PRAGMA. * v850.c (output_move_single, output_move_double): Constify return value. (print_operand): Constify a char *. * v850.h (struct small_memory_info): Constify name member. From-SVN: r36249
2000-09-07Integrated preprocessor.Zack Weinberg1-1689/+1758
top level: * Makefile.in: Remove all references to c-parse.gperf, c-gperf.h, and c-parse.h. Remove -d from yacc command line generating c-parse.c. Update dependencies. * c-parse.gperf, c-gperf.h: Delete. * c-common.c: Don't define parse_options, cpp_token, yy_cur, yy_lim, or yy_get_token. Don't define get_directive_line if USE_CPPLIB. * c-common.h: Add multiple include guard. Define RID values for every keyword in C, C++, and Objective C. Put all the modifiers first. (struct c_fileinfo, get_fileinfo, dump_time_statistics): New. * c-decl.c (c_decode_option): Handle -lang-objc here. (print_lang_identifier): Handle C_IS_RESERVED_WORD case. (grokdeclarator): Adjust for new RID scheme. (extract_interface_info): New stub. * c-lang.c: Don't declare yy_cur or parse_options. (lang_init_options): Call cpp_init. Don't call cpp_options_init. (lang_init): Don't call check_newline if USE_CPPLIB. * c-lex.c: Don't include c-parse.h. Do include timevar.h. Elide lots of unnecessary code if USE_CPPLIB. Delete code rendered unnecessary by new architecture. Move routines not shared with C++ to c-parse.in. Maintain a local idea of the line number. Handle C++ as well as C. [USE_CPPLIB]: Declare and register callbacks for #ident and for entering/leaving files. (init_c_lex, c_lex): Are now the entry points to this file. (check_newline): Break out directive handling to process_directive. (read_ucs, is_extended_char, utf8_extend_token): Moved here from C++ front end. (readescape, parse_float): Overhaul. (lex_number, lex_string, lex_charconst): Break out of c_lex (n'ee yylex). (get_fileinfo, update_header_times, dump_one_header, dump_time_statistics): New and/or moved here from C++. Support per-file data needed by C++ and per-header timing statistics (C++ only, at the moment). * c-lex.h: Update prototypes. Add multiple include guard. * c-tree.h (struct lang_identifier): Add rid_code field. (C_IS_RESERVED_WORD, C_RID_CODE): New. * c-parse.in: Include c-pragma.h. Remove unnecesary calls to reinit_parse_for_function and/or position_after_white_space. (save_filename, save_lineno): Look ahead before saving. (label -> identifier ':'): Save file and line before shifting ':'. (reservedwords): No need to call get_identifier. (init_parse, finish_parse, yyerror, yylex, yyprint, make_pointer_declarator): Are now here for C/ObjC. (rid_to_yy): Conversion table from RID constants to Yacc codes. * c-pragma.c: Rewrite parsing logic to fit with cpplib's #pragma registry. Provide dummy implementation of that interface if !USE_CPPLIB. * c-pragma.h: Update to match. * flags.h: Add multiple include guard. (flag_detailed_statistics): Moved here from C++. * toplev.c: Define flag_detailed_statistics. * gcc.c (C specs): Use %(trad_capable_cpp) for -E|-M|-MM case #if USE_CPPLIB. * timevar.def (TV_CPP, TV_LEX): New. * timevar.h: Add multiple include guard. * objc/lang-specs.h: Use %(trad_capable_cpp) for -E|-M|-MM case #if USE_CPPLIB. * objc/objc-act.c: Don't mention yy_cur or parse_options. Initialize cpplib properly. Force lineno to 0 after first call to check_newline. Don't handle -lang-objc here. Move forget_protocol_qualifiers and remember_protocol_qualifiers here. cp: * Make-lang.in, Makefile.in: Remove all references to input.c, gxx.gperf, and hash.h. Add ../c-lex.o to C_OBJS. * gxx.gperf, hash.h, input.c: Delete. * lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is initialized properly. * class.c (fixup_pending_inline): Take a tree, not a struct pending_inline *. All callers changed. (init_class_processing): Set RID_PUBLIC, RID_PRIVATE, RID_PROTECTED entries in ridpointers[] array here. * decl.c (duplicate_decls): Do not refer to struct pending_inline. (record_builtin_type, init_decl_processing): Use RID_MAX not CP_RID_MAX. (grokdeclarator): Use C_IS_RESERVED_WORD. * decl2.c (lang_decode_option): Ignore -lang-c++ for sake of cpplib. (grok_x_components): Do not inspect pending_inlines chain. * cp-tree.h (struct lang_identifier): Add rid_code entry. (C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New. (flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare. (DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME, TIME_IDENTIFIER_FILEINFO): Kill. Update prototypes. * lex.h: Expunge cp_rid. Rewrite RIDBIT macros to use just a single 32-bit word. * parse.y: Call do_pending_inlines unconditionally. reinit_parse_for_method is now snarf_method. fn.defpen is no longer necessary. Remove unnecessary <itype> annotation on SCOPE. Do not refer to end_of_file or struct pending_inline. * semantics.c (begin_inline_definitions): Call do_pending_inlines unconditionally. * lex.c: Remove all code now shared with C front end. Initialize cpplib properly if USE_CPPLIB. Put reserved words into the get_identifier table. Rewrite pragma handling to work with the registry. Move code to save tokens for later processing to spew.c. * spew.c: Rewrite everything in terms of token streams instead of text. Move routines here from lex.c / input.c as appropriate. GC-mark trees hanging off the pending inlines chain. testsuite: * g++.old-deja/g++.benjamin/13478.C: Put meaningful tags on ERROR markers. * g++.old-deja/g++.brendan/crash8.C: Move ERROR marker up one line. * gcc.dg/c99-array-nonobj-1.c: Don't expect func[] cases to fail. * gcc.dg/wtr-label-1.c: Don't use unconstrained .* in error regexps. * gcc.dg/wtr-suffix-1.c: Correct error regexps. * gcc.dg/cpp/unc1.c, gcc.dg/cpp/unc2.c, gcc.dg/cpp/unc3.c: Preprocess only. * gcc.dg/cpp/unc4.c: Adjust line number in dg-error line. * gcc.dg/noncompile/const-ll-1.c: Generalize error regexp. From-SVN: r36216
2000-08-25Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.Mark Mitchell1-3/+0
* Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o. (c-iterate.o): Remove target. * gcc/c-common.h (enum rid): Remove RID_ITERATOR. * gcc/c-decl.c (init_decl_processing): Remove call to init_iterators. (finish_decl): Don't handle iterators. (grokdeclarator): Likewise. * gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords. * gcc/c-gperf.h: Regenerated. * gcc/c-iterate.c: Removed. * gcc/c-lex.c (init_lex): Don't handle iterators. * gcc/c-parse.in (primary): Remove pop_iterator_stack call. (compstmt_primary_start): Remove push_iterator_stack call. (stmt): Don't allow iterator statements. Replace iterator_expand with expand_expr_stmt. (all_iter_stmt): Remove. (all_iter_stmt_simple): Likewise. (all_iter_stmt_with_decl): Likewise. * gcc/c-tree.h (ITERATOR_P): Remove. (ITERATOR_BOUND_P): Likewise. (init_iterators): Remove declaration. (iterator_expand): Likewise. (iterator_for_loop_start): Likewise. (iterator_for_loop_end): Likewise. (iterator_for_loop_record): Likewise. (push_iterator_stack): Likewise. (pop_iterator_stack): Likewise. * gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P. (readonly_warning): Likewise. * gcc/tree.h (ITERATOR_BOUND_P): Don't mention it. * Make-lang.in (cc1chill): Don't depend on c-iterate.o. * gcc.dg/noncompile/930622-2.c: Adjust error message. From-SVN: r35967
2000-08-21c-decl.c (duplicate_decls, [...]): Restrict -Wtraditional warnings to user code.Kaveh R. Ghazi1-3/+3
* c-decl.c (duplicate_decls, define_label): Restrict -Wtraditional warnings to user code. * c-lex.c (readescape, yylex): Likewise. * c-typeck.c (store_init_value, process_init_element): Likewise (c_expand_start_case): Format. From-SVN: r35845
2000-08-10c-lex.c (parse_float, yylex): For -Wtraditional, issue a warning about ↵Kaveh R. Ghazi1-0/+6
non-traditional numeric constant suffixes. * c-lex.c (parse_float, yylex): For -Wtraditional, issue a warning about non-traditional numeric constant suffixes. * cppexp.c (parse_number): Likewise. * invoke.texi: (-Wtraditional): Document new behavior. From-SVN: r35607
2000-08-09c-common.c (combine_strings, [...]): Refer to ISO C or ISO C89 instead of ↵Joseph Myers1-6/+6
ANSI C. * c-common.c (combine_strings, check_format_info): Refer to ISO C or ISO C89 instead of ANSI C. * c-decl.c (grokdeclarator, xref_tag, finish_struct, build_enumerator, do_case): Likewise. * c-lex.c (parse_float, yylex): Likewise. * c-parse.in: Likewise. * c-typeck.c (common_type, build_array_ref, build_binary_op, build_unary_op, pedantic_lvalue_warning, build_conditional_expr, build_c_cast, convert_for_assignment, set_init_index, set_init_label, c_expand_start_case): Likewise. * toplev.c (documented_lang_options, display_help): Likewise. From-SVN: r35576
2000-08-08c-lex.c (yylex): Don't allow integer suffixes 'LUL', 'Ll', 'lL'.Joseph Myers1-1/+8
* c-lex.c (yylex): Don't allow integer suffixes 'LUL', 'Ll', 'lL'. testsuite: * gcc.dg/noncompile/const-ll-1.c: New test. From-SVN: r35563
2000-08-04cpplex.c (parse_name): Might have to glue a CPP_OTHER token before the name.Zack Weinberg1-7/+1
* cpplex.c (parse_name): Might have to glue a CPP_OTHER token before the name. (lex_line): Glue @ onto the beginning of identifiers and string constants, in Objective-C mode. (output_token, spell_token): Handle CPP_OSTRING. (can_paste, maybe_paste_with_next): Handle pasting @ onto the beginning of a NAME or a STRING, in objc mode. * cpplib.c (get_define_node): Do not permit identifiers that begin with @ to be #defined. * cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER. * cpplib.h (TTYPE_TABLE): Add CPP_OSTRING. * c-lang.c, objc/objc-act.c (build_objc_string): Delete. * c-tree.h (build_objc_string): Delete prototype. * objc/objc-tree.def: Delete OBJC_STRING_CST. * c-lex.c (yylex): Use build_string for all three kinds of strings. * gcc.dg/cpp/20000625-2.c: Don't expect a warning on line 4. From-SVN: r35470
2000-07-23c-lex.c (init_lex): Keep the "inline" keyword in C99 mode.Joseph Myers1-2/+3
* c-lex.c (init_lex): Keep the "inline" keyword in C99 mode. (yylex): Don't pedwarn for "inline" in C99 mode. From-SVN: r35202
2000-07-17c-lex.c (yylex): Don't pedwarn for hexadecimal floating point constants in ↵Joseph Myers1-1/+1
C99 mode. * c-lex.c (yylex): Don't pedwarn for hexadecimal floating point constants in C99 mode. From-SVN: r35075
2000-07-13c-common.h (flag_digraphs): New.Neil Booth1-6/+9
* c-common.h (flag_digraphs): New. * c-decl.c (c_decode_option): Set flag_digraphs as appropriate. * c-lex.c (yylex): Use flag_digraphs to decide whether to honour digraphs. * testsuite/gcc.dg/cpp/digraph1.c, testsuite/gcc.dg/cpp/digraph2.c, testsuite/gcc.dg/cpp/digraphs.c: New tests. From-SVN: r35010
2000-07-10flags.h: Add new variable flag_single_precision_constant.Chandrakala Chavva1-0/+2
* flags.h : Add new variable flag_single_precision_constant. * toplev.c (display_help) : Add -fsingle-precision-constant option. (flag_single_precision_constant): New. * c-lex.c (yylex): Convert floating point constant to single precision constant. * invoke.texi : Add documentation for this new option. From-SVN: r34946
2000-06-30Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h.Mark Mitchell1-5/+1
* Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h. * c-common.c (ridpointers): Declare. * c-common.h (enum rid): Declare. (NORID): Likewise. (ridpointers): Likewise. * c-lex.c (ridpointers): Don't declare. (init_lex): Initialize ridpointers. * c-lex.h (enum rid): Don't declare. (NORID): Likewise. (RID_FIRST_MODIFIER): Likewise. (ridpointers): Likewise. * cp-tree.h (ridpointers): Don't declare. * decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX. (record_builtin_java_type): Likewise. (init_decl_processing): Likewise. * lex.c: Move inclusion of lex.h. (ridpointers): Don't define. (init_parse): Initialize ripdointers. Use CP_RID_MAX instead of RID_MAX. * lex.h (enum rid): Rename to ... (enum cp_rid): ... this. (ridpointers): Don't declare. * parse.y: Move inclusion of lex.h. * parse.c: Regenerated. * spew.c: Move inclusion of lex.h. * cp-tree.h (struct language_function): Remove temp_name_counter. (temp_name_counter): Remove. (get_temp_name): Change prototype. (get_guard): New function. (get_guard_cond): Likewise. (set_guard): Likewise. * cvt.c (build_up_reference): Adjust call to get_temp_name. * decl.c (expand_static_init): Use get_guard and friends to implement guard variables. * decl2.c (get_temp_name): Assume that the variables created are always static. (get_sentry): Rename to ... (get_guard): ... this. Implement new ABI guard variables. (get_guard_bits): New function. (get_guard_cond): Likewise. (set_guard): Likewise. (start_static_initialization_or_destruction): Use them. (do_static_initialization): Replace sentry with guard throughout. (do_static_destruction): Likewise. * init.c (create_temporary_var): Add comment. From-SVN: r34815
2000-06-26[multiple changes]Richard Henderson1-1/+2
2000-06-26 Joseph S. Myers <jsm28@cam.ac.uk> * c-decl.c (grokdeclarator): Don't warn about `long long' in C99. Make warnings about implicit int be pedwarns in C99. Don't warn about duplicate type qualifiers in C99. (start_function): Make warning about implict int return type be a pedwarn in C99. * c-lex.c (yylex): Don't warn about `long long' in C99. * c-typeck.c (c_expand_return): In C99, always pedwarn about `return' with no value in function returning non-void. 2000-06-26 Richard Henderson <rth@cygnus.com> * c-typeck.c (pedwarn_c99): New. * diagnostic.c (verror, vwarning, vpedwarn): Export. * toplev.h: Prototype them. From-SVN: r34713
2000-06-19c-parse.in (undeclared_variable_notice): Moved to c-typeck.c.Zack Weinberg1-17/+13
* c-parse.in (undeclared_variable_notice): Moved to c-typeck.c. (primary: IDENTIFIER): Just call build_external_ref. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * c-lex.c (lastiddecl): Remove. (yylex): Replace all instances of lastiddecl with local variables. * c-typeck.c (build_external_ref): New function. Treat decls with C_DECL_ANTICIPATED mostly the same as nonexistent decls. Look up the decl from the id here. Call lookup_objc_ivar. * c-lang.c (lookup_objc_ivar): Stub. * objc/objc-act.c (lookup_objc_ivar): New function. * c-tree.h: Prototype lookup_objc_ivar and build_external_ref. * c-lex.h: Don't declare lastiddecl. From-SVN: r34602
2000-06-16c-common.c (c_tree_code_type): New array.Benjamin Chelf1-0/+2
* c-common.c (c_tree_code_type): New array. (c_tree_code_length): Likewise. (c_tree_code_name): Likewise. (add_c_tree_codes): New function. * c-common.h (add_c_tree_codes): Declare. (enum c_tree_code): New enum. * c-lex.c (init_parse): Added call to add_c_tree_codes. * cp/cp-tree.h (enum cplus_tree_code): Changed __DUMMY to CP_DUMMY_TREE_CODE. Remove #include "c-common.def". * cp/lex.c (cplus_tree_code_type[]): Removed #include "c-common.def". (cplus_tree_code_length[]): Likewise. (cplus_tree_code_name[]): Likewise. (init_parse): Added call to add_c_tree_codes. Changed LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE. From-SVN: r34577
2000-06-06c-common.h (c_language_kind): New type.Mark Mitchell1-4/+0
* c-common.h (c_language_kind): New type. (c_language): New variab.e * c-common.c (lang_get_alias_set): Don't put structures in non-zero alias sets in C++. * c-decl.c (c_language): Define it. * c-lex.c (doing_objc_thang): Remove. * c-tree.h (doing_objc_thang): Make it a macro. * objc/objc-act.c (lang_decode_option): Set c_language, not doing_objc_thang. * decl2.c (c_language): Define. From-SVN: r34439
2000-05-09top level:Zack Weinberg1-2/+2
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-04-18cccp.c, [...]: Removed.Zack Weinberg1-1/+1
* cccp.c, cexp.y, cexp.c, cccp.1: Removed. * configure.in: Delete --disable-cpplib option and all references to cpp_main. * configure: Regenerate. * Makefile.in: Remove all references to CCCP, CCCP_OBJS, @cpp_main@, cccp.c, cexp.c, cexp.y, cexp.output, cexp.o, cccp.o, cccp, or cppmain. Link cppmain.o straight to cpp$(exeext). Add --no-headers to makeinfo command line when generating INSTALL. Install and uninstall cpp.1 manpage, not cccp.1. * install.texi: Delete all references to cexp.y/cexp.c. Delete ancient instructions for compiling GCC on 3b1. * INSTALL: Regenerate. * cppfiles.c, cpplib.h, jump.c, protoize.c, c-lex.c, ch/decl.c, ch/lex.c, cp/lex.c, f/lex.c, mips/t-ecoff, mips/t-elf, mips/t-r3900: Remove references to cccp.c. * convex.h, fx80.h, m68k.h, pdp11.h, contrib/gcc_update, f/g77install.texi: Remove references to cexp.c/cexp.y. * xm-linux.h, xm-os2.h, romp.h: Remove definition of BSTRING, which is no longer tested anywhere. * po/POTFILES.in: Remove cccp.c and cexp.c. Comment out alpha/vms-tramp.asm. From-SVN: r33238
2000-04-16Makefile.in ($(srcdir)/c-parse.y: c-parse.in): Enclose the whole message in ↵Dave Pitts1-1/+1
quotes. * Makefile.in ($(srcdir)/c-parse.y: c-parse.in): Enclose the whole message in quotes. Otherwise, IBM's make program treats the '#' as the start of a comment and ignores the remainder of the line. * c-lex.c (yylex): Change for EBCDIC, lower case characters preceed upper case. * cccp.c (initialize_char_syntax): Allow for holes in EBCDIC. * cexp.y (initialize_random_junk): Likewise. * cppfiles.c (find_include_file): Cast alloca return value. * cppinit.c (initialize_standard_includes): Likewise. * cpplib.c (cpp_define, cpp_undef): Likewise. * defaults.h (ASM_OUTPUT_ASCII): Use ISPRINT. * final.c (output_asm_insn): Allow for holes in EBCDIC. * fold-const.c (CHARMASK): New. (real_hex_to_f): Use it. * real.c (CHARMASK): New. (etoasc, asctoeg): Use it. (asctoeg): EBCDIC lower case characters preceed upper case. From-SVN: r33192
2000-03-14c-lex.h (enum rid): Add RID_BOUNDED & RID_UNBOUNDED.Greg McGary1-0/+2
* c-lex.h (enum rid): Add RID_BOUNDED & RID_UNBOUNDED. * c-lex.c (init_lex): Handle RID_BOUNDED & RID_UNBOUNDED. * c-parse.gperf (__bounded, __bounded__, __ptrbase, __ptrbase__, __ptrextent, __ptrextent__, __ptrvalue, __ptrvalue__, __unbounded, __unbounded__): New keywords. * c-parse.in (PTR_VALUE PTR_BASE PTR_EXTENT): New tokens. From-SVN: r32540
2000-03-07tree.h (INT_CST_LT, [...]): Remove unneeded casts.Richard Kenner1-0/+1
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts. (struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT. (attribute_hash_list, type_hash_canon): hashcode is now unsigned. (type_hash_lookup, type_hash_add, type_hash_list): Likewise. (min_precision): Result is unsignd. (add_double, neg_double, mul_double): Low word is unsigned. (lshift_double, rshift_double, lrotate_double): Likewise. (rrotate_double, div_and_round_double): Likewise. (tree_floor_log2, compare_tree_int): New functions. (preserve_rtl_expr_temps): New declaration. * c-common.c (declare_hidden_char_array): Use compare_tree_int. (decl_attributes): Use tree_log2 to find alignment. Check for TREE_INT_CST_HIGH for format args. (min_precision): Now unsigned. Use tree_floor_log2. (truthvalue_conversion): Delete long-disabled code. * c-decl.c (finish_struct): Clean up tests on field width. (finish_function): Use compare_tree_int. * c-pragma.c (handle_pragma_token): Use tree_log2 for alignment. * c-typeck.c (comptypes): Use tree_int_cst_equal. (default_conversion, digest_init): Use compare_tree_int. (build_binary_op): Use integer_all_onesp and compare_tree_int. Fix type errors in forming masks. * calls.c (initialize_argument_information): Use compare_tree_int. * dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. * except.c (expand_eh_region_start_tree): Use compare_tree_int. * expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop. (store_field): Use compare_tree_int. (expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT. (expand_expr, case ARRAY_REF): Use compare_tree_int. (do_jump, case BIT_AND_EXPR): Use tree_floor_log2. (do_store_flag): Use compare_tree_int. * fold-const.c (encode, decode): Low part is always unsigned. (force_fit_type, add_double, neg_double, mul_double): Likewise. (lshift_double, rshift_double, lrotate_double): Likewise. (rrotate_double, div_and_round_double, int_const_binop): Likewise. (fold_convert): Use compare_tree_int. (operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal. (invert_truthvalue, case INTEGER_CST): Likewise. (fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW. * mkdeps.c (deps_dummy_targets): Make I unsigned. * rtl.h (add_double, neg_double, mul_double): Low words are unsigned. (lshift_double, rshift_double, lrotate_double, rrotate_double): Likewise. * stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree. (expand_end_case): Use compare_tree_int. (estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. * stor-layout.c (mode_for_size_tree): Use compare_tree_int. (layout_decl): Likewise. (layout_record, layout_union): Make sizes unsigned. (layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype. (layout_type, case QUAL_UNION_TYPE): Use compare_tree_int. * tree.c (struct type_hash): hashcode is unsigned. (build_type_attribute_variant, type_hash_list): Likewise. (type_hash_lookup, type_hash_add, type_hash_canon): Likewise. (attribute_hash_list, build_array_type, build_method_type): Likewise. (build_complex_type): Likewise. (real_value_from_int_cst): Remove unneeded casts. (integer_all_onesp): Add casts. (tree_floor_log2, compare_tree_int): New functions. (build_index_type): Use tree_int_cst_sgn. * varasm.c (assemble_variable): Use compare_tree_int. * ch/actions.c (chill_convert_for_assignment): INDEX is unsigned HOST_WIDE_INT. * ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH since unsigned. * ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned. Use compare_tree_int. (expand_goto_except_cleanup): Likewise. * cp/class.c (dfs_modify_vtables): I is now unsigned. (check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int. (build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT. * cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned. * cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. * cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned. * cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR): Call integer_all_onesp. * cp/typeck2.c (process_init_constructor): Use compare_tree_int. * f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int. (ffecom_sym_transform_, ffecom_transform_common_): Likewise. (ffecom_transform_equiv_): Likewise. * java/decl.c (emit_init_test_initialization): Mark KEY as unused. * java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. (build_anewarray): Likewise. * java/parse.y (patch_newarray): Likewise. * java/parse.c: Regenerated. From-SVN: r32383
2000-02-27* c-lex.c (putback_buffer): Make 'buffer' an unsigned char *.Zack Weinberg1-1/+1
From-SVN: r32222
2000-02-25Copyright fixes.Jeff Law1-1/+2
From-SVN: r32171
2000-02-16* c-lex.c (readescape): Warn about 'x', but do not reject it.Alexandre Oliva1-1/+4
From-SVN: r32005
2000-01-29Adjust variable names, comments, help strings to c99.Ulrich Drepper1-1/+1
From-SVN: r31689
2000-01-25c-common.c, [...]: Remove all references to obstack functions obsoleted by GC...Zack Weinberg1-8/+1
* c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c, c-typeck.c, objc/objc-act.c: Remove all references to obstack functions obsoleted by GC, such as push_obstacks_nochange, end_temporary_allocation, savealloc, saveable_tree_cons, etc. and code which existed only to decide whether or not to call them. Remove now-unused NESTED argument from start_function; all callers changed. Do not change behavior based on ggc_p. The use of the ixp_obstack in c-iterate.c and the util_obstack in objc/objc-act.c remain; these are not obsoleted by garbage collection. * c-tree.h: Update prototype for start_function. * c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild. From-SVN: r31611
2000-01-12c-common.c: PROTO -> PARAMS.Kaveh R. Ghazi1-13/+13
* c-common.c: PROTO -> PARAMS. * c-common.h: Likewise. * c-decl.c: Likewise. * c-iterate.c: Likewise. * c-lang.c: Likewise. * c-lex.c: Likewise. * c-lex.h: Likewise. * c-parse.in: Likewise. * c-pragma.c: Likewise. * c-pragma.h: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * objc/objc-act.c: Likewise. * objc/objc-act.h: Likewise. From-SVN: r31362
2000-01-11Update copyrights for last checkin.Kaveh Ghazi1-1/+1
From-SVN: r31309
2000-01-10Makefile.in (optabs.o): Depend on real.hKaveh R. Ghazi1-0/+1
* Makefile.in (optabs.o): Depend on real.h (resource.o): Depend on insn-attr.h * builtins.c (result_vector): Wrap prototype in macro conditions governing definition and use. * c-common.c: Include tm_p.h. * c-lex.c: Likewise. * elfos.h: Constify a char*. * final.c (align_fuzz): Wrap prototype in macro HAVE_ATTR_length. (get_attr_length, shorten_branches, profile_after_prologue): Mark parameter with ATTRIBUTE_UNUSED. * fold-const.c (exact_real_inverse): Wrap variable `i' in CHECK_FLOAT_VALUE. * haifa-sched.c (schedule_insns): Mark parameter with ATTRIBUTE_UNUSED. * optabs.c: Include real.h. * real.h (ereal_atof): Add prototype arguments. * resource.c: Include insn-attr.h. * sdbout.c (sdbout_queue_anonymous_type, sdbout_dequeue_anonymous_types): Wrap in macro SDB_ALLOW_FORWARD_REFERENCES. (sdbout_init, sdbout_start_new_source_file): Mark parameter with ATTRIBUTE_UNUSED. * stmt.c (expand_return): Wrap variable `op0' in macro HAVE_return. * stupid.c: Include tm_p.h. * tree.c (real_value_from_int_cst): Mark parameter with ATTRIBUTE_UNUSED. cp: * lex.c: Include tm_p.h. ch: * lex.c: Include tm_p.h. From-SVN: r31308
1999-12-02Pass pragma_getc and pragma_ungetc to HANDLE_PRAGMA.Nick Clifton1-2/+2
From-SVN: r30756
1999-11-30c-lex.c (yylex): With -Wtraditional...Kaveh R. Ghazi1-1/+5
* c-lex.c (yylex): With -Wtraditional, when the ANSI type of an integer constant does not match the traditional type, limit the warnings to cases where the base of the type is ten. * invoke.texi (-Wtraditional): Document it. From-SVN: r30730
1999-10-30* c-lex.c (yylex): Accept 'f' in mantissa of hex float constant.Stephen L Moshier1-1/+3
From-SVN: r30284
1999-10-03alias.c (nonlocal_reference_p): Add static prototype.Kaveh R. Ghazi1-2/+12
* alias.c (nonlocal_reference_p): Add static prototype. * bitmap.c (bitmap_element_allocate): Prototype args in function pointer cast. * builtins.c (stabilize_va_list): Add static prototype. (expand_builtin_va_arg): Constify a char*. * c-lex.c (getch, put_back, extend_token_buffer_to, read_line_number, token_getch, token_put_back): Add static prototypes. * c-parse.gperf (hash, is_reserved_word): Likewise. * cccp.c (is_dir_separator): Likewise. From-SVN: r29782
1999-09-23toplev.c (documented_lang_options): Add -fshort-wchar.Jason Merrill1-7/+2
* toplev.c (documented_lang_options): Add -fshort-wchar. * c-decl.c (c_decode_option): Likewise. (init_decl_processing): If -fshort-wchar, use 'short unsigned int' for wchar_t. * c-common.c, c-lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. * gcc.c (default_compilers): If -fshort-wchar, override __WCHAR_TYPE__. * tm.texi (C Dialect Options): Add -fshort-wchar. From-SVN: r29638
1999-09-18c-pragma.c (mark_align_stack): New.Richard Henderson1-0/+1
* c-pragma.c (mark_align_stack): New. (init_pragma): New. * c-pragma.h (init_pragma): Declare it. * c-lex.c (init_parse): Call it. From-SVN: r29502
1999-09-15* c-lex.c (yylex): Initialize warn.Richard Henderson1-1/+1
From-SVN: r29447
1999-09-14c-lex.c (handle_generic_pragma): Remove unused variable `c'.Kaveh R. Ghazi1-2/+0
* c-lex.c (handle_generic_pragma): Remove unused variable `c'. * unroll.c (find_common_reg_term, subtract_reg_term, loop_find_equiv_value): Add static prototypes. (unroll_loop): Wrap variable `prev' in macro HAVE_cc0. (copy_loop_body): Remove unreachable break statement. * sparc.c (sparc_va_arg): Remove unused variable `tmp'. * sparc.h (sparc_va_start, sparc_va_arg): Add extern prototypes. From-SVN: r29409
1999-09-07Linas Vepstas <linas@linas.org>Linas Vepstas1-2/+2
* c-common.c: Use ISGRAPH, ISLOWER, toupper. * c-lex.c, cccp.c, cexp.c, cexp.y, cppexp.c, dwarf2out.c, genattr.c, genattrtab.c, genemit.c, genextract.c, genpeep.c, tree.c: Likewise. * system.h (IN_CTYPE_DOMAIN): Define to 1 if HOST_EBCDIC. * defaults.h (TARGET_ESC): Add default. From-SVN: r29192
1999-09-06Merge in gcc2-ss-010999Jeff Law1-6/+8
From-SVN: r29150
1999-09-06Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o.Bernd Schmidt1-1/+2
* Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o. (c-parse.o, c-decl.o, c-lang.o, c-lex.o, c-common.o, $(out_object_file)): Depend on ggc.h. * c-common.c: Include "ggc.h". (combine_strings): If doing GC, use ggc_alloc_string. * c-decl.c: Include "ggc.h". (ggc_p): Define with value 0. (mark_binding_level): New function. (init_decl_processing): Add GC roots. (mark_c_function_context): New function. (lang_mark_false_label_stack): New function. (lang_mark_tree): New function. (lang_cleanup_tree): New function. * c-lang.c: Include "ggc.h". (lang_init): Call c_parse_init. * c-lex.c: Include "ggc.h". (check_linenum): If doing GC, don't copy filenames to permanent obstack. * c-parse.in: Include "ggc.h". (c_parse_init): New function. * c-tree.h (c_parse_init, mark_c_function_context): Declare. * objc/Make-lang.in (objc-parse.o): Depend on ggc.h. * except.c (mark_eh_state): Mark more state. * function.c (mark_function_state): Likewise. * ggc-simple.c (ggc_alloc_rtvec): Bring in sync with non-gc version. (ggc_alloc_string) [GGC_DUMP]: Fix typo. * toplev.c (mark_file_stack): New function. (compile_file): If doing GC, use ggc_alloc_string on input filename. (main): Add root for input_file_stack. * i386.c: Include "ggc.h". (ix86_mark_machine_status): New function. (override_options): Set mark_machine_status. From-SVN: r29143
1999-08-06* c-lex.c (yylex): We can have a number with no digits.Jason Merrill1-1/+2
From-SVN: r28561
1999-08-04c-lex.c: Sync with C++ frontend.Jason Merrill1-433/+456
* c-lex.c: Sync with C++ frontend. (linemode): New variable. (parse_float): imag, conversion_errno, and type are output only. (yylex): Adjust. Move initial '.' case into main switch. Use linemode. (handle_generic_pragma): Just deal with tokens. (readescape): Use ISXDIGIT and ISGRAPH. * c-parse.in: Add END_OF_LINE token. * c-lex.c (lang_init): Generalize. (nextchar): Remove. Replace uses with UNGETC. (skip_white_space): Handle linemode here. Optimize for cpplib. (skip_white_space_on_line): Remove. (extend_token_buffer_to): New fn. (extend_token_buffer): Use it. (read_line_number, check_newline): Just deal with tokens. (token_getch, token_put_back): New fns. (yylex): Use them. More cpplib optimizations. Simplify. * c-lex.c (init_parse): Set cpp_token to CPP_DIRECTIVE. (consume_string): Make this smart about USE_CPPLIB. (check_newline): Rewrite to be intelligent about USE_CPPLIB. (yylex): Rewrite to be intelligent about USE_CPPLIB. Also, clean up cases where we redundantly set token_buffer[0]. (read_line_number): New fn. (ignore_escape_flag): New variable. From-SVN: r28507