Lines Matching defs:OpPC

61 static void diagnoseMissingInitializer(InterpState &S, CodePtr OpPC,
63 const SourceInfo &E = S.Current->getSource(OpPC);
68 static void diagnoseNonConstVariable(InterpState &S, CodePtr OpPC,
70 static bool diagnoseUnknownDecl(InterpState &S, CodePtr OpPC,
72 const SourceInfo &E = S.Current->getSource(OpPC);
85 diagnoseNonConstVariable(S, OpPC, D);
88 diagnoseMissingInitializer(S, OpPC, VD);
93 static void diagnoseNonConstVariable(InterpState &S, CodePtr OpPC,
98 const SourceInfo &Loc = S.Current->getSource(OpPC);
102 diagnoseMissingInitializer(S, OpPC, VD);
125 static bool CheckActive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
151 const SourceInfo &Loc = S.Current->getSource(OpPC);
157 static bool CheckTemporary(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
169 const SourceInfo &E = S.Current->getSource(OpPC);
177 static bool CheckGlobal(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
185 S.FFDiag(S.Current->getLocation(OpPC), diag::note_constexpr_modify_global);
198 void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC) {
248 bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
258 diagnoseNonConstVariable(S, OpPC, VD);
263 bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
266 const SourceInfo &E = S.Current->getSource(OpPC);
271 bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
274 const auto &Src = S.Current->getSource(OpPC);
285 const auto &Src = S.Current->getSource(OpPC);
301 bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
328 diagnoseNonConstVariable(S, OpPC, D);
335 static bool CheckConstant(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
338 return CheckConstant(S, OpPC, Ptr.getDeclDesc());
341 bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
345 const SourceInfo &Loc = S.Current->getSource(OpPC);
347 << CSK << S.Current->getRange(OpPC);
352 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
356 const SourceInfo &Loc = S.Current->getSource(OpPC);
358 << AK << S.Current->getRange(OpPC);
362 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
366 const SourceInfo &Loc = S.Current->getSource(OpPC);
368 << CSK << S.Current->getRange(OpPC);
372 bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
377 const SourceInfo &Loc = S.Current->getSource(OpPC);
379 << CSK << S.Current->getRange(OpPC);
383 bool CheckDowncast(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
393 const auto *E = cast<CastExpr>(S.Current->getExpr(OpPC));
403 bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
426 const SourceInfo &Loc = S.Current->getSource(OpPC);
431 bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
442 const SourceInfo &Loc = S.Current->getSource(OpPC);
449 bool CheckVolatile(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
462 const SourceInfo &Loc = S.Current->getSource(OpPC);
470 bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
479 const SourceInfo &Loc = S.Current->getSource(OpPC);
484 diagnoseMissingInitializer(S, OpPC, VD);
490 S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_access_uninit)
491 << AK << /*uninitialized=*/true << S.Current->getRange(OpPC);
496 bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
506 const SourceInfo &Loc = S.Current->getSource(OpPC);
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))
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))
575 bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
578 const SourceLocation &Loc = S.Current->getLocation(OpPC);
591 const SourceLocation &Loc = S.Current->getLocation(OpPC);
641 bool CheckCallDepth(InterpState &S, CodePtr OpPC) {
643 S.FFDiag(S.Current->getSource(OpPC),
652 bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This) {
656 const SourceInfo &Loc = S.Current->getSource(OpPC);
670 bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD) {
673 const SourceInfo &E = S.Current->getSource(OpPC);
679 bool CheckFloatResult(InterpState &S, CodePtr OpPC, const Floating &Result,
681 const SourceInfo &E = S.Current->getSource(OpPC);
689 << /*NaN=*/true << S.Current->getRange(OpPC);
726 bool CheckDynamicMemoryAllocation(InterpState &S, CodePtr OpPC) {
730 const SourceInfo &E = S.Current->getSource(OpPC);
735 bool CheckNewDeleteForms(InterpState &S, CodePtr OpPC, bool NewWasArray,
753 const SourceInfo &E = S.Current->getSource(OpPC);
761 bool CheckDeleteSource(InterpState &S, CodePtr OpPC, const Expr *Source,
767 const SourceInfo &Loc = S.Current->getSource(OpPC);
780 bool CheckDeclRef(InterpState &S, CodePtr OpPC, const DeclRefExpr *DR) {
782 return diagnoseUnknownDecl(S, OpPC, D);
785 bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
796 return diagnoseUnknownDecl(S, OpPC, D);
800 const SourceInfo &E = S.Current->getSource(OpPC);
806 bool CheckNonNullArgs(InterpState &S, CodePtr OpPC, const Function *F,
816 const SourceLocation &Loc = S.Current->getLocation(OpPC);
833 static bool runRecordDestructor(InterpState &S, CodePtr OpPC,
844 if (!runRecordDestructor(S, OpPC, BasePtr.atField(Field.Offset), D))
850 if (!runRecordDestructor(S, OpPC, BasePtr.atIndex(I).narrow(),
865 if (!Call(S, OpPC, DtorFunc, 0))
871 if (!runRecordDestructor(S, OpPC, BasePtr.atField(Base.Offset), Base.Desc))
878 bool RunDestructors(InterpState &S, CodePtr OpPC, const Block *B) {
893 if (!runRecordDestructor(S, OpPC, RP.atIndex(I).narrow(), ElemDesc))
900 return runRecordDestructor(S, OpPC, Pointer(const_cast<Block *>(B)), Desc);
903 void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,
916 const SourceLocation &Loc = S.Current->getLocation(OpPC);
921 const SourceLocation &Loc = S.Current->getLocation(OpPC);
947 CodePtr OpPC = PC;