Jordan Rose
1187b95bd1
[scan-build] Log compiler invocation to stderr, not stdout.
...
This is important for preprocessing steps, which may output to stdout.
Also, change ENV accesses using barewords to use string keys instead.
PR16414
llvm-svn: 185555
2013-07-03 16:42:02 +00:00
Anna Zaks
9f53c950df
[analyzer] Add --override-compiler option to scan-build.
...
The new advanced option ensures ccc-analyze is used even when better
interposition methods are available.
llvm-svn: 182981
2013-05-31 02:31:07 +00:00
Jordan Rose
d8fb478b36
scan-build: use the xcodebuild specified by the user.
...
This is important if the user has multiple Xcodes installed on their
system -- we use xcodebuild to do a version check, and therefore we need
to make sure we match the actual build command.
Reported by Howard Ling!
llvm-svn: 182498
2013-05-22 18:09:57 +00:00
Anton Yartsev
604518ccd4
[analyzer] Finally make c++-analyzer 'executable' again.
...
llvm-svn: 180905
2013-05-02 01:57:58 +00:00
Anton Yartsev
10f9d08c70
[analyzer] Recreated as a file.
...
llvm-svn: 180903
2013-05-02 01:41:51 +00:00
Anton Yartsev
2320d295af
[analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a symlink.
...
llvm-svn: 180902
2013-05-02 01:36:41 +00:00
Anton Yartsev
19993e8441
[analyzer] Added 'executable' property to c++analyzer.
...
llvm-svn: 180901
2013-05-02 01:18:17 +00:00
Anton Yartsev
caaaf2ee28
[analyzer] scan-build for Windows
...
The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html . The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable.
llvm-svn: 180900
2013-05-02 00:52:46 +00:00
Jordan Rose
38c97d2642
[analyzer] scan-build: support -enable-checker with new Xcode integration.
...
<rdar://problem/13772094>
llvm-svn: 180812
2013-04-30 22:00:04 +00:00
Ted Kremenek
b44bc7d599
[scan-build] Whitelist all -mXXXX options.
...
llvm-svn: 180073
2013-04-23 00:10:55 +00:00
Jordan Rose
83662f75ad
[analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).
...
PR14963
llvm-svn: 177678
2013-03-21 23:14:26 +00:00
Jordan Rose
529e239aee
[analyzer] Fix scan-build's -stats mode.
...
We were failing to match the output line, which led to us collecting no
stats at all, which led to a divide-by-zero error.
Fixes PR15510.
llvm-svn: 177084
2013-03-14 17:18:30 +00:00
Jordan Rose
838b72f6b5
scan-build: explicitly say "No bugs found" if there are no reports.
...
Patch by Martin Storsjo!
llvm-svn: 176472
2013-03-05 02:33:08 +00:00
Benjamin Kramer
d504096c12
scan-build: Remove debug print.
...
PR15329.
llvm-svn: 175889
2013-02-22 12:07:39 +00:00
Ted Kremenek
2dca31e1ed
[scan-build] Add quotes around clang executable name to handle path withs spaces. Fixes <rdar://problem/13254727>
...
llvm-svn: 175790
2013-02-21 20:28:59 +00:00
Ted Kremenek
9ddfa89bed
[scan-build] fix xcode version parsing to handle dot releases. Fixes <rdar://problem/13265300>.
...
llvm-svn: 175781
2013-02-21 19:33:30 +00:00
Ted Kremenek
3cfba5bf13
Teach ccc-analyze to pass on -iquote with no spaces between it an the argument.
...
llvm-svn: 175115
2013-02-14 00:32:25 +00:00
Ted Kremenek
26c777c409
Add some horrible Perl code to teach scan-build to recursively walk a directory for HTML files.
...
llvm-svn: 174260
2013-02-02 01:52:41 +00:00
Ted Kremenek
23813454e9
scan-build: When using Xcode 4.6, use build settings for doing proper build interposition.
...
llvm-svn: 173954
2013-01-30 19:10:24 +00:00
Jordan Rose
b18179da33
scan-build: Add a --keep-empty option for better testing.
...
SATestBuild expects to compare output directories for each invocation of
scan-build that it runs, but scan-build clears out empty directories by
default. We were coincidentally not getting that behavior until r173294.
llvm-svn: 173383
2013-01-24 23:07:59 +00:00
Ted Kremenek
15b47bc872
Always process an index.html file if we have HTML output. Patch by Justin Bogner.
...
llvm-svn: 173294
2013-01-23 21:22:14 +00:00
Ted Kremenek
632af24eb8
Set process return code of 1 in set-xcode-analyzer when Xcode needs to be quit. Fixes <rdar://problem/12983031>.
...
llvm-svn: 172256
2013-01-11 21:49:36 +00:00
Ted Kremenek
4a800f876a
ccc-analyzer: Forward -msse* options to the compiler.
...
llvm-svn: 172094
2013-01-10 19:29:31 +00:00
Ted Kremenek
6a4c73db23
Fix set-xcode-analyzer to only modify the ExecPath for the analyzer when using --use-xcode-clang.
...
Turns out that the ExecPath for the ObjC migrator would also get set.
Fixes <rdar://problem/12961769>.
llvm-svn: 171607
2013-01-05 07:31:54 +00:00
Ted Kremenek
8533dd9f58
Require set-xcode-analyzer to run with Python 2.7 or later.
...
Addresses LLVM PR 11661.
llvm-svn: 171503
2013-01-04 19:04:42 +00:00
Jordan Rose
85ff8f281e
[analyzer] scan-build: Don't forget to close our temp file for Clang's output.
...
Also, minor whitespace/indentation fixes.
Patch by Peeter Joot!
llvm-svn: 168805
2012-11-28 19:12:44 +00:00
Jordan Rose
dbbbf55119
[analyzer] scan-build: Treat '.C' files as C++.
...
Part of PR14443.
llvm-svn: 168804
2012-11-28 19:12:29 +00:00
Jordan Rose
a333f3fba1
scan-build: Respect TMPDIR on all platforms, not just Darwin (PR14438).
...
llvm-svn: 168672
2012-11-27 02:37:59 +00:00
Jordan Rose
721567af3e
[analyzer] Check that the argument to CFMakeCollectable is non-NULL.
...
Patch by Sean McBride!
llvm-svn: 167537
2012-11-07 17:12:37 +00:00
Sean Silva
d901e82ec4
Fix some mdoc nits
...
Patch by Eitan Adler!
llvm-svn: 166482
2012-10-23 16:35:44 +00:00
Ted Kremenek
45df60c1f3
Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
...
llvm-svn: 165681
2012-10-11 00:40:41 +00:00
Ted Kremenek
f81b0e387a
Have set-xcode-analyer report an error if no xcspec file could be found.
...
llvm-svn: 164713
2012-09-26 18:19:55 +00:00
Ted Kremenek
66dfa34404
Make set-xcode-analyzer more tolerant of the naming differenes reported by xcode-select.
...
llvm-svn: 164712
2012-09-26 18:13:03 +00:00
Benjamin Kramer
75e4bb1d87
ccc-analyzer: pass -stdlib=libc++ through to the analyzer.
...
Otherwise clang can't analyze code that relies on features provided by libc++.
llvm-svn: 164262
2012-09-19 22:56:24 +00:00
Ted Kremenek
b184a36aad
Revert "Utilize new build system support in Xcode 4.5 for easier interposition"
...
It's not clear if this is working yet on the buildbot. Reverting until we have
time to investigate.
llvm-svn: 163963
2012-09-15 05:51:10 +00:00
Ted Kremenek
460602e252
Utilize new build system support in Xcode 4.5 for easier interposition
...
of a build without needing to use ccc-analyzer.
llvm-svn: 163927
2012-09-14 19:06:33 +00:00
Jordan Rose
c87e690372
scan-build: Determine the location of the clang binary before printing help.
...
We need the clang executable to print the list of available checkers.
llvm-svn: 163925
2012-09-14 18:59:03 +00:00
Ted Kremenek
e29d2b8a66
Use double instead of single quote to expand .
...
llvm-svn: 162830
2012-08-29 07:22:34 +00:00
Ted Kremenek
2a226a61da
Fix passing of -analyzer-max-loop from scan-build to clang.
...
llvm-svn: 162765
2012-08-28 16:48:48 +00:00
Ted Kremenek
ca13244bb7
Change --with-analyzer to --use-analyzer, per sage feedback from Jordan.
...
llvm-svn: 162640
2012-08-25 05:24:46 +00:00
Ted Kremenek
12cda3384a
Fix a few issues related to -with-analyzer reported by Jordan. Let's
...
have the option with two '--' to be consistent with other options.
llvm-svn: 162625
2012-08-24 23:42:58 +00:00
Ted Kremenek
22708504f2
Rework how scan-build picks the version of clang to use for static analysis.
...
Unless the user specifies, the clang used for static analysis is the one
found relative to scan-build.
If the user specifies -with-analyzer, they can pick either to use
the clang bundled with Xcode (via xcrun) or they can specify
a path to clang.
llvm-svn: 162620
2012-08-24 23:08:08 +00:00
Ted Kremenek
2f65f465bf
Reformat help text for scan-build, and remove -constraints
...
and -store from help text because they are no longer relevant
to users.
llvm-svn: 162619
2012-08-24 23:08:06 +00:00
Ted Kremenek
7c2137a328
Revert "Go ahead and show experimental checkers in the scan-build "-h" output."
...
llvm-svn: 162587
2012-08-24 20:39:38 +00:00
Ted Kremenek
b5e409fd20
Go ahead and show experimental checkers in the scan-build "-h" output.
...
They are labeled as not being enabled-by-default, and how else
are users going to test them.
Fixes <rdar://problem/11654923>
llvm-svn: 162543
2012-08-24 06:49:34 +00:00
Ted Kremenek
af592eef7b
On OS X, use xcrun (if present) to find the clang to use for static analysis if
...
no clang can be found relative to the location of scan-build.
Fixes <rdar://problem/11691794>
llvm-svn: 162535
2012-08-24 04:53:06 +00:00
Jordan Rose
060b163801
[scan-build] Accept -fno-objc-arc as well as -fobjc-arc.
...
This is how Xcode lets individual files be marked as non-ARC when the rest
of the project is ARC-enabled, so this is necessary for scan-build xcodebuild.
Patch by Paul Eipper!
llvm-svn: 162497
2012-08-23 23:16:34 +00:00
Ted Kremenek
7c88d2ae0f
Teach ccc-analyze about -fobjc-legacy-dispatch and -mios-simulator-version-min
...
llvm-svn: 161443
2012-08-07 19:27:08 +00:00
Ted Kremenek
b9ddbd3daa
scan-build: factor out setting of environment variables.
...
llvm-svn: 161343
2012-08-06 20:19:19 +00:00
Ted Kremenek
0d29bd231b
Pull 'xcodebuild' wrapper logic into a separate function.
...
llvm-svn: 161330
2012-08-06 18:54:19 +00:00
Arnaud A. de Grandmaison
e00629f777
[scan-build] Fix clang++ pathname
...
llvm-svn: 160871
2012-07-27 17:10:06 +00:00
Ted Kremenek
4abbade558
Add hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed in /Developer
...
when using Python < 2.7.0. This is the case on Snow Leopard, where the tools are always
installed in /Developer. This isn't a proper fix for really figuring out where Xcode
is installed, but should work to fix an obvious problem on Snow Leopard.
llvm-svn: 160321
2012-07-16 21:39:29 +00:00
Anna Zaks
7aa3687bb6
[analyzer]scan-build: report the total number of steps analyzer performs
...
This would be useful to investigate performance issues.
llvm-svn: 159038
2012-06-22 22:08:12 +00:00
Ted Kremenek
00c31c888b
Adjust scan-build to enable color output for xterm-256color.
...
llvm-svn: 158735
2012-06-19 19:27:28 +00:00
Ted Kremenek
9dcc0325de
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
...
the compiler predefines buffer. These are essentially part of
the Objective-C language.
llvm-svn: 158690
2012-06-19 00:37:39 +00:00
Anna Zaks
268f154f48
[analyzer] Loading external plugins with scan-build
...
Load custom plugins when running scan-build. This is useful when
additional static analysis Checkers must be provided via clang's plugin
interface.
Loading additional plugins can now be done via the scan-build call:
scan-build -load-plugin <plugin.so>
A patch by Thomas Hauth.
llvm-svn: 157452
2012-05-25 01:13:50 +00:00
Ted Kremenek
e1e89370f0
New & improved man page attached, now with standard license added.
...
Plus, a patch for scan-build.
* mdoc corrections
* slightly more compact output
* same license as scan-build
* DESCRIPTION describes
* Default checkers corrected & explained
* Authors credited
The patch adds support for --help-checkers. It just lists the default
checkers by recursively invoking "scan-build -h" and looking for the
magic '+' signs.
Patch by James Lowden!
llvm-svn: 157411
2012-05-24 20:13:47 +00:00
Douglas Gregor
4b5c9979b9
Add the output of "clang --version" to scan-build results, from Gerald Combs!
...
llvm-svn: 156834
2012-05-15 18:41:55 +00:00
Ted Kremenek
42c8f73f93
Provide a man page for scan-build. Patch by James Lowden!
...
llvm-svn: 156559
2012-05-10 19:10:47 +00:00
Anna Zaks
d682741136
[analyzer] Add .cxx and .txx as known file extensions to ccc-analyzer.
...
A patch by Sean McBride.
llvm-svn: 154751
2012-04-14 16:30:00 +00:00
Ted Kremenek
415287d943
Add static analyzer support for new NSArray/NSDictionary/NSNumber literals.
...
llvm-svn: 152139
2012-03-06 20:06:12 +00:00
Ted Kremenek
d87cdd1d11
Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
...
llvm-svn: 151179
2012-02-22 18:44:35 +00:00
Ted Kremenek
49db052db4
Teach ccc-analyzer about -fobjc-abi-version.
...
llvm-svn: 149094
2012-01-26 23:30:13 +00:00
Anna Zaks
b3d896d333
[analyzer] Add the HTML file to the SATest diagnostic diff.
...
(Uses the functionality which has been in CmpRuns long before.)
llvm-svn: 148868
2012-01-24 21:57:35 +00:00
Anna Zaks
dc90f07b90
[analyzer] Correct the c++-analyzer symlink
...
As Matt pointed out, this should be just a link to 'ccc-analyzer'.
llvm-svn: 147661
2012-01-06 17:11:23 +00:00
Anna Zaks
06c9397665
[analyzer] c++-analyzer should be a symlink.
...
This fixes a regression from r147643.
llvm-svn: 147648
2012-01-06 02:19:07 +00:00
Anna Zaks
8e2fc5c5e9
[analyzer] Update the docs to reflect that gcc is not the only default
...
compiler option.
llvm-svn: 147645
2012-01-06 01:54:08 +00:00
Anna Zaks
1d39152059
[analyzer] scan-build: If we are on MacOS, use clang as the default
...
compiler.
llvm-svn: 147644
2012-01-06 01:54:05 +00:00
Anna Zaks
3a7f73d996
[analyzer] Skip --serialize-diagnostic when running scan-build.
...
Otherwise, the analyzer will try to analyze the serialized diagnostic
file as if it were a source file.
llvm-svn: 147643
2012-01-06 01:54:02 +00:00
Ted Kremenek
950e534e60
Force set-xcode-analyzer to use the system version of Python installed on OS X.
...
llvm-svn: 147483
2012-01-03 22:05:57 +00:00
Ted Kremenek
0e9843b328
Teach ccc-analyzer about -fobjc-arc.
...
llvm-svn: 144778
2011-11-16 05:14:42 +00:00
Anna Zaks
9fed084503
[analyzer] Make sure scan-build catches all clang failures.
...
scan-build ignores clang failures in some cases, which might lead to
silent failure suppression. For example, if clang command line
argument is wrong. (Addresses radar://10406598)
llvm-svn: 144029
2011-11-07 22:38:10 +00:00
Anna Zaks
45ce1bf091
[analyzer] When running scan-build with -plist on ./configure, delete the plist files.
...
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.)
llvm-svn: 139382
2011-09-09 18:43:53 +00:00
Anna Zaks
5efad63f57
[analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due to a merge error.
...
llvm-svn: 138919
2011-08-31 23:53:24 +00:00
Nico Weber
5d8f912f50
[analyzer] update bug report url
...
llvm-svn: 138721
2011-08-28 11:50:56 +00:00
Ted Kremenek
d33c4d39a0
scan-build: enable C++ support by default.
...
llvm-svn: 137382
2011-08-11 22:47:20 +00:00
John McCall
d70fb9812a
The ARC Migration Tool. All the credit goes to Argyrios and Fariborz
...
for this.
llvm-svn: 133104
2011-06-15 23:25:17 +00:00
Ted Kremenek
04f93b9cf1
Update regex in scan-build for parsing statistics.
...
llvm-svn: 130347
2011-04-27 23:43:27 +00:00
Ted Kremenek
f26109664e
Update scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer-stats' -cc1 argument.
...
llvm-svn: 130320
2011-04-27 18:53:08 +00:00
Ted Kremenek
13b5a2c2f8
Add Objective-C++ files to those accepted by ccc-analyzer.
...
llvm-svn: 129475
2011-04-13 21:52:05 +00:00
Ted Kremenek
f62a279e4c
Provide options to explicitly enable/disable checkers in scan-build.
...
llvm-svn: 129393
2011-04-12 21:47:00 +00:00
Ted Kremenek
79c4c2baa9
Enable C++ static analysis support in ccc-analyzer.
...
llvm-svn: 129392
2011-04-12 21:46:57 +00:00
Ted Kremenek
75bb01b47d
Filter our experimental checks in scan-build's checker listing.
...
llvm-svn: 128865
2011-04-05 00:21:49 +00:00
Ted Kremenek
c8e6f5110c
Don't store reports when scan-build's build command matches /autogen/ (same as configure).
...
llvm-svn: 128723
2011-04-01 18:47:06 +00:00
Ted Kremenek
9acb346375
scan-build: only display analyzer intra-file progress when in "Verbose" mode.
...
llvm-svn: 128015
2011-03-21 20:12:21 +00:00
Ted Kremenek
d4bcb4ffc1
Compress argument processing in ccc-analyzer. No functionality change.
...
llvm-svn: 127758
2011-03-16 21:10:42 +00:00
Ted Kremenek
339f7c3c58
Tweak ccc-analyzer's 'Analyze' function to not mutate the original arguments list.
...
llvm-svn: 127428
2011-03-10 21:10:08 +00:00
Ted Kremenek
27fdf0feda
Enhance scan-build to print out available analyses using new checker registration model.
...
This isn't totally complete. Right now scan-build uses some heuristics to determine
which checkers are enabled by default, but it cannot always tell which checkers
are not enabled.
llvm-svn: 126521
2011-02-25 22:00:40 +00:00
Ted Kremenek
42ec914ff8
Begin overhaul of scan-build/ccc-analyzer's handling of checker options.
...
We now rely on 'clang --analyze' to provide the default set of checkers. We're
still working on the new '-analyzer-checker <checker>' interface, and once
that's ready we'll wire it up to scan-build.
llvm-svn: 125712
2011-02-17 02:28:30 +00:00
Ted Kremenek
fffba74477
No longer pass deprecated '-nodistribute' flag to xcodebuild.
...
llvm-svn: 125131
2011-02-08 22:54:30 +00:00
Ted Kremenek
1dd5646da0
Enable the self-init checker in scan-build.
...
llvm-svn: 124696
2011-02-01 22:36:11 +00:00
Ted Kremenek
51651089ab
Tweak scan-build to work with naked clang commands.
...
llvm-svn: 116651
2010-10-16 00:29:16 +00:00
Tom Care
ea7c48ccf7
Updated scan-build:
...
- Idempotent operations are on by default, to match --analyze in the driver.
- Integrated stats calculation based on parsing warnings emitted with the -analyzer-stats flag. The new -stats flag enables this.
- New -maxloop flag to pass down a maxloop value to the analyzer.
llvm-svn: 115123
2010-09-30 01:12:05 +00:00
Tom Care
a5f13c866c
Modified the ccc-analyzer script to print the compiler command when log level verbosity is enabled. This is handy for debugging.
...
llvm-svn: 115109
2010-09-29 23:48:31 +00:00
Shantonu Sen
df44f74290
Forward -fno-builtin to clang, add .cp as a supported
...
extension if you otherwise configure scan-build
to do c++ static analysis.
OKed by Ted
llvm-svn: 107562
2010-07-03 03:08:23 +00:00
Ted Kremenek
e869a182c2
Add ccc-analyzer support for '-imacros'. Fixes PR 7204.
...
llvm-svn: 105624
2010-06-08 18:27:55 +00:00
Ted Kremenek
7deb7050d5
Fix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
...
llvm-svn: 100551
2010-04-06 19:41:24 +00:00
Ted Kremenek
d76197a271
scan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link projects
...
with c++ code.
llvm-svn: 99684
2010-03-27 00:20:01 +00:00
Ted Kremenek
adccbca23f
Don't enable static analysis support for C++ by default. Users are
...
accidentally using it without realizing that it is nowhere close
to being generally usable and are reporting crashes that we
already know about.
llvm-svn: 97960
2010-03-08 19:06:44 +00:00
Charles Davis
dde71b93da
Pass -m32 and -m64 to the static analyzer when using scan-build. Now we can
...
use scan-build with Wine, for example.
Ted, I hope this is OK.
llvm-svn: 97566
2010-03-02 15:26:41 +00:00