clang  10.0.0svn
Public Member Functions | Protected Member Functions | Friends | List of all members
clang::interp::ByteCodeStmtGen< Emitter > Class Template Reference

Compilation context for statements. More...

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

Inheritance diagram for clang::interp::ByteCodeStmtGen< Emitter >:
Inheritance graph
[legend]
Collaboration diagram for clang::interp::ByteCodeStmtGen< Emitter >:
Collaboration graph
[legend]

Public Member Functions

template<typename... Tys>
 ByteCodeStmtGen (Tys &&... Args)
 
- Public Member Functions inherited from clang::interp::ByteCodeExprGen< Emitter >
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)
 
- Public Member Functions inherited from clang::StmtVisitorBase< llvm::make_const_ptr, ByteCodeExprGen< Emitter >, bool, ParamTys... >
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
 
- Protected Member Functions inherited from clang::interp::ByteCodeExprGen< Emitter >
bool visitExpr (const Expr *E) override
 
bool visitDecl (const VarDecl *VD) override
 
void emitCleanup ()
 Emits scope cleanup instructions. More...
 
const RecordTypegetRecordTy (QualType Ty)
 Returns a record type from a record or pointer type. More...
 
RecordgetRecord (QualType Ty)
 Returns a record from a record or pointer type. More...
 
RecordgetRecord (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< PrimTypeclassify (const Expr *E) const
 Classifies a type. More...
 
llvm::Optional< PrimTypeclassify (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

- Public Attributes inherited from clang::StmtVisitorBase< llvm::make_const_ptr, ByteCodeExprGen< Emitter >, bool, ParamTys... >
ParamTys P
 
- Protected Types inherited from clang::interp::ByteCodeExprGen< Emitter >
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()>
 
- Protected Attributes inherited from clang::interp::ByteCodeExprGen< Emitter >
ContextCtx
 Current compilation context. More...
 
ProgramP
 Program to link to. More...
 
llvm::DenseMap< const ValueDecl *, Scope::LocalLocals
 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< InitFnRefInitFn = {}
 Expression being initialized. More...
 

Detailed Description

template<class Emitter>
class clang::interp::ByteCodeStmtGen< Emitter >

Compilation context for statements.

Definition at line 40 of file ByteCodeStmtGen.h.

Constructor & Destructor Documentation

◆ ByteCodeStmtGen()

template<class Emitter>
template<typename... Tys>
clang::interp::ByteCodeStmtGen< Emitter >::ByteCodeStmtGen ( Tys &&...  Args)
inline

Member Function Documentation

◆ visitFunc()

template<class Emitter >
bool ByteCodeStmtGen::visitFunc ( const FunctionDecl F)
overrideprotected

Friends And Related Function Documentation

◆ LabelScope< Emitter >

template<class Emitter>
friend class LabelScope< Emitter >
friend

Definition at line 55 of file ByteCodeStmtGen.h.

◆ LoopScope< Emitter >

template<class Emitter>
friend class LoopScope< Emitter >
friend

Definition at line 56 of file ByteCodeStmtGen.h.

◆ SwitchScope< Emitter >

template<class Emitter>
friend class SwitchScope< Emitter >
friend

Definition at line 57 of file ByteCodeStmtGen.h.


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