aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.h
AgeCommit message (Collapse)AuthorFilesLines
2024-01-03Update copyright years.Jakub Jelinek1-1/+1
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-09-01C-family: Add attribute 'unavailable'.Iain Sandoe1-1/+2
If an interface is marked 'deprecated' then, presumably, at some point it will be withdrawn and no longer available. The 'unavailable' attribute makes it possible to mark up interfaces to indicate this status. It is used quite extensively in some codebases where a single set of headers can be used to permit code generation for multiple system versions. From a configuration perspective, it also allows a compile test to determine that an interface is missing - rather than requiring a link test. The implementation follows the pattern of attribute deprecated, but produces an error (where deprecation produces a warning). This attribute has been implemented in clang for some years. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/c-family/ChangeLog: * c-attribs.c (handle_unavailable_attribute): New. gcc/c/ChangeLog: * c-decl.c (enum deprecated_states): Add unavailable state. (merge_decls): Copy unavailability. (quals_from_declspecs): Handle unavailable case. (start_decl): Amend the logic handling suppression of nested deprecation states to include unavailability. (smallest_type_quals_location): Amend comment. (grokdeclarator): Handle the unavailable deprecation state. (declspecs_add_type): Set TREE_UNAVAILABLE from the decl specs. * c-tree.h (struct c_declspecs): Add unavailable_p. * c-typeck.c (build_component_ref): Handle unavailability. (build_external_ref): Likewise. gcc/cp/ChangeLog: * call.c (build_over_call): Handle unavailable state in addition to deprecation. * class.c (type_build_ctor_call): Likewise. (type_build_dtor_call): Likewise. * cp-tree.h: Rename cp_warn_deprecated_use to cp_handle_deprecated_or_unavailable. * decl.c (duplicate_decls): Merge unavailability. (grokdeclarator): Handle unavailability in addition to deprecation. (type_is_unavailable): New. (grokparms): Handle unavailability in addition to deprecation. * decl.h (enum deprecated_states): Add UNAVAILABLE_DEPRECATED_SUPPRESS. * decl2.c (cplus_decl_attributes): Propagate unavailability to templates. (cp_warn_deprecated_use): Rename to ... (cp_handle_deprecated_or_unavailable): ... this and amend to handle the unavailable case. It remains a warning in the case of deprecation but becomes an error in the case of unavailability. (cp_warn_deprecated_use_scopes): Handle unavailability. (mark_used): Likewise. * parser.c (cp_parser_template_name): Likewise. (cp_parser_template_argument): Likewise. (cp_parser_parameter_declaration_list): Likewise. * typeck.c (build_class_member_access_expr): Likewise. (finish_class_member_access_expr): Likewise. * typeck2.c (build_functional_cast_1): Likewise. gcc/ChangeLog: * doc/extend.texi: Document unavailable attribute. * print-tree.c (print_node): Handle unavailable attribute. * tree-core.h (struct tree_base): Add a bit to carry unavailability. * tree.c (error_unavailable_use): New. * tree.h (TREE_UNAVAILABLE): New. (error_unavailable_use): New. gcc/objc/ChangeLog: * objc-act.c (objc_add_property_declaration): Register unavailable attribute. (maybe_make_artificial_property_decl): Set available. (objc_maybe_build_component_ref): Generalise to the method prototype to count availability. (objc_build_class_component_ref): Likewise. (build_private_template): Likewise. (objc_decl_method_attributes): Handle unavailable attribute. (lookup_method_in_hash_lists): Amend comments. (objc_finish_message_expr): Handle unavailability in addition to deprecation. (start_class): Likewise. (finish_class): Likewise. (lookup_protocol): Likewise. (objc_declare_protocol): Likewise. (start_protocol): Register unavailable attribute. (really_start_method): Likewise. (objc_gimplify_property_ref): Emit error on encountering an unavailable entity (and a warning for a deprecated one). gcc/testsuite/ChangeLog: * g++.dg/ext/attr-unavailable-1.C: New test. * g++.dg/ext/attr-unavailable-2.C: New test. * g++.dg/ext/attr-unavailable-3.C: New test. * g++.dg/ext/attr-unavailable-4.C: New test. * g++.dg/ext/attr-unavailable-5.C: New test. * g++.dg/ext/attr-unavailable-6.C: New test. * g++.dg/ext/attr-unavailable-7.C: New test. * g++.dg/ext/attr-unavailable-8.C: New test. * g++.dg/ext/attr-unavailable-9.C: New test. * gcc.dg/attr-unavailable-1.c: New test. * gcc.dg/attr-unavailable-2.c: New test. * gcc.dg/attr-unavailable-3.c: New test. * gcc.dg/attr-unavailable-4.c: New test. * gcc.dg/attr-unavailable-5.c: New test. * gcc.dg/attr-unavailable-6.c: New test. * obj-c++.dg/attributes/method-unavailable-1.mm: New test. * obj-c++.dg/attributes/method-unavailable-2.mm: New test. * obj-c++.dg/attributes/method-unavailable-3.mm: New test. * obj-c++.dg/property/at-property-unavailable-1.mm: New test. * obj-c++.dg/property/at-property-unavailable-2.mm: New test. * obj-c++.dg/property/dotsyntax-unavailable-1.mm: New test. * objc.dg/attributes/method-unavailable-1.m: New test. * objc.dg/attributes/method-unavailable-2.m: New test. * objc.dg/attributes/method-unavailable-3.m: New test. * objc.dg/property/at-property-unavailable-1.m: New test. * objc.dg/property/at-property-unavailable-2.m: New test. * objc.dg/property/dotsyntax-unavailable-1.m: New test.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-04-15[libcp1] handle anon aggregates linkage-named by typedefsAlexandre Oliva1-0/+1
Arrange for the first typedef to an anonymous type in the same context to be used as the linkage name for the type. for gcc/cp/ChangeLog * decl.c (name_unnamed_type): Split out of... (grokdeclarator): ... this. * decl.h (name_unnamed_type): Declare. for libcc1/ChangeLog * libcp1plugin.cc (plugin_build_decl): Call name_unnamed_type. From-SVN: r246938
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-01-02Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r206289
2013-01-10Update copyright years in gcc/Richard Sandiford1-2/+1
From-SVN: r195098
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek1-1/+1
From-SVN: r194903
2012-10-08Partial implementation of C++11 thread_local.Jason Merrill1-1/+1
c-family/ * c-common.c (c_common_reswords): Add thread_local. cp/ * decl.c (cp_finish_decl): Remove errors about non-trivial initialization and destruction of TLS variables. (register_dtor_fn): Add sorry about TLS variables. (expand_static_init): Add sorry about non-local TLS variables, or error with __thread. Don't emit thread-safety guards for local TLS variables. (grokdeclarator): thread_local in a function implies static. * decl.h: Adjust prototype. * decl2.c (get_guard): Copy DECL_TLS_MODEL. * parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type) (set_and_check_decl_spec_loc): Take the token rather than the location. Distinguish between __thread and thread_local. (cp_parser_set_storage_class): Don't complain about thread_local before extern/static. (token_is__thread): New. * call.c (make_temporary_var_for_ref_to_temp): Handle TLS. * cp-tree.h (DECL_GNU_TLS_P): New. (cp_decl_specifier_seq): Add gnu_thread_keyword_p. From-SVN: r192209
2009-11-16re PR c++/32056 (Storage classes on template parameters)Paolo Carlini1-0/+1
cp/ 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com> PR c++/32056 * decl.h (enum decl_context): Add TPARM enumerator. * decl.c (grokdeclarator): Per 14.1/2, error out if a storage class is specified in a template parameter declaration. * parser.c (cp_parser_template_parameter): Call grokdeclarator with TPARM as third argument. testsuite/ 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com> PR c++/32056 * testsuite/g++.dg/template/error44.C: New. From-SVN: r154198
2009-03-31re PR c++/37806 (CV-qualifiers on function typedef's are inconsistently ↵Jason Merrill1-0/+1
accepted depending on typedef scope) PR c++/37806 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals to a typedef. * tree.c (cp_build_qualified_type_real): Don't apply restrict to a function type. * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG. * decl.c (groktypename): Add is_template_arg parameter. (grokdeclarator): Allow function cv-quals on a template type arg. * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add is_template_arg argument in calls to groktypename. * cp-tree.h: Adjust prototype. * error.c (dump_type_prefix, dump_type_suffix): Fix plain FUNCTION_TYPE printing. PR libstdc++/39310 * include/tr1_impl/type_traits (is_function): Add partial specializations with function cv-quals. (__is_function_helper): Remove. (is_member_pointer): Don't define in terms of is_member_*_pointer. From-SVN: r145365
2009-02-20Update Copyright years for files modified in 2008 and/or 2009.Jakub Jelinek1-1/+1
From-SVN: r144324
2008-09-08re PR c++/37302 (function parameters are declared too late)Jason Merrill1-0/+13
PR c++/37302 * parser.c (cp_parser_parameter_declaration_list): Process the PARM_DECLs as we go and push them. Return a TREE_LIST. (cp_parser_parameter_declaration_clause): Return a TREE_LIST. (cp_parser_direct_declarator): Create a binding level and suppress deprecated warnings in the parameter list. (make_call_declarator): PARMS is now a tree. * cp-tree.h (struct cp_declarator): Function parms are now a tree. * decl.h (enum deprecated_states, deprecated_state): Move here. * decl.c: From here. (type_is_deprecated): New fn. (grokparms): PARMLIST is a tree now. Warn about parms that use deprecated types. * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and 0-operand cast. * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation. (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a function. * name-lookup.c (pushtag): Look through function parameter scopes. (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL when we're parsing a function declarator. From-SVN: r140120
2007-08-02typeck.c: Change copyright header to refer to version 3 of the GNU General ↵Nick Clifton1-5/+5
Public... * typeck.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in, cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c, operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c, name-lookup.h, parser.c: Likewise. From-SVN: r127154
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101312
2005-06-14Remove extra white spacing at end of lines.Mike Stump1-2/+2
From-SVN: r100952
2005-02-08cxx-pretty-print.c, [...]: Update copyright.Kazu Hirata1-1/+1
* cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update copyright. From-SVN: r94736
2005-01-25* decl.h (debug_bindings_indentation): Remove.Volker Reichelt1-5/+0
From-SVN: r94208
2004-07-13re PR c++/16518 (mutable specifier only applies to first item in declaration ↵Mark Mitchell1-1/+1
list) PR c++/16518 PR c++/16337 * decl.c (grokvardecl): Make declspecs parameter const. (grokdeclarator): Likewise. Adjust accordingly. * decl.h (grokdeclarator): Adjust declaration. * parser.c (cp_parser_init_declarator): Do not clear decl_specifiers->attributes. PR c++/16518 * g++.dg/parse/mutable1.C: New test. From-SVN: r84646
2004-06-24Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.Mark Mitchell1-1/+3
* Make-lang.in (cp/lex.o): Do not depend on cp/lex.h. (cp/decl.o): Likewise. (cp/decl2.o): Likewise. (cp/pt.o): Likewise. (cp/semantics.o): Likewise. * config-lang.in (gtfiles): Do not reference cp/lex.h. * class.c: Do not include lex.h. (add_implicitly_declared_members): Do not use adding_implicit_members. (check_bases_and_members): Do not talk about grok_x_components. * cp/cp-tree.h (adding_implicit_members): Remove. (cp_storage_class): New type. (cp_decl_spec): Likewise. (cp_decl_specifier_seq): Likewise. (cp_parameter_declarator): Use it for the decl_specifiers field. (check_tag_decl): Adjust prototype. (shadow_tag): Likewise. (groktypename): Likewise. (start_decl): Likewise. (start_function): Likewise. (start_method): Likewise. (grok_x_components): Remove. (grokfield): Adjust prototype. (grokbitfield): Likewise. (finish_member_class_template): Remove. * decl.c: Do not include lex.h. (adding_implicit_members): Do not define. (check_tag_decl): Do not use trees to represent decl-specifiers. (shadow_tag): Likewise. (groktypename): Likewise. (start_decl): Likewise. (grokvardecl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (start_function): Likewise. (start_method): Likewise. * decl.h (grokdeclarator): Adjust prototype. * decl2.c: Do not include lex.h. (grok_x_components): Remove. (grokfield): Do not use trees to represent decl-specifiers. (grokbitfield): Likewise. * lex.c: Do not include lex.h. * lex.h: Remove. * parser.c: Include target.h. (clear_decl_specs): New function. (cp_parser_translation_unit): Do not use trees to represent decl-specifiers. (cp_parser_postfix_expression): Likewise. (cp_parser_new_type_id): Likewise. (cp_parser_condition): Likewise. (cp_parser_simple_declaration): Likewise. (cp_parser_decl_specifier_seq): Likewise. (cp_parser_function_specifier_opt): Likewise. (cp_parser_conversion_type_id): Likewise. (cp_parser_template_parameter): Likewise. (cp_parser_explicit_instantiation): Likewise. (cp_parser_type_specifier): Likewise. (cp_parser_simple_type_specifier): Likewise. (cp_parser_init_declarator): Likewise. (cp_parser_type_id): Likewise. (cp_parser_type_specifier_seq): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_member_declaration): Likewise. (cp_parser_exception_declaration): Likewise. (cp_parser_function_definition_from_specifiers_and_declarator): Likewise. (cp_parser_single_declaration): Likewise. (cp_parser_save_member_function_body): Likewise. (cp_parser_friend_p): Likewise. (cp_parser_set_storage_class): New function. (cp_parser_set_decl_spec_type): Likewise. * pt.c: Do not include lex.h. * semantics.c: Likewise. (finish_member_class_template): Remove. From-SVN: r83584
2004-06-22cp-tree.def (NEW_EXPR): Add a fourth slot.Mark Mitchell1-1/+1
* cp-tree.def (NEW_EXPR): Add a fourth slot. * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove. (TREE_PARMLIST): Likewise. (CALL_DECLARATOR_PARMS): Likewise. (CALL_DECLARATOR_QUALS): Likewise. (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. (cp_declarator_kind): New type. (cp_parameter_declarator): Likewise. (cp_declarator): Likewise. (cp_error_declarator): Likewise. (no_parameters): Likewise. (groktypename): Change prototype. (start_decl): Likewise. (start_handler_parms): Likewise. (get_scope_of_declarator): Likewise. (start_function): Likewise. (start_preparsed_function): New function. (start_function): Change prototype. (start_method): Likewise. (grokfield): Likewise. (grokbitfield): Likewise. (build_new): Likewise. (make_pointer_declarator): Remove. (make_reference_declarator): Likewise. (make_call_declarator): Likewise. (set_quals_and_spec): Likewise. (process_template_parm): Change prototype. (begin_function_definition): Remove. (finish_parmlist): Remove. * decl.c (groktypename): Do not use trees to represent declarators. (start_decl): Likewise. (start_handler_parms): Remove. (get_scope_of_declarator): Reimplement. (grokdeclarator): Do not use trees to represent declarators. (grokparms): Likewise. (start_function): Likewise. (start_method): Likewise. (build_void_list_mode): Do not use TREE_PARMLIST. * decl.h (grokdeclarator): Change prototype. * decl2.c (grok_method_quals): Robustify. (grok_x_components): Do not use trees to represent declarators. (grokfield): Likewise. (grokbitfield): Likewise. (start_objects): Build FUNCTION_DECLs, not declarators. (start_static_storage_duration_function): Likewise. * init.c (build_new): Simplify. * lex.c (make_pointer_declarator): Remove. (make_reference_declarator): Likewise. (make_call_declarator): Likewise. (set_quals_and_spec): Likewise. * method.c (use_thunk): Use start_preparsed_function. (synthesize_method): Likewise. (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators. * optimize.c (maybe_clone_body): Use start_preparsed_function. * parser.c (cp_error_declarator): New variable. (declarator_obstack): Likewise. (alloc_declarator): New function. (make_declarator): Likewise. (make_id_declarator): Likewise. (make_pointer_declarator): Likewise. (make_reference_declarator): Likewise. (make_ptrmem_declarator): Likewise. (make_call_declarator): Likewise. (make_array_declarator): Likewise. (no_parameters): New variable. (make_parameter_declarator): Likewise. (cp_parser_check_for_definition_in_return_type): Do not use trees to represent declarators. (cp_parser_translation_unit): Likewise. (cp_parser_new_expression): Likewise. (cp_parser_new_type_id): Likewise. (cp_parser_new_declarator_opt): Likewise. (cp_parser_direct_new_declarator): Likewise. (cp_parser_condition): Likewise. (cp_parser_declaration_statement): Likewise. (cp_parser_declaration): Likewise. (cp_parser_conversion_type_id): Likewise. (cp_parser_conversion_declarator_opt): Likewise. (cp_parser_template_parameter_list): Likewise. (cp_parser_template_parameter): Likewise. (cp_parser_explicit_instantiation): Likewise. (cp_parser_init_declarator): Likewise. (cp_parser_declarator): Likewise. (cp_parser_direct_declarator): Likewise. (cp_parser_type_id): Likewise. (cp_parser_parameter_declaration_clause): Likewise. (cp_parser_parameter_declaration_list): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_member_declaration): Likewise. (cp_parser_exception_declaration): Likewise. (cp_parser_check_declarator_template_parameters): Likewise. (cp_parser_function_definition_from_specifiers_and_declarator): Likewise. (cp_parser_save_member_function_body): Likewise. * pt.c (process_template_parm): Add is_non_type parameter. (convert_template_argument): Adjust call to groktypename. (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST. (tsubst): Do not expect declarators. (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional argument. (instantiate_decl): Use start_preparsed_function. * semantics.c (begin_function_definition): Remove. (finish_parmlist): Remove. * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not declarators. From-SVN: r83482
2004-03-24dwarf2asm.c, [...]: Update copyright.Kazu Hirata1-1/+1
gcc/ * dwarf2asm.c, loop.h, pretty-print.c, pretty-print.h, config/i386/mmintrin.h: Update copyright. cp/ * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c: Update copyright. From-SVN: r79938
2004-03-20call.c (build_op_delete_call): Do not forget the placement arguments when ↵Mark Mitchell1-4/+0
iterating through mutiple delete... * call.c (build_op_delete_call): Do not forget the placement arguments when iterating through mutiple delete operators. * cp-tree.h (svaed_scope): Remove last_parms. (NEW_DELETE_OPNAME_P): New macro. (last_function_parms): Remove. (do_friend): Adjust prototype. * decl.c (grokparms): Return the PARM_DECLs directly, rather than using last_function_parms. (grokfndecl): Take the PARM_DECLs as an argument, rather than using last_function_parms. (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs for class-specific operator new and operator delete. (grok_op_properties): Do not look for allocation functions with METHOD_TYPEs. (start_function): Use DECL_ARGUMENTS instead of last_function_parms. * decl.h (last_function_parms): Do not declare. * decl2.c (grokclassfn): Do not use last_function_parms. * friend.c (do_friend): Remove parmdecls parameter. * name-lookup.c (push_to_top_level): Do not save last_function_parms. (pop_from_top_level): Do not restore it. * pt.c (check_explicit_specialization): Do not adjust last_function_parms. * name-lookup.c (do_local_using_decl): Create a local binding for types brought in via using declarations. * name-lookup.c (lookup_arg_dependent): Handle block-scope function declarations correctly. * semantics.c (finish_id_expression): Correct handling of conversion operators to dependent types. * typeck.c (lookup_destructor): Allow the use of destructors from base classes. * g++.dg/init/placement3.C: New test. * g++.dg/template/spec13.C: New test. * g++.dg/lookup/using11.C: New test. * g++.dg/lookup/koenig3.C: New test. * g++.dg/template/operator2.C: New test. * g++.dg/expr/dtor3.C: New test. * g++.old-deja/g++.brendan/crash15.C: Remove incorrect dg-error marker. * g++.old-deja/g++.law/visibility28.C: Likewise. From-SVN: r79722
2003-06-20re PR middle-end/11041 (ICE: const myclass &x = *x; (when operator*() defined))Mark Mitchell1-6/+0
PR c++/11041 * call.c (initialize_reference): Do not use cp_finish_decl to emit temporary variables. * cp-tree.h (static_aggregates): Declare. (pushdecl_top_level_and_finish): Likewise. * decl.c (pushdecl_top_level_1): New function. (pushdecl_top_level): Use it. (pushdecl_top_level_and_finish): New function. (initialize_local_var): Remove redundant code. (cp_finish_decl): Remove support for RESULT_DECLs. Don't check building_stmt_tree. * decl.h (static_aggregates): Remove. * decl2.c (get_guard): Use pushdecl_top_level_and_finish. * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish. (tinfo_base_init): Likewise. PR c++/11041 * g++.dg/init/ref7.C: New test. From-SVN: r68236
2003-01-23* cp-tree.h, decl.h: Get rid of PARAMS. Again.Nathanael Nerode1-2/+1
From-SVN: r61669
2002-12-30decl.c, [...]: GCC, not GNU CC.Nathanael Nerode1-4/+4
* decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front end, not the C front end. From-SVN: r60636
2002-06-04Merge from pch-branch up to tag pch-commit-20020603.Geoffrey Keating1-2/+2
From-SVN: r54232
2002-01-09* decl.h (grokdeclarator): Wrap long line.Graham Stott1-2/+3
From-SVN: r48675
2001-09-21Table-driven attributes.Joseph Myers1-1/+1
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2000-01-26call.c: PROTO -> PARAMS.Kaveh R. Ghazi1-2/+2
* call.c: PROTO -> PARAMS. * class.c: Likewise. * cp-tree.h: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl.h: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * errfn.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * init.c: Likewise. * input.c: Likewise. * lex.c: Likewise. * lex.h: Likewise. * method.c: Likewise. * optimize.c: Likewise. * parse.y: Likewise. * pt.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * spew.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. * xref.c: Likewise. From-SVN: r31632
1999-09-06Get ready for garbage collection.Mark Mitchell1-5/+0
* Makefile.in (CXX_TREE_H): Add varray.h (lex.o): Depend on ggc.h. (decl.o): Likewise. (decl2.o): Likewise. (method.o): Likewise. (search.o): Likewise. (pt.o): Likewise. (repo.o): Likewise. * class.c: Include ggc.h. (current_class_name): Remove. (current_class_type): Likewise. (current_access_specifier): Likewise. (previous_class_type): Likewise. (previous_class_values): Likewise. (class_cache_firstobj): Likewise. (current_lang_base): Likewise. (current_lang_stack): Likewise. (current_lang_stacksize): Likewise. (lang_name_c): Likewise. (lang_name_cplusplus): Likewise. (lang_name_java): Likewise. (current_lang_name): Likewise. (base_layout_decl): Likewise. (access_default_node): Likewise. (access_public_node): Likewise. (access_protected_node): Likewise. (access_private_node): Likewise. (access_default_virtual_node): Likewise. (access_public_virtual_node): Likewise. (access_protected_virtual_node): Likewise. (access_private_virtual_node): Likewise. (signed_zero_node): Likewise. (init_class_processing): Don't build base_layout_decl. (push_lang_context): Adjust now that current_lang_base is a varray. (pop_lang_context): Likewise. * cp-tree.h: Include varray.h. (cp_global_trees): Add access_default, access_public, access_protected, access_private, access_default_virtual, access_public_virtual, access_protected_virtual, access_private_virtual, ctor_identifier, delta2_identifier, delta_identifier, dtor_identifier, in_charge_identifier, index_identifier, nelts_identifier, this_identifier, pfn_identifier, pfn_or_delta2_identifier, vptr_identifier, lang_name_c, lang_name_cplusplus, lang_name_java, empty_except_spec, null, jclass, minus_one, terminate. (saved_scope): Move here from decl.c. Define globals in terms of saved_scope: current_namespace, current_class_name, current_class_type, current_access_specifier, current_lang_stack, current_lang_base, current_lang_name, current_function_parms, current_template_parms, processing_template_decl, processing_specialization, processing_explicit_instantiation, previous_class_type, previous_class_values, class_cache_firstobj. (scope_chain): New variable. (init_pt): New function. * decl.c (current_namespace): Remove. (this_identifier, in_charge_identifier, ctor_identifier): Likewise. (dtor_identifier, pfn_identifier, index_identifier): Likewise. (delta_identifier, delta2_identifier): Likewise. (pfn_or_delta2_identifier, tag_identifier): Likewise (vt_off_identifier, empty_except_spec, null_node): Likewise. (current_function_parms, current_lang_base): Remove. (current_lang_stack, previous_class_values): Remove. (class_binding_level): Macroize. (saved_scope): Remove. (current_saved_scope): Rename to scope_chain. (mark_saved_scope): Adjust for new scope structure. (maybe_push_to_top_level): Likewise. (pop_from_top_level): Likewise. (duplicate_decls): Adjust now that current_lang_base is a varray. (build_typename_type): Call ggc_add_tree_hash_table_root. (init_decl_processing): Call init_pt. Call push_to_top_level to set up globals. Add GC roots. (xref_basetypes): Adjust now that current_lang_base is a varray. * decl.h (this_identifier): Remove. (in_charge_identifier): Likewise. * decl2.c: Don't include varray.h. (current_namespace): Remove. (init_decl2): Add GC roots. * except.c (Terminate): Remove. (init_exception_processing): Use terminate_node instead. (build_terminate_handler): Likewise. * init.c (nc_nelts_field_id): Remove. (minus_one): Likewise. (init_init_processing): Use minus_one_node and nelts_identifier instead. Add GC roots. (jclass_node): Remove. (build_new_1): Use nelts_identifier. (build_vec_init): Likewise. (build_vec_delete): Likewise. * lex.c: Include ggc.h. (defarg_fn): Move declaration early. (defarg_parms): Likewise. (init_parse): Add GC roots. (handle_cp_pragma): Remove redundant declaration of pending_vtables. * method.c: Include ggc.h. (btypelist): Make it a varray. All uses changed. (ktypelist): Likewise. (init_method): Add GC roots. * pt.c: Don't include varray.h. Include ggc.h. (current_template_parms): Remove. (processing_template_decl): Likewise. (processing_specialization): Likewise. (processing_explicit_instantiation): Likewise. (init_pt): New function. * repo.c: Include ggc.h. (init_repo): Add GC roots. * search.c: Don't include varray.h. (_vptr_name): Remove. (lookup_field_1): Use vtpr_identifier instead. (expand_indirect_vtbls_init): Remove redundant declaration of in_charge_identifier. (init_search_processing): Use vptr_identifier. From-SVN: r29135
1999-04-22cp-tree.h (lang_decl_flags): Remove returns_first_arg and preserves_first_arg.Mark Mitchell1-5/+0
* cp-tree.h (lang_decl_flags): Remove returns_first_arg and preserves_first_arg. Enlarge dummy accordingly. (DECL_TINFO_FN_P): New macro. (SET_DECL_TINO_FN_P): Likeiwse. (DECL_RETURNS_FIRST_ARG): Remove. (DECL_PRESERVES_THIS): Likewise. (DECL_INIT_PRIORITY): New macro. (finish_struct_1): Change prototype. (cat_namespace_levels): Remove prototype. (vtable_decl_p): New prototype. (vtype_decl_p): Likewise. (sigtable_decl_p): Likewise. (walk_globals_pred): New typedef. (walk_globals_fn): Likewise. (walk_globals): New prototype. (walk_namespaces_fn): New typedef. (walk_namespaces): New prototype. (wrapup_globals_for_namespace): Likewise. (walk_vtables): Remove prototype. (walk_sigtables): Likewise. (instantiate_pending_templates): New prototype. * class.c (finish_struct_1): Don't return a value. * decl.h (pending_statics): Remove declaration. * decl.c (walk_namespaces_r): New function. (walk_globals_r): Likewise. (vtable_decl_p): Likewise. (vtype_decl_p): Likewise. (sigtable_decl_p): Likewise. (walk_namespaces): Likewise. (walk_globals_data): New type. (walk_globals): New function. (wrapup_globals_for_namespace): Likewise. (expand_static_init): Remove assertion. Remove redundancy in conditional. Don't put static data members in static_aggregates Tidy. (finish_function): Remove redundancy in conditional. Don't set DECL_RETURNS_FIRST_ARG. (cat_namespace_levels): Remove. * decl2.c: Include splay-tree.h and varray.h. (priority_info_s): New structure. (finish_vtable_vardecl): Change prototype. Adjust for new calling conventions. (prune_vtable_vardecl): Likewise. (finish_sigtable_vardecl): Likewise. (setup_initp): Remove. (do_dtors): Remove. (do_ctors): Remove. (start_static_storage_duration_function): New function. (generate_inits_for_priority): Likewise. (finish_static_storage_duration_function): Likewise. (get_priority_info): Likewise. (do_static_initialization): Likewise. (do_static_destruction): Likewise. (do_static_initialization_and_destruction): Likewise. (generate_ctor_or_dtor_function): Likewise. (generate_ctor_and_dtor_functions_for_priority): Likewise. (pending_statics): Make it a varray. (pending_statics_used): New variable. (saved_inlines): Make it a varray. (saved_inlines_used): New variable. (finish_static_data_member): Change method of updating pending_statics. (mark_inline_for_output): Remove #if 0'd code. Change method of updating saved_inlines. (walk_vtables): Remove. (walk_sigtables): Likewise. (import_export_decl): Use DECL_TINFO_FN_P. (pending_templates): Remove declaration. (maybe_templates): Likewise. (static_aggregates_initp): Likewise. (setup_initp): Likewise. (finish_objects): Simplify. (INITIALIZE_P_IDENTIFIER): New macro. (PRIORITY_IDENTIFIER): New macro. (SSDF_IDENTIFIER): New macro. (initialize_p_decl): New variable. (priority_decl): Likewise. (ssdf_decl): Likewise. (priority_info_map): Likewise. (finish_file): Recode output of static intializers and other file-scope finalization tasks. * error.c (OB_END_TEMPLATE_ID): New macro. (dump_type_real): Use it. (dump_decl): Likewise. (dump_function_name): Likewise. * lex.c (set_typedecl_interface_info): Adjust for new walk_globals interface. (check_newline): Use walk_globals, not walk_vtables. * pt.c (pending_tempalte_expansions): Remove. (set_vardecl_interface_info): Likewise. (pending_templates): Make static. (maybe_templates): Likewise. (instantiate_class_template): Adjust call to finish_struct_1. (instantiate_pending_templates): New function. * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P. * tree.c (static_aggregates_initp): Remove. (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY instead. * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h. From-SVN: r26594
1996-09-12mergingMike Stump1-1/+1
From-SVN: r12700
1995-10-1275th Cygnus<->FSF mergeMike Stump1-0/+3
From-SVN: r10438
1995-06-15Update FSF address.Richard Kenner1-1/+2
From-SVN: r9966
1994-11-2949th Cygnus<->FSF mergeMike Stump1-0/+1
From-SVN: r8570
1994-04-0831th Cygnus<->FSF merge.Mike Stump1-5/+0
From-SVN: r6996
1994-02-24Initial revisionMike Stump1-0/+59
From-SVN: r6613