Lines Matching defs:LVal
2097 static bool IsOpaqueConstantCall(const LValue &LVal) {
2099 llvm::dyn_cast_if_present<CallExpr>(LVal.Base.dyn_cast<const Expr *>());
2171 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) {
2172 return LVal.Base.dyn_cast<const ValueDecl*>();
2182 // Gets the lvalue base of LVal as a string.
2183 static bool GetLValueBaseAsString(const EvalInfo &Info, const LValue &LVal,
2185 const auto *BaseExpr = LVal.Base.dyn_cast<const Expr *>();
2346 QualType Type, const LValue &LVal,
2351 APValue::LValueBase Base = LVal.getLValueBase();
2352 const SubobjectDesignator &Designator = LVal.getLValueDesignator();
2419 LVal.getLValueCallIndex() == 0) &&
2647 LValue LVal;
2648 LVal.setFrom(Info.Ctx, Value);
2649 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind,
3344 /// Update LVal to refer to the given field, which must be a member of the type
3345 /// currently described by LVal.
3346 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal,
3355 LVal.addDecl(Info, E, FD);
3356 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I)));
3360 /// Update LVal to refer to the given indirect field.
3362 LValue &LVal,
3365 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C)))
3407 /// \param LVal - The pointer value to be updated.
3408 /// \param EltTy - The pointee type represented by LVal.
3411 LValue &LVal, QualType EltTy,
3417 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee);
3422 LValue &LVal, QualType EltTy,
3424 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy,
3430 /// \param LVal - The lvalue to be updated.
3434 LValue &LVal, QualType EltTy,
3440 LVal.Offset += SizeOfComponent;
3442 LVal.addComplex(Info, E, EltTy, Imag);
3447 LValue &LVal, QualType EltTy,
3453 LVal.Offset += SizeOfElement * Idx;
3455 LVal.addVectorElement(Info, E, EltTy, Size, Idx);
4283 AccessKinds AK, const LValue &LVal,
4285 if (LVal.InvalidBase) {
4290 if (!LVal.Base) {
4297 if (LVal.getLValueCallIndex()) {
4299 Info.getCallFrameAndDepth(LVal.getLValueCallIndex());
4302 << AK << LVal.Base.is<const ValueDecl*>();
4303 NoteLValueLocation(Info, LVal.Base);
4325 QualType BaseType = getType(LVal.Base);
4327 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl &&
4328 lifetimeStartedInEvaluation(Info, LVal.Base)) {
4332 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {
4346 return CompleteObject(LVal.Base, &V, GD->getType());
4355 return CompleteObject(LVal.Base, const_cast<APValue *>(&GCD->getValue()),
4365 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()),
4400 lifetimeStartedInEvaluation(Info, LVal.Base)) {
4416 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4426 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4458 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal))
4460 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {
4466 return CompleteObject(LVal.Base, &(*Alloc)->Value,
4467 LVal.Base.getDynamicAllocType());
4469 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4503 !lifetimeStartedInEvaluation(Info, LVal.Base)) {
4505 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4515 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4517 LVal.moveInto(Val);
4522 NoteLValueLocation(Info, LVal.Base);
4526 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion());
4540 LVal.Base.dyn_cast<const ValueDecl *>()))
4547 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType);
4559 /// \param LVal - The glvalue on which we are attempting to perform this action.
4566 const LValue &LVal, APValue &RVal,
4568 if (LVal.Designator.Invalid)
4572 const Expr *Base = LVal.Base.dyn_cast<const Expr*>();
4577 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) {
4613 CompleteObject LitObj(LVal.Base, &Lit, Base->getType());
4614 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK);
4618 assert(LVal.Designator.Entries.size() <= 1 &&
4620 if (LVal.Designator.Entries.empty()) {
4627 if (LVal.Designator.isOnePastTheEnd()) {
4634 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex();
4640 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type);
4641 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK);
4644 /// Perform an assignment of Val to LVal. Takes ownership of Val.
4645 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal,
4647 if (LVal.Designator.Invalid)
4655 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4656 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val);
4776 LValue LVal;
4777 LVal.setFrom(Info.Ctx, Subobj);
4778 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset))
4780 LVal.moveInto(Subobj);
4788 /// Perform a compound assignment of LVal <op>= RVal.
4791 const LValue &LVal, QualType LValType,
4795 if (LVal.Designator.Invalid)
4803 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType);
4806 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
4927 LValue LVal;
4928 LVal.setFrom(Info.Ctx, Subobj);
4929 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType,
4932 LVal.moveInto(Subobj);
4938 /// Perform an increment or decrement on LVal.
4939 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal,
4941 if (LVal.Designator.Invalid)
4950 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType);
4952 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler);
6192 LValue LVal;
6193 LVal.setFrom(Info.Ctx, Result);
6200 !CastToBaseClass(Info, E, LVal, OldClass, NewClass))
6205 LVal.moveInto(Result);
8503 LValue LVal;
8504 if (!EvaluateLValue(E->getSubExpr(), LVal, Info))
8509 LVal, RVal))
8543 LValue LVal;
8544 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info))
8547 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(),
9350 /// Convenience function. LVal's base must be a call to an alloc_size
9353 const LValue &LVal,
9355 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
9357 const auto *Base = LVal.getLValueBase().get<const Expr *>();
9730 LValue LVal;
9731 if (!evaluateLValue(E->getSubExpr(), LVal))
9737 LVal, RVal))
9739 evaluateLValueAsAllocSize(Info, LVal.Base, Result);
12536 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) {
12537 assert(!LVal.Designator.Invalid);
12548 auto &Base = LVal.getLValueBase();
12565 if (LVal.Designator.FirstEntryIsAnUnsizedArray) {
12575 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) {
12576 const auto &Entry = LVal.Designator.Entries[I];
12610 static bool refersToCompleteObject(const LValue &LVal) {
12611 if (LVal.Designator.Invalid)
12614 if (!LVal.Designator.Entries.empty())
12615 return LVal.Designator.isMostDerivedAnUnsizedArray();
12617 if (!LVal.InvalidBase)
12622 const auto *E = LVal.Base.dyn_cast<const Expr *>();
12628 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) {
12629 const SubobjectDesignator &Designator = LVal.Designator;
12663 return LVal.InvalidBase &&
12666 isDesignatorAtObjectEnd(Ctx, LVal);
12699 unsigned Type, const LValue &LVal,
12701 bool DetermineForCompleteObject = refersToCompleteObject(LVal);
12716 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) {
12722 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
12723 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
12726 if (LVal.InvalidBase)
12729 QualType BaseTy = getObjectType(LVal.getLValueBase());
12731 addFlexibleArrayMemberInitSize(Info, BaseTy, LVal, EndOffset);
12736 const SubobjectDesignator &Designator = LVal.Designator;
12745 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) {
12749 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) &&
12750 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
12777 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining;
12789 LValue LVal;
12803 LVal.setFrom(Info.Ctx, RVal);
12804 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info,
12811 if (LVal.getLValueOffset().isNegative()) {
12817 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset))
12822 if (EndOffset <= LVal.getLValueOffset())
12825 Size = (EndOffset - LVal.getLValueOffset()).getQuantity();
14077 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index,
14082 assert(!LVal.hasLValuePath() && "have designator for integer lvalue");
14083 CharUnits &Offset = LVal.getLValueOffset();
16857 LValue LVal;
16858 LVal.set(Base);
16906 LValue LVal;
16907 LVal.set(Base);
16913 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) ||
16977 LValue LVal;
16978 LVal.set(VD);
16991 if (!EvaluateInPlace(Value, Info, LVal, this,