clang
10.0.0git
|
Compilation context for statements. More...
#include "/work/www-prereleases/10.0.0/rc2/docsbuild/clang/lib/AST/Interp/ByteCodeStmtGen.h"
Public Member Functions | |
template<typename... Tys> | |
ByteCodeStmtGen (Tys &&... Args) | |
![]() | |
template<typename... Tys> | |
ByteCodeExprGen (Context &Ctx, Program &P, Tys &&... Args) | |
Initializes the compiler and the backend emitter. More... | |
bool | VisitCastExpr (const CastExpr *E) |
bool | VisitIntegerLiteral (const IntegerLiteral *E) |
bool | VisitParenExpr (const ParenExpr *E) |
bool | VisitBinaryOperator (const BinaryOperator *E) |
![]() | |
bool | Visit (PTR(Stmt) S, ParamTys... P) |
BINOP_FALLBACK (PtrMemD) BINOP_FALLBACK(PtrMemI) BINOP_FALLBACK(Mul) BINOP_FALLBACK(Div) BINOP_FALLBACK(Rem) BINOP_FALLBACK(Add) BINOP_FALLBACK(Sub) BINOP_FALLBACK(Shl) BINOP_FALLBACK(LT) BINOP_FALLBACK(GT) BINOP_FALLBACK(LE) BINOP_FALLBACK(GE) BINOP_FALLBACK(EQ) BINOP_FALLBACK(NE) BINOP_FALLBACK(And) BINOP_FALLBACK(Xor) BINOP_FALLBACK(Or) BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec) UNARYOP_FALLBACK(PreInc) UNARYOP_FALLBACK(PreDec) UNARYOP_FALLBACK(AddrOf) UNARYOP_FALLBACK(Deref) UNARYOP_FALLBACK(Plus) UNARYOP_FALLBACK(Minus) UNARYOP_FALLBACK(Not) UNARYOP_FALLBACK(LNot) UNARYOP_FALLBACK(Real) UNARYOP_FALLBACK(Imag) UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(Coawait) bool VisitStmt(PTR(Stmt) Node | |
Protected Member Functions | |
bool | visitFunc (const FunctionDecl *F) override |
![]() | |
bool | visitExpr (const Expr *E) override |
bool | visitDecl (const VarDecl *VD) override |
void | emitCleanup () |
Emits scope cleanup instructions. More... | |
const RecordType * | getRecordTy (QualType Ty) |
Returns a record type from a record or pointer type. More... | |
Record * | getRecord (QualType Ty) |
Returns a record from a record or pointer type. More... | |
Record * | getRecord (const RecordDecl *RD) |
unsigned | getIntWidth (QualType Ty) |
Returns the size int bits of an integer. More... | |
unsigned | getCharBit () const |
Returns the value of CHAR_BIT. More... | |
llvm::Optional< PrimType > | classify (const Expr *E) const |
Classifies a type. More... | |
llvm::Optional< PrimType > | classify (QualType Ty) const |
bool | needsAdjust (QualType Ty) const |
Checks if a pointer needs adjustment. More... | |
PrimType | classifyPrim (QualType Ty) const |
Classifies a known primitive type. More... | |
bool | discard (const Expr *E) |
Evaluates an expression for side effects and discards the result. More... | |
bool | visit (const Expr *E) |
Evaluates an expression and places result on stack. More... | |
bool | visitInitializer (const Expr *E, InitFnRef GenPtr) |
Compiles an initializer for a local. More... | |
bool | visitBool (const Expr *E) |
Visits an expression and converts it to a boolean. More... | |
bool | visitLocalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a local. More... | |
bool | visitGlobalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a global. More... | |
bool | visitThisInitializer (const Expr *I) |
Visits a delegated initializer. More... | |
unsigned | allocateLocalPrimitive (DeclTy &&Decl, PrimType Ty, bool IsMutable, bool IsExtended=false) |
Creates a local primitive value. More... | |
llvm::Optional< unsigned > | allocateLocal (DeclTy &&Decl, bool IsExtended=false) |
Allocates a space storing a local given its type. More... | |
Friends | |
class | LabelScope< Emitter > |
class | LoopScope< Emitter > |
class | SwitchScope< Emitter > |
Additional Inherited Members | |
![]() | |
ParamTys | P |
![]() | |
using | NullaryFn = bool(ByteCodeExprGen::*)(const SourceInfo &) |
using | UnaryFn = bool(ByteCodeExprGen::*)(PrimType, const SourceInfo &) |
using | BinaryFn = bool(ByteCodeExprGen::*)(PrimType, PrimType, const SourceInfo &) |
using | LabelTy = typename Emitter::LabelTy |
using | AddrTy = typename Emitter::AddrTy |
using | InitFnRef = std::function< bool()> |
![]() | |
Context & | Ctx |
Current compilation context. More... | |
Program & | P |
Program to link to. More... | |
llvm::DenseMap< const ValueDecl *, Scope::Local > | Locals |
Variable to storage mapping. More... | |
llvm::DenseMap< const OpaqueValueExpr *, unsigned > | OpaqueExprs |
OpaqueValueExpr to location mapping. More... | |
VariableScope< Emitter > * | VarScope = nullptr |
Current scope. More... | |
llvm::Optional< uint64_t > | ArrayIndex |
Current argument index. More... | |
bool | DiscardResult = false |
Flag indicating if return value is to be discarded. More... | |
llvm::Optional< InitFnRef > | InitFn = {} |
Expression being initialized. More... | |
Compilation context for statements.
Definition at line 40 of file ByteCodeStmtGen.h.
|
inline |
Definition at line 48 of file ByteCodeStmtGen.h.
References clang::interp::ByteCodeStmtGen< Emitter >::visitFunc().
|
overrideprotected |
Definition at line 93 of file ByteCodeStmtGen.cpp.
References clang::FunctionDecl::getBody(), clang::FunctionDecl::getReturnType(), and clang::Type::isVoidType().
Referenced by clang::interp::ByteCodeStmtGen< Emitter >::ByteCodeStmtGen().
|
friend |
Definition at line 55 of file ByteCodeStmtGen.h.
Definition at line 56 of file ByteCodeStmtGen.h.
|
friend |
Definition at line 57 of file ByteCodeStmtGen.h.