llvm-6502/lib/CodeGen/SelectionDAG
Stepan Dyatkovskiy c10fa6c801 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 07:06:20 +00:00
..
CMakeLists.txt fix cmake 2012-02-01 22:28:29 +00:00
DAGCombiner.cpp Extend r148086 to check for [r +/- reg] address mode. This fixes queens performance regression (due to increased register pressure from overly aggressive pre-inc formation). 2012-03-06 23:33:32 +00:00
FastISel.cpp Properly emit _fltused with FastISel. Refactor to share code with SDAG. 2012-02-22 19:06:13 +00:00
FunctionLoweringInfo.cpp Tabs, formatting and long lines oh my! 2012-02-24 01:59:01 +00:00
InstrEmitter.cpp Don't crash when a glue node contains an internal CopyToReg 2012-02-24 17:53:59 +00:00
InstrEmitter.h Simplify EXTRACT_SUBREG emission. 2011-10-05 20:26:40 +00:00
LegalizeDAG.cpp Make it possible for a target to mark FSUB as Expand. This requires providing a default expansion (FADD+FNEG), and teaching DAGCombine not to form FSUBs post-legalize if they are not legal. 2012-03-06 00:29:31 +00:00
LegalizeFloatTypes.cpp Convert assert(0) to llvm_unreachable 2012-02-05 08:31:47 +00:00
LegalizeIntegerTypes.cpp LegalizeIntegerTypes: Reorder operations in the "big shift by small amount" optimization, making the lives of later passes easier. 2012-02-29 13:27:00 +00:00
LegalizeTypes.cpp Re-commit r151623 with fix. Only issue special no-return calls if it's a direct call. 2012-02-28 18:51:51 +00:00
LegalizeTypes.h 1. Fix the widening of SETCC in WidenVecOp_SETCC. Use the correct return CC type. 2011-10-21 11:42:07 +00:00
LegalizeTypesGeneric.cpp Remove unnecessary default cases in switches that cover all enum values. 2012-01-10 16:47:17 +00:00
LegalizeVectorOps.cpp Convert assert(0) to llvm_unreachable 2012-02-05 08:31:47 +00:00
LegalizeVectorTypes.cpp Added hook to let targets custom lower splitting of illegal vectors 2012-02-15 00:55:31 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile
ResourcePriorityQueue.cpp misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
ScheduleDAGFast.cpp misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
ScheduleDAGRRList.cpp misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
ScheduleDAGSDNodes.cpp misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
ScheduleDAGSDNodes.h misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
ScheduleDAGVLIW.cpp misched preparation: rename core scheduler methods for consistency. 2012-03-07 23:00:49 +00:00
SDNodeDbgValue.h Do not lose debug info of an inlined function argument even if the argument is only used through GEPs. 2011-02-18 22:43:42 +00:00
SDNodeOrdering.h
SelectionDAG.cpp Re-commit r151623 with fix. Only issue special no-return calls if it's a direct call. 2012-02-28 18:51:51 +00:00
SelectionDAGBuilder.cpp Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012: 2012-03-08 07:06:20 +00:00
SelectionDAGBuilder.h [unwind removal] Remove all of the code for the dead 'unwind' instruction. There 2012-02-06 21:44:22 +00:00
SelectionDAGISel.cpp misched preparation: clarify ScheduleDAG and ScheduleDAGInstrs roles. 2012-03-07 05:21:52 +00:00
SelectionDAGPrinter.cpp drop unneeded config.h includes 2011-12-22 23:04:07 +00:00
TargetLowering.cpp Use the correct ShiftAmtTy for creating shifts after legalization. PR11881. Not committing a testcase because I think it will be too fragile. 2012-01-31 01:08:03 +00:00
TargetSelectionDAGInfo.cpp