[CodeGen] Force emission of personality directive if explicitly specified
[oota-llvm.git] / include / llvm / Analysis / LibCallSemantics.h
index 170e2a49a8ea59bc7825c231f9200a78cc993634..b4bef310e59099d7055da9fc8c8a0d321ae494d4 100644 (file)
@@ -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