Lines Matching defs:LVal

2118 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) {
2119 return LVal.Base.dyn_cast<const ValueDecl*>();
2213 QualType Type, const LValue &LVal,
2218 APValue::LValueBase Base = LVal.getLValueBase();
2219 const SubobjectDesignator &Designator = LVal.getLValueDesignator();
2286 LVal.getLValueCallIndex() == 0) &&
2510 LValue LVal;
2511 LVal.setFrom(Info.Ctx, Value);
2512 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind,
3207 /// Update LVal to refer to the given field, which must be a member of the type
3208 /// currently described by LVal.
3209 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal,
3218 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I)));
3219 LVal.addDecl(Info, E, FD);
3223 /// Update LVal to refer to the given indirect field.
3225 LValue &LVal,
3228 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C)))
3270 /// \param LVal - The pointer value to be updated.
3271 /// \param EltTy - The pointee type represented by LVal.
3274 LValue &LVal, QualType EltTy,
3280 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee);
3285 LValue &LVal, QualType EltTy,
3287 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy,
3293 /// \param LVal - The lvalue to be updated.
3297 LValue &LVal, QualType EltTy,
3303 LVal.Offset += SizeOfComponent;
3305 LVal.addComplex(Info, E, EltTy, Imag);
4054 AccessKinds AK, const LValue &LVal,
4056 if (LVal.InvalidBase) {
4061 if (!LVal.Base) {
4068 if (LVal.getLValueCallIndex()) {
4070 Info.getCallFrameAndDepth(LVal.getLValueCallIndex());
4073 << AK << LVal.Base.is<const ValueDecl*>();
4074 NoteLValueLocation(Info, LVal.Base);
4096 QualType BaseType = getType(LVal.Base);
4098 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl &&
4099 lifetimeStartedInEvaluation(Info, LVal.Base)) {
4103 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {
4117 return CompleteObject(LVal.Base, &V, GD->getType());
4126 return CompleteObject(LVal.Base, const_cast<APValue *>(&GCD->getValue()),
4136 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()),
4171 lifetimeStartedInEvaluation(Info, LVal.Base)) {
4187 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4197 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4229 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal))
4231 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {
4237 return CompleteObject(LVal.Base, &(*Alloc)->Value,
4238 LVal.Base.getDynamicAllocType());
4240 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4274 !lifetimeStartedInEvaluation(Info, LVal.Base)) {
4276 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4286 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4288 LVal.moveInto(Val);
4293 NoteLValueLocation(Info, LVal.Base);
4297 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion());
4311 LVal.Base.dyn_cast<const ValueDecl *>()))
4318 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType);
4330 /// \param LVal - The glvalue on which we are attempting to perform this action.
4337 const LValue &LVal, APValue &RVal,
4339 if (LVal.Designator.Invalid)
4343 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4348 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) {
4384 CompleteObject LitObj(LVal.Base, &Lit, Base->getType());
4385 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK);
4389 assert(LVal.Designator.Entries.size() <= 1 &&
4391 if (LVal.Designator.Entries.empty()) {
4398 if (LVal.Designator.isOnePastTheEnd()) {
4405 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex();
4411 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type);
4412 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK);
4415 /// Perform an assignment of Val to LVal. Takes ownership of Val.
4416 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal,
4418 if (LVal.Designator.Invalid)
4426 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4427 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val);
4547 LValue LVal;
4548 LVal.setFrom(Info.Ctx, Subobj);
4549 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset))
4551 LVal.moveInto(Subobj);
4559 /// Perform a compound assignment of LVal <op>= RVal.
4562 const LValue &LVal, QualType LValType,
4566 if (LVal.Designator.Invalid)
4574 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4577 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
4698 LValue LVal;
4699 LVal.setFrom(Info.Ctx, Subobj);
4700 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType,
4703 LVal.moveInto(Subobj);
4709 /// Perform an increment or decrement on LVal.
4710 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal,
4712 if (LVal.Designator.Invalid)
4721 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType);
4723 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
5948 LValue LVal;
5949 LVal.setFrom(Info.Ctx, Result);
5956 !CastToBaseClass(Info, E, LVal, OldClass, NewClass))
5961 LVal.moveInto(Result);
8235 LValue LVal;
8236 if (!EvaluateLValue(E->getSubExpr(), LVal, Info))
8241 LVal, RVal))
8275 LValue LVal;
8276 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info))
8279 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(),
9012 /// Convenience function. LVal's base must be a call to an alloc_size
9015 const LValue &LVal,
9017 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
9019 const auto *Base = LVal.getLValueBase().get<const Expr *>();
9392 LValue LVal;
9393 if (!evaluateLValue(E->getSubExpr(), LVal))
9399 LVal, RVal))
9401 evaluateLValueAsAllocSize(Info, LVal.Base, Result);
12087 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) {
12088 assert(!LVal.Designator.Invalid);
12099 auto &Base = LVal.getLValueBase();
12116 if (LVal.Designator.FirstEntryIsAnUnsizedArray) {
12126 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) {
12127 const auto &Entry = LVal.Designator.Entries[I];
12161 static bool refersToCompleteObject(const LValue &LVal) {
12162 if (LVal.Designator.Invalid)
12165 if (!LVal.Designator.Entries.empty())
12166 return LVal.Designator.isMostDerivedAnUnsizedArray();
12168 if (!LVal.InvalidBase)
12173 const auto *E = LVal.Base.dyn_cast<const Expr *>();
12179 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) {
12180 const SubobjectDesignator &Designator = LVal.Designator;
12214 return LVal.InvalidBase &&
12217 isDesignatorAtObjectEnd(Ctx, LVal);
12250 unsigned Type, const LValue &LVal,
12252 bool DetermineForCompleteObject = refersToCompleteObject(LVal);
12263 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) {
12269 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
12270 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
12273 if (LVal.InvalidBase)
12276 QualType BaseTy = getObjectType(LVal.getLValueBase());
12278 addFlexibleArrayMemberInitSize(Info, BaseTy, LVal, EndOffset);
12283 const SubobjectDesignator &Designator = LVal.Designator;
12292 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) {
12296 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
12297 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
12324 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining;
12336 LValue LVal;
12350 LVal.setFrom(Info.Ctx, RVal);
12351 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info,
12358 if (LVal.getLValueOffset().isNegative()) {
12364 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset))
12369 if (EndOffset <= LVal.getLValueOffset())
12372 Size = (EndOffset - LVal.getLValueOffset()).getQuantity();
13358 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index,
13363 assert(!LVal.hasLValuePath() && "have designator for integer lvalue");
13364 CharUnits &Offset = LVal.getLValueOffset();
16070 LValue LVal;
16071 LVal.set(Base);
16119 LValue LVal;
16120 LVal.set(Base);
16126 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
16190 LValue LVal;
16191 LVal.set(VD);
16204 if (!EvaluateInPlace(Value, Info, LVal, this,