clang
20.0.0git
|
Compilation context for expressions. More...
#include "/home/runner/work/llvm/llvm/repo/clang/lib/AST/ByteCode/Compiler.h"
Protected Types | |
using | LabelTy = typename Emitter::LabelTy |
using | AddrTy = typename Emitter::AddrTy |
using | OptLabelTy = std::optional< LabelTy > |
using | CaseMap = llvm::DenseMap< const SwitchCase *, LabelTy > |
Protected Member Functions | |
bool | visitStmt (const Stmt *S) |
bool | visitExpr (const Expr *E) override |
bool | visitFunc (const FunctionDecl *F) override |
bool | visitDeclAndReturn (const VarDecl *VD, bool ConstantContext) override |
Toplevel visitDeclAndReturn(). More... | |
void | emitCleanup () |
Emits scope cleanup instructions. More... | |
const RecordType * | getRecordTy (QualType Ty) |
Returns a record type from a record or pointer type. More... | |
Record * | getRecord (QualType Ty) |
Returns a record from a record or pointer type. More... | |
Record * | getRecord (const RecordDecl *RD) |
const Function * | getFunction (const FunctionDecl *FD) |
Returns a function for the given FunctionDecl. More... | |
std::optional< PrimType > | classify (const Expr *E) const |
std::optional< PrimType > | classify (QualType Ty) const |
PrimType | classifyPrim (QualType Ty) const |
Classifies a known primitive type. More... | |
PrimType | classifyPrim (const Expr *E) const |
Classifies a known primitive expression. More... | |
bool | visit (const Expr *E) |
Evaluates an expression and places the result on the stack. More... | |
bool | visitInitializer (const Expr *E) |
Compiles an initializer. More... | |
bool | discard (const Expr *E) |
Evaluates an expression for side effects and discards the result. More... | |
bool | delegate (const Expr *E) |
Just pass evaluation on to E . More... | |
VarCreationState | visitVarDecl (const VarDecl *VD, bool Toplevel=false) |
Creates and initializes a variable from the given decl. More... | |
VarCreationState | visitDecl (const VarDecl *VD) |
bool | visitAPValue (const APValue &Val, PrimType ValType, const Expr *E) |
Visit an APValue. More... | |
bool | visitAPValueInitializer (const APValue &Val, const Expr *E) |
bool | visitDeclRef (const ValueDecl *D, const Expr *E) |
Visit the given decl as if we have a reference to it. More... | |
bool | visitBool (const Expr *E) |
Visits an expression and converts it to a boolean. More... | |
bool | visitInitList (ArrayRef< const Expr * > Inits, const Expr *ArrayFiller, const Expr *E) |
bool | visitArrayElemInit (unsigned ElemIndex, const Expr *Init) |
Pointer to the array(not the element!) must be on the stack when calling this. More... | |
unsigned | allocateLocalPrimitive (DeclTy &&Decl, PrimType Ty, bool IsConst, bool IsExtended=false) |
Creates a local primitive value. More... | |
std::optional< unsigned > | allocateLocal (DeclTy &&Decl, const ValueDecl *ExtendingDecl=nullptr) |
Allocates a space storing a local given its type. More... | |
unsigned | allocateTemporary (const Expr *E) |
Protected Attributes | |
Context & | Ctx |
Current compilation context. More... | |
Program & | P |
Program to link to. More... | |
llvm::DenseMap< const ValueDecl *, Scope::Local > | Locals |
Variable to storage mapping. More... | |
llvm::DenseMap< const OpaqueValueExpr *, unsigned > | OpaqueExprs |
OpaqueValueExpr to location mapping. More... | |
VariableScope< Emitter > * | VarScope = nullptr |
Current scope. More... | |
std::optional< uint64_t > | ArrayIndex |
Current argument index. Needed to emit ArrayInitIndexExpr. More... | |
const Expr * | SourceLocDefaultExpr = nullptr |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr. More... | |
bool | DiscardResult = false |
Flag indicating if return value is to be discarded. More... | |
bool | InStmtExpr = false |
bool | Initializing = false |
Flag inidicating if we're initializing an already created variable. More... | |
const ValueDecl * | InitializingDecl = nullptr |
llvm::SmallVector< InitLink > | InitStack |
bool | InitStackActive = false |
std::optional< PrimType > | ReturnType |
Type of the expression returned by the function. More... | |
CaseMap | CaseLabels |
Switch case mapping. More... | |
OptLabelTy | BreakLabel |
Point to break to. More... | |
OptLabelTy | ContinueLabel |
Point to continue to. More... | |
OptLabelTy | DefaultLabel |
Default case label. More... | |
Friends | |
class | VariableScope< Emitter > |
class | LocalScope< Emitter > |
class | DestructorScope< Emitter > |
class | DeclScope< Emitter > |
class | InitLinkScope< Emitter > |
class | InitStackScope< Emitter > |
class | OptionScope< Emitter > |
class | ArrayIndexScope< Emitter > |
class | SourceLocScope< Emitter > |
struct | InitLink |
class | LoopScope< Emitter > |
class | LabelScope< Emitter > |
class | SwitchScope< Emitter > |
class | StmtExprScope< Emitter > |
Additional Inherited Members | |
Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
ParamTys | P { return RetTy() |
Compilation context for expressions.
Definition at line 103 of file Compiler.h.
|
protected |
Definition at line 108 of file Compiler.h.
|
protected |
Definition at line 110 of file Compiler.h.
|
protected |
Definition at line 107 of file Compiler.h.
|
protected |
Definition at line 109 of file Compiler.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 120 of file Compiler.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 3514 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Init(), clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), and P.
|
protected |
Creates a local primitive value.
Definition at line 3489 of file Compiler.cpp.
References D, clang::interp::Descriptor::InlineDescMD, and P.
Definition at line 3555 of file Compiler.cpp.
References D, E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), clang::Type::isRecordType(), and P.
|
inlineprotected |
Definition at line 242 of file Compiler.h.
References clang::interp::Context::classify(), clang::interp::Compiler< Emitter >::Ctx, and E.
Referenced by clang::interp::Compiler< Emitter >::classifyPrim().
|
inlineprotected |
Definition at line 245 of file Compiler.h.
References clang::interp::Context::classify(), and clang::interp::Compiler< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 257 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), E, and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 250 of file Compiler.h.
References clang::interp::Compiler< Emitter >::classify(), and clang::T.
Just pass evaluation on to E
.
This leaves all the parsing flags intact.
Definition at line 3231 of file Compiler.cpp.
References clang::Expr::containsErrors(), and E.
Evaluates an expression for side effects and discards the result.
Definition at line 3225 of file Compiler.cpp.
References E.
|
protected |
Emits scope cleanup instructions.
Definition at line 5416 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 3594 of file Compiler.cpp.
|
protected |
Definition at line 3589 of file Compiler.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 3582 of file Compiler.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 3576 of file Compiler.cpp.
References clang::Type::getAs(), and clang::Type::getPointeeType().
Evaluates an expression and places the result on the stack.
If the expression is of composite type, a local variable will be created and a pointer to said variable will be placed on the stack.
Definition at line 3241 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::QualType::isNull(), and clang::Type::isVoidType().
bool Compiler::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 1860 of file Compiler.cpp.
References clang::Condition, and E.
bool Compiler::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 3015 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isVoidPointerType(), Offset, and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 3835 of file Compiler.cpp.
References E, clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getMemberPointerDecl(), clang::APValue::isFloat(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), and clang::APValue::isNullPointer().
|
protected |
Definition at line 3862 of file Compiler.cpp.
References E, clang::APValue::getArrayInitializedElt(), clang::APValue::getArraySize(), clang::interp::Record::getField(), clang::FieldDecl::getParent(), clang::APValue::getStructField(), clang::APValue::getStructNumFields(), clang::Expr::getType(), clang::APValue::getUnionField(), clang::APValue::getUnionValue(), clang::APValue::isArray(), clang::APValue::isFloat(), clang::APValue::isInt(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), clang::APValue::isStruct(), clang::APValue::isUnion(), and clang::T.
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 1559 of file Compiler.cpp.
References clang::interp::InitLink::Elem(), clang::interp::Init(), and clang::T.
bool Compiler::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 1785 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 1794 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1289 of file Compiler.cpp.
References E.
bool Compiler::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2402 of file Compiler.cpp.
References E.
bool Compiler::visitAttributedStmt | ( | const AttributedStmt * | S | ) |
Definition at line 4662 of file Compiler.cpp.
bool Compiler::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 693 of file Compiler.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::BinaryOperator::isCommaOp(), clang::BinaryOperator::isComparisonOp(), clang::Type::isFloatingType(), clang::BinaryOperator::isLogicalOp(), clang::Expr::isLValue(), clang::BinaryOperator::isPtrMemOp(), clang::interp::isPtrType(), clang::Type::isVoidType(), clang::interp::LT(), clang::interp::PT_Bool, clang::interp::PT_MemberPtr, clang::Expr::refersToBitField(), and clang::T.
Visits an expression and converts it to a boolean.
Definition at line 3282 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 4562 of file Compiler.cpp.
Definition at line 3925 of file Compiler.cpp.
References E, clang::Func, clang::Expr::getType(), clang::interp::isPtrType(), clang::Type::isVoidType(), P, and clang::interp::PT_Ptr.
Definition at line 3980 of file Compiler.cpp.
References clang::interp::align(), clang::interp::collectNonNullArgs(), E, clang::Func, clang::Type::isVoidType(), clang::interp::primSize(), clang::interp::PT_FnPtr, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 4650 of file Compiler.cpp.
Definition at line 178 of file Compiler.cpp.
References clang::Type::getAs(), clang::QualType::getCanonicalType(), clang::CastExpr::getCastKind(), clang::MemberPointerType::getClass(), clang::EnumType::getDecl(), clang::Type::getPointeeType(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::InlineDescMD, clang::Type::isAnyComplexType(), clang::Type::isAtomicType(), clang::Type::isEnumeralType(), clang::EnumDecl::isFixed(), clang::Type::isFloatingType(), clang::Type::isIntegralOrEnumerationType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::interp::isPtrType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), P, clang::CastExpr::path(), clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_MemberPtr, clang::interp::PT_Ptr, clang::interp::Reinterpret, and clang::T.
bool Compiler::VisitCharacterLiteral | ( | const CharacterLiteral * | E | ) |
Definition at line 2000 of file Compiler.cpp.
References E.
bool Compiler::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 2760 of file Compiler.cpp.
References E.
bool Compiler::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 982 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::ComplexType::getElementType(), clang::Expr::getType(), clang::Type::isAnyComplexType(), Offset, clang::interp::PT_Float, and clang::interp::PT_Ptr.
bool Compiler::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 5173 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), Offset, and clang::interp::PT_Ptr.
bool Compiler::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2118 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), clang::Type::isPointerType(), clang::interp::LT(), clang::interp::PT_Float, and clang::Expr::refersToBitField().
bool Compiler::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 2328 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::interp::Init(), clang::Expr::isLValue(), P, and clang::T.
bool Compiler::visitCompoundStmt | ( | const CompoundStmt * | S | ) |
Definition at line 4297 of file Compiler.cpp.
bool Compiler::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 2966 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 1598 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::T.
bool Compiler::visitContinueStmt | ( | const ContinueStmt * | S | ) |
Definition at line 4571 of file Compiler.cpp.
bool Compiler::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 3025 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::VectorType::getElementType(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool Compiler::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 2322 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 4185 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2485 of file Compiler.cpp.
References clang::interp::align(), E, clang::Func, clang::Type::getAsCXXRecordDecl(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Type::isArrayType(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::FunctionDecl::isDefaulted(), clang::Type::isRecordType(), clang::Expr::isTemporaryObject(), clang::FunctionDecl::isTrivial(), clang::interp::primSize(), clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitCXXDefaultArgExpr | ( | const CXXDefaultArgExpr * | E | ) |
Definition at line 4173 of file Compiler.cpp.
bool Compiler::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 4166 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | E | ) |
Definition at line 2904 of file Compiler.cpp.
References E.
bool Compiler::visitCXXForRangeStmt | ( | const CXXForRangeStmt * | S | ) |
Definition at line 4506 of file Compiler.cpp.
bool Compiler::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 2773 of file Compiler.cpp.
References clang::interp::align(), E, clang::interp::Function::hasRVO(), clang::interp::Function::hasThisPointer(), clang::FunctionDecl::isTrivial(), Offset, clang::FunctionDecl::parameters(), clang::interp::primSize(), and clang::interp::PT_Ptr.
bool Compiler::VisitCXXNewExpr | ( | const CXXNewExpr * | E | ) |
Definition at line 2804 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Init(), clang::interp::Descriptor::InlineDescMD, clang::Type::isNothrowT(), P, and clang::interp::PT_Ptr.
bool Compiler::VisitCXXNoexceptExpr | ( | const CXXNoexceptExpr * | E | ) |
Definition at line 2476 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 4193 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1586 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2464 of file Compiler.cpp.
References E, and clang::interp::Reinterpret.
bool Compiler::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 2975 of file Compiler.cpp.
References E.
bool Compiler::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 2690 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitCXXStdInitializerListExpr | ( | const CXXStdInitializerListExpr * | E | ) |
Definition at line 3170 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::Record::getField(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::interp::Record::Field::Offset, clang::interp::PT_Ptr, and clang::interp::PT_Uint64.
bool Compiler::VisitCXXThisExpr | ( | const CXXThisExpr * | E | ) |
Definition at line 4213 of file Compiler.cpp.
References E, clang::interp::InitLink::K_Elem, clang::interp::InitLink::K_Field, and Kind.
bool Compiler::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 2456 of file Compiler.cpp.
References E.
bool Compiler::visitCXXTryStmt | ( | const CXXTryStmt * | S | ) |
Definition at line 4693 of file Compiler.cpp.
bool Compiler::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 2921 of file Compiler.cpp.
References E, clang::MSGuidDecl::getAsAPValue(), clang::Type::getAsRecordDecl(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TagDecl::isCompleteDefinition(), clang::APValue::None, P, and V.
|
protected |
Definition at line 3637 of file Compiler.cpp.
References clang::interp::InitializerFailed, clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), P, clang::interp::Block::rawData(), and clang::interp::Context::shouldBeGloballyIndexed().
|
overrideprotected |
Toplevel visitDeclAndReturn().
We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.
Definition at line 3665 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::VarDecl::getAnyInitializer(), clang::ValueDecl::getType(), clang::interp::InitializerFailed, clang::interp::GlobalInlineDescriptor::InitState, clang::interp::Block::invokeDtor(), P, clang::interp::PT_Ptr, clang::interp::Block::rawData(), and clang::interp::Context::shouldBeGloballyIndexed().
|
protected |
Visit the given decl as if we have a reference to it.
Definition at line 5280 of file Compiler.cpp.
Referenced by clang::interp::InitLink::emit().
bool Compiler::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 5411 of file Compiler.cpp.
Definition at line 4306 of file Compiler.cpp.
References D, clang::DeclStmt::decls(), and clang::isa().
bool Compiler::visitDefaultStmt | ( | const DefaultStmt * | S | ) |
Definition at line 4656 of file Compiler.cpp.
Definition at line 4431 of file Compiler.cpp.
Definition at line 1614 of file Compiler.cpp.
References E.
Definition at line 3598 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), E, clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 2915 of file Compiler.cpp.
References E.
bool Compiler::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 2239 of file Compiler.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), and E.
bool Compiler::VisitExtVectorElementExpr | ( | const ExtVectorElementExpr * | E | ) |
Definition at line 3099 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isVectorType(), clang::interp::PT_Ptr, and clang::interp::PT_Uint32.
bool Compiler::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2007 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isFloatingType(), and clang::interp::LT().
bool Compiler::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 658 of file Compiler.cpp.
References E.
Definition at line 4459 of file Compiler.cpp.
|
overrideprotected |
Definition at line 4928 of file Compiler.cpp.
References clang::FunctionDecl::getBody(), clang::FunctionDecl::getReturnType(), clang::CXXMethodDecl::isLambdaStaticInvoker(), and clang::Type::isVoidType().
bool Compiler::VisitGenericSelectionExpr | ( | const GenericSelectionExpr * | E | ) |
Definition at line 2754 of file Compiler.cpp.
References E.
bool Compiler::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 4202 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
Definition at line 4357 of file Compiler.cpp.
References clang::IfStmt::getCond(), clang::IfStmt::getConditionVariableDeclStmt(), clang::IfStmt::getElse(), clang::IfStmt::getInit(), clang::IfStmt::getThen(), clang::IfStmt::isNegatedConsteval(), and clang::IfStmt::isNonNegatedConsteval().
bool Compiler::VisitImaginaryLiteral | ( | const ImaginaryLiteral * | E | ) |
Definition at line 666 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isAnyComplexType().
bool Compiler::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 1205 of file Compiler.cpp.
References E, clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::Type::getAsRecordDecl(), clang::Expr::getType(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), clang::Decl::isInvalidDecl(), clang::Type::isRecordType(), clang::TagDecl::isUnion(), and clang::T.
Compiles an initializer.
This is like visit() but it will never create a variable and instead rely on a variable already having been created. visitInitializer() then relies on a pointer to this variable being on top of the stack.
Definition at line 3268 of file Compiler.cpp.
References clang::Expr::containsErrors(), E, and clang::Expr::getType().
|
protected |
Definition at line 1319 of file Compiler.cpp.
References clang::interp::Record::Field::Decl, E, clang::interp::InitLink::Field(), clang::Type::getAs(), clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::Expr::getType(), clang::interp::Init(), clang::Type::isArrayType(), clang::Type::isRecordType(), clang::interp::Record::isUnion(), clang::FieldDecl::isUnnamedBitField(), clang::Type::isVoidType(), and clang::T.
bool Compiler::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 1581 of file Compiler.cpp.
References E.
bool Compiler::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 650 of file Compiler.cpp.
References clang::interp::LE().
bool Compiler::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2409 of file Compiler.cpp.
References E, clang::interp::Record::fields(), clang::interp::Init(), P, and clang::T.
bool Compiler::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 921 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::interp::PT_Bool, and clang::T.
bool Compiler::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | E | ) |
Definition at line 2249 of file Compiler.cpp.
References E, IsStatic, P, and clang::SD_Static.
bool Compiler::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 1733 of file Compiler.cpp.
References E, clang::interp::Record::getField(), clang::DeclContext::getParent(), clang::Expr::isGLValue(), clang::Member, P, clang::interp::PT_Ptr, and clang::T.
bool Compiler::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 2765 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 3161 of file Compiler.cpp.
References E.
bool Compiler::VisitObjCEncodeExpr | ( | const ObjCEncodeExpr * | E | ) |
Definition at line 1965 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, clang::Expr::getType(), and clang::Ordinary.
bool Compiler::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 1960 of file Compiler.cpp.
References E.
bool Compiler::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 2655 of file Compiler.cpp.
References clang::OffsetOfNode::Array, E, clang::Expr::getType(), Node, clang::interp::PT_Sint64, and clang::T.
bool Compiler::VisitOpaqueValueExpr | ( | const OpaqueValueExpr * | E | ) |
Definition at line 1824 of file Compiler.cpp.
References E, and clang::interp::PT_Ptr.
bool Compiler::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 3005 of file Compiler.cpp.
References E.
Definition at line 688 of file Compiler.cpp.
References E.
bool Compiler::VisitPointerArithBinOp | ( | const BinaryOperator * | E | ) |
Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
Definition at line 873 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and clang::interp::LT().
bool Compiler::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 2081 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::LT().
bool Compiler::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2448 of file Compiler.cpp.
References E.
bool Compiler::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 2981 of file Compiler.cpp.
References E.
bool Compiler::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 3010 of file Compiler.cpp.
References E.
bool Compiler::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 2958 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::interp::PT_Bool.
bool Compiler::visitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 4323 of file Compiler.cpp.
References clang::ReturnStmt::getRetValue().
bool Compiler::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 3057 of file Compiler.cpp.
References clang::Type::castAs(), E, clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool Compiler::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 2749 of file Compiler.cpp.
References E.
bool Compiler::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 2599 of file Compiler.cpp.
References E, clang::interp::Record::getField(), clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::getLValuePath(), clang::interp::Record::getNumFields(), clang::Expr::getType(), clang::APValue::isInt(), clang::Type::isIntegerType(), clang::APValue::isLValue(), clang::Type::isPointerType(), P, and V.
Definition at line 4247 of file Compiler.cpp.
Definition at line 3203 of file Compiler.cpp.
References E, and clang::CompoundStmt::getStmtExprResult().
bool Compiler::VisitStringLiteral | ( | const StringLiteral * | E | ) |
Definition at line 1903 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), min(), and P.
bool Compiler::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 1592 of file Compiler.cpp.
References E.
bool Compiler::visitSwitchStmt | ( | const SwitchStmt * | S | ) |
Definition at line 4580 of file Compiler.cpp.
bool Compiler::VisitSYCLUniqueStableNameExpr | ( | const SYCLUniqueStableNameExpr * | E | ) |
Definition at line 1976 of file Compiler.cpp.
References clang::StringLiteral::Create(), E, clang::Normal, clang::Ordinary, P, and clang::QualType::withConst().
bool Compiler::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 2393 of file Compiler.cpp.
References E, clang::Expr::getType(), and clang::Type::isBooleanType().
bool Compiler::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 1643 of file Compiler.cpp.
References AlignOfType(), E, clang::Type::getAs(), clang::ASTContext::getDeclAlign(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeInfoDataSizeInChars(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParens(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isVoidType(), Kind, clang::CharUnits::One(), and clang::TypeInfoChars::Width.
bool Compiler::VisitUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 4954 of file Compiler.cpp.
References E, clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::Type::isMemberPointerType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
|
protected |
Creates and initializes a variable from the given decl.
Definition at line 3725 of file Compiler.cpp.
References clang::interp::InitLink::Decl(), clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::interp::Init(), clang::QualType::isConstQualified(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::VarDecl::isStaticLocal(), clang::interp::VarCreationState::NotCreated(), Offset, P, and clang::interp::Context::shouldBeGloballyIndexed().
Definition at line 4400 of file Compiler.cpp.
|
friend |
Definition at line 300 of file Compiler.h.
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 312 of file Compiler.h.
|
friend |
Definition at line 300 of file Compiler.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 377 of file Compiler.h.
|
protected |
Point to break to.
Definition at line 402 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope(), and clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Switch case mapping.
Definition at line 399 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Point to continue to.
Definition at line 404 of file Compiler.h.
Referenced by clang::interp::LoopScope< Emitter >::LoopScope().
|
protected |
Current compilation context.
Definition at line 113 of file Compiler.h.
Referenced by clang::interp::Compiler< Emitter >::classify().
|
protected |
Default case label.
Definition at line 406 of file Compiler.h.
Referenced by clang::interp::SwitchScope< Emitter >::SwitchScope().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 383 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 389 of file Compiler.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Definition at line 390 of file Compiler.h.
Referenced by clang::interp::DeclScope< Emitter >::DeclScope().
|
protected |
Definition at line 392 of file Compiler.h.
Referenced by clang::interp::DeclScope< Emitter >::DeclScope(), and clang::interp::InitLinkScope< Emitter >::InitLinkScope().
|
protected |
Definition at line 393 of file Compiler.h.
Referenced by clang::interp::InitStackScope< Emitter >::InitStackScope().
|
protected |
Definition at line 385 of file Compiler.h.
Referenced by clang::interp::StmtExprScope< Emitter >::StmtExprScope().
|
protected |
Variable to storage mapping.
Definition at line 368 of file Compiler.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 371 of file Compiler.h.
|
protected |
Program to link to.
Definition at line 115 of file Compiler.h.
|
protected |
Type of the expression returned by the function.
Definition at line 396 of file Compiler.h.
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 380 of file Compiler.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 374 of file Compiler.h.
Referenced by clang::interp::VariableScope< Emitter >::VariableScope().