aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
AgeCommit message (Collapse)AuthorFilesLines
2001-06-26toplev.c (decode_f_option): Adjust setting.Gabriel Dos Reis1-2/+2
* toplev.c (decode_f_option): Adjust setting. (toplev_main): Call diagnostic_initialize. Remove call to reshape_diagnostic_buffer._ * diagnostic.h (struct output_buffer): Add new field format_decoder. (diagnostic_format_decoder): New macro. (diagnostic_prefixing_rule): Likewise. (diagnostic_line_cutoff): Likewise. (set_message_prefixing_rule): Remove. * diagnostic.c (lang_printer): Remove. (diagnostic_message_length_per_line): Likewise. (current_prefixing_rule): Likewise. (initialize_diagnostics): Rename to... (diagnostic_initialize): ...this. Tweak. (default_initialize_buffer): Remove. (reshape_diagnostic_buffer): Likewise. (init_output_buffer): Adjust prefixing rule setting. (output_format): Use format_decoder from the output_buffer. * c-lang.c (c_init): Adjust tree formatter setting. cp/ * error.c (init_error): Adjust settings. From-SVN: r43588
2001-05-20Makefile.in (OBJS, [...]): Update.Neil Booth1-3/+4
* 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-13except.c (choose_personality_routine): Export.Zack Weinberg1-0/+15
gcc/cp: * except.c (choose_personality_routine): Export. Add explanatory comment. Take an enum languages, not a boolean. (initialize_handler_parm): Adjust to match. * cp-tree.h: Prototype choose_personality_routine. * lex.c (handle_pragma_java_exceptions): New function. (init_cp_pragma): Register #pragma GCC java_exceptions. gcc: * extend.texi: Document #pragma GCC java_exceptions. libjava: * Makefile.am (libgcj_la_OBJECTS): Remove libsupc++convenience.la. * Makefile.in: Regenerate (by hand). * include/jvm.h: Add #pragma GCC java_exceptions at top of file. * doc/cni.sgml: Document #pragma GCC java_exceptions. From-SVN: r42027
2001-04-24Lazy __FUNCTION__ generation.Nathan Sidwell1-0/+7
gcc: Lazy __FUNCTION__ generation. * c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME): New _RIDs. (CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove. (CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New global tree slots. (function_id_node, pretty_function_id_node, func_id_node): Remove. (c99_function_name_decl_node, function_name_decl_node, pretty_function_name_decl_node, saved_function_name_decls): Declare. (struct language_function): Remove x_function_name_declared_p. (make_fname_decl): Remove a parameter. (declare_function_names): Remove prototype. (start_fname_decls, finish_fname_decls): Prototype. (fname_as_string): Likewise. (fname_string, fname_decl): Likewise. * c-common.c (make_fname_decl): Adjust. (struct fname_var_t): New struct. (fname_vars): New static array. (declare_function_name): Remove. (start_fname_decls, finish_fname_decls): New functions. (fname_as_string): New function from remnants of declare_function_name. (fname_string, fname_decl): New functions. * c-decl.c (c_function_name_declared_p): Remove. (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (c_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. Call finish_decl. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. Remove c_function_name_declared_p. (push_c_function_context): Don't push c_function_name_declared_p. (pop_c_function_context): Don't pop c_function_name_declared_p. (c_begin_compound_stmt): Don't check c_function_name_declared_p. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens. (program): Call finish_fname_decls for C. (primary): Add VAR_FUNC_NAME. (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. (yylexname): If it's a STRING_FUNC_NAME generate the function name now. Don't look for VAR_DECLs containing __FUNCTION__ et al. * c-semantics.c (prune_unused_decls): Remove. (finish_stmt_tree): Don't call prune_unused_decls. (genrtl_decl_stmt): Don't prune unused decls here. cp: Lazy __FUNCTION__ generation. * cp-tree.def (FUNCTION_NAME): Remove. * cp-tree.h (function_name_declared_p): Remove. (cp_fname_init): Prototype. * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, don't call declare_function_name. Call start_fname_decls. (cp_make_fname_decl): Adjust parameters. Generate the name. Don't clobber the line number. (cp_fname_init): New function. (start_function): Call start_fname_decls. (finish_function): Call finish_fname_decls. * lex.c (reswords): Add slots for __FUNCTION__ et al. (rid_to_yy): Add mappings for __FUNCTION__ et al. * optimize.c (maybe_clone_body): Remove function_name_declared_p. * parse.y (VAR_FUNC_NAME): New token. (primary): Add VAR_FUNC_NAME. * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's generation. (tsubst, FUNCTION_NAME case): Remove. (tsubst_copy, FUNCTION_NAME case): Remove. (tsubst_expr, DECL_STMT case): Be careful with a DECL_PRETTY_FUNCTION_P. (instantiate_decl): Remove function_name_declared_p. * semantics.c (begin_compound_statement): Don't call declare_function_name here. (setup_vtbl_ptr). Don't save & restore function_name_declared_p. (finish_translation_unit): Call finish_fname_decls. (expand_body): Remove function_name_declared_p. * typeck2.c (digest_init): Allow any ERROR_MARK. testsuite: * gcc.dg/c99-func-2.c: Remove xfail. * gcc.dg/c99-func-3.c: Remove xfail. * gcc.dg/c99-func-4.c: Remove xfail. From-SVN: r41520
2001-04-19cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is set.Mark Mitchell1-3/+3
* cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is set. (SET_DECL_LANGUAGE): New macro. * decl.c (duplicate_decls): Use SET_DECL_LANGUAGE. (pushdecl): Likewise. (build_library_fn_1): Likewise. (build_cp_library_fn): Likewise. (grokfndecl): Likewise. (grokvardecl): Mark `extern "C"' variables as having C linkage. * decl2.c (grokclassfn): Use SET_DECL_LANGUAGE. * lex.c (retrofit_lang_decl): Likewise. * mangle.c (mangle_decl_string): Don't mangle the names of variables declared with C language linkage. * semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE. From-SVN: r41430
2001-04-12cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro.Jason Merrill1-1/+1
* cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro. (TYPE_ANONYMOUS_P): New macro. (TAGGED_TYPE_P): New macro. * decl.c (check_tag_decl): Use TYPE_ANONYMOUS_P. (grokfndecl, grokvardecl, grokdeclarator): Likewise. * tree.c (no_linkage_helper): Likewise. * semantics.c (begin_class_definition): Likewise. * pt.c (convert_template_argument): Likewise. * lex.c (check_for_missing_semicolon): Likewise. From-SVN: r41303
2001-04-04cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.Mark Mitchell1-3/+3
* cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove. (OPERATOR_FORMAT): Likewise. (OPERATOR_TYPENAME_FORMAT): Likewise. * operators.def: Remove old name-mangling information. * decl.c (grok_op_properties): Adjust accordingly. * lex.c (init_operators): Likewise. * rtti.c (get_tinfo_decl): Issue error messages about types that have variable size. From-SVN: r41076
2001-03-21pt.c (instantiate_decl): Abort if we see a member constant instantiation ↵Jason Merrill1-6/+2
that doesn't already have its... * pt.c (instantiate_decl): Abort if we see a member constant instantiation that doesn't already have its initializer. Downgrade explicit instantiation without definition to pedwarn. * cp-tree.h (DECL_TINFO_FN_P, SET_DECL_TINFO_FN_P): Remove. * class.c (build_vtable_entry): Don't check DECL_TINFO_FN_P. (import_export_decl): Check tinfo_decl_p, not DECL_TINFO_FN_P. * cp-tree.h (CLASSTYPE_VTABLE_NEEDS_WRITING): Remove. (pending_vtables): Remove. * decl2.c (pending_vtables): Remove. (import_export_vtable): Use CLASSTYPE_INTERFACE_ONLY, not CLASSTYPE_VTABLE_NEEDS_WRITING. (import_export_class): Likewise. (init_decl2): Don't mark pending_vtables. * lex.c (handle_pragma_vtable): Just sorry. * pt.c (instantiate_class_template): Don't mess with CLASSTYPE_VTABLE_NEEDS_WRITING. (mark_class_instantiated): Likewise. * ptree.c (print_lang_type): Don't print it. * semantics.c (begin_class_definition): Don't set it. * pt.c (template_tail): Replace with last_pending_template. (maybe_templates, maybe_template_tail): Remove. (add_pending_template): Adjust. (instantiate_pending_templates): Adjust. * cp-tree.h (struct saved_scope): Remove lang_stack field. (current_lang_stack): Remove. * decl.c (maybe_push_to_top_level): Don't initialize it. (duplicate_decls): Use current_lang_depth. (xref_basetypes): Likewise. * class.c (current_lang_depth): New fn. (push_lang_context): Use more varray functionality. (pop_lang_context): Likewise. From-SVN: r40724
2001-03-10toplev.c (file_name_nondirectory): Remove.Neil Booth1-6/+2
* toplev.c (file_name_nondirectory): Remove. * toplev.h: Similarly. * dwarf2out.c (compute_section_prefix): Use lbasename instead of file_name_nondirectory. * cp/lex.c: Delete duplicate pending_lang_change. * cp/lex.c (handle_pragma_interface, handle_pragma_implementation): Similarly. * cp/repo.c (get_base_filename, open_repo_file): Similarly. * cp/cp-tree.h: Remove file_name_nondirectory prototype. From-SVN: r40369
2001-02-12Remove old ABI support.Mark Mitchell1-1/+1
From-SVN: r39599
2001-01-29tree.c, tree.h (build_parse_node): Remove; was identical to build_nt.Joseph Myers1-7/+7
* tree.c, tree.h (build_parse_node): Remove; was identical to build_nt. * c-lang.c (start_cdtor), objc/objc-act.c (build_module_descriptor): Use build_nt instead of build_parse_node. cp: * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, make_reference_declarator, make_call_declarator), method.c (implicitly_declare_fn), parse.y (namespace_using_decl, notype_unqualified_id, expr_or_declarator, new_type_id, after_type_declarator, direct_after_type_declarator, notype_declarator, complex_notype_declarator, complex_direct_notype_declarator, qualified_id, notype_qualified_id, overqualified_id, direct_new_declarator, absdcl, direct_abstract_declarator, conversion_declarator), pt.c (tsubst), semantics.c (begin_constructor_declarator): Use build_nt instead of build_parse_node. From-SVN: r39332
2001-01-14c-parse.in (finish_parse): Add comment about cpp_destroy.Neil Booth1-0/+1
* c-parse.in (finish_parse): Add comment about cpp_destroy. * cp/lex.c (finish_parse): Similarly. * cppinit.c (cpp_cleanup): Rename cpp_destroy for clarity. Return the number of errors encountered. * cpplib.h (cpp_cleanup): Rename cpp_destroy, return int. * cppmain.c (main): Don't call cpp_destroy. From-SVN: r39020
2001-01-13c-lex.c (init_c_lex): Use cpp_get_callbacks to set callbacks.Neil Booth1-1/+1
* 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-10c-lang.c (lang_hooks): Update.Neil Booth1-2/+5
* c-lang.c (lang_hooks): Update. (lang_decode_option): Remove. (lang_init_options): Rename c_init_options. * toplev.c (main): Use lang_hooks for lang_init_options and lang_decode_option. * toplev.h (lang_hooks): Add 2 new hooks. * tree.h: Remove lang_init_options and lang_decode_option. * cp/cp-tree.h (lang_decode_option): Rename cxx_decode_option. * cp/decl2.c: Similarly. * cp/lex.c (lang_init_options): Rename cxx_init_options. (lang_hooks): Update. * f/com.c (f_init, f_finish): Rename ffe_init, ffe_finish for consistency. (lang_init_options): Rename ffe_init_options. (lang_hooks): Update. (lang_decode_option): Remove. * java/lang.c (lang_init_options): Rename java_init_options. (lang_decode_option): Rename java_decode_option. (lang_hooks): Update. * objc/objc-act.c (lang_init_options): Rename objc_init_options. (lang_decode_option): Rename objc_decode_option. (lang_hooks): Update. From-SVN: r38856
2001-01-09c-lang.c (lang_hooks): Update.Neil Booth1-5/+18
* c-lang.c (lang_hooks): Update. (lang_init): Rename c_init. (lang_finish): Remove. * toplev.c (compile_file): Use lang_hooks for lang_init () and lang_finish (). * toplev.h (lang_hooks): Add init () and finish (). * tree.h (lang_init, lang_finish): Remove. * cp/tree.h (lang_init, lang_finish): Remove. * cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c. * cp/lex.c (cxx_init, cxx_finish, cxx_post_options, lang_hooks): New. (lang_init, lang_finish): Remove. * f/com.c (lang_init, lang_finish): Rename f_init, f_finish. (lang_hooks): Update. * java/lang.c (lang_init): Rename java_init. (lang_finish): Remove. (lang_hooks): Update. * objc/objc-act.c (lang_init): Rename objc_init. (lang_finish): Remove. (lang_hoooks): Update. From-SVN: r38828
2001-01-03c-common.c (c_common_lang_init): New function.Joseph Myers1-4/+2
* c-common.c (c_common_lang_init): New function. Warn if format warning options which only have effects when used with -Wformat are used without -Wformat. * c-common.h (c_common_lang_init): Declare. * c-lang.c (lang_init): Call c_common_lang_init. * objc/objc-act.c (lang_init): Call c_common_lang_init. cp: * lex.c (lang_init): Call c_common_lang_init. From-SVN: r38672
2000-11-28c-lex.h (parse_in): Change parse_in to a cpp_reader *.Neil Booth1-13/+11
* 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-26Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib.Neil Booth1-1/+1
* 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-34/+7
* 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-20c-lang.c (lang_init_options): Update call to cpp_reader_init.Neil Booth1-1/+1
* c-lang.c (lang_init_options): Update call to cpp_reader_init. * cppmain.c (main): Similarly. * fix-header.c (read_scan_file): Similarly. * cp/lex.c (lang_init_options): Similarly. * objc/objc-act.c (lang_init_options): Similarly. * cppexp.c (parse_number): Only warn for unextended C89. * cppinit.c (set_lang): New function. (cpp_reader_init): Take a LANG argument and pass it to set_lang. (COMMAND_LINE_OPTIONS): New option std=c++98. (cpp_handle_option): Use set_lang. * cpplib.h (enum_c_lang): New enumeration. Update comments. From-SVN: r37587
2000-11-20lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.Nathan Sidwell1-1/+1
cp: * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. * parse.y (extdef): Add EXPORT reduction. * spew.c (yylex): Don't skip export here. testsuite: * g++.old-deja/g++.pt/export1.C: New test. From-SVN: r37585
2000-11-17ggc.h: Delete ggc_add_string_root and ggc_mark_string.Zack Weinberg1-31/+2
* 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-2/+2
* 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-10alpha.c (check_float_value): Use memcpy, not bcopy.Kaveh R. Ghazi1-1/+1
* alpha.c (check_float_value): Use memcpy, not bcopy. * arm.c (output_move_double): Likewise. * arm.md: Likewise. * m88k.c (legitimize_operand): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * m88k.md: Likewise. * mips.c (override_options): Likewise. * mips.md: Likewise. * romp.c (output_fpops): Likewise. * rs6000.c (rs6000_override_options): Likewise. * sh.md: Likewise. * vax.c (check_float_value): Likewise. * emit-rtl.c (copy_rtx_if_shared, init_emit_once): Likewise. * expmed.c (synth_mult): Likewise. * final.c (add_bb_string): Likewise. * genattr.c (main): Likewise. * genattrtab.c (attr_string, simplify_cond, copy_rtx_unchanging): Likewise. * jump.c (thread_jumps): Likewise. * prefix.c (save_string): Likewise. * real.h (REAL_VALUE_FROM_CONST_DOUBLE): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1): Likewise. * reload1.c (reload, eliminate_regs): Likewise. cp: * decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy. * lex.c (copy_lang_decl): Likewise. java: * decl.c (copy_lang_decl): Use memcpy, not bcopy. * jcf-parse.c (jcf_figure_file_type): Likewise. From-SVN: r37367
2000-11-09decl.c (init_decl_processing): Change definition of __wchar_t to wchar_t.Eric Christopher1-27/+27
2000-11-07 Eric Christopher <echristo@redhat.com> * decl.c (init_decl_processing): Change definition of __wchar_t to wchar_t. Remove artificial declaration of wchar_t. * lex.c: Change instances of __wchar_t to wchar_t. From-SVN: r37348
2000-11-09lex.c (do_identifier): Don't lookup_name for operators.Nathan Sidwell1-1/+1
gcp/ChangeLog: * lex.c (do_identifier): Don't lookup_name for operators. * parse.y (operator): Save looking_for_typename. (unoperator): Restore it. * spew.c (frob_opname): Use nth_token for lookahead. testsuite/ChangeLog: * g++.old-deja/g++.pt/operator1.C: New test. From-SVN: r37340
2000-11-02* collect2.c (main, write_c_file_stat), gcc.c (translate_options,Joseph Myers1-1/+1
process_command, main), gcov.c (open_files, output_data), tlink.c (frob_extension, scan_linker_output), toplev.c (file_name_nondirectory): Use strchr () and strrchr () instead of index () and rindex (). cp: * dump.c (dequeue_and_dump), lex.c (interface_strcmp), method.c (build_overload_value), repo.c (open_repo_file), xref.c (open_xref_file): Use strchr () and strrchr () instead of index () and rindex (). f: * com.c (open_include_file, ffecom_open_include_): Use strchr () and strrchr () instead of index () and rindex (). From-SVN: r37206
2000-11-02c-lex.c (init_c_lex): Update cpp_start_read call.Zack Weinberg1-1/+1
* c-lex.c (init_c_lex): Update cpp_start_read call. (cb_ident): Update for new callback prototype. (cb_def_pragma): Update for new cpp_get_token prototype. (c_lex): Similarly. Use cpp_get_line. * c-parse.in (finish_parse): Update for new cpp_finish prototype. * cp/lex.c (finish_parse): Similarly. From-SVN: r37201
2000-10-13Remove obstacks.Mark Mitchell1-1/+1
* Makefile.in (ggc-callbacks.o): Remove target. (flow.o): Depend on GGC_H. * alias.c (init_alias_analysis): Remove ggc_p conditionals. (end_alias_analysis): Likewise. * basic-block.h (init_flow): New function. (allocate_reg_life_data): Declare. * bb-reorder.c (function_obstack): Replace with ... (flow_obstack): ... new variable. (fixup_reorder_chain): Use it. * c-decl.c (ggc_p): Remove. (caller-save.c): Don't call oballoc/obfree. * combine.c (struct undobuf): Remove storage. (try_combine): Don't call oballoc. (undo_all): Don't call obfree. * cse.c (insert): Use xmalloc, not oballoc. (cse_main): Adjust accordingly. * dwarf2out.c (save_rtx): Remove obstack code. (dwarf2out_init): Remove ggc_p conditionals. * emit-rtl.c (rtl_obstack): Remove. (gen_rtx_CONST_INT): Remove ggc_p conditionals. (make_insn_raw): Likewise. (emit_insn_before): Likewise. (emit_insn_after): Likewise. (emit_insn): Likewise. (gen_sequence): Likewise. (copy_insn_1): Remove handling of `b' RTL components. (init_emit_once): Remove ggc_p conditionals. * except.c (create_rethrow_ref): Don't fool with obstacks. (add_partial_entry): Likewise. (call_get_eh_context): Likewise. (begin_protect_partials): Likewise. (protect_with_terminate): Likewise. * explow.c (plus_constant_wide): Likewise. * expr.c (init_expr_once): Likewise. (emit_block_move): Likewise. (clear_storage): Likewise. (expand_expr): Likewise. * flow.c (function_obstack): Remove. (flow_obstack): New variable. (flow_firstobj): Likewise. (create_base_block): Use the flow_obstack. (split_block): Likewise. (split_edge): Likewise. (calculate_global_regs_live): Likewise. (allocate_bb_life_data): Make it static. Likewiwse. (init_flow): New function. (size_int_type_wide): Remove ggc_p conditionals. * function.c (push_function_context_to): Don't call save_tree_status. (pop_function_context_from): Or restore_tree_status. (assign_stack_local_1): Don't call push_obstacks. (find_fixup_replacement): Use xmalloc. (fixup_var_refs_insns): Free the storage. (insns_for_mem_walk): Don't mess with obstacks. (instantiate_decls): Likewise. (trampoline_address): Likewise. (expand_function_end): Likewise. * function.h (sturct function): Remove obstack-related variables. (save_tree_status): Don't declare. (restore_tree_status): Likewise. * gcse.c (compute_can_copy): Don't call oballoc/obfree. * genattrtab.c (operate_exp): Remove ggc_p conditionals. (simplify_cond): Likewise. (simplify_test_exp): Don't mess with obstacks. (optimize_attrs): Likewise. * gengenrtl.c (gendef): Don't include ggc_p conditionals. * ggc-callbacks.c (ggc_p): Remove. * ggc-none.c (ggc_p): Remove. * ggc.h (ggc_p): Don't declare. * integrate.c (save_for_inline): Don't mess with obstacks. (integrate_decl_tree): Likewise. (output_inline_function): Likewise. * lists.c (init_EXPR_INSN_LIST_cache): Likewise. * loop.c (temp_obstack): Remove. (rtl_obstack): Likewise. (init_loop): Don't mess with obstacks. (reg_address_cost): Free BIVs and GIVs. (check_insns_for_bivs): Use xmalloc, not oballoc. (find_mem_givs): Likewise. (record_biv): Likewise. (general_induction_var): Likewise. (product_cheap_p): Likewse. * optabs.c (init_one_libfunc): Remove ggc_p conditional. * print-tree.c (debug_tree): Don't use oballoc/obfree. (print_node): Likewise. * profile.c (output_func_start_profiler): Remove call to temporary_allocation. * reload1.c (eliminate_regs_in_insn): Don't mess with obstacks. * resource.c (mark_target_live_regs): Use xmalloc. (free_resource_info): Free the memory. * rtl.c (rtl_obstack): Remove. (rtvec_alloc): Don't mess with obstacks. (rtx_alloc): Likewise. (rtx_free): Remove. (copy_rtx): Don't handle `b' cases. (read_rtx): Use a local rtl_obstack. * rtl.h (oballoc): Remove. (obfree): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (allocate_bb_life_data): Likewise. (allocate_reg_life_data): Likewise. (rtx_free): Likewise. * sdbout.c (sdbout_queue_anonymous_type): Use tree_cons, not saveable_tree_cons. * simplify-rtx.c (cselib_init): Don't mess with obstacks. * stmt.c (mark_block_nesting): Mark the label_chain. (epxand_label): Use ggc_alloc, not oballoc. (clear_last_expr): Don't mess with obstacks. (expand_decl_cleanup): Likewise. (expand_dcc_cleanup): Likewise. (expand_dhc_cleanup): Likewise. (expand_anon_union_decl): Likewise. (add_case_node): Use xmalloc, not oballoc. (free_case_nodes): New function. (expand_end_case): Call it. * stor-layout.c (layout_type): Don't mess with obstacks. (layout_type): Likewise. * toplev.c (wrapup_global_declarations): Likewise. (compile_file): Remove ggc_p conditionals. (rest_of_compilation): Call init_flow. Remove ggc_p conditionals. (decode_f_option): Remove ggc_p conditionals. * tree.c (function_maybepermanent_obstack): Remove. (maybepermanent_obstack): Likewise. (function_obstack): Likewise. (tmeporary_obstack): Likewise. (momentary_obstack): Likewise. (temp_decl_obstack): Likewise. (saveable_obstack): Likewise. (rtl_obstack): Likewise. (current_obstack): Likewise. (expression_obstack): Likewise. (struct obstack_stack): Likewise. (obstack_stack): Likewise. (obstack_stack_obstack): Likewise. (maybepermanent_firstobj): Likewise. (temporary_firstobj): Likewise. (momentary_firstobj): Likewise. (temp_decl_firstobj): Likewise. (momentary_function_firstobj): Likewise. (all_types_permanent): Likewise. (struct momentary_level): Likewise. (momentary_stack): Likewise. (init_obstacks): Remove initialization of removed obstacks. (save_tree_status): Remove. (restore_tree_status): Likewise. (temporary_allocation): Liekwise. (end_temporary_allocation): Liekwise. (resume_temporary_allocation): Likewise. (saveable_allocation): Likewise. (push_obstacks): Likewise. (push_obstacks_nochange): Likewise. (pop_obstacks): Likewise. (allocation_temporary_p): Likewise. (permanent_allocation): Likewise. (preserve_data): Likewise. (preserve_initializer): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (oballoc): Likewise. (obfree): Likewise. (savealloc): Likewise. (expralloc): Likewise. (print_obstack_name): Likewise. (debug_obstack): Likewise. (object_permanent_p): Likewise. (push_momentary): Likewise. (perserve_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (pop_momentary_nofree): Likewise. (suspend_momentary): Likewise. (resume_momentary): Likewise. (make_node): Don't set TREE_PERMANENT. (copy_node): Remove ggc_p conditionals. Don't set TYPE_OBSTACK. Don't set TREE_PERMANENT. (get_identifier): Remove ggc_p conditionals. (build_string): Likewise. (make_tree_vec): Likewise. (build_decl_list): Remove. (build_expr_list): Likewise. (tree_cons): Remove ggc_p conditionals. (decl_tree_cons): Remove. (expr_tree_cons): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (build1): Remove ggc_p conditionals. (build_parse_node): Likewise. (build_type_attribute_variant): Don't mess with obstacks. (build_type_copy): Likewise. (type_hash_canon): Likewise. (build_pointer_type): Likewise. (build_reference_type): Likewise. (build_index_type): Likewise. (build_range_type): Likewise. (dump_tree_statistics): Don't print obstack information. * tree.h (struct tree_common): Remove permanent_flag. (TREE_PERMANENT): Remove. (TREE_SET_PERMANENT): Likewise. (TYPE_OBSTACK): Likewise. (struct tree_type): Remove obstack. (oballoc): Remove. (savealloc): Likewise. (build_decl_list): Likewise. (build_expr_list): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (decl_tree_cons): Likewise. (expr_tree_cons): Likewise. (suspend_momentary): Likewise. (allocation_temporary_p): Likewise. (resume_momentary): Likewise. (push_obstacks_nochange): Likewise. (permanent_allocation): Likewise. (push_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (end_temporary_allocation): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (pop_momentary_nofree): LIkewise. (preserve_momentary): Likewise. (saveable_allocation): Likewise. (temporary_allocation): Likewise. (resume_temporary_allocation): Likewise. (perserve_initializer): Likewise. (debug_obstack): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (obfree): Likewise. * varasm.c (current_obstack): Remove. (saveable_obstack): Remove. (rtl_obstack): Remove. (immed_double_const): Don't mess with obstacks. (immed_real_cons): Likewise. (output_constant_def): Likewise. (init_varasm_status): Use xcalloc. (mark_pool_constant): Mark the pool constant itself. (free_varasm_status): Free memory. (decode_rtx_const): Call bzero directly, rather than expanding it inline. (record_rtx_const): Don't mess with obstacks. (force_const_mem): Likewise. * config/arm/arm.c (arm_encode_call_attribute): Remove ggc_p conditionals. (aof_pic_entry): Likewise. * config/ia64/ia64.c (ia64_encode_section_info): Likewise. * config/m32r/m32r.c (m32r_encode_section_info): Likewise. * config/pa/pa.c (saveable_obstack): Remove. (rtl_obstack): Likewise. (current_obstack): Likewise. (output_call): Don't mess with obstacks. (hppa_encode_label): Remove ggc_p conditionals. * config/romp/romp.c (get_symref): Don't mess with obstacks. * config/rs6000/rs6000.c (output_toc): Remove ggc_p conditional. (rs6000_encode_section_info): Likewise. * config/sh/sh.c (get_fpscr_rtx): Likewise. From-SVN: r36856
2000-10-01c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.Mark Mitchell1-2/+2
* 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-15c-parse.in (reswords): Add _Complex.Joseph Myers1-0/+1
* c-parse.in (reswords): Add _Complex. cp: * lex.c (reswords): Add _Complex. From-SVN: r36422
2000-09-07c-common.h (prep_stmt): Declare.Mark Mitchell1-1/+1
* c-common.h (prep_stmt): Declare. (lang_expand_stmt): Likewise. * c-decl.c (lang_expand_stmt): Remove. * c-semantics.c (lang_expand_stmt): Define. (prep_stmt): New function. (expand_stmt): Handle common statement types here. * cp-tree.h (init_cp_semantics): Declare. (genrtl_try_block): Don't declare. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_named_return_value): Likewise. * lex.c (init_parse): Call init_cp_semantics. * semantics.c (genrtl_try_block): Give it internal linkage. (genrtl_handler): Likewise. (genrtl_catch_block): Likewise. (genrtl_ctor_stmt): Likewise. (genrtl_subobject): Likewise. (genrtl_do_poplevel): Likewise. (genrtl_named_return_value): Likewise. (lang_expand_stmt): Rename to ... (cp_expand_stmt): ... this. Only handle C++-specific nodes. (init_cp_semantics): Define. From-SVN: r36229
2000-09-07Integrated preprocessor.Zack Weinberg1-3652/+447
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-28[multiple changes]Jason Merrill1-15/+0
2000-08-28 Daniel Berlin <dberlin@redhat.com> * dwarf2out.c (DIE_LABEL_PREFIX): Remove leading "__". (print_die): If we don't know the offset of the target die, try the symbol. Add a trailing newline. (reverse_all_dies): New fn. (dwarf2out_finish): Call it. (break_out_includes): Reorganize for clarity. (add_sibling_attributes): Don't call reverse_die_lists. (output_comp_unit): Rename from output_comdat_comp_unit. Use for primary CU, too. * flags.h: Add flag_eliminate_dwarf2_dups. * toplev.c (f_options): Support -feliminate-dwarf2-dups. 2000-08-28 Jason Merrill <jason@redhat.com> * dwarf2.h (DW_TAG_GNU_BINCL, DW_TAG_GNU_EINCL): New tags. * dwarf2out.c: #include "md5.h". (DIE_LABEL_PREFIX): New macro. (dw_val_struct): Add 'external' flag to val_die_ref. (add_AT_die_ref, AT_ref): Adjust. (AT_ref_external, set_AT_ref_external): New fns. (build_abbrev_table): Call set_AT_ref_external. (value_format): Call AT_ref_external. (die_struct): Add die_symbol field. (new_die): Clear it. (dwarf_tag_name): Handle BINCL/EINCL. (dwarf2out_start_source_file): Add BINCL DIE. (dwarf2out_end_source_file): Add EINCL DIE. (push_new_compile_unit, pop_compile_unit, clear_die_sizes): New fns. (loc_checksum, attr_checksum, die_checksum): New fns. (is_type_die, is_comdat_die, is_symbol_die): New fns. (compute_section_prefix, assign_symbol_names): New fns. (gen_internal_sym, output_die_symbol, output_symbolic_ref): New fns. (output_die): Call output_die_symbol and AT_ref_external. (output_comdat_comp_unit): New fn, split out from... (dwarf2out_finish): ...here. Also call add_sibling_attributes for secondary CUs. (output_pubnames, output_aranges): Abort if we see entries from secondary CUs. * toplev.h: Declare file_name_nondirectory. * toplev.c (file_name_nondirectory): New fn, moved from C++ frontend. (rest_of_type_compilation): Call dwarf2out_decl if at toplevel. (debug_start_source_file): Call dwarf2out_start_source_file regardless of debug verbosity. (debug_end_source_file): Similarly. * tree.h: Declare clean_symbol_name. * tree.c (clean_symbol_name): Split out from... (get_file_function_name_long): ...here. * dwarf2out.c (new_loc_descr): Use calloc. (splice_child_die): Remove the die from the right parent. (gen_struct_or_union_die): Don't add AT_name to a specification DIE. gcc/cp: 2000-08-28 Jason Merrill <jason@redhat.com> * lex.c (file_name_nondirectory): Move to toplev.c. libiberty: 2000-08-28 Jason Merrill <jason@redhat.com> * Makefile.in (REQUIRED_OFILES): Add md5.o. (CFILES): Add md5.c. * md5.c: New file. include: 2000-08-28 Jason Merrill <jason@redhat.com> * md5.h: New file. gcc/cp: 2000-08-28 Jason Merrill <jason@redhat.com> * cp-tree.h (LOCAL_CLASS_P): New macro. * class.c (finish_struct_1): Use it. From-SVN: r36022
2000-08-21diagnostic.c (context_as_prefix): Export.Gabriel Dos Reis1-2/+3
* diagnostic.c (context_as_prefix): Export. (need_error_newline): Remove. (lang_diagnostic_starter, lang_diagnostic_finalizer): New objects. (error_module_changed, record_last_error_module, error_function_changed, record_last_error_function): New functions. (initialize_diagnostics): Default intialize lang_diagnostic_starter, lang_diagnostic_finalizer. (init_output_buffer): Tweak. (file_name_as_prefix): New function. (announce_function, default_print_error_function, report_error_function, set_diagnostic_context): Tweak. cp/ * lex.c (lang_init_options): Default diagnostic message maximum length to 80, when line-wrapping. From-SVN: r35836
2000-07-27decl.c (start_cleanup_fn): Mark the function as `inline'.Mark Mitchell1-1/+0
* decl.c (start_cleanup_fn): Mark the function as `inline'. * decl2.c (get_guard): Call cp_finish_decl, not rest_of_decl_compilation, for local guards. * lex.c (do_identifier): Remove unused variable. From-SVN: r35285
2000-07-25Kill strict_prototype.Nathan Sidwell1-24/+5
Kill strict_prototype. Backwards compatibility only for non NO_IMPLICIT_EXTERN_C systems. * cp-tree.h (flag_strict_prototype): Remove. (strict_prototype): Remove. (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. * decl.c (maybe_push_to_top_level): Adjust. (pop_from_top_level): Adjust. (decls_match): Only allow sloppy parm matching for ancient system headers. (init_decl_processing): Adjust. (grokdeclarator): Adjust. * decl2.c (flag_strict_prototype): Remove. (strict_prototype): Remove. (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. (lang_f_options): Remove "strict-prototype". (unsupported-options): Add "strict-prototype". * lex.c (do_identifier): Adjust. (do_scoped_id): Adjust. * parse.y (empty_parms): Adjust. * class.c (push_lang_context): Adjust. (pop_lang_context): Adjust. * typeck.c (comp_target_parms): Adjust. From-SVN: r35254
2000-06-30Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h.Mark Mitchell1-7/+4
* 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-16c-common.c (c_tree_code_type): New array.Benjamin Chelf1-12/+10
* 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-16cp-tree.h (struct language_function): Remove x_base_init_list and ↵Mark Mitchell1-7/+0
x_member_init_list. * cp-tree.h (struct language_function): Remove x_base_init_list and x_member_init_list. (current_base_init_list): Remove. (current_member_init_list): Likewise. (setup_vtbl_ptr): Change prototype. (emit_base_init): Likewise. (expand_member_init): Likewise. (reinit_parse_for_function): Remove. * decl.c (save_function_data): Don't clear x_base_init_list and x_member_init_list. (mark_language_function): Don't mark them. * init.c (perform_member_init): Tweak comment. (sort_member_init): Take the list of initializers as an argument. (sort_base_init): Likewise. (emit_base_init): Likewise. (expand_member_init): Return the initializer. Don't use global variables. * lex.c (reinit_parse_for_function): Remove. * method.c (build_template_parm_names): Correct substitution. (do_build_copy_constructor): Don't use current_member_init_list and current_base_init_list. (synthesize_method): Likewise. * parse.y (base_init): Split mem-initializers into base-initializers and field-initializers. (member_init_list): Build up the list here. (member_init): Return the initializer. (fn.depfn): Don't use reinit_parse_for_function. * parse.c: Regenerated. * pt.c (convert_nontype_argument): Don't make an ADDR_EXPR of the ERROR_MARK. (tsubst_expr): Don't use current_member_init_list and current_base_init_list. (tsubst_expr_values): Rename to ... (tsubst_initializer_list): ... this. Use convert_from_reference. * semantics.c (setup_vtbl_ptr): Don't use current_member_init_list and current_base_init_list. (begin_function_definition): Don't call reinit_parse_for_function. * dump.c (dequeue_and_dump): Use TREE_VEC_LENGTH with vectors. * error.c (dump_expr): Handle ADDR_EXPRs with REFERENCE_TYPE correctly. From-SVN: r34571
2000-06-14c-common.h (IF_COND): Moved here from cp/cp-tree.h.Benjamin Chelf1-0/+3
* c-common.h (IF_COND): Moved here from cp/cp-tree.h. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. (SCOPE_BEGIN_P): Likewise. (SCOPE_END_P): Likewise. (SCOPE_STMT_BLOCK): Likewise. (SCOPE_NULLIFIED_P): Likewise. (SCOPE_NO_CLEANUPS_P): Likewise. (SCOPE_PARTIAL_P): Likewise. (ASM_VOLATILE_P): Likewise. (STMT_LINENO): Likewise. (STMT_LINENO_FOR_FN_P): Likewise. * c-common.def: Added SRCLOC, SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * gencheck.c (tree_codes[]): Added '#include "c-common.def"'. * cp/cp-tree.h (IF_COND): Move to c-common.h. (THEN_CLAUSE): Likewise. (ELSE_CLAUSE): Likewise. (WHILE_COND): Likewise. (WHILE_BODY): Likewise. (DO_COND): Likewise. (DO_BODY): Likewise. (RETURN_EXPR): Likewise. (EXPR_STMT_EXPR): Likewise. (FOR_INIT_STMT): Likewise. (FOR_COND): Likewise. (FOR_EXPR): Likewise. (FOR_BODY): Likewise. (SWITCH_COND): Likewise. (SWITCH_BODY): Likewise. (CASE_LOW): Likewise. (CASE_HIGH): Likewise. (GOTO_DESTINATION): Likewise. (COMPOUND_BODY): Likewise. (ASM_CV_QUAL): Likewise. (ASM_STRING): Likewise. (ASM_OUTPUTS): Likewise. (ASM_INPUTS): Likewise. (ASM_CLOBBERS): Likewise. (DECL_STMT_DECL): Likewise. (STMT_EXPR_STMT): Likewise. (LABEL_STMT_LABEL): Likewise. (SCOPE_BEGIN_P): Likewise. (SCOPE_END_P): Likewise. (SCOPE_STMT_BLOCK): Likewise. (SCOPE_NULLIFIED_P): Likewise. (SCOPE_NO_CLEANUPS_P): Likewise. (SCOPE_PARTIAL_P): Likewise. (ASM_VOLATILE_P): Likewise. (STMT_LINENO): Likewise. (STMT_LINENO_FOR_FN_P): Likewise. * cp/cp-tree.def: Removed SRCLOC, SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. * cp/Makefile.in (CXX_TREE_H): Added $(srcdir)/../c-common.def. * cp/Make-lang.in (CXX_SRCS): Added $(srcdir)/c-common.def. (cc1plus$(exeext)): Added $(srcdir)/c-common.def. * cp/lex.c (cplus_tree_code_type[]): Added '#include "c-common.def"'. (cplus_tree_code_length[]): Added '#include "c-common.def"'. (cplus_tree_code_name[]): Added '#include "c-common.def"'. From-SVN: r34552
2000-06-09ggc-none.c, [...] (ggc_alloc_obj): Rename it ggc_alloc, drop second ↵Zack Weinberg1-1/+1
argument, never clear returned memory. toplevel: * ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename it ggc_alloc, drop second argument, never clear returned memory. * ggc-common.c (ggc_alloc_string): Use ggc_alloc. (ggc_alloc_cleared): New. * ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not ggc_alloc_obj. Remove ggc_alloc macro. (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc. * rtl.c (rtvec_alloc): Clear the vector always. (rtx_alloc): Clear the first word always. Remove dirty obstack tricks (this routine is no longer a bottleneck). * tree.c (make_node): Clear the new node always. (make_tree_vec): Likewise. (tree_cons): Clear the common structure always. (build1): Likewise; also, clear TREE_COMPLEXITY. * gengenrtl.c: Use puts wherever possible. Remove extra newlines. (gendef): Clear the first word of an RTX in the generator function, irrespective of ggc_p. Initialize '0' slots to NULL. (genlegend): Don't generate obstack_alloc_rtx routine, just a thin wrapper macro around obstack_alloc. * stmt.c (expand_fixup): Use ggc_alloc. * c-typeck.c (add_pending_init): Use ggc_alloc. * emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem). * varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to const0_rtx when it is created. (immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if we are not in a function. * tree.c (tree_class_check_failed): Make second arg an int. * tree.h: Update prototype. cp: * call.c (add_candidate): Use ggc_alloc_cleared. * decl.c (lookup_label): Likewise. * lex.c (retrofit_lang_decl): Likewise. From-SVN: r34478
2000-06-09revert mangling patchJason Merrill1-3/+3
From-SVN: r34471
2000-06-09lex.c (DEF_OPERATOR): Say `operator@' -not- `operator @' whenever @ is a ↵Gabriel Dos Reis1-2/+2
symbolic name. 2000-06-09 Gabriel Dos Reis <gdr@codesourcery.com> * lex.c (DEF_OPERATOR): Say `operator@' -not- `operator @' whenever @ is a symbolic name. From-SVN: r34465
2000-06-08invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version.Mark Mitchell1-3/+3
* invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version. Remove old ABI mangling code. * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID and CPTI_TINFO_VAR_ID. (tinfo_decl_id): Remove. (tinfo_var_id): Likewise. (name_mangling_version): Likewise. (flag_do_squangling): Likewise. (get_vtt_name): Likewise. (init_method): Likewise. (build_overload_name): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (build_overload_with_type): Likewise. (build_destructor_name): Likewise. (get_id_2): Likewise. (get_ctor_vtbl_name): Likewise. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. * call.c (build_new_method_call): Use mangle_vtt_for_type. * class.c (get_vtable_name): Remove. (get_vtt_name): Remove. (get_vtable_decl): Use mangle_vtbl_for_type. (build_vtt): Likewise. (build_ctor_vtbl_group): Remove old ABI mangling support. * decl.c (pushtag): Likewise. (maybe_commonize_var): Use set_mangled_name_for_decl. (grokfndecl): Remove old ABI mangling support. (grokvardecl): Likewise. (grokdeclarator): Likewise. (grok_op_properties): Adjust use of DEF_OPERATOR. * decl2.c (name_mangling_version): Remove. (lang_f_options): Remove squangle. (unsupported_options): Add squangle. (lang_decode_options): Don't set flag_do_squangling. Issue a warning for -fname-mangling-version. (grokclassfn): Remove old ABI mangling support. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. (grokoptypename): Likewise. (get_sentry): Likewise. * init.c (build_java_class_ref): Use mangle_java_reflection_var_for_type. * lex.c (init_operators): Adjust use of DEF_OPERATOR. (init_parse): Call init_mangle, not init_method. * mangle.c (write_special_name_constructor): Handle maybe-in-charge constructors. (write_special_name_destructor): Handle maybe-in-charge destructors. (write_expression): Tweak code to handle non-type template arguments with reference type. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. (mangle_conv_op_name_for_type): Don't use a name that the user could type. * method.c (enum mangling_flags): Remove. (mangling_flags): Likewise. (obstack_chunk_alloc): Likewise. (obstack_chunk_free): Likewise. (OB_INIT): Likewise. (OB_PUTC): Likewise. (OB_PUTC2): Likewise. (OB_PUTS): Likewise. (OB_PUTID): Likewise. (OB_PUTCP): Likewise. (OB_FINISH): Likewise. (OB_LAST): Likewise. (btypelist): Likewise. (ktypelist): Likewise. (maxbtype): Likewise. (maxktype): Likewise. (typevec): Likewise. (maxtype): Likewise. (init_method): Likewise. (digit_buffer): Likewise. (nofold): Likewise. (start_squangling): Likewise. (end_squangling): Likewise. (icat): Likewise. (dicat): Likewise. (old_backref_index): Likewise. (flush_repeats): Likewise. (is_back_referenceable_type): Likewise. (issue_nrepeats): Likewise. (check_ktype): Likewise. (issue_ktype): Likewise. (build_overload_nested_name): Likewise. (build_underscore_int): Likewise. (build_overload_scope_ref): Likewise. (mangle_expression): Likewise. (build_overload_int): Likewise. (mangled_C9x_name): Likewise. (build_overload_value): Likewise. (build_template_template_parm_names): Likewise. (build_template_parm_names): Likewise. (build_overload_identifier): Likewise. (build_qualified_name): Likewise. (build_mangled_name_for_type_with_Gcode): Likewise. (build_mangled_name_for_type): Likewise. (build_overload_name): Likewise. (build_mangled_name): Likewise. (process_modifiers): Likewise. (check_btype): Likewise. (process_overload_item): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (set_mangled_name_for_decl): Remove old ABI mangling support. (build_typename_overload): Remove. (build_overload_with_type): Remove. (get_id_2): Remove. (get_ctor_vtbl_name): Remove. (build_destructor_name): Likewise. (set_mangled_name_for_decl): Likewise. (make_thunk): Remove old ABI mangling support. * operators.def: Likewise. * pt.c (check_explicit_specialization): Don't call set_mangled_name_for_template_decl. (lookup_template_class): Remove old ABI mangling support. (tsubst_friend_function): Update comment. (tsubst_decl): Remove old ABI mangling support. (tsubst_copy): Likewise. (set_mangled_name_for_template_decl): Remove. * rtti.c (init_rtti_processing): Use std_identifier. Don't set tinfo_decl_id or tinfo_var_id. (get_tinfo_var): Use mangle_typeinfo_for_type. (tinfo_name): Remove old ABI mangling support. (get_tinfo_decl): Likewise. (tinfo_base_init): Likewise. (create_real_tinfo_var): Use a name that the user can't type. * tinfo2.cc (BUILTIN): Adjust to use new mangling. From-SVN: r34458
2000-06-06diagnostic.c (output_maximum_width): Remove.Gabriel Dos Reis1-1/+1
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com> * diagnostic.c (output_maximum_width): Remove. (doing_line_wrapping): Tweak. (diagnostic_buffer): New object. (global_output_buffer): New object. (output_destroy_prefix): New function. (default_initialize_buffer): Likewise. (reshape_diagnostic_buffer): Likewise. (initialize_diagnostics): Likewise. (output_clear): Tweak. (line_wrapper_printf): Adjust call to init_output_buffer. (vline_wrapper_message_with_location): Likewise. Use output_destroy_prefix. (v_message_with_decl): Likewise. * diagnostic.h (struct output_buffer): Constify prefix. (init_output_buffer, output_get_prefix): Constify. (diagnostic_message_length_per_line): Likewise. (reshape_diagnostic_buffer): Declare. (default_initialize_buffer): Declare. (initialize_diagnostics): Declare. (diagnostic_buffer): Declare new obbject. * toplev.c: #include diagnostic.h (display_help): Document diagnostic formatting options. (decode_f_option): Handle diagnostic formatting options. (main): Setup initialization for diagnostic messages outputter. * toplev.h (set_message_length): Remove. * Makefile.in (toplev.o): Depends upon diagnostic.h * invoke.texi : Document diagnostics formatting options. cp/ 2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com> * lex.c (lang_init_options): Tweak. * decl2.c: Remove #inclusion of diagnostic.h (lang_decode_option): Move diagnostic formatting options to toplevel. * lang-options.h: Remove documentation for diagnostic options. * Makefile.in (lex.o): Depends upon diagnostic.h From-SVN: r34435
2000-06-05search.c (maybe_suppress_debug_info): Don't check CLASSTYPE_INTERFACE_ONLY ↵Jason Merrill1-2/+2
if CLASSTYPE_INTERFACE_KNOWN isn't set. * search.c (maybe_suppress_debug_info): Don't check CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set. * pt.c (mark_decl_instantiated): Do SET_DECL_EXPLICIT_INSTANTIATION here if extern_p. Remember instantiation context in deferred instantiations. * cp-tree.h (struct tinst_level): Remove. (TINST_DECL, TINST_LINE, TINST_FILE): New macros. * pt.c (current_tinst_level): Now a tree. (print_template_context, push_tinst_level, pop_tinst_level, tinst_for_decl): Adjust. (reopen_tinst_level): New fn. (init_pt): Register current_tinst_level as a root. (add_pending_template): Put current_tinst_level in TREE_PURPOSE of the pending templates list. (instantiate_pending_templates): Adjust. Call reopen_tinst_level. * lex.c (extract_interface_info): Adjust. * decl2.c (warn_if_unknown_interface): Adjust. From-SVN: r34415
2000-05-30cp-tree.h (DECL_ANTICIPATED): New macro.Zack Weinberg1-3/+13
* cp-tree.h (DECL_ANTICIPATED): New macro. Document new use of DECL_LANG_FLAG_7. * decl.c (builtin_function): Set DECL_ANTICIPATED on builtins in the user namespace. * lex.c (do_identifier): If the identifier's declaration has DECL_ANTICIPATED on, it has not yet been declared. But do not replace it with an ordinary implicit declaration. * tinfo2.cc: Include stdlib.h. From-SVN: r34267
2000-05-28cp-tree.h (ansi_opname): Make it a macro.Alex Samuel1-282/+78
2000-05-27 Alex Samuel <samuel@codesourcery.com> Mark Mitchell <mark@codesourcery.com> * cp-tree.h (ansi_opname): Make it a macro. (ansi_assopname): Likewise. (struct lang_decl_flags): Add assignment_operator_p. (struct lang_decl): Add operator_code. (DECL_VTT_PARM): Adjust. (DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an overloaded operator. (SET_OVERLOADED_OPERATOR_CODE): New macro. (DECL_ASSIGNMENT_OPERATOR_P): New macro. (DECL_ARRAY_DELETE_OPERATOR_P): Adjust. (opname_tab): Remove. (assignop_tab): Likewise. (operator_name_info_t): New type. (operator_name_info): New variable. (assignment_operator_name_info): Likewise. (build_cp_library_fn): Remove declaration. (push_cp_library_fn): Likewise. (operator_name_string): Likewise. (build_decl_overload): Likewise. * call.c (print_z_candidates): Simplify. (build_object_call): Adjust usage of ansi_opname. Use DECL_OVERLOADED_OPERATOR_P. (op_error): Adjust operator name lookup. (build_conditional_expr): Adjust usage of ansi_opname. (build_new_op): Likewise. (build_op_delete_call): Likewise. (build_over_call): Likewise. (joust): Use DECL_OVERLOADED_OPERATOR_P. * decl.c (duplicate_decls): Copy operator_code. (init_decl_processing): Adjust parameters to push_cp_library_fn. (builtin_function): Adjust parameters to build_library_fn_1. (build_library_fn_1): Accept an overloaded operator code. (build_library_fn): Pass ERROR_MARK. (build_cp_library_fn): Accept an overloaded operator code. (push_cp_library_fn): Likewise. (grokfndecl): Tweak. (grokdeclarator): Simplify code to compute names of overloaded operators. Adjust use of ansi_opname. (ambi_op_p): Work on tree_codes, not identifiers. (unary_op_p): Likewise. (grok_op_properties): Likewise. (start_function): Use DECL_OVERLOADED_OPERATOR_P. (lang_mark_tree): Don't try to mark the operator_code. * decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P. * error.c (dump_decl): Remove special handling for operator names. (dump_function_name): Likewise. (dump_expr): Adjust name lookup of operators. (op_to_string): Simplify. (assop_to_string): Likewise. * init.c (build_new_1): Adjust use of ansi_opname. * lex.c (opname_tab): Remove. (assignop_tab): Likewise. (ansi_opname): Likewise. (ansi_assopname): Likewise. (operator_name_string): Likewise. (reinit_lang_specific): Likewise. (operator_name_info): New variable. (assignment_operator_name_info): Likewise. (init_operators): New function. (init_parse): Use it. (do_identifier): Adjust use of ansi_opname. * method.c (mangle_expression): Don't use ansi_opname for mangling. (build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P. (build_decl_overload): Remove. (build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly. (do_build_assign_ref): Adjust use of ansi_opname. (synthesize_method): Likewise. (implicitly_declare_fn): Likewise. * operators.def: New file. * parse.y (operator): Adjust use of ansi_opname. * pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P. (set_mangled_name_for_template_decl): Don't play games with current_namespace. (special_function_p): Adjust use of ansi_opname. * typeck.c (check_return_expr): Likewise. * Make-lang.in (cc1plus): Depend on operators.def. * Makefile.in (lex.o): Likewise. (decl.o): Likewise. Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r34223
2000-05-14diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro.Gabriel Dos Reis1-0/+4
2000-05-13 Gabriel Dos Reis <gdr@codesourcery.com> * diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro. (DIAGNOSTICS_SHOW_PREFIX_NEVER): Likewise. (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE): Likewise. (struct output_buffer: emitted_prefix_p, prefixing_rule): New fields. (set_message_prefixing_rule): Declare. * diagnostic.c: (current_prefixing_rule): New variable. (set_message_prefixing_rule): Define. (output_set_prefix): Adjust buffer->emitted_prefix_p. (init_output_buffer): Adjust Initialization. (output_emit_prefix): Rewrite. Take prefixing rules into account. cp/ 2000-05-13 Gabriel Dos Reis <gdr@codesourcery.com> * lex.c: #include diagnostic.h. (lang_init_options): Set default prefixing rules. * lang-options.h: Add -fdiagnostics-show-location=. * decl2.c: #include diagnostic.h. (lang_decode_option): Handle -fdiagnostics-show-location=. From-SVN: r33890