From ae2ffc8a8c825acf46f58f20dc7d0ae5fecbdd0b Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 10 Jul 2015 07:00:44 +0000 Subject: New EH representation for MSVC compatibility Summary: This introduces new instructions neccessary to implement MSVC-compatible exception handling support. Most of the middle-end and none of the back-end haven't been audited or updated to take them into account. Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11041 llvm-svn: 241888 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 5 +++-- llvm/lib/Transforms/Utils/Local.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils') diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 53471de6154..c761934162d 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -119,8 +119,9 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DominatorTree *DT, // Don't break self-loops. if (PredBB == BB) return false; - // Don't break invokes. - if (isa(PredBB->getTerminator())) return false; + // Don't break unwinding instructions. + if (PredBB->getTerminator()->isExceptional()) + return false; succ_iterator SI(succ_begin(PredBB)), SE(succ_end(PredBB)); BasicBlock *OnlySucc = BB; diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 56085579b61..e1788c9e287 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -283,8 +283,9 @@ bool llvm::isInstructionTriviallyDead(Instruction *I, const TargetLibraryInfo *TLI) { if (!I->use_empty() || isa(I)) return false; - // We don't want the landingpad instruction removed by anything this general. - if (isa(I)) + // We don't want the landingpad-like instructions removed by anything this + // general. + if (I->isEHBlock()) return false; // We don't want debug info removed by anything this general, unless -- cgit v1.2.3