18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/FoldingSet.h"
23void CreatUnsatisfiedConstraintRecord(
26 if (Detail.second.is<
Expr *>())
29 UnsatisfiedConstraintRecord::second_type(Detail.second.get<
Expr *>())};
31 auto &SubstitutionDiagnostic =
32 *Detail.second.get<std::pair<SourceLocation, StringRef> *>();
33 unsigned MessageSize = SubstitutionDiagnostic.second.size();
34 char *Mem =
new (
C)
char[MessageSize];
35 memcpy(Mem, SubstitutionDiagnostic.second.data(), MessageSize);
36 auto *NewSubstDiag =
new (
C) std::pair<SourceLocation, StringRef>(
37 SubstitutionDiagnostic.first, StringRef(Mem, MessageSize));
39 Detail.first, UnsatisfiedConstraintRecord::second_type(NewSubstDiag)};
46 : NumRecords{Satisfaction.Details.size()},
47 IsSatisfied{Satisfaction.IsSatisfied}, ContainsErrors{
48 Satisfaction.ContainsErrors} {
50 CreatUnsatisfiedConstraintRecord(
52 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
57 : NumRecords{Satisfaction.NumRecords},
58 IsSatisfied{Satisfaction.IsSatisfied},
59 ContainsErrors{Satisfaction.ContainsErrors} {
61 CreatUnsatisfiedConstraintRecord(
62 C, *(Satisfaction.
begin() + I),
63 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
70 totalSizeToAlloc<UnsatisfiedConstraintRecord>(
79 totalSizeToAlloc<UnsatisfiedConstraintRecord>(Satisfaction.
NumRecords);
87 ID.AddPointer(ConstraintOwner);
88 ID.AddInteger(TemplateArgs.size());
89 for (
auto &Arg : TemplateArgs)
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
This represents one expression.
This represents a decl that may have a name.
@ C
Languages that the frontend can parse and compile.
std::pair< const Expr *, llvm::PointerUnion< Expr *, std::pair< SourceLocation, StringRef > * > > UnsatisfiedConstraintRecord
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 * Rebuild(const ASTContext &C, const ASTConstraintSatisfaction &Satisfaction)
ASTConstraintSatisfaction(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
const UnsatisfiedConstraintRecord * begin() const
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)