15 #ifndef LLVM_CLANG_AST_ASTCONCEPT_H 16 #define LLVM_CLANG_AST_ASTCONCEPT_H 19 #include "llvm/ADT/PointerUnion.h" 20 #include "llvm/ADT/SmallVector.h" 25 class ConceptSpecializationExpr;
32 const NamedDecl *ConstraintOwner =
nullptr;
41 ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(),
42 TemplateArgs.end()) { }
45 using Detail = llvm::PointerUnion<Expr *, SubstitutionDiagnostic *>;
56 Profile(ID, C, ConstraintOwner, TemplateArgs);
69 std::pair<
const Expr *,
70 llvm::PointerUnion<Expr *,
71 std::pair<SourceLocation, StringRef> *>>;
79 UnsatisfiedConstraintRecord> {
84 return getTrailingObjects<UnsatisfiedConstraintRecord>();
88 return getTrailingObjects<UnsatisfiedConstraintRecord>() + NumRecords;
94 static ASTConstraintSatisfaction *
131 NestedNameSpec(NNS), TemplateKWLoc(TemplateKWLoc),
132 ConceptName(ConceptNameInfo), FoundDecl(FoundDecl),
133 NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {}
136 FoundDecl(nullptr), NamedConcept(nullptr), ArgsAsWritten(nullptr) {}
139 return NestedNameSpec;
145 return getConceptNameInfo().getLoc();
159 return ArgsAsWritten;
165 return ArgsAsWritten !=
nullptr;
172 Expr *ImmediatelyDeclaredConstraint =
nullptr;
179 Expr *ImmediatelyDeclaredConstraint) :
181 FoundDecl, NamedConcept, ArgsAsWritten),
182 ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint) {}
188 return ImmediatelyDeclaredConstraint;
196 #endif // LLVM_CLANG_AST_ASTCONCEPT_H Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice.
std::pair< const Expr *, llvm::PointerUnion< Expr *, std::pair< SourceLocation, StringRef > * > > UnsatisfiedConstraintRecord
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr...
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Describes how types, statements, expressions, and declarations should be printed. ...
void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx, QualType Ty)
NamedDecl * getFoundDecl() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
bool hasExplicitTemplateArgs() const
Whether or not template arguments were explicitly specified in the concept reference (they might not ...
llvm::PointerUnion< Expr *, SubstitutionDiagnostic * > Detail
ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
ConceptDecl * getNamedConcept() const
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
const UnsatisfiedConstraintRecord * begin() const
const UnsatisfiedConstraintRecord * end() const
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
This represents one expression.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
SourceLocation getConceptNameLoc() const
const DeclarationNameInfo & getConceptNameInfo() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
NestedNameSpecifierLoc NestedNameSpec
NamedDecl * FoundDecl
The declaration found by name lookup when the expression was created.
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
Encodes a location in the source.
ConstraintSatisfaction()=default
Common data class for constructs that reference concepts with template arguments. ...
TypeConstraint(NestedNameSpecifierLoc NNS, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, Expr *ImmediatelyDeclaredConstraint)
DeclarationNameInfo ConceptName
The concept name used.
Dataflow Directional Tag Classes.
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr...
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
ConceptDecl * NamedConcept
The concept named.
Defines the clang::SourceLocation class and associated facilities.
SourceLocation getTemplateKWLoc() const
const ASTTemplateArgumentListInfo * ArgsAsWritten
The template argument list source info used to specialize the concept.
This represents a decl that may have a name.
ConstraintSatisfaction(const NamedDecl *ConstraintOwner, ArrayRef< TemplateArgument > TemplateArgs)
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.