Lines Matching refs:LVal

2028 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) {
2029 return LVal.Base.dyn_cast<const ValueDecl*>();
2122 QualType Type, const LValue &LVal,
2127 APValue::LValueBase Base = LVal.getLValueBase();
2128 const SubobjectDesignator &Designator = LVal.getLValueDesignator();
2198 LVal.getLValueCallIndex() == 0) &&
2398 LValue LVal;
2399 LVal.setFrom(Info.Ctx, Value);
2400 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind,
3119 /// Update LVal to refer to the given field, which must be a member of the type
3120 /// currently described by LVal.
3121 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal,
3130 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I)));
3131 LVal.addDecl(Info, E, FD);
3135 /// Update LVal to refer to the given indirect field.
3137 LValue &LVal,
3140 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C)))
3174 /// \param LVal - The pointer value to be updated.
3175 /// \param EltTy - The pointee type represented by LVal.
3178 LValue &LVal, QualType EltTy,
3184 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee);
3189 LValue &LVal, QualType EltTy,
3191 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy,
3197 /// \param LVal - The lvalue to be updated.
3201 LValue &LVal, QualType EltTy,
3207 LVal.Offset += SizeOfComponent;
3209 LVal.addComplex(Info, E, EltTy, Imag);
3944 AccessKinds AK, const LValue &LVal,
3946 if (LVal.InvalidBase) {
3951 if (!LVal.Base) {
3958 if (LVal.getLValueCallIndex()) {
3960 Info.getCallFrameAndDepth(LVal.getLValueCallIndex());
3963 << AK << LVal.Base.is<const ValueDecl*>();
3964 NoteLValueLocation(Info, LVal.Base);
3986 QualType BaseType = getType(LVal.Base);
3988 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl &&
3989 lifetimeStartedInEvaluation(Info, LVal.Base)) {
3993 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {
4007 return CompleteObject(LVal.Base, &V, GD->getType());
4016 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()),
4047 lifetimeStartedInEvaluation(Info, LVal.Base)) {
4060 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4070 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4102 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal))
4104 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {
4110 return CompleteObject(LVal.Base, &(*Alloc)->Value,
4111 LVal.Base.getDynamicAllocType());
4113 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4147 !lifetimeStartedInEvaluation(Info, LVal.Base)) {
4149 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4159 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4161 LVal.moveInto(Val);
4166 NoteLValueLocation(Info, LVal.Base);
4170 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion());
4184 LVal.Base.dyn_cast<const ValueDecl *>()))
4191 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType);
4203 /// \param LVal - The glvalue on which we are attempting to perform this action.
4210 const LValue &LVal, APValue &RVal,
4212 if (LVal.Designator.Invalid)
4216 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4221 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) {
4233 CompleteObject LitObj(LVal.Base, &Lit, Base->getType());
4234 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK);
4238 assert(LVal.Designator.Entries.size() <= 1 &&
4240 if (LVal.Designator.Entries.empty()) {
4247 if (LVal.Designator.isOnePastTheEnd()) {
4254 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex();
4260 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type);
4261 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK);
4264 /// Perform an assignment of Val to LVal. Takes ownership of Val.
4265 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal,
4267 if (LVal.Designator.Invalid)
4275 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4276 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val);
4391 LValue LVal;
4392 LVal.setFrom(Info.Ctx, Subobj);
4393 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset))
4395 LVal.moveInto(Subobj);
4403 /// Perform a compound assignment of LVal <op>= RVal.
4406 const LValue &LVal, QualType LValType,
4410 if (LVal.Designator.Invalid)
4418 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4421 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
4540 LValue LVal;
4541 LVal.setFrom(Info.Ctx, Subobj);
4542 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType,
4545 LVal.moveInto(Subobj);
4551 /// Perform an increment or decrement on LVal.
4552 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal,
4554 if (LVal.Designator.Invalid)
4563 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType);
4565 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
5709 LValue LVal;
5710 LVal.setFrom(Info.Ctx, Result);
5717 !CastToBaseClass(Info, E, LVal, OldClass, NewClass))
5722 LVal.moveInto(Result);
7804 LValue LVal;
7805 if (!EvaluateLValue(E->getSubExpr(), LVal, Info))
7810 LVal, RVal))
7844 LValue LVal;
7845 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info))
7848 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(),
8517 /// Convenience function. LVal's base must be a call to an alloc_size
8520 const LValue &LVal,
8522 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
8524 const auto *Base = LVal.getLValueBase().get<const Expr *>();
8825 LValue LVal;
8826 if (!evaluateLValue(E->getSubExpr(), LVal))
8832 LVal, RVal))
8834 evaluateLValueAsAllocSize(Info, LVal.Base, Result);
11201 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) {
11202 assert(!LVal.Designator.Invalid);
11213 auto &Base = LVal.getLValueBase();
11230 if (LVal.Designator.FirstEntryIsAnUnsizedArray) {
11240 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) {
11241 const auto &Entry = LVal.Designator.Entries[I];
11275 static bool refersToCompleteObject(const LValue &LVal) {
11276 if (LVal.Designator.Invalid)
11279 if (!LVal.Designator.Entries.empty())
11280 return LVal.Designator.isMostDerivedAnUnsizedArray();
11282 if (!LVal.InvalidBase)
11287 const auto *E = LVal.Base.dyn_cast<const Expr *>();
11293 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) {
11294 const SubobjectDesignator &Designator = LVal.Designator;
11306 return LVal.InvalidBase &&
11309 isDesignatorAtObjectEnd(Ctx, LVal);
11330 unsigned Type, const LValue &LVal,
11332 bool DetermineForCompleteObject = refersToCompleteObject(LVal);
11343 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) {
11349 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
11350 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
11353 if (LVal.InvalidBase)
11356 QualType BaseTy = getObjectType(LVal.getLValueBase());
11361 const SubobjectDesignator &Designator = LVal.Designator;
11370 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) {
11374 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
11375 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
11402 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining;
11414 LValue LVal;
11428 LVal.setFrom(Info.Ctx, RVal);
11429 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info,
11436 if (LVal.getLValueOffset().isNegative()) {
11442 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset))
11447 if (EndOffset <= LVal.getLValueOffset())
11450 Size = (EndOffset - LVal.getLValueOffset()).getQuantity();
12321 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index,
12326 assert(!LVal.hasLValuePath() && "have designator for integer lvalue");
12327 CharUnits &Offset = LVal.getLValueOffset();
14803 LValue LVal;
14804 LVal.set(Base);
14837 LValue LVal;
14838 LVal.set(Base);
14840 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) || Result.HasSideEffects)
14897 LValue LVal;
14898 LVal.set(VD);
14900 if (!EvaluateInPlace(Value, Info, LVal, this,