clang 19.0.0git
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::interp::ByteCodeExprGen< Emitter > Class Template Reference

Compilation context for expressions. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/ByteCodeExprGen.h"

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

Public Member Functions

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 VisitImaginaryLiteral (const ImaginaryLiteral *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 VisitComplexBinOp (const BinaryOperator *E)
 
bool VisitCXXDefaultArgExpr (const CXXDefaultArgExpr *E)
 
bool VisitCallExpr (const CallExpr *E)
 
bool VisitBuiltinCallExpr (const CallExpr *E)
 
bool VisitCXXDefaultInitExpr (const CXXDefaultInitExpr *E)
 
bool VisitCXXBoolLiteralExpr (const CXXBoolLiteralExpr *E)
 
bool VisitCXXNullPtrLiteralExpr (const CXXNullPtrLiteralExpr *E)
 
bool VisitGNUNullExpr (const GNUNullExpr *E)
 
bool VisitCXXThisExpr (const CXXThisExpr *E)
 
bool VisitUnaryOperator (const UnaryOperator *E)
 
bool VisitComplexUnaryOperator (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 VisitCXXParenListInitExpr (const CXXParenListInitExpr *E)
 
bool VisitConstantExpr (const ConstantExpr *E)
 
bool VisitUnaryExprOrTypeTraitExpr (const UnaryExprOrTypeTraitExpr *E)
 
bool VisitMemberExpr (const MemberExpr *E)
 
bool VisitArrayInitIndexExpr (const ArrayInitIndexExpr *E)
 
bool VisitArrayInitLoopExpr (const ArrayInitLoopExpr *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 VisitCXXBindTemporaryExpr (const CXXBindTemporaryExpr *E)
 
bool VisitCompoundLiteralExpr (const CompoundLiteralExpr *E)
 
bool VisitTypeTraitExpr (const TypeTraitExpr *E)
 
bool VisitArrayTypeTraitExpr (const ArrayTypeTraitExpr *E)
 
bool VisitLambdaExpr (const LambdaExpr *E)
 
bool VisitPredefinedExpr (const PredefinedExpr *E)
 
bool VisitCXXThrowExpr (const CXXThrowExpr *E)
 
bool VisitCXXReinterpretCastExpr (const CXXReinterpretCastExpr *E)
 
bool VisitCXXNoexceptExpr (const CXXNoexceptExpr *E)
 
bool VisitCXXConstructExpr (const CXXConstructExpr *E)
 
bool VisitSourceLocExpr (const SourceLocExpr *E)
 
bool VisitOffsetOfExpr (const OffsetOfExpr *E)
 
bool VisitCXXScalarValueInitExpr (const CXXScalarValueInitExpr *E)
 
bool VisitSizeOfPackExpr (const SizeOfPackExpr *E)
 
bool VisitGenericSelectionExpr (const GenericSelectionExpr *E)
 
bool VisitChooseExpr (const ChooseExpr *E)
 
bool VisitObjCBoolLiteralExpr (const ObjCBoolLiteralExpr *E)
 
bool VisitCXXInheritedCtorInitExpr (const CXXInheritedCtorInitExpr *E)
 
bool VisitExpressionTraitExpr (const ExpressionTraitExpr *E)
 
bool VisitCXXUuidofExpr (const CXXUuidofExpr *E)
 
bool VisitRequiresExpr (const RequiresExpr *E)
 
bool VisitConceptSpecializationExpr (const ConceptSpecializationExpr *E)
 
bool VisitCXXRewrittenBinaryOperator (const CXXRewrittenBinaryOperator *E)
 
bool VisitPseudoObjectExpr (const PseudoObjectExpr *E)
 
bool VisitPackIndexingExpr (const PackIndexingExpr *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 Types

using LabelTy = typename Emitter::LabelTy
 
using AddrTy = typename Emitter::AddrTy
 

Protected Member Functions

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
 
std::optional< PrimTypeclassify (QualType Ty) const
 
PrimType classifyPrim (QualType Ty) const
 Classifies a known primitive type.
 
bool visit (const Expr *E)
 Evaluates an expression and places the result on the stack.
 
bool visitInitializer (const Expr *E)
 Compiles an initializer.
 
bool discard (const Expr *E)
 Evaluates an expression for side effects and discards the result.
 
bool delegate (const Expr *E)
 Just pass evaluation on to E.
 
bool visitVarDecl (const VarDecl *VD)
 Creates and initializes a variable from the given decl.
 
bool visitAPValue (const APValue &Val, PrimType ValType, const Expr *E)
 Visit an APValue.
 
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.
 
bool visitInitList (ArrayRef< const Expr * > Inits, const Expr *E)
 
bool visitArrayElemInit (unsigned ElemIndex, const Expr *Init)
 Pointer to the array(not the element!) must be on the stack when calling this.
 
unsigned allocateLocalPrimitive (DeclTy &&Decl, PrimType Ty, bool IsConst, 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.
 

Protected Attributes

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.
 
const ExprSourceLocDefaultExpr = nullptr
 DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
 
bool DiscardResult = false
 Flag indicating if return value is to be discarded.
 
bool Initializing = false
 Flag inidicating if we're initializing an already created variable.
 
bool GlobalDecl = false
 Flag indicating if we're initializing a global variable.
 

Friends

class VariableScope< Emitter >
 
class LocalScope< Emitter >
 
class DestructorScope< Emitter >
 
class DeclScope< Emitter >
 
class OptionScope< Emitter >
 
class ArrayIndexScope< Emitter >
 
class SourceLocScope< Emitter >
 

Additional Inherited Members

- Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >
ParamTys P { return RetTy()
 

Detailed Description

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

Compilation context for expressions.

Definition at line 41 of file ByteCodeExprGen.h.

Member Typedef Documentation

◆ AddrTy

template<class Emitter >
using clang::interp::ByteCodeExprGen< Emitter >::AddrTy = typename Emitter::AddrTy
protected

Definition at line 46 of file ByteCodeExprGen.h.

◆ LabelTy

template<class Emitter >
using clang::interp::ByteCodeExprGen< Emitter >::LabelTy = typename Emitter::LabelTy
protected

Definition at line 45 of file ByteCodeExprGen.h.

Constructor & Destructor Documentation

◆ ByteCodeExprGen()

template<class Emitter >
template<typename... Tys>
clang::interp::ByteCodeExprGen< Emitter >::ByteCodeExprGen ( Context Ctx,
Program P,
Tys &&...  Args 
)
inline

Initializes the compiler and the backend emitter.

Definition at line 56 of file ByteCodeExprGen.h.

Member Function Documentation

◆ allocateLocal()

template<class Emitter >
std::optional< unsigned > ByteCodeExprGen::allocateLocal ( DeclTy &&  Decl,
bool  IsExtended = false 
)
protected

Allocates a space storing a local given its type.

Definition at line 2623 of file ByteCodeExprGen.cpp.

References clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Init, clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), and P.

◆ allocateLocalPrimitive()

template<class Emitter >
unsigned ByteCodeExprGen::allocateLocalPrimitive ( DeclTy &&  Decl,
PrimType  Ty,
bool  IsConst,
bool  IsExtended = false 
)
protected

Creates a local primitive value.

Definition at line 2597 of file ByteCodeExprGen.cpp.

References clang::interp::Descriptor::InlineDescMD, and P.

◆ classify() [1/2]

template<class Emitter >
std::optional< PrimType > clang::interp::ByteCodeExprGen< Emitter >::classify ( const Expr E) const
inlineprotected

◆ classify() [2/2]

template<class Emitter >
std::optional< PrimType > clang::interp::ByteCodeExprGen< Emitter >::classify ( QualType  Ty) const
inlineprotected

◆ classifyPrim()

template<class Emitter >
PrimType clang::interp::ByteCodeExprGen< Emitter >::classifyPrim ( QualType  Ty) const
inlineprotected

Classifies a known primitive type.

Definition at line 152 of file ByteCodeExprGen.h.

References clang::interp::ByteCodeExprGen< Emitter >::classify(), and clang::T.

◆ delegate()

template<class Emitter >
bool ByteCodeExprGen::delegate ( const Expr E)
protected

Just pass evaluation on to E.

This leaves all the parsing flags intact.

Definition at line 2349 of file ByteCodeExprGen.cpp.

References clang::Expr::containsErrors().

◆ discard()

template<class Emitter >
bool ByteCodeExprGen::discard ( const Expr E)
protected

Evaluates an expression for side effects and discards the result.

Definition at line 2339 of file ByteCodeExprGen.cpp.

References clang::Expr::containsErrors().

◆ emitCleanup()

template<class Emitter >
void ByteCodeExprGen::emitCleanup
protected

Emits scope cleanup instructions.

Definition at line 3432 of file ByteCodeExprGen.cpp.

References clang::C.

◆ getFunction()

template<class Emitter >
const Function * ByteCodeExprGen::getFunction ( const FunctionDecl FD)
protected

Definition at line 2680 of file ByteCodeExprGen.cpp.

◆ getRecord() [1/2]

template<class Emitter >
Record * ByteCodeExprGen::getRecord ( const RecordDecl RD)
protected

Definition at line 2675 of file ByteCodeExprGen.cpp.

References P.

◆ getRecord() [2/2]

template<class Emitter >
Record * ByteCodeExprGen::getRecord ( QualType  Ty)
protected

Returns a record from a record or pointer type.

Definition at line 2668 of file ByteCodeExprGen.cpp.

◆ getRecordTy()

template<class Emitter >
const RecordType * ByteCodeExprGen::getRecordTy ( QualType  Ty)
protected

Returns a record type from a record or pointer type.

Definition at line 2661 of file ByteCodeExprGen.cpp.

References clang::Type::getAs(), and clang::Type::getPointeeType().

◆ visit()

template<class Emitter >
bool ByteCodeExprGen::visit ( const Expr E)
protected

Evaluates an expression and places the result on the stack.

If the expression is of composite type, a local variable will be created and a pointer to said variable will be placed on the stack.

Definition at line 2359 of file ByteCodeExprGen.cpp.

References clang::Expr::containsErrors(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), and clang::Type::isVoidType().

◆ VisitAbstractConditionalOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitAbstractConditionalOperator ( const AbstractConditionalOperator E)

◆ visitAPValue()

template<class Emitter >
bool ByteCodeExprGen::visitAPValue ( const APValue Val,
PrimType  ValType,
const Expr E 
)
protected

◆ visitArrayElemInit()

template<class Emitter >
bool ByteCodeExprGen::visitArrayElemInit ( unsigned  ElemIndex,
const Expr Init 
)
protected

Pointer to the array(not the element!) must be on the stack when calling this.

Definition at line 999 of file ByteCodeExprGen.cpp.

References clang::Init, and clang::T.

◆ VisitArrayInitIndexExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitArrayInitIndexExpr ( const ArrayInitIndexExpr E)

Definition at line 1290 of file ByteCodeExprGen.cpp.

◆ VisitArrayInitLoopExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitArrayInitLoopExpr ( const ArrayInitLoopExpr E)

◆ VisitArraySubscriptExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitArraySubscriptExpr ( const ArraySubscriptExpr E)

◆ VisitArrayTypeTraitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitArrayTypeTraitExpr ( const ArrayTypeTraitExpr E)

Definition at line 1855 of file ByteCodeExprGen.cpp.

References clang::ArrayTypeTraitExpr::getValue().

◆ VisitBinaryOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitBinaryOperator ( const BinaryOperator E)

◆ visitBool()

template<class Emitter >
bool ByteCodeExprGen::visitBool ( const Expr E)
protected

◆ VisitBuiltinCallExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitBuiltinCallExpr ( const CallExpr E)

◆ VisitCallExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCallExpr ( const CallExpr E)

◆ VisitCastExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCastExpr ( const CastExpr E)

◆ VisitCharacterLiteral()

template<class Emitter >
bool ByteCodeExprGen::VisitCharacterLiteral ( const CharacterLiteral E)

Definition at line 1454 of file ByteCodeExprGen.cpp.

References clang::CharacterLiteral::getValue().

◆ VisitChooseExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitChooseExpr ( const ChooseExpr E)

Definition at line 2178 of file ByteCodeExprGen.cpp.

References clang::ChooseExpr::getChosenSubExpr().

◆ VisitComplexBinOp()

template<class Emitter >
bool ByteCodeExprGen::VisitComplexBinOp ( const BinaryOperator E)

◆ VisitComplexUnaryOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitComplexUnaryOperator ( const UnaryOperator E)

◆ VisitCompoundAssignOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitCompoundAssignOperator ( const CompoundAssignOperator E)

◆ VisitCompoundLiteralExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCompoundLiteralExpr ( const CompoundLiteralExpr E)

◆ VisitConceptSpecializationExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitConceptSpecializationExpr ( const ConceptSpecializationExpr E)

◆ VisitConstantExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitConstantExpr ( const ConstantExpr E)

◆ VisitCXXBindTemporaryExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXBindTemporaryExpr ( const CXXBindTemporaryExpr E)

Definition at line 1774 of file ByteCodeExprGen.cpp.

References clang::CXXBindTemporaryExpr::getSubExpr().

◆ VisitCXXBoolLiteralExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXBoolLiteralExpr ( const CXXBoolLiteralExpr E)

Definition at line 3038 of file ByteCodeExprGen.cpp.

References clang::CXXBoolLiteralExpr::getValue().

◆ VisitCXXConstructExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXConstructExpr ( const CXXConstructExpr E)

◆ VisitCXXDefaultArgExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXDefaultArgExpr ( const CXXDefaultArgExpr E)

Definition at line 3025 of file ByteCodeExprGen.cpp.

References clang::CXXDefaultArgExpr::getExpr(), and clang::T.

◆ VisitCXXDefaultInitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXDefaultInitExpr ( const CXXDefaultInitExpr E)

Definition at line 3018 of file ByteCodeExprGen.cpp.

References clang::CXXDefaultInitExpr::getExpr().

◆ VisitCXXInheritedCtorInitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXInheritedCtorInitExpr ( const CXXInheritedCtorInitExpr E)

◆ VisitCXXNoexceptExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXNoexceptExpr ( const CXXNoexceptExpr E)

◆ VisitCXXNullPtrLiteralExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXNullPtrLiteralExpr ( const CXXNullPtrLiteralExpr E)

Definition at line 3047 of file ByteCodeExprGen.cpp.

◆ VisitCXXParenListInitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXParenListInitExpr ( const CXXParenListInitExpr E)

◆ VisitCXXReinterpretCastExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXReinterpretCastExpr ( const CXXReinterpretCastExpr E)

Definition at line 1921 of file ByteCodeExprGen.cpp.

References clang::CastExpr::getSubExpr().

◆ VisitCXXRewrittenBinaryOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXRewrittenBinaryOperator ( const CXXRewrittenBinaryOperator E)

◆ VisitCXXScalarValueInitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXScalarValueInitExpr ( const CXXScalarValueInitExpr E)

◆ VisitCXXThisExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXThisExpr ( const CXXThisExpr E)

Definition at line 3067 of file ByteCodeExprGen.cpp.

◆ VisitCXXThrowExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXThrowExpr ( const CXXThrowExpr E)

Definition at line 1913 of file ByteCodeExprGen.cpp.

References clang::CXXThrowExpr::getSubExpr().

◆ VisitCXXUuidofExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitCXXUuidofExpr ( const CXXUuidofExpr E)

◆ visitDecl()

template<class Emitter >
bool ByteCodeExprGen::visitDecl ( const VarDecl VD)
overrideprotected

Toplevel visitDecl().

We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.

Definition at line 2726 of file ByteCodeExprGen.cpp.

References clang::ValueDecl::getType(), clang::Decl::isInvalidDecl(), P, clang::interp::PT_Ptr, and clang::interp::Context::shouldBeGloballyIndexed().

◆ VisitDeclRefExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitDeclRefExpr ( const DeclRefExpr E)

◆ visitExpr()

template<class Emitter >
bool ByteCodeExprGen::visitExpr ( const Expr E)
overrideprotected

◆ VisitExpressionTraitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitExpressionTraitExpr ( const ExpressionTraitExpr E)

Definition at line 2223 of file ByteCodeExprGen.cpp.

References clang::ExpressionTraitExpr::getValue().

◆ VisitExprWithCleanups()

template<class Emitter >
bool ByteCodeExprGen::VisitExprWithCleanups ( const ExprWithCleanups E)

◆ VisitFloatCompoundAssignOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitFloatCompoundAssignOperator ( const CompoundAssignOperator E)

◆ VisitFloatingLiteral()

template<class Emitter >
bool ByteCodeExprGen::VisitFloatingLiteral ( const FloatingLiteral E)

Definition at line 419 of file ByteCodeExprGen.cpp.

References clang::FloatingLiteral::getValue().

◆ VisitGenericSelectionExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitGenericSelectionExpr ( const GenericSelectionExpr E)

◆ visitGlobalInitializer()

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::visitGlobalInitializer ( const Expr Init,
unsigned  I 
)
inlineprotected

Visits an initializer for a global.

Definition at line 196 of file ByteCodeExprGen.h.

References clang::Init, and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().

◆ VisitGNUNullExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitGNUNullExpr ( const GNUNullExpr E)

◆ VisitImaginaryLiteral()

template<class Emitter >
bool ByteCodeExprGen::VisitImaginaryLiteral ( const ImaginaryLiteral E)

◆ VisitImplicitValueInitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitImplicitValueInitExpr ( const ImplicitValueInitExpr E)

◆ visitInitializer()

template<class Emitter >
bool ByteCodeExprGen::visitInitializer ( const Expr E)
protected

Compiles an initializer.

This is like visit() but it will never create a variable and instead rely on a variable already having been created. visitInitializer() then relies on a pointer to this variable being on top of the stack.

Definition at line 2386 of file ByteCodeExprGen.cpp.

References clang::Expr::containsErrors(), and clang::Expr::getType().

Referenced by clang::interp::ByteCodeExprGen< Emitter >::visitGlobalInitializer(), clang::interp::ByteCodeExprGen< Emitter >::visitLocalInitializer(), and clang::interp::ByteCodeExprGen< Emitter >::visitThisInitializer().

◆ visitInitList()

template<class Emitter >
bool ByteCodeExprGen::visitInitList ( ArrayRef< const Expr * >  Inits,
const Expr E 
)
protected

◆ VisitInitListExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitInitListExpr ( const InitListExpr E)

◆ VisitIntegerLiteral()

template<class Emitter >
bool ByteCodeExprGen::VisitIntegerLiteral ( const IntegerLiteral E)

Definition at line 411 of file ByteCodeExprGen.cpp.

References clang::interp::LE().

◆ VisitLambdaExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitLambdaExpr ( const LambdaExpr E)

◆ visitLocalInitializer()

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::visitLocalInitializer ( const Expr Init,
unsigned  I 
)
inlineprotected

Visits an initializer for a local.

Definition at line 182 of file ByteCodeExprGen.h.

References clang::Init, and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().

◆ VisitLogicalBinOp()

template<class Emitter >
bool ByteCodeExprGen::VisitLogicalBinOp ( const BinaryOperator E)

◆ VisitMaterializeTemporaryExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitMaterializeTemporaryExpr ( const MaterializeTemporaryExpr E)

◆ VisitMemberExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitMemberExpr ( const MemberExpr E)

◆ VisitObjCBoolLiteralExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitObjCBoolLiteralExpr ( const ObjCBoolLiteralExpr E)

Definition at line 2183 of file ByteCodeExprGen.cpp.

References clang::ObjCBoolLiteralExpr::getValue().

◆ VisitOffsetOfExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitOffsetOfExpr ( const OffsetOfExpr E)

◆ VisitOpaqueValueExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitOpaqueValueExpr ( const OpaqueValueExpr E)

◆ VisitPackIndexingExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitPackIndexingExpr ( const PackIndexingExpr E)

Definition at line 2334 of file ByteCodeExprGen.cpp.

References clang::PackIndexingExpr::getSelectedExpr().

◆ VisitParenExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitParenExpr ( const ParenExpr E)

Definition at line 452 of file ByteCodeExprGen.cpp.

References clang::ParenExpr::getSubExpr().

◆ VisitPointerArithBinOp()

template<class Emitter >
bool ByteCodeExprGen::VisitPointerArithBinOp ( const BinaryOperator E)

Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.

Definition at line 614 of file ByteCodeExprGen.cpp.

References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and LT.

◆ VisitPointerCompoundAssignOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitPointerCompoundAssignOperator ( const CompoundAssignOperator E)

◆ VisitPredefinedExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitPredefinedExpr ( const PredefinedExpr E)

Definition at line 1905 of file ByteCodeExprGen.cpp.

References clang::PredefinedExpr::getFunctionName().

◆ VisitPseudoObjectExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitPseudoObjectExpr ( const PseudoObjectExpr E)

◆ VisitRequiresExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitRequiresExpr ( const RequiresExpr E)

◆ VisitSizeOfPackExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitSizeOfPackExpr ( const SizeOfPackExpr E)

Definition at line 2167 of file ByteCodeExprGen.cpp.

References clang::SizeOfPackExpr::getPackLength().

◆ VisitSourceLocExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitSourceLocExpr ( const SourceLocExpr E)

◆ VisitStringLiteral()

template<class Emitter >
bool ByteCodeExprGen::VisitStringLiteral ( const StringLiteral E)

◆ VisitSubstNonTypeTemplateParmExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitSubstNonTypeTemplateParmExpr ( const SubstNonTypeTemplateParmExpr E)

◆ visitThisInitializer()

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::visitThisInitializer ( const Expr I)
inlineprotected

Visits a delegated initializer.

Definition at line 210 of file ByteCodeExprGen.h.

References clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().

◆ VisitTypeTraitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitTypeTraitExpr ( const TypeTraitExpr E)

◆ VisitUnaryExprOrTypeTraitExpr()

template<class Emitter >
bool ByteCodeExprGen::VisitUnaryExprOrTypeTraitExpr ( const UnaryExprOrTypeTraitExpr E)

◆ VisitUnaryOperator()

template<class Emitter >
bool ByteCodeExprGen::VisitUnaryOperator ( const UnaryOperator E)

◆ visitVarDecl()

template<class Emitter >
bool ByteCodeExprGen::visitVarDecl ( const VarDecl VD)
protected

Friends And Related Function Documentation

◆ ArrayIndexScope< Emitter >

template<class Emitter >
friend class ArrayIndexScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ DeclScope< Emitter >

template<class Emitter >
friend class DeclScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ DestructorScope< Emitter >

template<class Emitter >
friend class DestructorScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ LocalScope< Emitter >

template<class Emitter >
friend class LocalScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ OptionScope< Emitter >

template<class Emitter >
friend class OptionScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ SourceLocScope< Emitter >

template<class Emitter >
friend class SourceLocScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

◆ VariableScope< Emitter >

template<class Emitter >
friend class VariableScope< Emitter >
friend

Definition at line 228 of file ByteCodeExprGen.h.

Member Data Documentation

◆ ArrayIndex

template<class Emitter >
std::optional<uint64_t> clang::interp::ByteCodeExprGen< Emitter >::ArrayIndex
protected

Current argument index. Needed to emit ArrayInitIndexExpr.

Definition at line 293 of file ByteCodeExprGen.h.

Referenced by clang::interp::ArrayIndexScope< Emitter >::ArrayIndexScope().

◆ Ctx

template<class Emitter >
Context& clang::interp::ByteCodeExprGen< Emitter >::Ctx
protected

Current compilation context.

Definition at line 49 of file ByteCodeExprGen.h.

Referenced by clang::interp::ByteCodeExprGen< Emitter >::classify().

◆ DiscardResult

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::DiscardResult = false
protected

Flag indicating if return value is to be discarded.

Definition at line 299 of file ByteCodeExprGen.h.

Referenced by clang::interp::OptionScope< Emitter >::OptionScope().

◆ GlobalDecl

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::GlobalDecl = false
protected

Flag indicating if we're initializing a global variable.

Definition at line 306 of file ByteCodeExprGen.h.

◆ Initializing

template<class Emitter >
bool clang::interp::ByteCodeExprGen< Emitter >::Initializing = false
protected

Flag inidicating if we're initializing an already created variable.

This is set in visitInitializer().

Definition at line 303 of file ByteCodeExprGen.h.

Referenced by clang::interp::OptionScope< Emitter >::OptionScope().

◆ Locals

template<class Emitter >
llvm::DenseMap<const ValueDecl *, Scope::Local> clang::interp::ByteCodeExprGen< Emitter >::Locals
protected

Variable to storage mapping.

Definition at line 284 of file ByteCodeExprGen.h.

◆ OpaqueExprs

template<class Emitter >
llvm::DenseMap<const OpaqueValueExpr *, unsigned> clang::interp::ByteCodeExprGen< Emitter >::OpaqueExprs
protected

OpaqueValueExpr to location mapping.

Definition at line 287 of file ByteCodeExprGen.h.

◆ P

template<class Emitter >
Program& clang::interp::ByteCodeExprGen< Emitter >::P
protected

Program to link to.

Definition at line 51 of file ByteCodeExprGen.h.

◆ SourceLocDefaultExpr

template<class Emitter >
const Expr* clang::interp::ByteCodeExprGen< Emitter >::SourceLocDefaultExpr = nullptr
protected

DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.

Definition at line 296 of file ByteCodeExprGen.h.

Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().

◆ VarScope

template<class Emitter >
VariableScope<Emitter>* clang::interp::ByteCodeExprGen< Emitter >::VarScope = nullptr
protected

Current scope.

Definition at line 290 of file ByteCodeExprGen.h.

Referenced by clang::interp::VariableScope< Emitter >::VariableScope().


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