[PATCH] D34027: [XRay] Fix computation of function size subject to XRay threshold

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 15:49:26 PDT 2017


dberris accepted this revision.
dberris added a comment.
This revision is now accepted and ready to land.

Thanks @rSerge -- just one suggestion for readability.



================
Comment at: lib/CodeGen/XRayInstrumentation.cpp:146-148
+    typedef MachineFunction::const_iterator BasicBlockIterator;
+    for (BasicBlockIterator it = MF.begin(); it != MF.end(); it++)
+      MICount += it->size();
----------------
Could this be cleaner as a range-based for-loop?

```
int64_t MICount = 0;
for (const auto& MBB : MF)
  MICount += MBB.size();
```


https://reviews.llvm.org/D34027





More information about the llvm-commits mailing list