Go to file
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
clang Revert "[CUDA] Add implicit __attribute__((used)) to all __global__ functions." 2015-08-11 11:02:09 +00:00
clang-tools-extra 1. Disable tests that currently cannot work on windows due to missing path canonicalization in the file manager. 2015-08-11 14:21:26 +00:00
compiler-rt [windows] Use lld-link instead of lld-link2, the latter no longer exists 2015-08-11 17:36:09 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Require LLVM >=3.7 and bump version to 0.2.0 2015-08-07 08:31:37 +00:00
libcxx Protect template argument from user interference. 2015-08-10 16:58:04 +00:00
libcxxabi Update to new lists.llvm.org 2015-08-05 04:01:26 +00:00
libunwind Revert test commit. 2015-08-06 23:31:37 +00:00
lld Add support for weak undefined symbols. 2015-08-11 17:57:05 +00:00
lldb Add size field to library load event (MI) 2015-08-11 06:07:14 +00:00
llgo Update to new lists.llvm.org 2015-08-05 04:03:05 +00:00
llvm [LowerSwitch] Fix a bug when LowerSwitch deletes the default block 2015-08-11 18:12:26 +00:00
openmp Fix link error on Windows when LIBOMP_USE_DEBUGGER is off 2015-08-06 15:16:54 +00:00
polly Assign regions to all BBs from CodeGeneration 2015-08-11 14:47:37 +00:00