clang 20.0.0git
|
Compilation context for expressions. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/Compiler.h"
Protected Types | |
using | LabelTy = typename Emitter::LabelTy |
using | AddrTy = typename Emitter::AddrTy |
using | OptLabelTy = std::optional< LabelTy > |
using | CaseMap = llvm::DenseMap< const SwitchCase *, LabelTy > |
Protected Member Functions | |
bool | visitStmt (const Stmt *S) |
bool | visitExpr (const Expr *E, bool DestroyToplevelScope) override |
bool | visitFunc (const FunctionDecl *F) override |
bool | visitDeclAndReturn (const VarDecl *VD, bool ConstantContext) override |
Toplevel visitDeclAndReturn(). | |
void | emitCleanup () |
Emits scope cleanup instructions. | |
const RecordType * | getRecordTy (QualType Ty) |
Returns a record type from a record or pointer type. | |
Record * | getRecord (QualType Ty) |
Returns a record from a record or pointer type. | |
Record * | getRecord (const RecordDecl *RD) |
const Function * | getFunction (const FunctionDecl *FD) |
Returns a function for the given FunctionDecl. | |
std::optional< PrimType > | classify (const Expr *E) const |
std::optional< PrimType > | classify (QualType Ty) const |
PrimType | classifyPrim (QualType Ty) const |
Classifies a known primitive type. | |
PrimType | classifyPrim (const Expr *E) const |
Classifies a known primitive expression. | |
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 . | |
VarCreationState | visitVarDecl (const VarDecl *VD, bool Toplevel=false) |
Creates and initializes a variable from the given decl. | |
VarCreationState | visitDecl (const VarDecl *VD) |
bool | visitAPValue (const APValue &Val, PrimType ValType, const Expr *E) |
Visit an APValue. | |
bool | visitAPValueInitializer (const APValue &Val, const Expr *E) |
bool | visitDeclRef (const ValueDecl *D, const Expr *E) |
Visit the given decl as if we have a reference to it. | |
bool | visitBool (const Expr *E) |
Visits an expression and converts it to a boolean. | |
bool | visitInitList (ArrayRef< const Expr * > Inits, const Expr *ArrayFiller, 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< unsigned > | allocateLocal (DeclTy &&Decl, QualType Ty=QualType(), const ValueDecl *ExtendingDecl=nullptr) |
Allocates a space storing a local given its type. | |
unsigned | allocateTemporary (const Expr *E) |
Protected Attributes | |
Context & | Ctx |
Current compilation context. | |
Program & | P |
Program to link to. | |
llvm::DenseMap< const ValueDecl *, Scope::Local > | Locals |
Variable to storage mapping. | |
llvm::DenseMap< const OpaqueValueExpr *, unsigned > | OpaqueExprs |
OpaqueValueExpr to location mapping. | |
VariableScope< Emitter > * | VarScope = nullptr |
Current scope. | |
std::optional< uint64_t > | ArrayIndex |
Current argument index. Needed to emit ArrayInitIndexExpr. | |
const Expr * | SourceLocDefaultExpr = nullptr |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr. | |
bool | DiscardResult = false |
Flag indicating if return value is to be discarded. | |
bool | InStmtExpr = false |
bool | Initializing = false |
Flag inidicating if we're initializing an already created variable. | |
const ValueDecl * | InitializingDecl = nullptr |
llvm::SmallVector< InitLink > | InitStack |
bool | InitStackActive = false |
std::optional< PrimType > | ReturnType |
Type of the expression returned by the function. | |
CaseMap | CaseLabels |
Switch case mapping. | |
VariableScope< Emitter > * | BreakVarScope = nullptr |
Scope to cleanup until when we see a break statement. | |
OptLabelTy | BreakLabel |
Point to break to. | |
VariableScope< Emitter > * | ContinueVarScope = nullptr |
Scope to cleanup until when we see a continue statement. | |
OptLabelTy | ContinueLabel |
Point to continue to. | |
OptLabelTy | DefaultLabel |
Default case label. | |
Friends | |
class | VariableScope< Emitter > |
class | LocalScope< Emitter > |
class | DestructorScope< Emitter > |
class | DeclScope< Emitter > |
class | InitLinkScope< Emitter > |
class | InitStackScope< Emitter > |
class | OptionScope< Emitter > |
class | ArrayIndexScope< Emitter > |
class | SourceLocScope< Emitter > |
struct | InitLink |
class | LoopScope< Emitter > |
class | LabelScope< Emitter > |
class | SwitchScope< Emitter > |
class | StmtExprScope< Emitter > |
Additional Inherited Members | |
![]() | |
ParamTys | P { return RetTy() |
Compilation context for expressions.
Definition at line 107 of file Compiler.h.
|
protected |
Definition at line 112 of file Compiler.h.
|
protected |
Definition at line 114 of file Compiler.h.
|
protected |
Definition at line 111 of file Compiler.h.
|
protected |
Definition at line 113 of file Compiler.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 124 of file Compiler.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 4130 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Init, clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), clang::QualType::isNull(), and P.
|
protected |
Creates a local primitive value.
Definition at line 4105 of file Compiler.cpp.
References D, clang::interp::Descriptor::InlineDescMD, and P.
Definition at line 4172 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), clang::Type::isRecordType(), and P.
|
inlineprotected |
Definition at line 253 of file Compiler.h.
References clang::interp::Context::classify(), clang::interp::Compiler< Emitter >::Ctx, and E.
Referenced by clang::interp::Compiler< Emitter >::classifyPrim().
|
inlineprotected |
Definition at line 256 of file Compiler.h.
References clang::interp::Context::classify(), and clang::interp::Compiler< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 268 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), E, and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 261 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), and clang::T.
Just pass evaluation on to E
.
This leaves all the parsing flags intact.
Definition at line 3810 of file Compiler.cpp.
References E.
Evaluates an expression for side effects and discards the result.
Definition at line 3804 of file Compiler.cpp.
References E.
|
protected |
Emits scope cleanup instructions.
Definition at line 6249 of file Compiler.cpp.
References clang::C.
|
protected |
Returns a function for the given FunctionDecl.
If the function does not exist yet, it is compiled.
Definition at line 4211 of file Compiler.cpp.
|
protected |
Definition at line 4206 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 4199 of file Compiler.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 4193 of file Compiler.cpp.
References clang::Type::getAs(), and clang::Type::getPointeeType().
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 3817 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::QualType::isNull(), clang::Type::isVoidType(), and clang::interp::InitLink::Temp().
bool Compiler::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 2289 of file Compiler.cpp.
References clang::Condition, and E.
bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 3577 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isVoidPointerType(), and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 4468 of file Compiler.cpp.
References E, clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getMemberPointerDecl(), clang::APValue::isFloat(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), and clang::APValue::isNullPointer().
|
protected |
Definition at line 4495 of file Compiler.cpp.
References E, clang::APValue::getArrayInitializedElt(), clang::APValue::getArraySize(), clang::interp::Record::getField(), clang::FieldDecl::getParent(), clang::APValue::getStructField(), clang::APValue::getStructNumFields(), clang::Expr::getType(), clang::APValue::getUnionField(), clang::APValue::getUnionValue(), clang::APValue::isArray(), clang::APValue::isFloat(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), clang::APValue::isStruct(), clang::APValue::isUnion(), and clang::T.
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 1967 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::Init, and clang::T.
bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 2214 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 2223 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, and clang::Initializing.
bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1692 of file Compiler.cpp.
References E, clang::interp::PT_Ptr, and clang::Success.
bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2838 of file Compiler.cpp.
References E.
bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 5373 of file Compiler.cpp.
References clang::Expr::HasSideEffects(), and clang::Expr::isValueDependent().
bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 793 of file Compiler.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Initializing, clang::Type::isAnyComplexType(), clang::BinaryOperator::isCommaOp(), clang::BinaryOperator::isComparisonOp(), clang::Type::isFixedPointType(), clang::Type::isFloatingType(), clang::BinaryOperator::isLogicalOp(), clang::Expr::isLValue(), clang::BinaryOperator::isPtrMemOp(), clang::interp::isPtrType(), clang::Type::isVectorType(), clang::Type::isVoidType(), LT, clang::interp::PT_Bool, clang::interp::PT_MemberPtr, clang::Expr::refersToBitField(), and clang::T.
Definition at line 3434 of file Compiler.cpp.
References E, clang::Func, and P.
Visits an expression and converts it to a boolean.
Definition at line 3853 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 5267 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitBuiltinCallExpr | ( | const CallExpr * | E, |
unsigned | BuiltinID | ||
) |
Definition at line 4558 of file Compiler.cpp.
References E, clang::Func, clang::Expr::getType(), clang::Initializing, and clang::Type::isVoidType().
Definition at line 4607 of file Compiler.cpp.
References clang::interp::align(), clang::interp::collectNonNullArgs(), E, clang::Func, clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::Initializing, clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Type::isVoidType(), clang::interp::primSize(), clang::interp::PT_FnPtr, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 5361 of file Compiler.cpp.
Definition at line 195 of file Compiler.cpp.
References clang::Type::getAs(), clang::QualType::getCanonicalType(), clang::CastExpr::getCastKind(), clang::MemberPointerType::getClass(), clang::EnumType::getDecl(), clang::VectorType::getNumElements(), clang::Type::getPointeeType(), clang::interp::getRoundingMode(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Initializing, clang::interp::Descriptor::InlineDescMD, clang::Type::isAnyComplexType(), clang::Type::isAtomicType(), clang::Type::isEnumeralType(), clang::EnumDecl::isFixed(), clang::Type::isFloatingType(), clang::Type::isIntegralOrEnumerationType(), clang::QualType::isNull(), clang::interp::isPtrType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), P, clang::CastExpr::path(), clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitCharacterLiteral | ( | const CharacterLiteral * | E | ) |
Definition at line 2431 of file Compiler.cpp.
References E.
bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 3242 of file Compiler.cpp.
References E.
bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1115 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::ComplexType::getElementType(), clang::Expr::getType(), clang::Initializing, clang::Type::isAnyComplexType(), clang::interp::PT_Float, and clang::interp::PT_Ptr.
bool Compiler::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 5899 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Initializing, clang::Type::isAnyComplexType(), clang::Expr::isLValue(), clang::interp::PT_Bool, and clang::interp::PT_Ptr.
bool Compiler::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2548 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), clang::Type::isPointerType(), clang::Type::isVectorType(), LT, clang::interp::PT_Float, and clang::Expr::refersToBitField().
bool Compiler::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 2764 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Init, clang::Initializing, clang::Expr::isLValue(), P, and clang::T.
bool Compiler::visitCompoundStmt | ( | const CompoundStmt * | S | ) |
Definition at line 4966 of file Compiler.cpp.
bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 3528 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 2006 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::T.
bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 5278 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 3587 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::interp::getRoundingMode(), clang::Expr::getType(), clang::Initializing, and clang::interp::PT_Ptr.
bool Compiler::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 2758 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 4822 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2961 of file Compiler.cpp.
References clang::interp::align(), E, clang::Func, clang::Type::getAsCXXRecordDecl(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Initializing, clang::Type::isArrayType(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::FunctionDecl::isDefaulted(), clang::Type::isRecordType(), clang::Expr::isTemporaryObject(), clang::FunctionDecl::isTrivial(), clang::interp::primSize(), clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitCXXDefaultArgExpr | ( | const CXXDefaultArgExpr * | E | ) |
Definition at line 4815 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 4808 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 3418 of file Compiler.cpp.
References E.
bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 5211 of file Compiler.cpp.
References clang::interp::Inc, and clang::Init.
bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 3255 of file Compiler.cpp.
References clang::interp::align(), E, clang::interp::Function::hasRVO(), clang::interp::Function::hasThisPointer(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::parameters(), clang::interp::primSize(), and clang::interp::PT_Ptr.
bool Compiler::VisitCXXNewExpr | ( | const CXXNewExpr * | E | ) |
Definition at line 3286 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Init, clang::interp::Descriptor::InlineDescMD, clang::Type::isNothrowT(), P, and clang::interp::PT_Ptr.
bool Compiler::VisitCXXNoexceptExpr | ( | const CXXNoexceptExpr * | E | ) |
Definition at line 2952 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 4830 of file Compiler.cpp.
References E, and clang::Expr::getType().
bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1994 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2905 of file Compiler.cpp.
References E, clang::Type::getPointeeType(), clang::Expr::getType(), clang::interp::isIntegralType(), clang::Type::isPointerOrReferenceType(), and clang::interp::PT_Ptr.
bool Compiler::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 3537 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 3172 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Expr::getType(), clang::Initializing, clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitCXXStdInitializerListExpr | ( | const CXXStdInitializerListExpr * | E | ) |
Definition at line 3743 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::Record::getField(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Initializing, clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::interp::Record::Field::Offset, clang::interp::PT_Ptr, and clang::interp::PT_Uint64.
bool Compiler::VisitCXXThisExpr | ( | const CXXThisExpr * | E | ) |
Definition at line 4851 of file Compiler.cpp.
References E, clang::interp::InitLink::K_Elem, clang::interp::InitLink::K_Field, clang::interp::InitLink::K_InitList, and clang::interp::InitLink::K_This.
bool Compiler::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 2897 of file Compiler.cpp.
References E.
bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 5404 of file Compiler.cpp.
bool Compiler::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | E | ) |
Definition at line 3448 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::QualType::getTypePtr(), and clang::Expr::isLValue().
bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 3486 of file Compiler.cpp.
References E, clang::MSGuidDecl::getAsAPValue(), clang::Type::getAsRecordDecl(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Initializing, clang::TagDecl::isCompleteDefinition(), clang::APValue::None, P, and V.
|
protected |
Definition at line 4268 of file Compiler.cpp.
References clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), P, clang::interp::Block::rawData(), and clang::interp::Context::shouldBeGloballyIndexed().
|
overrideprotected |
Toplevel visitDeclAndReturn().
We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.
Definition at line 4296 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::VarDecl::getAnyInitializer(), clang::ValueDecl::getType(), clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), P, clang::interp::PT_Ptr, clang::interp::Block::rawData(), and clang::interp::Context::shouldBeGloballyIndexed().
|
protected |
Visit the given decl as if we have a reference to it.
Definition at line 6113 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::Type::isReferenceType(), P, clang::interp::PT_Ptr, and clang::T.
Referenced by clang::interp::InitLink::emit().
bool Compiler::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 6244 of file Compiler.cpp.
Definition at line 4975 of file Compiler.cpp.
References D, clang::DeclStmt::decls(), and clang::isa().
bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 5367 of file Compiler.cpp.
Definition at line 5127 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals().
Definition at line 2022 of file Compiler.cpp.
References E.
|
overrideprotected |
Definition at line 4216 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 3480 of file Compiler.cpp.
References E.
bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 2671 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 3668 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Initializing, clang::Expr::isGLValue(), clang::Type::isVectorType(), clang::interp::PT_Ptr, and clang::interp::PT_Uint32.
bool Compiler::VisitFixedPointBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1522 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFixedPointType(), clang::interp::PT_Bool, and clang::T.
bool Compiler::VisitFixedPointLiteral | ( | const FixedPointLiteral * | E | ) |
Definition at line 775 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFixedPointType(), and clang::interp::PT_FixedPoint.
bool Compiler::VisitFixedPointUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 1609 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isFixedPointType().
bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2438 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), and LT.
bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 745 of file Compiler.cpp.
References E.
Definition at line 5160 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::Inc, and clang::Init.
|
overrideprotected |
Definition at line 5642 of file Compiler.cpp.
References clang::FunctionDecl::getBody(), clang::FunctionDecl::getReturnType(), clang::CXXMethodDecl::isLambdaStaticInvoker(), and clang::Type::isVoidType().
bool Compiler::VisitGenericSelectionExpr | ( | const GenericSelectionExpr * | E | ) |
Definition at line 3236 of file Compiler.cpp.
References E.
bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 4840 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 5027 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::IfStmt::getCond(), clang::IfStmt::getConditionVariableDeclStmt(), clang::IfStmt::getElse(), clang::IfStmt::getInit(), clang::IfStmt::getThen(), clang::IfStmt::isNegatedConsteval(), and clang::IfStmt::isNonNegatedConsteval().
bool Compiler::VisitImaginaryLiteral | ( | const ImaginaryLiteral * | E | ) |
Definition at line 753 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Initializing, and clang::Type::isAnyComplexType().
bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 1628 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Type::getAsRecordDecl(), clang::Expr::getType(), clang::Initializing, clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), clang::Decl::isInvalidDecl(), clang::Type::isRecordType(), and clang::T.
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 3845 of file Compiler.cpp.
References E, and clang::Expr::getType().
|
protected |
Definition at line 1722 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::InitLink::Field(), clang::Type::getAs(), clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Init, clang::interp::InitLink::InitList(), clang::Type::isArrayType(), clang::Type::isRecordType(), clang::interp::Record::isUnion(), clang::FieldDecl::isUnnamedBitField(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 1989 of file Compiler.cpp.
References E.
bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 737 of file Compiler.cpp.
References clang::interp::LE().
bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2845 of file Compiler.cpp.
References E, clang::interp::Record::fields(), clang::Init, clang::Initializing, P, and clang::T.
bool Compiler::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1054 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::interp::PT_Bool, and clang::T.
bool Compiler::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | E | ) |
Definition at line 2679 of file Compiler.cpp.
References E, clang::Initializing, IsStatic, P, clang::SD_Static, clang::Expr::skipRValueSubobjectAdjustments(), and clang::interp::InitLink::Temp().
bool Compiler::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 2158 of file Compiler.cpp.
References E, clang::interp::Record::getField(), clang::DeclContext::getParent(), clang::Initializing, clang::Expr::isGLValue(), clang::Member, P, clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 3247 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 3730 of file Compiler.cpp.
References E, and clang::interp::PT_Ptr.
bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 2396 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, and clang::Expr::getType().
bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 2389 of file Compiler.cpp.
References E.
bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 3137 of file Compiler.cpp.
References clang::OffsetOfNode::Array, E, clang::Expr::getType(), Node, clang::interp::PT_Sint64, and clang::T.
bool Compiler::VisitOpaqueValueExpr | ( | const OpaqueValueExpr * | E | ) |
Definition at line 2253 of file Compiler.cpp.
References E, clang::Initializing, and clang::interp::PT_Ptr.
bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 3567 of file Compiler.cpp.
References E.
Definition at line 788 of file Compiler.cpp.
References E.
bool Compiler::VisitPointerArithBinOp | ( | const BinaryOperator * | E | ) |
Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
Definition at line 977 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), LT, clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2511 of file Compiler.cpp.
References E, clang::Expr::getType(), and LT.
bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2884 of file Compiler.cpp.
References E, clang::Initializing, and P.
bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 3543 of file Compiler.cpp.
References E.
bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 3572 of file Compiler.cpp.
References E.
bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 3520 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 4992 of file Compiler.cpp.
References clang::ReturnStmt::getRetValue(), and clang::interp::InitLink::RVO().
bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 3625 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::Expr::getType(), clang::Initializing, and clang::interp::PT_Ptr.
bool Compiler::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 3231 of file Compiler.cpp.
References E.
bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 3081 of file Compiler.cpp.
References E, clang::interp::Record::getField(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getLValuePath(), clang::interp::Record::getNumFields(), clang::Expr::getType(), clang::APValue::isInt(), clang::Type::isIntegerType(), clang::APValue::isLValue(), clang::Type::isPointerType(), P, and V.
Definition at line 4916 of file Compiler.cpp.
References E.
Definition at line 3782 of file Compiler.cpp.
References clang::CompoundStmt::body(), clang::interp::LocalScope< Emitter >::destroyLocals(), E, and clang::CompoundStmt::getStmtExprResult().
bool Compiler::VisitStringLiteral | ( | const StringLiteral * | E | ) |
Definition at line 2332 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Initializing, and P.
bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 2000 of file Compiler.cpp.
References E.
bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 5289 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::Expr::getType(), and clang::Value::getType().
bool Compiler::VisitSYCLUniqueStableNameExpr | ( | const SYCLUniqueStableNameExpr * | E | ) |
Definition at line 2407 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, clang::Initializing, P, and clang::QualType::withConst().
bool Compiler::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 2829 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 2051 of file Compiler.cpp.
References AlignOfType(), E, clang::Type::getAs(), clang::ASTContext::getDeclAlign(), clang::ASTContext::getOpenMPDefaultSimdAlign(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), clang::Expr::getType(), clang::ASTContext::getTypeInfoDataSizeInChars(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParens(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isVoidType(), clang::CharUnits::One(), clang::ASTContext::toCharUnitsFromBits(), and clang::TypeInfoChars::Width.
bool Compiler::VisitUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 5668 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Type::isFixedPointType(), clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::Type::isMemberPointerType(), clang::Type::isVectorType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
|
protected |
Creates and initializes a variable from the given decl.
Definition at line 4357 of file Compiler.cpp.
References clang::interp::InitLink::Decl(), clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::Init, clang::QualType::isConstQualified(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::VarDecl::isStaticLocal(), clang::interp::VarCreationState::NotCreated(), P, and clang::interp::Context::shouldBeGloballyIndexed().
bool Compiler::VisitVectorBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1338 of file Compiler.cpp.
References clang::interp::Add, clang::interp::Div(), E, EMIT_ARITH_OP, clang::Type::getAs(), clang::BinaryOperator::getOpForCompoundAssignment(), clang::Expr::getType(), clang::Initializing, clang::Type::isVectorType(), clang::interp::Mul(), clang::interp::PT_Bool, clang::interp::PT_Ptr, and clang::interp::Sub.
bool Compiler::VisitVectorUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 6006 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::VectorType::getElementType(), clang::Expr::getType(), clang::Initializing, clang::Type::isVectorType(), clang::interp::PT_Bool, and clang::interp::PT_Ptr.
Definition at line 5091 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals().
|
friend |
Definition at line 312 of file Compiler.h.
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
Definition at line 324 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 324 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
Definition at line 324 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 324 of file Compiler.h.
|
friend |
Definition at line 324 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 400 of file Compiler.h.
Referenced by clang::interp::ArrayIndexScope< Emitter >::ArrayIndexScope().
|
protected |
Point to break to.
Definition at line 427 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Scope to cleanup until when we see a break statement.
Definition at line 425 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Switch case mapping.
Definition at line 422 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Point to continue to.
Definition at line 431 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope().
|
protected |
Scope to cleanup until when we see a continue statement.
Definition at line 429 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope().
|
protected |
Current compilation context.
Definition at line 117 of file Compiler.h.
Referenced by clang::interp::Compiler< Emitter >::classify().
|
protected |
Default case label.
Definition at line 433 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 406 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 412 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Definition at line 413 of file Compiler.h.
|
protected |
Definition at line 415 of file Compiler.h.
Referenced by clang::interp::InitLinkScope< Emitter >::InitLinkScope().
|
protected |
Definition at line 416 of file Compiler.h.
Referenced by clang::interp::InitStackScope< Emitter >::InitStackScope().
|
protected |
Definition at line 408 of file Compiler.h.
Referenced by clang::interp::StmtExprScope< Emitter >::StmtExprScope().
|
protected |
Variable to storage mapping.
Definition at line 391 of file Compiler.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 394 of file Compiler.h.
|
protected |
Program to link to.
Definition at line 119 of file Compiler.h.
|
protected |
Type of the expression returned by the function.
Definition at line 419 of file Compiler.h.
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 403 of file Compiler.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 397 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), clang::interp::SwitchScope< Emitter >::SwitchScope(), and clang::interp::VariableScope< Emitter >::VariableScope().