Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
45df60c1
Commit
45df60c1
authored
12 years ago
by
Ted Kremenek
Browse files
Options
Downloads
Patches
Plain Diff
Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
llvm-svn: 165681
parent
686d7cbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clang/tools/scan-build/set-xcode-analyzer
+13
-2
13 additions, 2 deletions
clang/tools/scan-build/set-xcode-analyzer
with
13 additions
and
2 deletions
clang/tools/scan-build/set-xcode-analyzer
+
13
−
2
View file @
45df60c1
...
@@ -20,10 +20,19 @@ def FindClangSpecs(path):
...
@@ -20,10 +20,19 @@ def FindClangSpecs(path):
if
f
.
endswith
(
"
.xcspec
"
)
and
f
.
startswith
(
"
Clang LLVM
"
):
if
f
.
endswith
(
"
.xcspec
"
)
and
f
.
startswith
(
"
Clang LLVM
"
):
yield
os
.
path
.
join
(
root
,
f
)
yield
os
.
path
.
join
(
root
,
f
)
def
ModifySpec
(
path
,
pathToChecker
):
def
ModifySpec
(
path
,
isBuiltinAnalyzer
,
pathToChecker
):
t
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
t
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
foundAnalyzer
=
False
foundAnalyzer
=
False
with
open
(
path
)
as
f
:
with
open
(
path
)
as
f
:
if
isBuiltinAnalyzer
:
# First search for CLANG_ANALYZER_EXEC. Newer
# versions of Xcode set EXEC_PATH to be CLANG_ANALYZER_EXEC.
with
open
(
path
)
as
f2
:
for
line
in
f2
:
if
line
.
find
(
"
CLANG_ANALYZER_EXEC
"
)
>=
0
:
pathToChecker
=
"
$(CLANG_ANALYZER_EXEC)
"
break
# Now create a new file.
for
line
in
f
:
for
line
in
f
:
if
not
foundAnalyzer
:
if
not
foundAnalyzer
:
if
line
.
find
(
"
Static Analyzer
"
)
>=
0
:
if
line
.
find
(
"
Static Analyzer
"
)
>=
0
:
...
@@ -63,6 +72,7 @@ def main():
...
@@ -63,6 +72,7 @@ def main():
print
"
(-) You must quit Xcode first before modifying its configuration files.
"
print
"
(-) You must quit Xcode first before modifying its configuration files.
"
return
return
isBuiltinAnalyzer
=
False
if
options
.
path
:
if
options
.
path
:
# Expand tildes.
# Expand tildes.
path
=
os
.
path
.
expanduser
(
options
.
path
)
path
=
os
.
path
.
expanduser
(
options
.
path
)
...
@@ -74,6 +84,7 @@ def main():
...
@@ -74,6 +84,7 @@ def main():
else
:
else
:
print
"
(+) Using the Clang bundled with Xcode
"
print
"
(+) Using the Clang bundled with Xcode
"
path
=
options
.
default
path
=
options
.
default
isBuiltinAnalyzer
=
True
try
:
try
:
xcode_path
=
subprocess
.
check_output
([
"
xcode-select
"
,
"
-print-path
"
])
xcode_path
=
subprocess
.
check_output
([
"
xcode-select
"
,
"
-print-path
"
])
...
@@ -88,7 +99,7 @@ def main():
...
@@ -88,7 +99,7 @@ def main():
foundSpec
=
False
foundSpec
=
False
for
x
in
FindClangSpecs
(
xcode_path
):
for
x
in
FindClangSpecs
(
xcode_path
):
foundSpec
=
True
foundSpec
=
True
ModifySpec
(
x
,
path
)
ModifySpec
(
x
,
isBuiltinAnalyzer
,
path
)
if
foundSpec
==
False
:
if
foundSpec
==
False
:
print
"
(-) No compiler configuration file was found. Xcode
'
s analyzer has not been updated.
"
print
"
(-) No compiler configuration file was found. Xcode
'
s analyzer has not been updated.
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment