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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 04:21:29 PDT 2023


sammccall marked 2 inline comments as done.
sammccall added inline comments.


================
Comment at: clang/include/clang/Sema/Ownership.h:204
+  PtrTy get() const {
+    void *VP = reinterpret_cast<void *>(Value & ~0x01);
+    return PtrTraits::getFromVoidPointer(VP);
----------------
kadircet wrote:
> nit: `Value == InvalidValue ? nullptr : Value` ?
I think that's probably slower, I don't see how the compiler could avoid actually emitting some sort of conditional.

Clang produces cmov: https://godbolt.org/z/croo6o3q6

I'm not 100% sure it matters, but it's a common path we expect to be trivial so i'd rather not change it here.


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