llvm-project/llvm/lib/Target/NVPTX
Chandler Carruth cdf4788401 [C++11] Add range based accessors for the Use-Def chain of a Value.
This requires a number of steps.
1) Move value_use_iterator into the Value class as an implementation
   detail
2) Change it to actually be a *Use* iterator rather than a *User*
   iterator.
3) Add an adaptor which is a User iterator that always looks through the
   Use to the User.
4) Wrap these in Value::use_iterator and Value::user_iterator typedefs.
5) Add the range adaptors as Value::uses() and Value::users().
6) Update *all* of the callers to correctly distinguish between whether
   they wanted a use_iterator (and to explicitly dig out the User when
   needed), or a user_iterator which makes the Use itself totally
   opaque.

Because #6 requires churning essentially everything that walked the
Use-Def chains, I went ahead and added all of the range adaptors and
switched them to range-based loops where appropriate. Also because the
renaming requires at least churning every line of code, it didn't make
any sense to split these up into multiple commits -- all of which would
touch all of the same lies of code.

The result is still not quite optimal. The Value::use_iterator is a nice
regular iterator, but Value::user_iterator is an iterator over User*s
rather than over the User objects themselves. As a consequence, it fits
a bit awkwardly into the range-based world and it has the weird
extra-dereferencing 'operator->' that so many of our iterators have.
I think this could be fixed by providing something which transforms
a range of T&s into a range of T*s, but that *can* be separated into
another patch, and it isn't yet 100% clear whether this is the right
move.

However, this change gets us most of the benefit and cleans up
a substantial amount of code around Use and User. =]

llvm-svn: 203364
2014-03-09 03:16:01 +00:00
..
InstPrinter Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCTargetDesc Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
TargetInfo Prune redundant dependencies in LLVMBuild.txt. 2013-12-11 00:30:57 +00:00
CMakeLists.txt [CMake] Let add_public_tablegen_target() provide intrinsics_gen, too. 2013-11-28 17:04:31 +00:00
LLVMBuild.txt Prune redundant dependencies in LLVMBuild.txt. 2013-12-11 00:30:57 +00:00
Makefile
ManagedStringPool.h Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-04 01:31:24 +00:00
NVPTX.h [NVPTX] Remove unused prototypes 2013-07-22 17:04:40 +00:00
NVPTX.td Change the default of AsmWriterClassName and isMCAsmWriter. 2013-12-02 04:55:42 +00:00
NVPTXAllocaHoisting.cpp ARM: implement ldrex, strex and clrex intrinsics 2013-07-16 09:46:55 +00:00
NVPTXAllocaHoisting.h Make DataLayout a plain object, not a pass. 2014-02-25 17:30:31 +00:00
NVPTXAsmPrinter.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
NVPTXAsmPrinter.h Remove unused method declaration 2014-03-07 22:19:10 +00:00
NVPTXFrameLowering.cpp [NVPTX] Fix bug in stack code generation causes by MC conversion 2013-08-06 14:13:31 +00:00
NVPTXFrameLowering.h [NVPTX] Run clang-format on all NVPTX sources. 2013-03-30 14:29:21 +00:00
NVPTXGenericToNVVM.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
NVPTXISelDAGToDAG.cpp [NVPTX] Fix off-by-one error when creating the VT list for an SDNode 2013-12-05 12:58:00 +00:00
NVPTXISelDAGToDAG.h [NVPTX] Use approximate FP ops when unsafe-fp-math is used, and append 2013-07-22 12:18:04 +00:00
NVPTXISelLowering.cpp [Modules] Move CallSite into the IR library where it belogs. It is 2014-03-04 11:01:28 +00:00
NVPTXISelLowering.h [NVPTX] Fix handling of indirect calls 2013-11-15 12:30:04 +00:00
NVPTXInstrFormats.td
NVPTXInstrInfo.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
NVPTXInstrInfo.h [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
NVPTXInstrInfo.td [NVPTX] Add missing patterns for div.approx with immediate denominator 2014-01-21 14:40:05 +00:00
NVPTXIntrinsics.td [NVPTX] Add isel patterns for [reg+offset] form of ldg/ldu. 2013-07-01 12:58:52 +00:00
NVPTXLowerAggrCopies.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
NVPTXLowerAggrCopies.h Make DataLayout a plain object, not a pass. 2014-02-25 17:30:31 +00:00
NVPTXMCExpr.cpp [NVPTX] Start conversion to MC infrastructure 2013-08-06 14:13:27 +00:00
NVPTXMCExpr.h [NVPTX] Start conversion to MC infrastructure 2013-08-06 14:13:27 +00:00
NVPTXPrologEpilogPass.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
NVPTXRegisterInfo.cpp [NVPTX] Remove i8 register class. PTX support for i8 (.b8, .u8, .s8) is rather poor and we're better off just ignoring it and letting LLVM expand all i8 ops out to i16. 2013-06-28 17:57:59 +00:00
NVPTXRegisterInfo.h Don't pass in the TargetInstrInfo into the register info object. It doesn't use it. 2013-06-19 21:59:00 +00:00
NVPTXRegisterInfo.td [NVPTX] Cut down on physical register defs 2013-07-01 12:59:06 +00:00
NVPTXSection.h [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
NVPTXSplitBBatBar.cpp [Modules] Move InstIterator out of the Support library, where it had no 2014-03-04 10:30:26 +00:00
NVPTXSplitBBatBar.h [stackprotector] Use analysis from the StackProtector pass for stack layout in PEI a nd LocalStackSlot passes. 2013-12-19 03:17:11 +00:00
NVPTXSubtarget.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
NVPTXSubtarget.h Turn NVPTXSubtarget::getDataLayout into a static function. 2013-12-14 06:36:30 +00:00
NVPTXTargetMachine.cpp Switch all uses of LLVM_OVERRIDE to just use 'override' directly. 2014-03-02 09:09:27 +00:00
NVPTXTargetMachine.h [NVPTX] Run clang-format on all NVPTX sources. 2013-03-30 14:29:21 +00:00
NVPTXTargetObjectFile.h Switch all uses of LLVM_OVERRIDE to just use 'override' directly. 2014-03-02 09:09:27 +00:00
NVPTXUtilities.cpp [Modules] Move InstIterator out of the Support library, where it had no 2014-03-04 10:30:26 +00:00
NVPTXUtilities.h [NVPTX] Run clang-format on all NVPTX sources. 2013-03-30 14:29:21 +00:00
NVPTXVector.td
NVPTXutil.cpp [NVPTX] Run clang-format on all NVPTX sources. 2013-03-30 14:29:21 +00:00
NVPTXutil.h
NVVMReflect.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
cl_common_defines.h [NVPTX] Run clang-format on all NVPTX sources. 2013-03-30 14:29:21 +00:00