[cfe-commits] r71891 - /cfe/trunk/utils/scan-build

Ted Kremenek kremenek at apple.com
Fri May 15 14:14:17 PDT 2009


Author: kremenek
Date: Fri May 15 16:14:16 2009
New Revision: 71891

URL: http://llvm.org/viewvc/llvm-project?rev=71891&view=rev
Log:
Add hack to scan-build to fix PR 4215
(http://llvm.org/bugs/show_bug.cgi?id=4215): When xcodebuild is invoked with
-sdk iphonesimulator3.0, use gcc-4.2 instead of the system default gcc.

Modified:
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=71891&r1=71890&r2=71891&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Fri May 15 16:14:16 2009
@@ -859,6 +859,18 @@
   } 
   
   if ($Cmd eq "xcodebuild") {
+    # Check if using iPhone SDK 3.0 (simulator).  If so the compiler being
+    # used should be gcc-4.2.
+    if (!defined $ENV{"CCC_CC"}) {
+      for (my $i = 0 ; $i < scalar(@$Args); ++$i) {
+        if ($Args->[$i] eq "-sdk" && $i + 1 < scalar(@$Args)) {
+          if (@$Args[$i+1] =~ /^iphonesimulator3/) {
+            $ENV{"CCC_CC"} = "gcc-4.2";
+          }
+        }
+      }
+    }
+
     # Disable distributed builds for xcodebuild.
     AddIfNotPresent($Args,"-nodistribute");
 





More information about the cfe-commits mailing list