clang 17.0.0git
Public Member Functions | Protected Member Functions | Friends | List of all members
clang::interp::ByteCodeStmtGen< Emitter > Class Template Referencefinal

Compilation context for statements. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/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.
 
bool VisitCastExpr (const CastExpr *E)
 
bool VisitIntegerLiteral (const IntegerLiteral *E)
 
bool VisitFloatingLiteral (const FloatingLiteral *E)
 
bool VisitParenExpr (const ParenExpr *E)
 
bool VisitBinaryOperator (const BinaryOperator *E)
 
bool VisitLogicalBinOp (const BinaryOperator *E)
 
bool VisitPointerArithBinOp (const BinaryOperator *E)
 Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
 
bool VisitCXXDefaultArgExpr (const CXXDefaultArgExpr *E)
 
bool VisitCallExpr (const CallExpr *E)
 
bool VisitBuiltinCallExpr (const CallExpr *E)
 
bool VisitCXXMemberCallExpr (const CXXMemberCallExpr *E)
 
bool VisitCXXDefaultInitExpr (const CXXDefaultInitExpr *E)
 
bool VisitCXXBoolLiteralExpr (const CXXBoolLiteralExpr *E)
 
bool VisitCXXNullPtrLiteralExpr (const CXXNullPtrLiteralExpr *E)
 
bool VisitCXXThisExpr (const CXXThisExpr *E)
 
bool VisitUnaryOperator (const UnaryOperator *E)
 
bool VisitDeclRefExpr (const DeclRefExpr *E)
 
bool VisitImplicitValueInitExpr (const ImplicitValueInitExpr *E)
 
bool VisitSubstNonTypeTemplateParmExpr (const SubstNonTypeTemplateParmExpr *E)
 
bool VisitArraySubscriptExpr (const ArraySubscriptExpr *E)
 
bool VisitInitListExpr (const InitListExpr *E)
 
bool VisitConstantExpr (const ConstantExpr *E)
 
bool VisitUnaryExprOrTypeTraitExpr (const UnaryExprOrTypeTraitExpr *E)
 
bool VisitMemberExpr (const MemberExpr *E)
 
bool VisitArrayInitIndexExpr (const ArrayInitIndexExpr *E)
 
bool VisitOpaqueValueExpr (const OpaqueValueExpr *E)
 
bool VisitAbstractConditionalOperator (const AbstractConditionalOperator *E)
 
bool VisitStringLiteral (const StringLiteral *E)
 
bool VisitCharacterLiteral (const CharacterLiteral *E)
 
bool VisitCompoundAssignOperator (const CompoundAssignOperator *E)
 
bool VisitFloatCompoundAssignOperator (const CompoundAssignOperator *E)
 
bool VisitPointerCompoundAssignOperator (const CompoundAssignOperator *E)
 
bool VisitExprWithCleanups (const ExprWithCleanups *E)
 
bool VisitMaterializeTemporaryExpr (const MaterializeTemporaryExpr *E)
 
bool VisitCompoundLiteralExpr (const CompoundLiteralExpr *E)
 
- Public Member Functions inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >
RetTy 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) RetTy 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
 Toplevel visitDecl().
 
void emitCleanup ()
 Emits scope cleanup instructions.
 
const RecordTypegetRecordTy (QualType Ty)
 Returns a record type from a record or pointer type.
 
RecordgetRecord (QualType Ty)
 Returns a record from a record or pointer type.
 
RecordgetRecord (const RecordDecl *RD)
 
const FunctiongetFunction (const FunctionDecl *FD)
 
std::optional< PrimTypeclassify (const Expr *E) const
 Classifies a type.
 
std::optional< PrimTypeclassify (QualType Ty) const
 
PrimType classifyPrim (QualType Ty) const
 Classifies a known primitive type.
 
bool discard (const Expr *E)
 Evaluates an expression for side effects and discards the result.
 
bool visit (const Expr *E)
 Evaluates an expression and places result on stack.
 
bool visitInitializer (const Expr *E)
 Compiles an initializer.
 
bool visitArrayInitializer (const Expr *Initializer)
 Compiles an array initializer.
 
bool visitRecordInitializer (const Expr *Initializer)
 Compiles a record initializer.
 
bool visitVarDecl (const VarDecl *VD)
 Creates and initializes a variable from the given decl.
 
bool visitBool (const Expr *E)
 Visits an expression and converts it to a boolean.
 
bool visitLocalInitializer (const Expr *Init, unsigned I)
 Visits an initializer for a local.
 
bool visitGlobalInitializer (const Expr *Init, unsigned I)
 Visits an initializer for a global.
 
bool visitThisInitializer (const Expr *I)
 Visits a delegated initializer.
 
unsigned allocateLocalPrimitive (DeclTy &&Decl, PrimType Ty, bool IsMutable, bool IsExtended=false)
 Creates a local primitive value.
 
std::optional< unsignedallocateLocal (DeclTy &&Decl, bool IsExtended=false)
 Allocates a space storing a local given its type.
 

Friends

class LabelScope< Emitter >
 
class LoopScope< Emitter >
 
class SwitchScope< Emitter >
 

Additional Inherited Members

- Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >
ParamTys P { return RetTy()
 
- Protected Types inherited from clang::interp::ByteCodeExprGen< Emitter >
using LabelTy = typename Emitter::LabelTy
 
using AddrTy = typename Emitter::AddrTy
 
- Protected Attributes inherited from clang::interp::ByteCodeExprGen< Emitter >
ContextCtx
 Current compilation context.
 
ProgramP
 Program to link to.
 
llvm::DenseMap< const ValueDecl *, Scope::LocalLocals
 Variable to storage mapping.
 
llvm::DenseMap< const OpaqueValueExpr *, unsignedOpaqueExprs
 OpaqueValueExpr to location mapping.
 
VariableScope< Emitter > * VarScope = nullptr
 Current scope.
 
std::optional< uint64_t > ArrayIndex
 Current argument index. Needed to emit ArrayInitIndexExpr.
 
bool DiscardResult = false
 Flag indicating if return value is to be discarded.
 

Detailed Description

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

Compilation context for statements.

Definition at line 35 of file ByteCodeStmtGen.h.

Constructor & Destructor Documentation

◆ ByteCodeStmtGen()

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

Definition at line 43 of file ByteCodeStmtGen.h.

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 47 of file ByteCodeStmtGen.h.

◆ LoopScope< Emitter >

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

Definition at line 47 of file ByteCodeStmtGen.h.

◆ SwitchScope< Emitter >

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

Definition at line 47 of file ByteCodeStmtGen.h.


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