diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/Pointer.h')
-rw-r--r-- | clang/lib/AST/ByteCode/Pointer.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/AST/ByteCode/Pointer.h b/clang/lib/AST/ByteCode/Pointer.h index d17eba5..5bafc5b 100644 --- a/clang/lib/AST/ByteCode/Pointer.h +++ b/clang/lib/AST/ByteCode/Pointer.h @@ -39,6 +39,10 @@ struct BlockPointer { Block *Pointee; /// Start of the current subfield. unsigned Base; + /// Previous link in the pointer chain. + Pointer *Prev; + /// Next link in the pointer chain. + Pointer *Next; }; struct IntPointer { @@ -120,8 +124,8 @@ public: Pointer(Block *Pointee, unsigned Base, uint64_t Offset); ~Pointer(); - void operator=(const Pointer &P); - void operator=(Pointer &&P); + Pointer &operator=(const Pointer &P); + Pointer &operator=(Pointer &&P); /// Equality operators are just for tests. bool operator==(const Pointer &P) const { @@ -725,6 +729,10 @@ public: /// Initializes a field. void initialize() const; + /// Initialize all elements of a primitive array at once. This can be + /// used in situations where we *know* we have initialized *all* elements + /// of a primtive array. + void initializeAllElements() const; /// Activats a field. void activate() const; /// Deactivates an entire strurcutre. @@ -761,7 +769,7 @@ public: if (Offset < Other.Offset) return ComparisonCategoryResult::Less; - else if (Offset > Other.Offset) + if (Offset > Other.Offset) return ComparisonCategoryResult::Greater; return ComparisonCategoryResult::Equal; @@ -828,15 +836,10 @@ private: /// Offset into the storage. uint64_t Offset = 0; - /// Previous link in the pointer chain. - Pointer *Prev = nullptr; - /// Next link in the pointer chain. - Pointer *Next = nullptr; - Storage StorageKind = Storage::Int; union { - BlockPointer BS; IntPointer Int; + BlockPointer BS; FunctionPointer Fn; TypeidPointer Typeid; } PointeeStorage; |