[PATCH] D87518: [analyzer][Liveness][NFC] Remove an unneeded pass to collect variables that appear in an assignment

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 10:51:46 PDT 2020


xazax.hun added inline comments.


================
Comment at: clang/lib/Analysis/LiveVariables.cpp:326
 void TransferFunctions::VisitBinaryOperator(BinaryOperator *B) {
+  if (LV.killAtAssign && B->getOpcode() == BO_Assign) {
+    if (const auto *DR = dyn_cast<DeclRefExpr>(B->getLHS()->IgnoreParens())) {
----------------
xazax.hun wrote:
> Do we actually need to specially handle `BO_Assign`? What about `+=` and other assignment operators? I know that the original code did not consider them, but I do not have a good intuition why. 
Never mind, I those operators are reads too :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87518



More information about the cfe-commits mailing list