llvm-project/llvm/lib/Transforms
Chandler Carruth 0d256c0f5d [IR] Make SwitchInst::CaseIt almost a normal iterator.
This moves it to the iterator facade utilities giving it full random
access semantics, etc. It can also now be used with standard algorithms
like std::all_of and std::any_of and range adaptors like llvm::reverse.

Also make the semantics of iterating match what every other iterator
uses and forbid decrementing past the begin iterator. This was used as
a hacky way to work around iterator invalidation. However, every
instance trying to do this failed to actually avoid touching invalid
iterators despite the clear documentation that the removed and all
subsequent iterators become invalid including the end iterator. So I've
added a return of the next iterator to removeCase and rewritten the
loops that were doing this to correctly follow the iterator pattern of
either incremneting or removing and assigning fresh values to the
iterator and the end.

In one case we were trying to go backwards to make this cleaner but it
doesn't actually work. I've made that code match the code we use
everywhere else to remove cases as we iterate. This changes the order of
cases in one test output and I moved that test to CHECK-DAG so it
wouldn't care -- the order isn't semantically meaningful anyways.

llvm-svn: 298791
2017-03-26 02:49:23 +00:00
..
Coroutines Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
IPO Set the prof weight correctly for call instructions in DeadArgumentElimination. 2017-03-23 23:26:00 +00:00
InstCombine [InstCombine] Change the interface of SimplifyDemandedBits so that it takes the instruction and operand instead of the Use. 2017-03-25 06:52:52 +00:00
Instrumentation [asan] Put ctor/dtor in comdat. 2017-03-25 01:01:11 +00:00
ObjCARC Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
Scalar [IR] Make SwitchInst::CaseIt almost a normal iterator. 2017-03-26 02:49:23 +00:00
Utils [IR] Make SwitchInst::CaseIt almost a normal iterator. 2017-03-26 02:49:23 +00:00
Vectorize Revert r298620: [LV] Vectorize GEPs 2017-03-24 20:49:43 +00:00
CMakeLists.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00
LLVMBuild.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00