diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-05-28 11:48:37 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-05-28 11:48:37 +0000 |
commit | 33858016eaaf0f701fd59d1d36dfa81892fa3775 (patch) | |
tree | 810a2cc2a732f241f7c77c7877b43f378df1b5bd /lib/CodeGen/DwarfEHPrepare.cpp | |
parent | 06a8d5496788ac74a69dc68680bad48ca1814b43 (diff) | |
download | external_llvm-33858016eaaf0f701fd59d1d36dfa81892fa3775.zip external_llvm-33858016eaaf0f701fd59d1d36dfa81892fa3775.tar.gz external_llvm-33858016eaaf0f701fd59d1d36dfa81892fa3775.tar.bz2 |
Erase instructions _after_ checking their type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r-- | lib/CodeGen/DwarfEHPrepare.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp index 6a53e69..873ddd2 100644 --- a/lib/CodeGen/DwarfEHPrepare.cpp +++ b/lib/CodeGen/DwarfEHPrepare.cpp @@ -532,13 +532,14 @@ bool DwarfEHPrepare::LowerUnwindsAndResumes() { if (isa<UnwindInst>(RI)) new UnreachableInst(RI->getContext(), RI); - // Nuke the resume instruction. - RI->eraseFromParent(); - if (isa<UnwindInst>(RI)) ++NumUnwindsLowered; else ++NumResumesLowered; + + // Nuke the resume instruction. + RI->eraseFromParent(); + Changed = true; } |