clang
19.0.0git
|
Compilation context for expressions. More...
#include "/home/runner/work/llvm/llvm/repo/clang/lib/AST/Interp/ByteCodeExprGen.h"
Protected Types | |
using | LabelTy = typename Emitter::LabelTy |
using | AddrTy = typename Emitter::AddrTy |
Protected Member Functions | |
bool | visitExpr (const Expr *E) override |
bool | visitDecl (const VarDecl *VD) override |
Toplevel visitDecl(). 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) |
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... | |
bool | visitVarDecl (const VarDecl *VD) |
Creates and initializes a variable from the given decl. More... | |
bool | visitAPValue (const APValue &Val, PrimType ValType, const Expr *E) |
Visit an APValue. More... | |
bool | visitAPValueInitializer (const APValue &Val, const Expr *E) |
bool | visitBool (const Expr *E) |
Visits an expression and converts it to a boolean. More... | |
bool | visitLocalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a local. More... | |
bool | visitGlobalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a global. More... | |
bool | visitThisInitializer (const Expr *I) |
Visits a delegated initializer. 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... | |
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 | Initializing = false |
Flag inidicating if we're initializing an already created variable. More... | |
bool | GlobalDecl = false |
Flag indicating if we're initializing a global variable. More... | |
Friends | |
class | VariableScope< Emitter > |
class | LocalScope< Emitter > |
class | DestructorScope< Emitter > |
class | DeclScope< Emitter > |
class | OptionScope< Emitter > |
class | ArrayIndexScope< Emitter > |
class | SourceLocScope< Emitter > |
Additional Inherited Members | |
![]() | |
ParamTys | P { return RetTy() |
Compilation context for expressions.
Definition at line 41 of file ByteCodeExprGen.h.
|
protected |
Definition at line 46 of file ByteCodeExprGen.h.
|
protected |
Definition at line 45 of file ByteCodeExprGen.h.
|
inline |
Initializes the compiler and the backend emitter.
Definition at line 56 of file ByteCodeExprGen.h.
|
protected |
Allocates a space storing a local given its type.
Definition at line 2938 of file ByteCodeExprGen.cpp.
References 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 2912 of file ByteCodeExprGen.cpp.
References clang::interp::Descriptor::InlineDescMD, and P.
|
inlineprotected |
Definition at line 151 of file ByteCodeExprGen.h.
References clang::interp::Context::classify(), and clang::interp::ByteCodeExprGen< Emitter >::Ctx.
Referenced by clang::interp::ByteCodeExprGen< Emitter >::classifyPrim().
|
inlineprotected |
Definition at line 154 of file ByteCodeExprGen.h.
References clang::interp::Context::classify(), and clang::interp::ByteCodeExprGen< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 166 of file ByteCodeExprGen.h.
References clang::interp::ByteCodeExprGen< Emitter >::classify(), and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 159 of file ByteCodeExprGen.h.
References clang::interp::ByteCodeExprGen< Emitter >::classify(), and clang::T.
Just pass evaluation on to E
.
This leaves all the parsing flags intact.
Definition at line 2667 of file ByteCodeExprGen.cpp.
Evaluates an expression for side effects and discards the result.
Definition at line 2660 of file ByteCodeExprGen.cpp.
|
protected |
Emits scope cleanup instructions.
Definition at line 3842 of file ByteCodeExprGen.cpp.
|
protected |
Definition at line 2999 of file ByteCodeExprGen.cpp.
|
protected |
Definition at line 2994 of file ByteCodeExprGen.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 2987 of file ByteCodeExprGen.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 2980 of file ByteCodeExprGen.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 2674 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::QualType::isNull(), and clang::Type::isVoidType().
bool ByteCodeExprGen::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 1552 of file ByteCodeExprGen.cpp.
References clang::Condition, clang::AbstractConditionalOperator::getCond(), clang::AbstractConditionalOperator::getFalseExpr(), and clang::AbstractConditionalOperator::getTrueExpr().
bool ByteCodeExprGen::VisitAddrLabelExpr | ( | const AddrLabelExpr * | E | ) |
Definition at line 2567 of file ByteCodeExprGen.cpp.
References clang::AddrLabelExpr::getLabel(), clang::Expr::getType(), clang::Type::isVoidPointerType(), Offset, and clang::interp::PT_Ptr.
|
protected |
Visit an APValue.
Definition at line 3155 of file ByteCodeExprGen.cpp.
References clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::isInt(), and clang::APValue::isLValue().
|
protected |
Definition at line 3171 of file ByteCodeExprGen.cpp.
References clang::APValue::getArrayInitializedElt(), clang::APValue::getArraySize(), clang::interp::Record::getField(), clang::APValue::getStructField(), clang::APValue::getStructNumFields(), clang::Expr::getType(), clang::APValue::isArray(), clang::APValue::isInt(), clang::APValue::isStruct(), and clang::T.
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 1256 of file ByteCodeExprGen.cpp.
References clang::interp::Init(), and clang::T.
bool ByteCodeExprGen::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 1477 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 1487 of file ByteCodeExprGen.cpp.
References clang::ArrayInitLoopExpr::getArraySize(), clang::ArrayInitLoopExpr::getCommonExpr(), and clang::ArrayInitLoopExpr::getSubExpr().
bool ByteCodeExprGen::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 1004 of file ByteCodeExprGen.cpp.
References clang::ArraySubscriptExpr::getBase().
bool ByteCodeExprGen::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 2072 of file ByteCodeExprGen.cpp.
References clang::ArrayTypeTraitExpr::getValue().
bool ByteCodeExprGen::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 511 of file ByteCodeExprGen.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::Expr::refersToBitField(), and clang::T.
Visits an expression and converts it to a boolean.
Definition at line 2713 of file ByteCodeExprGen.cpp.
References 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 3219 of file ByteCodeExprGen.cpp.
References clang::CallExpr::arguments(), clang::Func, clang::CallExpr::getDirectCallee(), clang::Expr::getType(), and clang::Type::isVoidType().
Definition at line 3256 of file ByteCodeExprGen.cpp.
References clang::interp::align(), clang::interp::collectNonNullArgs(), clang::Func, clang::CallExpr::getArg(), clang::CallExpr::getArgs(), clang::CallExpr::getBuiltinCallee(), clang::CallExpr::getCallee(), clang::CallExpr::getCallReturnType(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getNumArgs(), clang::Type::isVoidType(), clang::interp::primSize(), clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
Definition at line 73 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::CastExpr::getCastKind(), clang::Type::getPointeeType(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::interp::Descriptor::InlineDescMD, clang::Type::isAnyComplexType(), clang::Type::isAtomicType(), clang::Type::isIntegralOrEnumerationType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::interp::isPtrType(), clang::Type::isVectorType(), clang::Type::isVoidType(), P, clang::CastExpr::path(), clang::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_Ptr, clang::interp::Reinterpret, and clang::T.
bool ByteCodeExprGen::VisitCharacterLiteral | ( | const CharacterLiteral * | E | ) |
Definition at line 1671 of file ByteCodeExprGen.cpp.
References clang::CharacterLiteral::getValue().
bool ByteCodeExprGen::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 2430 of file ByteCodeExprGen.cpp.
References clang::ChooseExpr::getChosenSubExpr().
bool ByteCodeExprGen::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 777 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isAnyComplexType(), Offset, clang::interp::PT_Float, and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 3645 of file ByteCodeExprGen.cpp.
References clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isAnyComplexType(), Offset, and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1790 of file ByteCodeExprGen.cpp.
References clang::CompoundAssignOperator::getComputationLHSType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFloatingType(), clang::Type::isPointerType(), clang::interp::LT(), clang::interp::PT_Float, and clang::Expr::refersToBitField().
bool ByteCodeExprGen::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 1997 of file ByteCodeExprGen.cpp.
References clang::CompoundLiteralExpr::getInitializer(), clang::Expr::getType(), clang::interp::Init(), clang::CompoundLiteralExpr::isFileScope(), clang::Expr::isLValue(), P, and clang::T.
bool ByteCodeExprGen::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 2516 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::ConceptSpecializationExpr::isSatisfied(), and clang::interp::PT_Bool.
bool ByteCodeExprGen::VisitConstantExpr | ( | const ConstantExpr * | E | ) |
Definition at line 1294 of file ByteCodeExprGen.cpp.
References clang::ConstantExpr::getAPValueResult(), clang::FullExpr::getSubExpr(), clang::Expr::getType(), clang::ConstantExpr::hasAPValueResult(), and clang::T.
bool ByteCodeExprGen::VisitConvertVectorExpr | ( | const ConvertVectorExpr * | E | ) |
Definition at line 2577 of file ByteCodeExprGen.cpp.
References clang::Type::castAs(), clang::VectorType::getElementType(), clang::ConvertVectorExpr::getSrcExpr(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 1991 of file ByteCodeExprGen.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
bool ByteCodeExprGen::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 3408 of file ByteCodeExprGen.cpp.
References clang::CXXBoolLiteralExpr::getValue().
bool ByteCodeExprGen::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2156 of file ByteCodeExprGen.cpp.
References clang::interp::align(), clang::CXXConstructExpr::arguments(), clang::Func, clang::CXXConstructExpr::getArg(), clang::CXXConstructExpr::getConstructor(), clang::CXXConstructExpr::getNumArgs(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Type::isArrayType(), clang::Type::isRecordType(), clang::FunctionDecl::isTrivial(), clang::interp::primSize(), clang::interp::PT_Ptr, clang::CXXConstructExpr::requiresZeroInitialization(), and clang::T.
bool ByteCodeExprGen::VisitCXXDefaultArgExpr | ( | const CXXDefaultArgExpr * | E | ) |
Definition at line 3395 of file ByteCodeExprGen.cpp.
References clang::CXXDefaultArgExpr::getExpr(), and clang::T.
bool ByteCodeExprGen::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 3388 of file ByteCodeExprGen.cpp.
References clang::CXXDefaultInitExpr::getExpr().
bool ByteCodeExprGen::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 2444 of file ByteCodeExprGen.cpp.
References clang::interp::align(), clang::CXXInheritedCtorInitExpr::getConstructor(), clang::interp::Function::hasRVO(), clang::interp::Function::hasThisPointer(), clang::FunctionDecl::isTrivial(), Offset, clang::FunctionDecl::parameters(), clang::interp::primSize(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitCXXNoexceptExpr | ( | const CXXNoexceptExpr * | E | ) |
Definition at line 2147 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::CXXNoexceptExpr::getValue(), and clang::Type::isBooleanType().
bool ByteCodeExprGen::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 3417 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1282 of file ByteCodeExprGen.cpp.
References clang::CXXParenListInitExpr::getArrayFiller(), and clang::CXXParenListInitExpr::getInitExprs().
bool ByteCodeExprGen::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2138 of file ByteCodeExprGen.cpp.
References clang::CastExpr::getSubExpr(), and clang::interp::Reinterpret.
bool ByteCodeExprGen::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 2525 of file ByteCodeExprGen.cpp.
References clang::CXXRewrittenBinaryOperator::getSemanticForm().
bool ByteCodeExprGen::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 2360 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool ByteCodeExprGen::VisitCXXThisExpr | ( | const CXXThisExpr * | E | ) |
Definition at line 3437 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 2130 of file ByteCodeExprGen.cpp.
References clang::CXXThrowExpr::getSubExpr().
bool ByteCodeExprGen::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 2482 of file ByteCodeExprGen.cpp.
References clang::MSGuidDecl::getAsAPValue(), clang::CXXUuidofExpr::getGuidDecl(), clang::Expr::getType(), clang::APValue::None, P, and V.
Toplevel visitDecl().
We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.
Definition at line 3046 of file ByteCodeExprGen.cpp.
References clang::Decl::isInvalidDecl().
bool ByteCodeExprGen::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 3738 of file ByteCodeExprGen.cpp.
References clang::DeclRefExpr::getDecl().
Definition at line 3004 of file ByteCodeExprGen.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::Expr::getType(), clang::Type::isVoidType(), and clang::T.
bool ByteCodeExprGen::VisitExpressionTraitExpr | ( | const ExpressionTraitExpr * | E | ) |
Definition at line 2475 of file ByteCodeExprGen.cpp.
References clang::ExpressionTraitExpr::getValue().
bool ByteCodeExprGen::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 1908 of file ByteCodeExprGen.cpp.
References clang::interp::LocalScope< Emitter >::destroyLocals(), clang::ExprWithCleanups::getNumObjects(), and clang::FullExpr::getSubExpr().
bool ByteCodeExprGen::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1679 of file ByteCodeExprGen.cpp.
References clang::CompoundAssignOperator::getComputationLHSType(), clang::CompoundAssignOperator::getComputationResultType(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isFloatingType(), and clang::interp::LT().
bool ByteCodeExprGen::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 473 of file ByteCodeExprGen.cpp.
References clang::FloatingLiteral::getValue().
bool ByteCodeExprGen::VisitGenericSelectionExpr | ( | const GenericSelectionExpr * | E | ) |
Definition at line 2424 of file ByteCodeExprGen.cpp.
References clang::GenericSelectionExpr::getResultExpr().
|
inlineprotected |
Visits an initializer for a global.
Definition at line 211 of file ByteCodeExprGen.h.
References clang::interp::Init(), and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 3426 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
bool ByteCodeExprGen::VisitImaginaryLiteral | ( | const ImaginaryLiteral * | E | ) |
Definition at line 481 of file ByteCodeExprGen.cpp.
References clang::ImaginaryLiteral::getSubExpr(), clang::Expr::getType(), and clang::Type::isAnyComplexType().
bool ByteCodeExprGen::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 921 of file ByteCodeExprGen.cpp.
References 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 2701 of file ByteCodeExprGen.cpp.
References clang::Expr::containsErrors(), and clang::Expr::getType().
Referenced by clang::interp::ByteCodeExprGen< Emitter >::visitGlobalInitializer(), clang::interp::ByteCodeExprGen< Emitter >::visitLocalInitializer(), and clang::interp::ByteCodeExprGen< Emitter >::visitThisInitializer().
|
protected |
Definition at line 1025 of file ByteCodeExprGen.cpp.
References clang::interp::Record::Field::Decl, clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::interp::Record::getNumFields(), 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 ByteCodeExprGen::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 1277 of file ByteCodeExprGen.cpp.
References clang::InitListExpr::getArrayFiller(), and clang::InitListExpr::inits().
bool ByteCodeExprGen::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 465 of file ByteCodeExprGen.cpp.
References clang::interp::LE().
bool ByteCodeExprGen::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 2080 of file ByteCodeExprGen.cpp.
References clang::LambdaExpr::capture_init_begin(), clang::interp::Record::fields(), clang::LambdaExpr::getLambdaClass(), clang::interp::Init(), P, and clang::T.
|
inlineprotected |
Visits an initializer for a local.
Definition at line 197 of file ByteCodeExprGen.h.
References clang::interp::Init(), and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 716 of file ByteCodeExprGen.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::BinaryOperator::isLogicalOp(), clang::interp::PT_Bool, and clang::T.
bool ByteCodeExprGen::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | E | ) |
Definition at line 1919 of file ByteCodeExprGen.cpp.
References clang::MaterializeTemporaryExpr::getLifetimeExtendedTemporaryDecl(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), IsStatic, P, and clang::SD_Static.
bool ByteCodeExprGen::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 1425 of file ByteCodeExprGen.cpp.
References clang::MemberExpr::getBase(), clang::interp::Record::getField(), clang::MemberExpr::getMemberDecl(), clang::DeclContext::getParent(), clang::Expr::isGLValue(), clang::Member, P, clang::interp::PT_Ptr, and clang::T.
bool ByteCodeExprGen::VisitObjCBoolLiteralExpr | ( | const ObjCBoolLiteralExpr * | E | ) |
Definition at line 2435 of file ByteCodeExprGen.cpp.
References clang::ObjCBoolLiteralExpr::getValue().
bool ByteCodeExprGen::VisitObjCBoxedExpr | ( | const ObjCBoxedExpr * | E | ) |
Definition at line 2653 of file ByteCodeExprGen.cpp.
References clang::ObjCBoxedExpr::getSubExpr(), and clang::ObjCBoxedExpr::isExpressibleAsConstantInitializer().
bool ByteCodeExprGen::VisitObjCStringLiteral | ( | const ObjCStringLiteral * | E | ) |
Definition at line 1641 of file ByteCodeExprGen.cpp.
References clang::ObjCStringLiteral::getString().
bool ByteCodeExprGen::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 2325 of file ByteCodeExprGen.cpp.
References clang::OffsetOfNode::Array, clang::OffsetOfExpr::getComponent(), clang::OffsetOfExpr::getIndexExpr(), clang::OffsetOfExpr::getNumComponents(), clang::Expr::getType(), Node, clang::interp::PT_Sint64, and clang::T.
bool ByteCodeExprGen::VisitOpaqueValueExpr | ( | const OpaqueValueExpr * | E | ) |
Definition at line 1516 of file ByteCodeExprGen.cpp.
References clang::OpaqueValueExpr::getSourceExpr(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 2556 of file ByteCodeExprGen.cpp.
References clang::PackIndexingExpr::getSelectedExpr().
Definition at line 506 of file ByteCodeExprGen.cpp.
References clang::ParenExpr::getSubExpr().
bool ByteCodeExprGen::VisitPointerArithBinOp | ( | const BinaryOperator * | E | ) |
Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
Definition at line 668 of file ByteCodeExprGen.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and clang::interp::LT().
bool ByteCodeExprGen::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1753 of file ByteCodeExprGen.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), and clang::interp::LT().
bool ByteCodeExprGen::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 2122 of file ByteCodeExprGen.cpp.
References clang::PredefinedExpr::getFunctionName().
bool ByteCodeExprGen::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 2531 of file ByteCodeExprGen.cpp.
References clang::PseudoObjectExpr::getResultExpr(), and clang::PseudoObjectExpr::semantics().
bool ByteCodeExprGen::VisitRecoveryExpr | ( | const RecoveryExpr * | E | ) |
Definition at line 2562 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 2508 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::RequiresExpr::isSatisfied(), and clang::interp::PT_Bool.
bool ByteCodeExprGen::VisitShuffleVectorExpr | ( | const ShuffleVectorExpr * | E | ) |
Definition at line 2610 of file ByteCodeExprGen.cpp.
References clang::Type::castAs(), clang::VectorType::getElementType(), clang::ShuffleVectorExpr::getExpr(), clang::VectorType::getNumElements(), clang::ShuffleVectorExpr::getNumSubExprs(), clang::ShuffleVectorExpr::getShuffleMaskIdx(), clang::Expr::getType(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 2419 of file ByteCodeExprGen.cpp.
References clang::SizeOfPackExpr::getPackLength().
bool ByteCodeExprGen::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 2269 of file ByteCodeExprGen.cpp.
References clang::SourceLocExpr::EvaluateInContext(), 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.
bool ByteCodeExprGen::VisitStringLiteral | ( | const StringLiteral * | E | ) |
Definition at line 1584 of file ByteCodeExprGen.cpp.
References clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), min(), and P.
bool ByteCodeExprGen::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 1288 of file ByteCodeExprGen.cpp.
References clang::SubstNonTypeTemplateParmExpr::getReplacement().
bool ByteCodeExprGen::VisitSYCLUniqueStableNameExpr | ( | const SYCLUniqueStableNameExpr * | E | ) |
Definition at line 1647 of file ByteCodeExprGen.cpp.
References clang::SYCLUniqueStableNameExpr::ComputeName(), clang::StringLiteral::Create(), clang::SYCLUniqueStableNameExpr::getLocation(), clang::Normal, clang::Ordinary, P, and clang::QualType::withConst().
|
inlineprotected |
Visits a delegated initializer.
Definition at line 225 of file ByteCodeExprGen.h.
References clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 2063 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::TypeTraitExpr::getValue(), and clang::Type::isBooleanType().
bool ByteCodeExprGen::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 1333 of file ByteCodeExprGen.cpp.
References AlignOfType(), clang::UnaryExprOrTypeTraitExpr::getArgumentExpr(), clang::Type::getAs(), clang::ASTContext::getDeclAlign(), clang::UnaryExprOrTypeTraitExpr::getKind(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeInfoDataSizeInChars(), clang::UnaryExprOrTypeTraitExpr::getTypeOfArgument(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParens(), clang::UnaryExprOrTypeTraitExpr::isArgumentType(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isSizelessVectorType(), clang::Type::isVoidType(), clang::CharUnits::One(), and clang::TypeInfoChars::Width.
bool ByteCodeExprGen::VisitUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 3451 of file ByteCodeExprGen.cpp.
References clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), clang::interp::isIntegralType(), clang::interp::PT_Bool, clang::interp::PT_Float, clang::interp::PT_FnPtr, clang::interp::PT_Ptr, and clang::T.
Creates and initializes a variable from the given decl.
Definition at line 3092 of file ByteCodeExprGen.cpp.
References clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::interp::Init(), clang::QualType::isConstQualified(), clang::QualType::isNull(), Offset, P, and clang::interp::Context::shouldBeGloballyIndexed().
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
Definition at line 245 of file ByteCodeExprGen.h.
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
|
friend |
Definition at line 245 of file ByteCodeExprGen.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 310 of file ByteCodeExprGen.h.
|
protected |
Current compilation context.
Definition at line 49 of file ByteCodeExprGen.h.
Referenced by clang::interp::ByteCodeExprGen< Emitter >::classify().
|
protected |
Flag indicating if return value is to be discarded.
Definition at line 316 of file ByteCodeExprGen.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Flag indicating if we're initializing a global variable.
Definition at line 323 of file ByteCodeExprGen.h.
Referenced by clang::interp::DeclScope< Emitter >::DeclScope().
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 320 of file ByteCodeExprGen.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Variable to storage mapping.
Definition at line 301 of file ByteCodeExprGen.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 304 of file ByteCodeExprGen.h.
|
protected |
Program to link to.
Definition at line 51 of file ByteCodeExprGen.h.
|
protected |
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition at line 313 of file ByteCodeExprGen.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 307 of file ByteCodeExprGen.h.
Referenced by clang::interp::VariableScope< Emitter >::VariableScope().