Lines Matching refs:LVal
2035 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { in GetLValueBaseDecl() argument
2036 return LVal.Base.dyn_cast<const ValueDecl*>(); in GetLValueBaseDecl()
2129 QualType Type, const LValue &LVal, in CheckLValueConstantExpression() argument
2134 APValue::LValueBase Base = LVal.getLValueBase(); in CheckLValueConstantExpression()
2135 const SubobjectDesignator &Designator = LVal.getLValueDesignator(); in CheckLValueConstantExpression()
2203 LVal.getLValueCallIndex() == 0) && in CheckLValueConstantExpression()
2416 LValue LVal; in CheckEvaluationResult() local
2417 LVal.setFrom(Info.Ctx, Value); in CheckEvaluationResult()
2418 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind, in CheckEvaluationResult()
3140 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal, in HandleLValueMember() argument
3149 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I))); in HandleLValueMember()
3150 LVal.addDecl(Info, E, FD); in HandleLValueMember()
3156 LValue &LVal, in HandleLValueIndirectMember() argument
3159 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C))) in HandleLValueIndirectMember()
3197 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3203 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee); in HandleLValueArrayAdjustment()
3208 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3210 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy, in HandleLValueArrayAdjustment()
3220 LValue &LVal, QualType EltTy, in HandleLValueComplexElement() argument
3226 LVal.Offset += SizeOfComponent; in HandleLValueComplexElement()
3228 LVal.addComplex(Info, E, EltTy, Imag); in HandleLValueComplexElement()
3963 AccessKinds AK, const LValue &LVal, in findCompleteObject() argument
3965 if (LVal.InvalidBase) { in findCompleteObject()
3970 if (!LVal.Base) { in findCompleteObject()
3977 if (LVal.getLValueCallIndex()) { in findCompleteObject()
3979 Info.getCallFrameAndDepth(LVal.getLValueCallIndex()); in findCompleteObject()
3982 << AK << LVal.Base.is<const ValueDecl*>(); in findCompleteObject()
3983 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4005 QualType BaseType = getType(LVal.Base); in findCompleteObject()
4007 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && in findCompleteObject()
4008 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4012 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) { in findCompleteObject()
4026 return CompleteObject(LVal.Base, &V, GD->getType()); in findCompleteObject()
4035 return CompleteObject(LVal.Base, const_cast<APValue *>(&GCD->getValue()), in findCompleteObject()
4045 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()), in findCompleteObject()
4076 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4089 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4099 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4131 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal)) in findCompleteObject()
4133 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) { in findCompleteObject()
4139 return CompleteObject(LVal.Base, &(*Alloc)->Value, in findCompleteObject()
4140 LVal.Base.getDynamicAllocType()); in findCompleteObject()
4142 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in findCompleteObject()
4176 !lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4178 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4188 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4190 LVal.moveInto(Val); in findCompleteObject()
4195 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4199 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); in findCompleteObject()
4213 LVal.Base.dyn_cast<const ValueDecl *>())) in findCompleteObject()
4220 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType); in findCompleteObject()
4239 const LValue &LVal, APValue &RVal, in handleLValueToRValueConversion() argument
4241 if (LVal.Designator.Invalid) in handleLValueToRValueConversion()
4245 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in handleLValueToRValueConversion()
4250 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { in handleLValueToRValueConversion()
4286 CompleteObject LitObj(LVal.Base, &Lit, Base->getType()); in handleLValueToRValueConversion()
4287 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4291 assert(LVal.Designator.Entries.size() <= 1 && in handleLValueToRValueConversion()
4293 if (LVal.Designator.Entries.empty()) { in handleLValueToRValueConversion()
4300 if (LVal.Designator.isOnePastTheEnd()) { in handleLValueToRValueConversion()
4307 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex(); in handleLValueToRValueConversion()
4313 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type); in handleLValueToRValueConversion()
4314 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4318 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleAssignment() argument
4320 if (LVal.Designator.Invalid) in handleAssignment()
4328 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleAssignment()
4329 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val); in handleAssignment()
4444 LValue LVal; in foundPointer() local
4445 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4446 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset)) in foundPointer()
4448 LVal.moveInto(Subobj); in foundPointer()
4459 const LValue &LVal, QualType LValType, in handleCompoundAssignment() argument
4463 if (LVal.Designator.Invalid) in handleCompoundAssignment()
4471 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleCompoundAssignment()
4474 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleCompoundAssignment()
4593 LValue LVal; in foundPointer() local
4594 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4595 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, in foundPointer()
4598 LVal.moveInto(Subobj); in foundPointer()
4605 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleIncDec() argument
4607 if (LVal.Designator.Invalid) in handleIncDec()
4616 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType); in handleIncDec()
4618 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleIncDec()
5802 LValue LVal; in HandleCovariantReturnAdjustment() local
5803 LVal.setFrom(Info.Ctx, Result); in HandleCovariantReturnAdjustment()
5810 !CastToBaseClass(Info, E, LVal, OldClass, NewClass)) in HandleCovariantReturnAdjustment()
5815 LVal.moveInto(Result); in HandleCovariantReturnAdjustment()
7908 LValue LVal; in VisitCastExpr() local
7909 if (!EvaluateLValue(E->getSubExpr(), LVal, Info)) in VisitCastExpr()
7914 LVal, RVal)) in VisitCastExpr()
7948 LValue LVal; in VisitUnaryPostIncDec() local
7949 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info)) in VisitUnaryPostIncDec()
7952 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(), in VisitUnaryPostIncDec()
8647 const LValue &LVal, in getBytesReturnedByAllocSizeCall() argument
8649 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) && in getBytesReturnedByAllocSizeCall()
8651 const auto *Base = LVal.getLValueBase().get<const Expr *>(); in getBytesReturnedByAllocSizeCall()
8998 LValue LVal; in VisitCastExpr() local
8999 if (!evaluateLValue(E->getSubExpr(), LVal)) in VisitCastExpr()
9005 LVal, RVal)) in VisitCastExpr()
9007 evaluateLValueAsAllocSize(Info, LVal.Base, Result); in VisitCastExpr()
11567 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) { in isDesignatorAtObjectEnd() argument
11568 assert(!LVal.Designator.Invalid); in isDesignatorAtObjectEnd()
11579 auto &Base = LVal.getLValueBase(); in isDesignatorAtObjectEnd()
11596 if (LVal.Designator.FirstEntryIsAnUnsizedArray) { in isDesignatorAtObjectEnd()
11606 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) { in isDesignatorAtObjectEnd()
11607 const auto &Entry = LVal.Designator.Entries[I]; in isDesignatorAtObjectEnd()
11641 static bool refersToCompleteObject(const LValue &LVal) { in refersToCompleteObject() argument
11642 if (LVal.Designator.Invalid) in refersToCompleteObject()
11645 if (!LVal.Designator.Entries.empty()) in refersToCompleteObject()
11646 return LVal.Designator.isMostDerivedAnUnsizedArray(); in refersToCompleteObject()
11648 if (!LVal.InvalidBase) in refersToCompleteObject()
11653 const auto *E = LVal.Base.dyn_cast<const Expr *>(); in refersToCompleteObject()
11659 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) { in isUserWritingOffTheEnd() argument
11660 const SubobjectDesignator &Designator = LVal.Designator; in isUserWritingOffTheEnd()
11694 return LVal.InvalidBase && in isUserWritingOffTheEnd()
11697 isDesignatorAtObjectEnd(Ctx, LVal); in isUserWritingOffTheEnd()
11718 unsigned Type, const LValue &LVal, in determineEndOffset() argument
11720 bool DetermineForCompleteObject = refersToCompleteObject(LVal); in determineEndOffset()
11731 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) { in determineEndOffset()
11737 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11738 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11741 if (LVal.InvalidBase) in determineEndOffset()
11744 QualType BaseTy = getObjectType(LVal.getLValueBase()); in determineEndOffset()
11749 const SubobjectDesignator &Designator = LVal.Designator; in determineEndOffset()
11758 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) { in determineEndOffset()
11762 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
11763 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
11790 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining; in determineEndOffset()
11802 LValue LVal; in tryEvaluateBuiltinObjectSize() local
11816 LVal.setFrom(Info.Ctx, RVal); in tryEvaluateBuiltinObjectSize()
11817 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info, in tryEvaluateBuiltinObjectSize()
11824 if (LVal.getLValueOffset().isNegative()) { in tryEvaluateBuiltinObjectSize()
11830 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset)) in tryEvaluateBuiltinObjectSize()
11835 if (EndOffset <= LVal.getLValueOffset()) in tryEvaluateBuiltinObjectSize()
11838 Size = (EndOffset - LVal.getLValueOffset()).getQuantity(); in tryEvaluateBuiltinObjectSize()
12672 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index, in addOrSubLValueAsInteger() argument
12677 assert(!LVal.hasLValuePath() && "have designator for integer lvalue"); in addOrSubLValueAsInteger()
12678 CharUnits &Offset = LVal.getLValueOffset(); in addOrSubLValueAsInteger()
15298 LValue LVal; in EvaluateDestruction() local
15299 LVal.set(Base); in EvaluateDestruction()
15336 LValue LVal; in EvaluateAsConstantExpr() local
15337 LVal.set(Base); in EvaluateAsConstantExpr()
15339 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) || Result.HasSideEffects) in EvaluateAsConstantExpr()
15403 LValue LVal; in EvaluateAsInitializer() local
15404 LVal.set(VD); in EvaluateAsInitializer()
15406 if (!EvaluateInPlace(Value, Info, LVal, this, in EvaluateAsInitializer()