|
clang 24.0.0git
|
Data structure that captures multiple levels of template argument lists for use in template instantiation. More...
#include "clang/Sema/Template.h"
Public Member Functions | |
| MultiLevelTemplateArgumentList ()=default | |
| Construct an empty set of template argument lists. | |
| MultiLevelTemplateArgumentList (Decl *D, ArgList Args, bool Final) | |
| Construct a single-level template argument list. | |
| void | setKind (TemplateSubstitutionKind K) |
| void | setRetainInnerDepths () |
| bool | retainInnerDepths () const |
| TemplateSubstitutionKind | getKind () const |
| Determine the kind of template substitution being performed. | |
| bool | isRewrite () const |
| Determine whether we are rewriting template parameters rather than substituting for them. | |
| unsigned | getNumLevels () const |
| Determine the number of levels in this template argument list. | |
| unsigned | getNumSubstitutedLevels () const |
| Determine the number of substituted levels in this template argument list. | |
| unsigned | getNumSubsitutedArgs (unsigned Depth) const |
| unsigned | getNumRetainedOuterLevels () const |
| unsigned | getNewDepth (unsigned OldDepth) const |
Determine how many of the OldDepth outermost template parameter lists would be removed by substituting these arguments. | |
| const TemplateArgument & | operator() (unsigned Depth, unsigned Index) const |
| Retrieve the template argument at a given depth and index. | |
| std::pair< Decl *, bool > | getAssociatedDecl (unsigned Depth) const |
| A template-like entity which owns the whole pattern being substituted. | |
| bool | hasTemplateArgument (unsigned Depth, unsigned Index) const |
| Determine whether there is a non-NULL template argument at the given depth and index. | |
| bool | isAnyArgInstantiationDependent () const |
| void | setArgument (unsigned Depth, unsigned Index, TemplateArgument Arg) |
| Clear out a specific template argument. | |
| void | addOuterTemplateArguments (Decl *AssociatedDecl, ArgList Args, bool Final) |
| Add a new outmost level to the multi-level template argument list. | |
| void | addOuterTemplateArguments (ArgList Args) |
| void | addOuterTemplateArguments (std::nullopt_t) |
| void | replaceInnermostTemplateArguments (Decl *AssociatedDecl, ArgList Args, bool Final=false) |
| Replaces the current 'innermost' level with the provided argument list. | |
| void | replaceOutermostTemplateArguments (Decl *AssociatedDecl, ArgList Args) |
| void | addOuterRetainedLevel () |
| Add an outermost level that we are not substituting. | |
| void | addOuterRetainedLevels (unsigned Num) |
| const ArgList & | getInnermost () const |
| Retrieve the innermost template argument list. | |
| const ArgList & | getOutermost () const |
| Retrieve the outermost template argument list. | |
| ArgListsIterator | begin () |
| ConstArgListsIterator | begin () const |
| ArgListsIterator | end () |
| ConstArgListsIterator | end () const |
| LLVM_DUMP_METHOD void | dump () const |
Data structure that captures multiple levels of template argument lists for use in template instantiation.
Multiple levels of template arguments occur when instantiating the definitions of member templates. For example:
When instantiating X<int>::Y<17>::f, the multi-level template argument list will contain a template argument list (int) at depth 0 and a template argument list (17) at depth 1.
Definition at line 76 of file Template.h.
|
default |
Construct an empty set of template argument lists.
|
inline |
Construct a single-level template argument list.
Definition at line 107 of file Template.h.
References addOuterTemplateArguments().
|
inline |
Add an outermost level that we are not substituting.
We have no arguments at this level, and do not remove it from the depth of inner template parameters that we instantiate.
Definition at line 269 of file Template.h.
|
inline |
Definition at line 272 of file Template.h.
References clang::Num.
Referenced by clang::Sema::BuildExprRequirement(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateIdType(), clang::Sema::FinishCXXExpansionStmt(), FinishTemplateArgumentDeduction(), and clang::Sema::SubstSpaceshipAsEqualEqual().
|
inline |
Definition at line 229 of file Template.h.
References getKind(), and clang::Rewrite.
|
inline |
Add a new outmost level to the multi-level template argument list.
A 'Final' substitution means that these Args don't need to be resugared later.
Definition at line 218 of file Template.h.
References clang::Decl::getCanonicalDecl(), getKind(), and clang::Specialization.
Referenced by clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::CheckTemplateIdType(), MultiLevelTemplateArgumentList(), SubstDefaultTemplateArgument(), SubstDefaultTemplateArgument(), and SubstDefaultTemplateArgument().
|
inline |
Definition at line 236 of file Template.h.
|
inline |
Definition at line 284 of file Template.h.
|
inline |
Definition at line 285 of file Template.h.
|
inline |
Definition at line 291 of file Template.h.
References getNumLevels().
|
inline |
Definition at line 288 of file Template.h.
|
inline |
Definition at line 289 of file Template.h.
|
inline |
A template-like entity which owns the whole pattern being substituted.
This will usually own a set of template parameters, or in some cases might even be a template parameter itself.
Definition at line 170 of file Template.h.
References getNumLevels().
|
inline |
Retrieve the innermost template argument list.
Definition at line 277 of file Template.h.
Referenced by CheckConstraintSatisfaction(), clang::Sema::EnsureTemplateArgumentListConstraints(), clang::Sema::FindInstantiatedDecl(), instantiateOMPDeclareVariantAttr(), and clang::Sema::SubstDefaultArgument().
|
inline |
Determine the kind of template substitution being performed.
Definition at line 118 of file Template.h.
Referenced by addOuterTemplateArguments(), and addOuterTemplateArguments().
Determine how many of the OldDepth outermost template parameter lists would be removed by substituting these arguments.
Definition at line 151 of file Template.h.
References getNumLevels().
|
inline |
Determine the number of levels in this template argument list.
Definition at line 129 of file Template.h.
Referenced by CalculateTemplateDepthForConstraints(), CheckConstraintSatisfaction(), clang::Sema::CheckParameterPacksForExpansion(), dump(), getAssociatedDecl(), getNewDepth(), clang::Sema::getNumArgumentsInExpansionFromUnexpanded(), getNumSubsitutedArgs(), hasTemplateArgument(), operator()(), setArgument(), and clang::Sema::SubstConceptTemplateArguments().
|
inline |
Definition at line 145 of file Template.h.
Referenced by clang::Sema::FindInstantiatedDecl().
Definition at line 140 of file Template.h.
References getNumLevels().
|
inline |
Determine the number of substituted levels in this template argument list.
Definition at line 135 of file Template.h.
Referenced by SubstituteConstraintExpressionWithoutSatisfaction().
|
inline |
Retrieve the outermost template argument list.
Definition at line 281 of file Template.h.
|
inline |
Determine whether there is a non-NULL template argument at the given depth and index.
There must exist a template argument list at the given depth.
Definition at line 181 of file Template.h.
References getNumLevels().
Referenced by clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::getNumArgumentsInExpansionFromUnexpanded(), and clang::Sema::SubstConceptTemplateArguments().
|
inline |
Definition at line 194 of file Template.h.
References clang::TemplateArgument::Args, clang::TemplateArgument::isInstantiationDependent(), and clang::TemplateArgument::isNull().
Referenced by CheckConstraintSatisfaction().
|
inline |
Determine whether we are rewriting template parameters rather than substituting for them.
If so, we should not leave references to the original template parameters behind.
Definition at line 123 of file Template.h.
References clang::Rewrite.
|
inline |
Retrieve the template argument at a given depth and index.
Definition at line 160 of file Template.h.
References getNumLevels().
|
inline |
Replaces the current 'innermost' level with the provided argument list.
This is useful for type deduction cases where we need to get the entire list from the AST, but then add the deduced innermost list.
Definition at line 245 of file Template.h.
Referenced by CheckDeducedArgumentConstraints().
|
inline |
Definition at line 259 of file Template.h.
|
inline |
Definition at line 115 of file Template.h.
|
inline |
Clear out a specific template argument.
Definition at line 205 of file Template.h.
References getNumLevels().
|
inline |
Definition at line 111 of file Template.h.
Referenced by clang::Sema::SubstSpaceshipAsEqualEqual().
|
inline |
Definition at line 113 of file Template.h.