summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/LibCallSemantics.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-08-07 23:01:33 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-08-07 23:01:33 +0000
commitee8648bdac07986a0f1ec897b02ec82a2f144d46 (patch)
tree52d1861acda1205241ee35a94aa63129c604d469 /include/llvm/Analysis/LibCallSemantics.h
parent1a82d4c088707c791c792f6822f611b47a12bdfe (diff)
Diffstat (limited to 'include/llvm/Analysis/LibCallSemantics.h')
-rw-r--r--include/llvm/Analysis/LibCallSemantics.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Analysis/LibCallSemantics.h b/include/llvm/Analysis/LibCallSemantics.h
index 170e2a49a8ea5..b4bef310e5909 100644
--- a/include/llvm/Analysis/LibCallSemantics.h
+++ b/include/llvm/Analysis/LibCallSemantics.h
@@ -206,6 +206,18 @@ class InvokeInst;
llvm_unreachable("invalid enum");
}
+ /// \brief Return true if this personality may be safely removed if there
+ /// are no invoke instructions remaining in the current function.
+ inline bool isNoOpWithoutInvoke(EHPersonality Pers) {
+ switch (Pers) {
+ case EHPersonality::Unknown:
+ return false;
+ // All known personalities currently have this behavior
+ default: return true;
+ }
+ llvm_unreachable("invalid enum");
+ }
+
bool canSimplifyInvokeNoUnwind(const Function *F);
} // end namespace llvm