llvm-6502/include/llvm
Stepan Dyatkovskiy 24473120a2 SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 07:49:51 +00:00
..
ADT Add Triple::getMacOSXVersion to replace crufty code in the clang driver. 2012-01-31 22:32:29 +00:00
Analysis SwitchInst refactoring. 2012-02-01 07:49:51 +00:00
Assembly Make headers standalone. 2011-11-14 17:45:03 +00:00
Bitcode Add bitcode reader and writer support for ConstantDataAggregate, which 2012-01-30 00:51:16 +00:00
CodeGen Tidy up. Trailing whitespace. 2012-01-31 19:47:32 +00:00
Config revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
DebugInfo DebugInfo: Add equality operators and default constructor to DILineInfo. 2011-09-21 01:13:16 +00:00
ExecutionEngine ExecutionEngine interface to re-map addresses for engines that support it. 2012-01-16 23:50:55 +00:00
MC Add assembler dialect attribute in asm parser which lets target specific asm parser change dialect on the fly. 2012-01-31 18:14:05 +00:00
Object Remove trailing spaces 2012-01-22 09:26:00 +00:00
Support Move Clang's file-level locking facility over to LLVM's support 2012-01-29 20:15:10 +00:00
TableGen Delete CodeInit and CodeRecTy from TableGen. 2012-01-13 03:38:34 +00:00
Target Properly emit ctors / dtors with priorities into desired sections 2012-01-25 22:24:19 +00:00
Transforms Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
Argument.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Attributes.h Extend Attributes to 64 bits 2012-01-20 17:56:17 +00:00
AutoUpgrade.h remove autoupgrade support for really old-style debug info intrinsics. 2011-11-27 06:18:33 +00:00
BasicBlock.h Add a constified getLandingPad() method. 2012-01-31 00:26:24 +00:00
CallGraphSCCPass.h
CallingConv.h Use X86_thiscall calling convention for Win64 as well. 2011-03-03 07:49:07 +00:00
CMakeLists.txt build/cmake: Use tblgen macro directly instead of llvm_tablegen, which just 2011-11-04 19:04:23 +00:00
Constant.h eliminate the Constant::getVectorElements method. There are better (and 2012-01-26 02:51:13 +00:00
Constants.h Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail. 2012-02-01 04:51:17 +00:00
DebugInfoProbe.h Introduce DebugInfoProbe. This is used to monitor how llvm optimizer is treating debugging information. 2011-03-10 00:21:25 +00:00
DefaultPasses.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
DerivedTypes.h Add support for vectors of pointers. 2011-12-05 06:29:09 +00:00
Function.h Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. 2011-10-20 05:23:42 +00:00
GlobalAlias.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
GlobalValue.h Re-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't abuse the semantics of linker_private. We don't really want to merge any string constant with a weak_odr global. 2012-01-11 22:06:46 +00:00
GlobalVariable.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
GVMaterializer.h
InitializePasses.h Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
InlineAsm.h Encode register class constreaints in inline asm instructions. 2011-10-12 23:37:29 +00:00
InstrTypes.h Add some missing anchors. 2011-12-01 08:00:17 +00:00
Instruction.def Initial commit of the 'landingpad' instruction. 2011-08-12 20:24:12 +00:00
Instruction.h Move Instruction::isSafeToSpeculativelyExecute out of VMCore and 2011-12-14 23:49:11 +00:00
Instructions.h SwitchInst refactoring. 2012-02-01 07:49:51 +00:00
IntrinsicInst.h Remove the eh.exception and eh.selector intrinsics. Also remove a hack to copy 2012-01-31 01:46:13 +00:00
Intrinsics.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
Intrinsics.td Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics. 2012-01-31 01:58:48 +00:00
IntrinsicsARM.td Add support for ARM ldrexd/strexd intrinsics. They both use i32 register pairs 2011-05-28 04:07:29 +00:00
IntrinsicsCellSPU.td
IntrinsicsHexagon.td Hexagon backend support 2011-12-12 21:14:40 +00:00
IntrinsicsPowerPC.td
IntrinsicsPTX.td PTX: Add intrinsics to list of built-in intrinsics, which allows them to be 2011-04-20 15:37:17 +00:00
IntrinsicsX86.td Remove pcmpgt/pcmpeq intrinsics as clang is not using them. 2012-01-31 06:52:44 +00:00
IntrinsicsXCore.td Update IntrinsicsXCore.td with the normal LLVM notice at the top of the file. 2011-10-13 21:08:11 +00:00
LinkAllPasses.h Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
LinkAllVMCore.h
Linker.h Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before. 2011-10-11 00:24:54 +00:00
LLVMContext.h generalize LLVMContext::emitError to take a twine instead of a StringRef. 2012-01-03 23:47:05 +00:00
Metadata.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Module.h Remove the last improper use of getGlobalContext() from LLVM. 2011-08-13 01:04:44 +00:00
OperandTraits.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
Operator.h Add support for vectors of pointers. 2011-12-05 06:29:09 +00:00
Pass.h Devirtualize Pass::getPassID, overriding it isn't useful and it gets called a lot. 2011-11-24 21:14:11 +00:00
PassAnalysisSupport.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
PassManager.h Add pass printer passes in the right place. 2012-02-01 07:16:20 +00:00
PassManagers.h Add pass printer passes in the right place. 2012-02-01 07:16:20 +00:00
PassRegistry.h
PassSupport.h Add Tsan annotations to the pass system. 2011-12-08 00:15:41 +00:00
SymbolTableListTraits.h
Type.h add StructType helpers too. 2012-01-26 00:06:44 +00:00
Use.h Reinstate r133513 (reverted in r133700) with an additional fix for a 2011-06-23 09:09:15 +00:00
User.h Add some missing anchors. 2011-12-01 08:00:17 +00:00
Value.h start the implementation of a new ConstantDataVector and ConstantDataArray 2012-01-23 22:57:10 +00:00
ValueSymbolTable.h