================ @@ -95,31 +93,23 @@ class Pointer { static constexpr unsigned RootPtrMark = ~0u; public: - Pointer() { - StorageKind = Storage::Int; - PointeeStorage.Int.Value = 0; - PointeeStorage.Int.Desc = nullptr; - } - Pointer(IntPointer &&IntPtr) : StorageKind(Storage::Int) { - PointeeStorage.Int = std::move(IntPtr); - } + Pointer() : StorageKind(Storage::Int), Int{nullptr, 0} {} + Pointer(IntPointer &&IntPtr) + : StorageKind(Storage::Int), Int(std::move(IntPtr)) {} Pointer(Block *B); Pointer(Block *B, uint64_t BaseAndOffset); Pointer(const Pointer &P); Pointer(Pointer &&P); Pointer(uint64_t Address, const Descriptor *Desc, uint64_t Offset = 0) - : Offset(Offset), StorageKind(Storage::Int) { - PointeeStorage.Int.Value = Address; - PointeeStorage.Int.Desc = Desc; - } + : Offset(Offset), StorageKind(Storage::Int), Int{Desc, Address} {} Pointer(const Function *F, uint64_t Offset = 0) - : Offset(Offset), StorageKind(Storage::Fn) { - PointeeStorage.Fn = FunctionPointer(F); + : Offset(Offset), StorageKind(Storage::Fn), Fn(F) { ---------------- shafik wrote:
Why do you set `Fn` twice, once in the mem-init-list and then in the body of the constructor? https://github.com/llvm/llvm-project/pull/154405 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits