|
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 (DeclTy &&Decl, PrimType Ty, bool IsConst, bool IsVolatile=false, ScopeKind SC=ScopeKind::Block) |
| Creates a local primitive value. | |
| UnsignedOrNone | allocateLocal (DeclTy &&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 | 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 > |
| 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 111 of file Compiler.h.
|
protected |
Definition at line 116 of file Compiler.h.
|
protected |
Definition at line 118 of file Compiler.h.
|
protected |
Definition at line 115 of file Compiler.h.
|
protected |
Definition at line 117 of file Compiler.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 142 of file Compiler.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 5335 of file Compiler.cpp.
References clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Init(), clang::interp::Descriptor::InlineDescMD, clang::interp::Descriptor::IsConstexprUnknown, clang::QualType::isConstQualified(), clang::QualType::isNull(), clang::QualType::isVolatileQualified(), Locals, P, VariablesAreConstexprUnknown, and VarScope.
Referenced by visit(), VisitBinaryOperator(), VisitBuiltinCallExpr(), visitCallArgs(), VisitCallExpr(), VisitCastExpr(), VisitComplexUnaryOperator(), VisitCompoundLiteralExpr(), VisitCXXConstructExpr(), VisitCXXScalarValueInitExpr(), visitExpr(), VisitExtVectorElementExpr(), VisitMaterializeTemporaryExpr(), VisitShuffleVectorExpr(), visitVarDecl(), VisitVectorUnaryOperator(), and visitWithSubstitutions().
|
protected |
Creates a local primitive value.
Definition at line 5316 of file Compiler.cpp.
References clang::interp::Descriptor::InlineDescMD, clang::isa(), clang::interp::Descriptor::IsConstexprUnknown, 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 5368 of file Compiler.cpp.
References clang::interp::VariableScope< Emitter >::addLocal(), clang::interp::VariableScope< Emitter >::getParent(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), clang::Type::isRecordType(), P, and VarScope.
Referenced by VisitCastExpr(), VisitComplexBinOp(), VisitImaginaryLiteral(), and VisitVectorBinOp().
|
inlineprotected |
Definition at line 286 of file Compiler.h.
References Ctx.
Referenced by visit(), visitCallArgs(), VisitCastExpr(), VisitCXXConstructExpr(), visitDtorCall(), visitInitializer(), visitInitializerPop(), VisitVectorBinOp(), and visitWithSubstitutions().
|
inlineprotected |
Definition at line 287 of file Compiler.h.
|
inlineprotected |
Definition at line 284 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(), VisitLogicalBinOp(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitOpaqueValueExpr(), VisitPointerArithBinOp(), VisitPointerCompoundAssignOperator(), VisitUnaryOperator(), visitVarDecl(), and visitWithSubstitutions().
|
inlineprotected |
Definition at line 285 of file Compiler.h.
References Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 297 of file Compiler.h.
References classify(), and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 290 of file Compiler.h.
References classify(), and clang::T.
Referenced by VisitArraySubscriptExpr(), VisitBinaryOperator(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitConceptSpecializationExpr(), VisitCXXNewExpr(), VisitCXXScalarValueInitExpr(), VisitCXXStdInitializerListExpr(), visitDeclRef(), VisitExtVectorElementExpr(), VisitFixedPointBinOp(), VisitFixedPointLiteral(), VisitFloatCompoundAssignOperator(), VisitGNUNullExpr(), VisitImaginaryLiteral(), VisitImplicitValueInitExpr(), visitInitList(), VisitObjCBoxedExpr(), VisitOffsetOfExpr(), VisitPointerArithBinOp(), VisitRequiresExpr(), VisitShuffleVectorExpr(), VisitSourceLocExpr(), visitSwitchStmt(), VisitTypeTraitExpr(), VisitUnaryOperator(), visitVarDecl(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
Just pass evaluation on to E.
This leaves all the parsing flags intact.
Definition at line 4885 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 4879 of file Compiler.cpp.
References clang::StmtVisitorBase< llvm::make_const_ptr, Compiler< Emitter >, bool, ParamTys... >::Visit().
Emits scope cleanup instructions.
Definition at line 8408 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 5409 of file Compiler.cpp.
References Ctx.
Referenced by VisitCallExpr(), VisitCXXConstructExpr(), VisitCXXInheritedCtorInitExpr(), VisitCXXNewExpr(), and visitDeclRef().
|
protected |
Definition at line 5404 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 5397 of file Compiler.cpp.
References getRecord(), and getRecordTy().
Referenced by getRecord(), visitAPValue(), visitAPValueInitializer(), VisitCastExpr(), VisitCXXConstructExpr(), VisitCXXStdInitializerListExpr(), VisitCXXUuidofExpr(), VisitImplicitValueInitExpr(), visitInitList(), VisitMemberExpr(), and VisitSourceLocExpr().
Returns a record type from a record or pointer type.
Definition at line 5391 of file Compiler.cpp.
References clang::Type::getAsCanonical().
Referenced by getRecord().
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 4917 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 3040 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 4626 of file Compiler.cpp.
References DiscardResult, clang::Expr::getType(), and clang::Type::isVoidPointerType().
|
protected |
Visit an APValue.
Definition at line 5816 of file Compiler.cpp.
References clang::interp::SourceInfo::asExpr(), clang::cast(), Ctx, DiscardResult, 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::getLValuePath(), clang::APValue::getMemberPointerDecl(), clang::APValue::getMemberPointerPath(), getRecord(), clang::interp::Record::getVirtualBase(), clang::Type::isArrayType(), clang::APValue::isFloat(), clang::APValue::isIndeterminate(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), clang::APValue::isMemberPointerToDerivedMember(), clang::APValue::isNullPointer(), clang::Type::isRecordType(), clang::interp::Record::Field::Offset, clang::interp::PT_Uint64, visit(), and visitDeclRef().
Referenced by visitAPValueInitializer(), VisitConstantExpr(), visitDeclRef(), VisitSourceLocExpr(), and VisitTypeTraitExpr().
|
protected |
Definition at line 5904 of file Compiler.cpp.
References clang::cast(), classify(), Ctx, clang::APValue::getArrayFiller(), clang::APValue::getArrayInitializedElt(), clang::APValue::getArrayInitializedElts(), clang::APValue::getArraySize(), 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::isArray(), clang::APValue::isIndeterminate(), clang::APValue::isStruct(), clang::APValue::isUnion(), clang::T, visitAPValue(), and visitAPValueInitializer().
Referenced by visitAPValueInitializer(), VisitCXXUuidofExpr(), visitDeclRef(), and visitDtorCall().
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 2593 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 2950 of file Compiler.cpp.
References ArrayIndex, and DiscardResult.
| bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 2960 of file Compiler.cpp.
References clang::cast(), classify(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::discard(), DiscardResult, 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 2244 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 3687 of file Compiler.cpp.
References DiscardResult, and clang::ArrayTypeTraitExpr::getValue().
Definition at line 4962 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 7171 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 1294 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 4459 of file Compiler.cpp.
References Ctx, DiscardResult, and clang::Func.
Visits an expression and converts it to a boolean.
Definition at line 4968 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 6953 of file Compiler.cpp.
References clang::C, clang::LoopControlStmt::getNamedLoopOrSwitch(), LabelInfoStack, and VarScope.
Referenced by visitStmt().
| bool Compiler::VisitBuiltinBitCastExpr | ( | const BuiltinBitCastExpr * | E | ) |
Definition at line 1230 of file Compiler.cpp.
| bool Compiler::VisitBuiltinCallExpr | ( | const CallExpr * | E, |
| unsigned | BuiltinID ) |
Definition at line 6041 of file Compiler.cpp.
References allocateLocal(), clang::CallExpr::arguments(), classify(), classifyPrim(), DiscardResult, clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), 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 2613 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 6138 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(), 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 7141 of file Compiler.cpp.
References CaseLabels, clang::CaseStmt::getSubStmt(), InStmtExpr, SwitchInStmtExpr, and visitStmt().
Referenced by visitStmt().
Definition at line 448 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(), Initializing, clang::Type::isAnyComplexType(), clang::Type::isAtomicType(), clang::Type::isBooleanType(), 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 3209 of file Compiler.cpp.
References DiscardResult, and clang::CharacterLiteral::getValue().
| bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 4120 of file Compiler.cpp.
References delegate(), and clang::ChooseExpr::getChosenSubExpr().
| bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 1609 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 7966 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 3341 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 3614 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 6547 of file Compiler.cpp.
References clang::CompoundStmt::body(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 4577 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 2691 of file Compiler.cpp.
References classify(), delegate(), DiscardResult, clang::ConstantExpr::getAPValueResult(), clang::FullExpr::getSubExpr(), clang::ConstantExpr::hasAPValueResult(), clang::T, and visitAPValue().
| bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 6993 of file Compiler.cpp.
References clang::C, clang::LoopControlStmt::getNamedLoopOrSwitch(), LabelInfoStack, and VarScope.
Referenced by visitStmt().
| bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 4682 of file Compiler.cpp.
References clang::ConvertVectorExpr::getSrcExpr().
| bool Compiler::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 3595 of file Compiler.cpp.
References delegate(), DiscardResult, clang::CXXBindTemporaryExpr::getSubExpr(), Initializing, and visit().
| bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 6392 of file Compiler.cpp.
References DiscardResult, and clang::CXXBoolLiteralExpr::getValue().
| bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 3820 of file Compiler.cpp.
References clang::interp::align(), allocateLocal(), clang::CXXConstructExpr::arguments(), bool, canClassify(), classify(), Ctx, DiscardResult, 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::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 6385 of file Compiler.cpp.
References delegate(), and clang::CXXDefaultArgExpr::getExpr().
| bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 6378 of file Compiler.cpp.
References delegate(), and clang::CXXDefaultInitExpr::getExpr().
| bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 4443 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 3779 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 7228 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 6897 of file Compiler.cpp.
References clang::Cond, 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 4133 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 4167 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::QualType::getTypePtr(), clang::interp::Init(), clang::interp::Descriptor::InlineDescMD, 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 3811 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 6400 of file Compiler.cpp.
References Ctx, DiscardResult, and clang::Expr::getType().
| bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 2679 of file Compiler.cpp.
References clang::CXXParenListInitExpr::getArrayFiller(), clang::CXXParenListInitExpr::getInitExprs(), and visitInitList().
| bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 3752 of file Compiler.cpp.
References classify(), delegate(), clang::CastExpr::getCastKind(), clang::CastExpr::getSubExpr(), clang::interp::PT_Ptr, clang::interp::Reinterpret, and VisitCastExpr().
| bool Compiler::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 4586 of file Compiler.cpp.
References delegate(), and clang::CXXRewrittenBinaryOperator::getSemanticForm().
| bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 4063 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 4817 of file Compiler.cpp.
References classifyPrim(), Ctx, 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 6421 of file Compiler.cpp.
References DiscardResult, emit(), InitStack, InitStackActive, clang::interp::InitLink::K_DIE, clang::interp::InitLink::K_Elem, clang::interp::InitLink::K_Field, and clang::interp::InitLink::K_InitList.
| bool Compiler::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 3744 of file Compiler.cpp.
References clang::CXXThrowExpr::getSubExpr().
| bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 7215 of file Compiler.cpp.
References clang::CXXTryStmt::getTryBlock(), and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | E | ) |
Definition at line 4473 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 4533 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 5467 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 5494 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(), 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 8181 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 8395 of file Compiler.cpp.
References clang::DeclRefExpr::getDecl(), and visitDeclRef().
| bool Compiler::visitDeclStmt | ( | const DeclStmt * | DS, |
| bool | EvaluateConditionDecl = false ) |
Definition at line 6615 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 7154 of file Compiler.cpp.
References clang::DefaultStmt::getSubStmt(), LabelInfoStack, and visitStmt().
Referenced by visitStmt().
| bool Compiler::VisitDesignatedInitUpdateExpr | ( | const DesignatedInitUpdateExpr * | E | ) |
Definition at line 8401 of file Compiler.cpp.
References clang::DesignatedInitUpdateExpr::getBase(), clang::DesignatedInitUpdateExpr::getUpdater(), and visitInitializer().
Definition at line 6807 of file Compiler.cpp.
References clang::Cond, clang::interp::LocalScope< Emitter >::destroyLocals(), clang::DoStmt::getBody(), clang::DoStmt::getCond(), visitBool(), and visitStmt().
Referenced by visitStmt().
|
overrideprotected |
Definition at line 5674 of file Compiler.cpp.
References clang::interp::Block, canClassify(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::hasTrivialDtor(), clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), clang::QualType::isVolatileQualified(), Locals, P, VarScope, and visitAPValueInitializer().
Definition at line 2709 of file Compiler.cpp.
References clang::EmbedExpr::begin(), and visit().
|
overrideprotected |
Definition at line 5414 of file Compiler.cpp.
References allocateLocal(), classify(), clang::interp::LocalScope< Emitter >::destroyLocals(), clang::interp::FullExpression, clang::Expr::getType(), clang::Type::isVoidType(), clang::T, clang::interp::InitLink::Temp(), visit(), and visitInitializer().
Referenced by visitLValueExpr().
| bool Compiler::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 4527 of file Compiler.cpp.
References Ctx, and clang::ExpressionTraitExpr::getValue().
| bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 3475 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 4744 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 2061 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 1276 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 2146 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 3216 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 1243 of file Compiler.cpp.
References DiscardResult, and clang::FloatingLiteral::getValue().
Definition at line 6841 of file Compiler.cpp.
References clang::Cond, 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 7643 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 4114 of file Compiler.cpp.
References delegate(), and clang::GenericSelectionExpr::getResultExpr().
| bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 6410 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 6682 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 1252 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 2169 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 4945 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 4954 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 2296 of file Compiler.cpp.
References clang::interp::Activate(), clang::cast(), classify(), classifyPrim(), Ctx, 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, visit(), visitArrayElemInit(), and visitInitializerPop().
Referenced by VisitCXXParenListInitExpr(), and VisitInitListExpr().
| bool Compiler::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 2674 of file Compiler.cpp.
References clang::InitListExpr::getArrayFiller(), clang::InitListExpr::inits(), and visitInitList().
| bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 1235 of file Compiler.cpp.
References DiscardResult, and clang::interp::LE().
| bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 3694 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 1548 of file Compiler.cpp.
References classify(), DiscardResult, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::BinaryOperator::isLogicalOp(), clang::interp::PT_Bool, clang::T, and visitBool().
Referenced by VisitBinaryOperator().
|
overrideprotected |
Definition at line 5458 of file Compiler.cpp.
References visitExpr().
| bool Compiler::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | E | ) |
Definition at line 3483 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 2887 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 4520 of file Compiler.cpp.
References clang::ObjCObjectLiteral::isExpressibleAsConstantInitializer().
| bool Compiler::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 4125 of file Compiler.cpp.
References DiscardResult, and clang::ObjCBoolLiteralExpr::getValue().
| bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 4804 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 4512 of file Compiler.cpp.
References clang::ObjCObjectLiteral::isExpressibleAsConstantInitializer().
| bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 3174 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 3167 of file Compiler.cpp.
References DiscardResult.
| bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 4021 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 3002 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 4616 of file Compiler.cpp.
References delegate(), and clang::PackIndexingExpr::getSelectedExpr().
Definition at line 1289 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 1460 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 3304 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 3731 of file Compiler.cpp.
References delegate(), DiscardResult, clang::PredefinedExpr::getFunctionName(), Initializing, and P.
| bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 4592 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 4621 of file Compiler.cpp.
| bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 4567 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 6644 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 4687 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 4109 of file Compiler.cpp.
References clang::SizeOfPackExpr::getPackLength().
| bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 3965 of file Compiler.cpp.
References clang::cast(), classifyPrim(), 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 6494 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 4855 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 3110 of file Compiler.cpp.
References Ctx, DiscardResult, clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), Initializing, and P.
| bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 2685 of file Compiler.cpp.
References delegate(), and clang::SubstNonTypeTemplateParmExpr::getReplacement().
| bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 7030 of file Compiler.cpp.
References allocateLocalPrimitive(), CaseLabels, classifyPrim(), clang::Cond, 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 3185 of file Compiler.cpp.
References clang::SYCLUniqueStableNameExpr::ComputeName(), clang::StringLiteral::Create(), Ctx, DiscardResult, clang::SYCLUniqueStableNameExpr::getLocation(), Initializing, clang::Normal, clang::Ordinary, P, and clang::QualType::withConst().
| bool Compiler::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 3674 of file Compiler.cpp.
References classifyPrim(), DiscardResult, clang::TypeTraitExpr::getAPValue(), clang::TypeTraitExpr::getBoolValue(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::TypeTraitExpr::isStoredAsBoolean(), clang::T, and visitAPValue().
| bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 2738 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::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 7688 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 5557 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 1849 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 8074 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 6763 of file Compiler.cpp.
References clang::Cond, 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 5737 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 349 of file Compiler.h.
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
Definition at line 361 of file Compiler.h.
References InitLink, and clang::T.
Referenced by InitLink.
|
friend |
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 361 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 361 of file Compiler.h.
Definition at line 361 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
|
friend |
Definition at line 361 of file Compiler.h.
|
friend |
Definition at line 361 of file Compiler.h.
|
friend |
Definition at line 349 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 480 of file Compiler.h.
Referenced by VisitArrayInitIndexExpr().
|
protected |
Switch case mapping.
Definition at line 506 of file Compiler.h.
Referenced by visitCaseStmt(), and visitSwitchStmt().
|
protected |
Definition at line 510 of file Compiler.h.
Referenced by VisitCallExpr(), and visitFunc().
|
protected |
Current compilation context.
Definition at line 135 of file Compiler.h.
Referenced by canClassify(), canClassify(), classify(), classify(), Compiler(), getFunction(), visitAPValue(), visitAPValueInitializer(), visitAttributedStmt(), VisitBinaryOperator(), VisitBlockExpr(), VisitCallExpr(), VisitCastExpr(), VisitCompoundAssignOperator(), VisitCXXConstructExpr(), VisitCXXDynamicCastExpr(), VisitCXXNewExpr(), VisitCXXNullPtrLiteralExpr(), VisitCXXStdInitializerListExpr(), VisitCXXTypeidExpr(), visitDeclRef(), VisitExpressionTraitExpr(), VisitFixedPointBinOp(), VisitFixedPointLiteral(), visitInitList(), VisitMaterializeTemporaryExpr(), VisitObjCEncodeExpr(), VisitPointerArithBinOp(), VisitSourceLocExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), VisitUnaryExprOrTypeTraitExpr(), VisitUnaryOperator(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 486 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(), VisitCXXScalarValueInitExpr(), 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 496 of file Compiler.h.
Referenced by VisitArrayInitLoopExpr(), VisitBinaryOperator(), VisitBuiltinCallExpr(), VisitCallExpr(), VisitCastExpr(), VisitComplexBinOp(), VisitComplexUnaryOperator(), VisitCompoundLiteralExpr(), VisitCXXBindTemporaryExpr(), VisitCXXConstructExpr(), VisitCXXScalarValueInitExpr(), VisitCXXStdInitializerListExpr(), VisitCXXUuidofExpr(), VisitExtVectorElementExpr(), VisitImaginaryLiteral(), VisitImplicitValueInitExpr(), visitInitList(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitOpaqueValueExpr(), VisitPredefinedExpr(), VisitShuffleVectorExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), VisitVectorBinOp(), and VisitVectorUnaryOperator().
|
protected |
Definition at line 497 of file Compiler.h.
Referenced by visitDeclRef(), and visitInitList().
|
protected |
Definition at line 499 of file Compiler.h.
Referenced by VisitCXXThisExpr(), and visitWithSubstitutions().
|
protected |
Definition at line 500 of file Compiler.h.
Referenced by VisitCXXThisExpr(), and visitWithSubstitutions().
|
protected |
Definition at line 489 of file Compiler.h.
Referenced by visitCaseStmt(), visitReturnStmt(), VisitStmtExpr(), and visitSwitchStmt().
|
protected |
Stack of label information for loops and switch statements.
Definition at line 508 of file Compiler.h.
Referenced by visitBreakStmt(), visitContinueStmt(), and visitDefaultStmt().
|
protected |
Variable to storage mapping.
Definition at line 471 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), VisitCastExpr(), visitDeclAndReturn(), visitDeclRef(), and visitDtorCall().
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 474 of file Compiler.h.
Referenced by VisitOpaqueValueExpr().
|
protected |
Program to link to.
Definition at line 137 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), allocateTemporary(), Compiler(), getRecord(), VisitCastExpr(), VisitCompoundLiteralExpr(), VisitCXXNewExpr(), VisitCXXUuidofExpr(), visitDecl(), visitDeclAndReturn(), visitDeclRef(), visitDtorCall(), VisitLambdaExpr(), VisitMaterializeTemporaryExpr(), VisitMemberExpr(), VisitPredefinedExpr(), VisitSourceLocExpr(), VisitStringLiteral(), VisitSYCLUniqueStableNameExpr(), visitVarDecl(), and visitWithSubstitutions().
|
protected |
Type of the expression returned by the function.
Definition at line 503 of file Compiler.h.
Referenced by VisitBuiltinCallExpr(), VisitCallExpr(), visitFunc(), and visitReturnStmt().
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 483 of file Compiler.h.
Referenced by VisitSourceLocExpr().
|
protected |
Definition at line 488 of file Compiler.h.
Referenced by visitCaseStmt(), and visitSwitchStmt().
|
protected |
Definition at line 490 of file Compiler.h.
Referenced by visit(), visitBool(), and VisitCastExpr().
|
protected |
Definition at line 492 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), visitDeclRef(), and visitVarDecl().
|
protected |
Current scope.
Definition at line 477 of file Compiler.h.
Referenced by allocateLocal(), allocateLocalPrimitive(), allocateTemporary(), emitCleanup(), VisitAbstractConditionalOperator(), visitBreakStmt(), visitCallArgs(), visitContinueStmt(), visitDtorCall(), VisitMaterializeTemporaryExpr(), and visitWithSubstitutions().