From: Benjamin Kramer Date: Sat, 28 May 2011 11:48:37 +0000 (+0000) Subject: Erase instructions _after_ checking their type. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=33858016eaaf0f701fd59d1d36dfa81892fa3775;p=oota-llvm.git Erase instructions _after_ checking their type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132256 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp index 6a53e693370..873ddd20b8c 100644 --- a/lib/CodeGen/DwarfEHPrepare.cpp +++ b/lib/CodeGen/DwarfEHPrepare.cpp @@ -532,13 +532,14 @@ bool DwarfEHPrepare::LowerUnwindsAndResumes() { if (isa(RI)) new UnreachableInst(RI->getContext(), RI); - // Nuke the resume instruction. - RI->eraseFromParent(); - if (isa(RI)) ++NumUnwindsLowered; else ++NumResumesLowered; + + // Nuke the resume instruction. + RI->eraseFromParent(); + Changed = true; }