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

Serge Rogatch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 05:46:42 PDT 2017


rSerge added inline comments.


================
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();
----------------
dberris wrote:
> Could this be cleaner as a range-based for-loop?
> 
> ```
> int64_t MICount = 0;
> for (const auto& MBB : MF)
>   MICount += MBB.size();
> ```
Sure, thanks, changing it.


https://reviews.llvm.org/D34027





More information about the llvm-commits mailing list