[C++11] Add two range adaptor views to User: operands and
authorChandler Carruth <chandlerc@gmail.com>
Mon, 3 Mar 2014 10:42:58 +0000 (10:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 3 Mar 2014 10:42:58 +0000 (10:42 +0000)
commit3dfabcb249ec77bc9d2cd76e4d64bb0c59527f09
treef5f249ec59210cff108db3c467ddc8ad86a1effc
parent26abef7b5a3f239204a1ad605a88b99a1ef878c3
[C++11] Add two range adaptor views to User: operands and
operand_values. The first provides a range view over operand Use
objects, and the second provides a range view over the Value*s being
used by those operands.

The naming is "STL-style" rather than "LLVM-style" because we have
historically named iterator methods STL-style, and range methods seem to
have far more in common with their iterator counterparts than with
"normal" APIs. Feel free to bikeshed on this one if you want, I'm happy
to change these around if people feel strongly.

I've switched code in SROA and LCG to exercise these mostly to ensure
they work correctly -- we don't really have an easy way to unittest this
and they're trivial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202687 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/User.h
lib/Analysis/LazyCallGraph.cpp
lib/Transforms/Scalar/SROA.cpp