Lines Matching refs:LVal
2028 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { in GetLValueBaseDecl() argument
2029 return LVal.Base.dyn_cast<const ValueDecl*>(); in GetLValueBaseDecl()
2122 QualType Type, const LValue &LVal, in CheckLValueConstantExpression() argument
2127 APValue::LValueBase Base = LVal.getLValueBase(); in CheckLValueConstantExpression()
2128 const SubobjectDesignator &Designator = LVal.getLValueDesignator(); in CheckLValueConstantExpression()
2198 LVal.getLValueCallIndex() == 0) && in CheckLValueConstantExpression()
2398 LValue LVal; in CheckEvaluationResult() local
2399 LVal.setFrom(Info.Ctx, Value); in CheckEvaluationResult()
2400 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind, in CheckEvaluationResult()
3121 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal, in HandleLValueMember() argument
3130 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I))); in HandleLValueMember()
3131 LVal.addDecl(Info, E, FD); in HandleLValueMember()
3137 LValue &LVal, in HandleLValueIndirectMember() argument
3140 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C))) in HandleLValueIndirectMember()
3178 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3184 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee); in HandleLValueArrayAdjustment()
3189 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3191 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy, in HandleLValueArrayAdjustment()
3201 LValue &LVal, QualType EltTy, in HandleLValueComplexElement() argument
3207 LVal.Offset += SizeOfComponent; in HandleLValueComplexElement()
3209 LVal.addComplex(Info, E, EltTy, Imag); in HandleLValueComplexElement()
3947 AccessKinds AK, const LValue &LVal, in findCompleteObject() argument
3949 if (LVal.InvalidBase) { in findCompleteObject()
3954 if (!LVal.Base) { in findCompleteObject()
3961 if (LVal.getLValueCallIndex()) { in findCompleteObject()
3963 Info.getCallFrameAndDepth(LVal.getLValueCallIndex()); in findCompleteObject()
3966 << AK << LVal.Base.is<const ValueDecl*>(); in findCompleteObject()
3967 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
3989 QualType BaseType = getType(LVal.Base); in findCompleteObject()
3991 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && in findCompleteObject()
3992 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
3996 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) { in findCompleteObject()
4010 return CompleteObject(LVal.Base, &V, GD->getType()); in findCompleteObject()
4019 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()), in findCompleteObject()
4050 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4063 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4073 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4105 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal)) in findCompleteObject()
4107 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) { in findCompleteObject()
4113 return CompleteObject(LVal.Base, &(*Alloc)->Value, in findCompleteObject()
4114 LVal.Base.getDynamicAllocType()); in findCompleteObject()
4116 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in findCompleteObject()
4150 !lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4152 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4162 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4164 LVal.moveInto(Val); in findCompleteObject()
4169 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4173 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); in findCompleteObject()
4187 LVal.Base.dyn_cast<const ValueDecl *>())) in findCompleteObject()
4194 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType); in findCompleteObject()
4213 const LValue &LVal, APValue &RVal, in handleLValueToRValueConversion() argument
4215 if (LVal.Designator.Invalid) in handleLValueToRValueConversion()
4219 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in handleLValueToRValueConversion()
4224 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { in handleLValueToRValueConversion()
4236 CompleteObject LitObj(LVal.Base, &Lit, Base->getType()); in handleLValueToRValueConversion()
4237 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4241 assert(LVal.Designator.Entries.size() <= 1 && in handleLValueToRValueConversion()
4243 if (LVal.Designator.Entries.empty()) { in handleLValueToRValueConversion()
4250 if (LVal.Designator.isOnePastTheEnd()) { in handleLValueToRValueConversion()
4257 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex(); in handleLValueToRValueConversion()
4263 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type); in handleLValueToRValueConversion()
4264 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4268 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleAssignment() argument
4270 if (LVal.Designator.Invalid) in handleAssignment()
4278 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleAssignment()
4279 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val); in handleAssignment()
4394 LValue LVal; in foundPointer() local
4395 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4396 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset)) in foundPointer()
4398 LVal.moveInto(Subobj); in foundPointer()
4409 const LValue &LVal, QualType LValType, in handleCompoundAssignment() argument
4413 if (LVal.Designator.Invalid) in handleCompoundAssignment()
4421 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleCompoundAssignment()
4424 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleCompoundAssignment()
4543 LValue LVal; in foundPointer() local
4544 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4545 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, in foundPointer()
4548 LVal.moveInto(Subobj); in foundPointer()
4555 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleIncDec() argument
4557 if (LVal.Designator.Invalid) in handleIncDec()
4566 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType); in handleIncDec()
4568 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleIncDec()
5712 LValue LVal; in HandleCovariantReturnAdjustment() local
5713 LVal.setFrom(Info.Ctx, Result); in HandleCovariantReturnAdjustment()
5720 !CastToBaseClass(Info, E, LVal, OldClass, NewClass)) in HandleCovariantReturnAdjustment()
5725 LVal.moveInto(Result); in HandleCovariantReturnAdjustment()
7807 LValue LVal; in VisitCastExpr() local
7808 if (!EvaluateLValue(E->getSubExpr(), LVal, Info)) in VisitCastExpr()
7813 LVal, RVal)) in VisitCastExpr()
7847 LValue LVal; in VisitUnaryPostIncDec() local
7848 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info)) in VisitUnaryPostIncDec()
7851 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(), in VisitUnaryPostIncDec()
8523 const LValue &LVal, in getBytesReturnedByAllocSizeCall() argument
8525 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) && in getBytesReturnedByAllocSizeCall()
8527 const auto *Base = LVal.getLValueBase().get<const Expr *>(); in getBytesReturnedByAllocSizeCall()
8848 LValue LVal; in VisitCastExpr() local
8849 if (!evaluateLValue(E->getSubExpr(), LVal)) in VisitCastExpr()
8855 LVal, RVal)) in VisitCastExpr()
8857 evaluateLValueAsAllocSize(Info, LVal.Base, Result); in VisitCastExpr()
11236 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) { in isDesignatorAtObjectEnd() argument
11237 assert(!LVal.Designator.Invalid); in isDesignatorAtObjectEnd()
11248 auto &Base = LVal.getLValueBase(); in isDesignatorAtObjectEnd()
11265 if (LVal.Designator.FirstEntryIsAnUnsizedArray) { in isDesignatorAtObjectEnd()
11275 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) { in isDesignatorAtObjectEnd()
11276 const auto &Entry = LVal.Designator.Entries[I]; in isDesignatorAtObjectEnd()
11310 static bool refersToCompleteObject(const LValue &LVal) { in refersToCompleteObject() argument
11311 if (LVal.Designator.Invalid) in refersToCompleteObject()
11314 if (!LVal.Designator.Entries.empty()) in refersToCompleteObject()
11315 return LVal.Designator.isMostDerivedAnUnsizedArray(); in refersToCompleteObject()
11317 if (!LVal.InvalidBase) in refersToCompleteObject()
11322 const auto *E = LVal.Base.dyn_cast<const Expr *>(); in refersToCompleteObject()
11328 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) { in isUserWritingOffTheEnd() argument
11329 const SubobjectDesignator &Designator = LVal.Designator; in isUserWritingOffTheEnd()
11341 return LVal.InvalidBase && in isUserWritingOffTheEnd()
11344 isDesignatorAtObjectEnd(Ctx, LVal); in isUserWritingOffTheEnd()
11365 unsigned Type, const LValue &LVal, in determineEndOffset() argument
11367 bool DetermineForCompleteObject = refersToCompleteObject(LVal); in determineEndOffset()
11378 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) { in determineEndOffset()
11384 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11385 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11388 if (LVal.InvalidBase) in determineEndOffset()
11391 QualType BaseTy = getObjectType(LVal.getLValueBase()); in determineEndOffset()
11396 const SubobjectDesignator &Designator = LVal.Designator; in determineEndOffset()
11405 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) { in determineEndOffset()
11409 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11410 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11437 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining; in determineEndOffset()
11449 LValue LVal; in tryEvaluateBuiltinObjectSize() local
11463 LVal.setFrom(Info.Ctx, RVal); in tryEvaluateBuiltinObjectSize()
11464 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info, in tryEvaluateBuiltinObjectSize()
11471 if (LVal.getLValueOffset().isNegative()) { in tryEvaluateBuiltinObjectSize()
11477 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset)) in tryEvaluateBuiltinObjectSize()
11482 if (EndOffset <= LVal.getLValueOffset()) in tryEvaluateBuiltinObjectSize()
11485 Size = (EndOffset - LVal.getLValueOffset()).getQuantity(); in tryEvaluateBuiltinObjectSize()
12356 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index, in addOrSubLValueAsInteger() argument
12361 assert(!LVal.hasLValuePath() && "have designator for integer lvalue"); in addOrSubLValueAsInteger()
12362 CharUnits &Offset = LVal.getLValueOffset(); in addOrSubLValueAsInteger()
14841 LValue LVal; in EvaluateDestruction() local
14842 LVal.set(Base); in EvaluateDestruction()
14875 LValue LVal; in EvaluateAsConstantExpr() local
14876 LVal.set(Base); in EvaluateAsConstantExpr()
14878 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) || Result.HasSideEffects) in EvaluateAsConstantExpr()
14933 LValue LVal; in EvaluateAsInitializer() local
14934 LVal.set(VD); in EvaluateAsInitializer()
14936 if (!EvaluateInPlace(Value, Info, LVal, this, in EvaluateAsInitializer()