clang  10.0.0svn
Public Member Functions | List of all members
clang::interp::State Class Referenceabstract

Interface for the VM to interact with the AST walker's context. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/AST/Interp/State.h"

Inheritance diagram for clang::interp::State:
Inheritance graph
[legend]

Public Member Functions

virtual ~State ()
 
virtual bool checkingForUndefinedBehavior () const =0
 
virtual bool checkingPotentialConstantExpression () const =0
 
virtual bool noteUndefinedBehavior ()=0
 
virtual bool keepEvaluatingAfterFailure () const =0
 
virtual FramegetCurrentFrame ()=0
 
virtual const FramegetBottomFrame () const =0
 
virtual bool hasActiveDiagnostic ()=0
 
virtual void setActiveDiagnostic (bool Flag)=0
 
virtual void setFoldFailureDiagnostic (bool Flag)=0
 
virtual Expr::EvalStatusgetEvalStatus () const =0
 
virtual ASTContextgetCtx () const =0
 
virtual bool hasPriorDiagnostic ()=0
 
virtual unsigned getCallStackDepth ()=0
 
OptionalDiagnostic FFDiag (SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
 
OptionalDiagnostic FFDiag (const Expr *E, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
 
OptionalDiagnostic FFDiag (const SourceInfo &SI, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
 
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. More...
 
OptionalDiagnostic CCEDiag (const Expr *E, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
 
OptionalDiagnostic CCEDiag (const SourceInfo &SI, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
 
OptionalDiagnostic Note (SourceLocation Loc, diag::kind DiagId)
 Add a note to a prior diagnostic. More...
 
void addNotes (ArrayRef< PartialDiagnosticAt > Diags)
 Add a stack of notes to a prior diagnostic. More...
 
DiagnosticBuilder report (SourceLocation Loc, diag::kind DiagId)
 Directly reports a diagnostic message. More...
 
const LangOptionsgetLangOpts () const
 

Detailed Description

Interface for the VM to interact with the AST walker's context.

Definition at line 55 of file State.h.

Constructor & Destructor Documentation

◆ ~State()

State::~State ( )
virtual

Definition at line 18 of file State.cpp.

Member Function Documentation

◆ addNotes()

void State::addNotes ( ArrayRef< PartialDiagnosticAt Diags)

Add a stack of notes to a prior diagnostic.

Definition at line 68 of file State.cpp.

References Diag(), clang::Expr::EvalStatus::Diag, getEvalStatus(), and hasActiveDiagnostic().

◆ CCEDiag() [1/3]

OptionalDiagnostic State::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.

FIXME: Stop evaluating if we're in EM_ConstantExpression or EM_PotentialConstantExpression mode and we produce one of these.

Definition at line 41 of file State.cpp.

References Diag(), getEvalStatus(), and setActiveDiagnostic().

Referenced by clang::interp::AddSubMulHelper(), CCEDiag(), clang::interp::InterpState::reportOverflow(), clang::interp::ShiftLeft(), clang::interp::Shl(), clang::interp::Shr(), and clang::interp::Trunc().

◆ CCEDiag() [2/3]

OptionalDiagnostic State::CCEDiag ( const Expr E,
diag::kind  DiagId = diag::note_invalid_subexpr_in_const_expr,
unsigned  ExtraNotes = 0 
)

Definition at line 52 of file State.cpp.

References CCEDiag(), and clang::Expr::getExprLoc().

◆ CCEDiag() [3/3]

OptionalDiagnostic State::CCEDiag ( const SourceInfo SI,
diag::kind  DiagId = diag::note_invalid_subexpr_in_const_expr,
unsigned  ExtraNotes = 0 
)

Definition at line 57 of file State.cpp.

References CCEDiag(), and clang::interp::SourceInfo::getLoc().

◆ checkingForUndefinedBehavior()

virtual bool clang::interp::State::checkingForUndefinedBehavior ( ) const
pure virtual

◆ checkingPotentialConstantExpression()

virtual bool clang::interp::State::checkingPotentialConstantExpression ( ) const
pure virtual

◆ FFDiag() [1/3]

OptionalDiagnostic State::FFDiag ( SourceLocation  Loc,
diag::kind  DiagId = diag::note_invalid_subexpr_in_const_expr,
unsigned  ExtraNotes = 0 
)

◆ FFDiag() [2/3]

OptionalDiagnostic State::FFDiag ( const Expr E,
diag::kind  DiagId = diag::note_invalid_subexpr_in_const_expr,
unsigned  ExtraNotes = 0 
)

Definition at line 25 of file State.cpp.

References Diag(), getEvalStatus(), clang::Expr::getExprLoc(), and setActiveDiagnostic().

◆ FFDiag() [3/3]

OptionalDiagnostic State::FFDiag ( const SourceInfo SI,
diag::kind  DiagId = diag::note_invalid_subexpr_in_const_expr,
unsigned  ExtraNotes = 0 
)

◆ getBottomFrame()

virtual const Frame* clang::interp::State::getBottomFrame ( ) const
pure virtual

◆ getCallStackDepth()

virtual unsigned clang::interp::State::getCallStackDepth ( )
pure virtual

Implemented in clang::interp::InterpState.

Referenced by getLangOpts(), and report().

◆ getCtx()

virtual ASTContext& clang::interp::State::getCtx ( ) const
pure virtual

◆ getCurrentFrame()

virtual Frame* clang::interp::State::getCurrentFrame ( )
pure virtual

◆ getEvalStatus()

virtual Expr::EvalStatus& clang::interp::State::getEvalStatus ( ) const
pure virtual

◆ getLangOpts()

const LangOptions & State::getLangOpts ( ) const

◆ hasActiveDiagnostic()

virtual bool clang::interp::State::hasActiveDiagnostic ( )
pure virtual

◆ hasPriorDiagnostic()

virtual bool clang::interp::State::hasPriorDiagnostic ( )
pure virtual

◆ keepEvaluatingAfterFailure()

virtual bool clang::interp::State::keepEvaluatingAfterFailure ( ) const
pure virtual

◆ Note()

OptionalDiagnostic State::Note ( SourceLocation  Loc,
diag::kind  DiagId 
)

Add a note to a prior diagnostic.

Definition at line 62 of file State.cpp.

References hasActiveDiagnostic().

◆ noteUndefinedBehavior()

virtual bool clang::interp::State::noteUndefinedBehavior ( )
pure virtual

◆ report()

DiagnosticBuilder State::report ( SourceLocation  Loc,
diag::kind  DiagId 
)

◆ setActiveDiagnostic()

virtual void clang::interp::State::setActiveDiagnostic ( bool  Flag)
pure virtual

◆ setFoldFailureDiagnostic()

virtual void clang::interp::State::setFoldFailureDiagnostic ( bool  Flag)
pure virtual

The documentation for this class was generated from the following files: