[cfe-commits] r95093 - in /cfe/trunk: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/ToolChains.cpp

Daniel Dunbar daniel at zuster.org
Tue Feb 2 09:31:12 PST 2010


Author: ddunbar
Date: Tue Feb  2 11:31:12 2010
New Revision: 95093

URL: http://llvm.org/viewvc/llvm-project?rev=95093&view=rev
Log:
Driver/Darwin: Don't error/warn on conflicting deployment targets. Apparently
this is still a popular thing to do.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=95093&r1=95092&r2=95093&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Tue Feb  2 11:31:12 2010
@@ -62,8 +62,6 @@
 def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
 def err_drv_invalid_remap_file : Error<
     "invalid option '%0' not of the form <from-file>;<to-file>">;
-def err_drv_conflicting_deployment_targets : Error<
-    "conflicting deployment targets, both MACOSX_DEPLOYMENT_TARGET '%0' and IPHONEOS_DEPLOYMENT_TARGET '%1' are present in environment">;
 
 def warn_drv_input_file_unused : Warning<
   "%0: '%1' input unused when '%2' is present">;
@@ -87,5 +85,7 @@
   "ignoring invalid -ftabstop value '%0', using default value %1">;
 def warn_drv_missing_resource_library : Warning<
   "missing resource library '%0', link may fail">;
+def warn_drv_conflicting_deployment_targets : Warning<
+    "conflicting deployment targets, both MACOSX_DEPLOYMENT_TARGET '%0' and IPHONEOS_DEPLOYMENT_TARGET '%1' are present in environment">;
 
 }

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=95093&r1=95092&r2=95093&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Feb  2 11:31:12 2010
@@ -385,12 +385,21 @@
     if (iPhoneOSTarget && iPhoneOSTarget[0] == '\0')
       iPhoneOSTarget = 0;
 
-    if (OSXTarget) {
-      // Diagnose conflicting deployment targets.
-      if (iPhoneOSTarget)
-        getDriver().Diag(clang::diag::err_drv_conflicting_deployment_targets)
-          << OSXTarget << iPhoneOSTarget;
+    // Diagnose conflicting deployment targets, and choose default platform
+    // based on the tool chain.
+    //
+    // FIXME: Don't hardcode default here.
+    if (OSXTarget && iPhoneOSTarget) {
+      // FIXME: We should see if we can get away with warning or erroring on
+      // this. Perhaps put under -pedantic?
+      if (getTriple().getArch() == llvm::Triple::arm ||
+          getTriple().getArch() == llvm::Triple::thumb)
+        OSXVersion = 0;
+      else
+        iPhoneVersion = 0;
+    }
 
+    if (OSXTarget) {
       const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
       OSXVersion = DAL->MakeJoinedArg(0, O, OSXTarget);
       DAL->append(OSXVersion);





More information about the cfe-commits mailing list