aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
AgeCommit message (Collapse)AuthorFilesLines
2001-12-02vms.h (VMS_DEBUGGING_INFO): New macro.Douglas B Rupp1-1/+2
* config/alpha/vms.h (VMS_DEBUGGING_INFO): New macro. (PREFERRED_DEBUGGING_TYPE): Define as VMS_AND_DWARF2_DEBUG. (ASM_SPEC): Don't redefine. (OPTIMIZATION_OPTIONS, OVERRIDE_OPTIONS, LINK_SPEC): Define. * config/alpha/t-vms (EXTRA_PARTS): Use; add rule for vms-dwarf2.asm. * config/alpha/vms-dwarf2.asm: New file. * Makefile.in (OBJS): Add vmsdbgout.c and its rule. * c-lex.c (init_c_lex): Test for VMS_AND_DWARF2_DEBUG. * debug.h (gcc_debug_hooks): Add vmsdbg_debug_hooks. (vmsdbgout_after_prologue): New declaration. * defaults.h (VMS_DEBUGGING_INFO): Add to PREFERRED_DEBUGGING_TYPE. * dwarf2.h (dwarf_attribute): New DW_AT_VMS_rtnbeg_pd_address. * dwarf2out.c (dwarf2out_do_frame): Test for VMS_AND_DWARF2_DEBUG. (dwarf2out_frame_finish): Test for VMS_AND_DWARF2_DEBUG. (dwarf_attr_name): Use DW_AT_VMS_rtnbeg_pd_address. (add_name_and_src_coords_attributes): Test VMS_DEBUGGING_INFO * final.c (final_start_function): Test for VMS_AND_DWARF2_DEBUG. Test VMS_DEBUGGING_INFO. (final_end_function): Test for VMS_AND_DWARF2_DEBUG. (final_scan_insn): Test for VMS_AND_DWARF2_DEBUG and VMS_DEBUG. * flags.h (debug_info_type): Add VMS_DEBUG and VMS_AND_DWARF2_DEBUG. * toplev.c (compile_file): Test VMS_DEBUGGING_INFO, VMS_DEBUG, and VMS_AND_DWARF2_DEBUG. (rest_of_type_compilation): Test for VMS_AND_DWARF2_DEBUG. (decode_g_option): Add "vms" to debug_type_names. (process_options): Set vmsdbg_debug_hooks if -gvms. (lang_independent_init): Emit line number for VMS unless -g0. * tree.c: (build_complex_type): Test for VMS_AND_DWARF2_DEBUG. * vmsdbg.h, vmsdbgout.c: New files. From-SVN: r47532
2001-12-02c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.Neil Booth1-1/+1
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-01c-decl.c (duplicate_decls, [...]): Remove trailing period from diagnostics.Neil Booth1-1/+1
* c-decl.c (duplicate_decls, parmlist_tags_warning): Remove trailing period from diagnostics. * c-lex.c (cb_file_change): Similarly. * cppmacro.c (check_trad_stringification): Similarly. * gcc.c (do_spec_1): Similarly. * genattr.c (main): Similarly. * genattrtab.c (main, operate_exp, make_length_attrs): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * mips-tfile.c (add_file, error): Similarly. * profile.c (init_branch_prob): Similarly. * reload1.c (spill_failure): Similarly. * stmt.c (parse_output_constraint): Similarly. * varasm.c (assemble_variable): Similarly. cp: * class.c (finish_struct): Similarly. * decl.c (check_tag_decl): Similarly. * lex.c (cxx_set_yydebug): Similarly. * typeck2.c (friendly_abort): Similarly. java: * expr.c (expand_byte_code): Similarly. * jcf-parse.c (load_class, jcf_parse): Similarly. * jcf-write.c (generate_classfile): Similarly. * lex.c (java_lex): Similarly. From-SVN: r47517
2001-11-29* c-lex.c (init_c_lex): Canonicalize "-" filename to "".Jakub Jelinek1-1/+1
From-SVN: r47461
2001-11-15c-common.c: Include c-lex.h.Neil Booth1-13/+6
* c-common.c: Include c-lex.h. (c_common_lang_init): Change prototype. Call init_c_lex and init_pragma from here. * c-common.h (c_common_lang_init): Change prototype. * c-decl.c (init_decl_processing): Rename. Call c_parse_init. * c-lang.c (c_init): Change prototype. Update. (c_init_options): Update. * c-lex.c (cpp_filename): Remove. (init_c_lex): Update. Read the main file, and get the original file name. (yyparse): Finish the command line options. * c-parse.in (c_parse_init): Call init_reswords here. (init_parse): Remove. * c-tree.h (c_init_decl_processing): New. * cpphash.c (_cpp_init_hashtable): After initializing the hash table, populate it. * cppinit.c (read_original_filename, cpp_finish_options): New. (cpp_create_reader): New prototype. Defer hash table initialization. (cpp_start_read): Rename cpp_read_main_file. Initialize the hash table. Get the original filename. * cpplib.h (cpp_create_reader): Update. (cpp_start_read): Remove. (cpp_read_main_file, cpp_finish_options): New. * cppmain.c (main, do_preprocessing): Update. * langhooks.h (struct langhooks): Update init prototype. * toplev.c (general_init, parse_options_and_default_flags, process_options, lang_indpendent_init, lang_dependent_init, init_asm_output): New; perform the bulk of initialization. (compile_file): Move most of initialization to above functions. (debug_hooks): Initialize statically. (set_Wunused): Relocate. (toplev_main): Move most of initialization to other init functions. Have a clear logic flow. * tree.h (init_parse, init_decl_processing): Remove. ada: * misc.c (gnat_init): Change prototype. Include the functionality of the old init_parse and init_decl_processing. (gnat_init_decl_processing): New prototype. (init_parse): Remove. * utils.c (init_decl_processing): Rename gnat_init_decl_processing. cp: * cp-tree.h (init_reswords, cxx_init_decl_processing): New. (cxx_init): Update prototype. * decl.c (init_decl_processing): Rename. Move null node init to its creation time. * lex.c (cxx_init_options): Update. (cxx_init): Combine with old init_parse; also call cxx_init_decl_processing. f: * com.c (ffecom_init_decl_processing): Renamed from init_decl_processing. (init_parse): Move contents to ffe_init. (ffe_init): Update prototype. java: * decl.c (init_decl_processing): Rename java_init_decl_processing. * java-tree.h: New prototype. * lang.c (java_init): Update prototype. Combine with old init_parse. objc: * objc-act.c (objc_init): Update prototype, combine with old init_parse. (objc_init_options): Update. From-SVN: r47046
2001-10-30Localization fixes.Paolo Bonzini1-4/+4
2001-10-30 Paolo Bonzini <bonzini@gnu.org> Localization fixes. * c-decl.c (parmlist_tags_warning, start_struct, check_for_loop_decls): Separate messages for struct, union and enum cases to allow for languages in which they have different genders. * c-format.c (scanf_flag_specs): Separate short and long name of the assignment suppression feature. (check_format_types): Localize "pointer" and "different types" strings. * c-lex.c (lex_number): Localize "an unsigned long int" and related strings. (lex_string) [MULTIBYTE_CHARS]: Use initial lowercase letter on warning message. * c-typeck.c (build_unary_up): Separate messages for increment and decrement cases to allow for languages in which they use different articles. Localize the strings "increment" and "decrement" in one case. From-SVN: r46635
2001-10-07builtins.c (expand_builtin_setjmp_receiver): Const-ify.Kaveh R. Ghazi1-4/+4
* builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-09-24c-lex.c (cb_def_pragma): Update.Neil Booth1-21/+21
* c-lex.c (cb_def_pragma): Update. (c_lex): Update, and skip padding. * cppexp.c (lex, parse_defined): Update, remove unused variable. * cpphash.h (struct toklist): Delete. (union utoken): New. (struct cpp_context): Update. (struct cpp_reader): New members eof, avoid_paste. (_cpp_temp_token): New. * cppinit.c (cpp_create_reader): Update. * cpplex.c (_cpp_temp_token): New. (_cpp_lex_direct): Add PREV_WHITE when parsing args. (cpp_output_token): Don't print leading whitespace. (cpp_output_line): Update. * cpplib.c (glue_header_name, parse_include, get__Pragma_string, do_include_common, do_line, do_ident, do_pragma, do_pragma_dependency, _cpp_do__Pragma, parse_answer, parse_assertion): Update. (get_token_no_padding): New. * cpplib.h (CPP_PADDING): New. (AVOID_LPASTE): Delete. (struct cpp_token): New union member source. (cpp_get_token): Update. * cppmacro.c (macro_arg): Convert to use pointers to const tokens. (builtin_macro, paste_all_tokens, paste_tokens, funlike_invocation_p, replace_args, quote_string, stringify_arg, parse_arg, next_context, enter_macro_context, expand_arg, _cpp_pop_context, cpp_scan_nooutput, _cpp_backup_tokens, _cpp_create_definition): Update. (push_arg_context): Delete. (padding_token, push_token_context, push_ptoken_context): New. (make_string_token, make_number_token): Update, rename. (cpp_get_token): Update to handle tokens as pointers to const, and insert padding appropriately. * cppmain.c (struct printer): New member prev. (check_multiline_token): Constify. (do_preprocessing, cb_line_change): Update. (scan_translation_unit): Update to handle spacing. * scan-decls.c (get_a_token): New. (skip_to_closing_brace, scan_decls): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi: Update. * gcc.dg/cpp/macro10.c: New test. * gcc.dg/cpp/strify3.c: New test. * gcc.dg/cpp/spacing1.c: Add tests. * gcc.dg/cpp/19990703-1.c: Remove bogus test. * gcc.dg/cpp/20000625-2.c: Fudge to pass. From-SVN: r45793
2001-09-14cpperror.c (print_location): Take line and column, for default positioning ↵Neil Booth1-1/+17
use the previously lexed token. * cpperror.c (print_location): Take line and column, for default positioning use the previously lexed token. (_cpp_begin_message): Take line and column. (cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning, cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update. * cpphash.h (_cpp_begin_message): Update prototype. * cppinit.c (push_include): Don't set output line. * cpplex.c (_cpp_lex_token): Callback for start of new output lines. * cpplib.c (do_diagnostic, _cpp_pop_buffer): Update. (do_pragma): Kludge for front ends. Don't expand macros at all. * cpplib.h (cpp_lookahead, cpp_token_with_pos, cpp_get_line): Remove. (struct cpp_token): Remove output_line. (struct cpp_callbacks): New member line_change. * cppmacro.c (builtin_macro, paste_all_tokens, replace_args, cpp_get_token): Preserve BOL flag. (cpp_get_line): Remove. (_cpp_backup_tokens): Remove useless abort(). * cppmain.c (cb_line_change): New. (scan_translation_unit): Don't worry about starting new lines here. * scan-decls.c (scan_decls): Update. * c-lex.c (c_lex, init_c_lex): Update. (cb_line_change, src_lineno): New. From-SVN: r45613
2001-08-22Makefile.in, [...]: replace "GNU CC" with "GCC".Lars Brinkhoff1-12/+12
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-11c-lex.c (map): Make const.Neil Booth1-40/+35
* c-lex.c (map): Make const. (cb_file_change): Update for callback passing a line map. Don't assume we have a previous map. Remove sanity check about popping too many files. * cpperror.c (print_location): Make map const. * cppfiles.c (stack_include_file): Update; line maps now hold sysp. (cpp_make_system_header): Similarly. (search_from): Similarly. (_cpp_execute_include): Don't remember where we came from. * cpphash.h (struct cpp_buffer): Remove return_to_line, sysp. (struct cpp_reader): Make map const. (CPP_IN_SYSTEM_HEADER, _cpp_do_file_change): Update. * cpplib.c (do_line): Update; line maps now hold sysp. (cpp_push_buffer): Similarly. (_cpp_do_file_change): Similarly; callback with map instead. (cpp_get_line_maps): Constify return value. (_cpp_pop_buffer): Update. * cpplib.h (struct cpp_file_change): Remove. (struct cpp_callbacks): Update. (cpp_get_line_maps): Constify return value. * cppmacro.c (_cpp_create_definition): Update. * cppmain.c (struct printer): Constify map. (maybe_print_line): Similarly. (print_line): Similarly. Deduce flags 1 and 2 here. (cb_file_change): Update. * line-map.c (free_line_maps): Warn regardless. (add_line_map): Return pointer to const. When passed NULL to_file with LC_LEAVE, use the obvious values for the return point so the caller doesn't have to figure them out. (lookup_line): Return pointer to const. (print_containing_files): Take pointer to const. * line-map.h (struct line_map): New members reason, sysp. (add_line_map): Return pointer to const. (lookup_line): Similarly. (print_containing_files): Take pointer to const. From-SVN: r44789
2001-08-05re PR preprocessor/3081 (Preprocessor merges 2 first lines when -imacros is ↵Neil Booth1-10/+14
being used) PR preprocessor/3081 * c-lex.c (map): New. (cb_file_change): Update map and use it. (cb_def_pragma, cb_define, cb_undef): Use map and line. (c_lex): Update to use map. * cpperror.c (print_location): Move to using logical line numbers. * cppfiles.c (stack_include_file): Update for new _cpp_do_file_change. (cpp_make_system_header): Similarly. (_cpp_execute_include): Stop line numbering hacks. Store the line we will return to. * cpphash.h (CPP_BUF_LINE): Remove. (struct cpp_buffer): Remove lineno and pseudo_newlines. Add map and return_to_line. (_cpp_do_file_change): Update. * cppinit.c (cpp_start_read): Update line kludge. * cpplex.c (handle_newline): Don't update lineno and pseudo_newlines. (trigraph_ok): Use logical line numbers for diagnostics. (skip_block_comment): Likewise. (skip_whitespace): Likewise. (skip_line_comment): Use pfile->line instead. (_cpp_lex_token): Update to use logical line numbering exclusively. Handle BOL locally. Accept new lines in directives, but keep pfile->line decremented. Diagnostics use logical lines. Update directive handling. * cpplib.c (SEEN_EOL): New. (skip_rest_of_line, check_eol): Use it. (end_directive): Increase line number when accepting the newline at the end of a directive. (run_directive): Simplify. (do_line): Bad LC_LEAVEs become LC_RENAMEs. Update. (_cpp_do_file_change): Update to take buffer line number as an argument, and store the current map in the cpp_reader. Remove line number kludges. (_cpp_do__Pragma): Restore output position after a _Pragma. (cpp_push_buffer): Don't set output line or lineno. (_cpp_pop_buffer): Transfer more info from a faked buffer. Remove line kludge. Set output_line. * cppmacro.c (builtin_macro): Update handling of __LINE__. (parse_arg): Use logical lines. (save_lookahead_token): Save EOFs too now. * cppmain.c (struct printer): Fix comments. (printer_init): Simplify, let caller do errors. (scan_translation_unit, check_multiline_token, dump_macro): Update. (maybe_print_line): Simplify. (print_line): Don't print a linemarker if -P. (cb_define, cb_undef, cb_def_pragma, cb_ident, cb_include): Update. (cb_file_change): Simplify. * line-map.h (LAST_SOURCE_LINE): Fix. (CURRENT_LINE_MAP): New. * gcc.dg/cpp/19951025-1.c: Revert. * gcc.dg/cpp/directiv.c: We no longer process directives that interrupt macro arguments. From-SVN: r44650
2001-08-04cpphash.h (struct cpp_reader): New member directive_line.Neil Booth1-8/+15
* cpphash.h (struct cpp_reader): New member directive_line. * cpplib.h (struct cpp_callbacks): Update prototypes of callbacks. * cpplib.c (do_define, do_undef, do_ident, do_include_common, do_pragma): Pass line to callbacks. (start_directive): Record line of directive. * cppmain.c (cb_ident, cb_define, cb_undef, cb_def_pragma, cb_include): Similarly. * c-lex.c (cb_ident, cb_define, cb_undef, cb_def_pragma): Similarly. From-SVN: r44637
2001-08-02line-map.c: New.Neil Booth1-12/+14
* line-map.c: New. * line-map.h: New. * Makefile.in (line-map.o): New. (LIBCPP_OBJS, LIBCPP_DEPS): Update. * c-lex.c (cb_file_change): Update for new cpp_file_change structure. * cpperror.c (print_containing_files): Similarly. (print_location): Update. Don't output a space before _Pragma. * cppfiles.c (stack_include_file): Set to line 1 immediately. (stack_include_filee, cpp_make_system_header): Update. (_cpp_execute_include): Get logical line number right for calling as-yet-unterminated #include. * cpphash.h (struct cpp_reader): Add line_maps. (_cpp_do_file_change): Update. * cppinit.c (cpp_create_reader): Initialize line maps. (cpp_destroy): Destroy line maps. (cpp_start_read): Get logical line number right. * cpplex.c (parse_string): Only warn once for multi-line strings. Use boolean variable for null warning. * cpplib.c (_cpp_handle_directive): End the directive if it isn't already. (do_include_common): End the directive early. (do_line): Don't warn about out-of-range lines in preprocessed source. Update. Remove unused variables. (_cpp_do_file_change): Update for new line mapping. (pragma_cb): New typedef. (cpp_register_pragma): Stop looking ahead before calling the handler. Clean up. (do_pragma_system_header): End directive early. (cpp_get_line_maps): New. (cpp_pop_buffer): Fudge logical line. Update. * cpplib.h: Include line-map.h (enum cpp_fc_reason): Remove. (struct cpp_file_change): Update. (cpp_get_line_maps): New. * cppmain.c (struct_printer): New member map. (cb_file_change): Update for new mappings. * fix-header.c (cb_file_change): Similarly. testsuite: * gcc.dg/cpp/19951025-1.c: Update. From-SVN: r44584
2001-08-01alias.c: Fix comment formatting.Kazu Hirata1-6/+6
* alias.c: Fix comment formatting. * bitmap.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * c-common.c: Likewise. * c-decl.c: Likewise. * c-dump.c: Likewise. * c-lex.c: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * conflict.c: Likewise. * cppfiles.c: Likewise. * cppinit.c: Likewise. * cpplex.c: Likewise. * cpplib.c: Likewise. * cppmacro.c: Likewise. * cppspec.c: Likewise. * c-pragma.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * c-semantics.c: Likewise. * c-typeck.c: Likewise. From-SVN: r44547
2001-07-19c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.Neil Booth1-2/+0
* c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases. * c-parse.in (yyerror, _yylex): Similarly. * cppexp.c (parse_number, parse_defined, lex, _cpp_parse_expr): Don't use CPP_INT, CPP_FLOAT; CPP_NUMBER is enough. Update comments. * cpplib.h (CPP_INT, CPP_FLOAT): Remove. * cp/spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases. From-SVN: r44144
2001-07-11Makefile.in (c-lex.o): Wrap long lines.Neil Booth1-5/+8
* Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug hooks directly. * dbxout.c (dbx_debug_hooks): Add new hooks. (dbxout_start_new_source_file): Rename dbxout_start_source_file, make static. (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, make static. * dbxout.h (dbxout_start_new_source_file, dbxout_resume_previous_source_file): Delete. * debug.c (do_nothing_debug_hooks): Add new hooks. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * debug.h (gcc_debug_hooks): New hooks define, undef, start_source_file and end_source_file. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Make static. * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Remove. * dwarfout.c (dwarf_debug_hooks): Add new hooks. (dwarfout_start_source_file, dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Make static. (dwarfout_start_source_file_check, dwarfout_end_source_file_check): New. (dwarfout_define, dwarfout_finish): Update. * dwarfout.h (dwarfout_start_new_source_file, dwarfout_resume_previous_source_file, dwarfout_define, dwarfout_undef): Remove. * sdbout.c (sdb_debug_hooks): Add new hooks. (sdbout_start_new_source_file): Rename sdbout_start_source_file, make static. (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, make static, take an arg. * sdbout.h (sdbout_start_new_source_file, sdbout_resume_previous_source_file): Delete. * toplev.c (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * toplev.h (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * java/jcf-parse.c: Include debug.h. (parse_class_file): Update to use debug hooks directly. * java/Make-lang.in (jcf-parse.o): Depend on debug.h. From-SVN: r43952
2001-07-04c-lex.c (cb_file_change): Pass line number to debug_start_source_file.Daniel Berlin1-3/+3
2001-07-04 Daniel Berlin <dan@cgsoftware.com> * c-lex.c (cb_file_change): Pass line number to debug_start_source_file. (cb_undefine): Pass correct line number to debug_undef. * toplev.c (debug_start_source_file): Add line number to parameters. Pass it along to dwarf2out_start_source_file. (decode_g_option): Stop resetting debug level back to normal when we change debug formats, unless the current level is none. (Before, -g3 -gdwarf-2 would use debug level 2, rather than 3). * toplev.h (debug_start_source_file): Add line number to parameters. * dwarf2out.h (dwarf2out_start_source_file): Add line number to parameters. * dwarf2out.c (dwarf2out_start_source_file): Add line number to parameters. Output debug_macinfo data for starting file if requested. (dwarf2out_end_source_file): Output debug_macinfo data for ending file if requested. (dwarf2out_define): Output debug_macinfo data for defining a macro if requested. (dwarf2out_undef): Output debug_macinfo data for undefining a macro if requested. (DEBUG_MACINFO_SECTION): New. DWARF2 macro info section name. (DEBUG_MACINFO_SECTION_LABEL): New. DWARF2 macro info section label. (macinfo_section_label): New. DWARF2 macro info section label. (dwarf2out_init): If we want macro info, output the start label for the section. (dwarf2out_finish): If we want macro info, add a DW_AT_macro_info attribute to the compilation unit die pointing to the macro info. 2001-07-04 Daniel Berlin <dan@cgsoftware.com> * dwarf2out.c (new_loc_list): Move to inside #ifdef DWARF2_DEBUGGING_INFO. (add_loc_descr_to_loc_list): Ditto. (output_loc_list): Ditto. Also, fix thinko in curr not being initialized. (gen_internal_sym): Ditto. From-SVN: r43763
2001-05-23c-lex.c (read_escape, read_ucs): Delete.Neil Booth1-232/+9
* c-lex.c (read_escape, read_ucs): Delete. (lex_string): Use cpp_parse_escape. * cpplex.c (read_ucs): Rename maybe_read_ucs. Do nothing if not C++ or not C99. Warn if traditional. (parse_escape): Rename cpp_parse_escape. Make the bitmask unsigned. Warn for out-of-range escape sequences here. Update to use maybe_read_ucs. (cpp_interpret_charconst): Don't warn here. * cpplib.h (cpp_parse_escape): New exported function. From-SVN: r42509
2001-05-22c-lex.c (lex_number): If pedantic and not C99...Joseph Myers1-3/+4
* c-lex.c (lex_number): If pedantic and not C99, pedwarn exactly once for hexadecimal floats, whether or not they contain a decimal point. Don't let the setting of pedantic otherwise affect the parsing of hexadecimal floats. testsuite: * gcc.dg/c90-hexfloat-1.c: Add more tests. From-SVN: r42440
2001-05-22c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one.Neil Booth1-6/+1
* c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one. * stringpool.c: (IS_FE_IDENT, make_identifier): Delete. (maybe_get_identifier): Update. * tree.h (make_identifier): Delete. From-SVN: r42432
2001-05-20Makefile.in (OBJS, [...]): Update.Neil Booth1-1/+6
* Makefile.in (OBJS, LIBCPP_OBJS, LIBCPP_DEPS, cpplib.o, cpphash.o, fix-header): Update. (hashtable.o): New target. * c-common.h: Include cpplib.h. Define C_RID_CODE and struct c_common_identifier here. * c-lang.c (c_init_options): Update. Call set_identifier_size. * c-lex.c (c_lex): Update. * c-pragma.h: Update. * c-tree.h (struct lang_identifier): Contain c_common_identifier. Delete rid_code. (C_RID_CODE): Delete. * cpphash.c: Rewrite to use hashtable.c. * cpphash.h: Update include guards. (struct cpp_reader): Remove hashtab. hash_ob and buffer_ob are no longer pointers. Add hash_table and our_hashtable. (HASHSTEP, _cpp_init_hashtable, _cpp_lookup_with_hash): Delete. (_cpp_cleanup_hashtable): Rename _cpp_destroy_hashtable. (_cpp_cleanup_stacks): Rename _cpp_init_directives. * cppinit.c (cpp_create_reader): Update. * cpplex.c (cpp_ideq, parse_identifier, cpp_output_token): Update. (cpp_interpret_charconst): Eliminate warning. * cpplib.c (do_pragma, do_endif, push_conditional, cpp_push_buffer, cpp_pop_buffer): Update. (_cpp_init_stacks): Rename cpp_init_directives. (_cpp_cleanup_stacks): Remove. * cpplib.h: Update include guards. Include tree-core.h and c-rid.h. (cpp_hashnode, cpp_token, NODE_LEN, NODE_NAME, cpp_forall_identifiers, cpp_create_reader): Update. (C_RID_CODE, cpp_make_node): New. (c_common_identifier): New identifier node for C front ends. * cppmain.c (main): Update. * fix-header.c (read_scan_file): Update. * flags.h (id_clash_len): Make unsigned. * ggc.h (ggc_mark_nonnull_tree): New. * hashtable.c: New. * hashtable.h: New. * stringpool.c: Update comments and copyright. Update to use hashtable.c. * toplev.c (approx_sqrt): Move to hashtable.c. (id_clash_len): Make unsigned. * toplev.h (ident_hash): New. * tree.c (gcc_obstack_init): Move to hashtable.c. * tree.h: Include hashtable.h. (IDENTIFIER_POINTER, IDENTIFIER_LENGTH): Update. (GCC_IDENT_TO_HT_IDENT, HT_IDENT_TO_GCC_IDENT): New. (struct tree_identifier): Update. (make_identifier): New. cp: * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. (C_RID_CODE): Remove. * lex.c (cxx_init_options): Call set_identifier_size. Update. (init_parse): Don't do it here. objc: * objc-act.c (objc_init_options): Call set_identifier_size. Update. From-SVN: r42334
2001-05-16cppexp.c (lex): Use NODE_NAME and NODE_LEN.Neil Booth1-2/+2
* cppexp.c (lex): Use NODE_NAME and NODE_LEN. * cpphash.c (_cpp_lookup_with_hash): Similarly. * cpplex.c (cpp_ideq, parse_identifier, cpp_token_len, cpp_spell_token, cpp_output_token): Similarly. * cpplib.c (lex_macro_node, do_undef, do_pragma, do_pragma_poison, parse_assertion, do_assert): Similarly. * cppmacro.c (builtin_macro, parse_args, funlike_invocation_p, save_parameter, _cpp_create_definition, check_trad_stringification, cpp_macro_definition): Similarly. * cppmain.c (cb_define, cb_undef, dump_macro): Similarly. * c-lex.c (cb_undef, c_lex): Similarly. * fix-header.c (recognized_function): Similarly. * cpplib.h (NODE_LEN, NODE_NAME): New. (cpp_hashnode): Rename length len. From-SVN: r42174
2001-05-11c-lex.c (lex_charconst): Convert into a simple wrapper around ↵Neil Booth1-102/+24
cpp_interpret_charconst... * c-lex.c (lex_charconst): Convert into a simple wrapper around cpp_interpret_charconst, to which most of the code body is moved. * cppexp.c (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE, MAX_LONG_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_CHAR_TYPE_MASK, MAX_WCHAR_TYPE_MASK, parse_escape, parse_charconst): Remove. (lex): Use cpp_interpret_charconst. * cpplex.c (parse_escape, read_ucs, cpp_interpret_charconst, hex_digit_value): New functions. (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): New macros. * cpplib.h (cpp_interpret_charconst): New prototype. * Makefile.in: Update. From-SVN: r41978
2001-05-02c-lex.c: NULL_PTR -> NULL.Kaveh R. Ghazi1-2/+2
* c-lex.c: NULL_PTR -> NULL. * cse.c: Likewise. * emit-rtl.c: Likewise. * gcse.c: Likewise. * genpeep.c: Likewise. * jump.c: Likewise. * mips-tdump.c: Likewise. * reload1.c: Likewise. * rtlanal.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * toplev.c: Likewise. From-SVN: r41761
2001-04-26c-lex.c (c_lex): Remove # from %o diagnostic formatting.Nathan Sidwell1-1/+1
.: * c-lex.c (c_lex): Remove # from %o diagnostic formatting. testsuite: * g++.old-deja/g++.other/lex1.C: New test. From-SVN: r41588
2001-03-07c-parse.in (yylexname): New function, split out of _yylex.Zack Weinberg1-1/+0
* c-parse.in (yylexname): New function, split out of _yylex. (objc_rid_sans_at): New table. (init_reswords): Initialize it. (_yylex): Give labels clearer names. Handle CPP_ATSIGN by retrieving the next token and checking it for significance as an ObjC keyword or string constant. * cpplex.c (_cpp_lex_token): Just return CPP_ATSIGN for '@'. * cpplib.h (TTYPE_TABLE): Add CPP_ATSIGN, drop CPP_OSTRING. * c-lex.c, c-parse.in, cppmacro.c, cpplex.c, cp/spew.c: Remove references to CPP_OSTRING. From-SVN: r40279
2001-03-03cpp.texi: Update.Neil Booth1-3/+3
* cpp.texi: Update. * cppexp.c (parse_number): Update. * cpplex.c (parse_string): Pedwarn if multiline string does not result from a system header's macro. * cpplib.h (sys_objmacro_p): Rename sys_macro_p. * cppmacro.c (sys_objmacro_p): Rename sys_macro_p. Return true for function-like macros too. * c-lex.c (parse_number): Update. From-SVN: r40211
2001-02-21cppfiles.c: Update comments.Neil Booth1-6/+7
* cppfiles.c: Update comments. (_cpp_read_file): Don't check for NULL filenames any more. * cppinit.c (cpp_start_read): Don't do canonicalization of in_fname and out_fname. Use the passed file name exclusively. (_cpp_handle_options): Don't treat "-" as a command line option, but as a normal filename. (_cpp_post_options): Canonicalize in_fname and out_fname. * cppmain.c (printer_init): Don't check out_fname for NULL. * c-lex.c (orig_filename): Rename cpp_filename for clarity. (init_c_lex): Update, and use "" to represent stdin to CPP. (yyparse): Update. From-SVN: r39938
2001-02-14c-lex.c (lex_number): Only warn traditionally for U suffix outside system ↵Neil Booth1-3/+6
macros. * c-lex.c (lex_number): Only warn traditionally for U suffix outside system macros. * cppexp.c (parse_number): Similarly. * cpplib.h (NODE_SYSHDR, cpp_sys_objmacro_p): New. * cppmacro.c (struct cpp_macro): New member node. (parse_args): Only warn about missing rest args if not a system macro. (funlike_invocation_p): Similarly for uninvoked funlike macros. (cpp_sys_objmacro_p): New. (_cpp_create_definition): Store the node with the macro defn. Remember if the macro is defined in a system header. From-SVN: r39661
2001-01-23* c-lex.c (lex_charconst): Fix typo: s/p/str.Neil Booth1-1/+1
From-SVN: r39215
2001-01-19tweak commentsJason Merrill1-2/+3
From-SVN: r39134
2001-01-13c-lex.c (init_c_lex): Use cpp_get_callbacks to set callbacks.Neil Booth1-5/+8
* c-lex.c (init_c_lex): Use cpp_get_callbacks to set callbacks. * c-parse.in (finish_parse): Use cpp_errors. (__yylex): Use return value of cpp_pop_buffer. * cp/lex.c (finish_parse): Use cpp_errors. * cp/spew.c (read_token): Use return value of cpp_pop_buffer. From-SVN: r38982
2001-01-07c-lex.c (init_c_lex): Request #define / #undef callbacks for verbose ↵Neil Booth1-0/+28
DWARF[2] debugging. * c-lex.c (init_c_lex): Request #define / #undef callbacks for verbose DWARF[2] debugging. (cb_define, cb_undef): The new callbacks. * toplev.h (debug_define, debug_undef): Make const correct. * toplev.c (debug_define, debug_undef): Similarly. Do not perform the verbosity tests here anymore. From-SVN: r38756
2000-12-18c-lex.c (cb_file_change): Treat in_system_header as strictly boolean (0 or 1).Neil Booth1-2/+1
* c-lex.c (cb_file_change): Treat in_system_header as strictly boolean (0 or 1). From-SVN: r38361
2000-12-18c-lex.c: s/change_file/file_change.Neil Booth1-3/+3
* c-lex.c: s/change_file/file_change. * cpplib.h: Similarly. * cppmain.c: Similarly. * fix-header.c: Similarly. * cppfiles.c (stack_include_file): Pass the buffer location and size to cpp_push_buffer. Generate the file_change callback, so that sysp is already set. * cpphash.h: Add _cpp_do_file_change. * cpplib.c (do_line): Set buffer->sysp directly. Generate the file_change callback after setting sysp. (_cpp_do_file_change): Handle FC_ENTER and the FC_RENAME exception here. (cpp_push_buffer): Don't generate a callback. Clear sysp. (cpp_pop_buffer): Clean up logic. From-SVN: r38357
2000-12-18c-lex.c (lex_lineno): Remove.Neil Booth1-10/+6
* c-lex.c (lex_lineno): Remove. (init_c_lex, c_lex): Remove lex_lineno. (cb_change_file): Update lineno correctly, both before calling push_srcloc and before leaving the function. (cb_def_pragma): Set lineno before outputting diagnostics. From-SVN: r38342
2000-12-17c-lex.c: Move main_input_filename handling to FC_ENTER.Neil Booth1-8/+4
* c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up. * cpperror.c (print_containing_files): Get right line number. (print_location): Output column of 1 if 0. * cppfiles.c (stack_include_file): cpp_push_buffer handles the callback. * cpphash.h (_cpp_do_file_change): No longer external. * cpplib.c (do_file_change): Now local to cpplib.c. (do_line): Fake a buffer stack for preprocessed files. (cpp_push_buffer): Create a file_change callback. Handle faked buffers. (cpp_pop_buffer): Similarly. * cpplib.h: BUF_FAKE: New buffer type. * cppmain.c: Update to handle correct file renaming where a #line is the first line of the main file, and produce only the renamed file, not the original file, as output. From-SVN: r38319
2000-12-06c-lex.c (cb_indent): Decorate `str' argument, unused on HP-UX.Rodney Brown1-1/+1
* c-lex.c (cb_indent): Decorate `str' argument, unused on HP-UX. * collect2.c (scan_libraries): Remove unused `ch'. (COFF specific stuff): Prototype ldgetname. Declare and prototype ldbtread and ldclose. From-SVN: r38092
2000-11-28c-common.h: Remove flag_digraphs.Neil Booth1-3/+0
* c-common.h: Remove flag_digraphs. * c-decl.c: Remove flag_digraphs. (c_decode_option): Don't set it. * c-lex.c (init_c_lex): Don't do anything for digraphs. From-SVN: r37834
2000-11-28c-lex.h (parse_in): Change parse_in to a cpp_reader *.Neil Booth1-8/+8
* c-lex.h (parse_in): Change parse_in to a cpp_reader *. * c-decl.c (c_decode_option): Update to match. * c-lex.c (init_c_lex, yyparse): Update to match. * c-lang.c (lang_init_options): Use cpp_create_reader. * cppinit.c (cpp_init): Rename initialize. (cpp_reader_init): Rename cpp_create_reader. Create the reader. Initialize cpplib if appropriate. * cpplib.h (cpp_create_reader) New prototype. (cpp_init, cpp_reader_init): Delete prototypes. * cppmain.c (general_init, setup_callbacks): New functions. (main): Use them. * fix-header.c (scan_in): Change type to cpp_reader *. (read_scan_file): Update for new cpplib interface and scan_in type. * cp/decl.c (parse_in): Change to cpp_reader *. (lang_decode_option): Update. * cp/lex.c (lang_init_options): Use new cpplib interface. (init_cp_pragma, finish_parse, handle_pragma_implementation): Update. * cp/spew.c (read_token): Update. * objc/objc-act.c (lang_init_options): Update new cpplib interface. From-SVN: r37826
2000-11-27c-lex.c (cb_enter_file, [...]): Combine into the new function cb_change_file.Neil Booth1-305/+46
* c-lex.c (cb_enter_file, cb_leave_file, cb_rename_file): Combine into the new function cb_change_file. (init_c_lex): Update. * cppfiles.c (stack_include_file): Use _cpp_do_file_change. (cpp_syshdr_flags): Delete. * cpphash.h (_cpp_do_file_change): New prototype. Move struct cpp_buffer here from... * cpplib.h (struct cpp_buffer): ... here. (enum cpp_fc_reason, struct cpp_file_loc, struct_cpp_file_change, change_file): New. (enter_file, leave_file, rename_file, cpp_syshdr_flags): Delete. * cpplib.c (do_line): Update for new cb_change_file callback. (_cpp_do_file_change): New function. (_cpp_pop_buffer): Update to use it. * cppmain.c (move_printer): Delete. (main): Set up single callback cb_change_file. (cb_enter_file, cb_leave_file, cb_rename_file): Delete. (cb_change_file): New. * fix-header.c (cur_file, cb_change_file): New. (recognized_function, read_scan_file): Update. * scan-decls.c (scan_decls): Update. * scan.h (recognized_function): Update prototype. From-SVN: r37784
2000-11-26Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib.Neil Booth1-2/+0
* Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib. * c-decl.c: Remove parse_in declaration. * c-lang.c: Similarly. * c-lex.c: Similarly. * c-parse.in: Similarly. * c-pragma.c: Similarly. * configure.in: Similarly. * cp/Make-lang.in: Similarly. * cp/spew.c: Similarly. * cp/decl2.c: Remove check for lang-c++ option. * cp/lang-specs.h: Remove -lang-c++ from cc1plus command line. * cp/lex.c (lang_init_options): With cpp_reader_init, default to C++. * c-lex.h: Add declaration of parse_in. * cppinit.c: Call set_lang after allocating pfile->pending. * configure: Regenerate. From-SVN: r37754
2000-11-25c-common.c: Remove USE_CPPLIB conditional inclusions.Neil Booth1-605/+2
* c-common.c: Remove USE_CPPLIB conditional inclusions. * c-common.h: Similarly. * c-decl.c: Similarly. * c-lang.c: Similarly. * c-lex.c: Similarly. * c-parse.in: Similarly. * c-pragma.c: Similarly. * c-pragma.h: Similarly. * gcc.c: Similarly. * toplev.c: Similarly. * cp/cp-tree.h: Similarly. * cp/decl2.c: Similarly. * cp/lang-specs.h: Similarly. * cp/lex.c: Similarly. * cp/lex.h: Similarly. * cp/spew.c: Similarly. * java/lang-options.h: Similarly. * objc/lang-specs.h: Similarly. * objc/objc-act.c: Similarly. * configure.in: Remove configure option. * config.in: Regenerate. * configure: Regenerate. From-SVN: r37742
2000-11-20parse.y (yyparse_1): Rename the parser entry point.Richard Henderson1-3/+17
* cp/parse.y (yyparse_1): Rename the parser entry point. * c-lex.c (orig_filename): New variable. (init_c_lex): Set it. Move call to cpp_start_read ... (yyparse): ... here. New function. * c-parse.in (yyparse_1): Rename the parser entry point. * c-tree.h: Declare it. From-SVN: r37607
2000-11-17ggc.h: Delete ggc_add_string_root and ggc_mark_string.Zack Weinberg1-31/+3
* ggc.h: Delete ggc_add_string_root and ggc_mark_string. Add digit_vector and digit_string. * stringpool.c (digit_vector): New. (ggc_alloc_string): Use digit_string. * stmt.c (digit_strings): Delete. (init_stmt): Do not initialize digit_strings. (expand_asm_operands): Use ggc.h's digit_string macro. * toplev.c (mark_file_stack): Delete. (compile_file): Don't call init_tree_codes. (main): No need to make the file stack a GC root. * tree.c (init_tree_codes): Delete. * tree.h (init_tree_codes): Delete. * c-lex.c: Don't include ggc.h. (mark_splay_tree_node, mark_splay_tree): Delete. (init_c_lex): No need to ggc_strdup string constant. Don't add file_info_tree to GGC roots. (cb_enter_file, cb_rename_file): No need to ggc_strdup ip->nominal_fname. * Makefile.in (c-lex.o): No longer depends on $(GGC_H). * dbxout.c (dbxout_init), dwarf2out.c (dwarf2out_line), ggc-common.c (ggc_mark_rtx_children, ggc_mark_trees), varasm.c (mark_const_hash_entry, mark_pool_constant, init_varasm_once), xcoffout.c (xcoffout_source_file), i386.c (load_pic_register): Delete call(s) to ggc_add_string_root and/or ggc_mark_string. * except.c (create_rethrow_ref), profile.c (init_edge_profiler), toplev.c (compile_file), varasm.c (named_section, assemble_static_space, assemble_trampoline_template, output_constant_def, force_const_mem), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_emit_load_toc_table, create_TOC_reference, rs6000_emit_prologue, rs6000_emit_epilogue), rs6000.md (load_toc_aix_si, load_toc_aix_di): Change ggc_alloc_string (var, -1) to ggc_strdup (var). * profile.c (output_func_start_profiler), tree.c (make_node), i386.c (load_pic_register): No need to ggc_strdup string constant. cp: * lex.c (mark_impl_file_chain): Delete. (init_parse): Remove call to ggc_add_string_root. No need to ggc_strdup a string constant. Do not add impl_file_chain to GC roots. (handle_pragma_implementation): No need to ggc_strdup main_filename. f: * lex.c (ffelex_hash_): Change ggc_alloc_string (var, -1) to ggc_strdup (var). java: * parse.y (goal): Remove call to ggc_add_string_root. From-SVN: r37522
2000-11-17stringpool.c: New file.Zack Weinberg1-1/+1
* stringpool.c: New file. * ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete. (ggc_alloc_string): Now in stringpool.o. * ggc-page.c, ggc-simple.c: Do not define or allocate empty_string. * ggc.h: Delete prototype of ggc_add_string_root. #define ggc_add_string_root and ggc_mark_string to nothing. Prototype init_stringpool and stringpool_statistics. (ggc_alloc_string): Returns a const char *. * tree.c (hash_table, do_identifier_warnings): Delete. (init_obstacks): Don't initialize the identifier hash table. (get_identifier, maybe_get_identifier, start_identifier_warnings, set_identifier_size): Now in stringpool.c. * tree.h (struct tree_string): Constify pointer field. (approx_sqrt): Prototype. * Makefile.in (stringpool.o): Add rule, mention in OBJS. * toplev.c (approx_sqrt): New function. (compile_file): Call stringpool_statistics if mem_report is on. (main): Call init_stringpool. * builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c (process_directive), c-typeck.c (constructor_asmspec, struct initializer_stack, start_init), except.c (create_rethrow_ref), stmt.c (digit_strings), toplev.c (decode_f_option), tree.c (built_in_filename), varasm,c (in_named_name, assemble_static_space, struct constant_descriptor, struct deferred_string, struct pool_constant, force_const_mem), i386.c (pic_label_name, global_offset_table_name), rs6000.c (rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *. * c-common.c (combine_strings): Combine strings in scratch buffer, then pass to build_string. * optabs.c (init_libfuncs), profile.c (init_edge_profiler, output_func_start_profiler), stmt.c (init_stmt), alpha.c (alpha_need_linkage), arm.c (arm_encode_call_attribute), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_encode_section_info): Create string in scratch buffer, then pass to ggc_alloc_string. * stmt.c (expand_asm_operands): If we must adjust the constraint strings, do so by creating a new one, not by modifying the old one in place. Constify some char *s. * config/pa/pa.c (hppa_encode_label): Drop unnecessary second argument. Create string in scratch buffer, then pass to ggc_alloc_string. * config/pa/pa-protos.h: Update prototype. * config/pa/elf.h, config/pa/pa.h, config/pa/som.h: hppa_encode_label takes only one argument. * c-parse.in (if_prefix): Find the filename and line number at $-2 and $-1 respectively. * diagnostic.c (error_recursion): Add missing newline, use fputs, translate string. cp: * lex.c (struct impl_files, internal_filename): Constify a char *. java: * jcf-parse.c (get_constant), parse.y (do_merge_string_cste): Create string in scratch buffer, then pass to build_string. From-SVN: r37514
2000-11-13c-lex.c (cb_leave_file): Harmonize conditions and order of statements to ↵Hans-Peter Nilsson1-20/+24
those of process_directive for... * c-lex.c (cb_leave_file): Harmonize conditions and order of statements to those of process_directive for (action == act_pop). * collect2.c (main): Pass on -B options from COLLECT_GCC_OPTIONS. * local-alloc.c (equiv_init_movable_p): References to CC0 are not movable. From-SVN: r37438
2000-11-11Remove CPP_PLACEMARKERsNeil Booth1-1/+0
* cppexp.c (lex): Don't handle CPP_PLACEMARKER. * cpplex.c (_cpp_lex_token): Rename skip_newlines to next_bol * cpplib.c (skip_rest_of_line, check_eol, cpp_push_buffer): Similarly. * cpplib.h: Remove CPP_PLACEMARKER. (struct lexer_state): Rename skip_newlines to next_bol. * cppmacro.c (stringify_arg): Don't handle CPP_PLACEMARKER. Simplify prev_white handling as a result. (paste_all_tokens): Don't worry about CPP_PLACEMARKERs. (parse_arg): Empty arguments are now empty, not CPP_PLACEMARKERs. (parse_args): Similarly. Update argument count tests. (enter_macro_context): Return 2 to indicate an empty macro. (replace_args): Don't bother pre-expanding an empty argument. Handle placemarkers and ## extension during pre-expansion. (cpp_get_token): Handle empty macro expansions. Don't worry about CPP_PLACEMARKERs. (_cpp_create_definition): Empty macros are now empty. (cpp_macro_defintion): Don't special case empty macros. * scan-decls.c: Don't bother with CPP_PLACEMARKERs. * c-lex.c: Similarly. From-SVN: r37385
2000-11-09* c-lex.c [! NO_IMPLICIT_EXTERN_C] (cb_enter_file): CheckHans-Peter Nilsson1-1/+1
in_system_header and flags[1] before dereferencing flags[2]. From-SVN: r37361