#include "ByteCode/Context.h"
#include "ByteCode/Frame.h"
#include "ByteCode/State.h"
#include "ExprConstShared.h"
#include "clang/AST/APValue.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/CurrentSourceLocExprScope.h"
#include "clang/AST/Expr.h"
#include "clang/AST/OSLog.h"
#include "clang/AST/OptionalDiagnostic.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/APFixedPoint.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/SipHash.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <cstring>
#include <functional>
#include <optional>
#include "clang/AST/TypeNodes.inc"
#include "clang/AST/BuiltinTypes.def"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/AArch64SVEACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.def"
#include "clang/Basic/AMDGPUTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"
#include "clang/AST/StmtNodes.inc"
Go to the source code of this file.
namespace llvm Diagnostic wrappers for TextAPI types for error reporting.Base
, which is known to be a direct base class of Derived
, is a public base class.
E
.
case Type::Class: \
llvm_unreachable( \
"dependent types aren't supported in the constant evaluator!");
◆ DEPENDENT_TYPE [2/2] #define DEPENDENT_TYPE ( ID, BASE ) case Type::ID: ◆ EXPR ◆ EXT_OPAQUE_TYPE #define EXT_OPAQUE_TYPE ( ExtType, Id, Ext ) case BuiltinType::Id: ◆ FLOATING_TYPE ◆ HLSL_INTANGIBLE_TYPE #define HLSL_INTANGIBLE_TYPE ( Name, Id, SingletonId ) case BuiltinType::Id: ◆ IMAGE_TYPE #define IMAGE_TYPE ( ImgType, Id, SingletonId, Access, Suffix ) case BuiltinType::Id: ◆ NON_CANONICAL_TYPE [1/2] #define NON_CANONICAL_TYPE ( Class, Base ) Value:case Type::Class: \
llvm_unreachable("non-canonical type should be impossible!");
◆ NON_CANONICAL_TYPE [2/2] #define NON_CANONICAL_TYPE ( ID, BASE ) case Type::ID: ◆ NON_CANONICAL_UNLESS_DEPENDENT #define NON_CANONICAL_UNLESS_DEPENDENT ( Class, Base ) Value:case Type::Class: \
llvm_unreachable("either dependent or not canonical!");
◆ NON_CANONICAL_UNLESS_DEPENDENT_TYPE #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE ( ID, BASE ) case Type::ID: ◆ PLACEHOLDER_TYPE #define PLACEHOLDER_TYPE ( ID, SINGLETON_ID ) case BuiltinType::ID: break; ◆ PPC_VECTOR_TYPE #define PPC_VECTOR_TYPE ( Name, Id, Size ) case BuiltinType::Id: ◆ RVV_TYPE #define RVV_TYPE ( Name, Id, SingletonId ) case BuiltinType::Id: ◆ SIGNED_TYPE ◆ STMT ◆ SVE_TYPE #define SVE_TYPE ( Name, Id, SingletonId ) case BuiltinType::Id: ◆ TYPE [1/2] #define TYPE ( Class, Base ) Value:case Type::Class: \
return visit(cast<Class##Type>(Can.getTypePtr()), Offset);
◆ TYPE [2/2] #define TYPE ( ID, BASE ) ◆ WASM_TYPE #define WASM_TYPE ( Name, Id, SingletonId ) case BuiltinType::Id: ◆ CheckedTemporariesMaterialized temporaries that we've already checked to determine if they're initializsed by a constant expression.
Definition at line 2332 of file ExprConstant.cpp.
◆ CheckEvaluationResultKind ◆ SizeOfType ◆ addFlexibleArrayMemberInitSize() static void addFlexibleArrayMemberInitSize ( EvalInfo & Info, const QualType & T, const LValue & LV, CharUnits & Size ) static ◆ addOrSubLValueAsInteger() static void addOrSubLValueAsInteger ( APValue & LVal, const APSInt & Index, bool IsSub ) static ◆ AreElementsOfSameArray() static bool AreElementsOfSameArray ( QualType ObjType, const SubobjectDesignator & A, const SubobjectDesignator & B ) static ◆ ArePotentiallyOverlappingStringLiterals() static bool ArePotentiallyOverlappingStringLiterals ( const EvalInfo & Info, const LValue & LHS, const LValue & RHS ) static ◆ CastToBaseClass() ◆ CastToDerivedClass() static bool CastToDerivedClass ( EvalInfo & Info, const Expr * E, LValue & Result, const RecordDecl * TruncatedType, unsigned TruncatedElements ) staticCast an lvalue referring to a base subobject to a derived class, by truncating the lvalue's path to the given length.
Definition at line 3248 of file ExprConstant.cpp.
References clang::CSK_Derived, D, E, clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTRecordLayout::getVBaseClassOffset(), and clang::Decl::isInvalidDecl().
Referenced by HandleBaseToDerivedCast(), HandleDynamicCast(), HandleLValueBase(), HandleMemberPointerAccess(), and HandleVirtualDispatch().
◆ CheckArraySize() ◆ CheckConstantExpression() ◆ CheckConstexprFunction() ◆ CheckDeleteKind() static std::optional< DynAlloc * > CheckDeleteKind ( EvalInfo & Info, const Expr * E, const LValue & Pointer, DynAlloc::Kind DeallocKind ) staticCheck that the given object is a suitable pointer to a heap allocation that still exists and is of the right kind for the purpose of a deletion.
On success, returns the heap allocation to deallocate. On failure, produces a diagnostic and returns std::nullopt.
Definition at line 7146 of file ExprConstant.cpp.
References E, NoteLValueLocation(), and Pointer.
Referenced by HandleOperatorDeleteCall().
◆ checkDynamicType() static bool checkDynamicType ( EvalInfo & Info, const Expr * E, const LValue & This, AccessKinds AK, bool Polymorphic ) static ◆ CheckedIntArithmetic()template<typename Operation >
◆ CheckEvalInICE() static ICEDiag CheckEvalInICE ( const Expr * E, const ASTContext & Ctx ) static ◆ CheckEvaluationResult()Definition at line 2569 of file ExprConstant.cpp.
References clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), CheckEvaluationResult(), CheckLValueConstantExpression(), CheckMemberPointerConstantExpression(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::ArrayType::getElementType(), clang::Decl::getLocation(), clang::Value::getType(), clang::APValue::hasValue(), and clang::Value::hasValue().
Referenced by CheckConstantExpression(), CheckEvaluationResult(), CheckFullyInitialized(), and CheckLValueConstantExpression().
◆ checkFloatingPointResult() static bool checkFloatingPointResult ( EvalInfo & Info, const Expr * E, APFloat::opStatus St ) static ◆ CheckFullyInitialized() ◆ CheckICE()Definition at line 17161 of file ExprConstant.cpp.
References CheckEvalInICE(), CheckICE(), D, E, clang::Expr::EvaluateKnownConstInt(), clang::Stmt::getBeginLoc(), clang::CallExpr::getBuiltinCallee(), clang::BinaryConditionalOperator::getCommon(), clang::ConditionalOperator::getCond(), clang::ConditionalOperator::getFalseExpr(), clang::BinaryConditionalOperator::getFalseExpr(), clang::ASTContext::getIntWidth(), clang::UnaryExprOrTypeTraitExpr::getKind(), clang::ASTContext::getLangOpts(), clang::BinaryOperator::getLHS(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::ConditionalOperator::getTrueExpr(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::UnaryExprOrTypeTraitExpr::getTypeOfArgument(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isIntegralOrEnumerationType(), clang::Expr::isPRValue(), clang::Type::isReferenceType(), clang::Type::isSignedIntegerOrEnumerationType(), clang::VarDecl::isUsableInConstantExpressions(), clang::Expr::isValueDependent(), clang::Type::isVariableArrayType(), NoDiag(), and Worst().
Referenced by CheckICE(), clang::Expr::isCXX98IntegralConstantExpr(), and clang::Expr::isIntegerConstantExpr().
◆ CheckLiteralType() static bool CheckLiteralType ( EvalInfo & Info, const Expr * E, const LValue * This =nullptr
) static ◆ CheckLocalVariableDeclaration() static bool CheckLocalVariableDeclaration ( EvalInfo & Info, const VarDecl * VD ) static ◆ CheckLValueConstantExpression()
Check that this reference or pointer core constant expression is a valid value for an address or reference constant expression.
Return true if we can fold this expression, whether or not it's a constant expression.
Definition at line 2345 of file ExprConstant.cpp.
References CheckEvaluationResult(), clang::FixItHint::CreateInsertion(), clang::Type::isAnyPointerType(), clang::QualType::isDestructedType(), IsGlobalLValue(), clang::Type::isReferenceType(), Loc, NoteLValueLocation(), and V.
Referenced by CheckEvaluationResult(), and clang::Expr::EvaluateAsLValue().
◆ CheckMemberPointerConstantExpression() ◆ CheckMemoryLeaks() static bool CheckMemoryLeaks ( EvalInfo & Info ) static ◆ checkNonVirtualMemberCallThisPointer() static bool checkNonVirtualMemberCallThisPointer ( EvalInfo & Info, const Expr * E, const LValue & This, const CXXMethodDecl * NamedMember ) static ◆ CheckTrivialDefaultConstructor() ◆ ComputeDynamicType() ◆ convertUnsignedAPIntToCharUnits() static bool convertUnsignedAPIntToCharUnits ( const llvm::APInt & Int, CharUnits & Result ) static ◆ determineEndOffset()Helper for tryEvaluateBuiltinObjectSize – Given an LValue, this will determine how many bytes exist from the beginning of the object to either the end of the current subobject, or the end of the object itself, depending on what the LValue looks like + the value of Type.
If this returns false, the value of Result is undefined.
Definition at line 12698 of file ExprConstant.cpp.
References addFlexibleArrayMemberInitSize(), convertUnsignedAPIntToCharUnits(), getBytesReturnedByAllocSizeCall(), clang::QualType::getNonReferenceType(), getObjectType(), HandleSizeof(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), clang::QualType::isNull(), clang::Type::isReferenceType(), isUserWritingOffTheEnd(), and refersToCompleteObject().
Referenced by tryEvaluateBuiltinObjectSize().
◆ diagnoseMutableFields()Diagnose an attempt to read from any unreadable field within the specified type, which might be a class type.
Definition at line 3760 of file ExprConstant.cpp.
References clang::CXXRecordDecl::bases(), diagnoseMutableFields(), E, clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::Expr::getType(), clang::CXXRecordDecl::hasMutableFields(), isReadByLvalueToRvalueConversion(), clang::TagDecl::isUnion(), and clang::T.
Referenced by diagnoseMutableFields(), and findSubobject().
◆ EvalPointerValueAsBool() static bool EvalPointerValueAsBool ( const APValue & Value, bool & Result ) static ◆ Evaluate()Definition at line 16508 of file ExprConstant.cpp.
References clang::C, E, EvaluateArray(), EvaluateAtomic(), EvaluateComplex(), EvaluateFloat(), EvaluateLValue(), EvaluateMemberPointer(), EvaluatePointer(), EvaluateRecord(), EvaluateVector(), EvaluateVoid(), clang::Expr::getType(), clang::Type::hasPointerRepresentation(), clang::Type::isAnyComplexType(), clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::Type::isFixedPointType(), clang::Type::isFunctionType(), clang::Expr::isGLValue(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isMemberPointerType(), clang::Type::isRealFloatingType(), clang::Type::isRecordType(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), clang::Type::isVoidType(), P, and clang::T.
Referenced by EvaluateAsBooleanCondition(), EvaluateAsRValue(), EvaluateIgnoredValue(), EvaluateInPlace(), EvaluateStmt(), clang::Expr::EvaluateWithSubstitution(), handleLValueToRValueConversion(), and clang::Expr::isPotentialConstantExprUnevaluated().
◆ EvaluateArgs() ◆ EvaluateArray() static bool EvaluateArray ( const Expr * E, const LValue & This, APValue & Result, EvalInfo & Info ) static ◆ EvaluateArrayNewConstructExpr() ◆ EvaluateArrayNewInitList() ◆ EvaluateAsBooleanCondition() static bool EvaluateAsBooleanCondition ( const Expr * E, bool & Result, EvalInfo & Info ) static ◆ EvaluateAsFixedPoint() ◆ EvaluateAsInt() ◆ EvaluateAsRValue() [1/2] ◆ EvaluateAsRValue() [2/2] static bool EvaluateAsRValue ( EvalInfo & Info, const Expr * E, APValue & Result ) staticEvaluateAsRValue - Try to evaluate this expression, performing an implicit lvalue-to-rvalue cast if it is an lvalue.
Definition at line 16622 of file ExprConstant.cpp.
References CheckConstantExpression(), CheckLiteralType(), CheckMemoryLeaks(), E, Evaluate(), clang::Expr::getExprLoc(), clang::Expr::getType(), handleLValueToRValueConversion(), clang::Expr::isGLValue(), clang::QualType::isNull(), and clang::Expr::isValueDependent().
Referenced by CheckEvalInICE(), clang::Expr::EvaluateAsBooleanCondition(), EvaluateAsFixedPoint(), clang::Expr::EvaluateAsFloat(), EvaluateAsInt(), EvaluateAsRValue(), EvaluateBuiltinConstantP(), clang::Expr::EvaluateForOverflow(), clang::Expr::EvaluateKnownConstInt(), clang::Expr::EvaluateKnownConstIntCheckOverflow(), clang::Expr::isCXX11ConstantExpr(), clang::Expr::isEvaluatable(), and tryEvaluateBuiltinObjectSize().
◆ EvaluateAtomic() static bool EvaluateAtomic ( const Expr * E, const LValue * This, APValue & Result, EvalInfo & Info ) static ◆ EvaluateBuiltinClassifyType() [1/2] ◆ EvaluateBuiltinClassifyType() [2/2] ◆ EvaluateBuiltinConstantP() static bool EvaluateBuiltinConstantP ( EvalInfo & Info, const Expr * Arg ) static ◆ EvaluateBuiltinConstantPForLValue() static bool EvaluateBuiltinConstantPForLValue ( const APValue & LV ) static ◆ EvaluateBuiltinStrLen() static bool EvaluateBuiltinStrLen ( const Expr * E, uint64_t & Result, EvalInfo & Info, std::string * StringResult =nullptr
) static
Definition at line 17842 of file ExprConstant.cpp.
References E, EvaluatePointer(), clang::APValue::getInt(), clang::Type::getPointeeType(), clang::Expr::getType(), HandleLValueArrayAdjustment(), handleLValueToRValueConversion(), clang::Type::hasPointerRepresentation(), clang::APValue::isInt(), and clang::Expr::isPRValue().
Referenced by clang::Expr::tryEvaluateString(), and clang::Expr::tryEvaluateStrLen().
◆ EvaluateCallArg() ◆ EvaluateComparisonBinaryOperator()template<class SuccessCB , class AfterCB >
static bool EvaluateComparisonBinaryOperator ( EvalInfo & Info, const BinaryOperator * E, SuccessCB && Success, AfterCB && DoAfter ) staticDefinition at line 14242 of file ExprConstant.cpp.
References ArePotentiallyOverlappingStringLiterals(), E, clang::Equal, EvaluateComplex(), EvaluateFixedPointOrInteger(), EvaluateFloat(), EvaluateInteger(), EvaluateLValue(), EvaluateMemberPointer(), EvaluatePointer(), FindDesignatorMismatch(), clang::Decl::getAccess(), clang::Expr::getFPFeaturesInEffect(), clang::FieldDecl::getParent(), clang::CharUnits::getQuantity(), clang::Expr::getType(), HasSameBase(), clang::Type::isAnyComplexType(), clang::Type::isFixedPointType(), clang::FPOptions::isFPConstrained(), IsGlobalLValue(), clang::Type::isIncompleteType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isMemberPointerType(), clang::Type::isNullPtrType(), isOnePastTheEndOfCompleteObject(), IsOpaqueConstantCall(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), clang::TagDecl::isUnion(), clang::Expr::isValueDependent(), IsWeakLValue(), isZeroSized(), clang::Reversed, and clang::Success.
◆ EvaluateComplex() static bool EvaluateComplex ( const Expr * E, ComplexValue & Res, EvalInfo & Info ) static ◆ EvaluateCond() static bool EvaluateCond ( EvalInfo & Info, const VarDecl * CondDecl, const Expr * Cond, bool & Result ) static ◆ EvaluateCPlusPlus11IntegralConstantExpr() ◆ EvaluateDecl() static bool EvaluateDecl ( EvalInfo & Info, const Decl * D ) static ◆ EvaluateDependentExpr() static bool EvaluateDependentExpr ( const Expr * E, EvalInfo & Info ) static ◆ EvaluateDestruction() ◆ EvaluateFixedPoint() static bool EvaluateFixedPoint ( const Expr * E, APFixedPoint & Result, EvalInfo & Info ) static ◆ EvaluateFixedPointOrInteger() static bool EvaluateFixedPointOrInteger ( const Expr * E, APFixedPoint & Result, EvalInfo & Info ) static ◆ EvaluateFloat() static bool EvaluateFloat ( const Expr * E, APFloat & Result, EvalInfo & Info ) static ◆ EvaluateIgnoredValue() static bool EvaluateIgnoredValue ( EvalInfo & Info, const Expr * E ) static ◆ EvaluateInPlace() static bool EvaluateInPlace ( APValue & Result, EvalInfo & Info, const LValue & This, const Expr * E, bool AllowNonLiteralTypes ) staticEvaluateInPlace - Evaluate an expression in-place in an APValue.
In some cases, the in-place evaluation is essential, since later initializers for an object can indirectly refer to subobjects which were initialized earlier.
Definition at line 16594 of file ExprConstant.cpp.
References CheckLiteralType(), E, Evaluate(), EvaluateArray(), EvaluateAtomic(), EvaluateRecord(), clang::Expr::getType(), clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::Expr::isPRValue(), clang::Type::isRecordType(), clang::Expr::isValueDependent(), and clang::T.
Referenced by clang::Expr::EvaluateAsConstantExpr(), clang::Expr::EvaluateAsInitializer(), EvaluateCallArg(), EvaluateStmt(), EvaluateVarDecl(), HandleClassZeroInitialization(), and HandleConstructorCall().
◆ EvaluateInteger() static bool EvaluateInteger ( const Expr * E, APSInt & Result, EvalInfo & Info ) staticDefinition at line 12155 of file ExprConstant.cpp.
References E, EvaluateIntegerOrLValue(), clang::APValue::getInt(), clang::APValue::isInt(), and clang::Expr::isValueDependent().
Referenced by clang::Expr::EvaluateCharRangeAsString(), EvaluateComparisonBinaryOperator(), EvaluateFixedPointOrInteger(), EvaluateSwitch(), getAlignmentArgument(), getBuiltinAlignArguments(), and HandleOperatorNewCall().
◆ EvaluateIntegerOrLValue() static bool EvaluateIntegerOrLValue ( const Expr * E, APValue & Result, EvalInfo & Info ) static ◆ EvaluateLoopBody() static EvalStmtResult EvaluateLoopBody ( StmtResult & Result, EvalInfo & Info, const Stmt * Body, const SwitchCase * Case =nullptr
) static ◆ EvaluateLValue() static bool EvaluateLValue ( const Expr * E, LValue & Result, EvalInfo & Info, bool InvalidBaseOK ) static
Evaluate an expression as an lvalue.
This can be legitimately called on expressions which are not glvalues, in three cases:
Definition at line 8872 of file ExprConstant.cpp.
References E, clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::Type::isFunctionType(), clang::Expr::isGLValue(), clang::Expr::isValueDependent(), and clang::Type::isVoidType().
Referenced by Evaluate(), clang::Expr::EvaluateAsLValue(), EvaluateComparisonBinaryOperator(), and EvaluateObjectArgument().
◆ evaluateLValueAsAllocSize()Attempts to evaluate the given LValueBase as the result of a call to a function with the alloc_size attribute.
If it was possible to do so, this function will return true, make Result's Base point to said function call, and mark Result's Base as invalid.
Definition at line 9366 of file ExprConstant.cpp.
References clang::Type::castAs(), E, clang::VarDecl::getAnyInitializer(), getPointeeType(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Init, clang::QualType::isConstQualified(), and clang::VarDecl::isLocalVarDecl().
◆ EvaluateMemberPointer() static bool EvaluateMemberPointer ( const Expr * E, MemberPtr & Result, EvalInfo & Info ) static ◆ EvaluateObjectArgument() static bool EvaluateObjectArgument ( EvalInfo & Info, const Expr * Object, LValue & This ) static ◆ EvaluatePointer() static bool EvaluatePointer ( const Expr * E, LValue & Result, EvalInfo & Info, bool InvalidBaseOK =false
) static
Definition at line 9536 of file ExprConstant.cpp.
References E, clang::Expr::getType(), clang::Type::hasPointerRepresentation(), clang::Expr::isPRValue(), and clang::Expr::isValueDependent().
Referenced by Evaluate(), EvaluateBuiltinStrLen(), clang::Expr::EvaluateCharRangeAsString(), EvaluateComparisonBinaryOperator(), EvaluateObjectArgument(), getBuiltinAlignArguments(), HandleOperatorDeleteCall(), and tryEvaluateBuiltinObjectSize().
◆ EvaluateRecord() static bool EvaluateRecord ( const Expr * E, const LValue & This, APValue & Result, EvalInfo & Info ) static ◆ EvaluateStmt() static EvalStmtResult EvaluateStmt ( StmtResult & Result, EvalInfo & Info, const Stmt * S, const SwitchCase * SC =nullptr
) static
Definition at line 5403 of file ExprConstant.cpp.
References clang::CompoundStmt::body(), CheckLocalVariableDeclaration(), D, clang::DeclStmt::decls(), E, Evaluate(), EvaluateAsBooleanCondition(), EvaluateCond(), EvaluateDecl(), EvaluateDependentExpr(), EvaluateIgnoredValue(), EvaluateInPlace(), EvaluateLoopBody(), EvaluateStmt(), EvaluateSwitch(), EvaluateVarDecl(), clang::WhileStmt::getBody(), clang::DoStmt::getBody(), clang::IfStmt::getCond(), clang::WhileStmt::getCond(), clang::DoStmt::getCond(), clang::IfStmt::getConditionVariable(), clang::WhileStmt::getConditionVariable(), clang::IfStmt::getElse(), clang::IfStmt::getInit(), clang::IfStmt::getThen(), clang::Init, clang::IfStmt::isConsteval(), clang::IfStmt::isNonNegatedConsteval(), and clang::Expr::isValueDependent().
Referenced by EvaluateLoopBody(), EvaluateStmt(), EvaluateSwitch(), HandleConstructorCall(), HandleDestructionImpl(), and HandleFunctionCall().
◆ EvaluateSwitch() static EvalStmtResult EvaluateSwitch ( StmtResult & Result, EvalInfo & Info, const SwitchStmt * SS ) staticEvaluate a switch statement.
Definition at line 5310 of file ExprConstant.cpp.
References EvaluateDecl(), EvaluateDependentExpr(), EvaluateInteger(), clang::Expr::EvaluateKnownConstInt(), EvaluateStmt(), clang::Found, clang::SwitchStmt::getBody(), clang::SwitchStmt::getCond(), clang::SwitchStmt::getConditionVariable(), clang::SwitchStmt::getInit(), clang::CaseStmt::getLHS(), clang::SwitchCase::getNextSwitchCase(), clang::CaseStmt::getRHS(), clang::SwitchStmt::getSwitchCaseList(), clang::Init, and clang::Expr::isValueDependent().
Referenced by EvaluateStmt().
◆ EvaluateTemporary() static bool EvaluateTemporary ( const Expr * E, LValue & Result, EvalInfo & Info ) static ◆ EvaluateVarDecl() static bool EvaluateVarDecl ( EvalInfo & Info, const VarDecl * VD ) static ◆ evaluateVarDeclInit()Try to evaluate the initializer for a variable declaration.
Definition at line 3468 of file ExprConstant.cpp.
References E, clang::VarDecl::evaluateValue(), clang::VarDecl::getAnyInitializer(), clang::Stmt::getBeginLoc(), clang::Decl::getDeclContext(), clang::VarDecl::getEvaluatedValue(), clang::ValueDecl::getType(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasICEInitializer(), clang::Init, clang::VarDecl::isInitCapture(), clang::isLambdaCallOperator(), clang::Type::isReferenceType(), clang::Expr::isValueDependent(), clang::ValueDecl::isWeak(), clang::VarDecl::mightBeUsableInConstantExpressions(), and NoteLValueLocation().
Referenced by findCompleteObject().
◆ EvaluateVector() static bool EvaluateVector ( const Expr * E, APValue & Result, EvalInfo & Info ) static ◆ EvaluateVoid() static bool EvaluateVoid ( const Expr * E, EvalInfo & Info ) static ◆ expandArray() ◆ expandStringLiteral() ◆ extractStringLiteralCharacter() static APSInt extractStringLiteralCharacter ( EvalInfo & Info, const Expr * Lit, uint64_t Index ) static ◆ extractSubobject() static bool extractSubobject ( EvalInfo & Info, const Expr * E, const CompleteObject & Obj, const SubobjectDesignator & Sub, APValue & Result, AccessKinds AK =AK_Read
) static ◆ FastEvaluateAsRValue() ◆ findCompleteObject() static CompleteObject findCompleteObject ( EvalInfo & Info, const Expr * E, AccessKinds AK, const LValue & LVal, QualType LValType ) static
Find the complete object to which an LValue refers.
Definition at line 4282 of file ExprConstant.cpp.
References D, E, evaluateVarDeclInit(), clang::APValue::getAsString(), clang::VarDecl::getDefinition(), clang::Decl::getLocation(), clang::VarDecl::hasDefinition(), isAnyAccess(), clang::QualType::isConstant(), clang::VarDecl::isConstexpr(), isFormalAccess(), clang::Type::isIntegralOrEnumerationType(), clang::Decl::isInvalidDecl(), clang::Type::isLiteralType(), isModification(), clang::QualType::isVolatileQualified(), lifetimeStartedInEvaluation(), NoteLValueLocation(), clang::SD_Static, and V.
Referenced by checkDynamicType(), handleAssignment(), handleCompoundAssignment(), HandleDestruction(), handleIncDec(), handleLValueToRValueConversion(), and MaybeHandleUnionActiveMemberChange().
◆ FindDesignatorMismatch() static unsigned FindDesignatorMismatch ( QualType ObjType, const SubobjectDesignator & A, const SubobjectDesignator & B, bool & WasArrayIndex ) static ◆ findSubobject()template<typename SubobjectHandler >
static SubobjectHandler::result_type findSubobject ( EvalInfo & Info, const Expr * E, const CompleteObject & Obj, const SubobjectDesignator & Sub, SubobjectHandler & handler ) staticFind the designated sub-object of an rvalue.
Definition at line 3894 of file ExprConstant.cpp.
References clang::AK_Construct, clang::AK_IsWithinLifetime, clang::APValue::allowConstexprUnknown(), clang::Type::castAs(), CheckArraySize(), diagnoseMutableFields(), E, expandArray(), clang::APValue::getArrayFiller(), clang::APValue::getArrayInitializedElt(), clang::APValue::getArrayInitializedElts(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), getBaseIndex(), clang::FieldDecl::getCanonicalDecl(), clang::QualType::getCanonicalType(), clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::ComplexType::getElementType(), clang::ArrayType::getElementType(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::ConstantArrayType::getSize(), clang::Stmt::getSourceRange(), clang::APValue::getStructBase(), clang::APValue::getStructField(), getSubobjectType(), clang::APValue::getUnionField(), clang::APValue::getUnionValue(), clang::APValue::getVectorElt(), clang::APValue::hasValue(), clang::APValue::isAbsent(), clang::Type::isAnyComplexType(), clang::Type::isArrayType(), clang::FieldDecl::isBitField(), clang::APValue::isComplexFloat(), clang::APValue::isComplexInt(), clang::QualType::isConstQualified(), isFormalAccess(), clang::APValue::isIndeterminate(), isModification(), isRead(), clang::Type::isRecordType(), clang::TagDecl::isUnion(), isValidIndeterminateAccess(), clang::QualType::isVolatileQualified(), Loc, clang::QualType::removeLocalConst(), clang::QualType::removeLocalVolatile(), clang::APValue::setUnion(), and truncateBitfieldValue().
Referenced by checkDynamicType(), extractSubobject(), handleCompoundAssignment(), HandleDestruction(), handleIncDec(), MaybeHandleUnionActiveMemberChange(), and modifySubobject().
◆ getActiveRoundingMode() static llvm::RoundingMode getActiveRoundingMode ( EvalInfo & Info, const Expr * E ) static ◆ getAlignmentArgument() ◆ GetAlignOfExpr() ◆ GetAlignOfType() ◆ getBaseAlignment() static CharUnits getBaseAlignment ( EvalInfo & Info, const LValue & Value ) static ◆ getBaseClassType() ◆ getBaseIndex() ◆ getBuiltinAlignArguments() ◆ getBytesReturnedByAllocSizeCall() [1/2] static bool getBytesReturnedByAllocSizeCall ( const ASTContext & Ctx, const CallExpr * Call, llvm::APInt & Result ) static ◆ getBytesReturnedByAllocSizeCall() [2/2] static bool getBytesReturnedByAllocSizeCall ( const ASTContext & Ctx, const LValue & LVal, llvm::APInt & Result ) static ◆ GetLValueBaseAsString() static bool GetLValueBaseAsString ( const EvalInfo & Info, const LValue & LVal, LValueBaseString & AsString ) static ◆ GetLValueBaseDecl() static const ValueDecl * GetLValueBaseDecl ( const LValue & LVal ) static ◆ getObjectType()Retrieves the "underlying object type" of the given expression, as used by __builtin_object_size.
Definition at line 12478 of file ExprConstant.cpp.
References D, clang::APValue::LValueBase::dyn_cast(), E, clang::APValue::LValueBase::getDynamicAllocType(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::APValue::LValueBase::getTypeInfoType(), and clang::APValue::LValueBase::is().
Referenced by clang::SemaObjC::checkInitMethod(), determineEndOffset(), clang::ObjCObjectPointerType::getInterfaceDecl(), clang::ObjCObjectPointerType::getNumProtocols(), clang::ObjCObjectPointerType::getProtocol(), clang::ObjCObjectPointerType::getTypeArgs(), clang::ObjCObjectPointerType::getTypeArgsAsWritten(), clang::ObjCObjectPointerType::isKindOfType(), clang::ObjCObjectPointerType::isObjCClassType(), clang::ObjCObjectPointerType::isObjCIdOrClassType(), clang::ObjCObjectPointerType::isObjCIdType(), clang::ObjCObjectPointerType::isObjCQualifiedClassType(), clang::ObjCObjectPointerType::isObjCQualifiedIdType(), clang::ObjCObjectPointerType::isSpecialized(), clang::ObjCObjectPointerType::isSpecializedAsWritten(), clang::ObjCObjectPointerType::isUnspecialized(), clang::ObjCObjectPointerType::qual_begin(), clang::ObjCObjectPointerType::qual_empty(), and clang::ObjCObjectPointerType::qual_end().
◆ getSubobjectType() ◆ getVirtualOperatorDelete() ◆ handleAssignment() static bool handleAssignment ( EvalInfo & Info, const Expr * E, const LValue & LVal, QualType LValType, APValue & Val ) static ◆ HandleBaseToDerivedCast() static bool HandleBaseToDerivedCast ( EvalInfo & Info, const CastExpr * E, LValue & Result ) static ◆ HandleClassZeroInitialization() static bool HandleClassZeroInitialization ( EvalInfo & Info, const Expr * E, const RecordDecl * RD, const LValue & This, APValue & Result ) staticPerform zero-initialization on an object of non-union class type.
C++11 [dcl.init]p5: To zero-initialize an object or reference of type T means: [...] – if T is a (possibly cv-qualified) non-union class type, each non-static data member and each base-class subobject is zero-initialized
Definition at line 10586 of file ExprConstant.cpp.
References clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), E, EvaluateInPlace(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::RecordDecl::fields(), clang::CXXRecordDecl::getNumBases(), HandleClassZeroInitialization(), HandleLValueDirectBase(), HandleLValueMember(), clang::Decl::isInvalidDecl(), and clang::TagDecl::isUnion().
Referenced by HandleClassZeroInitialization().
◆ handleCompareOpForVector() ◆ handleCompareOpForVectorHelper()template<typename APTy >
static bool handleCompareOpForVectorHelper ( const APTy & LHSValue, BinaryOperatorKind Opcode, const APTy & RHSValue, APInt & Result ) static ◆ HandleComplexComplexDiv() void HandleComplexComplexDiv ( APFloat A, APFloat B, APFloat C, APFloat D, APFloat & ResR, APFloat & ResI ) ◆ HandleComplexComplexMul() void HandleComplexComplexMul ( APFloat A, APFloat B, APFloat C, APFloat D, APFloat & ResR, APFloat & ResI ) ◆ handleCompoundAssignment() ◆ HandleConstructorCall() [1/2] ◆ HandleConstructorCall() [2/2]Evaluate a constructor call.
Definition at line 6615 of file ExprConstant.cpp.
References clang::CXXRecordDecl::bases_begin(), clang::C, clang::Call, clang::declaresSameEntity(), clang::Definition, E, EvaluateDependentExpr(), EvaluateInPlace(), EvaluateStmt(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::Type::getAsCXXRecordDecl(), clang::Expr::getExprLoc(), clang::FieldDecl::getFieldIndex(), clang::CXXRecordDecl::getNumBases(), clang::CXXRecordDecl::getNumVBases(), clang::FieldDecl::getParent(), clang::Stmt::getSourceRange(), clang::CXXBaseSpecifier::getType(), handleDefaultInitValue(), HandleLValueDirectBase(), HandleLValueMember(), handleTrivialCopy(), clang::Value::hasValue(), Indirect, clang::Init, clang::FieldDecl::isBitField(), clang::Decl::isInvalidDecl(), isReadByLvalueToRvalueConversion(), clang::TagDecl::isUnion(), clang::CXXBaseSpecifier::isVirtual(), clang::Success, and truncateBitfieldValue().
Referenced by HandleConstructorCall(), and clang::Expr::isPotentialConstantExpr().
◆ HandleConversionToBool()Definition at line 2717 of file ExprConstant.cpp.
References clang::APValue::AddrLabelDiff, clang::APValue::Array, clang::APValue::ComplexFloat, clang::APValue::ComplexInt, EvalPointerValueAsBool(), clang::APValue::FixedPoint, clang::APValue::Float, clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::APValue::getFixedPoint(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getKind(), clang::APValue::getMemberPointerDecl(), clang::APValue::Indeterminate, clang::APValue::Int, clang::ValueDecl::isWeak(), clang::APValue::LValue, clang::APValue::MemberPointer, clang::APValue::None, clang::APValue::Struct, clang::APValue::Union, and clang::APValue::Vector.
Referenced by clang::Expr::EvaluateAsBooleanCondition(), and EvaluateAsBooleanCondition().
◆ HandleCovariantReturnAdjustment()Perform the adjustment from a value returned by a virtual function to a value of the statically expected type, which may be a pointer or reference to a base class of the returned type.
Definition at line 6184 of file ExprConstant.cpp.
References CastToBaseClass(), E, and Path.
◆ handleDefaultInitValue() ◆ HandleDestruction() [1/2] static bool HandleDestruction ( EvalInfo & Info, const Expr * E, const LValue & This, QualType ThisType ) static ◆ HandleDestruction() [2/2] ◆ HandleDestructionImpl()Definition at line 6842 of file ExprConstant.cpp.
References clang::CXXRecordDecl::bases(), CheckArraySize(), CheckConstexprFunction(), clang::Definition, EvaluateStmt(), expandArray(), clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::APValue::getAsString(), clang::SourceRange::getBegin(), clang::FunctionDecl::getBody(), clang::CXXRecordDecl::getDestructor(), clang::ArrayType::getElementType(), clang::CXXRecordDecl::getNumBases(), clang::CXXRecordDecl::getNumVBases(), clang::ConstantArrayType::getZExtSize(), HandleDestructionImpl(), HandleLValueArrayAdjustment(), HandleLValueDirectBase(), HandleLValueMember(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::Type::isNullPtrType(), clang::FunctionDecl::isTrivial(), clang::TagDecl::isUnion(), clang::T, and clang::VK_PRValue.
Referenced by HandleDestruction(), and HandleDestructionImpl().
◆ HandleDynamicCast()Apply the given dynamic cast operation on the provided lvalue.
This implements the hard case of dynamic_cast, requiring a "runtime check" to find a suitable target subobject.
Definition at line 6225 of file ExprConstant.cpp.
References clang::AK_DynamicCast, clang::AS_public, clang::C, CastToDerivedClass(), clang::Class, ComputeDynamicType(), D, clang::declaresSameEntity(), E, getBaseClassType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), HandleLValueBase(), isBaseClassPublic(), clang::Expr::isGLValue(), and clang::Type::isVoidPointerType().
◆ handleFloatFloatBinOp() ◆ HandleFloatToFloatCast() static bool HandleFloatToFloatCast ( EvalInfo & Info, const Expr * E, QualType SrcType, QualType DestType, APFloat & Result ) static ◆ HandleFloatToIntCast() ◆ HandleFunctionCall()Evaluate a function call.
Definition at line 6560 of file ExprConstant.cpp.
References clang::Call, E, EvaluateStmt(), clang::CXXRecordDecl::getCaptureFields(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Stmt::getSourceRange(), clang::CXXMethodDecl::getThisType(), handleAssignment(), handleTrivialCopy(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::FunctionDecl::isDefaulted(), clang::isLambdaCallOperator(), clang::CXXMethodDecl::isMoveAssignmentOperator(), isReadByLvalueToRvalueConversion(), clang::FunctionDecl::isTrivial(), and clang::TagDecl::isUnion().
Referenced by clang::Expr::isPotentialConstantExpr().
◆ handleIncDec() ◆ handleIntIntBinOp() ◆ HandleIntToFloatCast() ◆ HandleIntToIntCast() ◆ HandleLambdaCapture() ◆ handleLogicalOpForVector() [1/3] ◆ handleLogicalOpForVector() [2/3] static bool handleLogicalOpForVector ( const APInt & LHSValue, BinaryOperatorKind Opcode, const APInt & RHSValue, APInt & Result ) static ◆ handleLogicalOpForVector() [3/3] ◆ HandleLValueArrayAdjustment() [1/2] static bool HandleLValueArrayAdjustment ( EvalInfo & Info, const Expr * E, LValue & LVal, QualType EltTy, APSInt Adjustment ) static ◆ HandleLValueArrayAdjustment() [2/2] static bool HandleLValueArrayAdjustment ( EvalInfo & Info, const Expr * E, LValue & LVal, QualType EltTy, int64_t Adjustment ) static ◆ HandleLValueBase() ◆ HandleLValueBasePath() static bool HandleLValueBasePath ( EvalInfo & Info, const CastExpr * E, QualType Type, LValue & Result ) static ◆ HandleLValueComplexElement() static bool HandleLValueComplexElement ( EvalInfo & Info, const Expr * E, LValue & LVal, QualType EltTy, bool Imag ) staticUpdate an lvalue to refer to a component of a complex number.
Definition at line 3433 of file ExprConstant.cpp.
References E, clang::Expr::getExprLoc(), and HandleSizeof().
◆ HandleLValueDirectBase() ◆ HandleLValueIndirectMember() ◆ HandleLValueMember() ◆ handleLValueToRValueConversion() static bool handleLValueToRValueConversion ( EvalInfo & Info, const Expr * Conv, QualType Type, const LValue & LVal, APValue & RVal, bool WantObjectRepresentation =false
) static
Perform an lvalue-to-rvalue conversion on the given glvalue.
This can also be used for 'lvalue-to-lvalue' conversions for looking up the glvalue referred to by an entity of reference type.
Definition at line 4565 of file ExprConstant.cpp.
References clang::AK_Read, clang::AK_ReadObjectRepresentation, Evaluate(), extractStringLiteralCharacter(), extractSubobject(), findCompleteObject(), clang::Type::isArrayType(), and clang::QualType::isConstant().
Referenced by EvaluateAsRValue(), EvaluateBuiltinStrLen(), clang::Expr::EvaluateCharRangeAsString(), HandleLambdaCapture(), and handleTrivialCopy().
◆ HandleLValueVectorElement() static bool HandleLValueVectorElement ( EvalInfo & Info, const Expr * E, LValue & LVal, QualType EltTy, uint64_t Size, uint64_t Idx ) static ◆ HandleMemberPointerAccess() [1/2] ◆ HandleMemberPointerAccess() [2/2] static const ValueDecl * HandleMemberPointerAccess ( EvalInfo & Info, QualType LVType, LValue & LV, const Expr * RHS, bool IncludeMember =true
) static ◆ HandleOperatorDeleteCall() static bool HandleOperatorDeleteCall ( EvalInfo & Info, const CallExpr * E ) static ◆ HandleOperatorNewCall() static bool HandleOperatorNewCall ( EvalInfo & Info, const CallExpr * E, LValue & Result ) static
Perform a call to 'operator new' or to ‘__builtin_operator_new’.
Definition at line 7065 of file ExprConstant.cpp.
References E, EvaluateIgnoredValue(), EvaluateInteger(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::CharUnits::getQuantity(), clang::Expr::getType(), HandleSizeof(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), and clang::Type::isNothrowT().
◆ HandleOverflow()template<typename T >
static bool HandleOverflow ( EvalInfo & Info, const Expr * E, const T & SrcValue, QualType DestType ) static ◆ HandleSizeof() ◆ handleTrivialCopy() ◆ handleVectorElementCast() ◆ handleVectorShuffle() ◆ handleVectorUnaryOperator() ◆ handleVectorVectorBinOp()Definition at line 3177 of file ExprConstant.cpp.
References clang::Type::castAs(), E, clang::APValue::Float, clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getKind(), clang::VectorType::getNumElements(), clang::Expr::getType(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), handleCompareOpForVector(), handleFloatFloatBinOp(), handleIntIntBinOp(), handleLogicalOpForVector(), clang::BinaryOperator::isComparisonOp(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::BinaryOperator::isLogicalOp(), clang::APValue::isLValue(), clang::Type::isUnsignedIntegerType(), clang::APValue::isVector(), and clang::Success.
◆ HandleVirtualDispatch() ◆ HasSameBase() static bool HasSameBase ( const LValue & A, const LValue & B ) static ◆ hasUnacceptableSideEffect() ◆ hasVirtualDestructor() ◆ ignorePointerCastsAndParens() static const Expr * ignorePointerCastsAndParens ( const Expr * E ) static ◆ isAnyAccess() ◆ isBaseClassPublic() ◆ IsDeclSourceLocationCurrent() ◆ isDesignatorAtObjectEnd() static bool isDesignatorAtObjectEnd ( const ASTContext & Ctx, const LValue & LVal ) staticChecks to see if the given LValue's Designator is at the end of the LValue's record layout.
e.g. struct { struct { int a, b; } fst, snd; } obj; obj.fst // no obj.snd // yes obj.fst.a // no obj.fst.b // no obj.snd.a // no obj.snd.b // yes
Please note: this function is specialized for how __builtin_object_size views "objects".
If this encounters an invalid RecordDecl or otherwise cannot determine the correct result, it will always return true.
Definition at line 12536 of file ExprConstant.cpp.
References clang::Type::castAs(), E, clang::ASTContext::getAsArrayType(), clang::ASTContext::getASTRecordLayout(), clang::ArrayType::getElementType(), clang::ASTRecordLayout::getFieldCount(), clang::FieldDecl::getFieldIndex(), clang::FieldDecl::getParent(), getPointeeType(), clang::ValueDecl::getType(), clang::ConstantArrayType::getZExtSize(), clang::Invalid, clang::Type::isAnyComplexType(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), and Parent.
Referenced by isUserWritingOffTheEnd().
◆ isFormalAccess() ◆ IsGlobalLValue()Definition at line 2103 of file ExprConstant.cpp.
References D, clang::APValue::LValueBase::dyn_cast(), E, clang::APValue::LValueBase::get(), clang::Stmt::getStmtClass(), clang::APValue::LValueBase::is(), clang::CompoundLiteralExpr::isFileScope(), clang::Expr::isLValue(), IsOpaqueConstantCall(), and clang::SD_Static.
Referenced by CheckLValueConstantExpression(), EvaluateComparisonBinaryOperator(), and clang::Expr::EvalResult::isGlobalLValue().
◆ isModification()Definition at line 1536 of file ExprConstant.cpp.
References clang::AK_Assign, clang::AK_Construct, clang::AK_Decrement, clang::AK_Destroy, clang::AK_DynamicCast, clang::AK_Increment, clang::AK_IsWithinLifetime, clang::AK_MemberCall, clang::AK_Read, clang::AK_ReadObjectRepresentation, and clang::AK_TypeId.
Referenced by findCompleteObject(), findSubobject(), and isAnyAccess().
◆ isOneByteCharacterType() ◆ isOnePastTheEndOfCompleteObject() static bool isOnePastTheEndOfCompleteObject ( const ASTContext & Ctx, const LValue & LV ) static ◆ IsOpaqueConstantCall() [1/2] ◆ IsOpaqueConstantCall() [2/2] static bool IsOpaqueConstantCall ( const LValue & LVal ) static ◆ isRead() ◆ isReadByLvalueToRvalueConversion() [1/2] ◆ isReadByLvalueToRvalueConversion() [2/2] ◆ isUserWritingOffTheEnd() static bool isUserWritingOffTheEnd ( const ASTContext & Ctx, const LValue & LVal ) static ◆ isValidIndeterminateAccess()Is this kind of axcess valid on an indeterminate object value?
Definition at line 1566 of file ExprConstant.cpp.
References clang::AK_Assign, clang::AK_Construct, clang::AK_Decrement, clang::AK_Destroy, clang::AK_DynamicCast, clang::AK_Increment, clang::AK_IsWithinLifetime, clang::AK_MemberCall, clang::AK_Read, clang::AK_ReadObjectRepresentation, and clang::AK_TypeId.
Referenced by findSubobject().
◆ IsWeakLValue() static bool IsWeakLValue ( const LValue & Value ) static ◆ isZeroSized() static bool isZeroSized ( const LValue & Value ) static ◆ lifetimeStartedInEvaluation() ◆ MaybeElementDependentArrayFiller() static bool MaybeElementDependentArrayFiller ( const Expr * FillerExpr ) static ◆ MaybeHandleUnionActiveMemberChange() static bool MaybeHandleUnionActiveMemberChange ( EvalInfo & Info, const Expr * LHSExpr, const LValue & LHS ) static ◆ modifySubobject() static bool modifySubobject ( EvalInfo & Info, const Expr * E, const CompleteObject & Obj, const SubobjectDesignator & Sub, APValue & NewVal ) static ◆ negateAsSigned() static void negateAsSigned ( APSInt & Int ) staticNegate an APSInt in place, converting it to a signed form if necessary, and preserving its value (by extending by up to one bit as needed).
Definition at line 1943 of file ExprConstant.cpp.
◆ NoDiag() static ICEDiag NoDiag ( ) static ◆ NoteLValueLocation() ◆ refersToCompleteObject() static bool refersToCompleteObject ( const LValue & LVal ) staticTests to see if the LValue has a user-specified designator (that isn't necessarily valid).
Note that this always returns 'true' if the LValue has an unsized array as its first designator entry, because there's currently no way to tell if the user typed *foo or foo[0].
Definition at line 12610 of file ExprConstant.cpp.
References E.
Referenced by determineEndOffset().
◆ truncateBitfieldValue() ◆ TryEvaluateBuiltinNaN() ◆ tryEvaluateBuiltinObjectSize() static bool tryEvaluateBuiltinObjectSize ( const Expr * E, unsigned Type, EvalInfo & Info, uint64_t & Size ) static ◆ Worst() static ICEDiag Worst ( ICEDiag A, ICEDiag B ) staticRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4