summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2015-09-27 01:47:46 +0000
committerJoseph Tremoulet <jotrem@microsoft.com>2015-09-27 01:47:46 +0000
commit09af67aba54e6d2a05e3071c0c7ba43bde678df9 (patch)
treeff8dfefbf81e9a6ae3f2f3ded3ade5b8a54b8ed7 /llvm/include
parentd47346d0f8f0012c556e4ce656c4222eec8d08d6 (diff)
downloadbcm5719-llvm-09af67aba54e6d2a05e3071c0c7ba43bde678df9.tar.gz
bcm5719-llvm-09af67aba54e6d2a05e3071c0c7ba43bde678df9.zip
[EH] Create removeUnwindEdge utility
Summary: Factor the code that rewrites invokes to calls and rewrites WinEH terminators to their "unwind to caller" equivalents into a helper in Utils/Local, and use it in the three places I'm aware of that need to do this. Reviewers: andrew.w.kaylor, majnemer, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13152 llvm-svn: 248677
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Utils/Local.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 11c181cbbe0..2354e0ae160 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -277,6 +277,14 @@ DbgDeclareInst *FindAllocaDbgDeclare(Value *V);
bool replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
DIBuilder &Builder, bool Deref);
+/// Replace 'BB's terminator with one that does not have an unwind successor
+/// block. Rewrites `invoke` to `call`, `catchendpad unwind label %foo` to
+/// `catchendpad unwind to caller`, etc. Updates any PHIs in unwind successor.
+///
+/// \param BB Block whose terminator will be replaced. Its terminator must
+/// have an unwind successor.
+void removeUnwindEdge(BasicBlock *BB);
+
/// \brief Remove all blocks that can not be reached from the function's entry.
///
/// Returns true if any basic block was removed.
OpenPOWER on IntegriCloud