16 using namespace clang;
22 unsigned ExtraNotes) {
23 return diag(
Loc, DiagId, ExtraNotes,
false);
27 unsigned ExtraNotes) {
29 return diag(E->
getExprLoc(), DiagId, ExtraNotes,
false);
35 unsigned ExtraNotes) {
37 return diag(SI.
getLoc(), DiagId, ExtraNotes,
false);
43 unsigned ExtraNotes) {
50 return diag(
Loc, DiagId, ExtraNotes,
true);
54 unsigned ExtraNotes) {
59 unsigned ExtraNotes) {
88 unsigned ExtraNotes,
bool IsCCEDiag) {
90 if (EvalStatus.
Diag) {
98 CallStackNotes =
std::min(CallStackNotes, Limit + 1);
104 EvalStatus.
Diag->clear();
105 EvalStatus.
Diag->reserve(1 + ExtraNotes + CallStackNotes);
106 addDiag(
Loc, DiagId);
118 void State::addCallStack(
unsigned Limit) {
121 unsigned SkipStart = ActiveCalls, SkipEnd = SkipStart;
122 if (Limit && Limit < ActiveCalls) {
123 SkipStart = Limit / 2 + Limit % 2;
124 SkipEnd = ActiveCalls - Limit / 2;
128 unsigned CallIdx = 0;
131 for (
const Frame *F = Top; F != Bottom; F = F->
getCaller(), ++CallIdx) {
135 if (CallIdx >= SkipStart && CallIdx < SkipEnd) {
136 if (CallIdx == SkipStart) {
138 addDiag(CallRange.
getBegin(), diag::note_constexpr_calls_suppressed)
147 dyn_cast_if_present<CXXConstructorDecl>(F->getCallee());
148 CD && CD->isInheritingConstructor()) {
150 diag::note_constexpr_inherited_ctor_call_here)
156 llvm::raw_svector_ostream Out(Buffer);
159 addDiag(CallRange.
getBegin(), diag::note_constexpr_call_here)
160 << Out.str() << CallRange;
Defines the clang::ASTContext interface.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Implements a partial diagnostic which may not be emitted.
__DEVICE__ int min(int __a, int __b)
const LangOptions & getLangOpts() const
DiagnosticsEngine & getDiagnostics() const
A little helper class used to produce diagnostics.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
unsigned getConstexprBacktraceLimit() const
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic.
This represents one expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A partial diagnostic which we might know in advance that we are not going to emit.
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
Base class for stack frames, shared between VM and walker.
virtual Frame * getCaller() const =0
Returns a pointer to the caller frame.
Describes the statement/declaration an opcode was generated from.
SourceLocation getLoc() const
virtual Frame * getCurrentFrame()=0
virtual bool hasActiveDiagnostic()=0
virtual void setActiveDiagnostic(bool Flag)=0
OptionalDiagnostic Note(SourceLocation Loc, diag::kind DiagId)
Add a note to a prior diagnostic.
virtual bool checkingPotentialConstantExpression() const =0
DiagnosticBuilder report(SourceLocation Loc, diag::kind DiagId)
Directly reports a diagnostic message.
OptionalDiagnostic FFDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
Diagnose that the evaluation could not be folded (FF => FoldFailure)
virtual unsigned getCallStackDepth()=0
virtual const Frame * getBottomFrame() const =0
virtual ASTContext & getCtx() const =0
void addNotes(ArrayRef< PartialDiagnosticAt > Diags)
Add a stack of notes to a prior diagnostic.
const LangOptions & getLangOpts() const
OptionalDiagnostic CCEDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
Diagnose that the evaluation does not produce a C++11 core constant expression.
virtual void setFoldFailureDiagnostic(bool Flag)=0
virtual bool hasPriorDiagnostic()=0
virtual Expr::EvalStatus & getEvalStatus() const =0
The JSON file list parser is used to communicate input to InstallAPI.
EvalStatus is a struct with detailed info about an evaluation in progress.
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...