Move BB succ_iterator to be inside TerminatorInst. NFC.
authorPete Cooper <peter_cooper@apple.com>
Wed, 5 Aug 2015 17:43:01 +0000 (17:43 +0000)
committerPete Cooper <peter_cooper@apple.com>
Wed, 5 Aug 2015 17:43:01 +0000 (17:43 +0000)
commitbaa8ef1276a1cb4388bd06035ba07f5483667900
tree740b910e8894d5824a53bf216e95d85e0a90e93b
parent13fa799e5f34e743fdf6455b2bd24a04c0434dfb
Move BB succ_iterator to be inside TerminatorInst.  NFC.

To get the successors of a BB we currently do successors(BB) which
ultimately walks the successors of the BB's terminator.

This moves the iterator to TerminatorInst as thats what we're actually
using to do the iteration, and adds a member function to TerminatorInst
to allow us to iterate directly over successors given an instruction.

For example, we can now do

  for (auto *Succ : BI->successors())

instead of

  for (unsigned i = 0, e = BI->getNumSuccessors(); i != e; ++i)

Reviewed by Tobias Grosser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244074 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/CFG.h
include/llvm/IR/InstrTypes.h
lib/Target/AArch64/AArch64FastISel.cpp