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) 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, 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. | |
OptLabelTy | BreakLabel |
Point to break to. | |
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 3523 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Init, clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), and P.
|
protected |
Creates a local primitive value.
Definition at line 3498 of file Compiler.cpp.
References D, clang::interp::Descriptor::InlineDescMD, and P.
Definition at line 3564 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 243 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 246 of file Compiler.h.
References clang::interp::Context::classify(), and clang::interp::Compiler< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 258 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), E, and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 251 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 3240 of file Compiler.cpp.
References clang::Expr::containsErrors(), and E.
Evaluates an expression for side effects and discards the result.
Definition at line 3234 of file Compiler.cpp.
References E.
|
protected |
Emits scope cleanup instructions.
Definition at line 5425 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 3603 of file Compiler.cpp.
|
protected |
Definition at line 3598 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 3591 of file Compiler.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 3585 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 3250 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 1860 of file Compiler.cpp.
References clang::Condition, and E.
bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 3024 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isVoidPointerType(), and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 3844 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 3871 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 1559 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::Init, and clang::T.
bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 1785 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 1794 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1289 of file Compiler.cpp.
References E, clang::interp::PT_Ptr, and clang::Success.
bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2400 of file Compiler.cpp.
References E.
bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 4671 of file Compiler.cpp.
References clang::Expr::HasSideEffects(), and clang::Expr::isValueDependent().
bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 693 of file Compiler.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::BinaryOperator::isCommaOp(), clang::BinaryOperator::isComparisonOp(), clang::Type::isFloatingType(), clang::BinaryOperator::isLogicalOp(), clang::Expr::isLValue(), clang::BinaryOperator::isPtrMemOp(), clang::interp::isPtrType(), clang::Type::isVoidType(), LT, clang::interp::PT_Bool, clang::interp::PT_MemberPtr, clang::Expr::refersToBitField(), and clang::T.
Definition at line 2913 of file Compiler.cpp.
References E, clang::Func, and P.
Visits an expression and converts it to a boolean.
Definition at line 3291 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 4571 of file Compiler.cpp.
Definition at line 3934 of file Compiler.cpp.
References E, clang::Func, clang::Expr::getType(), clang::interp::isPtrType(), clang::Type::isVoidType(), P, and clang::interp::PT_Ptr.
Definition at line 3989 of file Compiler.cpp.
References clang::interp::align(), clang::interp::collectNonNullArgs(), E, clang::Func, clang::Type::isVoidType(), clang::interp::primSize(), clang::interp::PT_FnPtr, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 4659 of file Compiler.cpp.
Definition at line 178 of file Compiler.cpp.
References clang::Type::getAs(), clang::QualType::getCanonicalType(), clang::CastExpr::getCastKind(), clang::MemberPointerType::getClass(), clang::EnumType::getDecl(), clang::Type::getPointeeType(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::QualType::getTypePtr(), 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 2000 of file Compiler.cpp.
References E.
bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 2758 of file Compiler.cpp.
References E.
bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 982 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::ComplexType::getElementType(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::interp::PT_Float, and clang::interp::PT_Ptr.
bool Compiler::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 5182 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isLValue(), clang::interp::PT_Bool, and clang::interp::PT_Ptr.
bool Compiler::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2118 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), clang::Type::isPointerType(), LT, clang::interp::PT_Float, and clang::Expr::refersToBitField().
bool Compiler::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 2326 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Init, clang::Expr::isLValue(), P, and clang::T.
bool Compiler::visitCompoundStmt | ( | const CompoundStmt * | S | ) |
Definition at line 4306 of file Compiler.cpp.
bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 2975 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 1598 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::T.
bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 4580 of file Compiler.cpp.
bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 3034 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::VectorType::getElementType(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool Compiler::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 2320 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 4194 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2483 of file Compiler.cpp.
References clang::interp::align(), E, clang::Func, clang::Type::getAsCXXRecordDecl(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), 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 4182 of file Compiler.cpp.
bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 4175 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 2902 of file Compiler.cpp.
References E.
bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 4515 of file Compiler.cpp.
References clang::interp::Inc, and clang::Init.
bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 2771 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 2802 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 2474 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 4202 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1586 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2462 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 2984 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 2688 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitCXXStdInitializerListExpr | ( | const CXXStdInitializerListExpr * | E | ) |
Definition at line 3179 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::Record::getField(), clang::ValueDecl::getType(), clang::Expr::getType(), 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 4222 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 2454 of file Compiler.cpp.
References E.
bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 4702 of file Compiler.cpp.
bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 2930 of file Compiler.cpp.
References E, clang::MSGuidDecl::getAsAPValue(), clang::Type::getAsRecordDecl(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TagDecl::isCompleteDefinition(), clang::APValue::None, P, and V.
|
protected |
Definition at line 3646 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 3674 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 5289 of file Compiler.cpp.
References D, E, clang::Type::getAs(), clang::Expr::getType(), clang::interp::isPtrType(), clang::Type::isVoidType(), P, clang::interp::PT_Ptr, and clang::T.
Referenced by clang::interp::InitLink::emit().
bool Compiler::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 5420 of file Compiler.cpp.
Definition at line 4315 of file Compiler.cpp.
References D, clang::DeclStmt::decls(), and clang::isa().
bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 4665 of file Compiler.cpp.
Definition at line 4440 of file Compiler.cpp.
Definition at line 1614 of file Compiler.cpp.
References E.
Definition at line 3607 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 2924 of file Compiler.cpp.
References E.
bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 2239 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 3108 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isVectorType(), clang::interp::PT_Ptr, and clang::interp::PT_Uint32.
bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2007 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), and LT.
bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 658 of file Compiler.cpp.
References E.
Definition at line 4468 of file Compiler.cpp.
References clang::interp::Inc, and clang::Init.
|
overrideprotected |
Definition at line 4937 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 2752 of file Compiler.cpp.
References E.
bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 4211 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 4366 of file Compiler.cpp.
References 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 666 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isAnyComplexType().
bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 1205 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsRecordDecl(), clang::Expr::getType(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), clang::Decl::isInvalidDecl(), clang::Type::isRecordType(), clang::TagDecl::isUnion(), 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 3277 of file Compiler.cpp.
References clang::Expr::containsErrors(), E, and clang::Expr::getType().
|
protected |
Definition at line 1319 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 1581 of file Compiler.cpp.
References E.
bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 650 of file Compiler.cpp.
References clang::interp::LE().
bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2407 of file Compiler.cpp.
References E, clang::interp::Record::fields(), clang::Init, P, and clang::T.
bool Compiler::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 921 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 2247 of file Compiler.cpp.
References E, IsStatic, P, clang::SD_Static, clang::Expr::skipRValueSubobjectAdjustments(), and clang::interp::InitLink::Temp().
bool Compiler::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 1733 of file Compiler.cpp.
References E, clang::interp::Record::getField(), clang::DeclContext::getParent(), clang::Expr::isGLValue(), clang::Member, P, clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 2763 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 3170 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 1965 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, and clang::Expr::getType().
bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 1960 of file Compiler.cpp.
References E.
bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 2653 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 1824 of file Compiler.cpp.
References E, and clang::interp::PT_Ptr.
bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 3014 of file Compiler.cpp.
References E.
Definition at line 688 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 873 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and LT.
bool Compiler::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2081 of file Compiler.cpp.
References E, clang::Expr::getType(), and LT.
bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2446 of file Compiler.cpp.
References E.
bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 2990 of file Compiler.cpp.
References E.
bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 3019 of file Compiler.cpp.
References E.
bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 2967 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 4332 of file Compiler.cpp.
References clang::ReturnStmt::getRetValue().
bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 3066 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool Compiler::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 2747 of file Compiler.cpp.
References E.
bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 2597 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 4256 of file Compiler.cpp.
References E.
Definition at line 3212 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 1903 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), and P.
bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 1592 of file Compiler.cpp.
References E.
bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 4589 of file Compiler.cpp.
References clang::Expr::getType(), and clang::Value::getType().
bool Compiler::VisitSYCLUniqueStableNameExpr | ( | const SYCLUniqueStableNameExpr * | E | ) |
Definition at line 1976 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, P, and clang::QualType::withConst().
bool Compiler::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 2391 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 1643 of file Compiler.cpp.
References AlignOfType(), E, clang::Type::getAs(), clang::ASTContext::getDeclAlign(), clang::Type::getPointeeType(), 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(), and clang::TypeInfoChars::Width.
bool Compiler::VisitUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 4963 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::Type::isMemberPointerType(), 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 3734 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().
Definition at line 4409 of file Compiler.cpp.
|
friend |
Definition at line 301 of file Compiler.h.
Definition at line 301 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
Definition at line 313 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
|
friend |
Definition at line 313 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
Definition at line 313 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
|
friend |
Definition at line 313 of file Compiler.h.
|
friend |
Definition at line 313 of file Compiler.h.
|
friend |
Definition at line 301 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 378 of file Compiler.h.
Referenced by clang::interp::ArrayIndexScope< Emitter >::ArrayIndexScope().
|
protected |
Point to break to.
Definition at line 403 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Switch case mapping.
Definition at line 400 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Point to continue to.
Definition at line 405 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 407 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 384 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 390 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Definition at line 391 of file Compiler.h.
|
protected |
Definition at line 393 of file Compiler.h.
Referenced by clang::interp::InitLinkScope< Emitter >::InitLinkScope().
|
protected |
Definition at line 394 of file Compiler.h.
Referenced by clang::interp::InitStackScope< Emitter >::InitStackScope().
|
protected |
Definition at line 386 of file Compiler.h.
Referenced by clang::interp::StmtExprScope< Emitter >::StmtExprScope().
|
protected |
Variable to storage mapping.
Definition at line 369 of file Compiler.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 372 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 397 of file Compiler.h.
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 381 of file Compiler.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 375 of file Compiler.h.
Referenced by clang::interp::VariableScope< Emitter >::VariableScope().