llvm-project/llvm/unittests
Vedant Kumar 75fda2e0a5 [ADT] Make filter_iterator support bidirectional iteration
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
2018-04-25 21:50:09 +00:00
..
ADT [ADT] Make filter_iterator support bidirectional iteration 2018-04-25 21:50:09 +00:00
Analysis [unittests] Change std::sort to llvm::sort in response to r327219 2018-04-07 01:29:45 +00:00
AsmParser
BinaryFormat [dwarf] Unify unknown dwarf enum formatting code 2018-03-21 11:46:37 +00:00
Bitcode Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
CodeGen [CodeGen] Print user-friendly debug locations as MI comments 2018-04-24 11:00:46 +00:00
DebugInfo [ObjectYAML] Add ability for DWARFYAML to calculate DIE lengths 2018-04-20 12:33:49 +00:00
Demangle Fix another bot failure from r329951. 2018-04-13 02:53:26 +00:00
ExecutionEngine Link to AggressiveInstCombine in a few places. Unbreaks build for me. 2018-04-24 08:40:37 +00:00
FuzzMutate [FuzzMutate] Inst deleter doesn't work with PhiNodes 2018-01-25 09:22:18 +00:00
IR [ADT] Make filter_iterator support bidirectional iteration 2018-04-25 21:50:09 +00:00
LineEditor
Linker Fix build for LLVM unittests 2017-09-15 21:12:13 +00:00
MC Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MI [LiveIntervals] Handle moving up dead partial write 2018-02-26 14:42:13 +00:00
Object Fix unittest for buildbot with mips host (32bit big endian) from r295174 2017-02-15 16:03:22 +00:00
ObjectYAML
Option [Option] For typo '-foo', suggest '--foo' 2018-01-09 19:38:04 +00:00
Passes Fix PluginsTests failure on Windows buildbots by enabling it everywhere 2018-04-25 20:16:24 +00:00
ProfileData [unittests] Change std::sort to llvm::sort in response to r327219 2018-04-07 01:29:45 +00:00
Support [Support/Path] Add more tests and improve failure messages of existing ones 2018-04-24 08:29:20 +00:00
Target Reapply "[GlobalISel] Remove the GISelAccessor API." 2017-08-15 22:31:51 +00:00
Transforms Revert "Revert r330403 and r330413." 2018-04-20 13:34:32 +00:00
XRay [XRay][graph] Disambiguate name of type from member name 2017-02-10 06:59:25 +00:00
tools Revert r330027: "[llvm-exegesis] re-enable failing tests after r330026." 2018-04-13 15:19:16 +00:00
CMakeLists.txt [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00