Lines Matching full:pointer
49 bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
52 bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
54 /// Checks if a pointer is live and accessible.
55 bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
58 /// Checks if a pointer is a dummy pointer.
59 bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
62 /// Checks if a pointer is null.
63 bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
66 /// Checks if a pointer is in range.
67 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
70 /// Checks if a field from which a pointer is going to be derived is valid.
71 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
74 /// Checks if Ptr is a one-past-the-end pointer.
75 bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
79 /// pointer.
80 bool CheckDowncast(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
83 /// Checks if a pointer points to const storage.
84 bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
89 /// Checks if a pointer points to a mutable field.
90 bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
93 bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
96 bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
99 bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
102 bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
105 bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
108 bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
117 /// Checks the 'this' pointer.
118 bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This);
136 /// Check the source of the pointer passed to delete/delete[] has actually
139 const Pointer &Ptr);
141 /// Sets the given integral value to the pointer, which is of
144 const Pointer &Ptr, const APSInt &IntValue);
147 bool DoMemcpy(InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest);
279 // pointer or reference to a local variable. in Ret()
281 if constexpr (std::is_same_v<T, Pointer>) { in Ret()
284 // pointer type. in Ret()
426 const Pointer &RHS = S.Stk.pop<Pointer>(); in Mulc()
427 const Pointer &LHS = S.Stk.pop<Pointer>(); in Mulc()
428 const Pointer &Result = S.Stk.peek<Pointer>(); in Mulc()
481 const Pointer &RHS = S.Stk.pop<Pointer>(); in Divc()
482 const Pointer &LHS = S.Stk.pop<Pointer>(); in Divc()
483 const Pointer &Result = S.Stk.peek<Pointer>(); in Divc()
718 bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in IncDecHelper()
771 /// 1) Pops a pointer from the stack
772 /// 2) Load the value from the pointer
773 /// 3) Writes the value increased by one back to the pointer
777 const Pointer &Ptr = S.Stk.pop<Pointer>(); in Inc()
784 /// 1) Pops a pointer from the stack
785 /// 2) Load the value from the pointer
786 /// 3) Writes the value increased by one back to the pointer
789 const Pointer &Ptr = S.Stk.pop<Pointer>(); in IncPop()
796 /// 1) Pops a pointer from the stack
797 /// 2) Load the value from the pointer
798 /// 3) Writes the value decreased by one back to the pointer
802 const Pointer &Ptr = S.Stk.pop<Pointer>(); in Dec()
809 /// 1) Pops a pointer from the stack
810 /// 2) Load the value from the pointer
811 /// 3) Writes the value decreased by one back to the pointer
814 const Pointer &Ptr = S.Stk.pop<Pointer>(); in DecPop()
822 bool IncDecFloatHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in IncDecFloatHelper()
842 const Pointer &Ptr = S.Stk.pop<Pointer>(); in Incf()
850 const Pointer &Ptr = S.Stk.pop<Pointer>(); in IncfPop()
858 const Pointer &Ptr = S.Stk.pop<Pointer>(); in Decf()
866 const Pointer &Ptr = S.Stk.pop<Pointer>(); in DecfPop()
896 "Non-equality comparisons on member pointer types should already be " in CmpHelper()
945 inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
947 const Pointer &RHS = S.Stk.pop<Pointer>();
948 const Pointer &LHS = S.Stk.pop<Pointer>();
950 if (!Pointer::hasSameBase(LHS, RHS)) {
965 inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
967 const Pointer &RHS = S.Stk.pop<Pointer>();
968 const Pointer &LHS = S.Stk.pop<Pointer>();
987 if (!Pointer::hasSameBase(LHS, RHS)) {
1008 // In our Pointer class, a pointer to an array and a pointer to the first
1028 // If either operand is a pointer to a weak function, the comparison is not
1074 const Pointer &P = S.Stk.peek<Pointer>(); in CMP3()
1177 const Pointer &Ptr = S.Current->getLocalPointer(I); in GetLocal()
1208 /// 1) Peeks a pointer on the stack
1209 /// 2) Pushes the value of the pointer's field on the stack
1212 const Pointer &Obj = S.Stk.peek<Pointer>(); in GetField()
1217 const Pointer &Field = Obj.atField(I); in GetField()
1227 const Pointer &Obj = S.Stk.peek<Pointer>(); in SetField()
1232 const Pointer &Field = Obj.atField(I); in SetField()
1240 /// 1) Pops a pointer from the stack
1241 /// 2) Pushes the value of the pointer's field on the stack
1244 const Pointer &Obj = S.Stk.pop<Pointer>(); in GetFieldPop()
1249 const Pointer &Field = Obj.atField(I); in GetFieldPop()
1260 const Pointer &This = S.Current->getThis(); in GetThisField()
1263 const Pointer &Field = This.atField(I); in GetThisField()
1275 const Pointer &This = S.Current->getThis(); in SetThisField()
1278 const Pointer &Field = This.atField(I); in SetThisField()
1287 const Pointer &Ptr = S.P.getPtrGlobal(I); in GetGlobal()
1305 const Pointer &Ptr = S.P.getPtrGlobal(I); in GetGlobalUnchecked()
1320 const Pointer &P = S.P.getGlobal(I); in InitGlobal()
1332 const Pointer &Ptr = S.P.getGlobal(I); in InitGlobalTemp()
1355 const Pointer &P = S.Stk.peek<Pointer>(); in InitGlobalTempComp()
1374 const Pointer &This = S.Current->getThis(); in InitThisField()
1377 const Pointer &Field = This.atField(I); in InitThisField()
1383 // FIXME: The Field pointer here is too much IMO and we could instead just
1391 const Pointer &This = S.Current->getThis(); in InitThisBitField()
1394 const Pointer &Field = This.atField(FieldOffset); in InitThisBitField()
1405 const Pointer &This = S.Current->getThis(); in InitThisFieldActive()
1408 const Pointer &Field = This.atField(I); in InitThisFieldActive()
1416 /// 2) Peeks a pointer from the stack
1417 /// 3) Pushes the value to field I of the pointer on the stack
1421 const Pointer &Field = S.Stk.peek<Pointer>().atField(I); in InitField()
1432 const Pointer &Field = S.Stk.peek<Pointer>().atField(F->Offset); in InitBitField()
1442 const Pointer &Ptr = S.Stk.pop<Pointer>(); in InitFieldActive()
1443 const Pointer &Field = Ptr.atField(I); in InitFieldActive()
1455 S.Stk.push<Pointer>(S.Current->getLocalPointer(I)); in GetPtrLocal()
1463 S.Stk.push<Pointer>(S.Current->getParamPointer(I)); in GetPtrParam()
1468 S.Stk.push<Pointer>(S.P.getPtrGlobal(I)); in GetPtrGlobal()
1472 /// 1) Peeks a Pointer
1473 /// 2) Pushes Pointer.atField(Off) on the stack
1475 const Pointer &Ptr = S.Stk.peek<Pointer>(); in GetPtrField()
1492 S.Stk.push<Pointer>(Ptr.atField(Off)); in GetPtrField()
1497 const Pointer &Ptr = S.Stk.pop<Pointer>(); in GetPtrFieldPop()
1515 S.Stk.push<Pointer>(Ptr.atField(Off)); in GetPtrFieldPop()
1522 const Pointer &This = S.Current->getThis(); in GetPtrThisField()
1525 S.Stk.push<Pointer>(This.atField(Off)); in GetPtrThisField()
1530 const Pointer &Ptr = S.Stk.pop<Pointer>(); in GetPtrActiveField()
1535 Pointer Field = Ptr.atField(Off); in GetPtrActiveField()
1538 S.Stk.push<Pointer>(std::move(Field)); in GetPtrActiveField()
1545 const Pointer &This = S.Current->getThis(); in GetPtrActiveThisField()
1548 Pointer Field = This.atField(Off); in GetPtrActiveThisField()
1551 S.Stk.push<Pointer>(std::move(Field)); in GetPtrActiveThisField()
1556 const Pointer &Ptr = S.Stk.pop<Pointer>(); in GetPtrDerivedPop()
1564 S.Stk.push<Pointer>(Ptr.atFieldSub(Off)); in GetPtrDerivedPop()
1569 const Pointer &Ptr = S.Stk.peek<Pointer>(); in GetPtrBase()
1574 S.Stk.push<Pointer>(Ptr.atField(Off)); in GetPtrBase()
1579 const Pointer &Ptr = S.Stk.pop<Pointer>(); in GetPtrBasePop()
1584 S.Stk.push<Pointer>(Ptr.atField(Off)); in GetPtrBasePop()
1597 const Pointer &This = S.Current->getThis(); in GetPtrThisBase()
1600 S.Stk.push<Pointer>(This.atField(Off)); in GetPtrThisBase()
1605 const Pointer &Ptr = S.Stk.pop<Pointer>(); in FinishInitPop()
1614 const Pointer &Ptr = S.Stk.peek<Pointer>(); in FinishInit()
1628 const Pointer &Ptr) { in VirtBaseHelper()
1629 Pointer Base = Ptr; in VirtBaseHelper()
1634 S.Stk.push<Pointer>(Base.atField(VirtBase->Offset)); in VirtBaseHelper()
1641 const Pointer &Ptr = S.Stk.pop<Pointer>(); in GetPtrVirtBasePop()
1652 const Pointer &This = S.Current->getThis(); in GetPtrThisVirtBase()
1664 const Pointer &Ptr = S.Stk.peek<Pointer>(); in Load()
1675 const Pointer &Ptr = S.Stk.pop<Pointer>(); in LoadPop()
1687 const Pointer &Ptr = S.Stk.peek<Pointer>(); in Store()
1699 const Pointer &Ptr = S.Stk.pop<Pointer>(); in StorePop()
1711 const Pointer &Ptr = S.Stk.peek<Pointer>(); in StoreBitField()
1726 const Pointer &Ptr = S.Stk.pop<Pointer>(); in StoreBitFieldPop()
1741 const Pointer &Ptr = S.Stk.peek<Pointer>(); in Init()
1754 const Pointer &Ptr = S.Stk.pop<Pointer>(); in InitPop()
1763 /// 2) Peeks a pointer and gets its index \Idx
1764 /// 3) Sets the value on the pointer, leaving the pointer on the stack.
1768 const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx); in InitElem()
1778 /// The same as InitElem, but pops the pointer as well.
1782 const Pointer &Ptr = S.Stk.pop<Pointer>().atIndex(Idx); in InitElemPop()
1793 const Pointer &Src = S.Stk.pop<Pointer>(); in Memcpy()
1794 Pointer &Dest = S.Stk.peek<Pointer>(); in Memcpy()
1804 const auto &Base = S.Stk.pop<Pointer>(); in ToMemberPtr()
1813 if (std::optional<Pointer> Ptr = MP.toPointer(S.Ctx)) { in CastMemberPtrPtr()
1814 S.Stk.push<Pointer>(*Ptr); in CastMemberPtrPtr()
1826 const Pointer &Ptr) { in OffsetHelper()
1827 // A zero offset does not change the pointer. in OffsetHelper()
1829 S.Stk.push<Pointer>(Ptr); in OffsetHelper()
1900 // When the pointer is one-past-end, going back to index 0 is the only in OffsetHelper()
1904 S.Stk.push<Pointer>(Ptr.asBlockPointer().Pointee, in OffsetHelper()
1909 S.Stk.push<Pointer>(Ptr.atIndex(static_cast<uint64_t>(Result))); in OffsetHelper()
1916 const Pointer &Ptr = S.Stk.pop<Pointer>(); in AddOffset()
1923 const Pointer &Ptr = S.Stk.pop<Pointer>(); in SubOffset()
1929 const Pointer &Ptr) { in IncDecPtrHelper()
1935 const Pointer &P = Ptr.deref<Pointer>(); in IncDecPtrHelper()
1940 S.Stk.push<Pointer>(P); in IncDecPtrHelper()
1948 Ptr.deref<Pointer>() = S.Stk.pop<Pointer>(); in IncDecPtrHelper()
1953 const Pointer &Ptr = S.Stk.pop<Pointer>(); in IncPtr()
1962 const Pointer &Ptr = S.Stk.pop<Pointer>(); in DecPtr()
1970 /// 1) Pops a Pointer from the stack.
1971 /// 2) Pops another Pointer from the stack.
1975 const Pointer &LHS = S.Stk.pop<Pointer>(); in SubPtr()
1976 const Pointer &RHS = S.Stk.pop<Pointer>(); in SubPtr()
1983 if (!Pointer::hasSameBase(LHS, RHS) && S.getLangOpts().CPlusPlus) { in SubPtr()
2132 const Pointer &Ptr = S.Stk.pop<Pointer>(); in CastPointerIntegral()
2147 const Pointer &Ptr = S.Stk.pop<Pointer>(); in CastPointerIntegralAP()
2163 const Pointer &Ptr = S.Stk.pop<Pointer>(); in CastPointerIntegralAPS()
2178 const auto &Ptr = S.Stk.peek<Pointer>(); in PtrPtrCast()
2236 const Pointer &This = S.Current->getThis(); in This()
2240 // Ensure the This pointer has been cast to the correct base. in This()
2249 S.Stk.push<Pointer>(This); in This()
2257 S.Stk.push<Pointer>(S.Current->getRVOPtr()); in RVOPtr()
2363 const Pointer &Ptr = S.Stk.pop<Pointer>(); in NarrowPtr()
2364 S.Stk.push<Pointer>(Ptr.narrow()); in NarrowPtr()
2369 const Pointer &Ptr = S.Stk.pop<Pointer>(); in ExpandPtr()
2370 S.Stk.push<Pointer>(Ptr.expand()); in ExpandPtr()
2375 // 2) Peeks a pointer
2376 // 3) Pushes a new pointer that's a narrowed array
2377 // element of the peeked pointer with the value
2380 // This leaves the original pointer on the stack and pushes a new one
2385 const Pointer &Ptr = S.Stk.peek<Pointer>(); in ArrayElemPtr()
2401 const Pointer &Ptr = S.Stk.pop<Pointer>(); in ArrayElemPtrPop()
2416 const Pointer &Ptr = S.Stk.peek<Pointer>(); in ArrayElem()
2427 const Pointer &Ptr = S.Stk.pop<Pointer>(); in ArrayElemPop()
2438 const auto &SrcPtr = S.Stk.pop<Pointer>(); in CopyArray()
2439 const auto &DestPtr = S.Stk.peek<Pointer>(); in CopyArray()
2442 const Pointer &SP = SrcPtr.atIndex(SrcIndex + I); in CopyArray()
2447 const Pointer &DP = DestPtr.atIndex(DestIndex + I); in CopyArray()
2454 /// Just takes a pointer and checks if it's an incomplete
2457 const Pointer &Ptr = S.Stk.pop<Pointer>(); in ArrayDecay()
2460 S.Stk.push<Pointer>(Ptr); in ArrayDecay()
2468 S.Stk.push<Pointer>(Ptr.atIndex(0)); in ArrayDecay()
2483 const Pointer &ThisPtr = S.Stk.peek<Pointer>(ThisOffset); in CallVar()
2487 // skip the CheckInvoke, since the ThisPtr is a null pointer in CallVar()
2534 const Pointer &ThisPtr = S.Stk.peek<Pointer>(ThisOffset); in Call()
2538 // skip the CheckInvoke, since the ThisPtr is a null pointer in Call()
2583 Pointer &ThisPtr = S.Stk.peek<Pointer>(ThisOffset); in CallVirt()
2611 // FieldDesc of our pointer, just get the DeclDesc instead, which in CallVirt()
2688 S.Stk.push<Pointer>(static_cast<uint64_t>(IntVal), Desc); in GetIntPtr()
2700 S.Stk.push<Pointer>(MP.getBase()); in GetMemberPtrBase()
2853 S.Stk.push<Pointer>(B, sizeof(InlineDescriptor)); in Alloc()
2870 S.Stk.push<Pointer>(0, nullptr); in AllocN()
2878 S.Stk.push<Pointer>(B, sizeof(InlineDescriptor)); in AllocN()
2896 S.Stk.push<Pointer>(0, ElementDesc); in AllocCN()
2905 S.Stk.push<Pointer>(B, sizeof(InlineDescriptor)); in AllocCN()
2918 // Extra scope for this so the block doesn't have this pointer in Free()
2920 const Pointer &Ptr = S.Stk.pop<Pointer>(); in Free()