llvm-project/llvm/test
Chen Li 10f01bd4d3 [LowerSwitch] Fix a bug when LowerSwitch deletes the default block
Summary: LowerSwitch crashed with the attached test case after deleting the default block. This happened because the current implementation of deleting dead blocks is wrong. After the default block being deleted, it contains no instruction or terminator, and it should no be traversed anymore. However, since the iterator is advanced before processSwitchInst() function is executed, the block advanced to could be deleted inside processSwitchInst(). The deleted block would then be visited next and crash dyn_cast<SwitchInst>(Cur->getTerminator()) because Cur->getTerminator() returns a nullptr. This patch fixes this problem by recording dead default blocks into a list, and delete them after all processSwitchInst() has been done. It still possible to visit dead default blocks and waste time process them. But it is a compile time issue, and I plan to have another patch to add support to skip dead blocks.

Reviewers: kariddi, resistor, hans, reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11852

llvm-svn: 244642
2015-08-11 18:12:26 +00:00
..
Analysis [GMR] Be a bit smarter about which globals don't alias when doing recursive lookups 2015-08-11 08:06:44 +00:00
Assembler DI: Disallow uniquable DICompileUnits 2015-08-03 17:26:41 +00:00
Bindings [OCaml] Do not use -warn-error in tests. 2015-07-17 17:33:23 +00:00
Bitcode [compatibility.ll] Cover explicitly named comdats. 2015-08-06 22:04:21 +00:00
BugPoint Fix typo in comment 2015-07-26 11:37:05 +00:00
CodeGen fix minsize detection: minsize attribute implies optimizing for size 2015-08-11 17:04:31 +00:00
DebugInfo Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI 2015-08-10 19:01:27 +00:00
ExecutionEngine [RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef. 2015-08-11 06:27:53 +00:00
Feature [IR] Verify EH pad predecessors 2015-08-11 02:48:30 +00:00
FileCheck
Instrumentation [libFuzzer] don't crash if the condition in a switch has unusual type (e.g. i72) 2015-08-11 00:24:39 +00:00
Integer
JitListener DI: Disallow uniquable DICompileUnits 2015-08-03 17:26:41 +00:00
LTO Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
LibDriver Add support for producing thin archives in llvm-lib. 2015-07-17 16:01:11 +00:00
Linker Linker: Fix references to uniqued nodes after r243883 2015-08-04 06:42:31 +00:00
MC [X86] Add SAL mnemonics for Intel syntax 2015-08-11 12:05:06 +00:00
Object Add a test showing that objdump (and so ObjectFIle) can handle shndx. 2015-08-10 21:00:15 +00:00
Other Update test suite to make "ninja check" succeed without native backend builtin 2015-08-04 06:32:54 +00:00
SymbolRewriter
TableGen TableGen: Support folding casts from bits to int 2015-07-31 01:12:06 +00:00
Transforms [LowerSwitch] Fix a bug when LowerSwitch deletes the default block 2015-08-11 18:12:26 +00:00
Unit
Verifier DI: Disallow uniquable DICompileUnits 2015-08-03 17:26:41 +00:00
YAMLParser YAML: Implement block scalar parsing. 2015-05-13 23:10:51 +00:00
tools Enable five passing dsymutil tests on Windows. 2015-08-11 06:05:27 +00:00
.clang-format
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
Makefile
Makefile.tests
TestRunner.sh
lit.cfg Improve lit "native" feature to check if the native backend is builtin 2015-08-04 06:32:31 +00:00
lit.site.cfg.in Improve lit "native" feature to check if the native backend is builtin 2015-08-04 06:32:31 +00:00