[PATCH] D158093: [Sema] Clean up ActionResult type a little. NFCI

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 09:16:10 PDT 2023


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



More information about the cfe-commits mailing list