Author: compnerd Date: Wed Nov 1 17:25:40 2017 New Revision: 317146 URL: http://llvm.org/viewvc/llvm-project?rev=317146&view=rev Log: CodeGen: simplify EH personality selection (NFC)
Fix a typo in the comment, reorder to ensure that the ordering matches across the ObjC/ObjC++ cases. NFCI. Modified: cfe/trunk/lib/CodeGen/CGException.cpp Modified: cfe/trunk/lib/CodeGen/CGException.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=317146&r1=317145&r2=317146&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGException.cpp (original) +++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Nov 1 17:25:40 2017 @@ -165,26 +165,27 @@ static const EHPersonality &getCXXPerson 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"); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits