Lines Matching refs:Ptr

125 static bool CheckActive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,  in CheckActive()  argument
127 if (Ptr.isActive()) in CheckActive()
131 const FieldDecl *InactiveField = Ptr.getField(); in CheckActive()
134 Pointer U = Ptr.getBase(); in CheckActive()
157 static bool CheckTemporary(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckTemporary() argument
159 if (auto ID = Ptr.getDeclID()) { in CheckTemporary()
160 if (!Ptr.isStaticTemporary()) in CheckTemporary()
163 if (Ptr.getDeclDesc()->getType().isConstQualified()) in CheckTemporary()
171 S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here); in CheckTemporary()
177 static bool CheckGlobal(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckGlobal() argument
178 if (auto ID = Ptr.getDeclID()) { in CheckGlobal()
179 if (!Ptr.isStatic()) in CheckGlobal()
248 bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckExtern() argument
249 if (!Ptr.isExtern()) in CheckExtern()
252 if (Ptr.isInitialized() || in CheckExtern()
253 (Ptr.getDeclDesc()->asVarDecl() == S.EvaluatingDecl)) in CheckExtern()
257 const auto *VD = Ptr.getDeclDesc()->asValueDecl(); in CheckExtern()
263 bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckArray() argument
264 if (!Ptr.isUnknownSizeArray()) in CheckArray()
271 bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckLive() argument
273 if (Ptr.isZero()) { in CheckLive()
276 if (Ptr.isField()) in CheckLive()
284 if (!Ptr.isLive()) { in CheckLive()
286 bool IsTemp = Ptr.isTemporary(); in CheckLive()
291 S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here); in CheckLive()
293 S.Note(Ptr.getDeclLoc(), diag::note_declared_at); in CheckLive()
335 static bool CheckConstant(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckConstant() argument
336 if (Ptr.isIntegralPointer()) in CheckConstant()
338 return CheckConstant(S, OpPC, Ptr.getDeclDesc()); in CheckConstant()
341 bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckNull() argument
343 if (!Ptr.isZero()) in CheckNull()
352 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckRange() argument
354 if (!Ptr.isOnePastEnd()) in CheckRange()
362 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckRange() argument
364 if (!Ptr.isElementPastEnd()) in CheckRange()
372 bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckSubobject() argument
374 if (!Ptr.isOnePastEnd()) in CheckSubobject()
383 bool CheckDowncast(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckDowncast() argument
385 uint32_t MinOffset = Ptr.getDeclDesc()->getMetadataSize(); in CheckDowncast()
386 uint32_t PtrOffset = Ptr.getByteOffset(); in CheckDowncast()
395 QualType MostDerivedQT = Ptr.getDeclPtr().getType(); in CheckDowncast()
403 bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckConst() argument
404 assert(Ptr.isLive() && "Pointer is not live"); in CheckConst()
405 if (!Ptr.isConst() || Ptr.isMutable()) in CheckConst()
416 Ptr.block() == Frame->getThis().block()) { in CheckConst()
422 if (!Ptr.isBlockPointer()) in CheckConst()
425 const QualType Ty = Ptr.getType(); in CheckConst()
431 bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckMutable() argument
432 assert(Ptr.isLive() && "Pointer is not live"); in CheckMutable()
433 if (!Ptr.isMutable()) in CheckMutable()
439 Ptr.block()->getEvalID() == S.Ctx.getEvalID()) in CheckMutable()
443 const FieldDecl *Field = Ptr.getField(); in CheckMutable()
449 bool CheckVolatile(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckVolatile() argument
451 assert(Ptr.isLive()); in CheckVolatile()
455 if (!Ptr.isBlockPointer()) in CheckVolatile()
458 QualType PtrType = Ptr.getType(); in CheckVolatile()
470 bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckInitialized() argument
472 assert(Ptr.isLive()); in CheckInitialized()
474 if (Ptr.isInitialized()) in CheckInitialized()
477 if (const auto *VD = Ptr.getDeclDesc()->asVarDecl(); in CheckInitialized()
496 bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckGlobalInitialized() argument
497 if (Ptr.isInitialized()) in CheckGlobalInitialized()
501 const auto *VD = cast<VarDecl>(Ptr.getDeclDesc()->asValueDecl()); in CheckGlobalInitialized()
513 bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckLoad() argument
515 if (!CheckLive(S, OpPC, Ptr, AK)) in CheckLoad()
517 if (!CheckConstant(S, OpPC, Ptr)) in CheckLoad()
520 if (!CheckDummy(S, OpPC, Ptr, AK)) in CheckLoad()
522 if (!CheckExtern(S, OpPC, Ptr)) in CheckLoad()
524 if (!CheckRange(S, OpPC, Ptr, AK)) in CheckLoad()
526 if (!CheckActive(S, OpPC, Ptr, AK)) in CheckLoad()
528 if (!CheckInitialized(S, OpPC, Ptr, AK)) in CheckLoad()
530 if (!CheckTemporary(S, OpPC, Ptr, AK)) in CheckLoad()
532 if (!CheckMutable(S, OpPC, Ptr)) in CheckLoad()
534 if (!CheckVolatile(S, OpPC, Ptr, AK)) in CheckLoad()
539 bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckStore() argument
540 if (!CheckLive(S, OpPC, Ptr, AK_Assign)) in CheckStore()
542 if (!CheckDummy(S, OpPC, Ptr, AK_Assign)) in CheckStore()
544 if (!CheckExtern(S, OpPC, Ptr)) in CheckStore()
546 if (!CheckRange(S, OpPC, Ptr, AK_Assign)) in CheckStore()
548 if (!CheckGlobal(S, OpPC, Ptr)) in CheckStore()
550 if (!CheckConst(S, OpPC, Ptr)) in CheckStore()
555 bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckInvoke() argument
556 if (!CheckLive(S, OpPC, Ptr, AK_MemberCall)) in CheckInvoke()
558 if (!Ptr.isDummy()) { in CheckInvoke()
559 if (!CheckExtern(S, OpPC, Ptr)) in CheckInvoke()
561 if (!CheckRange(S, OpPC, Ptr, AK_MemberCall)) in CheckInvoke()
567 bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in CheckInit() argument
568 if (!CheckLive(S, OpPC, Ptr, AK_Assign)) in CheckInit()
570 if (!CheckRange(S, OpPC, Ptr, AK_Assign)) in CheckInit()
762 const Pointer &Ptr) { in CheckDeleteSource() argument
769 << Ptr.toDiagnosticString(S.getCtx()); in CheckDeleteSource()
771 if (Ptr.isTemporary()) in CheckDeleteSource()
772 S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here); in CheckDeleteSource()
774 S.Note(Ptr.getDeclLoc(), diag::note_declared_at); in CheckDeleteSource()
785 bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in CheckDummy() argument
787 if (!Ptr.isDummy()) in CheckDummy()
790 const Descriptor *Desc = Ptr.getDeclDesc(); in CheckDummy()