forked from OSchip/llvm-project
75fda2e0a5
This makes it possible to reverse a filtered range. For example, here's a way to visit memory accesses in a BasicBlock in reverse order: auto MemInsts = reverse(make_filter_range(BB, [](Instruction &I) { return isa<StoreInst>(&I) || isa<LoadInst>(&I); })); for (auto &MI : MemInsts) ... To implement this functionality, I factored out forward iteration functionality into filter_iterator_base, and added a specialization of filter_iterator_impl which supports bidirectional iteration. Thanks to Tim Shen, Zachary Turner, and others for suggesting this design and providing feedback! This version of the patch supersedes the original (https://reviews.llvm.org/D45792). This was motivated by a problem we encountered in D45657: we'd like to visit the non-debug-info instructions in a BasicBlock in reverse order. Testing: check-llvm, check-clang Differential Revision: https://reviews.llvm.org/D45853 llvm-svn: 330875 |
||
---|---|---|
.. | ||
AsmWriterTest.cpp | ||
AttributesTest.cpp | ||
BasicBlockTest.cpp | ||
CFGBuilder.cpp | ||
CFGBuilder.h | ||
CMakeLists.txt | ||
ConstantRangeTest.cpp | ||
ConstantsTest.cpp | ||
DebugInfoTest.cpp | ||
DebugTypeODRUniquingTest.cpp | ||
DeferredDominanceTest.cpp | ||
DominatorTreeBatchUpdatesTest.cpp | ||
DominatorTreeTest.cpp | ||
FunctionTest.cpp | ||
IRBuilderTest.cpp | ||
InstructionsTest.cpp | ||
IntrinsicsTest.cpp | ||
LegacyPassManagerTest.cpp | ||
MDBuilderTest.cpp | ||
ManglerTest.cpp | ||
MetadataTest.cpp | ||
ModuleTest.cpp | ||
PassBuilderCallbacksTest.cpp | ||
PassManagerTest.cpp | ||
PatternMatch.cpp | ||
TypeBuilderTest.cpp | ||
TypesTest.cpp | ||
UseTest.cpp | ||
UserTest.cpp | ||
ValueHandleTest.cpp | ||
ValueMapTest.cpp | ||
ValueTest.cpp | ||
VerifierTest.cpp | ||
WaymarkTest.cpp |