1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Go to file
Stepan Dyatkovskiy 856ca370cc 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.
llvm-svn: 149481
2012-02-01 07:49:51 +00:00
autoconf comment tweaks 2012-01-26 10:28:58 +00:00
bindings Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
cmake CMake: Add the folder "Tablegenning" on llvm-tblgen targets. 2012-01-30 03:01:03 +00:00
docs Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
examples Fix BrainF compilation. 2012-01-31 09:35:01 +00:00
include SwitchInst refactoring. 2012-02-01 07:49:51 +00:00
lib SwitchInst refactoring. 2012-02-01 07:49:51 +00:00
projects Regenerate configure. 2012-01-31 17:18:47 +00:00
runtime LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
test Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
tools SwitchInst refactoring. 2012-02-01 07:49:51 +00:00
unittests RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend, 2012-01-31 19:58:34 +00:00
utils Don't assign a value to NUM_TARGET_NAMED_SUBREGS. 2012-01-31 21:51:53 +00:00
.gitignore git: Add tools/lldb to the ignore list. 2011-11-10 22:55:50 +00:00
CMakeLists.txt capitalize project name, reference bugzilla 2011-12-18 18:50:16 +00:00
configure Regenerate configure. 2012-01-31 17:18:47 +00:00
CREDITS.TXT CREDITS.TXT: Add a line. (test commit) 2011-10-29 23:42:14 +00:00
LICENSE.TXT Happy new year 2012! 2012-01-01 08:16:56 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +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 Makefile: add missing files to FilesToConfig 2012-01-17 02:56:49 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in capitalize project name, reference bugzilla 2011-12-18 18:50:16 +00:00
Makefile.rules PR11642 has been fixed, enable -fvisibility-inlines-hidden everywhere. 2011-12-27 21:37:11 +00:00
README.txt Revert test commit 2012-01-31 23:18:33 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.