[PATCH] D130596: [StandardInstrumentations] Handle case where block order changes

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 7 13:50:37 PDT 2022


aeubanks added inline comments.


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:625
     HandlePair(&BData, &AData);
-    ++BI;
     ++AI;
----------------
jamieschmeiser wrote:
> I don't understand why you are removing this line.  On exiting the loop, (with your change to the loop) BI == BE or *BI == *AI.  In the latter case, we still want to advance BI or HandlePotentiallyRemovedData will be called with it on the next time through this loop (AI advances and the above loop will enter when BI != BE and HandlePotentiallyRemovedData will be called with BI before it is advanced).  Shouldn't this line be guarded with "if (BI != BE)" instead of being removed?
you're right, fixed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130596



More information about the llvm-commits mailing list