kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks a lot for doing this, i think this makes it a lot more obvious that this 
is a tristate struct rather than invalid just being a bit that can bit set for 
both null and non-null pointers.



================
Comment at: clang/include/clang/Sema/Ownership.h:155
+  PtrTy Val = {};
+  bool Invalid;
+
----------------
nit: also initialize Invalid to false?


================
Comment at: clang/include/clang/Sema/Ownership.h:204
+  PtrTy get() const {
+    void *VP = reinterpret_cast<void *>(Value & ~0x01);
+    return PtrTraits::getFromVoidPointer(VP);
----------------
nit: `Value == InvalidValue ? nullptr : Value` ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158093/new/

https://reviews.llvm.org/D158093

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to