[cfe-commits] r151179 - /cfe/trunk/tools/scan-build/set-xcode-analyzer

Ted Kremenek kremenek at apple.com
Wed Feb 22 10:44:35 PST 2012


Author: kremenek
Date: Wed Feb 22 12:44:35 2012
New Revision: 151179

URL: http://llvm.org/viewvc/llvm-project?rev=151179&view=rev
Log:
Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3

Modified:
    cfe/trunk/tools/scan-build/set-xcode-analyzer

Modified: cfe/trunk/tools/scan-build/set-xcode-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/set-xcode-analyzer?rev=151179&r1=151178&r2=151179&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/set-xcode-analyzer (original)
+++ cfe/trunk/tools/scan-build/set-xcode-analyzer Wed Feb 22 12:44:35 2012
@@ -5,6 +5,7 @@
 # This one has the scripting bridge enabled.
 
 import os
+import subprocess
 import sys
 import re
 import tempfile
@@ -13,6 +14,7 @@
 from AppKit import *
 
 def FindClangSpecs(path):
+  print "(+) Searching for xcspec file in: ", path
   for root, dirs, files in os.walk(path):
     for f in files:
       if f.endswith(".xcspec") and f.startswith("Clang LLVM"):
@@ -73,7 +75,13 @@
     print "(+) Using the Clang bundled with Xcode"
     path = options.default
   
-  for x in FindClangSpecs('/Developer'):
+  xcode_path = subprocess.check_output(["xcode-select", "-print-path"])
+  if (re.search("Xcode.app", xcode_path)):
+    # Cut off the 'Developer' dir, as the xcspec lies in another part
+    # of the Xcode.app subtree.
+    xcode_path = os.path.dirname(xcode_path)
+  
+  for x in FindClangSpecs(xcode_path):
     ModifySpec(x, path)
 
 if __name__ == '__main__':





More information about the cfe-commits mailing list