clang
10.0.0git
|
An emitter which evaluates opcodes as they are emitted. More...
#include "/work/www-prereleases/10.0.0/rc2/docsbuild/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 () |
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... | |
Protected Member Functions | |
EvalEmitter (Context &Ctx, Program &P, State &Parent, InterpStack &Stk, APValue &Result) | |
virtual | ~EvalEmitter () |
void | emitLabel (LabelTy Label) |
Define a label. More... | |
LabelTy | getLabel () |
Create a label. More... | |
virtual bool | visitExpr (const Expr *E)=0 |
Methods implemented by the compiler. More... | |
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. More... | |
bool | jumpFalse (const LabelTy &Label) |
bool | jump (const LabelTy &Label) |
bool | fallthrough (const LabelTy &Label) |
Local | createLocal (Descriptor *D) |
Callback for registering a local. More... | |
SourceInfo | getSource (Function *F, CodePtr PC) const override |
Returns the source location of the current opcode. More... | |
Protected Attributes | |
llvm::DenseMap< const ParmVarDecl *, unsigned > | Params |
Parameter indices. More... | |
llvm::SmallVector< SmallVector< Local, 8 >, 2 > | Descriptors |
Local descriptors. More... | |
An emitter which evaluates opcodes as they are emitted.
Definition at line 36 of file EvalEmitter.h.
Definition at line 39 of file EvalEmitter.h.
using clang::interp::EvalEmitter::LabelTy = uint32_t |
Definition at line 38 of file EvalEmitter.h.
Definition at line 40 of file EvalEmitter.h.
|
protected |
Definition at line 22 of file EvalEmitter.cpp.
|
inlineprotectedvirtual |
Definition at line 49 of file EvalEmitter.h.
References emitLabel(), getLabel(), Label, visitDecl(), and visitExpr().
Definition at line 60 of file EvalEmitter.h.
References bail(), and clang::Stmt::getBeginLoc().
Referenced by bail().
Definition at line 61 of file EvalEmitter.h.
References bail(), createLocal(), fallthrough(), clang::Decl::getBeginLoc(), jump(), jumpFalse(), and jumpTrue().
Referenced by bail().
|
protected |
Definition at line 63 of file EvalEmitter.cpp.
|
protected |
Callback for registering a local.
Definition at line 51 of file EvalEmitter.cpp.
References clang::interp::Descriptor::getAllocSize(), and clang::interp::Block::invokeCtor().
Referenced by bail().
|
protected |
Define a label.
Definition at line 45 of file EvalEmitter.cpp.
References Label.
Referenced by ~EvalEmitter().
Definition at line 91 of file EvalEmitter.cpp.
References clang::interp::Pointer::atField(), clang::interp::Pointer::atIndex(), clang::interp::Context::classify(), clang::interp::InterpState::deallocate(), clang::interp::Record::Field::Decl, clang::interp::Record::Base::Decl, clang::interp::Pointer::deref(), Descriptors, clang::interp::Record::fields(), clang::APValue::getArrayInitializedElt(), clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::interp::Context::getASTContext(), clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::interp::Record::getNumBases(), clang::interp::Pointer::getNumElems(), clang::interp::Record::getNumFields(), clang::interp::Record::getNumVirtualBases(), clang::ASTContext::getRecordType(), clang::APValue::getStructField(), clang::ValueDecl::getType(), clang::interp::Record::getVirtualBase(), clang::interp::Pointer::isActive(), Label, clang::interp::Pointer::narrow(), clang::interp::Record::Field::Offset, clang::interp::Record::Base::Offset, clang::interp::Scope::Local::Offset, clang::interp::InterpStack::pop(), clang::interp::InterpStack::push(), clang::interp::InterpState::Stk, and TYPE_SWITCH.
Referenced by bail().
|
protected |
|
inlineoverrideprotectedvirtual |
Returns the source location of the current opcode.
Implements clang::interp::SourceMapper.
Definition at line 74 of file EvalEmitter.h.
References clang::interp::Function::getSource().
llvm::Expected< bool > EvalEmitter::interpretDecl | ( | const VarDecl * | VD | ) |
Definition at line 37 of file EvalEmitter.cpp.
References visitDecl().
llvm::Expected< bool > EvalEmitter::interpretExpr | ( | const Expr * | E | ) |
Definition at line 29 of file EvalEmitter.cpp.
References visitExpr().
Definition at line 77 of file EvalEmitter.cpp.
References Label, clang::interp::InterpStack::pop(), and clang::interp::InterpState::Stk.
Referenced by bail().
Emits jumps.
Definition at line 69 of file EvalEmitter.cpp.
References Label, clang::interp::InterpStack::pop(), and clang::interp::InterpState::Stk.
Referenced by bail().
Referenced by interpretDecl(), and ~EvalEmitter().
Methods implemented by the compiler.
Referenced by interpretExpr(), and ~EvalEmitter().
|
protected |
|
protected |
Parameter indices.
Definition at line 79 of file EvalEmitter.h.