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 | |
Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
ParamTys | P { return RetTy() |
Compilation context for expressions.
Definition at line 103 of file Compiler.h.
|
protected |
Definition at line 108 of file Compiler.h.
|
protected |
Definition at line 110 of file Compiler.h.
|
protected |
Definition at line 107 of file Compiler.h.
|
protected |
Definition at line 109 of file Compiler.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 120 of file Compiler.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 4079 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 4054 of file Compiler.cpp.
References D, clang::interp::Descriptor::InlineDescMD, and P.
Definition at line 4121 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 248 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 251 of file Compiler.h.
References clang::interp::Context::classify(), and clang::interp::Compiler< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 263 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), E, and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 256 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 3760 of file Compiler.cpp.
References E.
Evaluates an expression for side effects and discards the result.
Definition at line 3754 of file Compiler.cpp.
References E.
|
protected |
Emits scope cleanup instructions.
Definition at line 6171 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 4160 of file Compiler.cpp.
|
protected |
Definition at line 4155 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 4148 of file Compiler.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 4142 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 3767 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::QualType::isNull(), and clang::Type::isVoidType().
bool Compiler::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 2271 of file Compiler.cpp.
References clang::Condition, and E.
bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 3527 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isVoidPointerType(), and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 4417 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 4444 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 1959 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::Init, and clang::T.
bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 2196 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 2205 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, and clang::Initializing.
bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1688 of file Compiler.cpp.
References E, clang::interp::PT_Ptr, and clang::Success.
bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2820 of file Compiler.cpp.
References E.
bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 5295 of file Compiler.cpp.
References clang::Expr::HasSideEffects(), and clang::Expr::isValueDependent().
bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 789 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 3416 of file Compiler.cpp.
References E, clang::Func, and P.
Visits an expression and converts it to a boolean.
Definition at line 3802 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 5189 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitBuiltinCallExpr | ( | const CallExpr * | E, |
unsigned | BuiltinID | ||
) |
Definition at line 4507 of file Compiler.cpp.
References E, clang::Func, clang::Expr::getType(), clang::Initializing, and clang::Type::isVoidType().
Definition at line 4556 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 5283 of file Compiler.cpp.
Definition at line 191 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 2413 of file Compiler.cpp.
References E.
bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 3224 of file Compiler.cpp.
References E.
bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1111 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 5821 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 2530 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 2746 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 4889 of file Compiler.cpp.
bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 3478 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 1998 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::T.
bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 5200 of file Compiler.cpp.
References clang::C.
bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 3537 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 2740 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 4776 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2943 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 4764 of file Compiler.cpp.
References E, clang::Initializing, and clang::T.
bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 4757 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 3400 of file Compiler.cpp.
References E.
bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 5133 of file Compiler.cpp.
References clang::interp::Inc, and clang::Init.
bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 3237 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 3268 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 2934 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 4784 of file Compiler.cpp.
References E, and clang::Expr::getType().
bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1986 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2887 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 3487 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 3154 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 3693 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 4805 of file Compiler.cpp.
References E, clang::interp::InitLink::K_Elem, and clang::interp::InitLink::K_Field.
bool Compiler::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 2879 of file Compiler.cpp.
References E.
bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 5326 of file Compiler.cpp.
bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 3436 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 4217 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 4245 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 6035 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 6166 of file Compiler.cpp.
Definition at line 4898 of file Compiler.cpp.
References D, clang::DeclStmt::decls(), and clang::isa().
bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 5289 of file Compiler.cpp.
Definition at line 5049 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals().
Definition at line 2014 of file Compiler.cpp.
References E.
|
overrideprotected |
Definition at line 4165 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 3430 of file Compiler.cpp.
References E.
bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 2653 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 3618 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 1518 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 771 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 1605 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isFixedPointType().
bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2420 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), and LT.
bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 741 of file Compiler.cpp.
References E.
Definition at line 5082 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::Inc, and clang::Init.
|
overrideprotected |
Definition at line 5564 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 3218 of file Compiler.cpp.
References E.
bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 4794 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 4949 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 749 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Initializing, and clang::Type::isAnyComplexType().
bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 1624 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 3794 of file Compiler.cpp.
References E, and clang::Expr::getType().
|
protected |
Definition at line 1718 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::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 1981 of file Compiler.cpp.
References E.
bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 733 of file Compiler.cpp.
References clang::interp::LE().
bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2827 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 1050 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 2661 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 2140 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 3229 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 3680 of file Compiler.cpp.
References E, and clang::interp::PT_Ptr.
bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 2378 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, and clang::Expr::getType().
bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 2371 of file Compiler.cpp.
References E.
bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 3119 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 2235 of file Compiler.cpp.
References E, clang::Initializing, and clang::interp::PT_Ptr.
bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 3517 of file Compiler.cpp.
References E.
Definition at line 784 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 973 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 2493 of file Compiler.cpp.
References E, clang::Expr::getType(), and LT.
bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2866 of file Compiler.cpp.
References E, clang::Initializing, and P.
bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 3493 of file Compiler.cpp.
References E.
bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 3522 of file Compiler.cpp.
References E.
bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 3470 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 4915 of file Compiler.cpp.
References clang::ReturnStmt::getRetValue().
bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 3575 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 3213 of file Compiler.cpp.
References E.
bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 3063 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 4839 of file Compiler.cpp.
References E.
Definition at line 3732 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 2314 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 1992 of file Compiler.cpp.
References E.
bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 5211 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 2389 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 2811 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 2043 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 5590 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 4306 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 1334 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 5928 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 5013 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals().
|
friend |
Definition at line 307 of file Compiler.h.
Definition at line 307 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
Definition at line 319 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
|
friend |
Definition at line 319 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
Definition at line 319 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
|
friend |
Definition at line 319 of file Compiler.h.
|
friend |
Definition at line 319 of file Compiler.h.
|
friend |
Definition at line 307 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 395 of file Compiler.h.
Referenced by clang::interp::ArrayIndexScope< Emitter >::ArrayIndexScope().
|
protected |
Point to break to.
Definition at line 422 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 420 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Switch case mapping.
Definition at line 417 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Point to continue to.
Definition at line 426 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 424 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope().
|
protected |
Current compilation context.
Definition at line 113 of file Compiler.h.
Referenced by clang::interp::Compiler< Emitter >::classify().
|
protected |
Default case label.
Definition at line 428 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 401 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 407 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Definition at line 408 of file Compiler.h.
|
protected |
Definition at line 410 of file Compiler.h.
Referenced by clang::interp::InitLinkScope< Emitter >::InitLinkScope().
|
protected |
Definition at line 411 of file Compiler.h.
Referenced by clang::interp::InitStackScope< Emitter >::InitStackScope().
|
protected |
Definition at line 403 of file Compiler.h.
Referenced by clang::interp::StmtExprScope< Emitter >::StmtExprScope().
|
protected |
Variable to storage mapping.
Definition at line 386 of file Compiler.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 389 of file Compiler.h.
|
protected |
Program to link to.
Definition at line 115 of file Compiler.h.
|
protected |
Type of the expression returned by the function.
Definition at line 414 of file Compiler.h.
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 398 of file Compiler.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 392 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), clang::interp::SwitchScope< Emitter >::SwitchScope(), and clang::interp::VariableScope< Emitter >::VariableScope().