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 4131 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 4106 of file Compiler.cpp.
References D, clang::interp::Descriptor::InlineDescMD, and P.
Definition at line 4173 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 3811 of file Compiler.cpp.
References E.
Evaluates an expression for side effects and discards the result.
Definition at line 3805 of file Compiler.cpp.
References E.
|
protected |
Emits scope cleanup instructions.
Definition at line 6279 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 4212 of file Compiler.cpp.
|
protected |
Definition at line 4207 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 4200 of file Compiler.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 4194 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 3818 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 2290 of file Compiler.cpp.
References clang::Condition, and E.
bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 3578 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isVoidPointerType(), and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 4470 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 4497 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 1968 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::Init, and clang::T.
bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 2215 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 2224 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, and clang::Initializing.
bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1693 of file Compiler.cpp.
References E, clang::interp::PT_Ptr, and clang::Success.
bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2839 of file Compiler.cpp.
References E.
bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 5384 of file Compiler.cpp.
References clang::ASTContext::getLangOpts(), clang::Expr::HasSideEffects(), and clang::Expr::isValueDependent().
bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 796 of file Compiler.cpp.
References clang::ASTContext::CompCategories, 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(), clang::ComparisonCategories::lookupInfoForType(), LT, clang::interp::PT_Bool, clang::interp::PT_MemberPtr, clang::Expr::refersToBitField(), and clang::T.
Definition at line 3435 of file Compiler.cpp.
References E, clang::Func, and P.
Visits an expression and converts it to a boolean.
Definition at line 3854 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 5278 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitBuiltinCallExpr | ( | const CallExpr * | E, |
unsigned | BuiltinID | ||
) |
Definition at line 4560 of file Compiler.cpp.
References E, clang::Func, clang::Expr::getType(), clang::Initializing, and clang::Type::isVoidType().
Definition at line 4609 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 5372 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::ASTContext::getFixedPointSemantics(), clang::ASTContext::getLangOpts(), clang::VectorType::getNumElements(), clang::Type::getPointeeType(), clang::interp::getRoundingMode(), clang::CastExpr::getSubExpr(), clang::ASTContext::getTargetNullPointerValue(), 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 2432 of file Compiler.cpp.
References E.
bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 3243 of file Compiler.cpp.
References E.
bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1118 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 5910 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 2549 of file Compiler.cpp.
References E, clang::ASTContext::getLangOpts(), 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 2765 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 4968 of file Compiler.cpp.
bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 3529 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 2007 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::T.
bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 5289 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 3588 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 2759 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 4824 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2962 of file Compiler.cpp.
References clang::interp::align(), E, clang::Func, clang::ASTContext::getAsConstantArrayType(), 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 4817 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 4810 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 3419 of file Compiler.cpp.
References E.
bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 5222 of file Compiler.cpp.
References clang::interp::Inc, and clang::Init.
bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 3256 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 3287 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 2953 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 4832 of file Compiler.cpp.
References E, clang::ASTContext::getTargetNullPointerValue(), and clang::Expr::getType().
bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1995 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2906 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 3538 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 3173 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 3744 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::ASTContext::getAsConstantArrayType(), 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 4853 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 2898 of file Compiler.cpp.
References E.
bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 5415 of file Compiler.cpp.
bool Compiler::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | E | ) |
Definition at line 3449 of file Compiler.cpp.
References E, clang::ASTContext::getLangOpts(), clang::Expr::getType(), clang::QualType::getTypePtr(), and clang::Expr::isLValue().
bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 3487 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 4270 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 4298 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 6124 of file Compiler.cpp.
References D, E, clang::ASTContext::getLangOpts(), clang::Expr::getType(), clang::Init, clang::Type::isReferenceType(), P, clang::interp::PT_Ptr, clang::T, and V.
bool Compiler::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 6274 of file Compiler.cpp.
Definition at line 4977 of file Compiler.cpp.
References D, clang::DeclStmt::decls(), and clang::isa().
bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 5378 of file Compiler.cpp.
Definition at line 5138 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals().
Definition at line 2023 of file Compiler.cpp.
References E.
|
overrideprotected |
Definition at line 4217 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, clang::Expr::getType(), clang::Type::isVoidType(), clang::T, and clang::interp::InitLink::Temp().
bool Compiler::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 3481 of file Compiler.cpp.
References E, and clang::ASTContext::getLangOpts().
bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 2672 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 3669 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 1525 of file Compiler.cpp.
References E, clang::ASTContext::getFixedPointSemantics(), clang::Expr::getType(), clang::Type::isFixedPointType(), clang::interp::PT_Bool, and clang::T.
bool Compiler::VisitFixedPointLiteral | ( | const FixedPointLiteral * | E | ) |
Definition at line 778 of file Compiler.cpp.
References E, clang::ASTContext::getFixedPointSemantics(), clang::Expr::getType(), clang::Type::isFixedPointType(), and clang::interp::PT_FixedPoint.
bool Compiler::VisitFixedPointUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 1610 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isFixedPointType().
bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2439 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), and LT.
bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 748 of file Compiler.cpp.
References E.
Definition at line 5171 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::Inc, and clang::Init.
|
overrideprotected |
Definition at line 5653 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 3237 of file Compiler.cpp.
References E.
bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 4842 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 5038 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 756 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Initializing, and clang::Type::isAnyComplexType().
bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 1629 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 3846 of file Compiler.cpp.
References E, and clang::Expr::getType().
|
protected |
Definition at line 1723 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::InitLink::Field(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), 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 1990 of file Compiler.cpp.
References E.
bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 740 of file Compiler.cpp.
References clang::interp::LE().
bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2846 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 1057 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 2680 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 2159 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 3248 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 3731 of file Compiler.cpp.
References E, and clang::interp::PT_Ptr.
bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 2397 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, clang::ASTContext::getObjCEncodingForType(), and clang::Expr::getType().
bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 2390 of file Compiler.cpp.
References E.
bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 3138 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 2254 of file Compiler.cpp.
References E, clang::Initializing, and clang::interp::PT_Ptr.
bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 3568 of file Compiler.cpp.
References E.
Definition at line 791 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 980 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 2512 of file Compiler.cpp.
References E, clang::Expr::getType(), and LT.
bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2885 of file Compiler.cpp.
References E, clang::Initializing, and P.
bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 3544 of file Compiler.cpp.
References E.
bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 3573 of file Compiler.cpp.
References E.
bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 3521 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 5003 of file Compiler.cpp.
References clang::ReturnStmt::getRetValue(), and clang::interp::InitLink::RVO().
bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 3626 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 3232 of file Compiler.cpp.
References E.
bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 3082 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 4918 of file Compiler.cpp.
References E.
Definition at line 3783 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 2333 of file Compiler.cpp.
References E, clang::ASTContext::getAsConstantArrayType(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Initializing, and P.
bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 2001 of file Compiler.cpp.
References E.
bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 5300 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 2408 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 2830 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 2052 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 5679 of file Compiler.cpp.
References E, clang::ASTContext::getLangOpts(), 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 4359 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 1341 of file Compiler.cpp.
References clang::interp::Add, clang::ASTContext::BoolTy, clang::interp::Div(), E, EMIT_ARITH_OP, clang::Type::getAs(), clang::BinaryOperator::getOpForCompoundAssignment(), clang::ASTContext::getPromotedIntegerType(), 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 6017 of file Compiler.cpp.
References clang::ASTContext::BoolTy, 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 5102 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.
|
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.
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 412 of file Compiler.h.
|
protected |
Definition at line 413 of file Compiler.h.
|
protected |
Definition at line 415 of file Compiler.h.
|
protected |
Definition at line 416 of file Compiler.h.
|
protected |
Definition at line 408 of file Compiler.h.
|
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.
|
protected |
Current scope.
Definition at line 397 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().