Skip to content
Snippets Groups Projects
  1. May 05, 2021
    • Tom Tromey's avatar
      libcc1: add deleter objects · 0d5a0b9a
      Tom Tromey authored
      This adds deleter objects for various kinds of protocol pointers to
      libcc1.  Existing specializations of argument_wrapper are then
      replaced with a single specialization that handles all pointer types
      via the appropriate deleter.  The result here is a bit nicer because
      the argument_wrapper boilerplate code is completely shared, leaving
      just the memory-management detail to the particular specializations.
      
      libcc1
      
      	* rpc.hh (struct deleter): New template class and
      	specializations.
      	(argument_wrapper): Remove specializations.  Add specialization
      	for any pointer type.
      
      
      0d5a0b9a
    • Tom Tromey's avatar
      libcc1: use std::vector when building function types · e702c60e
      Tom Tromey authored
      This changes libcc1 to use std::vector in the code that builds
      function types.  This avoids some explicit memory management.
      
      libcc1
      
      	* libcp1plugin.cc (plugin_build_function_type): Use std::vector.
      	* libcc1plugin.cc (plugin_build_function_type): Use std::vector.
      
      
      e702c60e
    • Tom Tromey's avatar
      libcc1: use variadic templates for "rpc" · 410d5719
      Tom Tromey authored
      This changes libcc1 to use variadic templates for the "rpc" functions.
      This simplifies the code and removes some possibility for mistakes.
      
      libcc1
      
      	* libcp1.cc (rpc): Use variadic template.  Remove overloads.
      	* libcc1.cc (rpc): Use variadic template.  Remove overloads.
      
      
      410d5719
    • Tom Tromey's avatar
      libcc1: use variadic templates for "call" · dc6be7c0
      Tom Tromey authored
      This changes libcc1 to use variadic templates for the "call"
      functions.  The primary benefit is that this simplifies the code.
      
      libcc1
      
      	* rpc.hh (call): Use variadic template.  Remove overloads.
      	* marshall.hh (marshall): Add base overload.  Use variadic
      	template.
      
      
      dc6be7c0
    • Tom Tromey's avatar
      libcc1: delete copy constructor and assignment operators · c10a3b13
      Tom Tromey authored
      Change libcc1 to use "= delete" for the copy constructor and
      assignment operator, rather than the old approach of private methods
      that are nowhere defined.
      
      libcc1
      
      	* rpc.hh (argument_wrapper): Use delete for copy constructor.
      	* connection.hh (class connection): Use delete for copy
      	constructor.
      	* callbacks.hh (class callbacks): Use delete for copy constructor.
      
      
      c10a3b13
    • Tom Tromey's avatar
      libcc1: inline some simple methods · 41f43816
      Tom Tromey authored
      This changes libcc1 to inline a trivial method and to use the default
      constructor.
      
      libcc1
      
      	* connection.hh (~connection): Use default.
      	(print): Inline.
      	* connection.cc (cc1_plugin::connection::~connection)
      	(cc1_plugin::connection::print): Remove definitions.
      
      
      41f43816
    • Tom Tromey's avatar
      libcc1: use "override" · e1f5252e
      Tom Tromey authored
      This changes libcc1 to use "override" where appropriate.
      
      libcc1
      
      	* libcp1.cc (class compiler_triplet_regexp)
      	(class compiler_driver_filename, class libcp1_connection): Use
      	"override".
      	* libcc1.cc (class compiler_triplet_regexp)
      	(class compiler_driver_filename, class libcc1_connection): Use
      	"override".
      
      
      e1f5252e
    • Tom Tromey's avatar
      libcc1: use templates to unmarshall enums · 25d1a6ec
      Tom Tromey authored
      Now that C++11 can be used in GCC, libcc1 can be changed to use
      templates and type traits to handle unmarshalling all kinds of enums.
      
      libcc1
      
      	* marshall.hh (cc1_plugin::unmarshall): Use type traits.
      	* marshall-cp.hh (cc1_plugin::unmarshall): Remove overloads.
      	* marshall-c.hh: Remove.
      	* libcc1plugin.cc: Update includes.
      	* libcc1.cc: Update includes.
      
      
      25d1a6ec
  2. May 04, 2021
  3. May 03, 2021
    • H.J. Lu's avatar
      GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs · 3f570621
      H.J. Lu authored
      Check if host supports multi-byte NOPs before enabling CET on host.
      
      gcc/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      
      libbacktrace/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      
      libcc1/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      
      libcpp/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      
      libdecnumber/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      
      lto-plugin/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      3f570621
  4. Jan 06, 2021
  5. Jan 05, 2021
    • Samuel Thibault's avatar
      Update GNU/Hurd configure support · f56de355
      Samuel Thibault authored
      ChangeLog:
      
      	* libtool.m4: Match gnu* along other GNU systems.
      	* libgo/config/libtool.m4: Match gnu* along other GNU systems.
      	* libgo/configure: Re-generate.
      
      libffi/
      	* configure: Re-generate.
      
      libgomp/
      	* configure: Re-generate.
      
      gcc/
      
      	* configure: Re-generate.
      
      libatomic/
      
      	* configure: Re-generate.
      
      libbacktrace/
      
      	* configure: Re-generate.
      
      libcc1/
      
      	* configure: Re-generate.
      
      libgfortran/
      
      	* configure: Re-generate.
      
      libgomp/
      
      	* configure: Re-generate.
      
      libhsail-rt/
      
      	* configure: Re-generate.
      
      libitm/
      
      	* configure: Re-generate.
      
      libobjc/
      
      	* configure: Re-generate.
      
      liboffloadmic/
      
      	* configure: Re-generate.
      	* plugin/configure: Re-generate.
      
      libphobos/
      
      	* configure: Re-generate.
      
      libquadmath/
      
      	* configure: Re-generate.
      
      libsanitizer/
      
      	* configure: Re-generate.
      
      libssp/
      
      	* configure: Re-generate.
      
      libstdc++-v3/
      
      	* configure: Re-generate.
      
      libvtv/
      
      	* configure: Re-generate.
      
      lto-plugin/
      
      	* configure: Re-generate.
      
      zlib/
      
      	* configure: Re-generate.
      f56de355
  6. Jan 04, 2021
  7. Dec 19, 2020
  8. Dec 18, 2020
    • Jakub Jelinek's avatar
      libcc1: Fix up libcc1 configure [PR98330] · 5dc99893
      Jakub Jelinek authored
      Either we should write test x$darwin_dynamic_lookup = xyes
      or we should make sure the variable is always defined to non-empty string.
      
      2020-12-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR bootstrap/98380
      	* configure.ac: Set darwin_dynamic_lookup=no instead to empty
      	string.
      	* configure: Regenerated.
      5dc99893
  9. Dec 06, 2020
  10. Dec 05, 2020
    • Iain Sandoe's avatar
      Darwin : Update libtool and dependencies for Darwin20 [PR97865] · 1352bc88
      Iain Sandoe authored
      The change in major version (and the increment from Darwin19 to 20)
      caused libtool tests to fail which resulted in incorrect build settings
      for shared libraries.
      
      We take this opportunity to sort out the shared undefined symbols state
      rather than propagating the current unsound behaviour into a new rev.
      
      This change means that we default to the case that missing symbols are
      considered an error, and if one wants to allow this intentionally, the
      confiuration for that case should be set appropriately.
      
      Three existing cases need undefined dynamic lookup:
       libitm, where there is already a configuration mechanism to add the
               flags.
       libcc1, where we add simple configuration to add the flags for Darwin.
       libsanitizer, where we can add to the existing extra flags.
      
      libcc1/ChangeLog:
      
      	PR target/97865
      	* Makefile.am: Add dynamic_lookup to LD flags for Darwin.
      	* configure.ac: Test for Darwin host and set a flag.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	PR target/97865
      	* configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin.
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	PR target/97865
      	* configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for
      	Darwin.
      	* configure: Regenerate.
      
      ChangeLog:
      
      	PR target/97865
      	* libtool.m4: Update handling of Darwin platform link flags
      	for Darwin20.
      
      gcc/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libhsail-rt/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	PR target/97865
      	* configure: Regenerate.
      1352bc88
  11. Nov 30, 2020
  12. Nov 29, 2020
    • John David Anglin's avatar
      Fix hppa64-hpux11 build to remove source paths from embedded path. · 4e4ba647
      John David Anglin authored
      This change adds the +nodefaultrpath ld option to remove all library
      paths that were specified with the -L option from the embedded path.
      
      2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
      
      ChangeLog:
      	* libtool.m4 (archive_cmds): Add +nodefaultrpath ld option on
      	hppa64-*-hpux11*.
      
      libatomic/ChangeLog:
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      	* configure: Regenerate.
      
      libhsail-rt/ChangeLog:
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      	* configure: Regenerate.
      
      liboffloadmic/ChangeLog:
      	* configure: Regenerate.
      	* plugin/configure: Regenerate.
      
      libquadmath/ChangeLog:
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      	* configure: Regenerate.
      4e4ba647
  13. Nov 12, 2020
  14. Nov 11, 2020
    • Patrick Palka's avatar
      c++: Correct the handling of alignof(expr) [PR88115] · 61827d5d
      Patrick Palka authored
      We're currently neglecting to set the ALIGNOF_EXPR_STD_P flag on an
      ALIGNOF_EXPR when its operand is an expression.  This leads to us
      handling alignof(expr) as if it were written __alignof__(expr), and
      returning the preferred alignment instead of the ABI alignment.  In the
      testcase below, this causes the first and third static_assert to fail on
      x86.
      
      gcc/cp/ChangeLog:
      
      	PR c++/88115
      	* cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
      	* decl.c (fold_sizeof_expr): Pass false to
      	cxx_sizeof_or_alignof_expr.
      	* parser.c (cp_parser_unary_expression): Pass std_alignof to
      	cxx_sizeof_or_alignof_expr.
      	* pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
      	(tsubst_copy_and_build): Pass std_alignof to
      	cxx_sizeof_or_alignof_expr.
      	* typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
      	and pass it to cxx_sizeof_or_alignof_type.  Set ALIGNOF_EXPR_STD_P
      	appropriately.
      	(cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
      	and pass it to cxx_alignof_expr.  Assert op is either
      	SIZEOF_EXPR or ALIGNOF_EXPR.
      
      libcc1/ChangeLog:
      
      	PR c++/88115
      	* libcp1plugin.cc (plugin_build_unary_expr): Pass true to
      	cxx_sizeof_or_alignof_expr.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/88115
      	* g++.dg/cpp0x/alignof6.C: New test.
      61827d5d
    • GCC Administrator's avatar
      Daily bump. · bb622641
      GCC Administrator authored
      bb622641
  15. Nov 10, 2020
    • Marek Polacek's avatar
      c++: Improve static_assert diagnostic [PR97518] · 8c0c83fe
      Marek Polacek authored
      Currently, when a static_assert fails, we only say "static assertion failed".
      It would be more useful if we could also print the expression that
      evaluated to false; this is especially useful when the condition uses
      template parameters.  Consider the motivating example, in which we have
      this line:
      
        static_assert(is_same<X, Y>::value);
      
      if this fails, the user has to play dirty games to get the compiler to
      print the template arguments.  With this patch, we say:
      
        error: static assertion failed
        note: 'is_same<int*, int>::value' evaluates to false
      
      which I think is much better.  However, always printing the condition that
      evaluated to 'false' wouldn't be very useful: e.g. noexcept(fn) is
      always parsed to true/false, so we would say "'false' evaluates to false"
      which doesn't help.  So I wound up only printing the condition when it was
      instantiation-dependent, that is, we called finish_static_assert from
      tsubst_expr.
      
      Moreover, this patch also improves the diagnostic when the condition
      consists of a logical AND.  Say you have something like this:
      
        static_assert(fn1() && fn2() && fn3() && fn4() && fn5());
      
      where fn4() evaluates to false and the other ones to true.  Highlighting
      the whole thing is not that helpful because it won't say which clause
      evaluated to false.  With the find_failing_clause tweak in this patch
      we emit:
      
        error: static assertion failed
          6 | static_assert(fn1() && fn2() && fn3() && fn4() && fn5());
            |                                          ~~~^~
      
      so you know right away what's going on.  Unfortunately, when you combine
      both things, that is, have an instantiation-dependent expr and && in
      a static_assert, we can't yet quite point to the clause that failed.  It
      is because when we tsubstitute something like is_same<X, Y>::value, we
      generate a VAR_DECL that doesn't have any location.  It would be awesome
      if we could wrap it with a location wrapper, but I didn't see anything
      obvious.
      
      In passing, I've cleaned up some things:
      * use iloc_sentinel when appropriate,
      * it's nicer to call contextual_conv_bool instead of the rather verbose
        perform_implicit_conversion_flags,
      * no need to check for INTEGER_CST before calling integer_zerop.
      
      gcc/cp/ChangeLog:
      
      	PR c++/97518
      	* cp-tree.h (finish_static_assert): Adjust declaration.
      	* parser.c (cp_parser_static_assert): Pass false to
      	finish_static_assert.
      	* pt.c (tsubst_expr): Pass true to finish_static_assert.
      	* semantics.c (find_failing_clause_r): New function.
      	(find_failing_clause): New function.
      	(finish_static_assert): Add a bool parameter.  Use
      	iloc_sentinel.  Call contextual_conv_bool instead of
      	perform_implicit_conversion_flags.  Don't check for INTEGER_CST before
      	calling integer_zerop.  Call find_failing_clause and maybe use its
      	location.  Print the original condition or the failing clause if
      	SHOW_EXPR_P.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/97518
      	* g++.dg/diagnostic/pr87386.C: Adjust expected output.
      	* g++.dg/diagnostic/static_assert1.C: New test.
      	* g++.dg/diagnostic/static_assert2.C: New test.
      
      libcc1/ChangeLog:
      
      	PR c++/97518
      	* libcp1plugin.cc (plugin_add_static_assert): Pass false to
      	finish_static_assert.
      8c0c83fe
  16. Nov 07, 2020
  17. Nov 06, 2020
    • Nathan Sidwell's avatar
      core: Rename DECL_IS_BUILTIN -> DECL_IS_UNDECLARED_BUILTIN · ba649812
      Nathan Sidwell authored
      In cleaning up C++'s handling of hidden decls, I renamed its
      DECL_BUILTIN_P, which checks for loc == BUILTINS_LOCATION to
      DECL_UNDECLARED_BUILTIN_P, because the location gets updated, if user
      source declares the builtin, and the predicate no longer holds.  The
      original name was confusing me.  (The builtin may still retain builtin
      properties in the redeclaration, and other predicates can still detect
      that.)
      
      I discovered that tree.h had its own variant 'DECL_IS_BUILTIN', which
      behaves in (almost) the same manner.  And therefore has the same
      mutating behaviour.
      
      This patch deletes the C++ one, and renames tree.h's to
      DECL_IS_UNDECLARED_BUILTIN, to emphasize its non-constantness.  I
      guess _IS_ wins over _P
      
      	gcc/
      	* tree.h (DECL_IS_BUILTIN): Rename to ...
      	(DECL_IS_UNDECLARED_BUILTIN): ... here.  No need to use SOURCE_LOCUS.
      	* calls.c (maybe_warn_alloc_args_overflow): Adjust for rename.
      	* cfgexpand.c (pass_expand::execute): Likewise.
      	* dwarf2out.c (base_type_die, is_naming_typedef_decl): Likewise.
      	* godump.c (go_decl, go_type_decl): Likewise.
      	* print-tree.c (print_decl_identifier): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise.
      	* xcoffout.c (xcoff_assign_fundamental_type_number): Likewise.
      	gcc/c-family/
      	* c-ada-spec.c (collect_ada_nodes): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	(collect_ada_node): Likewise.
      	(dump_forward_type): Likewise.
      	* c-common.c (set_underlying_type): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	(user_facing_original_type, c_common_finalize_early_debug): Likewise.
      	gcc/c/
      	* c-decl.c (diagnose_mismatched_decls): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	(warn_if_shadowing, implicitly_declare, names_builtin_p)
      	(collect_source_refs): Likewise.
      	* c-typeck.c (inform_declaration, inform_for_arg)
      	(convert_for_assignment): Likewise.
      	gcc/cp/
      	* cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
      	* cp-objcp-common.c (names_bultin_p): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	* decl.c (decls_match): Likewise.  Replace
      	DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
      	(duplicate_decls): Likewise.
      	* decl2.c (collect_source_refs): Likewise.
      	* name-lookup.c (anticipated_builtin_p, print_binding_level)
      	(do_nonmember_using_decl): Likewise.
      	* pt.c (builtin_pack_fn_p): Likewise.
      	* typeck.c (error_args_num): Likewise.
      	gcc/lto/
      	* lto-symtab.c (lto_symtab_merge_decls_1): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	gcc/go/
      	* go-gcc.cc (Gcc_backend::call_expression): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	libcc1/
      	* libcc1plugin.cc (address_rewriter): Rename
      	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
      	* libcp1plugin.cc (supplement_binding): Likewise.
      ba649812
  18. Oct 15, 2020
  19. Oct 14, 2020
    • Nathan Sidwell's avatar
      c++: DECL_FRIEND_P cleanup · 068644a1
      Nathan Sidwell authored
      DECL_FRIEND_P's meaning has changed over time.  It now (almost) means
      the the friend function decl has not been met via an explicit decl.
      This completes that transition, renaming it to DECL_UNIQUE_FRIEND_P,
      so one doesn't think it is the sole indicator of friendliness (plenty
      of friends do not have the flag set).  This allows reduction in the
      complexity of managing the field -- all in duplicate_decls now.
      
      	gcc/cp/
      	* cp-tree.h (struct lang_decl_fn): Adjust context comment.
      	(DECL_FRIEND_P): Replace with ...
      	(DECL_UNIQUE_FRIEND_P): ... this.  Only for FUNCTION_DECLs.
      	(DECL_FRIEND_CONTEXT): Adjust.
      	* class.c (add_implicitly_declared_members): Detect friendly
      	spaceship from context.
      	* constraint.cc (remove_constraints): Use a checking assert.
      	(maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
      	* decl.c (check_no_redeclaration_friend_default_args):
      	DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
      	(duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
      	(redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
      	(start_preparsed_function): Correct in-class friend processing.
      	Refactor some initializers.
      	(grokmethod): Directly check friend decl-spec.
      	* decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
      	* friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
      	extraneous conditions.  Don't re set it afterwards.
      	* name-lookup.c (lookup_elaborated_type_1): Simplify revealing
      	code.
      	(do_pushtag): Likewise.
      	* pt.c (optimize_specialization_lookup_p): Check
      	DECL_UNIQUE_FRIEND_P.
      	(push_template_decl): Likewise.  Drop unneeded friend setting.
      	(type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
      	libcc1/
      	* libcp1plugin.cc (plugin_add_friend): Set DECL_UNIQUE_FRIEND_P.
      068644a1
  20. Oct 08, 2020
  21. Oct 07, 2020
    • Nathan Sidwell's avatar
      c++: Rename DECL_BUILTIN_P to DECL_UNDECLARED_BUILTIN_P · 99e9b543
      Nathan Sidwell authored
      I realized I'd misnamed DECL_BUILTIN_P, it's only true of compiler
      builtins unless and until the user declares them -- at that point
      they're real decls, and will have a location in the user's source.
      (BUILT_IN_FN and friends still work though).  This renames them so
      future-me is not confused as to why the predicate becomes false.
      
      	gcc/cp/
      	* cp-tree.h (DECL_BUILTIN_P): Rename to ...
      	(DECL_UNDECLARED_BUILTIN_P): ... here.
      	* decl.c (duplicate_decls): Adjust.
      	* name-lookup.c (anticipated_builtin_p): Adjust.
      	(do_nonmember_using_decl): Likewise.
      	libcc1/
      	* libcp1plugin.cc (supplement_binding): Rename
      	DECL_BUILTIN_P.
      99e9b543
  22. Oct 03, 2020
  23. Oct 02, 2020
    • Nathan Sidwell's avatar
      c++: Kill DECL_ANTICIPATED · 679dbc9d
      Nathan Sidwell authored
      Here's the patch to remove DECL_ANTICIPATED, and with it hiddenness is
      managed entirely in the symbol table.  Sadly I couldn't get rid of the
      actual field without more investigation -- it's repurposed for
      OMP_PRIVATIZED_MEMBER.  It looks like a the VAR-related flags in
      lang_decl_base are not completely orthogonal, so perhaps some can be
      turned into an enumeration or something.  But that's more than I want
      to do right now.
      
      DECL_FRIEND_P Is still slightly suspect as it appears to mean more
      than just in-class definition.  However, I'm leaving that for now.
      
      	gcc/cp/
      	* cp-tree.h (lang_decl_base): anticipated_p is not used for
      	anticipatedness.
      	(DECL_ANTICIPATED): Delete.
      	* decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
      	use was_hidden.
      	(cxx_builtin_function): Drop DECL_ANTICIPATED setting.
      	(xref_tag_1): Drop DECL_ANTICIPATED assert.
      	* name-lookup.c (name_lookup::adl_class_only): Drop
      	DECL_ANTICIPATED check.
      	(name_lookup::search_adl): Always dedup.
      	(anticipated_builtin_p): Reimplement.
      	(do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
      	(lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
      	(do_pushtag): Drop DECL_ANTICIPATED setting.
      	* pt.c (push_template_decl): Likewise.
      	(tsubst_friend_class): Likewise.
      	libcc1/
      	* libcp1plugin.cc (libcp1plugin.cc): Drop DECL_ANTICIPATED test.
      679dbc9d
  24. Sep 26, 2020
  25. Sep 25, 2020
    • Nathan Sidwell's avatar
      c++: DECL_BUILTIN_P for builtins · a28542df
      Nathan Sidwell authored
      We currently detect builtin decls via DECL_ARTIFICIAL &&
      !DECL_HIDDEN_FUNCTION_P, which, besides being clunky, is a problem as
      hiddenness is a property of the symbol table -- not the decl being
      hidden.  This adds DECL_BUILTIN_P, which just looks at the
      SOURCE_LOCATION -- we have a magic one for builtins.
      
      One of the consequential changes is to make function-scope omp udrs
      have function context (needed because otherwise duplicate-decls thinks
      the types don't match at the point we check).  This is also morally
      better, because that's what they are -- nested functions, stop lying.
      
      (That's actually my plan for all DECL_LOCAL_DECL_P decls, as they are
      distinct decls to the namespace-scope decl they alias.)
      
      	gcc/cp/
      	* cp-tree.h (DECL_BUILTIN_P): New.
      	* decl.c (duplicate_decls): Use it.  Do not treat omp-udr as a
      	builtin.
      	* name-lookup.c (anticipated_builtin): Use it.
      	(set_decl_context_in_fn): Function-scope OMP UDRs have function context.
      	(do_nonmember_using_decl): Use DECL_BUILTIN_P.
      	* parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
      	UDRs have function context.  Assert we never find a valid duplicate.
      	* pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
      	libcc1/
      	* libcp1plugin.cc (supplement_binding): Use DECL_BULTIN_P.
      a28542df
    • GCC Administrator's avatar
      Daily bump. · a2b7397b
      GCC Administrator authored
      a2b7397b
  26. Sep 24, 2020
    • Nathan Sidwell's avatar
      c++: Cleanup some decl pushing apis · d13c0ae8
      Nathan Sidwell authored
      In cleaning up local decl handling, here's an initial patch that takes
      advantage of C++'s default args for the is_friend parm of pushdecl,
      duplicate_decls and push_template_decl_real and the scope & tpl_header
      parms of xref_tag.  Then many of the calls simply not mention these.
      I also rename push_template_decl_real to push_template_decl, deleting
      the original forwarding function.  This'll make my later patches
      changing their types less intrusive.  There are 2 functional changes:
      
      1) push_template_decl requires is_friend to be correct, it doesn't go
      checking for a friend function (an assert is added).
      
      2) debug_overload prints out Hidden and Using markers for the overload set.
      
      	gcc/cp/
      	* cp-tree.h (duplicate_decls): Default is_friend to false.
      	(xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
      	(push_template_decl_real): Default is_friend to false.  Rename to
      	...
      	(push_template_decl): ... here.  Delete original decl.
      	* name-lookup.h (pushdecl_namespace_level): Default is_friend to
      	false.
      	(pushtag): Default tag_scope to ts_current.
      	* coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
      	* decl.c (start_decl): Drop default args to duplicate_decls.
      	(start_enum): Drop default arg to pushtag & xref_tag.
      	(start_preparsed_function): Pass DECL_FRIEND_P to
      	push_template_decl.
      	(grokmethod): Likewise.
      	* friend.c (do_friend): Rename push_template_decl_real calls.
      	* lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
      	(vla_capture_type): Likewise.
      	* name-lookup.c (maybe_process_template_type_declaration): Rename
      	push_template_decl_real call.
      	(pushdecl_top_level_and_finish): Drop default arg to
      	pushdecl_namespace_level.
      	* pt.c (push_template_decl_real): Assert no surprising friend
      	functions.  Rename to ...
      	(push_template_decl): ... here.  Delete original function.
      	(lookup_template_class_1): Drop default args from pushtag.
      	(instantiate_class_template_1): Likewise.
      	* ptree.c (debug_overload): Print hidden and using markers.
      	* rtti.c (init_rtti_processing): Drop refault args from xref_tag.
      	(build_dynamic_cast_1, tinfo_base_init): Likewise.
      	* semantics.c (begin_class_definition): Drop default args to
      	pushtag.
      	gcc/objcp/
      	* objcp-decl.c (objcp_start_struct): Drop default args to
      	xref_tag.
      	(objcp_xref_tag): Likewise.
      	libcc1/
      	* libcp1plugin.cc (supplement_binding): Drop default args to
      	duplicate_decls.
      	(safe_pushtag): Drop scope parm.  Drop default args to pushtag.
      	(safe_pushdecl_maybe_friend): Rename to ...
      	(safe_pushdecl): ... here. Drop is_friend parm.  Drop default args
      	to pushdecl.
      	(plugin_build_decl): Adjust safe_pushdecl & safe_pushtag calls.
      	(plugin_build_constant): Adjust safe_pushdecl call.
      d13c0ae8
  27. Sep 11, 2020
  28. Sep 10, 2020
    • Nathan Sidwell's avatar
      c++: DECL_LOCAL_FUNCTION_P -> DECL_LOCAL_DECL_P · f4086696
      Nathan Sidwell authored
      Our handling of block-scope extern decls is insufficient for modern
      C++, in particular modules, (but also constexprs).  We mark such local
      function decls, and this patch extends that to marking local var decls
      too, so mainly a macro rename.  Also, we set this flag earlier, rather
      than learning about it when pushing the decl.  This is a step towards
      handling these properly.
      
      	gcc/cp/
      	* cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
      	(DECL_LOCAL_DECL_P): ... here.  Accept both fns and vars.
      	* decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
      	(omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
      	(local_variable_p): Simplify.
      	* name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
      	is as expected.  Simplify.
      	(do_pushdecl): Don't set decl_context_in_fn for friends.
      	(is_local_extern): Simplify.
      	* call.c (equal_functions): Use DECL_LOCAL_DECL_P.
      	* parser.c (cp_parser_postfix_expression): Likewise.
      	(cp_parser_omp_declare_reduction): Likewise.
      	* pt.c (check_default_tmpl_args): Likewise.
      	(tsubst_expr): Assert nested reduction function is local.
      	(type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
      	* semantics.c (finish_call_expr): Likewise.
      	libcc1/
      	* libcp1plugin.cc (plugin_build_call_expr): Use DECL_LOCAL_DECL_P.
      f4086696
  29. Aug 15, 2020
  30. Aug 14, 2020
    • Nathan Sidwell's avatar
      c++: Final bit of name-lookup api simplification · f00008b4
      Nathan Sidwell authored
      We no longer need to give name_lookup_real not name_lookup_nonclass
      different names to the name_lookup functions.  This renames the lookup
      functions thusly.
      
      	gcc/cp/
      	* name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
      	to ...
      	(lookup_name): ... these new overloads.
      	* name-lookup.c (identifier_type_value_1): Rename lookup_name_real
      	call.
      	(lookup_name_real_1): Rename to ...
      	(lookup_name_1): ... here.
      	(lookup_name_real): Rename to ...
      	(lookup_name): ... here.  Rename lookup_name_real_1 call.
      	(lookup_name_nonclass): Delete.
      	* call.c (build_operator_new_call): Rename lookup_name_real call.
      	(add_operator_candidates): Likewise.
      	(build_op_delete_call): Rename lookup_name_nonclass call.
      	* parser.c (cp_parser_lookup_name): Likewise.
      	* pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
      	(tsubst_expr): Likewise.
      	* semantics.c (capture_decltype): Likewise.
      	libcc1/
      	* libcp1plugin.cc (plugin_build_dependent_expr): Rename
      	lookup_name_real call.
      f00008b4
    • Nathan Sidwell's avatar
      c++: Yet more name-lookup api simplification · db1c2a89
      Nathan Sidwell authored
      This patch deals with LOOKUP_HIDDEN, which originally meant 'find
      hidden friends', but it's being pressed into service for not ignoring
      lambda-relevant internals.  However these two functions are different.
      (a) hidden friends can occur in block scope (very uncommon) and (b) it
      had the semantics of stopping after the innermost enclosing
      namepspace.  That's really suspect for the lambda case, but not
      relevant there because we never get to namespace scope (I think).
      Anyway, I've split the flag into two and adjusted the lambda callers
      to just search block scope.  These two flags are added to the
      LOOK_want enum class, which allows dropping another parameter from the
      name lookup routines.
      
      The remaining LOOKUP_$FOO flags in cp-tree.h are, I think, now all
      related to features of overload resolution, conversion operators and
      reference binding.  Nothing to do with /name/ lookup.
      
      	gcc/cp/
      	* cp-tree.h (LOOKUP_HIDDEN): Delete.
      	(LOOKUP_PREFER_RVALUE): Adjust initializer.
      	* name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
      	HIDDEN_LAMBDA flags.
      	(lookup_name_real): Drop flags parm.
      	(lookup_qualified_name): Drop find_hidden parm.
      	* name-lookup.c (class name_lookup): Drop hidden field, adjust
      	ctors.
      	(name_lookup::add_overload): Check want for hiddenness.
      	(name_lookup::process_binding): Likewise.
      	(name_lookup::search_unqualified): Likewise.
      	(identifier_type_value_1): Adjust lookup_name_real call.
      	(set_decl_namespace): Adjust name_lookup ctor.
      	(qualify_lookup): Drop flags parm, use want for hiddenness.
      	(lookup_qualified_name): Drop find_hidden parm.
      	(lookup_name_real_1): Drop flags parm, adjust qualify_lookup
      	calls.
      	(lookup_name_real): Drop flags parm.
      	(lookup_name_nonclass, lookup_name): Adjust lookup_name_real
      	calls.
      	(lookup_type_scope_1): Adjust qualify_lookup calls.
      	* call.c (build_operator_new_call): Adjust lookup_name_real call.
      	(add_operator_candidates): Likewise.
      	* coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
      	call.
      	* parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
      	* pt.c (check_explicit_specialization): Adjust
      	lookup_qualified_name call.
      	(deduction_guides_for): Likewise.
      	(tsubst_friend_class): Adjust lookup_name_real call.
      	(lookup_init_capture_pack): Likewise.
      	(tsubst_expr): Likewise, don't look in namespaces.
      	* semantics.c (capture_decltype): Adjust lookup_name_real.  Don't
      	look in namespaces.
      	libcc1/
      	* libcp1plugin.cc (plugin_build_dependent_exp): Adjust
      	lookup_name_real call.
      db1c2a89
Loading