OSDN Git Service

EH: Prune unreachable resume instructions during Dwarf EH preparation
authorReid Kleckner <reid@kleckner.net>
Fri, 20 Feb 2015 01:00:19 +0000 (01:00 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 20 Feb 2015 01:00:19 +0000 (01:00 +0000)
commit49ab3a626a3e64c91707e899e75c3724f7fbaf23
tree7ee1c0dcfc60e809a986d369d76efaf2df8c6fd2
parent8c4bb575e190bbae78d8cad0ed938539612a17db
EH: Prune unreachable resume instructions during Dwarf EH preparation

Today a simple function that only catches exceptions and doesn't run
destructor cleanups ends up containing a dead call to _Unwind_Resume
(PR20300). We can't remove these dead resume instructions during normal
optimization because inlining might introduce additional landingpads
that do have cleanups to run. Instead we can do this during EH
preparation, which is guaranteed to run after inlining.

Fixes PR20300.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229944 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/Passes.h
lib/CodeGen/CodeGen.cpp
lib/CodeGen/DwarfEHPrepare.cpp
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/Mips/eh.ll
test/CodeGen/X86/dwarf-eh-prepare.ll
test/CodeGen/X86/gcc_except_table.ll
test/CodeGen/X86/gcc_except_table_functions.ll
test/CodeGen/XCore/exception.ll