This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG33e731e62dae: [analyzer][Liveness][NFC] Remove an unneeded
pass to collect variables that… (authored by Szelethus).
Changed prior to commit:
martong added inline comments.
Comment at: clang/include/clang/Analysis/CFG.h:1311
+
+ llvm::iterator_range nodes() { return *this; }
+ llvm::iterator_range const_nodes() const { return *this; }
martong wrote:
> Do we convert `this` to `CFGBlock *Entry` here?
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
xazax.hun added inline comments.
Comment at: clang/lib/Analysis/LiveVariables.cpp:332
if (B->isAssignmentOp()) {
if (!LV.killAtAssign)
return;
Nit: Maybe moving this to the front of the function would simplify the code a
bit.
Repository:
rG
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
LGTM! Looks a lot cleaner this way.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87518/new/
https://reviews.llvm.org/D87518
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(B->getLHS()->IgnoreParens())) {
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(B->getLHS()->IgnoreParens())) {
Szelethus created this revision.
Szelethus added reviewers: xazax.hun, NoQ, vsavchenko, martong, balazske,
baloghadamsoftware, steakhal.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, gamesh411,
dkrupp, donat.nagy, mikhail.ramalho, a.sidorin,