Lines Matching refs:LVal
2032 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { in GetLValueBaseDecl() argument
2033 return LVal.Base.dyn_cast<const ValueDecl*>(); in GetLValueBaseDecl()
2126 QualType Type, const LValue &LVal, in CheckLValueConstantExpression() argument
2131 APValue::LValueBase Base = LVal.getLValueBase(); in CheckLValueConstantExpression()
2132 const SubobjectDesignator &Designator = LVal.getLValueDesignator(); in CheckLValueConstantExpression()
2202 LVal.getLValueCallIndex() == 0) && in CheckLValueConstantExpression()
2415 LValue LVal; in CheckEvaluationResult() local
2416 LVal.setFrom(Info.Ctx, Value); in CheckEvaluationResult()
2417 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind, in CheckEvaluationResult()
3138 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal, in HandleLValueMember() argument
3147 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I))); in HandleLValueMember()
3148 LVal.addDecl(Info, E, FD); in HandleLValueMember()
3154 LValue &LVal, in HandleLValueIndirectMember() argument
3157 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C))) in HandleLValueIndirectMember()
3195 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3201 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee); in HandleLValueArrayAdjustment()
3206 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3208 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy, in HandleLValueArrayAdjustment()
3218 LValue &LVal, QualType EltTy, in HandleLValueComplexElement() argument
3224 LVal.Offset += SizeOfComponent; in HandleLValueComplexElement()
3226 LVal.addComplex(Info, E, EltTy, Imag); in HandleLValueComplexElement()
3961 AccessKinds AK, const LValue &LVal, in findCompleteObject() argument
3963 if (LVal.InvalidBase) { in findCompleteObject()
3968 if (!LVal.Base) { in findCompleteObject()
3975 if (LVal.getLValueCallIndex()) { in findCompleteObject()
3977 Info.getCallFrameAndDepth(LVal.getLValueCallIndex()); in findCompleteObject()
3980 << AK << LVal.Base.is<const ValueDecl*>(); in findCompleteObject()
3981 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4003 QualType BaseType = getType(LVal.Base); in findCompleteObject()
4005 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && in findCompleteObject()
4006 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4010 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) { in findCompleteObject()
4024 return CompleteObject(LVal.Base, &V, GD->getType()); in findCompleteObject()
4033 return CompleteObject(LVal.Base, const_cast<APValue *>(&GCD->getValue()), in findCompleteObject()
4043 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()), in findCompleteObject()
4074 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4087 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4097 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4129 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal)) in findCompleteObject()
4131 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) { in findCompleteObject()
4137 return CompleteObject(LVal.Base, &(*Alloc)->Value, in findCompleteObject()
4138 LVal.Base.getDynamicAllocType()); in findCompleteObject()
4140 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in findCompleteObject()
4174 !lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4176 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4186 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4188 LVal.moveInto(Val); in findCompleteObject()
4193 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4197 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); in findCompleteObject()
4211 LVal.Base.dyn_cast<const ValueDecl *>())) in findCompleteObject()
4218 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType); in findCompleteObject()
4237 const LValue &LVal, APValue &RVal, in handleLValueToRValueConversion() argument
4239 if (LVal.Designator.Invalid) in handleLValueToRValueConversion()
4243 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in handleLValueToRValueConversion()
4248 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { in handleLValueToRValueConversion()
4284 CompleteObject LitObj(LVal.Base, &Lit, Base->getType()); in handleLValueToRValueConversion()
4285 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4289 assert(LVal.Designator.Entries.size() <= 1 && in handleLValueToRValueConversion()
4291 if (LVal.Designator.Entries.empty()) { in handleLValueToRValueConversion()
4298 if (LVal.Designator.isOnePastTheEnd()) { in handleLValueToRValueConversion()
4305 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex(); in handleLValueToRValueConversion()
4311 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type); in handleLValueToRValueConversion()
4312 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4316 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleAssignment() argument
4318 if (LVal.Designator.Invalid) in handleAssignment()
4326 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleAssignment()
4327 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val); in handleAssignment()
4442 LValue LVal; in foundPointer() local
4443 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4444 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset)) in foundPointer()
4446 LVal.moveInto(Subobj); in foundPointer()
4457 const LValue &LVal, QualType LValType, in handleCompoundAssignment() argument
4461 if (LVal.Designator.Invalid) in handleCompoundAssignment()
4469 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleCompoundAssignment()
4472 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleCompoundAssignment()
4591 LValue LVal; in foundPointer() local
4592 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4593 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, in foundPointer()
4596 LVal.moveInto(Subobj); in foundPointer()
4603 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleIncDec() argument
4605 if (LVal.Designator.Invalid) in handleIncDec()
4614 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType); in handleIncDec()
4616 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleIncDec()
5794 LValue LVal; in HandleCovariantReturnAdjustment() local
5795 LVal.setFrom(Info.Ctx, Result); in HandleCovariantReturnAdjustment()
5802 !CastToBaseClass(Info, E, LVal, OldClass, NewClass)) in HandleCovariantReturnAdjustment()
5807 LVal.moveInto(Result); in HandleCovariantReturnAdjustment()
7895 LValue LVal; in VisitCastExpr() local
7896 if (!EvaluateLValue(E->getSubExpr(), LVal, Info)) in VisitCastExpr()
7901 LVal, RVal)) in VisitCastExpr()
7935 LValue LVal; in VisitUnaryPostIncDec() local
7936 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info)) in VisitUnaryPostIncDec()
7939 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(), in VisitUnaryPostIncDec()
8628 const LValue &LVal, in getBytesReturnedByAllocSizeCall() argument
8630 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) && in getBytesReturnedByAllocSizeCall()
8632 const auto *Base = LVal.getLValueBase().get<const Expr *>(); in getBytesReturnedByAllocSizeCall()
8977 LValue LVal; in VisitCastExpr() local
8978 if (!evaluateLValue(E->getSubExpr(), LVal)) in VisitCastExpr()
8984 LVal, RVal)) in VisitCastExpr()
8986 evaluateLValueAsAllocSize(Info, LVal.Base, Result); in VisitCastExpr()
11494 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) { in isDesignatorAtObjectEnd() argument
11495 assert(!LVal.Designator.Invalid); in isDesignatorAtObjectEnd()
11506 auto &Base = LVal.getLValueBase(); in isDesignatorAtObjectEnd()
11523 if (LVal.Designator.FirstEntryIsAnUnsizedArray) { in isDesignatorAtObjectEnd()
11533 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) { in isDesignatorAtObjectEnd()
11534 const auto &Entry = LVal.Designator.Entries[I]; in isDesignatorAtObjectEnd()
11568 static bool refersToCompleteObject(const LValue &LVal) { in refersToCompleteObject() argument
11569 if (LVal.Designator.Invalid) in refersToCompleteObject()
11572 if (!LVal.Designator.Entries.empty()) in refersToCompleteObject()
11573 return LVal.Designator.isMostDerivedAnUnsizedArray(); in refersToCompleteObject()
11575 if (!LVal.InvalidBase) in refersToCompleteObject()
11580 const auto *E = LVal.Base.dyn_cast<const Expr *>(); in refersToCompleteObject()
11586 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) { in isUserWritingOffTheEnd() argument
11587 const SubobjectDesignator &Designator = LVal.Designator; in isUserWritingOffTheEnd()
11600 return LVal.InvalidBase && in isUserWritingOffTheEnd()
11608 isDesignatorAtObjectEnd(Ctx, LVal); in isUserWritingOffTheEnd()
11629 unsigned Type, const LValue &LVal, in determineEndOffset() argument
11631 bool DetermineForCompleteObject = refersToCompleteObject(LVal); in determineEndOffset()
11642 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) { in determineEndOffset()
11648 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11649 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11652 if (LVal.InvalidBase) in determineEndOffset()
11655 QualType BaseTy = getObjectType(LVal.getLValueBase()); in determineEndOffset()
11660 const SubobjectDesignator &Designator = LVal.Designator; in determineEndOffset()
11669 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) { in determineEndOffset()
11673 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11674 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11701 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining; in determineEndOffset()
11713 LValue LVal; in tryEvaluateBuiltinObjectSize() local
11727 LVal.setFrom(Info.Ctx, RVal); in tryEvaluateBuiltinObjectSize()
11728 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info, in tryEvaluateBuiltinObjectSize()
11735 if (LVal.getLValueOffset().isNegative()) { in tryEvaluateBuiltinObjectSize()
11741 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset)) in tryEvaluateBuiltinObjectSize()
11746 if (EndOffset <= LVal.getLValueOffset()) in tryEvaluateBuiltinObjectSize()
11749 Size = (EndOffset - LVal.getLValueOffset()).getQuantity(); in tryEvaluateBuiltinObjectSize()
12584 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index, in addOrSubLValueAsInteger() argument
12589 assert(!LVal.hasLValuePath() && "have designator for integer lvalue"); in addOrSubLValueAsInteger()
12590 CharUnits &Offset = LVal.getLValueOffset(); in addOrSubLValueAsInteger()
15073 LValue LVal; in EvaluateDestruction() local
15074 LVal.set(Base); in EvaluateDestruction()
15107 LValue LVal; in EvaluateAsConstantExpr() local
15108 LVal.set(Base); in EvaluateAsConstantExpr()
15110 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) || Result.HasSideEffects) in EvaluateAsConstantExpr()
15167 LValue LVal; in EvaluateAsInitializer() local
15168 LVal.set(VD); in EvaluateAsInitializer()
15170 if (!EvaluateInPlace(Value, Info, LVal, this, in EvaluateAsInitializer()