Lines Matching refs:LVal

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