[IR] Redesign the case iterator in SwitchInst to actually be an iterator
authorChandler Carruth <chandlerc@gmail.com>
Wed, 12 Apr 2017 07:27:28 +0000 (07:27 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 12 Apr 2017 07:27:28 +0000 (07:27 +0000)
commit927d8e610ab8d86ca007255db1dfffa4886ad659
treeb95d69a6723e6dbe8114ce10db4272378b312b6a
parent540823f6796e10518aa68ad9b97822bbcf784f92
[IR] Redesign the case iterator in SwitchInst to actually be an iterator
and to expose a handle to represent the actual case rather than having
the iterator return a reference to itself.

All of this allows the iterator to be used with common STL facilities,
standard algorithms, etc.

Doing this exposed some missing facilities in the iterator facade that
I've fixed and required some work to the actual iterator to fully
support the necessary API.

Differential Revision: https://reviews.llvm.org/D31548

llvm-svn: 300032
28 files changed:
llvm/include/llvm/ADT/iterator.h
llvm/include/llvm/Analysis/CFGPrinter.h
llvm/include/llvm/IR/Instructions.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/lib/Analysis/SparsePropagation.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
llvm/lib/Transforms/Scalar/NewGVN.cpp
llvm/lib/Transforms/Scalar/SCCP.cpp
llvm/lib/Transforms/Utils/CloneFunction.cpp
llvm/lib/Transforms/Utils/Evaluator.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/LowerSwitch.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/tools/llvm-diff/DifferenceEngine.cpp
llvm/unittests/IR/InstructionsTest.cpp