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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 05:55:36 PDT 2020


martong added a comment.

> This problem only exists if we traverse a CFGBlock in order. And Liveness in fact does it reverse order. So a distinct pass is indeed unnecessary, we can note the appearance of the assignment by the time we reach the variable.

Should this patch depend on https://reviews.llvm.org/D87519?



================
Comment at: clang/include/clang/Analysis/CFG.h:1311
+
+  llvm::iterator_range<iterator> nodes() { return *this; }
+  llvm::iterator_range<const_iterator> const_nodes() const { return *this; }
----------------
Do we convert `this` to `CFGBlock *Entry` here? If yes, please comment it there in the code, so others should not be forced to dig up the first data member. (If no then this code is hard to understand.)

Even better, why not `return *Entry`?


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