Lines Matching refs:Ptr

75 static bool CheckActive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,  in CheckActive()  argument
77 if (Ptr.isActive()) in CheckActive()
81 const FieldDecl *InactiveField = Ptr.getField(); in CheckActive()
84 Pointer U = Ptr.getBase(); in CheckActive()
107 static bool CheckTemporary(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckTemporary() argument
109 if (auto ID = Ptr.getDeclID()) { in CheckTemporary()
110 if (!Ptr.isStaticTemporary()) in CheckTemporary()
113 if (Ptr.getDeclDesc()->getType().isConstQualified()) in CheckTemporary()
121 S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here); in CheckTemporary()
127 static bool CheckGlobal(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckGlobal() argument
128 if (auto ID = Ptr.getDeclID()) { in CheckGlobal()
129 if (!Ptr.isStatic()) in CheckGlobal()
187 bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckExtern() argument
188 if (!Ptr.isExtern()) in CheckExtern()
192 const auto *VD = Ptr.getDeclDesc()->asValueDecl(); in CheckExtern()
198 bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckArray() argument
199 if (!Ptr.isUnknownSizeArray()) in CheckArray()
206 bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckLive() argument
208 if (Ptr.isZero()) { in CheckLive()
211 if (Ptr.isField()) in CheckLive()
219 if (!Ptr.isLive()) { in CheckLive()
221 bool IsTemp = Ptr.isTemporary(); in CheckLive()
226 S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here); in CheckLive()
228 S.Note(Ptr.getDeclLoc(), diag::note_declared_at); in CheckLive()
270 static bool CheckConstant(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckConstant() argument
271 return CheckConstant(S, OpPC, Ptr.getDeclDesc()); in CheckConstant()
274 bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckDummy() argument
275 return !Ptr.isZero() && !Ptr.isDummy(); in CheckDummy()
278 bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckNull() argument
280 if (!Ptr.isZero()) in CheckNull()
287 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckRange() argument
289 if (!Ptr.isOnePastEnd()) in CheckRange()
296 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckRange() argument
298 if (!Ptr.isElementPastEnd()) in CheckRange()
305 bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckSubobject() argument
307 if (!Ptr.isOnePastEnd()) in CheckSubobject()
315 bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckConst() argument
316 assert(Ptr.isLive() && "Pointer is not live"); in CheckConst()
317 if (!Ptr.isConst()) in CheckConst()
324 Ptr.block() == S.Current->getThis().block()) { in CheckConst()
328 const QualType Ty = Ptr.getType(); in CheckConst()
334 bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckMutable() argument
335 assert(Ptr.isLive() && "Pointer is not live"); in CheckMutable()
336 if (!Ptr.isMutable()) { in CheckMutable()
341 const FieldDecl *Field = Ptr.getField(); in CheckMutable()
347 bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckInitialized() argument
349 if (Ptr.isInitialized()) in CheckInitialized()
359 bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckLoad() argument
360 if (!CheckLive(S, OpPC, Ptr, AK_Read)) in CheckLoad()
362 if (!CheckConstant(S, OpPC, Ptr)) in CheckLoad()
365 if (!CheckDummy(S, OpPC, Ptr)) in CheckLoad()
367 if (!CheckExtern(S, OpPC, Ptr)) in CheckLoad()
369 if (!CheckRange(S, OpPC, Ptr, AK_Read)) in CheckLoad()
371 if (!CheckInitialized(S, OpPC, Ptr, AK_Read)) in CheckLoad()
373 if (!CheckActive(S, OpPC, Ptr, AK_Read)) in CheckLoad()
375 if (!CheckTemporary(S, OpPC, Ptr, AK_Read)) in CheckLoad()
377 if (!CheckMutable(S, OpPC, Ptr)) in CheckLoad()
382 bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckStore() argument
383 if (!CheckLive(S, OpPC, Ptr, AK_Assign)) in CheckStore()
385 if (!CheckExtern(S, OpPC, Ptr)) in CheckStore()
387 if (!CheckRange(S, OpPC, Ptr, AK_Assign)) in CheckStore()
389 if (!CheckGlobal(S, OpPC, Ptr)) in CheckStore()
391 if (!CheckConst(S, OpPC, Ptr)) in CheckStore()
396 bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckInvoke() argument
397 if (!CheckLive(S, OpPC, Ptr, AK_MemberCall)) in CheckInvoke()
399 if (!CheckExtern(S, OpPC, Ptr)) in CheckInvoke()
401 if (!CheckRange(S, OpPC, Ptr, AK_MemberCall)) in CheckInvoke()
406 bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckInit() argument
407 if (!CheckLive(S, OpPC, Ptr, AK_Assign)) in CheckInit()
409 if (!CheckRange(S, OpPC, Ptr, AK_Assign)) in CheckInit()
502 const Pointer &Ptr) { in CheckPotentialReinterpretCast() argument