[PATCH] D100733: [clang] NFC: change uses of `Expr->getValueKind` into `is?Value`

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 18 15:55:49 PDT 2021


aaronpuchert added a comment.

The change seems to be correct, but I'm wondering if `x.getValueKind() == VK_*Value` doesn't have one advantage over `x.is*Value()`: it's obvious that this is exclusive with the other values. Especially with `isRValue()` it might not be so obvious, because Clang doesn't follow the C++11 terminology with this.

But it's admittedly shorter, so I'd be willing to approve this.



================
Comment at: clang/lib/Sema/SemaExpr.cpp:5522
     }
     VK = LHSExp->getValueKind();
     if (VK != VK_RValue)
----------------
There might be a certain benefit to using `LHSExp->getValueKind()` above when we use it here again: that makes it more obvious what we're trying to achieve in that `if`. (Namely changing the value category.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100733



More information about the cfe-commits mailing list