Lines Matching refs:LVal

2111 static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) {  in GetLValueBaseDecl()  argument
2112 return LVal.Base.dyn_cast<const ValueDecl*>(); in GetLValueBaseDecl()
2206 QualType Type, const LValue &LVal, in CheckLValueConstantExpression() argument
2211 APValue::LValueBase Base = LVal.getLValueBase(); in CheckLValueConstantExpression()
2212 const SubobjectDesignator &Designator = LVal.getLValueDesignator(); in CheckLValueConstantExpression()
2279 LVal.getLValueCallIndex() == 0) && in CheckLValueConstantExpression()
2503 LValue LVal; in CheckEvaluationResult() local
2504 LVal.setFrom(Info.Ctx, Value); in CheckEvaluationResult()
2505 return CheckLValueConstantExpression(Info, DiagLoc, Type, LVal, Kind, in CheckEvaluationResult()
3181 static bool HandleLValueMember(EvalInfo &Info, const Expr *E, LValue &LVal, in HandleLValueMember() argument
3190 LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I))); in HandleLValueMember()
3191 LVal.addDecl(Info, E, FD); in HandleLValueMember()
3197 LValue &LVal, in HandleLValueIndirectMember() argument
3200 if (!HandleLValueMember(Info, E, LVal, cast<FieldDecl>(C))) in HandleLValueIndirectMember()
3246 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3252 LVal.adjustOffsetAndIndex(Info, E, Adjustment, SizeOfPointee); in HandleLValueArrayAdjustment()
3257 LValue &LVal, QualType EltTy, in HandleLValueArrayAdjustment() argument
3259 return HandleLValueArrayAdjustment(Info, E, LVal, EltTy, in HandleLValueArrayAdjustment()
3269 LValue &LVal, QualType EltTy, in HandleLValueComplexElement() argument
3275 LVal.Offset += SizeOfComponent; in HandleLValueComplexElement()
3277 LVal.addComplex(Info, E, EltTy, Imag); in HandleLValueComplexElement()
4026 AccessKinds AK, const LValue &LVal, in findCompleteObject() argument
4028 if (LVal.InvalidBase) { in findCompleteObject()
4033 if (!LVal.Base) { in findCompleteObject()
4040 if (LVal.getLValueCallIndex()) { in findCompleteObject()
4042 Info.getCallFrameAndDepth(LVal.getLValueCallIndex()); in findCompleteObject()
4045 << AK << LVal.Base.is<const ValueDecl*>(); in findCompleteObject()
4046 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4068 QualType BaseType = getType(LVal.Base); in findCompleteObject()
4070 if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && in findCompleteObject()
4071 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4075 } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) { in findCompleteObject()
4089 return CompleteObject(LVal.Base, &V, GD->getType()); in findCompleteObject()
4098 return CompleteObject(LVal.Base, const_cast<APValue *>(&GCD->getValue()), in findCompleteObject()
4108 return CompleteObject(LVal.Base, const_cast<APValue *>(&TPO->getValue()), in findCompleteObject()
4139 lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4152 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4162 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4194 if (!evaluateVarDeclInit(Info, E, VD, Frame, LVal.getLValueVersion(), BaseVal)) in findCompleteObject()
4196 } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) { in findCompleteObject()
4202 return CompleteObject(LVal.Base, &(*Alloc)->Value, in findCompleteObject()
4203 LVal.Base.getDynamicAllocType()); in findCompleteObject()
4205 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in findCompleteObject()
4239 !lifetimeStartedInEvaluation(Info, LVal.Base)) { in findCompleteObject()
4241 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4251 return CompleteObject(LVal.getLValueBase(), nullptr, BaseType); in findCompleteObject()
4253 LVal.moveInto(Val); in findCompleteObject()
4258 NoteLValueLocation(Info, LVal.Base); in findCompleteObject()
4262 BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); in findCompleteObject()
4276 LVal.Base.dyn_cast<const ValueDecl *>())) in findCompleteObject()
4283 return CompleteObject(LVal.getLValueBase(), BaseVal, BaseType); in findCompleteObject()
4302 const LValue &LVal, APValue &RVal, in handleLValueToRValueConversion() argument
4304 if (LVal.Designator.Invalid) in handleLValueToRValueConversion()
4308 const Expr *Base = LVal.Base.dyn_cast<const Expr*>(); in handleLValueToRValueConversion()
4313 if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { in handleLValueToRValueConversion()
4349 CompleteObject LitObj(LVal.Base, &Lit, Base->getType()); in handleLValueToRValueConversion()
4350 return extractSubobject(Info, Conv, LitObj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4354 assert(LVal.Designator.Entries.size() <= 1 && in handleLValueToRValueConversion()
4356 if (LVal.Designator.Entries.empty()) { in handleLValueToRValueConversion()
4363 if (LVal.Designator.isOnePastTheEnd()) { in handleLValueToRValueConversion()
4370 uint64_t CharIndex = LVal.Designator.Entries[0].getAsArrayIndex(); in handleLValueToRValueConversion()
4376 CompleteObject Obj = findCompleteObject(Info, Conv, AK, LVal, Type); in handleLValueToRValueConversion()
4377 return Obj && extractSubobject(Info, Conv, Obj, LVal.Designator, RVal, AK); in handleLValueToRValueConversion()
4381 static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleAssignment() argument
4383 if (LVal.Designator.Invalid) in handleAssignment()
4391 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleAssignment()
4392 return Obj && modifySubobject(Info, E, Obj, LVal.Designator, Val); in handleAssignment()
4512 LValue LVal; in foundPointer() local
4513 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4514 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, Offset)) in foundPointer()
4516 LVal.moveInto(Subobj); in foundPointer()
4527 const LValue &LVal, QualType LValType, in handleCompoundAssignment() argument
4531 if (LVal.Designator.Invalid) in handleCompoundAssignment()
4539 CompleteObject Obj = findCompleteObject(Info, E, AK_Assign, LVal, LValType); in handleCompoundAssignment()
4542 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleCompoundAssignment()
4663 LValue LVal; in foundPointer() local
4664 LVal.setFrom(Info.Ctx, Subobj); in foundPointer()
4665 if (!HandleLValueArrayAdjustment(Info, E, LVal, PointeeType, in foundPointer()
4668 LVal.moveInto(Subobj); in foundPointer()
4675 static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal, in handleIncDec() argument
4677 if (LVal.Designator.Invalid) in handleIncDec()
4686 CompleteObject Obj = findCompleteObject(Info, E, AK, LVal, LValType); in handleIncDec()
4688 return Obj && findSubobject(Info, E, Obj, LVal.Designator, Handler); in handleIncDec()
5887 LValue LVal; in HandleCovariantReturnAdjustment() local
5888 LVal.setFrom(Info.Ctx, Result); in HandleCovariantReturnAdjustment()
5895 !CastToBaseClass(Info, E, LVal, OldClass, NewClass)) in HandleCovariantReturnAdjustment()
5900 LVal.moveInto(Result); in HandleCovariantReturnAdjustment()
8171 LValue LVal; in VisitCastExpr() local
8172 if (!EvaluateLValue(E->getSubExpr(), LVal, Info)) in VisitCastExpr()
8177 LVal, RVal)) in VisitCastExpr()
8211 LValue LVal; in VisitUnaryPostIncDec() local
8212 if (!EvaluateLValue(UO->getSubExpr(), LVal, Info)) in VisitUnaryPostIncDec()
8215 if (!handleIncDec(this->Info, UO, LVal, UO->getSubExpr()->getType(), in VisitUnaryPostIncDec()
8929 const LValue &LVal, in getBytesReturnedByAllocSizeCall() argument
8931 assert(isBaseAnAllocSizeCall(LVal.getLValueBase()) && in getBytesReturnedByAllocSizeCall()
8933 const auto *Base = LVal.getLValueBase().get<const Expr *>(); in getBytesReturnedByAllocSizeCall()
9291 LValue LVal; in VisitCastExpr() local
9292 if (!evaluateLValue(E->getSubExpr(), LVal)) in VisitCastExpr()
9298 LVal, RVal)) in VisitCastExpr()
9300 evaluateLValueAsAllocSize(Info, LVal.Base, Result); in VisitCastExpr()
11830 static bool isDesignatorAtObjectEnd(const ASTContext &Ctx, const LValue &LVal) { in isDesignatorAtObjectEnd() argument
11831 assert(!LVal.Designator.Invalid); in isDesignatorAtObjectEnd()
11842 auto &Base = LVal.getLValueBase(); in isDesignatorAtObjectEnd()
11859 if (LVal.Designator.FirstEntryIsAnUnsizedArray) { in isDesignatorAtObjectEnd()
11869 for (unsigned E = LVal.Designator.Entries.size(); I != E; ++I) { in isDesignatorAtObjectEnd()
11870 const auto &Entry = LVal.Designator.Entries[I]; in isDesignatorAtObjectEnd()
11904 static bool refersToCompleteObject(const LValue &LVal) { in refersToCompleteObject() argument
11905 if (LVal.Designator.Invalid) in refersToCompleteObject()
11908 if (!LVal.Designator.Entries.empty()) in refersToCompleteObject()
11909 return LVal.Designator.isMostDerivedAnUnsizedArray(); in refersToCompleteObject()
11911 if (!LVal.InvalidBase) in refersToCompleteObject()
11916 const auto *E = LVal.Base.dyn_cast<const Expr *>(); in refersToCompleteObject()
11922 static bool isUserWritingOffTheEnd(const ASTContext &Ctx, const LValue &LVal) { in isUserWritingOffTheEnd() argument
11923 const SubobjectDesignator &Designator = LVal.Designator; in isUserWritingOffTheEnd()
11957 return LVal.InvalidBase && in isUserWritingOffTheEnd()
11960 isDesignatorAtObjectEnd(Ctx, LVal); in isUserWritingOffTheEnd()
11993 unsigned Type, const LValue &LVal, in determineEndOffset() argument
11995 bool DetermineForCompleteObject = refersToCompleteObject(LVal); in determineEndOffset()
12006 if (!(Type & 1) || LVal.Designator.Invalid || DetermineForCompleteObject) { in determineEndOffset()
12012 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
12013 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
12016 if (LVal.InvalidBase) in determineEndOffset()
12019 QualType BaseTy = getObjectType(LVal.getLValueBase()); in determineEndOffset()
12021 addFlexibleArrayMemberInitSize(Info, BaseTy, LVal, EndOffset); in determineEndOffset()
12026 const SubobjectDesignator &Designator = LVal.Designator; in determineEndOffset()
12035 if (isUserWritingOffTheEnd(Info.Ctx, LVal)) { in determineEndOffset()
12039 if (isBaseAnAllocSizeCall(LVal.getLValueBase()) && in determineEndOffset()
12040 getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset)) in determineEndOffset()
12067 EndOffset = LVal.getLValueOffset() + BytesPerElem * ElemsRemaining; in determineEndOffset()
12079 LValue LVal; in tryEvaluateBuiltinObjectSize() local
12093 LVal.setFrom(Info.Ctx, RVal); in tryEvaluateBuiltinObjectSize()
12094 } else if (!EvaluatePointer(ignorePointerCastsAndParens(E), LVal, Info, in tryEvaluateBuiltinObjectSize()
12101 if (LVal.getLValueOffset().isNegative()) { in tryEvaluateBuiltinObjectSize()
12107 if (!determineEndOffset(Info, E->getExprLoc(), Type, LVal, EndOffset)) in tryEvaluateBuiltinObjectSize()
12112 if (EndOffset <= LVal.getLValueOffset()) in tryEvaluateBuiltinObjectSize()
12115 Size = (EndOffset - LVal.getLValueOffset()).getQuantity(); in tryEvaluateBuiltinObjectSize()
12991 static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index, in addOrSubLValueAsInteger() argument
12996 assert(!LVal.hasLValuePath() && "have designator for integer lvalue"); in addOrSubLValueAsInteger()
12997 CharUnits &Offset = LVal.getLValueOffset(); in addOrSubLValueAsInteger()
15655 LValue LVal; in EvaluateDestruction() local
15656 LVal.set(Base); in EvaluateDestruction()
15704 LValue LVal; in EvaluateAsConstantExpr() local
15705 LVal.set(Base); in EvaluateAsConstantExpr()
15711 if (!::EvaluateInPlace(Result.Val, Info, LVal, this) || in EvaluateAsConstantExpr()
15774 LValue LVal; in EvaluateAsInitializer() local
15775 LVal.set(VD); in EvaluateAsInitializer()
15788 if (!EvaluateInPlace(Value, Info, LVal, this, in EvaluateAsInitializer()