[X86] Add support for tbyte memory operand size for Intel-syntax x86 assembly
[oota-llvm.git] / include / llvm / Analysis / LibCallSemantics.h
index e6427a4b2ec4bc6767cfc8d92ba3baf0d375fbda..b4bef310e59099d7055da9fc8c8a0d321ae494d4 100644 (file)
@@ -48,8 +48,7 @@ class InvokeInst;
     enum LocResult {
       Yes, No, Unknown
     };
-    LocResult (*isLocation)(ImmutableCallSite CS,
-                            const AliasAnalysis::Location &Loc);
+    LocResult (*isLocation)(ImmutableCallSite CS, const MemoryLocation &Loc);
   };
   
   /// LibCallFunctionInfo - Each record in the array of FunctionInfo structs
@@ -181,9 +180,45 @@ class InvokeInst;
 
   /// \brief Returns true if this personality function catches asynchronous
   /// exceptions.
-  bool isAsynchronousEHPersonality(EHPersonality Pers);
+  inline bool isAsynchronousEHPersonality(EHPersonality Pers) {
+    // The two SEH personality functions can catch asynch exceptions. We assume
+    // unknown personalities don't catch asynch exceptions.
+    switch (Pers) {
+    case EHPersonality::MSVC_X86SEH:
+    case EHPersonality::MSVC_Win64SEH:
+      return true;
+    default: return false;
+    }
+    llvm_unreachable("invalid enum");
+  }
+
+  /// \brief Returns true if this is an MSVC personality function.
+  inline bool isMSVCEHPersonality(EHPersonality Pers) {
+    // The two SEH personality functions can catch asynch exceptions. We assume
+    // unknown personalities don't catch asynch exceptions.
+    switch (Pers) {
+    case EHPersonality::MSVC_CXX:
+    case EHPersonality::MSVC_X86SEH:
+    case EHPersonality::MSVC_Win64SEH:
+      return true;
+    default: return false;
+    }
+    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 InvokeInst *II);
+  bool canSimplifyInvokeNoUnwind(const Function *F);
 
 } // end namespace llvm