aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/LibCallSemantics.h
diff options
context:
space:
mode:
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 170e2a49a8ea..b4bef310e590 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