clang 18.0.0git
|
An emitter which evaluates opcodes as they are emitted. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/EvalEmitter.h"
Public Types | |
using | LabelTy = uint32_t |
using | AddrTy = uintptr_t |
using | Local = Scope::Local |
Public Member Functions | |
llvm::Expected< bool > | interpretExpr (const Expr *E) |
llvm::Expected< bool > | interpretDecl (const VarDecl *VD) |
![]() | |
virtual | ~SourceMapper () |
virtual SourceInfo | getSource (const Function *F, CodePtr PC) const =0 |
Returns source information for a given PC in a function. | |
const Expr * | getExpr (const Function *F, CodePtr PC) const |
Returns the expression if an opcode belongs to one, null otherwise. | |
SourceLocation | getLocation (const Function *F, CodePtr PC) const |
Returns the location from which an opcode originates. | |
SourceRange | getRange (const Function *F, CodePtr PC) const |
Protected Member Functions | |
EvalEmitter (Context &Ctx, Program &P, State &Parent, InterpStack &Stk, APValue &Result) | |
virtual | ~EvalEmitter () |
void | emitLabel (LabelTy Label) |
Define a label. | |
LabelTy | getLabel () |
Create a label. | |
virtual bool | visitExpr (const Expr *E)=0 |
Methods implemented by the compiler. | |
virtual bool | visitDecl (const VarDecl *VD)=0 |
bool | bail (const Stmt *S) |
bool | bail (const Decl *D) |
bool | bail (const SourceLocation &Loc) |
bool | jumpTrue (const LabelTy &Label) |
Emits jumps. | |
bool | jumpFalse (const LabelTy &Label) |
bool | jump (const LabelTy &Label) |
bool | fallthrough (const LabelTy &Label) |
Local | createLocal (Descriptor *D) |
Callback for registering a local. | |
SourceInfo | getSource (const Function *F, CodePtr PC) const override |
Returns the source location of the current opcode. | |
Protected Attributes | |
llvm::DenseMap< const ParmVarDecl *, ParamOffset > | Params |
Parameter indices. | |
llvm::DenseMap< const ValueDecl *, ParamOffset > | LambdaCaptures |
Lambda captures. | |
unsigned | LambdaThisCapture |
llvm::SmallVector< SmallVector< Local, 8 >, 2 > | Descriptors |
Local descriptors. | |
An emitter which evaluates opcodes as they are emitted.
Definition at line 30 of file EvalEmitter.h.
Definition at line 33 of file EvalEmitter.h.
using clang::interp::EvalEmitter::LabelTy = uint32_t |
Definition at line 32 of file EvalEmitter.h.
Definition at line 34 of file EvalEmitter.h.
|
protected |
Definition at line 19 of file EvalEmitter.cpp.
References clang::interp::InterpState::Current.
|
inlineprotectedvirtual |
Definition at line 43 of file EvalEmitter.h.
Definition at line 55 of file EvalEmitter.h.
References bail(), and clang::Decl::getBeginLoc().
Referenced by bail().
|
protected |
Definition at line 71 of file EvalEmitter.cpp.
|
protected |
Callback for registering a local.
Definition at line 49 of file EvalEmitter.cpp.
References clang::interp::InlineDescriptor::Desc, clang::interp::Descriptor::getAllocSize(), clang::interp::Block::invokeCtor(), clang::interp::InlineDescriptor::IsActive, clang::interp::InlineDescriptor::IsBase, clang::interp::InlineDescriptor::IsConst, clang::interp::InlineDescriptor::IsFieldMutable, clang::interp::InlineDescriptor::IsInitialized, and clang::interp::InlineDescriptor::Offset.
|
protected |
Definition at line 99 of file EvalEmitter.cpp.
References Label.
|
protected |
Create a label.
Definition at line 47 of file EvalEmitter.cpp.
|
inlineoverrideprotectedvirtual |
Returns the source location of the current opcode.
Implements clang::interp::SourceMapper.
Definition at line 68 of file EvalEmitter.h.
References clang::interp::Function::getSource(), and clang::interp::Function::hasBody().
llvm::Expected< bool > EvalEmitter::interpretDecl | ( | const VarDecl * | VD | ) |
Definition at line 35 of file EvalEmitter.cpp.
References visitDecl().
llvm::Expected< bool > EvalEmitter::interpretExpr | ( | const Expr * | E | ) |
Definition at line 27 of file EvalEmitter.cpp.
References visitExpr().
Definition at line 93 of file EvalEmitter.cpp.
References Label.
Definition at line 85 of file EvalEmitter.cpp.
References Label, clang::interp::InterpStack::pop(), and clang::interp::InterpState::Stk.
Emits jumps.
Definition at line 77 of file EvalEmitter.cpp.
References Label, clang::interp::InterpStack::pop(), and clang::interp::InterpState::Stk.
Referenced by interpretDecl().
Methods implemented by the compiler.
Referenced by interpretExpr().
|
protected |
Local descriptors.
Definition at line 78 of file EvalEmitter.h.
|
protected |
Lambda captures.
Definition at line 75 of file EvalEmitter.h.
|
protected |
Definition at line 76 of file EvalEmitter.h.
|
protected |
Parameter indices.
Definition at line 73 of file EvalEmitter.h.