[PATCH] D129382: Add BAT testing framework

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 17:23:30 PDT 2022


maksfb accepted this revision.
maksfb added inline comments.
This revision is now accepted and ready to land.


================
Comment at: bolt/lib/Passes/ValidateInternalCalls.cpp:96
   for (BinaryBasicBlock &BB : Function) {
     for (auto II = BB.begin(); II != BB.end(); ++II) {
       MCInst &Inst = *II;
----------------
rafauler wrote:
> maksfb wrote:
> > Unrelated to this patch: we need to iterate over the copy of BBs as we increase the size inside the loop potentially invalidating the iterator.
> When this function creates a new block and potentially invalidates iterators (for both BBs and mcinsts), it stops the loop (returns true). So there is no issue with invalidation here.
I see now. Agree it will not crash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129382



More information about the llvm-commits mailing list