19 #include "llvm/ADT/ArrayRef.h" 20 #include "llvm/ADT/FoldingSet.h" 21 using namespace clang;
25 NumRecords{Satisfaction.
Details.size()},
28 auto &Detail = Satisfaction.Details[I];
29 if (Detail.second.is<
Expr *>())
30 new (getTrailingObjects<UnsatisfiedConstraintRecord>() + I)
32 UnsatisfiedConstraintRecord::second_type(
33 Detail.second.get<
Expr *>())};
35 auto &SubstitutionDiagnostic =
36 *Detail.second.get<std::pair<SourceLocation, StringRef> *>();
37 unsigned MessageSize = SubstitutionDiagnostic.second.size();
38 char *Mem =
new (
C)
char[MessageSize];
39 memcpy(Mem, SubstitutionDiagnostic.second.data(), MessageSize);
40 auto *NewSubstDiag =
new (
C) std::pair<SourceLocation, StringRef>(
41 SubstitutionDiagnostic.first, StringRef(Mem, MessageSize));
42 new (getTrailingObjects<UnsatisfiedConstraintRecord>() + I)
44 UnsatisfiedConstraintRecord::second_type(
55 totalSizeToAlloc<UnsatisfiedConstraintRecord>(
64 ID.AddPointer(ConstraintOwner);
65 ID.AddInteger(TemplateArgs.size());
66 for (
auto &Arg : TemplateArgs)
Defines the clang::ASTContext interface.
std::pair< const Expr *, llvm::PointerUnion< Expr *, std::pair< SourceLocation, StringRef > * > > UnsatisfiedConstraintRecord
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
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)
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
void * Allocate(size_t Size, unsigned Align=8) const
Dataflow Directional Tag Classes.
ASTConstraintSatisfaction(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
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...
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
This represents a decl that may have a name.
This file provides AST data structures related to concepts.