|
clang 24.0.0git
|
Compilation context for expressions. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/Compiler.h"
Classes | |
| struct | LabelInfo |
Protected Types | |
| using | LabelTy = typename Emitter::LabelTy |
| using | AddrTy = typename Emitter::AddrTy |
| using | OptLabelTy = UnsignedOrNone |
| using | CaseMap = llvm::DenseMap<const SwitchCase *, LabelTy> |
Protected Member Functions | |
| bool | visitStmt (const Stmt *S) |
| bool | visitExpr (const Expr *E, bool DestroyToplevelScope) override |
| bool | visitLValueExpr (const Expr *E, bool DestroyToplevelScope) override |
| bool | visitFunc (const FunctionDecl *F) override |
| bool | visitDeclAndReturn (const VarDecl *VD, const Expr *Init, bool ConstantContext) override |
| Toplevel visitDeclAndReturn(). | |
| bool | visitDtorCall (const VarDecl *VD, const APValue &Value) override |
| bool | visitWithSubstitutions (const FunctionDecl *Callee, ArrayRef< const Expr * > Args, const Expr *This, const Expr *Condition) override |
Evaluate the Condition as if it was in the body of Callee. | |
| bool | 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. | |
| OptPrimType | classify (const Expr *E) const |
| OptPrimType | classify (QualType Ty) const |
| bool | canClassify (const Expr *E) const |
| bool | canClassify (QualType T) 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) override |
| Evaluates an expression and places the result on the stack. | |
| bool | visitInitializer (const Expr *E) |
| Compiles an initializer. | |
| bool | visitInitializerPop (const Expr *E) |
| Similar, but will also pop the pointer. | |
| bool | visitAsLValue (const Expr *E) |
| 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, const Expr *Init, bool Toplevel=false) |
| Creates and initializes a variable from the given decl. | |
| VarCreationState | visitDecl (const VarDecl *VD) |
| bool | visitAPValue (const APValue &Val, PrimType ValType, SourceInfo Info) |
| Visit an APValue. | |
| bool | visitAPValueInitializer (const APValue &Val, SourceInfo Info, QualType T, bool IsCompleteClass=true) |
| 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, OptPrimType InitT) |
| Pointer to the array(not the element!) must be on the stack when calling this. | |
| bool | visitCallArgs (ArrayRef< const Expr * > Args, const FunctionDecl *FuncDecl, bool Activate, bool IsOperatorCall) |
| unsigned | allocateLocalPrimitive (DeclOrExpr Decl, PrimType Ty, bool IsConst, bool IsVolatile=false, ScopeKind SC=ScopeKind::Block) |
| Creates a local primitive value. | |
| UnsignedOrNone | allocateLocal (DeclOrExpr Decl, QualType Ty=QualType(), ScopeKind=ScopeKind::Block) |
| Allocates a space storing a local given its type. | |
| UnsignedOrNone | 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 | SwitchInStmtExpr = false |
| bool | InStmtExpr = false |
| bool | ToLValue = false |
| bool | VariablesAreConstexprUnknown = false |
| bool | Initializing = false |
| Flag inidicating if we're initializing an already created variable. | |
| const VarDecl * | InitializingDecl = nullptr |
| llvm::SmallVector< InitLink > | InitStack |
| bool | InitStackActive = false |
| OptPrimType | ReturnType |
| Type of the expression returned by the function. | |
| CaseMap | CaseLabels |
| Switch case mapping. | |
| llvm::SmallVector< LabelInfo > | LabelInfoStack |
| Stack of label information for loops and switch statements. | |
| const FunctionDecl * | CompilingFunction = nullptr |
Friends | |
| class | VariableScope< Emitter > |
| class | LocalScope< 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 | SwitchScope< Emitter > |
| class | LocOverrideScope< Emitter > |
Additional Inherited Members | |
| Public Attributes inherited from clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... > | |
| ParamTys | P |
Compilation context for expressions.
Definition at line 115 of file Compiler.h.
|
protected |
Definition at line 120 of file Compiler.h.
|
protected |
Definition at line 122 of file Compiler.h.
|
protected |
Definition at line 119 of file Compiler.h.
|
protected |
Definition at line 121 of file Compiler.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 146 of file Compiler.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 5486 of file Compiler.cpp.
References clang::interp::DeclOrExpr::asExpr(), clang::interp::DeclOrExpr::asValueDecl(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Init(), clang::interp::Descriptor::IsConstexprUnknown, clang::QualType::isConstQualified(), clang::QualType::isNull(), clang::QualType::isVolatileQualified(), Local, Locals, P, VariablesAreConstexprUnknown, and VarScope.
Referenced by visit(), VisitBinaryOperator(), VisitBuiltinCallExpr(), visitCallArgs(), VisitCallExpr(), VisitCastExpr(), VisitComplexUnaryOperator(), VisitCompoundLiteralExpr(), VisitConstantExpr(), VisitCXXConstructExpr(), VisitCXXScalarValueInitExpr(), VisitCXXStdInitializerListExpr(), visitExpr(), VisitExtVectorElementExpr(), visitInitList(), VisitMaterializeTemporaryExpr(), VisitShuffleVectorExpr(), visitVarDecl(), VisitVectorUnaryOperator(), and visitWithSubstitutions().
|
protected |
Creates a local primitive value.
Definition at line 5468 of file Compiler.cpp.
References clang::interp::DeclOrExpr::asValueDecl(), clang::interp::Descriptor::IsConstexprUnknown, clang::interp::DeclOrExpr::isExpr(), Local, Locals, P, VariablesAreConstexprUnknown, and VarScope.
Referenced by VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitCompoundAssignOperator(), VisitCompoundLiteralExpr(), VisitCXXNewExpr(), VisitExtVectorElementExpr(), VisitFloatCompoundAssignOperator(), VisitMaterializeTemporaryExpr(), VisitOpaqueValueExpr(), VisitShuffleVectorExpr(), visitSwitchStmt(), visitVarDecl(), VisitVectorBinOp(), VisitVectorUnaryOperator(), and visitWithSubstitutions().
|
protected |
Definition at line 5518 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::addLocal(), clang::interp::VariableScope< Emitter >::getParent(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::QualType::isConstQualified(), clang::Type::isRecordType(), Local, P, and VarScope.
Referenced by VisitCastExpr(), VisitComplexBinOp(), VisitImaginaryLiteral(), and VisitVectorBinOp().
|
inlineprotected |
Definition at line 293 of file Compiler.h.
References Ctx.
Referenced by registerRedecl(), visit(), visitCallArgs(), VisitCastExpr(), VisitCXXConstructExpr(), VisitCXXStdInitializerListExpr(), visitDtorCall(), visitInitializer(), visitInitializerPop(), visitInitList(), VisitVectorBinOp(), and visitWithSubstitutions().
|
inlineprotected |
Definition at line 294 of file Compiler.h.
|
inlineprotected |
Definition at line 291 of file Compiler.h.
References Ctx.
Referenced by classifyPrim(), classifyPrim(), visitAPValueInitializer(), VisitArrayInitLoopExpr(), VisitArraySubscriptExpr(), VisitBinaryOperator(), visitBool(), VisitBuiltinCallExpr(), visitCallArgs(), VisitCallExpr(), VisitCastExpr(), VisitComplexUnaryOperator(), VisitCompoundAssignOperator(), VisitCompoundLiteralExpr(), VisitConstantExpr(), VisitCXXConstructExpr(), VisitCXXInheritedCtorInitExpr(), VisitCXXNewExpr(), VisitCXXReinterpretCastExpr(), VisitCXXScalarValueInitExpr(), visitDeclAndReturn(), visitDeclRef(), visitExpr(), VisitFloatCompoundAssignOperator(), visitFunc(), VisitImplicitValueInitExpr(), visitInitList(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitOpaqueValueExpr(), VisitPointerArithBinOp(), VisitPointerCompoundAssignOperator(), VisitUnaryOperator(), visitVarDecl(), and visitWithSubstitutions().
|
inlineprotected |
Definition at line 292 of file Compiler.h.
References Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 304 of file Compiler.h.
References classify(), and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 297 of file Compiler.h.
References classify(), and clang::T.
Referenced by registerRedecl(), visitAPValueInitializer(), VisitArraySubscriptExpr(), VisitBinaryOperator(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitConceptSpecializationExpr(), VisitCXXNewExpr(), VisitCXXScalarValueInitExpr(), visitDeclRef(), VisitExtVectorElementExpr(), VisitFixedPointBinOp(), VisitFixedPointLiteral(), VisitFloatCompoundAssignOperator(), VisitGNUNullExpr(), VisitImaginaryLiteral(), VisitImplicitValueInitExpr(), visitInitList(), VisitLogicalBinOp(), VisitObjCBoxedExpr(), VisitOffsetOfExpr(), VisitPointerArithBinOp(), VisitRequiresExpr(), VisitShuffleVectorExpr(), visitSwitchStmt(), VisitTypeTraitExpr(), VisitUnaryOperator(), visitVarDecl(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
Just pass evaluation on to E.
This leaves all the parsing flags intact.
Definition at line 5034 of file Compiler.cpp.
References clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Referenced by VisitAbstractConditionalOperator(), VisitBinaryOperator(), VisitCastExpr(), VisitChooseExpr(), VisitComplexUnaryOperator(), VisitCompoundLiteralExpr(), VisitConstantExpr(), VisitCXXBindTemporaryExpr(), VisitCXXDefaultArgExpr(), VisitCXXDefaultInitExpr(), VisitCXXReinterpretCastExpr(), VisitCXXRewrittenBinaryOperator(), visitDeclRef(), VisitExprWithCleanups(), VisitFixedPointUnaryOperator(), VisitGenericSelectionExpr(), visitInitList(), VisitMaterializeTemporaryExpr(), VisitObjCEncodeExpr(), VisitPackIndexingExpr(), VisitParenExpr(), VisitPredefinedExpr(), VisitPseudoObjectExpr(), VisitStmtExpr(), VisitSubstNonTypeTemplateParmExpr(), VisitUnaryOperator(), and VisitVectorUnaryOperator().
Evaluates an expression for side effects and discards the result.
Definition at line 5028 of file Compiler.cpp.
References clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Emits scope cleanup instructions.
Definition at line 8751 of file Compiler.cpp.
|
protected |
Returns a function for the given FunctionDecl.
If the function does not exist yet, it is compiled.
Definition at line 5558 of file Compiler.cpp.
References Ctx.
Referenced by VisitCallExpr(), VisitCXXConstructExpr(), VisitCXXInheritedCtorInitExpr(), VisitCXXNewExpr(), and visitDeclRef().
|
protected |
Definition at line 5553 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 5546 of file Compiler.cpp.
References getRecord(), and getRecordTy().
Referenced by getRecord(), visitAPValue(), visitAPValueInitializer(), VisitCastExpr(), VisitCXXConstructExpr(), VisitCXXStdInitializerListExpr(), VisitCXXUuidofExpr(), VisitImplicitValueInitExpr(), visitInitList(), VisitMemberExpr(), VisitSourceLocExpr(), and VisitTypeTraitExpr().
Returns a record type from a record or pointer type.
Definition at line 5540 of file Compiler.cpp.
References clang::Type::getAsCanonical().
Referenced by getRecord().
Definition at line 6277 of file Compiler.cpp.
References canClassify(), classifyPrim(), clang::ValueDecl::getType(), P, clang::T, and visitAPValue().
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 5066 of file Compiler.cpp.
References allocateLocal(), canClassify(), clang::interp::discard(), clang::interp::FullExpression, clang::Expr::getType(), clang::Expr::isGLValue(), clang::QualType::isNull(), clang::Type::isVoidType(), stripDerivedToBaseCasts(), clang::interp::InitLink::Temp(), ToLValue, clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit(), and visitInitializer().
Referenced by visitAPValue(), visitArrayElemInit(), VisitArrayInitLoopExpr(), VisitArraySubscriptExpr(), VisitBinaryOperator(), visitBool(), VisitBuiltinCallExpr(), visitCallArgs(), VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitCompoundAssignOperator(), VisitCompoundLiteralExpr(), VisitCXXBindTemporaryExpr(), VisitCXXConstructExpr(), VisitCXXDeleteExpr(), VisitCXXDynamicCastExpr(), VisitCXXNewExpr(), VisitCXXStdInitializerListExpr(), VisitCXXTypeidExpr(), visitDeclAndReturn(), VisitEmbedExpr(), visitExpr(), VisitExtVectorElementExpr(), VisitFixedPointBinOp(), VisitFixedPointUnaryOperator(), VisitFloatCompoundAssignOperator(), visitInitList(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitOffsetOfExpr(), VisitOpaqueValueExpr(), VisitPointerArithBinOp(), VisitPointerCompoundAssignOperator(), visitReturnStmt(), VisitShuffleVectorExpr(), VisitSourceLocExpr(), visitSwitchStmt(), VisitUnaryOperator(), visitVarDecl(), VisitVectorBinOp(), VisitVectorUnaryOperator(), and visitWithSubstitutions().
| bool Compiler::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 3131 of file Compiler.cpp.
References clang::Condition, delegate(), clang::interp::discard(), clang::interp::getBoolValue(), clang::AbstractConditionalOperator::getCond(), clang::AbstractConditionalOperator::getFalseExpr(), clang::AbstractConditionalOperator::getTrueExpr(), VarScope, and visitBool().
| bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 4758 of file Compiler.cpp.
References DiscardResult, clang::Expr::getType(), and clang::Type::isVoidPointerType().
|
protected |
Visit an APValue.
Definition at line 5966 of file Compiler.cpp.
References clang::interp::SourceInfo::asExpr(), clang::cast(), Ctx, DiscardResult, clang::interp::Record::findVirtualBase(), clang::Type::getAsArrayTypeUnsafe(), clang::interp::Record::getBaseOrNull(), clang::ArrayType::getElementType(), clang::interp::Record::getField(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getLValueOffset(), clang::APValue::getLValuePath(), clang::APValue::getMemberPointerDecl(), clang::APValue::getMemberPointerPath(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), getRecord(), clang::Expr::getType(), getType(), clang::QualType::getTypePtr(), clang::APValue::hasLValuePath(), clang::Type::isArrayType(), clang::APValue::isFloat(), clang::Expr::isGLValue(), clang::APValue::isIndeterminate(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), clang::APValue::isMemberPointerToDerivedMember(), clang::APValue::isNullPointer(), clang::interp::isPtrType(), clang::Type::isRecordType(), clang::interp::Record::Field::Offset, P, clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_Uint64, visit(), and visitDeclRef().
|
protected |
Definition at line 6101 of file Compiler.cpp.
References clang::cast(), classify(), classifyPrim(), Ctx, clang::APValue::getArrayFiller(), clang::APValue::getArrayInitializedElt(), clang::APValue::getArrayInitializedElts(), clang::APValue::getArraySize(), clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::ComplexType::getElementType(), clang::VectorType::getElementType(), getRecord(), clang::APValue::getStructBase(), clang::APValue::getStructField(), clang::APValue::getStructNumBases(), clang::APValue::getStructNumFields(), clang::APValue::getStructNumVirtualBases(), clang::APValue::getStructVirtualBase(), clang::APValue::getUnionField(), clang::APValue::getUnionValue(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), clang::APValue::isArray(), clang::APValue::isComplexFloat(), clang::APValue::isComplexInt(), clang::APValue::isIndeterminate(), clang::APValue::isStruct(), clang::APValue::isUnion(), clang::APValue::isVector(), clang::T, visitAPValue(), and visitAPValueInitializer().
Referenced by visitAPValueInitializer(), VisitConstantExpr(), VisitCXXUuidofExpr(), visitDeclRef(), and visitDtorCall().
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 2671 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::interp::Init(), visit(), and visitInitializerPop().
Referenced by VisitArrayInitLoopExpr(), VisitCastExpr(), VisitImaginaryLiteral(), and visitInitList().
| bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 3039 of file Compiler.cpp.
References ArrayIndex, and DiscardResult.
| bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 3049 of file Compiler.cpp.
References clang::cast(), classify(), Ctx, clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::discard(), DiscardResult, clang::interp::exceedsArraySizeLimit(), clang::interp::FullExpression, clang::ArrayInitLoopExpr::getArraySize(), clang::ArrayInitLoopExpr::getCommonExpr(), clang::ArrayInitLoopExpr::getSubExpr(), Initializing, visit(), and visitArrayElemInit().
| bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 2295 of file Compiler.cpp.
References classify(), classifyPrim(), clang::Expr::containsErrors(), DiscardResult, clang::ArraySubscriptExpr::getBase(), clang::ArraySubscriptExpr::getIdx(), clang::ArraySubscriptExpr::getLHS(), clang::ArraySubscriptExpr::getRHS(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isVoidType(), clang::interp::PT_Ptr, clang::Success, clang::T, and visit().
| bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 3791 of file Compiler.cpp.
References DiscardResult, and clang::ArrayTypeTraitExpr::getValue().
Definition at line 5111 of file Compiler.cpp.
References clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Referenced by VisitBuiltinCallExpr().
| bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 7508 of file Compiler.cpp.
References Ctx, clang::AttributedStmt::getAttrs(), clang::AttributedStmt::getSubStmt(), clang::Expr::HasSideEffects(), clang::hasSpecificAttr(), clang::isa(), clang::Expr::isValueDependent(), visitBool(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 1337 of file Compiler.cpp.
References allocateLocal(), classify(), classifyPrim(), clang::Expr::containsErrors(), Ctx, delegate(), clang::interp::discard(), DiscardResult, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), Initializing, clang::Type::isAnyComplexType(), clang::BinaryOperator::isCommaOp(), clang::BinaryOperator::isComparisonOp(), clang::Type::isFixedPointType(), clang::Type::isFloatingType(), clang::BinaryOperator::isLogicalOp(), clang::BinaryOperator::isPtrMemOp(), clang::interp::isPtrType(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::interp::LT(), clang::interp::PT_Bool, clang::interp::PT_MemberPtr, clang::Result, clang::T, visit(), VisitComplexBinOp(), VisitFixedPointBinOp(), VisitLogicalBinOp(), VisitPointerArithBinOp(), and VisitVectorBinOp().
Definition at line 4571 of file Compiler.cpp.
References Ctx, DiscardResult, and clang::Func.
Visits an expression and converts it to a boolean.
Definition at line 5117 of file Compiler.cpp.
References classify(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_Ptr, clang::T, ToLValue, and visit().
Referenced by VisitAbstractConditionalOperator(), visitAttributedStmt(), visitCXXForRangeStmt(), visitDoStmt(), visitForStmt(), visitIfStmt(), VisitLogicalBinOp(), VisitUnaryOperator(), and visitWhileStmt().
Definition at line 7277 of file Compiler.cpp.
References clang::C, clang::LoopControlStmt::getNamedLoopOrSwitch(), clang::LoopControlStmt::isNamed(), LabelInfoStack, and VarScope.
Referenced by visitStmt().
| bool Compiler::VisitBuiltinBitCastExpr | ( | const BuiltinBitCastExpr * | E | ) |
Definition at line 1271 of file Compiler.cpp.
| bool Compiler::VisitBuiltinCallExpr | ( | const CallExpr * | E, |
| unsigned | BuiltinID ) |
Definition at line 6296 of file Compiler.cpp.
References allocateLocal(), clang::CallExpr::arguments(), classify(), classifyPrim(), ConvertBuiltinIDToX86BuiltinID(), Ctx, DiscardResult, clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), ignorePointerCastsAndParens(), Initializing, clang::Expr::isGLValue(), clang::interp::Context::isUnevaluatedBuiltin(), clang::Type::isVoidType(), clang::interp::PT_Ptr, ReturnType, clang::interp::OptPrimType::value_or(), visit(), and visitAsLValue().
Referenced by VisitCallExpr().
|
protected |
Definition at line 2691 of file Compiler.cpp.
References clang::interp::Activate(), allocateLocal(), clang::interp::Call, canClassify(), classify(), clang::interp::collectNonNullArgs(), clang::FunctionDecl::getParamDecl(), clang::Decl::hasAttr(), clang::interp::PT_Ptr, clang::interp::InitLink::Temp(), VarScope, visit(), and visitInitializer().
Referenced by VisitCallExpr().
Definition at line 6418 of file Compiler.cpp.
References clang::interp::align(), allocateLocal(), allocateLocalPrimitive(), clang::interp::Call, clang::cast(), classify(), classifyPrim(), CompilingFunction, clang::Expr::containsErrors(), Ctx, clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::discard(), DiscardResult, clang::Func, clang::CallExpr::getArg(), clang::CallExpr::getArgs(), clang::FunctionDecl::getBuiltinID(), clang::CallExpr::getCallee(), clang::CallExpr::getCallReturnType(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::CallExpr::getDirectCallee(), getFunction(), clang::CallExpr::getNumArgs(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), Initializing, clang::isa(), clang::DeclarationName::isAnyOperatorNew(), isTrivialMemoryOperation(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::interp::primSize(), clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, ReturnType, stripCheckedDerivedToBaseCasts(), clang::T, visit(), VisitBuiltinCallExpr(), and visitCallArgs().
Definition at line 7478 of file Compiler.cpp.
References CaseLabels, clang::CaseStmt::getSubStmt(), InStmtExpr, SwitchInStmtExpr, and visitStmt().
Referenced by visitStmt().
Definition at line 447 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), allocateTemporary(), canClassify(), clang::Type::castAs(), clang::Type::castAsEnumDecl(), classify(), classifyPrim(), clang::Expr::containsErrors(), Ctx, delegate(), clang::interp::discard(), DiscardResult, clang::Type::getAs(), clang::CastExpr::getCastKind(), clang::VectorType::getNumElements(), clang::Type::getPointeeType(), getRecord(), clang::interp::getRoundingMode(), clang::CastExpr::getSubExpr(), clang::CastExpr::getTargetUnionField(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Type::hasBooleanRepresentation(), Initializing, clang::Type::isAnyComplexType(), clang::Type::isAtomicType(), clang::Type::isConstantMatrixType(), clang::Type::isEnumeralType(), clang::Type::isFloatingType(), clang::Type::isFunctionPointerType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isPointerOrReferenceType(), clang::Type::isPointerType(), clang::interp::isPtrType(), clang::Type::isRealFloatingType(), clang::Type::isReferenceType(), clang::interp::isSignedType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), clang::QualType::isVolatileQualified(), Locals, P, clang::CastExpr::path(), clang::CastExpr::path_begin(), clang::CastExpr::path_end(), clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, clang::interp::Reinterpret, clang::interp::ReinterpretLike, clang::interp::Context::shouldBeGloballyIndexed(), clang::T, ToLValue, visit(), visitArrayElemInit(), visitInitializerPop(), and clang::interp::Volatile.
Referenced by VisitCXXDynamicCastExpr(), and VisitCXXReinterpretCastExpr().
| bool Compiler::VisitCharacterLiteral | ( | const CharacterLiteral * | E | ) |
Definition at line 3293 of file Compiler.cpp.
References DiscardResult, and clang::CharacterLiteral::getValue().
| bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 4233 of file Compiler.cpp.
References delegate(), and clang::ChooseExpr::getChosenSubExpr().
| bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1653 of file Compiler.cpp.
References allocateLocalPrimitive(), allocateTemporary(), classifyPrim(), DiscardResult, clang::Type::getAs(), clang::ComplexType::getElementType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), Initializing, clang::Type::isAnyComplexType(), clang::interp::PT_Float, clang::interp::PT_Ptr, and visit().
Referenced by VisitBinaryOperator().
| bool Compiler::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 8309 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), classify(), classifyPrim(), delegate(), clang::interp::discard(), DiscardResult, clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), Initializing, clang::Type::isAnyComplexType(), clang::Expr::isLValue(), clang::interp::PT_Bool, clang::interp::PT_Ptr, and visit().
Referenced by VisitUnaryOperator().
| bool Compiler::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 3425 of file Compiler.cpp.
References allocateLocalPrimitive(), classify(), Ctx, DiscardResult, clang::CompoundAssignOperator::getComputationLHSType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFloatingType(), clang::Type::isPointerType(), clang::interp::isSideEffectFree(), clang::Type::isVectorType(), clang::interp::LT(), clang::interp::PT_Float, clang::Expr::refersToBitField(), visit(), VisitFloatCompoundAssignOperator(), VisitPointerCompoundAssignOperator(), and VisitVectorBinOp().
| bool Compiler::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 3702 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), classify(), delegate(), clang::interp::discard(), DiscardResult, clang::CompoundLiteralExpr::getInitializer(), clang::Expr::getType(), clang::interp::Init(), Initializing, clang::CompoundLiteralExpr::isFileScope(), clang::Expr::isLValue(), P, clang::T, visit(), and visitInitializer().
| bool Compiler::visitCompoundStmt | ( | const CompoundStmt * | S | ) |
Definition at line 6868 of file Compiler.cpp.
References clang::CompoundStmt::body(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 4709 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::Expr::getType(), clang::ConceptSpecializationExpr::isSatisfied(), and clang::interp::PT_Bool.
| bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 2769 of file Compiler.cpp.
References allocateLocal(), classify(), delegate(), DiscardResult, clang::ConstantExpr::getAPValueResult(), clang::FullExpr::getSubExpr(), clang::Expr::getType(), clang::ConstantExpr::hasAPValueResult(), Initializing, clang::T, visitAPValue(), and visitAPValueInitializer().
| bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 7323 of file Compiler.cpp.
References clang::C, clang::LoopControlStmt::getNamedLoopOrSwitch(), clang::LoopControlStmt::isNamed(), LabelInfoStack, and VarScope.
Referenced by visitStmt().
| bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 4814 of file Compiler.cpp.
References clang::ConvertVectorExpr::getSrcExpr().
| bool Compiler::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 3683 of file Compiler.cpp.
References delegate(), DiscardResult, clang::CXXBindTemporaryExpr::getSubExpr(), Initializing, and visit().
| bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 6707 of file Compiler.cpp.
References DiscardResult, and clang::CXXBoolLiteralExpr::getValue().
| bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 3923 of file Compiler.cpp.
References clang::interp::align(), allocateLocal(), clang::CXXConstructExpr::arguments(), bool, canClassify(), classify(), Ctx, DiscardResult, clang::interp::exceedsArraySizeLimit(), clang::Func, std::function, clang::CXXConstructExpr::getArg(), clang::CXXConstructExpr::getConstructor(), clang::ArrayType::getElementType(), getFunction(), clang::CXXConstructExpr::getNumArgs(), clang::CXXMethodDecl::getParent(), getRecord(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), Initializing, clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::CXXConstructorDecl::isDefaultConstructor(), clang::FunctionDecl::isDefaulted(), clang::CXXConstructExpr::isElidable(), clang::Expr::isTemporaryObject(), clang::FunctionDecl::isTrivial(), clang::interp::primSize(), clang::interp::PT_Ptr, clang::CXXConstructExpr::requiresZeroInitialization(), clang::T, visit(), and visitInitializer().
| bool Compiler::VisitCXXDefaultArgExpr | ( | const CXXDefaultArgExpr * | E | ) |
Definition at line 6700 of file Compiler.cpp.
References delegate(), and clang::CXXDefaultArgExpr::getExpr().
| bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 6693 of file Compiler.cpp.
References delegate(), and clang::CXXDefaultInitExpr::getExpr().
| bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 4555 of file Compiler.cpp.
References clang::Expr::containsErrors(), clang::CXXDeleteExpr::getArgument(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CXXDeleteExpr::isArrayForm(), clang::CXXDeleteExpr::isGlobalDelete(), and visit().
| bool Compiler::VisitCXXDynamicCastExpr | ( | const CXXDynamicCastExpr * | E | ) |
Definition at line 3882 of file Compiler.cpp.
References Ctx, DiscardResult, clang::interp::Dynamic, clang::CastExpr::getCastKind(), clang::Type::getPointeeType(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Expr::isGLValue(), clang::Type::isPointerOrReferenceType(), clang::Type::isRecordType(), clang::Type::isVoidPointerType(), visit(), and VisitCastExpr().
| bool Compiler::visitCXXExpansionStmtInstantiation | ( | const CXXExpansionStmtInstantiation * | S | ) |
template for (auto x : {1, 2}) {}
This is not a loop from an AST perspective at all since it has already been instantiated to a list of compound statements.
Since we can have control flow in those compound statements, we need to handle it mostly like a loop though.
Definition at line 7565 of file Compiler.cpp.
References clang::interp::Block, clang::cast(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::CXXExpansionStmtInstantiation::getInstantiations(), clang::CXXExpansionStmtInstantiation::getPreambleStmts(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 7218 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::discard(), clang::CXXForRangeStmt::getBeginStmt(), clang::CXXForRangeStmt::getBody(), clang::CXXForRangeStmt::getCond(), clang::CXXForRangeStmt::getEndStmt(), clang::CXXForRangeStmt::getInc(), clang::CXXForRangeStmt::getInit(), clang::CXXForRangeStmt::getLoopVarStmt(), clang::CXXForRangeStmt::getRangeStmt(), clang::interp::Inc(), clang::interp::Init(), visitBool(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 4246 of file Compiler.cpp.
References classify(), clang::CXXInheritedCtorInitExpr::getConstructor(), getFunction(), clang::interp::Function::hasRVO(), clang::interp::Function::hasThisPointer(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::parameters(), and clang::interp::PT_Ptr.
| bool Compiler::VisitCXXNewExpr | ( | const CXXNewExpr * | E | ) |
Definition at line 4282 of file Compiler.cpp.
References allocateLocalPrimitive(), classify(), classifyPrim(), clang::Expr::containsErrors(), Ctx, clang::interp::discard(), DiscardResult, clang::CXXNewExpr::getAllocatedType(), clang::CXXNewExpr::getArraySize(), clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), getFunction(), clang::CXXNewExpr::getInitializer(), clang::CXXNewExpr::getNumPlacementArgs(), clang::CXXNewExpr::getOperatorNew(), clang::CXXNewExpr::getPlacementArg(), clang::Expr::getType(), clang::interp::Init(), clang::isa(), clang::CXXNewExpr::isArray(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), clang::Type::isNothrowT(), P, clang::interp::PT_Ptr, SizeT, visit(), visitInitializer(), and visitInitializerPop().
| bool Compiler::VisitCXXNoexceptExpr | ( | const CXXNoexceptExpr * | E | ) |
Definition at line 3914 of file Compiler.cpp.
References DiscardResult, clang::Expr::getType(), clang::CXXNoexceptExpr::getValue(), and clang::Type::isBooleanType().
| bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 6715 of file Compiler.cpp.
References Ctx, DiscardResult, and clang::Expr::getType().
| bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 2757 of file Compiler.cpp.
References clang::CXXParenListInitExpr::getArrayFiller(), clang::CXXParenListInitExpr::getInitExprs(), and visitInitList().
| bool Compiler::VisitCXXReflectExpr | ( | const CXXReflectExpr * | E | ) |
Definition at line 4639 of file Compiler.cpp.
References DiscardResult, clang::CXXReflectExpr::getKind(), clang::CXXReflectExpr::getOpaqueValue(), clang::Null, and clang::Type.
| bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 3853 of file Compiler.cpp.
References classify(), delegate(), clang::CastExpr::getCastKind(), clang::CastExpr::getSubExpr(), clang::interp::isIntegerType(), clang::interp::PT_Ptr, clang::interp::Reinterpret, clang::interp::ReinterpretPtrToInt, and VisitCastExpr().
| bool Compiler::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 4718 of file Compiler.cpp.
References delegate(), and clang::CXXRewrittenBinaryOperator::getSemanticForm().
| bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 4176 of file Compiler.cpp.
References allocateLocal(), clang::Type::castAs(), classify(), classifyPrim(), DiscardResult, clang::Type::getAs(), clang::Expr::getType(), Initializing, clang::Type::isAnyComplexType(), clang::Type::isVectorType(), clang::Type::isVoidType(), and clang::T.
| bool Compiler::VisitCXXStdInitializerListExpr | ( | const CXXStdInitializerListExpr * | E | ) |
Definition at line 4949 of file Compiler.cpp.
References allocateLocal(), canClassify(), Ctx, DiscardResult, getRecord(), clang::CXXStdInitializerListExpr::getSubExpr(), clang::Expr::getType(), Initializing, clang::Expr::isGLValue(), clang::interp::isIntegerOrBoolType(), clang::interp::PT_Ptr, clang::interp::PT_Uint64, and visit().
| bool Compiler::VisitCXXThisExpr | ( | const CXXThisExpr * | E | ) |
Definition at line 6736 of file Compiler.cpp.
References DiscardResult, emit(), InitStack, InitStackActive, clang::interp::InitLink::K_Base, clang::interp::InitLink::K_Decl, clang::interp::InitLink::K_DIE, clang::interp::InitLink::K_Elem, clang::interp::InitLink::K_Field, clang::interp::InitLink::K_InitList, clang::interp::InitLink::K_RVO, clang::interp::InitLink::K_Temp, and clang::interp::InitLink::K_This.
| bool Compiler::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 3845 of file Compiler.cpp.
References clang::CXXThrowExpr::getSubExpr().
| bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 7552 of file Compiler.cpp.
References clang::CXXTryStmt::getTryBlock(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | E | ) |
Definition at line 4585 of file Compiler.cpp.
References Ctx, DiscardResult, clang::CXXTypeidExpr::getExprOperand(), clang::Expr::getType(), clang::CXXTypeidExpr::getTypeOperand(), clang::QualType::getTypePtr(), clang::Expr::isLValue(), clang::CXXTypeidExpr::isPotentiallyEvaluated(), clang::CXXTypeidExpr::isTypeOperand(), clang::T, and visit().
| bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 4665 of file Compiler.cpp.
References DiscardResult, clang::MSGuidDecl::getAsAPValue(), clang::Type::getAsRecordDecl(), clang::CXXUuidofExpr::getGuidDecl(), getRecord(), clang::Expr::getType(), clang::ValueDecl::getType(), Initializing, clang::TagDecl::isCompleteDefinition(), clang::APValue::None, P, V, and visitAPValueInitializer().
|
protected |
Definition at line 5618 of file Compiler.cpp.
References clang::interp::Block::getBlockDesc(), clang::VarDecl::getInit(), clang::interp::InitializerFailed, clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), P, clang::interp::Context::shouldBeGloballyIndexed(), and visitVarDecl().
Referenced by visitDeclRef().
|
overrideprotected |
Toplevel visitDeclAndReturn().
We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.
Definition at line 5645 of file Compiler.cpp.
References classify(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::Block::getBlockDesc(), clang::ValueDecl::getType(), clang::interp::Init(), clang::interp::InitializerFailed, clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), clang::Type::isReferenceType(), Local, Locals, P, clang::interp::PT_Ptr, clang::interp::Context::shouldBeGloballyIndexed(), clang::interp::OptPrimType::value_or(), visit(), and visitVarDecl().
|
protected |
Visit the given decl as if we have a reference to it.
Definition at line 8524 of file Compiler.cpp.
References clang::cast(), classify(), classifyPrim(), Ctx, delegate(), DiscardResult, clang::VarDecl::evaluateValue(), clang::VarDecl::getAnyInitializer(), getFunction(), clang::VarDecl::getInit(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasGlobalStorage(), clang::interp::Init(), InitializingDecl, clang::QualType::isConstant(), clang::VarDecl::isConstexpr(), clang::VarDecl::isInitCapture(), clang::Type::isIntegralOrEnumerationType(), clang::VarDecl::isLocalVarDecl(), clang::Type::isReferenceType(), clang::VarDecl::isStaticDataMember(), clang::Expr::isValueDependent(), clang::ValueDecl::isWeak(), Locals, P, clang::interp::PT_Ptr, clang::Result, clang::T, VariablesAreConstexprUnknown, visitAPValue(), visitAPValueInitializer(), visitDecl(), and visitDeclRef().
Referenced by clang::interp::InitLink::emit(), visitAPValue(), visitDeclRef(), VisitDeclRefExpr(), and VisitMemberExpr().
| bool Compiler::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 8738 of file Compiler.cpp.
References clang::DeclRefExpr::getDecl(), and visitDeclRef().
| bool Compiler::visitDeclStmt | ( | const DeclStmt * | DS, |
| bool | EvaluateConditionDecl = false ) |
Definition at line 6936 of file Compiler.cpp.
References clang::DeclStmt::decls(), clang::VarDecl::getInit(), clang::isa(), visitStmt(), and visitVarDecl().
Referenced by visitCXXExpansionStmtInstantiation(), visitCXXForRangeStmt(), visitForStmt(), visitIfStmt(), visitStmt(), visitSwitchStmt(), and visitWhileStmt().
| bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 7491 of file Compiler.cpp.
References clang::DefaultStmt::getSubStmt(), LabelInfoStack, and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitDesignatedInitUpdateExpr | ( | const DesignatedInitUpdateExpr * | E | ) |
Definition at line 8744 of file Compiler.cpp.
References clang::DesignatedInitUpdateExpr::getBase(), clang::DesignatedInitUpdateExpr::getUpdater(), and visitInitializer().
Definition at line 7128 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::DoStmt::getBody(), clang::DoStmt::getCond(), visitBool(), and visitStmt().
Referenced by visitStmt().
|
overrideprotected |
Definition at line 5825 of file Compiler.cpp.
References clang::interp::Block, canClassify(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::hasTrivialDtor(), clang::QualType::isConstQualified(), clang::QualType::isVolatileQualified(), Local, Locals, P, VarScope, and visitAPValueInitializer().
Definition at line 2795 of file Compiler.cpp.
References clang::EmbedExpr::begin(), and visit().
|
overrideprotected |
Definition at line 5563 of file Compiler.cpp.
References allocateLocal(), classify(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::FullExpression, clang::Expr::getType(), clang::QualType::isNull(), clang::Type::isVoidType(), clang::T, clang::interp::InitLink::Temp(), visit(), and visitInitializer().
Referenced by visitLValueExpr().
| bool Compiler::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 4659 of file Compiler.cpp.
References Ctx, and clang::ExpressionTraitExpr::getValue().
| bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 3559 of file Compiler.cpp.
References delegate(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::FullExpression, and clang::FullExpr::getSubExpr().
| bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 4876 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), classifyPrim(), DiscardResult, clang::Type::getAs(), clang::ElementAccessExprBase< Derived >::getBase(), clang::VectorType::getElementType(), clang::ExtVectorElementExpr::getEncodedElementAccess(), clang::VectorType::getNumElements(), clang::PointerType::getPointeeType(), clang::Expr::getType(), Initializing, clang::Expr::isGLValue(), clang::Type::isVectorType(), clang::interp::PT_Ptr, clang::interp::PT_Uint32, and visit().
| bool Compiler::VisitFixedPointBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 2112 of file Compiler.cpp.
References classifyPrim(), Ctx, DiscardResult, clang::ASTContext::getFixedPointSemantics(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFixedPointType(), clang::interp::PT_Bool, clang::Result, clang::T, and visit().
Referenced by VisitBinaryOperator().
| bool Compiler::VisitFixedPointLiteral | ( | const FixedPointLiteral * | E | ) |
Definition at line 1319 of file Compiler.cpp.
References classifyPrim(), Ctx, DiscardResult, clang::Expr::getType(), clang::FixedPointLiteral::getValue(), clang::Type::isFixedPointType(), and clang::interp::PT_FixedPoint.
| bool Compiler::VisitFixedPointUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 2197 of file Compiler.cpp.
References delegate(), DiscardResult, clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isFixedPointType(), and visit().
Referenced by VisitUnaryOperator().
| bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 3300 of file Compiler.cpp.
References allocateLocalPrimitive(), classify(), classifyPrim(), DiscardResult, clang::CompoundAssignOperator::getComputationLHSType(), clang::CompoundAssignOperator::getComputationResultType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFloatingType(), clang::interp::isSideEffectFree(), clang::interp::LT(), and visit().
Referenced by VisitCompoundAssignOperator().
| bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 1284 of file Compiler.cpp.
References DiscardResult, and clang::FloatingLiteral::getValue().
Definition at line 7162 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::discard(), clang::ForStmt::getBody(), clang::ForStmt::getCond(), clang::ForStmt::getConditionVariable(), clang::ForStmt::getConditionVariableDeclStmt(), clang::ForStmt::getInc(), clang::ForStmt::getInit(), clang::interp::Inc(), clang::interp::Init(), visitBool(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
|
overrideprotected |
Definition at line 7980 of file Compiler.cpp.
References classify(), CompilingFunction, clang::interp::Dtor, clang::FunctionDecl::getBody(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::Type::isDependentType(), clang::CXXMethodDecl::isLambdaStaticInvoker(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::TagDecl::isUnion(), clang::Type::isVoidType(), ReturnType, and visitStmt().
| bool Compiler::VisitGenericSelectionExpr | ( | const GenericSelectionExpr * | E | ) |
Definition at line 4227 of file Compiler.cpp.
References delegate(), and clang::GenericSelectionExpr::getResultExpr().
| bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 6725 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 7003 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::FullExpression, clang::interp::getBoolValue(), clang::IfStmt::getCond(), clang::IfStmt::getConditionVariable(), clang::IfStmt::getConditionVariableDeclStmt(), clang::IfStmt::getElse(), clang::IfStmt::getInit(), clang::IfStmt::getThen(), clang::IfStmt::isNegatedConsteval(), clang::IfStmt::isNonNegatedConsteval(), visitBool(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitImaginaryLiteral | ( | const ImaginaryLiteral * | E | ) |
Definition at line 1293 of file Compiler.cpp.
References allocateTemporary(), classifyPrim(), DiscardResult, clang::ImaginaryLiteral::getSubExpr(), clang::Expr::getType(), Initializing, clang::Type::isAnyComplexType(), and visitArrayElemInit().
| bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 2220 of file Compiler.cpp.
References classify(), classifyPrim(), DiscardResult, clang::Type::getAs(), clang::Type::getAsRecordDecl(), getRecord(), clang::Expr::getType(), 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 5094 of file Compiler.cpp.
References canClassify(), clang::Expr::getType(), and clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Referenced by visit(), visitCallArgs(), VisitCompoundLiteralExpr(), VisitCXXConstructExpr(), VisitCXXNewExpr(), VisitDesignatedInitUpdateExpr(), visitExpr(), VisitMaterializeTemporaryExpr(), VisitOpaqueValueExpr(), and visitVarDecl().
Similar, but will also pop the pointer.
Definition at line 5103 of file Compiler.cpp.
References canClassify(), clang::Expr::getType(), and clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Referenced by visitArrayElemInit(), VisitCastExpr(), VisitCXXNewExpr(), visitInitList(), VisitLambdaExpr(), visitReturnStmt(), visitVarDecl(), and visitWithSubstitutions().
|
protected |
Definition at line 2347 of file Compiler.cpp.
References clang::interp::Activate(), allocateLocal(), clang::interp::InitLink::Base(), canClassify(), clang::cast(), classify(), classifyPrim(), Ctx, clang::interp::DefaultInit(), delegate(), clang::interp::discard(), DiscardResult, clang::interp::InitLink::Field(), clang::Type::getAs(), clang::ArrayType::getElementType(), getRecord(), clang::Expr::getType(), clang::APIntStorage::getValue(), clang::ConstantArrayType::getZExtSize(), clang::interp::Init(), Initializing, InitializingDecl, clang::interp::InitLink::InitList(), clang::Inits, clang::isa(), clang::Type::isArrayType(), clang::Type::isRecordType(), clang::Type::isVoidType(), clang::interp::PT_Float, clang::T, clang::interp::InitLink::Temp(), visit(), visitArrayElemInit(), and visitInitializerPop().
Referenced by VisitCXXParenListInitExpr(), and VisitInitListExpr().
| bool Compiler::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 2752 of file Compiler.cpp.
References clang::InitListExpr::getArrayFiller(), clang::InitListExpr::inits(), and visitInitList().
| bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 1276 of file Compiler.cpp.
References DiscardResult, and clang::interp::LE().
| bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 3798 of file Compiler.cpp.
References clang::LambdaExpr::capture_init_begin(), classify(), DiscardResult, clang::LambdaExpr::getLambdaClass(), clang::interp::Init(), Initializing, P, clang::T, visit(), and visitInitializerPop().
| bool Compiler::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1592 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::BinaryOperator::isLogicalOp(), clang::interp::PT_Bool, clang::T, and visitBool().
Referenced by VisitBinaryOperator().
|
overrideprotected |
Definition at line 5609 of file Compiler.cpp.
References visitExpr().
| bool Compiler::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | E | ) |
Definition at line 3567 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), clang::interp::Block, classify(), Ctx, delegate(), clang::interp::discard(), DiscardResult, clang::interp::FullExpression, clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::MaterializeTemporaryExpr::getLifetimeExtendedTemporaryDecl(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::getType(), Initializing, clang::QualType::isConstQualified(), clang::QualType::isVolatileQualified(), P, clang::SD_FullExpression, clang::SD_Static, clang::interp::Context::shouldBeGloballyIndexed(), clang::Expr::skipRValueSubobjectAdjustments(), clang::interp::InitLink::Temp(), VarScope, visit(), and visitInitializer().
| bool Compiler::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 2972 of file Compiler.cpp.
References clang::cast(), classify(), clang::interp::discard(), DiscardResult, clang::MemberExpr::getBase(), clang::MemberExpr::getMemberDecl(), clang::DeclContext::getParent(), getRecord(), clang::isa(), clang::Expr::isGLValue(), clang::Member, P, clang::interp::PT_Ptr, clang::T, visit(), and visitDeclRef().
| bool Compiler::VisitObjCArrayLiteral | ( | const ObjCArrayLiteral * | E | ) |
Definition at line 4632 of file Compiler.cpp.
References clang::ObjCObjectLiteral::isExpressibleAsConstantInitializer().
| bool Compiler::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 4238 of file Compiler.cpp.
References DiscardResult, and clang::ObjCBoolLiteralExpr::getValue().
| bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 4936 of file Compiler.cpp.
References classifyPrim(), clang::interp::discard(), DiscardResult, clang::ObjCBoxedExpr::getSubExpr(), clang::ObjCObjectLiteral::isExpressibleAsConstantInitializer(), and clang::interp::PT_Ptr.
| bool Compiler::VisitObjCDictionaryLiteral | ( | const ObjCDictionaryLiteral * | E | ) |
Definition at line 4624 of file Compiler.cpp.
References clang::ObjCObjectLiteral::isExpressibleAsConstantInitializer().
| bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 3260 of file Compiler.cpp.
References clang::StringLiteral::Create(), Ctx, delegate(), clang::ObjCEncodeExpr::getAtLoc(), clang::ObjCEncodeExpr::getEncodedType(), clang::Expr::getType(), and clang::Ordinary.
| bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 3253 of file Compiler.cpp.
References DiscardResult.
| bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 4134 of file Compiler.cpp.
References clang::OffsetOfNode::Array, classifyPrim(), clang::interp::discard(), DiscardResult, clang::OffsetOfNode::getArrayExprIndex(), clang::OffsetOfExpr::getComponent(), clang::OffsetOfExpr::getIndexExpr(), clang::OffsetOfNode::getKind(), clang::OffsetOfExpr::getNumComponents(), clang::Expr::getType(), clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_Sint64, clang::T, and visit().
| bool Compiler::VisitOpaqueValueExpr | ( | const OpaqueValueExpr * | E | ) |
Definition at line 3093 of file Compiler.cpp.
References allocateLocalPrimitive(), classify(), DiscardResult, clang::OpaqueValueExpr::getSourceExpr(), Initializing, OpaqueExprs, clang::interp::PT_Ptr, visit(), and visitInitializer().
| bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 4748 of file Compiler.cpp.
References delegate(), and clang::PackIndexingExpr::getSelectedExpr().
Definition at line 1332 of file Compiler.cpp.
References delegate(), and clang::ParenExpr::getSubExpr().
| bool Compiler::VisitPointerArithBinOp | ( | const BinaryOperator * | E | ) |
Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
Definition at line 1503 of file Compiler.cpp.
References classify(), classifyPrim(), Ctx, DiscardResult, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), clang::Type::isVoidType(), clang::interp::LT(), clang::CharUnits::One(), clang::interp::PT_Ptr, clang::T, and visit().
Referenced by VisitBinaryOperator().
| bool Compiler::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 3388 of file Compiler.cpp.
References classify(), DiscardResult, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::interp::LT(), and visit().
Referenced by VisitCompoundAssignOperator().
| bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 3835 of file Compiler.cpp.
References delegate(), DiscardResult, clang::PredefinedExpr::getFunctionName(), and Initializing.
| bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 4724 of file Compiler.cpp.
References delegate(), clang::interp::discard(), clang::PseudoObjectExpr::getResultExpr(), and clang::PseudoObjectExpr::semantics().
| bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 4753 of file Compiler.cpp.
| bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 4699 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::Expr::getType(), clang::RequiresExpr::isSatisfied(), clang::Expr::isValueDependent(), and clang::interp::PT_Bool.
| bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 6965 of file Compiler.cpp.
References emitCleanup(), clang::ReturnStmt::getRetValue(), InStmtExpr, ReturnType, clang::interp::InitLink::RVO(), visit(), and visitInitializerPop().
Referenced by visitStmt().
| bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 4819 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), clang::Type::castAs(), classifyPrim(), DiscardResult, clang::VectorType::getElementType(), clang::ShuffleVectorExpr::getExpr(), clang::VectorType::getNumElements(), clang::ShuffleVectorExpr::getNumSubExprs(), clang::ShuffleVectorExpr::getShuffleMaskIdx(), clang::Expr::getType(), Initializing, clang::interp::PT_Ptr, and visit().
| bool Compiler::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 4222 of file Compiler.cpp.
References clang::SizeOfPackExpr::getPackLength().
| bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 4080 of file Compiler.cpp.
References clang::cast(), Ctx, DiscardResult, clang::SourceLocExpr::EvaluateInContext(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getLValuePath(), getRecord(), clang::Expr::getType(), clang::APValue::isInt(), clang::Type::isIntegerType(), clang::APValue::isLValue(), clang::Type::isPointerType(), P, SourceLocDefaultExpr, V, visit(), and visitAPValue().
Definition at line 6815 of file Compiler.cpp.
References clang::cast(), clang::interp::discard(), clang::Stmt::getStmtClass(), visitAttributedStmt(), visitBreakStmt(), visitCaseStmt(), visitCompoundStmt(), visitContinueStmt(), visitCXXExpansionStmtInstantiation(), visitCXXForRangeStmt(), visitCXXTryStmt(), visitDeclStmt(), visitDefaultStmt(), visitDoStmt(), visitForStmt(), visitIfStmt(), visitReturnStmt(), visitStmt(), visitSwitchStmt(), and visitWhileStmt().
Referenced by visitAttributedStmt(), visitCaseStmt(), visitCompoundStmt(), visitCXXExpansionStmtInstantiation(), visitCXXForRangeStmt(), visitCXXTryStmt(), visitDeclStmt(), visitDefaultStmt(), visitDoStmt(), visitForStmt(), visitFunc(), visitIfStmt(), visitStmt(), VisitStmtExpr(), visitSwitchStmt(), and visitWhileStmt().
Definition at line 5004 of file Compiler.cpp.
References clang::CompoundStmt::body(), clang::CompoundStmt::body_back(), delegate(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::StmtExpr::getSubStmt(), InStmtExpr, clang::Result, and visitStmt().
| bool Compiler::VisitStringLiteral | ( | const StringLiteral * | E | ) |
Definition at line 3198 of file Compiler.cpp.
References Ctx, DiscardResult, clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), and Initializing.
| bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 2763 of file Compiler.cpp.
References delegate(), and clang::SubstNonTypeTemplateParmExpr::getReplacement().
| bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 7367 of file Compiler.cpp.
References allocateLocalPrimitive(), CaseLabels, classifyPrim(), clang::Expr::containsErrors(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::SwitchStmt::getBody(), clang::SwitchStmt::getCond(), clang::SwitchStmt::getConditionVariable(), clang::SwitchStmt::getConditionVariableDeclStmt(), clang::SwitchStmt::getInit(), clang::SwitchCase::getNextSwitchCase(), clang::SwitchStmt::getSwitchCaseList(), clang::Expr::getType(), clang::Value::getType(), InStmtExpr, clang::Expr::isValueDependent(), clang::interp::LT(), SwitchInStmtExpr, visit(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitSYCLUniqueStableNameExpr | ( | const SYCLUniqueStableNameExpr * | E | ) |
Definition at line 3271 of file Compiler.cpp.
References clang::SYCLUniqueStableNameExpr::ComputeName(), clang::StringLiteral::Create(), Ctx, DiscardResult, clang::SYCLUniqueStableNameExpr::getLocation(), Initializing, clang::Normal, clang::Ordinary, and clang::QualType::withConst().
| bool Compiler::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 3762 of file Compiler.cpp.
References classifyPrim(), Ctx, DiscardResult, clang::TypeTraitExpr::getAPValue(), clang::TypeTraitExpr::getBoolValue(), clang::APValue::getInt(), clang::ComparisonCategoryInfo::ValueInfo::getIntValue(), getRecord(), clang::Expr::getType(), clang::ComparisonCategoryInfo::getValueInfo(), clang::Type::isBooleanType(), clang::TypeTraitExpr::isStoredAsBoolean(), clang::TypeTraitExpr::isStoredAsComparisonResult(), clang::Result, clang::T, and visitAPValue().
| bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 2823 of file Compiler.cpp.
References alignOfType(), clang::Expr::containsErrors(), Ctx, DiscardResult, clang::UnaryExprOrTypeTraitExpr::getArgumentExpr(), clang::UnaryExprOrTypeTraitExpr::getArgumentType(), clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::ASTContext::getAsVariableArrayType(), clang::ASTContext::getDeclAlign(), clang::UnaryExprOrTypeTraitExpr::getKind(), clang::ASTContext::getOpenMPDefaultSimdAlign(), clang::CodeGen::getPointerAuthTypeDiscriminator(), clang::CharUnits::getQuantity(), clang::Expr::getType(), clang::ASTContext::getTypeInfoDataSizeInChars(), clang::UnaryExprOrTypeTraitExpr::getTypeOfArgument(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParens(), clang::UnaryExprOrTypeTraitExpr::isArgumentType(), clang::Type::isArrayType(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isSizelessVectorType(), clang::CharUnits::One(), clang::ASTContext::toCharUnitsFromBits(), and clang::TypeInfoChars::Width.
| bool Compiler::VisitUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 8025 of file Compiler.cpp.
References clang::UnaryOperator::canOverflow(), clang::cast(), classify(), classifyPrim(), clang::Expr::containsErrors(), Ctx, delegate(), clang::interp::discard(), DiscardResult, getBitWidth(), clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::Type::isAnyComplexType(), clang::Type::isFixedPointType(), clang::Type::isFunctionPointerType(), clang::Expr::isGLValue(), clang::interp::isIntegerOrBoolType(), clang::Type::isMemberPointerType(), clang::Type::isVectorType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_Ptr, clang::Expr::refersToBitField(), clang::interp::Sub(), clang::T, true, visit(), visitBool(), VisitComplexUnaryOperator(), VisitFixedPointUnaryOperator(), and VisitVectorUnaryOperator().
|
protected |
Creates and initializes a variable from the given decl.
Definition at line 5708 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), clang::interp::Block, classify(), classifyPrim(), clang::interp::InitLink::Decl(), clang::ValueDecl::getType(), clang::interp::Init(), clang::QualType::isConstQualified(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::Type::isReferenceType(), clang::VarDecl::isStaticLocal(), clang::QualType::isVolatileQualified(), clang::interp::VarCreationState::NotCreated(), P, clang::interp::PT_Ptr, clang::interp::Context::shouldBeGloballyIndexed(), VariablesAreConstexprUnknown, visit(), visitInitializer(), and visitInitializerPop().
Referenced by visitDecl(), visitDeclAndReturn(), and visitDeclStmt().
| bool Compiler::VisitVectorBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1893 of file Compiler.cpp.
References clang::interp::Add(), allocateLocalPrimitive(), allocateTemporary(), canClassify(), clang::Type::castAs(), classifyPrim(), Ctx, DiscardResult, clang::interp::Div(), EMIT_ARITH_OP, clang::Type::getAs(), clang::VectorType::getElementType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getOpForCompoundAssignment(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), Initializing, clang::BinaryOperator::isAssignmentOp(), clang::BinaryOperator::isBitwiseOp(), clang::BinaryOperator::isCommaOp(), clang::BinaryOperator::isComparisonOp(), clang::BinaryOperator::isCompoundAssignmentOp(), clang::BinaryOperator::isLogicalOp(), clang::BinaryOperator::isShiftOp(), clang::Type::isVectorType(), clang::interp::Mul(), clang::interp::PT_Bool, clang::interp::PT_Ptr, clang::interp::Sub(), and visit().
Referenced by VisitBinaryOperator(), and VisitCompoundAssignOperator().
| bool Compiler::VisitVectorUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 8417 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), classifyPrim(), Ctx, delegate(), clang::interp::discard(), DiscardResult, clang::Type::getAs(), clang::VectorType::getElementType(), clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), Initializing, clang::Type::isVectorType(), clang::interp::PT_Bool, clang::interp::PT_Ptr, and visit().
Referenced by VisitUnaryOperator().
Definition at line 7084 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::WhileStmt::getBody(), clang::WhileStmt::getCond(), clang::WhileStmt::getConditionVariable(), clang::WhileStmt::getConditionVariableDeclStmt(), visitBool(), visitDeclStmt(), and visitStmt().
Referenced by visitStmt().
|
overrideprotected |
Evaluate the Condition as if it was in the body of Callee.
Specifically, all the parameters of the callee are available to use for the condition, and their values are given by Args (and This).
Definition at line 5887 of file Compiler.cpp.
References allocateLocal(), allocateLocalPrimitive(), canClassify(), classify(), clang::Condition, clang::interp::InitLink::Decl(), clang::interp::LocalScope< Emitter >::destroyLocals(), ParamFinder::FoundParams, InitStack, InitStackActive, P, clang::interp::PT_Bool, clang::interp::InitLink::Temp(), clang::interp::This(), clang::DynamicRecursiveASTVisitorBase< IsConst >::TraverseStmt(), VarScope, visit(), and visitInitializerPop().
|
friend |
Definition at line 356 of file Compiler.h.
Definition at line 356 of file Compiler.h.
Definition at line 367 of file Compiler.h.
References InitLink, and clang::T.
Referenced by InitLink.
|
friend |
Definition at line 356 of file Compiler.h.
|
friend |
Definition at line 356 of file Compiler.h.
|
friend |
Definition at line 356 of file Compiler.h.
|
friend |
Definition at line 367 of file Compiler.h.
Definition at line 367 of file Compiler.h.
|
friend |
Definition at line 356 of file Compiler.h.
|
friend |
Definition at line 356 of file Compiler.h.
|
friend |
Definition at line 367 of file Compiler.h.
|
friend |
Definition at line 356 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 484 of file Compiler.h.
Referenced by VisitArrayInitIndexExpr().
|
protected |
Switch case mapping.
Definition at line 510 of file Compiler.h.
Referenced by visitCaseStmt(), and visitSwitchStmt().
|
protected |
Definition at line 514 of file Compiler.h.
Referenced by VisitCallExpr(), and visitFunc().
|
protected |
Current compilation context.
Definition at line 139 of file Compiler.h.
Referenced by canClassify(), canClassify(), classify(), classify(), Compiler(), getFunction(), visitAPValue(), visitAPValueInitializer(), VisitArrayInitLoopExpr(), visitAttributedStmt(), VisitBinaryOperator(), VisitBlockExpr(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitCompoundAssignOperator(), VisitCXXConstructExpr(), VisitCXXDynamicCastExpr(), VisitCXXNewExpr(), VisitCXXNullPtrLiteralExpr(), VisitCXXStdInitializerListExpr(), VisitCXXTypeidExpr(), visitDeclRef(), VisitExpressionTraitExpr(), VisitFixedPointBinOp(), VisitFixedPointLiteral(), visitInitList(), VisitMaterializeTemporaryExpr(), VisitObjCEncodeExpr(), VisitPointerArithBinOp(), VisitSourceLocExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), VisitTypeTraitExpr(), VisitUnaryExprOrTypeTraitExpr(), VisitUnaryOperator(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 490 of file Compiler.h.
Referenced by VisitAddrLabelExpr(), visitAPValue(), VisitArrayInitIndexExpr(), VisitArrayInitLoopExpr(), VisitArraySubscriptExpr(), VisitArrayTypeTraitExpr(), VisitBinaryOperator(), VisitBlockExpr(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitCharacterLiteral(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitCompoundAssignOperator(), VisitCompoundLiteralExpr(), VisitConceptSpecializationExpr(), VisitConstantExpr(), VisitCXXBindTemporaryExpr(), VisitCXXBoolLiteralExpr(), VisitCXXConstructExpr(), VisitCXXDynamicCastExpr(), VisitCXXNewExpr(), VisitCXXNoexceptExpr(), VisitCXXNullPtrLiteralExpr(), VisitCXXReflectExpr(), VisitCXXScalarValueInitExpr(), VisitCXXStdInitializerListExpr(), VisitCXXThisExpr(), VisitCXXTypeidExpr(), VisitCXXUuidofExpr(), visitDeclRef(), VisitExtVectorElementExpr(), VisitFixedPointBinOp(), VisitFixedPointLiteral(), VisitFixedPointUnaryOperator(), VisitFloatCompoundAssignOperator(), VisitFloatingLiteral(), VisitGNUNullExpr(), VisitImaginaryLiteral(), VisitImplicitValueInitExpr(), visitInitList(), VisitIntegerLiteral(), VisitLambdaExpr(), VisitLogicalBinOp(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitObjCBoolLiteralExpr(), VisitObjCBoxedExpr(), VisitObjCStringLiteral(), VisitOffsetOfExpr(), VisitOpaqueValueExpr(), VisitPointerArithBinOp(), VisitPointerCompoundAssignOperator(), VisitPredefinedExpr(), VisitRequiresExpr(), VisitShuffleVectorExpr(), VisitSourceLocExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), VisitTypeTraitExpr(), VisitUnaryExprOrTypeTraitExpr(), VisitUnaryOperator(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 500 of file Compiler.h.
Referenced by VisitArrayInitLoopExpr(), VisitBinaryOperator(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitCompoundLiteralExpr(), VisitConstantExpr(), VisitCXXBindTemporaryExpr(), VisitCXXConstructExpr(), VisitCXXScalarValueInitExpr(), VisitCXXStdInitializerListExpr(), VisitCXXUuidofExpr(), VisitExtVectorElementExpr(), VisitImaginaryLiteral(), VisitImplicitValueInitExpr(), visitInitList(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitOpaqueValueExpr(), VisitPredefinedExpr(), VisitShuffleVectorExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
|
protected |
Definition at line 501 of file Compiler.h.
Referenced by visitDeclRef(), and visitInitList().
|
protected |
Definition at line 503 of file Compiler.h.
Referenced by VisitCXXThisExpr(), and visitWithSubstitutions().
|
protected |
Definition at line 504 of file Compiler.h.
Referenced by VisitCXXThisExpr(), and visitWithSubstitutions().
|
protected |
Definition at line 493 of file Compiler.h.
Referenced by visitCaseStmt(), visitReturnStmt(), VisitStmtExpr(), and visitSwitchStmt().
|
protected |
Stack of label information for loops and switch statements.
Definition at line 512 of file Compiler.h.
Referenced by visitBreakStmt(), visitContinueStmt(), and visitDefaultStmt().
|
protected |
Variable to storage mapping.
Definition at line 475 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), VisitCastExpr(), visitDeclAndReturn(), visitDeclRef(), and visitDtorCall().
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 478 of file Compiler.h.
Referenced by VisitOpaqueValueExpr().
|
protected |
Program to link to.
Definition at line 141 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), allocateTemporary(), Compiler(), getRecord(), registerRedecl(), visitAPValue(), VisitCastExpr(), VisitCompoundLiteralExpr(), VisitCXXNewExpr(), VisitCXXUuidofExpr(), visitDecl(), visitDeclAndReturn(), visitDeclRef(), visitDtorCall(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitSourceLocExpr(), visitVarDecl(), and visitWithSubstitutions().
|
protected |
Type of the expression returned by the function.
Definition at line 507 of file Compiler.h.
Referenced by VisitBuiltinCallExpr(), VisitCallExpr(), visitFunc(), and visitReturnStmt().
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 487 of file Compiler.h.
Referenced by VisitSourceLocExpr().
|
protected |
Definition at line 492 of file Compiler.h.
Referenced by visitCaseStmt(), and visitSwitchStmt().
|
protected |
Definition at line 494 of file Compiler.h.
Referenced by visit(), visitBool(), and VisitCastExpr().
|
protected |
Definition at line 496 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), visitDeclRef(), and visitVarDecl().
|
protected |
Current scope.
Definition at line 481 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), allocateTemporary(), emitCleanup(), VisitAbstractConditionalOperator(), visitBreakStmt(), visitCallArgs(), visitContinueStmt(), visitDtorCall(), VisitMaterializeTemporaryExpr(), and visitWithSubstitutions().