[PATCH] D27913: [XRay] Fix assertion failure on empty machine basic blocks (PR 31424)

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 01:08:55 PST 2016


dberris marked an inline comment as done.
dberris added a comment.

Thanks @chandlerc!



================
Comment at: lib/CodeGen/XRayInstrumentation.cpp:135
+  auto MBI =
+      std::find_if(MF.begin(), MF.end(),
+                   [&](const MachineBasicBlock &MBB) { return !MBB.empty(); });
----------------
chandlerc wrote:
> You can use just `find_if(MF, ...)` -- we have a range based version in the `llvm` namespace.
Awesome! I keep forgetting that. :)


https://reviews.llvm.org/D27913





More information about the llvm-commits mailing list