]> granicus.if.org Git - clang/commitdiff
CodeGen: simplify EH personality selection (NFC)
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 2 Nov 2017 00:25:40 +0000 (00:25 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 2 Nov 2017 00:25:40 +0000 (00:25 +0000)
Fix a typo in the comment, reorder to ensure that the ordering matches
across the ObjC/ObjC++ cases.  NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317146 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp

index 1bff6490b8ca8118f9ae386308540fc54e36b211..6a421e81dffd50b38c0008912598557a0f3ffbe9 100644 (file)
@@ -165,26 +165,27 @@ static const EHPersonality &getCXXPersonality(const llvm::Triple &T,
 static const EHPersonality &getObjCXXPersonality(const llvm::Triple &T,
                                                  const LangOptions &L) {
   switch (L.ObjCRuntime.getKind()) {
+  // In the fragile ABI, just use C++ exception handling and hope
+  // they're not doing crazy exception mixing.
+  case ObjCRuntime::FragileMacOSX:
+    return getCXXPersonality(T, L);
+
   // The ObjC personality defers to the C++ personality for non-ObjC
   // handlers.  Unlike the C++ case, we use the same personality
   // function on targets using (backend-driven) SJLJ EH.
   case ObjCRuntime::MacOSX:
   case ObjCRuntime::iOS:
   case ObjCRuntime::WatchOS:
-    return EHPersonality::NeXT_ObjC;
+    return getObjCPersonality(T, L);
 
-  // In the fragile ABI, just use C++ exception handling and hope
-  // they're not doing crazy exception mixing.
-  case ObjCRuntime::FragileMacOSX:
-    return getCXXPersonality(T, L);
+  case ObjCRuntime::GNUstep:
+    return EHPersonality::GNU_ObjCXX;
 
   // The GCC runtime's personality function inherently doesn't support
-  // mixed EH.  Use the C++ personality just to avoid returning null.
+  // mixed EH.  Use the ObjC personality just to avoid returning null.
   case ObjCRuntime::GCC:
   case ObjCRuntime::ObjFW:
     return getObjCPersonality(T, L);
-  case ObjCRuntime::GNUstep:
-    return EHPersonality::GNU_ObjCXX;
   }
   llvm_unreachable("bad runtime kind");
 }