14 #ifndef LLVM_CLANG_SEMA_SEMACONCEPT_H 15 #define LLVM_CLANG_SEMA_SEMACONCEPT_H 21 #include "llvm/ADT/PointerUnion.h" 22 #include "llvm/ADT/Optional.h" 23 #include "llvm/ADT/SmallVector.h" 35 ConstraintExpr(ConstraintExpr) { };
41 if (!ParameterMapping)
46 for (
unsigned I = 0, S = ParameterMapping->size(); I < S; ++I) {
47 llvm::FoldingSetNodeID IDA, IDB;
88 std::pair<NormalizedConstraint, NormalizedConstraint> *, 1,
91 llvm::PointerUnion<AtomicConstraint *, CompoundConstraint>
Constraint;
97 new (
C) std::pair<NormalizedConstraint, NormalizedConstraint>{
98 std::move(LHS), std::move(RHS)}, Kind}} { };
105 new (C) std::pair<NormalizedConstraint, NormalizedConstraint>{
112 Constraint(Other.Constraint) {
113 Other.Constraint =
nullptr;
117 if (&Other !=
this) {
125 assert(!isAtomic() &&
"getCompoundKind called on atomic constraint.");
132 assert(!isAtomic() &&
"getLHS called on atomic constraint.");
137 assert(!isAtomic() &&
"getRHS called on atomic constraint.");
143 "getAtomicConstraint called on non-atomic constraint.");
156 #endif //LLVM_CLANG_SEMA_SEMACONCEPT_H Defines the clang::ASTContext interface.
static const TemplateArgument & getArgument(const TemplateArgument &A)
bool subsumes(ASTContext &C, const AtomicConstraint &Other) const
Defines the C++ template declaration subclasses.
NormalizedConstraint(AtomicConstraint *C)
const Expr * ConstraintExpr
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
Used to insert TemplateArguments into FoldingSets.
AtomicConstraint(Sema &S, const Expr *ConstraintExpr)
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::PointerUnion< AtomicConstraint *, CompoundConstraint > Constraint
bool hasMatchingParameterMapping(ASTContext &C, const AtomicConstraint &Other) const
llvm::PointerIntPair< std::pair< NormalizedConstraint, NormalizedConstraint > *, 1, CompoundConstraintKind > CompoundConstraint
Sema - This implements semantic analysis and AST building for C.
This represents one expression.
NormalizedConstraint & operator=(NormalizedConstraint &&Other)
NormalizedConstraint & getRHS() const
CompoundConstraintKind getCompoundKind() const
Dataflow Directional Tag Classes.
NormalizedConstraint(ASTContext &C, const NormalizedConstraint &Other)
NormalizedConstraint & getLHS() const
NormalizedConstraint(NormalizedConstraint &&Other)
Defines the clang::SourceLocation class and associated facilities.
NormalizedConstraint(ASTContext &C, NormalizedConstraint LHS, NormalizedConstraint RHS, CompoundConstraintKind Kind)
AtomicConstraint * getAtomicConstraint() const
This represents a decl that may have a name.
Optional< MutableArrayRef< TemplateArgumentLoc > > ParameterMapping
This file provides AST data structures related to concepts.
A normalized constraint, as defined in C++ [temp.constr.normal], is either an atomic constraint...