[cfe-commits] r167935 - /cfe/trunk/lib/CodeGen/CGException.cpp

John McCall rjmccall at apple.com
Wed Nov 14 09:48:31 PST 2012


Author: rjmccall
Date: Wed Nov 14 11:48:31 2012
New Revision: 167935

URL: http://llvm.org/viewvc/llvm-project?rev=167935&view=rev
Log:
The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,
which is not coincidentally the only place it works, either (because
of how it tests for EH_TYPE symbols).

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=167935&r1=167934&r2=167935&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Nov 14 11:48:31 2012
@@ -307,14 +307,15 @@
 /// aggressive about only using the ObjC++ personality in a function
 /// when it really needs it.
 void CodeGenModule::SimplifyPersonality() {
-  // For now, this is really a Darwin-specific operation.
-  if (!Context.getTargetInfo().getTriple().isOSDarwin())
-    return;
-
   // If we're not in ObjC++ -fexceptions, there's nothing to do.
   if (!LangOpts.CPlusPlus || !LangOpts.ObjC1 || !LangOpts.Exceptions)
     return;
 
+  // Both the problem this endeavors to fix and the way the logic
+  // above works is specific to the NeXT runtime.
+  if (!LangOpts.ObjCRuntime.isNeXTFamily())
+    return;
+
   const EHPersonality &ObjCXX = EHPersonality::get(LangOpts);
   const EHPersonality &CXX = getCXXPersonality(LangOpts);
   if (&ObjCXX == &CXX)





More information about the cfe-commits mailing list