summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-02-22 18:44:35 +0000
committerTed Kremenek <kremenek@apple.com>2012-02-22 18:44:35 +0000
commitd87cdd1d1119bfd962b0464fb9292b4e3a39eff6 (patch)
tree59f2db72b964b8a030f334b3b2dff5d121238949
parent64ca16e9b85998cfbe0c8d7a7b10747723d7fad5 (diff)
downloadbcm5719-llvm-d87cdd1d1119bfd962b0464fb9292b4e3a39eff6.tar.gz
bcm5719-llvm-d87cdd1d1119bfd962b0464fb9292b4e3a39eff6.zip
Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
llvm-svn: 151179
-rwxr-xr-xclang/tools/scan-build/set-xcode-analyzer10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/tools/scan-build/set-xcode-analyzer b/clang/tools/scan-build/set-xcode-analyzer
index 133f9cc329e..06e1d857de9 100755
--- a/clang/tools/scan-build/set-xcode-analyzer
+++ b/clang/tools/scan-build/set-xcode-analyzer
@@ -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 @@ import stat
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 @@ def main():
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__':
OpenPOWER on IntegriCloud