diff options
author | Marek Polacek <polacek@redhat.com> | 2021-03-11 14:01:52 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2021-05-18 16:29:46 -0400 |
commit | fef7c8990da15493110118554adfc9a0b779604c (patch) | |
tree | 2d8117698161e39c8963a53fc91b69da5fc737a4 /gcc/cp/constraint.cc | |
parent | 8c114759b8c9c9e2ec90b82d92a24b5a71647017 (diff) | |
download | gcc-fef7c8990da15493110118554adfc9a0b779604c.zip gcc-fef7c8990da15493110118554adfc9a0b779604c.tar.gz gcc-fef7c8990da15493110118554adfc9a0b779604c.tar.bz2 |
c++: Prune dead functions.
I was looking at the LCOV coverage report for the C++ FE and
found a bunch of unused functions that I think we can remove.
Obviously, I left alone various dump_* and debug_* routines.
I haven't removed cp_build_function_call although it is also
currently unused.
* lambda_return_type: was used in parser.c in GCC 7, unused since r255950,
* classtype_has_non_deleted_copy_ctor: appeared in GCC 10, its usage
was removed in c++/95350,
* contains_wildcard_p: used in GCC 9, unused since r276764,
* get_template_head_requirements: seems to never have been used,
* check_constrained_friend: seems to never have been used,
* subsumes_constraints: unused since r276764,
* push_void_library_fn: usage removed in r248328,
* get_template_parms_at_level: unused since r157857,
* get_pattern_parm: unused since r275387.
(Some of the seemingly unused functions, such as set_global_friend, are
actually used in libcc1.)
gcc/cp/ChangeLog:
* class.c (classtype_has_non_deleted_copy_ctor): Remove.
* constraint.cc (contains_wildcard_p): Likewise.
(get_template_head_requirements): Likewise.
(check_constrained_friend): Likewise.
(subsumes_constraints): Likewise.
* cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
(push_void_library_fn): Likewise.
(get_pattern_parm): Likewise.
(get_template_parms_at_level): Likewise.
(lambda_return_type): Likewise.
(get_template_head_requirements): Likewise.
(check_constrained_friend): Likewise.
(subsumes_constraints): Likewise.
* decl.c (push_void_library_fn): Likewise.
* lambda.c (lambda_return_type): Likewise.
* pt.c (get_template_parms_at_level): Likewise.
(get_pattern_parm): Likewise.
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r-- | gcc/cp/constraint.cc | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 30fccc4..03ce8eb 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -278,21 +278,6 @@ get_concept_check_template (tree t) return tmpl; } -/* Returns true if any of the arguments in the template argument list is - a wildcard or wildcard pack. */ - -bool -contains_wildcard_p (tree args) -{ - for (int i = 0; i < TREE_VEC_LENGTH (args); ++i) - { - tree arg = TREE_VEC_ELT (args, i); - if (TREE_CODE (arg) == WILDCARD_DECL) - return true; - } - return false; -} - /*--------------------------------------------------------------------------- Resolution of qualified concept names ---------------------------------------------------------------------------*/ @@ -1310,18 +1295,6 @@ maybe_substitute_reqs_for (tree reqs, const_tree decl_) return reqs; } -/* Returns the template-head requires clause for the template - declaration T or NULL_TREE if none. */ - -tree -get_template_head_requirements (tree t) -{ - tree ci = get_constraints (t); - if (!ci) - return NULL_TREE; - return CI_TEMPLATE_REQS (ci); -} - /* Returns the trailing requires clause of the declarator of a template declaration T or NULL_TREE if none. */ @@ -3469,31 +3442,6 @@ check_function_concept (tree fn) return NULL_TREE; } - -// Check that a constrained friend declaration function declaration, -// FN, is admissible. This is the case only when the declaration depends -// on template parameters and does not declare a specialization. -void -check_constrained_friend (tree fn, tree reqs) -{ - if (fn == error_mark_node) - return; - gcc_assert (TREE_CODE (fn) == FUNCTION_DECL); - - // If there are not constraints, this cannot be an error. - if (!reqs) - return; - - // Constrained friend functions that don't depend on template - // arguments are effectively meaningless. - if (!uses_template_parms (TREE_TYPE (fn))) - { - error_at (location_of (fn), - "constrained friend does not depend on template parameters"); - return; - } -} - /*--------------------------------------------------------------------------- Equivalence of constraints ---------------------------------------------------------------------------*/ @@ -3521,16 +3469,6 @@ equivalently_constrained (tree d1, tree d2) Partial ordering of constraints ---------------------------------------------------------------------------*/ -/* Returns true when the constraints in A subsume those in B. */ - -bool -subsumes_constraints (tree a, tree b) -{ - gcc_assert (!a || TREE_CODE (a) == CONSTRAINT_INFO); - gcc_assert (!b || TREE_CODE (b) == CONSTRAINT_INFO); - return subsumes (a, b); -} - /* Returns true when the constraints in CI strictly subsume the associated constraints of TMPL. */ |