1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/tools
Stepan Dyatkovskiy 79f3dd93b7 Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.

llvm-svn: 152297
2012-03-08 07:06:20 +00:00
..
bugpoint Improve handling of blockaddresses in bugpoint when splitting a module. Patch by Daniel Reynaud. 2012-02-22 01:43:47 +00:00
bugpoint-passes build: Tidy up a bunch of tool Makefiles, and simplify where possible using the 2011-10-18 19:27:24 +00:00
gold drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
llc RegAlloc superpass: includes phi elimination, coalescing, and scheduling. 2012-02-10 04:10:36 +00:00
lli Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches. 2012-01-16 08:56:09 +00:00
llvm-ar LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-as LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-bcanalyzer Enable streaming of bitcode 2012-02-06 22:30:29 +00:00
llvm-config An easy case where GCC should really be able to work out that the value is only 2012-02-23 08:25:25 +00:00
llvm-cov LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-diff Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012: 2012-03-08 07:06:20 +00:00
llvm-dis Enable streaming of bitcode 2012-02-06 22:30:29 +00:00
llvm-dwarfdump LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-extract Remove extraneous ".get()->" which is just "->". No functionality change. 2011-12-30 19:17:23 +00:00
llvm-ld Remove dead code. Improve llvm_unreachable text. Simplify some control flow. 2012-02-19 11:37:01 +00:00
llvm-link LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-mc Make MCRegisterInfo available to the the MCInstPrinter. 2012-03-05 19:33:20 +00:00
llvm-nm In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags. 2012-02-28 23:47:53 +00:00
llvm-objdump Make MCRegisterInfo available to the the MCInstPrinter. 2012-03-05 19:33:20 +00:00
llvm-prof LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-ranlib LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-readobj Fix comments for llvm-readobj, remove extraneous headers 2012-03-02 23:43:51 +00:00
llvm-rtdyld Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary) 2012-01-17 04:43:56 +00:00
llvm-shlib build: Tidy up a bunch of tool Makefiles, and simplify where possible using the 2011-10-18 19:27:24 +00:00
llvm-size LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
llvm-stress Fix some stray semi-colons. 2012-02-29 00:20:33 +00:00
llvm-stub LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
lto reapply the patches reverted in r149470 that reenable ConstantDataArray, 2012-02-05 02:29:43 +00:00
macho-dump LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
opt Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
CMakeLists.txt [Object] 2012-03-01 01:36:50 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile [Object] 2012-03-01 01:36:50 +00:00