clang 10.0.0git

Public Member Functions | Public Attributes | List of all members
clang::interp::InterpState Class Referencefinal

Interpreter context. More...

`#include "/work/www-prereleases/10.0.0/rc1/docsbuild/clang/lib/AST/Interp/InterpState.h"`

Inheritance diagram for clang::interp::InterpState:
[legend]
Collaboration diagram for clang::interp::InterpState:
[legend]

## Public Member Functions
| InterpState (State &Parent, Program &P, InterpStack &Stk, Context &Ctx, SourceMapper *M=nullptr)
| ~InterpState ()
Frame * | getSplitFrame ()
Frame * | getCurrentFrame () override
unsigned | getCallStackDepth () override
const Frame * | getBottomFrame () const override
Expr::EvalStatus & | getEvalStatus () const override
ASTContext & | getCtx () const override
bool | checkingForUndefinedBehavior () const override
bool | keepEvaluatingAfterFailure () const override
bool | checkingPotentialConstantExpression () const override
bool | noteUndefinedBehavior () override
bool | hasActiveDiagnostic () override
void | setActiveDiagnostic (bool Flag) override
void | setFoldFailureDiagnostic (bool Flag) override
bool | hasPriorDiagnostic () override
bool | reportOverflow (const Expr *E, const llvm::APSInt &Value)
| Reports overflow and return true if evaluation should continue. More...
void | deallocate (Block *B)
| Deallocates a pointer. More...
SourceInfo | getSource (Function *F, CodePtr PC) const override
| Delegates source mapping to the mapper. More...
Public Member Functions inherited from clang::interp::State
virtual | ~State ()
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 LangOptions & | getLangOpts () const
Public Member Functions inherited from clang::interp::SourceMapper
virtual | ~SourceMapper ()
const Expr * | getExpr (Function *F, CodePtr PC) const
| Returns the expression if an opcode belongs to one, null otherwise. More...
SourceLocation | getLocation (Function *F, CodePtr PC) const
| Returns the location from which an opcode originates. More...

## Public Attributes
Program & | P
| Reference to the module containing all bytecode. More...
InterpStack & | Stk
| Temporary stack. More...
Context & | Ctx
| Interpreter Context. More...
InterpFrame * | Current = nullptr
| The current frame. More...
unsigned | CallStackDepth
| Call stack depth. More...

## Detailed Description

Interpreter context.

Definition at line 34 of file InterpState.h.

## Constructor & Destructor Documentation

## ◆ InterpState()

InterpState::InterpState | ( | State & | Parent,
|  | Program & | P,
|  | InterpStack & | Stk,
|  | Context & | Ctx,
|  | SourceMapper * | M = `nullptr`
| ) |  |

Definition at line 24 of file InterpState.cpp.

## ◆ ~InterpState()

InterpState::~InterpState | ( |  | ) |

Definition at line 29 of file InterpState.cpp.

References Current.

## Member Function Documentation

## ◆ checkingForUndefinedBehavior()

bool clang::interp::InterpState::checkingForUndefinedBehavior | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 56 of file InterpState.h.

References clang::interp::State::checkingForUndefinedBehavior().

Referenced by clang::interp::AddSubMulHelper().

## ◆ checkingPotentialConstantExpression()

bool clang::interp::InterpState::checkingPotentialConstantExpression | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 62 of file InterpState.h.

References clang::interp::State::checkingPotentialConstantExpression().

Referenced by clang::interp::GetParam(), clang::interp::GetPtrActiveThisField(), clang::interp::GetPtrParam(), clang::interp::GetPtrThisBase(), clang::interp::GetPtrThisField(), clang::interp::GetPtrThisVirtBase(), clang::interp::GetThisField(), clang::interp::InitThisBitField(), clang::interp::InitThisField(), clang::interp::InitThisFieldActive(), clang::interp::SetThisField(), and clang::interp::This().

## ◆ deallocate()

void InterpState::deallocate | ( | Block * | B | ) |

Deallocates a pointer.

Definition at line 57 of file InterpState.cpp.

References clang::interp::Block::data(), clang::interp::Descriptor::DtorFn, clang::interp::Block::getDescriptor(), clang::interp::Block::getSize(), clang::interp::Block::hasPointers(), and clang::interp::Descriptor::MoveFn.

