Lines Matching defs:Ptr

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