clang 19.0.0git
|
Compilation context for expressions. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/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(). | |
void | emitCleanup () |
Emits scope cleanup instructions. | |
const RecordType * | getRecordTy (QualType Ty) |
Returns a record type from a record or pointer type. | |
Record * | getRecord (QualType Ty) |
Returns a record from a record or pointer type. | |
Record * | getRecord (const RecordDecl *RD) |
const Function * | getFunction (const FunctionDecl *FD) |
std::optional< PrimType > | classify (const Expr *E) const |
std::optional< PrimType > | classify (QualType Ty) const |
PrimType | classifyPrim (QualType Ty) const |
Classifies a known primitive type. | |
PrimType | classifyPrim (const Expr *E) const |
Classifies a known primitive expression. | |
bool | visit (const Expr *E) |
Evaluates an expression and places the result on the stack. | |
bool | visitInitializer (const Expr *E) |
Compiles an initializer. | |
bool | discard (const Expr *E) |
Evaluates an expression for side effects and discards the result. | |
bool | delegate (const Expr *E) |
Just pass evaluation on to E . | |
bool | visitVarDecl (const VarDecl *VD) |
Creates and initializes a variable from the given decl. | |
bool | visitAPValue (const APValue &Val, PrimType ValType, const Expr *E) |
Visit an APValue. | |
bool | visitBool (const Expr *E) |
Visits an expression and converts it to a boolean. | |
bool | visitLocalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a local. | |
bool | visitGlobalInitializer (const Expr *Init, unsigned I) |
Visits an initializer for a global. | |
bool | visitThisInitializer (const Expr *I) |
Visits a delegated initializer. | |
bool | visitInitList (ArrayRef< const Expr * > Inits, const Expr *E) |
bool | visitArrayElemInit (unsigned ElemIndex, const Expr *Init) |
Pointer to the array(not the element!) must be on the stack when calling this. | |
unsigned | allocateLocalPrimitive (DeclTy &&Decl, PrimType Ty, bool IsConst, bool IsExtended=false) |
Creates a local primitive value. | |
std::optional< unsigned > | allocateLocal (DeclTy &&Decl, bool IsExtended=false) |
Allocates a space storing a local given its type. | |
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 | Initializing = false |
Flag inidicating if we're initializing an already created variable. | |
bool | GlobalDecl = false |
Flag indicating if we're initializing a global variable. | |
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 | |
Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
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 2706 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Init, clang::interp::Descriptor::InlineDescMD, clang::QualType::isConstQualified(), and P.
|
protected |
Creates a local primitive value.
Definition at line 2680 of file ByteCodeExprGen.cpp.
References clang::interp::Descriptor::InlineDescMD, and P.
|
inlineprotected |
Definition at line 144 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 147 of file ByteCodeExprGen.h.
References clang::interp::Context::classify(), and clang::interp::ByteCodeExprGen< Emitter >::Ctx.
|
inlineprotected |
Classifies a known primitive expression.
Definition at line 159 of file ByteCodeExprGen.h.
References clang::interp::ByteCodeExprGen< Emitter >::classify(), and clang::T.
|
inlineprotected |
Classifies a known primitive type.
Definition at line 152 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 2432 of file ByteCodeExprGen.cpp.
References clang::Expr::containsErrors().
Evaluates an expression for side effects and discards the result.
Definition at line 2422 of file ByteCodeExprGen.cpp.
References clang::Expr::containsErrors().
|
protected |
Emits scope cleanup instructions.
Definition at line 3525 of file ByteCodeExprGen.cpp.
References clang::C.
|
protected |
Definition at line 2763 of file ByteCodeExprGen.cpp.
|
protected |
Definition at line 2758 of file ByteCodeExprGen.cpp.
References P.
Returns a record from a record or pointer type.
Definition at line 2751 of file ByteCodeExprGen.cpp.
|
protected |
Returns a record type from a record or pointer type.
Definition at line 2744 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 2442 of file ByteCodeExprGen.cpp.
References clang::Expr::containsErrors(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isGLValue(), and clang::Type::isVoidType().
bool ByteCodeExprGen::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | E | ) |
Definition at line 1448 of file ByteCodeExprGen.cpp.
References clang::Condition, clang::AbstractConditionalOperator::getCond(), clang::AbstractConditionalOperator::getFalseExpr(), and clang::AbstractConditionalOperator::getTrueExpr().
|
protected |
Visit an APValue.
Definition at line 2917 of file ByteCodeExprGen.cpp.
References clang::APValue::getInt(), clang::APValue::getLValueBase(), clang::APValue::isInt(), and clang::APValue::isLValue().
|
protected |
Pointer to the array(not the element!) must be on the stack when calling this.
Definition at line 1053 of file ByteCodeExprGen.cpp.
References clang::Init, and clang::T.
bool ByteCodeExprGen::VisitArrayInitIndexExpr | ( | const ArrayInitIndexExpr * | E | ) |
Definition at line 1373 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitArrayInitLoopExpr | ( | const ArrayInitLoopExpr * | E | ) |
Definition at line 1383 of file ByteCodeExprGen.cpp.
References clang::ArrayInitLoopExpr::getArraySize(), clang::ArrayInitLoopExpr::getCommonExpr(), and clang::ArrayInitLoopExpr::getSubExpr().
bool ByteCodeExprGen::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | E | ) |
Definition at line 962 of file ByteCodeExprGen.cpp.
References clang::ArraySubscriptExpr::getBase(), and clang::ArraySubscriptExpr::getIdx().
bool ByteCodeExprGen::VisitArrayTypeTraitExpr | ( | const ArrayTypeTraitExpr * | E | ) |
Definition at line 1938 of file ByteCodeExprGen.cpp.
References clang::ArrayTypeTraitExpr::getValue().
bool ByteCodeExprGen::VisitBinaryOperator | ( | const BinaryOperator * | E | ) |
Definition at line 492 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(), LT, clang::interp::PT_Bool, clang::Expr::refersToBitField(), and clang::T.
Visits an expression and converts it to a boolean.
Definition at line 2481 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 2933 of file ByteCodeExprGen.cpp.
References clang::CallExpr::arguments(), clang::Func, clang::CallExpr::getDirectCallee(), clang::Expr::getType(), and clang::Type::isVoidType().
Definition at line 2970 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 77 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::interp::PT_IntAP, clang::interp::PT_IntAPS, clang::interp::PT_Ptr, and clang::T.
bool ByteCodeExprGen::VisitCharacterLiteral | ( | const CharacterLiteral * | E | ) |
Definition at line 1537 of file ByteCodeExprGen.cpp.
References clang::CharacterLiteral::getValue().
bool ByteCodeExprGen::VisitChooseExpr | ( | const ChooseExpr * | E | ) |
Definition at line 2261 of file ByteCodeExprGen.cpp.
References clang::ChooseExpr::getChosenSubExpr().
bool ByteCodeExprGen::VisitComplexBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 758 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::interp::PT_Float, and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitComplexUnaryOperator | ( | const UnaryOperator * | E | ) |
Definition at line 3346 of file ByteCodeExprGen.cpp.
References clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Expr::isLValue(), clang::interp::PT_Bool, and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1656 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(), LT, clang::interp::PT_Float, and clang::Expr::refersToBitField().
bool ByteCodeExprGen::VisitCompoundLiteralExpr | ( | const CompoundLiteralExpr * | E | ) |
Definition at line 1863 of file ByteCodeExprGen.cpp.
References clang::CompoundLiteralExpr::getInitializer(), clang::Expr::getType(), clang::Init, clang::CompoundLiteralExpr::isFileScope(), clang::Expr::isLValue(), P, and clang::T.
bool ByteCodeExprGen::VisitConceptSpecializationExpr | ( | const ConceptSpecializationExpr * | E | ) |
Definition at line 2379 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 1204 of file ByteCodeExprGen.cpp.
References clang::ConstantExpr::getAPValueResult(), clang::FullExpr::getSubExpr(), clang::Expr::getType(), clang::ConstantExpr::hasAPValueResult(), and clang::T.
bool ByteCodeExprGen::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | E | ) |
Definition at line 1857 of file ByteCodeExprGen.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
bool ByteCodeExprGen::VisitCXXBoolLiteralExpr | ( | const CXXBoolLiteralExpr * | E | ) |
Definition at line 3121 of file ByteCodeExprGen.cpp.
References clang::CXXBoolLiteralExpr::getValue().
bool ByteCodeExprGen::VisitCXXConstructExpr | ( | const CXXConstructExpr * | E | ) |
Definition at line 2022 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 3108 of file ByteCodeExprGen.cpp.
References clang::CXXDefaultArgExpr::getExpr(), and clang::T.
bool ByteCodeExprGen::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | E | ) |
Definition at line 3101 of file ByteCodeExprGen.cpp.
References clang::CXXDefaultInitExpr::getExpr().
bool ByteCodeExprGen::VisitCXXInheritedCtorInitExpr | ( | const CXXInheritedCtorInitExpr * | E | ) |
Definition at line 2275 of file ByteCodeExprGen.cpp.
References clang::interp::align(), clang::CXXInheritedCtorInitExpr::getConstructor(), clang::interp::Function::hasRVO(), clang::interp::Function::hasThisPointer(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::parameters(), clang::interp::primSize(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitCXXNoexceptExpr | ( | const CXXNoexceptExpr * | E | ) |
Definition at line 2013 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::CXXNoexceptExpr::getValue(), and clang::Type::isBooleanType().
bool ByteCodeExprGen::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | E | ) |
Definition at line 3130 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitCXXParenListInitExpr | ( | const CXXParenListInitExpr * | E | ) |
Definition at line 1183 of file ByteCodeExprGen.cpp.
References clang::CXXParenListInitExpr::getInitExprs(), clang::Expr::getType(), clang::Init, and clang::Type::isRecordType().
bool ByteCodeExprGen::VisitCXXReinterpretCastExpr | ( | const CXXReinterpretCastExpr * | E | ) |
Definition at line 2004 of file ByteCodeExprGen.cpp.
References clang::CastExpr::getSubExpr().
bool ByteCodeExprGen::VisitCXXRewrittenBinaryOperator | ( | const CXXRewrittenBinaryOperator * | E | ) |
Definition at line 2386 of file ByteCodeExprGen.cpp.
References clang::CXXRewrittenBinaryOperator::getSemanticForm().
bool ByteCodeExprGen::VisitCXXScalarValueInitExpr | ( | const CXXScalarValueInitExpr * | E | ) |
Definition at line 2217 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::Expr::getType(), clang::Type::isAnyComplexType(), clang::Type::isVoidType(), and clang::T.
bool ByteCodeExprGen::VisitCXXThisExpr | ( | const CXXThisExpr * | E | ) |
Definition at line 3150 of file ByteCodeExprGen.cpp.
bool ByteCodeExprGen::VisitCXXThrowExpr | ( | const CXXThrowExpr * | E | ) |
Definition at line 1996 of file ByteCodeExprGen.cpp.
References clang::CXXThrowExpr::getSubExpr().
bool ByteCodeExprGen::VisitCXXUuidofExpr | ( | const CXXUuidofExpr * | E | ) |
Definition at line 2313 of file ByteCodeExprGen.cpp.
References clang::APValue::getArrayInitializedElt(), clang::APValue::getArraySize(), clang::MSGuidDecl::getAsAPValue(), clang::interp::Record::getField(), clang::CXXUuidofExpr::getGuidDecl(), clang::Expr::getType(), clang::APValue::isArray(), clang::APValue::isInt(), clang::APValue::None, P, clang::T, and V.
Toplevel visitDecl().
We get here from evaluateAsInitializer(). We need to evaluate the initializer and return its value.
Definition at line 2809 of file ByteCodeExprGen.cpp.
References clang::ValueDecl::getType(), clang::Decl::isInvalidDecl(), P, clang::interp::PT_Ptr, and clang::interp::Context::shouldBeGloballyIndexed().
bool ByteCodeExprGen::VisitDeclRefExpr | ( | const DeclRefExpr * | E | ) |
Definition at line 3440 of file ByteCodeExprGen.cpp.
References clang::DeclRefExpr::getDecl(), clang::interp::Descriptor::getType(), clang::Type::isReferenceType(), P, and clang::interp::PT_Ptr.
Definition at line 2768 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 2306 of file ByteCodeExprGen.cpp.
References clang::ExpressionTraitExpr::getValue().
bool ByteCodeExprGen::VisitExprWithCleanups | ( | const ExprWithCleanups * | E | ) |
Definition at line 1774 of file ByteCodeExprGen.cpp.
References clang::ExprWithCleanups::getNumObjects(), and clang::FullExpr::getSubExpr().
bool ByteCodeExprGen::VisitFloatCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1545 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 LT.
bool ByteCodeExprGen::VisitFloatingLiteral | ( | const FloatingLiteral * | E | ) |
Definition at line 454 of file ByteCodeExprGen.cpp.
References clang::FloatingLiteral::getValue().
bool ByteCodeExprGen::VisitGenericSelectionExpr | ( | const GenericSelectionExpr * | E | ) |
Definition at line 2255 of file ByteCodeExprGen.cpp.
References clang::GenericSelectionExpr::getResultExpr().
|
inlineprotected |
Visits an initializer for a global.
Definition at line 203 of file ByteCodeExprGen.h.
References clang::Init, and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitGNUNullExpr | ( | const GNUNullExpr * | E | ) |
Definition at line 3139 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::Type::isIntegerType(), and clang::T.
bool ByteCodeExprGen::VisitImaginaryLiteral | ( | const ImaginaryLiteral * | E | ) |
Definition at line 462 of file ByteCodeExprGen.cpp.
References clang::ImaginaryLiteral::getSubExpr(), clang::Expr::getType(), and clang::Type::isAnyComplexType().
bool ByteCodeExprGen::VisitImplicitValueInitExpr | ( | const ImplicitValueInitExpr * | E | ) |
Definition at line 902 of file ByteCodeExprGen.cpp.
References clang::Type::getAs(), clang::Type::getAsArrayTypeUnsafe(), clang::Expr::getType(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), 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 2469 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 983 of file ByteCodeExprGen.cpp.
References clang::interp::Record::Field::Decl, clang::interp::Record::getBase(), clang::interp::Record::getField(), clang::Expr::getType(), clang::Init, clang::Type::isRecordType(), clang::FieldDecl::isUnnamedBitField(), and clang::T.
bool ByteCodeExprGen::VisitInitListExpr | ( | const InitListExpr * | E | ) |
Definition at line 1074 of file ByteCodeExprGen.cpp.
References clang::InitListExpr::getArrayFiller(), clang::Type::getAs(), clang::InitListExpr::getNumInits(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), clang::Init, clang::InitListExpr::inits(), clang::Type::isArrayType(), clang::Type::isRecordType(), and clang::T.
bool ByteCodeExprGen::VisitIntegerLiteral | ( | const IntegerLiteral * | E | ) |
Definition at line 446 of file ByteCodeExprGen.cpp.
References clang::interp::LE().
bool ByteCodeExprGen::VisitLambdaExpr | ( | const LambdaExpr * | E | ) |
Definition at line 1946 of file ByteCodeExprGen.cpp.
References clang::LambdaExpr::capture_init_begin(), clang::interp::Record::fields(), clang::LambdaExpr::getLambdaClass(), clang::Init, P, and clang::T.
|
inlineprotected |
Visits an initializer for a local.
Definition at line 189 of file ByteCodeExprGen.h.
References clang::Init, and clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitLogicalBinOp | ( | const BinaryOperator * | E | ) |
Definition at line 697 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 1784 of file ByteCodeExprGen.cpp.
References clang::MaterializeTemporaryExpr::getLifetimeExtendedTemporaryDecl(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), IsStatic, P, clang::SD_Static, and clang::Expr::skipRValueSubobjectAdjustments().
bool ByteCodeExprGen::VisitMemberExpr | ( | const MemberExpr * | E | ) |
Definition at line 1321 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 2266 of file ByteCodeExprGen.cpp.
References clang::ObjCBoolLiteralExpr::getValue().
bool ByteCodeExprGen::VisitOffsetOfExpr | ( | const OffsetOfExpr * | E | ) |
Definition at line 2182 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 1412 of file ByteCodeExprGen.cpp.
References clang::OpaqueValueExpr::getSourceExpr(), and clang::interp::PT_Ptr.
bool ByteCodeExprGen::VisitPackIndexingExpr | ( | const PackIndexingExpr * | E | ) |
Definition at line 2417 of file ByteCodeExprGen.cpp.
References clang::PackIndexingExpr::getSelectedExpr().
Definition at line 487 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 649 of file ByteCodeExprGen.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and LT.
bool ByteCodeExprGen::VisitPointerCompoundAssignOperator | ( | const CompoundAssignOperator * | E | ) |
Definition at line 1619 of file ByteCodeExprGen.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), and LT.
bool ByteCodeExprGen::VisitPredefinedExpr | ( | const PredefinedExpr * | E | ) |
Definition at line 1988 of file ByteCodeExprGen.cpp.
References clang::PredefinedExpr::getFunctionName().
bool ByteCodeExprGen::VisitPseudoObjectExpr | ( | const PseudoObjectExpr * | E | ) |
Definition at line 2392 of file ByteCodeExprGen.cpp.
References clang::PseudoObjectExpr::getResultExpr(), and clang::PseudoObjectExpr::semantics().
bool ByteCodeExprGen::VisitRequiresExpr | ( | const RequiresExpr * | E | ) |
Definition at line 2373 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::RequiresExpr::isSatisfied(), and clang::interp::PT_Bool.
bool ByteCodeExprGen::VisitSizeOfPackExpr | ( | const SizeOfPackExpr * | E | ) |
Definition at line 2250 of file ByteCodeExprGen.cpp.
References clang::SizeOfPackExpr::getPackLength().
bool ByteCodeExprGen::VisitSourceLocExpr | ( | const SourceLocExpr * | E | ) |
Definition at line 2126 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 1480 of file ByteCodeExprGen.cpp.
References clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::Expr::getType(), clang::ConstantArrayType::getZExtSize(), and P.
bool ByteCodeExprGen::VisitSubstNonTypeTemplateParmExpr | ( | const SubstNonTypeTemplateParmExpr * | E | ) |
Definition at line 1198 of file ByteCodeExprGen.cpp.
References clang::SubstNonTypeTemplateParmExpr::getReplacement().
|
inlineprotected |
Visits a delegated initializer.
Definition at line 217 of file ByteCodeExprGen.h.
References clang::interp::ByteCodeExprGen< Emitter >::visitInitializer().
bool ByteCodeExprGen::VisitTypeTraitExpr | ( | const TypeTraitExpr * | E | ) |
Definition at line 1929 of file ByteCodeExprGen.cpp.
References clang::Expr::getType(), clang::TypeTraitExpr::getValue(), and clang::Type::isBooleanType().
bool ByteCodeExprGen::VisitUnaryExprOrTypeTraitExpr | ( | const UnaryExprOrTypeTraitExpr * | E | ) |
Definition at line 1243 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 3164 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 2855 of file ByteCodeExprGen.cpp.
References clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::Init, clang::QualType::isConstQualified(), clang::QualType::isNull(), P, and clang::interp::Context::shouldBeGloballyIndexed().
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
Definition at line 235 of file ByteCodeExprGen.h.
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
|
friend |
Definition at line 235 of file ByteCodeExprGen.h.
|
protected |
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition at line 300 of file ByteCodeExprGen.h.
Referenced by clang::interp::ArrayIndexScope< Emitter >::ArrayIndexScope().
|
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 306 of file ByteCodeExprGen.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Flag indicating if we're initializing a global variable.
Definition at line 313 of file ByteCodeExprGen.h.
|
protected |
Flag inidicating if we're initializing an already created variable.
This is set in visitInitializer().
Definition at line 310 of file ByteCodeExprGen.h.
Referenced by clang::interp::OptionScope< Emitter >::OptionScope().
|
protected |
Variable to storage mapping.
Definition at line 291 of file ByteCodeExprGen.h.
|
protected |
OpaqueValueExpr to location mapping.
Definition at line 294 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 303 of file ByteCodeExprGen.h.
Referenced by clang::interp::SourceLocScope< Emitter >::SourceLocScope().
|
protected |
Current scope.
Definition at line 297 of file ByteCodeExprGen.h.
Referenced by clang::interp::VariableScope< Emitter >::VariableScope().