Referenced by clang::interp::InterpFrame::destroy(), clang::interp::EvalEmitter::fallthrough(), hasPriorDiagnostic(), and clang::interp::InterpFrame::~InterpFrame().

## ◆ getBottomFrame()

const Frame* clang::interp::InterpState::getBottomFrame | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 45 of file InterpState.h.

References clang::interp::State::getBottomFrame().

## ◆ getCallStackDepth()

unsigned clang::interp::InterpState::getCallStackDepth | ( |  | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 44 of file InterpState.h.

References CallStackDepth.

## ◆ getCtx()

ASTContext& clang::interp::InterpState::getCtx | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 53 of file InterpState.h.

References clang::interp::State::getCtx().

Referenced by clang::interp::InterpFrame::describe(), clang::interp::InitBitField(), clang::interp::InitThisBitField(), clang::interp::StoreBitField(), and clang::interp::StoreBitFieldPop().

## ◆ getCurrentFrame()

Frame * InterpState::getCurrentFrame | ( |  | ) |
| override virtual

Implements clang::interp::State.

Definition at line 43 of file InterpState.cpp.

References clang::interp::InterpFrame::Caller, Current, and clang::interp::State::getCurrentFrame().

Referenced by getSplitFrame().

## ◆ getEvalStatus()

Expr::EvalStatus& clang::interp::InterpState::getEvalStatus | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 50 of file InterpState.h.

References clang::interp::State::getEvalStatus().

## ◆ getSource()

SourceInfo clang::interp::InterpState::getSource | ( | Function * | F,
|  | CodePtr | PC
| ) |  | const
| inline override virtual

Delegates source mapping to the mapper.

Implements clang::interp::SourceMapper.

Definition at line 84 of file InterpState.h.

References clang::interp::Function::getSource(), and clang::interp::SourceMapper::getSource().

Referenced by clang::interp::InterpFrame::getSource().

## ◆ getSplitFrame()

Frame* clang::interp::InterpState::getSplitFrame | ( |  | ) |
| inline

Definition at line 42 of file InterpState.h.

References getCurrentFrame(), and clang::interp::State::getCurrentFrame().

Referenced by clang::interp::InterpFrame::getCaller().

## ◆ hasActiveDiagnostic()

bool clang::interp::InterpState::hasActiveDiagnostic | ( |  | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 68 of file InterpState.h.

References clang::interp::State::hasActiveDiagnostic().

## ◆ hasPriorDiagnostic()

bool clang::interp::InterpState::hasPriorDiagnostic | ( |  | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 75 of file InterpState.h.

References deallocate(), clang::interp::State::hasPriorDiagnostic(), and reportOverflow().

## ◆ keepEvaluatingAfterFailure()

bool clang::interp::InterpState::keepEvaluatingAfterFailure | ( |  | ) | const
| inline override virtual

Implements clang::interp::State.

Definition at line 59 of file InterpState.h.

References clang::interp::State::keepEvaluatingAfterFailure().

## ◆ noteUndefinedBehavior()

bool clang::interp::InterpState::noteUndefinedBehavior | ( |  | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 65 of file InterpState.h.

References clang::interp::State::noteUndefinedBehavior().

Referenced by clang::interp::AddSubMulHelper(), and reportOverflow().

## ◆ reportOverflow()

bool InterpState::reportOverflow | ( | const Expr * | E,
|  | const llvm::APSInt & | Value
| ) |  |

Reports overflow and return true if evaluation should continue.

Definition at line 51 of file InterpState.cpp.

References clang::interp::State::CCEDiag(), clang::Expr::getType(), and noteUndefinedBehavior().

Referenced by hasPriorDiagnostic().

## ◆ setActiveDiagnostic()

void clang::interp::InterpState::setActiveDiagnostic | ( | bool | Flag | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 69 of file InterpState.h.

References clang::interp::State::setActiveDiagnostic().

## ◆ setFoldFailureDiagnostic()

void clang::interp::InterpState::setFoldFailureDiagnostic | ( | bool | Flag | ) |
| inline override virtual

Implements clang::interp::State.

Definition at line 72 of file InterpState.h.

References clang::interp::State::setFoldFailureDiagnostic().

## Member Data Documentation

## ◆ CallStackDepth

unsigned clang::interp::InterpState::CallStackDepth

Call stack depth.

Definition at line 106 of file InterpState.h.

Referenced by getCallStackDepth().

## ◆ Ctx

Context& clang::interp::InterpState::Ctx

Interpreter Context.

Definition at line 102 of file InterpState.h.

Referenced by clang::interp::InterpFrame::describe().

## ◆ Current

InterpFrame* clang::interp::InterpState::Current = nullptr

The current frame.

Definition at line 104 of file InterpState.h.

Referenced by clang::interp::AddSubMulHelper(), clang::interp::Destroy(), getCurrentFrame(), clang::interp::GetLocal(), clang::interp::GetParam(), clang::interp::GetPtrActiveThisField(), clang::interp::GetPtrLocal(), clang::interp::GetPtrParam(), clang::interp::GetPtrThisBase(), clang::interp::GetPtrThisField(), clang::interp::GetPtrThisVirtBase(), clang::interp::GetThisField(), clang::interp::InitThisBitField(), clang::interp::InitThisField(), clang::interp::InitThisFieldActive(), clang::interp::NoRet(), clang::interp::SetLocal(), clang::interp::SetParam(), clang::interp::SetThisField(), clang::interp::ShiftLeft(), clang::interp::Shl(), clang::interp::Shr(), clang::interp::This(), clang::interp::Trunc(), and ~InterpState().

## ◆ P

Program& clang::interp::InterpState::P

Reference to the module containing all bytecode.

Definition at line 98 of file InterpState.h.

Referenced by clang::interp::GetGlobal(), clang::interp::GetPtrGlobal(), and clang::interp::InitGlobal().

## ◆ Stk

InterpStack& clang::interp::InterpState::Stk

Temporary stack.

Definition at line 100 of file InterpState.h.

Referenced by clang::interp::Add(), clang::interp::AddSubMulHelper(), clang::interp::Cast(), clang::interp::CmpHelper(), clang::interp::Const(), clang::interp::Dup(), clang::interp::ExpandPtr(), clang::interp::EvalEmitter::fallthrough(), clang::interp::GetField(), clang::interp::GetFieldPop(), clang::interp::GetGlobal(), clang::interp::GetLocal(), clang::interp::GetParam(), clang::interp::GetPtrActiveField(), clang::interp::GetPtrActiveThisField(), clang::interp::GetPtrBase(), clang::interp::GetPtrField(), clang::interp::GetPtrGlobal(), clang::interp::GetPtrLocal(), clang::interp::GetPtrParam(), clang::interp::GetPtrThisBase(), clang::interp::GetPtrThisField(), clang::interp::GetPtrVirtBase(), clang::interp::GetThisField(), clang::interp::InitBitField(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::InitField(), clang::interp::InitFieldActive(), clang::interp::InitGlobal(), clang::interp::InitPop(), clang::interp::InitThisBitField(), clang::interp::InitThisField(), clang::interp::InitThisFieldActive(), clang::interp::InRange(), clang::interp::EvalEmitter::jumpFalse(), clang::interp::EvalEmitter::jumpTrue(), clang::interp::Load(), clang::interp::LoadPop(), clang::interp::Mul(), clang::interp::NarrowPtr(), clang::interp::Null(), clang::interp::OffsetHelper(), clang::interp::Pop(), clang::interp::InterpFrame::popArgs(), clang::interp::SetField(), clang::interp::SetLocal(), clang::interp::SetParam(), clang::interp::SetThisField(), clang::interp::ShiftLeft(), clang::interp::ShiftRight(), clang::interp::Shl(), clang::interp::Shr(), clang::interp::Store(), clang::interp::StoreBitField(), clang::interp::StoreBitFieldPop(), clang::interp::StorePop(), clang::interp::Sub(), clang::interp::This(), clang::interp::VirtBaseHelper(), and clang::interp::Zero().

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

- lib/AST/Interp/InterpState.h
- lib/AST/Interp/InterpState.cpp