Commit Graph

114 Commits

Author SHA1 Message Date
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