[PATCH] D33533: [IR] Add an iterator and range accessor for the PHI nodes of a basic block.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 19:55:16 PDT 2017


chandlerc created this revision.
Herald added subscribers: mgorny, mcrosier.

This allows writing much more natural and readable range based for loops
directly over the PHI nodes. It also takes advantage of the same tricks
for terminating the sequence as the hand coded versions.

I've replaced one example of this mostly to showcase the difference and
I've added a unit test to make sure the facilities really work the way
they're intended. I want to use this inside of SimpleLoopUnswitch but it
seems generally nice.


https://reviews.llvm.org/D33533

Files:
  include/llvm/IR/BasicBlock.h
  lib/IR/BasicBlock.cpp
  unittests/IR/BasicBlockTest.cpp
  unittests/IR/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33533.100197.patch
Type: text/x-patch
Size: 6597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170525/347e4ff2/attachment.bin>


More information about the llvm-commits mailing list