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
AssemblyAnnotationWriter.h
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
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
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
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
IntrinsicsPowerPC.td
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
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
Mangler.h Add back r201608, r201622, r201624 and r201625 2014-02-19 17:23:20 +00:00
MDBuilder.h
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
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
Type.h
TypeBuilder.h
TypeFinder.h
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
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