aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2000-09-13* init.c (begin_init_stmts): Don't use // comments.J. David Anglin2-2/+8
From-SVN: r36399
2000-09-12decl.c (maybe_deduce_size_from_array_init): Set do_default for all ↵Jason Merrill3-13/+59
non-extern arrays. * decl.c (maybe_deduce_size_from_array_init): Set do_default for all non-extern arrays. * decl.c (grokdeclarator): Complain about 'friend T' for implicit typenames, too. Downgrade complaint to pedwarn. (xref_tag): Warn about surprising behavior of 'friend struct T'. * decl2.c (handle_class_head): Generate a TYPENAME_TYPE for 'class This::Inherited'. From-SVN: r36382
2000-09-12decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT.Mark Mitchell2-0/+6
* decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT. From-SVN: r36365
2000-09-12error.c (TFF_PLAIN_IDENTIFIER, [...]): New macros.Gabriel Dos Reis2-19/+669
* error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPDEF, TFF_DECL_SPECIFIERS, TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, TFF_SCOPE): New macros. (sorry_for_unsupported_tree, print_scope_operator, print_left_paren, print_right_paren, print_left_bracket, print_right_bracket, print_whitespace): Likewise. (aggr_variety): Rename to class_key_or_enum. (print_type): Rename to print_type_id. (print_type_specifier_seq, print_simple_type_specifier, print_elaborated_type_specifier, print_rest_of_abstract_declarator, print_parameter_declaration_clause, print_exception_specification, print_nested_name_specifier, print_template_id, typedef_original_name, print_template_argument_list_start, print_template_argument_list_end): New functions. From-SVN: r36356
2000-09-12* ir.texi: Add more documentation.Gabriel Dos Reis2-3/+163
From-SVN: r36355
2000-09-12c-common.h (genrtl_clear_out_block): Remove.Mark Mitchell10-428/+405
* c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-11* error.c (cp_tree_printer, case 'P'): Append break.Nathan Sidwell2-0/+5
From-SVN: r36318
2000-09-11cp-tree.h (frob_opname): Declare.Nathan Sidwell4-74/+133
* cp-tree.h (frob_opname): Declare. * parse.y (saved_scopes): New static variable. (cp_parse_init): Adjust. (do_id): If lastiddecl is NULL, do do_identifier. (operator): Save scope information. (unoperator): new reduction. Restore scope information. (operator_name): Append unoperator. Call frob_opname. * spew.c (frob_opname): Define. From-SVN: r36315
2000-09-11defaults.h: Provide default definitions for...Zack Weinberg4-14/+7
* defaults.h: Provide default definitions for: CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, WCHAR_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE, and WCHAR_UNSIGNED. * cppexp.c, dwarfout.c, dwarf2out.c, emit-rtl.c, final.c, optabs.c, profile.c, sdbout.c, tradcif.y, tree.c, ch/decl.c, ch/timing.c, cp/decl.c, cp/rtti.c, f/com.c, f/com.h, java/decl.c, java/expr.c: Include defaults.h if not already included. Don't define the above macros. * Makefile.in, ch/Makefile.in, cp/Makefile.in, f/Makefile.in: Update dependencies. From-SVN: r36307
2000-09-10c-common.h (add_stmt): Change prototype.Mark Mitchell8-199/+233
* c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-09-07* ir.texi: Document type nodes.Gabriel Dos Reis2-0/+41
From-SVN: r36231
2000-09-07c-common.h (prep_stmt): Declare.Mark Mitchell4-143/+78
* 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-07decl.c (initialize_local_var): Remove RTL-generating code.Mark Mitchell3-15/+16
* decl.c (initialize_local_var): Remove RTL-generating code. * semantics.c (genrtl_try_block): Fix formatting. From-SVN: r36224
2000-09-07Move statement-tree facilities from C++ to C front-end.Mark Mitchell7-330/+169
* c-common.h (c_tree_index): Add CTI_VOID_ZERO. (void_zero_node): New macro. (struct stmt_tree_s): New type. (stmt_tree): New typedef. (struct language_function): New type. (last_tree): New macro. (last_expr_type): Likewise. (walk_tree_fn): New typedef. (current_stmt_tree): New function. (begin_stmt_tree): Likewise. (add_stmt): Likewise. (finish_stmt_tree): Likewise. (statement_code_p): Likewise. (lang_statement_code_p): New variable. (walk_stmt_tree): New function. (STMT_IS_FULL_EXPR_P): New macro. * c-common.c (lang_statement_code_p): New variable. (c_common_nodes_and_builtins): Initialize void_zero_node. (statement_code_p): New function. (walk_stmt_tree): Likewise. * c-decl.c (language_function): Rename to ... (c_language_function): ... this. Include language_function. (push_c_function_context): Adjust accordingly. (pop_c_function_context): Likewise. (mark_c_function_context): Likewise. (current_stmt_tree): Define. * c-semantics.c (begin_stmt_tree): New function. (add_stmt): Likewise. (prune_unused_decls): Likewise. (finish_stmt_tree): Likewise. Move statement-tree facilities from C++ to C front-end. * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. (void_zero_node): Remove. (stmt_tree): Likewise. (scope_chain): Adjust. (language_function): Rename to cp_language_function. (cp_function_chain): Adjust. (current_stmt_tree): Remove. (last_tree): Likewise. (last_expr_type): Likewise. (struct lang_decl): Adjust. (STMT_IS_FULL_EXPR_P): Remove. (add_tree): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (walk_tree_fn): Likewise. (walk_stmt_tree): Likewise. * class.c (finish_struct): Replace use of add_tree with add_stmt. * decl.c (mark_stmt_tree): Adjust type. (init_decl_processing): Don't build void_zero_node. (initialize_local_var): Adjust usage of current_stmt_tree. (finish_enum): Use add_stmt, not add_tree. (save_function_data): Adjust use of language_function. (finish_constructor_body): Use add_stmt, not add_tree. (finish_destructor_body): Likewise. (push_cp_function_context): Adjust use of language_function. (pop_cp_function_context): Likewise. (mark_lang_function): Likewise. (mark_cp_function_context): Likewise. * init.c (build_aggr_init): Adjust use of current_stmt_tree. (build_vec_init): Likewise. * semantics.c (SET_LAST_STMT): Remove. (RECHAIN_STMTS): Don't use it. (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. (current_stmt_tree): Define. (add_tree): Remove. (finish_goto_stmt): Use add_stmt, not add_tree. (finish_expr_stmt): Likewise. (begin_if_stmt): Likewise. (finish_then_clause): Likewise. (begin_while_stmt): Likewise. (begin_do_stmt): Likewise. (finish_return_stmt): Likewise. (begin_for_stmt): Likewise. (finish_break_stmt): Likewise. (finish_continue_stmt): Likewise. (begin_switch_stmt): Likewise. (finish_case_label): Likewise. (begin_try_block): Likewise. (begin_function_try_block): Likewise. (begin_handler): Likewise. (begin_catch_block): Likewise. (begin_compound_stmt): Likewise. (begin_asm_stmt): Likewise. (finish_asm_stmt): Likewise. (finish_label_stmt): Likewise. (add_decl_stmt): Likewise. (finish_subobject): Likewise. (finish_decl_cleanup): Likewise. (finish_named_return_value): Likewise. (setup_vtbl_ptr): Likewise. (add_scope_stmt): Likewise. (finish_stmt_expr): Likewise. (prune_unused_decls): Remove. (begin_stmt_tree): Likewise. (finish_stmt_tree): Likewise. (prep_stmt): Adjust use of current_stmt_tree. (lang_expand_stmt): Likewise. * tree.c (statement_code_p): Remove. (cp_statement_code_p): New function. (walk_stmt_tree): Remove. (init_tree): Set lang_statement_code_p. From-SVN: r36221
2000-09-07Integrated preprocessor.Zack Weinberg16-4808/+1919
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-09-06extend.texi: Mark named return value extension as deprecated.Mark Mitchell5-113/+67
* extend.texi: Mark named return value extension as deprecated. * NEWS: Mention that the named return value extension has been deprecated. * cp-tree.h (original_result_rtx): Define. (TREE_REFERENCE_EXPR): Remove. (DECL_VPARENT): Likewise. (pushdecl_nonclass_level): Likewise. (store_return_init): Likewise. (reinit_lang_specific): Likewise. (genrtl_named_return_value): Change prototype. * decl.c (original_result_rtx): Remove. (cp_finish_decl): Don't build DECL_STMTs for RESULT_DECLs. Do not generate RTL for local variables here. (store_return_init): Remove. * semantics.c (genrtl_named_return_value): Simplify. Fold in store_return_init. (finish_named_return_value): Adjust accordingly. Warn that this extension is deprecated. (lang_expand_stmt): Adjust call to genrtl_named_return_value. From-SVN: r36210
2000-09-06pt.c (type_unification_real): Replace switch with if.Nathan Sidwell2-9/+11
* pt.c (type_unification_real): Replace switch with if. (unify): Tsubst non-type parms before comparing. From-SVN: r36195
2000-09-06error.c (dump_typename): New function, broken out of ...Nathan Sidwell3-5/+29
* error.c (dump_typename): New function, broken out of ... (dump_type): ... here. Use it. * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. From-SVN: r36193
2000-09-06init.c (build_offset_ref): Deal with namespace scoped TEMPLATE_ID_EXPRs.Nathan Sidwell2-15/+29
* init.c (build_offset_ref): Deal with namespace scoped TEMPLATE_ID_EXPRs. From-SVN: r36189
2000-09-06class.c (resolve_address_of_overloaded_function): Add explanation message.Nathan Sidwell5-14/+31
* class.c (resolve_address_of_overloaded_function): Add explanation message. * decl.c (define_case_label): Reformat explanation. * decl2.c (finish_static_data_member_decl): Likewise. (grokfield): Likewise. * friend.c (do_friend): Likewise. From-SVN: r36188
2000-09-06tree.c (walk_tree): Expose tail recursion.Zack Weinberg4-18/+103
* tree.c (walk_tree): Expose tail recursion. (walk_stmt_tree): New function. * cp-tree.h: Prototype walk_stmt_tree. * semantics.c (prune_unused_decls): Operate on SCOPE_STMTs not the BLOCKs directly. If a BLOCK has no variables after pruning, discard it. (finish_stmt_tree): Use walk_stmt_tree. No need to save and restore the line number. From-SVN: r36178
2000-09-05Makefile.in (CXX_TREE_H): Add dependency on HTAB_H.Mark Mitchell8-34/+103
* Makefile.in (CXX_TREE_H): Add dependency on HTAB_H. (pt.o): Remove dependency on HTAB_H. * cp-tree.h: Include hashtab.h. (walk_tree): Change prototype. (walk_tree_without_duplicates): New function. * decl.c (check_default_argument): Use it. * optimize.c (remap_decl): Adjust calls to walk_tree. (copy_body): Likewise. (expand_calls_inline): Likewise. (calls_setjmp_p): Use walk_tree_without_duplicates. * pt.c: Don't include hashtab.h. (for_each_template_parm): Use walk_tree_without_duplicates. * semantics.c (finish-stmt_tree): Likewise. (expand_body): Likewise. * tree.c (walk_tree): Add additional parameter. (walk_tree_without_duplicates): New function. (count_trees): Use it. (verify_stmt_tree): Adjust call to walk_tree. (find_tree): Use walk_tree_without_duplicates. (no_linkage_check): Likewise. (break_out_target_exprs): Adjust call to walk_tree. (cp_unsave): Likewise. From-SVN: r36155
2000-09-04tweakJason Merrill1-0/+1
From-SVN: r36152
2000-09-04cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code.Kriang Lerdsuwanakij16-156/+227
* cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. (TEMPLATE_TEMPLATE_PARM): Adjust comment. * cp-tree.h (TYPE_BINFO): Adjust comment. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. (TEMPLATE_TYPE_PARM_INDEX): Likewise. (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. (TYPE_TEMPLATE_INFO): Likewise. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise. * class.c (push_nested_class): Likewise. * decl.c (lookup_name_real): Likewise. (grokdeclarator): Likewise. (grok_op_properties): Likewise. (xref_tag): Likewise. (xref_basetypes): Likewise. * decl2.c (constructor_name_full): Likewise. (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case. (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case. (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM. (dump_type_suffix): Likewise. * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. (get_aggr_from_typedef): Likewise. * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case. (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM. (write_template_parm): Likewise. (write_template_template_parm): Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. * method.c (build_overload_nested_name): Add BOUND_TEMPLATE_TEMPLATE_PARM. (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case. * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM. * pt.c (convert_template_argument): Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case. (for_each_template_parm): Adjust comment. (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM. (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. Use template_args_equal to compare template template parameter cases. * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM. * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. * tree.c (copy_template_template_parm): Decide whether to create a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node. (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM. (copy_tree_r): Likewise. * typeck.c (comptypes): Likewise. Check tree code instead of using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. From-SVN: r36149
2000-09-04decl.c (finish_function): Move the code for handling functions marked with ↵Mark Elbrecht2-8/+21
the constructor and destructor... * decl.c (finish_function): Move the code for handling functions marked with the constructor and destructor attributes inside the expand_p block. From-SVN: r36147
2000-09-04* init.c (resolve_offset_ref): Deal with TEMPLATE_ID_EXPR.Nathan Sidwell2-2/+6
From-SVN: r36136
2000-09-04pt.c (lookup_template_class): Remove abort.Nathan Sidwell3-3/+8
* pt.c (lookup_template_class): Remove abort. * tree.c (get_type_decl): Allow error_mark_node. From-SVN: r36134
2000-09-04decl2.c (arg_assoc): Deal with COMPONENT_REFs inside TEMPLATE_ID_EXPRs.Nathan Sidwell2-0/+8
* decl2.c (arg_assoc): Deal with COMPONENT_REFs inside TEMPLATE_ID_EXPRs. From-SVN: r36132
2000-09-04operators.def (ALIGNOF_EXPR, [...]): Change new ABI mangling.Mark Mitchell2-3/+8
* operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Change new ABI mangling. From-SVN: r36125
2000-09-01parse.y (named_class_head): Check for TYPENAME_TYPE.Nathan Sidwell2-12/+23
* parse.y (named_class_head): Check for TYPENAME_TYPE. Simplify union tag mismatch error reporting. From-SVN: r36096
2000-09-01* call.c (build_scoped_method_call): Check it is not a namespace.Nathan Sidwell2-0/+9
From-SVN: r36094
2000-08-30cp-tree.h (LOCAL_CLASS_P): Use decl_function_context.Jason Merrill4-17/+24
* cp-tree.h (LOCAL_CLASS_P): Use decl_function_context. * tree.c (bot_manip): Check TREE_CONSTANT rather than !TREE_SIDE_EFFECTS. Call break_out_target_exprs and build_target_expr_with_type for the non-AGGR_INIT_EXPR case. * decl.c (start_function): Always call make_function_rtl. From-SVN: r36080
2000-08-30typosJason Merrill2-3/+3
From-SVN: r36062
2000-08-29semantics.c (prune_unused_decls): New function.Zack Weinberg2-0/+64
* cp/semantics.c (prune_unused_decls): New function. (finish_stmt_tree): Call it via walk_tree. From-SVN: r36056
2000-08-29top level:Zack Weinberg6-8/+23
* c-common.c (declare_function_name): Use func_id_node, function_id_node, and pretty_function_id_node. Do not make __func__ visible at file scope. * c-common.h (c_tree_index): Add CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, and CTI_FUNC_ID. (function_id_node, pretty_function_id_node, func_id_node): New macros. * c-decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. (c_make_fname_decl): Correct comment. * tree.h (struct tree_identifier): Constify pointer member. * c-decl.c (pushdecl, implicit_decl_warning): Constify a char *. * c-pragma.h (struct weak_syms): Constify name and value members. (add_weak): Constify arguments. * calls.c (special_function_p): Constify a char *. (expand_call): Remove variable which is initialized and then never used. * dependence.c (struct def_use, struct induction, struct subscript): Constify 'variable' member. (get_low_bound, have_induction_variable): Constify char * argument. (find_induction_variable): Add braces to avoid dangling else. (classify_dependence): Constify char * arrays. * profile.c (output_func_start_profiler): Constify a char *. * stor-layout.c (finalize_record_size): Constify a char *. * tree.c (is_attribute_p): Constify a char *. * varasm.c (add_weak, remove_from_pending_weak_list): Constify argument. * varasm.c (make_function_rtl, make_decl_rtl): Rearrange code for comprehensibility. Do not call get_identifier if we did not change the DECL_ASSEMBLER_NAME of the decl. Use alloca to create temporary string constants, not ggc_alloc_string. No need to copy result of ASM_FORMAT_PRIVATE_NAME. Use const char * to hold IDENTIFIER_POINTERs. ch: * inout.c (add_enum_to_list): Use DECL_NAME directly, don't get its IDENTIFIER_POINTER and immediately call get_identifier on it. * lex.c (yywrap): Constify a char *. cp: * class.c (build_secondary_vtable): Constify a char *. * decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. * input.c (struct input_source): Constify 'str'. (feed_input): Constify first argument. * mangle.c (write_identifier): Constify argument. * pt.c (mangle_class_name_for_template): Constify argument. f: * ansify.c: Use #line, not # <number>. java: * jcf-parse.c (set_source_filename): Constify a char *. * jcf-write.c (append_innerclasses_attribute, make_class_file_name): Constify a char *. Don't recycle a variable for an unrelated purpose. * parse.y: (build_alias_initializer_parameter_list): Constify a char *. (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings. From-SVN: r36055
2000-08-29calls.c (expand_call): Don't create a VAR_DECL just to throw it away.Mark Mitchell2-15/+5
* calls.c (expand_call): Don't create a VAR_DECL just to throw it away. * expr.c (expand_expr, case TARGET_EXPR): Don't call mark_addressable. * tree.h (get_file_function_name): Remove two duplicate declarations. * typeck.c (mark_addressable): Remove code that pokes around in RTL. From-SVN: r36038
2000-08-28[multiple changes]Jason Merrill4-16/+13
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-28mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo.Alex Samuel2-56/+93
* mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo. (write_encoding): Pass another argument to write_name. (write_name): Add ignore_local_scope parameter. Fix handling of local names. (write_nested_name): Use write_unqualified_name. (write_prefix): Likewise. Skip out on FUNCTION_DECLs. (write_template_prefix): Use write_unqualified_name. (write_component): Remove. (write_local_name): Add parameter. Use direct local entity to discriminator calculation. (write_class_enum_type): Pass another argument to write_name. (write_template_template_arg): Likewise. (make_guard_variable): Likewise. From-SVN: r36013
2000-08-27decl.c (pushdecl): Matching decls for local externs are found in the current ↵Jason Merrill2-9/+44
level. * decl.c (pushdecl): Matching decls for local externs are found in the current level. Propagate linkage information from previous declarations. From-SVN: r36011
2000-08-26* ir.texi (Expressions): Fix typo.Gabriel Dos Reis2-2/+6
From-SVN: r35998
2000-08-25* tree.c (init_tree): Use ARRAY_SIZE.Greg McGary2-1/+5
From-SVN: r35989
2000-08-25* error.c (cp_tree_printer): Rework.Gabriel Dos Reis2-33/+44
From-SVN: r35981
2000-08-25Make-lang.in (CXX_LIB2FUNCS): Remove cp-demangle.o and dyn-string.o.Mark Mitchell2-13/+8
* Make-lang.in (CXX_LIB2FUNCS): Remove cp-demangle.o and dyn-string.o. (CXX_LIB2SRCS): Remove cp-demangle.c and dyn-string.c. (cp-demangle.o): Remove target. (dyn-string.o): Likewise. From-SVN: r35974
2000-08-25decl.c (grokfndecl): Require that `main' return an `int'.Mark Mitchell3-1/+11
* decl.c (grokfndecl): Require that `main' return an `int'. * mangle.c (write_encoding): Don't mangle return types for conversion functions. From-SVN: r35972
2000-08-24error.c (tree_formatting_info): New data type.Gabriel Dos Reis2-2/+202
* error.c (tree_formatting_info): New data type. (tree_being_formatted): New macro. (tree_formatting_flags): Likewise. (put_whitespace): Likewise. (print_tree_identifier): Likewise. (print_identifier): Likewise. (cp_tree_printer, print_function_argument_list, print_declaration, print_expression, print_function_declaration, print_function_parameter, print_type, print_cv_qualifier): New functions. (init_error): Initialize lang_printer. From-SVN: r35965
2000-08-24typeck.c (build_ptrmemfunc): Just reinterpret if there's no adjustment ↵Jason Merrill2-8/+16
necessary. * typeck.c (build_ptrmemfunc): Just reinterpret if there's no adjustment necessary. From-SVN: r35954
2000-08-24* cp-tree.h (MAIN_NAME_P): Remove macro.Greg McGary2-10/+4
From-SVN: r35946
2000-08-24diagnostic.c (finish_diagnostic): Define.Gabriel Dos Reis2-0/+6
* diagnostic.c (finish_diagnostic): Define. (output_do_printf): Use wrap_text instead of output_add_string. (default_print_error_function): Avoid embedded '\n'. * diagnostic.h (flush_diagnostic_buffer): Declare. cp/ * error.c (print_instantiation_context): Don't forget to flush the buffer. From-SVN: r35939
2000-08-23typeck.c (build_ptrmemfunc): Save the input pmf.Jason Merrill3-2/+11
* typeck.c (build_ptrmemfunc): Save the input pmf. * method.c (process_modifiers): Use same_type_p. From-SVN: r35930
2000-08-23cp-tree.h (DECL_CLONED_FUNCTION_P): Check DECL_LANG_SPECIFIC.Mark Mitchell4-10/+31
* cp-tree.h (DECL_CLONED_FUNCTION_P): Check DECL_LANG_SPECIFIC. * mangle.c (write_function_type): Change prototype. (write_encoding): Don't mangle return types for constructors or destructors. (write_type): Adjust call to write_function_type. * pt.c (instantiate_template): Instantiate alternate entry points when instantiating the main function. From-SVN: r35916