llvm-6502/include/llvm/IR
Chandler Carruth 36b699f2b1 [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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203364 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-09 03:16:01 +00:00
..
Argument.h Add an inalloca flag to allocas 2014-01-17 23:58:17 +00:00
AssemblyAnnotationWriter.h Move the LLVM IR asm writer header files into the IR directory, as they 2014-01-07 12:34:26 +00:00
Attributes.h [C++11] Expand and eliminate the LLVM_ENUM_INT_TYPE() macro 2014-03-02 03:20:38 +00:00
AutoUpgrade.h [Layering] Move AutoUpgrade.h into the IR library where its 2014-03-05 10:34:14 +00:00
BasicBlock.h Use DataLayout from the module when easily available. 2014-02-25 23:25:17 +00:00
CallingConv.h [ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret' 2014-01-31 17:41:22 +00:00
CallSite.h [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
CFG.h [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
CMakeLists.txt [CMake] intrinsics_gen: Use add_public_tablegen_target(). 2014-02-20 13:42:16 +00:00
Constant.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
ConstantFolder.h [Modules] Move the ConstantFolder into the IR library where it can 2014-03-04 12:02:47 +00:00
ConstantRange.h [Modules] Move the ConstantRange class into the IR library. This is 2014-03-04 12:24:34 +00:00
Constants.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
DataLayout.h Fix typo. Thanks to Roman Divacky for noticing it. 2014-02-26 17:05:38 +00:00
DebugInfo.h [Layering] Move DebugInfo.h into the IR library where its implementation 2014-03-06 00:46:21 +00:00
DebugLoc.h [Layering] Move DebugLoc.h into the IR library. The implementation 2014-03-05 10:30:38 +00:00
DerivedTypes.h Fix the segfault reported in PR 11990. 2013-12-07 00:13:34 +00:00
DiagnosticInfo.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
DiagnosticPrinter.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
DIBuilder.h [Layering] Move DebugInfo.h into the IR library where its implementation 2014-03-06 00:46:21 +00:00
Dominators.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
Function.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
GetElementPtrTypeIterator.h [Modules] Move GetElementPtrTypeIterator into the IR library. As its 2014-03-04 10:40:04 +00:00
GlobalAlias.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
GlobalValue.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
GlobalVariable.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
GVMaterializer.h [Layering] Move GVMaterializer.h into the IR library where its 2014-03-06 03:50:29 +00:00
InlineAsm.h [C++11] Expand and eliminate the LLVM_ENUM_INT_TYPE() macro 2014-03-02 03:20:38 +00:00
InstIterator.h [Modules] Move InstIterator out of the Support library, where it had no 2014-03-04 10:30:26 +00:00
InstrTypes.h Teach lint about address spaces 2014-03-06 17:33:55 +00:00
Instruction.def Add addrspacecast instruction. 2013-11-15 01:34:59 +00:00
Instruction.h [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
Instructions.h [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
InstVisitor.h [Layering] Move InstVisitor.h into the IR library as it is pretty 2014-03-06 03:23:41 +00:00
IntrinsicInst.h Add some convenience accessors for the underlying Use of an operand. 2014-02-25 03:34:17 +00:00
Intrinsics.h Enable variable arguments support for intrinsics. 2013-10-31 17:18:11 +00:00
Intrinsics.td Change math intrinsic attributes from readonly to readnone. These 2014-03-06 00:18:15 +00:00
IntrinsicsAArch64.td AArch64: simplify tbl/tbx polymorphism 2014-02-26 11:55:09 +00:00
IntrinsicsARM.td ARM: use natural LLVM IR for vshll instructions 2014-02-10 16:20:29 +00:00
IntrinsicsHexagon.td
IntrinsicsMips.td [mips][msa] Add DLSA instruction. 2014-02-10 12:05:17 +00:00
IntrinsicsNVVM.td [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
IntrinsicsPowerPC.td Implement PPC counter loops as a late IR-level pass 2013-05-15 21:37:41 +00:00
IntrinsicsR600.td
IntrinsicsX86.td Changed attributes of all gather intrinsics from IntrReadMem to IntrReadArgMem as they access only memory based on argument. Patch by Robert Khasanov. 2014-02-11 04:05:33 +00:00
IntrinsicsXCore.td [XCore] Add intrinsic for CLRPT (clear port time) instruction. 2014-02-25 17:31:15 +00:00
IRBuilder.h [Modules] Move the ConstantFolder into the IR library where it can 2014-03-04 12:02:47 +00:00
IRPrintingPasses.h [PM] Fix stale header blocker, found by Duncan Smith in code review! 2014-01-14 05:50:19 +00:00
LeakDetector.h [Modules] Move the LeakDetector header into the IR library where the 2014-03-04 12:46:06 +00:00
LegacyPassManager.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
LegacyPassManagers.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
LegacyPassNameParser.h [C++11] Add 'override' keyword to IR library. 2014-03-05 06:35:38 +00:00
LLVMContext.h Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
Mangler.h Add back r201608, r201622, r201624 and r201625 2014-02-19 17:23:20 +00:00
MDBuilder.h Struct-path aware TBAA: change the format of TBAAStructType node. 2013-04-27 00:26:11 +00:00
Metadata.h Change the tag on this iterator to bidir and implement enough operators to make it true. 2014-03-06 02:02:43 +00:00
Module.h Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
NoFolder.h [Modules] Move the NoFolder into the IR library as it creates 2014-03-04 12:05:47 +00:00
OperandTraits.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Operator.h [Modules] Move GetElementPtrTypeIterator into the IR library. As its 2014-03-04 10:40:04 +00:00
PassManager.h [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-08 08:27:28 +00:00
PatternMatch.h [Modules] Move the LLVM IR pattern match header into the IR library, it 2014-03-04 11:08:18 +00:00
PredIteratorCache.h [Modules] Move the PredIteratorCache into the IR library -- it is 2014-03-04 12:09:19 +00:00
SymbolTableListTraits.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Type.h Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
TypeBuilder.h #include <climits> instead of <limits.h> in C++ header file. 2013-06-13 23:49:09 +00:00
TypeFinder.h Move TypeFinder.h into the IR tree, it clearly belongs with the IR library. 2013-01-07 15:43:51 +00:00
Use.h [C++11] Sink the iterator over a Value's users into the Value type 2014-03-05 01:50:35 +00:00
User.h [cleanup] Add a getOperandNo method to the Use class and implement it 2014-03-04 09:19:43 +00:00
Value.h [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
ValueHandle.h [Modules] Move ValueHandle into the IR library where Value itself lives. 2014-03-04 11:17:44 +00:00
ValueMap.h [C++11] Replace LLVM-style type traits with C++11 standard ones. 2014-03-07 14:42:25 +00:00
ValueSymbolTable.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
Verifier.h [PM] Wire up the Verifier for the new pass manager and connect it to the 2014-01-20 11:34:08 +00:00