Lines Matching defs:Pointer
1 //===--- Pointer.h - Types for the constexpr VM -----------------*- C++ -*-===//
28 class Pointer;
33 class Pointer;
34 inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Pointer &P);
55 /// In the simplest form, a Pointer has a Block* (the pointee) and both Base
65 /// Pointee->rawData() + Pointer.Offset.
79 class Pointer {
85 Pointer() {
90 Pointer(Block *B);
91 Pointer(Block *B, uint64_t BaseAndOffset);
92 Pointer(const Pointer &P);
93 Pointer(Pointer &&P);
94 Pointer(uint64_t Address, const Descriptor *Desc, uint64_t Offset = 0)
99 ~Pointer();
101 void operator=(const Pointer &P);
102 void operator=(Pointer &&P);
105 bool operator==(const Pointer &P) const {
118 bool operator!=(const Pointer &P) const { return !(P == *this); }
137 [[nodiscard]] Pointer atIndex(uint64_t Idx) const {
139 return Pointer(asIntPointer().Value, asIntPointer().Desc, Idx);
142 return Pointer(asBlockPointer().Pointee, RootPtrMark,
149 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base,
154 [[nodiscard]] Pointer atField(unsigned Off) const {
157 return Pointer(asIntPointer().Value + Field, asIntPointer().Desc);
158 return Pointer(asBlockPointer().Pointee, Field, Field);
163 [[nodiscard]] Pointer atFieldSub(unsigned Off) const {
166 return Pointer(asBlockPointer().Pointee, O, O);
170 [[nodiscard]] Pointer narrow() const {
178 // Pointer to an array of base types - enter block.
180 return Pointer(asBlockPointer().Pointee, sizeof(InlineDescriptor),
183 // Pointer is one past end - magic offset marks that.
185 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base,
195 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base,
199 // Pointer is to a field or array element - enter it.
201 return Pointer(asBlockPointer().Pointee, Offset, Offset);
208 return Pointer(asBlockPointer().Pointee, NewBase, NewBase);
212 [[nodiscard]] Pointer expand() const {
223 return Pointer(Pointee, asBlockPointer().Base,
233 return Pointer(Pointee, RootPtrMark, 0);
243 return Pointer(Pointee, Next, Offset);
288 [[nodiscard]] Pointer getBase() const {
291 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base, 0);
294 return Pointer(asBlockPointer().Pointee, NewBase, NewBase);
297 [[nodiscard]] Pointer getArray() const {
300 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base, 0);
303 return Pointer(asBlockPointer().Pointee, asBlockPointer().Base,
332 [[nodiscard]] Pointer getDeclPtr() const {
333 return Pointer(asBlockPointer().Pointee);
400 /// Pointer points directly to a block.
629 ComparisonCategoryResult compare(const Pointer &Other) const {
642 static bool hasSameBase(const Pointer &A, const Pointer &B);
644 static bool hasSameArray(const Pointer &A, const Pointer &B);
657 Pointer(Block *Pointee, unsigned Base, uint64_t Offset);
688 Pointer *Prev = nullptr;
690 Pointer *Next = nullptr;
699 inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Pointer &P) {