[llvm-branch-commits] [cfe-branch] r115807 - /cfe/branches/Apple/williamson/lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Wed Oct 6 11:41:35 PDT 2010


Author: ddunbar
Date: Wed Oct  6 13:41:35 2010
New Revision: 115807

URL: http://llvm.org/viewvc/llvm-project?rev=115807&view=rev
Log:
Merge r113889:
--
Author: Daniel Dunbar <daniel at zuster.org>
Date:   Tue Sep 14 23:12:31 2010 +0000

    Simplify.

Modified:
    cfe/branches/Apple/williamson/lib/Driver/Tools.cpp

Modified: cfe/branches/Apple/williamson/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/lib/Driver/Tools.cpp?rev=115807&r1=115806&r2=115807&view=diff
==============================================================================
--- cfe/branches/Apple/williamson/lib/Driver/Tools.cpp (original)
+++ cfe/branches/Apple/williamson/lib/Driver/Tools.cpp Wed Oct  6 13:41:35 2010
@@ -666,6 +666,7 @@
 
 static bool needsExceptions(const ArgList &Args,  types::ID InputType,
                             const llvm::Triple &Triple) {
+  // Handle -fno-exceptions.
   if (Arg *A = Args.getLastArg(options::OPT_fexceptions,
                                options::OPT_fno_exceptions)) {
     if (A->getOption().matches(options::OPT_fexceptions))
@@ -673,25 +674,23 @@
     else
       return false;
   }
-  switch (InputType) {
-  case types::TY_CXX: case types::TY_CXXHeader:
-  case types::TY_PP_CXX: case types::TY_PP_CXXHeader:
-  case types::TY_ObjCXX: case types::TY_ObjCXXHeader:
-  case types::TY_PP_ObjCXX: case types::TY_PP_ObjCXXHeader:
+
+  // Otherwise, C++ inputs use exceptions.
+  if (types::isCXX(InputType))
     return true;
 
-  case types::TY_ObjC: case types::TY_ObjCHeader:
-  case types::TY_PP_ObjC: case types::TY_PP_ObjCHeader:
+  // As do Objective-C non-fragile ABI inputs and all Objective-C inputs on
+  // x86_64 after SnowLeopard.
+  if (types::isObjC(InputType)) {
     if (Args.hasArg(options::OPT_fobjc_nonfragile_abi))
       return true;
     if (Triple.getOS() != llvm::Triple::Darwin)
       return false;
     return (Triple.getDarwinMajorNumber() >= 9 &&
             Triple.getArch() == llvm::Triple::x86_64);
-
-  default:
-    return false;
   }
+
+  return false;
 }
 
 /// getEffectiveClangTriple - Get the "effective" target triple, which is the





More information about the llvm-branch-commits mailing list