Commit Graph

380 Commits

Author SHA1 Message Date
Daniel Dunbar 6ec8a4d9e3 ABITest: Support --test-layout option for generating
size/alignment/offsetof based tests of types instead of calling
convention tests.

llvm-svn: 63167
2009-01-28 02:01:23 +00:00
Ted Kremenek dd62885f40 Use string comparison rather than '=='.
llvm-svn: 63095
2009-01-27 05:34:28 +00:00
Ted Kremenek a3f462e49a PathDiagnostics:
- Add the distinction between the 'bug type' and the 'bug description'

HTMLDiagnostics:
- Output the bug type field as HTML comments

scan-build:
- Use the bug type field instead of the bug description for the HTML table.
- Radar filing now automatically picks up the bug description in the title (addresses <rdar://problem/6265970>)

llvm-svn: 63084
2009-01-27 01:53:39 +00:00
Ted Kremenek 725fb43012 Have 'Analyzer Failures' files be named to reflect the category of problem.
llvm-svn: 63080
2009-01-27 01:19:08 +00:00
Daniel Dunbar 827c763051 ABITestGen: Add generation of vector types.
llvm-svn: 63024
2009-01-26 19:05:20 +00:00
Daniel Dunbar ed4361ecbb Add simple make based harness for running ABI tests.
llvm-svn: 62916
2009-01-24 08:43:22 +00:00
Ted Kremenek ec28391084 Added clang option '--analyzer-display-progress' to indicate that the analyzer should output 'ANALYZE:' messages to display its progress on a source file.
llvm-svn: 62875
2009-01-23 20:52:26 +00:00
Daniel Dunbar 70e06bdbae Update CmpDriver to report missing commands.
llvm-svn: 62728
2009-01-21 23:34:23 +00:00
Ted Kremenek 13747167ca Static Analyzer: When generating plists for errors reports, generate one plist file per translation unit that contains all of the diagnostics.
llvm-svn: 62647
2009-01-21 00:42:24 +00:00
Daniel Dunbar 34fc92fdc2 Add -analyze action to run static analyzer, instead of inferring from
individual checker options.

llvm-svn: 62634
2009-01-20 23:17:32 +00:00
Daniel Dunbar 0c8d6c9d27 ccc: Darwin/x86: Add direct cpp support.
- Add Darwin_X86_CC1Tool which is shared by Darwin/x86/Compile and
   Darwin/x86/Preprocess tools.

 - Minor bug fixes (CmpDriver exit code, -x cpp-output handling, some
   linker argument translation).

llvm-svn: 62551
2009-01-20 00:47:24 +00:00
Daniel Dunbar 563dc04faa Return success indicator from CmpDriver.
llvm-svn: 62388
2009-01-17 00:50:45 +00:00
Daniel Dunbar 2e49bf2ceb Add utils/ABITest, my ABI test generation tool.
- Mostly written as an entertaining exercise in enumerating large or
   (countably, naturally) infinite sets. But hey, its useful too!

 - Idea is to number all C-types so that the N-th type can quickly be
   computed, with a good deal of flexibility about what types to
   include, and taking some care so that the (N+1)-th type is
   interestingly different from the N-th type. For example, using the
   default generator, the 1,000,000-th function type is:
--
typedef _Complex int T0;
typedef char T1 __attribute__ ((vector_size (4)));
typedef int T2 __attribute__ ((vector_size (4)));
T2 fn1000000(T0 arg0, signed long long arg1, T1 arg2, T0 arg3);
--
   and the 1,000,001-th type is:
--
typedef _Complex char T0;
typedef _Complex char T2;
typedef struct T1 { T2 field0; T2 field1; T2 field2; } T1;
typedef struct T3 {  } T3;
unsigned short fn1000001(T0 arg0, T1 arg1, T3 arg2);
--

   Computing the 10^1600-th type takes a little less than 1s. :)

llvm-svn: 62253
2009-01-15 04:24:17 +00:00
Daniel Dunbar 35926e10bd CmpDriver: Allow over-ride of drivers to compare through env variables
(DRIVER_[AB]).

llvm-svn: 62242
2009-01-14 20:06:04 +00:00
Daniel Dunbar c838568803 Add simple tool for comparing drivers (hardcoded to gcc and xcc) which
support -###.

llvm-svn: 62156
2009-01-13 07:38:29 +00:00
Daniel Dunbar 60e734782f Add utils/SummarizeErrors.
- Little script for scanning a compile log and summarizing warnings,
   errors, assertions, and crashes.
 - Is very slow, and stack trace regexs probably only work on Darwin.

llvm-svn: 62013
2009-01-09 22:39:43 +00:00
Daniel Dunbar 1b90e1cd17 ccc (old): Pass -arch through to assembler if given.
llvm-svn: 61833
2009-01-07 00:03:20 +00:00
Anders Carlsson e298a1775d Pass '-undefined- to the linker
llvm-svn: 61663
2009-01-05 01:24:39 +00:00
Anders Carlsson 091134785d Pass -fblocks to clang
llvm-svn: 61258
2008-12-19 20:56:23 +00:00
Ted Kremenek cd7cc1ec0b Properly "include" abs_path.
llvm-svn: 60502
2008-12-03 19:50:37 +00:00
Ted Kremenek 6cd08e42e4 Use abs_path to resolve symbolic links and '..' in report table.
llvm-svn: 60493
2008-12-03 19:19:23 +00:00
Ted Kremenek eda6c23984 Don't have special treatment from pruning the common suffices of files in /Developer, /usr, etc.
llvm-svn: 60491
2008-12-03 19:16:58 +00:00
Nuno Lopes 48b5a33826 llvm-ld doesnt support '-g', so aovid passing that opt to it
llvm-svn: 60428
2008-12-02 18:19:03 +00:00
Ted Kremenek 5a205a57d8 scan-build now recognizes when the user is directly invoking gcc for:
(a) different versions of gcc (e.g., a suffix '-4.2')
(b) different paths for gcc

llvm-svn: 59578
2008-11-19 01:46:21 +00:00
Daniel Dunbar ad90855730 Input files should be before link options.
- PR3094.
 - No test case, ccc is not really a supported product (llvmc2 already
   got this right).

llvm-svn: 59535
2008-11-18 17:38:30 +00:00
Ted Kremenek eefdcea2ba Fix use of uninitialized variable.
llvm-svn: 58663
2008-11-04 00:22:12 +00:00
Ted Kremenek 90230557d7 Allow user toggling between plist and html output with scan-build/ccc-analyzer.
llvm-svn: 58657
2008-11-04 00:02:53 +00:00
Ted Kremenek 3a5d515a82 Simplify the functions HtmlEsape and ShellEscape. We now properly print out the following command line in the HTML output: scan-build gcc -x c /dev/null -c -Dfoo='"string abc"'
Fixes <rdar://problem/6338651>

llvm-svn: 58600
2008-11-03 07:44:16 +00:00
Zhongxing Xu 72cf861fba Add defined in if().
llvm-svn: 58562
2008-11-02 10:58:16 +00:00
Ted Kremenek d15b2b1121 On Mac OS X, use TMPDIR as the default location to place analysis results. This is a more secure location for such files, and addresses <rdar://problem/6334220>.
llvm-svn: 58491
2008-10-31 05:48:42 +00:00
Daniel Dunbar 719781633a Update FindSpecRefs to recognize named section references.
- Unfortunately, I don't have an easy way to map from named sections
   to numbers nicely so they don't get page numbers or integrate in
   the list well.

llvm-svn: 58368
2008-10-29 05:58:09 +00:00
Ted Kremenek 2800afa640 Minor UI enhancement:
(1) when all of the bug category boxes are checked, automatically check "All Bugs"

(2) when any of the bug category boxes are unchecked, automatically uncheck "All Bugs"

llvm-svn: 58346
2008-10-28 20:09:57 +00:00
Ted Kremenek 99205241f4 Patch by Nikita Zhuk:
The attached patch adds a checkbox to the scan-build summary report, which toggles all other checkboxes' states.

llvm-svn: 58344
2008-10-28 19:56:52 +00:00
Zhongxing Xu ad4c3ded0d Add store option to scan-build and ccc-analyzer.
llvm-svn: 58248
2008-10-27 14:26:32 +00:00
Ted Kremenek 196922b4a1 Fix scan-build's processing of clang's analysis arguments. Patch by Nikita Zhuk!
llvm-svn: 58093
2008-10-24 15:11:58 +00:00
Chris Lattner 720d515ee9 Add support for assembler-with-cpp (preprocessed .S files), patch by
Roman Divacky!

llvm-svn: 57988
2008-10-22 17:29:21 +00:00
Ted Kremenek ad4a57d757 Add "argument key" processing similar to ccc.
llvm-svn: 57780
2008-10-19 06:42:38 +00:00
Daniel Dunbar 969e35610d ccc: Pass '-g' through to clang. Handle -weak_framework.
llvm-svn: 57779
2008-10-19 02:41:16 +00:00
Daniel Dunbar 5f68d4571b ccc: support -Xlinker
llvm-svn: 57613
2008-10-16 00:10:28 +00:00
Daniel Dunbar 76eae72a0c ccc: support -fsyntax-only, add some more darwin options, support
logging of actions.

llvm-svn: 57603
2008-10-15 21:52:00 +00:00
Ted Kremenek d323ccd29c Use 'realpath' to resolve the absolute path to clang and ccc-analyzer.
Add "-analyze-headers" option to scan-build that passes the option -analyzer-opt-analyze-headers to clang.

llvm-svn: 57467
2008-10-13 21:46:42 +00:00
Ted Kremenek 63cfae34fd Add missing newline.
llvm-svn: 57333
2008-10-10 00:17:08 +00:00
Daniel Dunbar 6ba6cc42d4 Add script for checking builtin macros verse another compiler ($CC or
gcc).

llvm-svn: 57133
2008-10-05 20:39:30 +00:00
Daniel Dunbar 438b0c0c03 Bug fix, ccc was passing -std twice.
llvm-svn: 56991
2008-10-03 01:54:54 +00:00
Daniel Dunbar 92c4c4af58 Fix ccc handling of -mmacosx-version-min.
llvm-svn: 56956
2008-10-02 17:26:37 +00:00
Daniel Dunbar e8813812eb ccc: Use CCC_NATIVE=1 by default.
- So far this works fairly well for me for building applications
   using clang as a gcc substitute. If you are using ccc for a
   different purpose and this is a problem, speak up! Note you can
   also use CCC_NATIVE=0 to disable.

 - Also, turn CCC_ECHO off as default.

 - Also, pass through -Wl, to linker.

llvm-svn: 56904
2008-10-01 01:10:22 +00:00
Ted Kremenek e8450fefdd Support -mmacosx-version-min
llvm-svn: 56892
2008-09-30 23:40:25 +00:00
Daniel Dunbar 969b48cba1 ccc: Add support for another batch of OS X linker options, including
-mmacosx-version-min.

One might anticipate that at some point I will just break down and go
through the man page. That seems a little too obvious.

llvm-svn: 56890
2008-09-30 22:54:22 +00:00
Daniel Dunbar 123e7d1c2a ccc: Infer action type upfront.
- More straightforward, e.g. -E should always imply action =
   'preprocess' (I think).
 - Pass another option through for OS X.

llvm-svn: 56884
2008-09-30 21:20:51 +00:00
Daniel Dunbar 64fd24812a Change ccc to not pass -x unknown down.
Pass through some more Mac OS X linker options.

llvm-svn: 56853
2008-09-30 16:18:31 +00:00
Ted Kremenek 887c49d592 Really don't add -isysroot twice.
llvm-svn: 56815
2008-09-29 23:06:09 +00:00
Ted Kremenek 6b2e07a292 Don't filter out -fpascal-strings.
llvm-svn: 56810
2008-09-29 22:45:28 +00:00
Ted Kremenek 8b89a65136 Discard extra -isysroot options. This fixes:
<rdar://problem/6253141> Parser rejection occurs when command line has more than one -isysroot switch

llvm-svn: 56790
2008-09-29 16:15:20 +00:00
Ted Kremenek 7dbc92a269 Add "Path Length" back to the table of bug reports.
llvm-svn: 56765
2008-09-28 04:13:09 +00:00
Ted Kremenek 15146a56e1 Emulate gcc driver-driver functionality: run analyzer separately for each separate -arch option.
llvm-svn: 56618
2008-09-25 20:17:57 +00:00
Daniel Dunbar 0dbad4670c Add link to report analyzer failures (parse errors, asserts, etc).
llvm-svn: 56606
2008-09-25 06:05:31 +00:00
Daniel Dunbar 1ac2ccb47e Update scan-build to add markers about crashes.
llvm-svn: 56603
2008-09-25 01:10:50 +00:00
Ted Kremenek 72e4b0b54c Include clang preprocessed sources as well with "crashes" output.
llvm-svn: 56601
2008-09-25 00:51:44 +00:00
Ted Kremenek 1ad3b3df2f Use .txt extension for info files.
llvm-svn: 56598
2008-09-25 00:25:16 +00:00
Ted Kremenek ba79e17139 For generated index.html, look for "scan-view.css", not "/scan-view.css"
llvm-svn: 56510
2008-09-23 22:34:51 +00:00
Ted Kremenek 0ed9c35b0e Yank out special CSS for button rendering (not very portable or well tested, and we were encountering race conditions with CSS loading).
llvm-svn: 56449
2008-09-22 18:14:23 +00:00
Ted Kremenek 9b5ba60ff3 Reintegrate Daniel's changes.
llvm-svn: 56447
2008-09-22 18:05:05 +00:00
Ted Kremenek 85ea56ea84 Add "SUMMARYENDHEAD" tag.
llvm-svn: 56445
2008-09-22 17:52:58 +00:00
Ted Kremenek 620ca3d3c9 Don't embed CSS inside scan-build script; use external scanview.css.
llvm-svn: 56444
2008-09-22 17:50:47 +00:00
Ted Kremenek 8775b12c36 Don't emit link to source file.
llvm-svn: 56443
2008-09-22 17:42:31 +00:00
Ted Kremenek 2a56b23c3a Make "View Report" just a normal link again.
llvm-svn: 56442
2008-09-22 17:39:18 +00:00
Ted Kremenek a026fd3c01 Don't print out the path length.
llvm-svn: 56441
2008-09-22 17:38:23 +00:00
Ted Kremenek a3fe93b688 Use scan-view to view reports. Opening index.html is deprecated.
llvm-svn: 56431
2008-09-22 06:47:01 +00:00
Ted Kremenek d01c408b71 Patch from Richard Godbee:
Improve scan-build results to include the user's host name, the working
directory of the analyzed project, and the date the analysis run took place.

llvm-svn: 56421
2008-09-22 01:35:58 +00:00
Ted Kremenek 0b7ae724a7 Add webkit styles using Javascript (detect for AppleWebKit)
llvm-svn: 56408
2008-09-21 20:10:46 +00:00
Ted Kremenek 23432d4c7b Unbreak using abs_path.
llvm-svn: 56407
2008-09-21 19:56:14 +00:00
Ted Kremenek 9eca6af2f2 Remove debugging message.
llvm-svn: 56398
2008-09-21 18:26:58 +00:00
Ted Kremenek ca8ac081af Unbreak ccc-analyzer: getcwd is from package Cwd
llvm-svn: 56397
2008-09-21 18:26:19 +00:00
Ted Kremenek 32c1181468 Patch by Richard Godbee:
Output to .info files the absolute paths to files that were rejected by the
parser or crashed the analyzer.

llvm-svn: 56396
2008-09-21 18:04:49 +00:00
Ted Kremenek 172f04dfe6 scan-build now prints out bug categories.
llvm-svn: 56395
2008-09-21 06:58:09 +00:00
Ted Kremenek ebb4245b84 Have ScanView.py generate a "<td></td>" pair in the output HTML instead of having scan-build output an empty (and possibly unused) <td>.
llvm-svn: 56393
2008-09-21 03:55:51 +00:00
Daniel Dunbar 669632bf9a Add REPORTBUG marker to scan-build.
llvm-svn: 56373
2008-09-19 23:18:44 +00:00
Ted Kremenek 6633871cb3 Analysis option -warn-objc-nserror-methods is no longer available. (check is done automatically with -checker-cfref)
llvm-svn: 56313
2008-09-18 21:25:58 +00:00
Ted Kremenek be061e2a19 Enable '-warn-objc-nserror-methods' by default.
llvm-svn: 56298
2008-09-18 06:34:16 +00:00
Ted Kremenek 907921f753 Include links to stderr output of clang in the table of files that clang rejects.
llvm-svn: 56173
2008-09-12 22:49:36 +00:00
Daniel Dunbar 2880158a20 Add ccc support for -e and -sectorder.
- llvmc2, save me!

llvm-svn: 56169
2008-09-12 19:42:28 +00:00
Daniel Dunbar be12fd1f4f Teach FindSpecRefs how to link to C++ spec.
llvm-svn: 56164
2008-09-12 18:10:49 +00:00
Ted Kremenek 4ab81cbe2f Echo stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
to an output file. This way users can both see the output of 'clang' as well as
enable background logging of files that clang encounters problems on.

llvm-svn: 56130
2008-09-11 23:05:26 +00:00
Ted Kremenek 28d1dc50b8 Bug fix: <rdar://problem/6164367>
scan-build now correctly processes path prefixes that contain multiple '+'
characters or other regex control characters.

llvm-svn: 56121
2008-09-11 21:15:10 +00:00
Ted Kremenek 81ced5c472 Check if the environment variable TERM is defined before using it.
This fixes: <rdar://problem/6164279> scan-build gives error when invoked without TERM variable

llvm-svn: 56110
2008-09-11 18:17:51 +00:00
Ted Kremenek c92c134563 Patch to scan-build by Jordan Breeding:
- Don't remove $BaseDir; may be unsafe
- Always create HTML directory with parents

llvm-svn: 55813
2008-09-04 23:56:36 +00:00
Daniel Dunbar 217836527c Fix FindSpecRefs to be Python 2.4 compatible and get the SVN revision
in a more obvious fashion.

llvm-svn: 55791
2008-09-04 20:26:14 +00:00
Ted Kremenek e9354c6029 scan-build:
- Only set the environment variable 'CXX' if the user specifies --use-c++.
- Fix regression when setting LDPLUSPLUS: add a 'which' to determine the location of g++.  This regression was pointed out by Jordan Breeding!

llvm-svn: 55780
2008-09-04 17:52:41 +00:00
Ted Kremenek 3cbb3b2920 Capture 'uname' and 'gcc -v' output to .info files.
llvm-svn: 55752
2008-09-04 00:41:45 +00:00
Ted Kremenek 370de84b50 ccc-analyzer:
- Capture the STDERR output of 'clang' to a file for use with crash reporting.

llvm-svn: 55749
2008-09-04 00:02:34 +00:00
Ted Kremenek f4fd23f635 Added --use-cxx option to scan-build.
llvm-svn: 55706
2008-09-03 17:59:35 +00:00
Nuno Lopes d63db4063a recognise .s/.S file extensions. add default value for CCC_LANGUAGES
llvm-svn: 55630
2008-09-02 10:27:37 +00:00
Daniel Dunbar 2e5225818a Improve ccc:
- Support environment variable CCC_LANGUAGES to control which
   languages clang is invoked on. If unset clang is invoked for all
   languages, otherwise CCC_LANGUAGES should be a comma separated list
   of the languages (as accepted by -x) for which clang should be
   invoked. Useful for only building C and Objective-C parts of a
   project with clang, for example.

 - Add environment variable CCC_FALLBACK. If set and non-empty then
   ccc will try and compile using the regular compiler if compilation
   with clang fails.

 - A few other tweaks to add options, flush stdout, recognize .mm as
   objective-c++, and infer languages for compile+link style
   invocations.

llvm-svn: 55547
2008-08-29 21:03:27 +00:00
Daniel Dunbar a545f466e8 Add utils/FindSpecRefs, Python script for generating specification
references HTML page.

llvm-svn: 55524
2008-08-29 01:07:08 +00:00
Ted Kremenek 1bb387e056 Use explicit variable instead of $?
llvm-svn: 55501
2008-08-28 21:28:55 +00:00
Ted Kremenek de8008a130 Enhance ubiviz to support vertex styles.
llvm-svn: 55462
2008-08-28 05:01:37 +00:00
Ted Kremenek 266ec3fb4e Automatically execute ubiviz.
Cleanup ubigraph files when don't drawing the graphs.

llvm-svn: 55459
2008-08-28 03:54:51 +00:00
Ted Kremenek 1a42278a19 Fix regression: immediately terminate ccc-analyzer when gcc reports an error.
llvm-svn: 55452
2008-08-28 01:18:44 +00:00
Ted Kremenek d461d7ad7e Added Ubigraph visualization for the static analyzer (this is pretty alpha quality).
llvm-svn: 55442
2008-08-27 22:31:43 +00:00
Ted Kremenek 7b62806272 Remove regression where the analyzer was not called.
llvm-svn: 55440
2008-08-27 22:30:34 +00:00
Ted Kremenek 715ac7c51e Use path information from .info files when computing common prefix information.
This partially implements PR 2705: http://llvm.org/bugs/show_bug.cgi?id=2705

llvm-svn: 55327
2008-08-25 20:45:07 +00:00
Ted Kremenek 6aa1ad0a7b Use the same 'cc' for generated preprocessed crash files as we do for compilation.
llvm-svn: 55326
2008-08-25 20:44:31 +00:00
Ted Kremenek a3b3c86a47 ccc-analyzer now correctly reports the exit code from 'cc'.
scan-build now correctly reports the exit code from the build command.
Fixes: <rdar://problem/6172224>

llvm-svn: 55324
2008-08-25 20:10:45 +00:00
Daniel Dunbar eacf1d2c0f Update ccc driver
- Use CCC_ECHO to control echoing behavior (default is on, set to ''
   or unset to disable)
 - Get 'clang','llc','as','cc','ld' executables from environment. 'cc'
   and 'ld' are fetched through CCC_CC and CCC_LD respectively -- to
   support make CC=ccc -- the others are through their upcased
   versions.
 - Add CCC_NATIVE mode.
   o This uses llc and as to generate native object files; allowing
     more drop-in replacement of gcc.
   o Disabled by default, but should eventually be default.
   o Allow --emit-llvm in CCC_NATIVE mode to override. Essentially
     this makes ccc more like a drop in replacement for llvm-gcc.
 - Prevent explicit -x <language> options from annoying clang.

llvm-svn: 55260
2008-08-23 22:15:15 +00:00
Ted Kremenek b57efcc3d0 Added --use-cc option to scan-build to allow the user to specify what compiler they want to use for code compilation.
llvm-svn: 55142
2008-08-21 21:47:09 +00:00
Ted Kremenek b3c98d3a88 Record arguments in .info file.
llvm-svn: 54947
2008-08-18 20:55:25 +00:00
Ted Kremenek 5abf546865 scan-build/ccc-analyzer now also report clang parser failures.
llvm-svn: 54931
2008-08-18 18:38:29 +00:00
Nuno Lopes d83be33cc0 fix linking with .so files specified in cmd line (this fixes some libtool usages)
llvm-svn: 54623
2008-08-10 22:17:57 +00:00
Nuno Lopes c14bcffda6 pass -R arg to linker
llvm-svn: 54622
2008-08-10 21:58:01 +00:00
Ted Kremenek 994c8e393d Have scan-build/ccc-analyzer generate preprocessed .i/.mi files for sources that clang crashes on.
llvm-svn: 54552
2008-08-08 20:46:42 +00:00
Ted Kremenek 1f4eb6b8da Fix by Jordan Breeding: when scanning for prior runs, scan-build should ignore files that are not directories.
llvm-svn: 54473
2008-08-07 17:57:34 +00:00
Ted Kremenek 7ae17ce6b4 Misc cleanups.
When results go to a auto-generated dir in /tmp, don't use randomized file names.  Just output /tmp/scan-build-DATE-counter, where counter is an auto-incremented counter for runs produced that day.

llvm-svn: 54325
2008-08-04 18:15:26 +00:00
Ted Kremenek 5a3803c076 Convert remaining "open" calls to use three-argument form (thanks to Sam Bishop for the tip!).
Recognize 'ccc-analyzer' as a build command some users may use.  Treat it just like calling gcc.

llvm-svn: 54323
2008-08-04 17:34:06 +00:00
Ted Kremenek 6a77d42a4d Use stable sort.
llvm-svn: 54222
2008-07-30 18:03:31 +00:00
Ted Kremenek e8fce56cd1 "Escape" bug names with quotes for selecting/deselecting from the bug table.
llvm-svn: 54220
2008-07-30 17:58:08 +00:00
Ted Kremenek 7fb92dbf47 Enabled 'unused ivars' check by default.
llvm-svn: 54052
2008-07-25 20:35:01 +00:00
Ted Kremenek 4a154b2857 Ignore -MT and -MF.
llvm-svn: 53977
2008-07-24 03:52:21 +00:00
Ted Kremenek 1c0c06bb9c "This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor options in ccc."
Patch by Zhongxing Xu!

llvm-svn: 53976
2008-07-24 03:49:15 +00:00
Ted Kremenek f7ffd66551 Reimplement ccc-analyzer in a language I actually know, and implement some obvious optimizations when processing command line arguments.
llvm-svn: 53783
2008-07-19 06:11:04 +00:00
Ted Kremenek d2d122961d Remove typo.
llvm-svn: 53776
2008-07-18 23:13:03 +00:00
Ted Kremenek 2a6b0b5d5e Quote invocation of clang in pipe to handle paths with spaces.
llvm-svn: 53775
2008-07-18 23:11:33 +00:00
Ted Kremenek 803d9ef9d6 Have scan-build control default analyses.
llvm-svn: 53654
2008-07-15 23:41:32 +00:00
Ted Kremenek 3be3401303 Add -DIBOutlet=__attribute__((iboutlet)) to analyzer arguments.
llvm-svn: 53648
2008-07-15 23:09:14 +00:00
Ted Kremenek 3879c5f6e4 Added --status-bugs option to scan-build. By default, the exit status of
scan-build is the same as the exit status of the executed build command. With
this option, the exit status of scan-build is 1 if the analyzer flagged any
bugs, and 0 otherwise.

This addresses: <rdar://problem/6075320>

llvm-svn: 53642
2008-07-15 22:03:09 +00:00
Ted Kremenek 48ea92965b Per Sam Bishop's excellent suggestion, use "system" instead of backticks to invoke sub-commands used by scan-build. This avoids meta-character translation issues caused by a shell subprocess.
llvm-svn: 53640
2008-07-15 20:18:21 +00:00
Ted Kremenek c7cd410657 Quote file names to better handle paths with spaces.
llvm-svn: 53635
2008-07-15 18:28:16 +00:00
Ted Kremenek 78e9c0d697 scan-build now propagates up the exit status of the build command.
llvm-svn: 53620
2008-07-15 17:09:28 +00:00
Ted Kremenek e5165722ed Do not enable -warn-objc-missing-dealloc by default.
llvm-svn: 53619
2008-07-15 17:06:44 +00:00
Ted Kremenek 3a787bf977 scan-build now interrogates clang for a list of available analyses, and presents
these as options to the user of scan-build.

llvm-svn: 53618
2008-07-15 17:06:13 +00:00
Ted Kremenek 5470e0c7e1 Re-enable missing -dealloc check.
llvm-svn: 53578
2008-07-14 23:56:31 +00:00
Ted Kremenek 2fa70832e4 Using new clang option to invoke the type-signature check of Objective-C instance methods.
llvm-svn: 53576
2008-07-14 23:41:49 +00:00
Ted Kremenek afe2c0be34 Run by default: -check-objc-methodsigs
llvm-svn: 53483
2008-07-11 22:41:43 +00:00
Ted Kremenek 36f8212299 scan-build now also prints the HTML directory reports were emitted to at the end of the build.
llvm-svn: 53466
2008-07-11 19:15:05 +00:00
Ted Kremenek 86b4249c97 Mark the "Bug Type" column as being initially sorted (display the sort ding) so that users can readily see that the table can be sorted.
llvm-svn: 53176
2008-07-07 17:23:32 +00:00
Ted Kremenek 9707a93f9d Output html should have 'class=' before "sorttable_nosort".
llvm-svn: 53175
2008-07-07 16:58:44 +00:00
Nuno Lopes a7c7c6b011 llvm-ld doesnt support -O1, -O2, etc options, so dont pass them
llvm-svn: 53144
2008-07-05 17:31:10 +00:00
Ted Kremenek 9c75ea62d7 Have ccc-analyzer skip any files with an unknown (or absent) extension.
llvm-svn: 53114
2008-07-03 22:24:10 +00:00
Ted Kremenek f1f17555bd ccc-analyzer now dispatches the options "-checker-cfref" and "-warn-dead-stores" to clang instead of just "-checker-cfref".
llvm-svn: 53053
2008-07-02 23:16:10 +00:00
Ted Kremenek 51a685cf27 When inspecting the build command, strip off the preceding path to the build command.
llvm-svn: 52913
2008-06-30 18:18:16 +00:00
Ted Kremenek fec817aa12 Bug fix: when copying prefix files using 'cp', don't split file names by spaces.
llvm-svn: 52899
2008-06-30 16:12:30 +00:00
Chris Lattner 552b52f49d "This maps the -pthread option to -lpthread - this isn't 100% correct,
since handling this correctly is quite complex, and on some platforms  
requires additional -D options and on some implies linking against a  
different libc, but this works better than just ignoring the option.

The other change passes the -x option across to clang, which allows  
compiling .c files as Objective-C and so on.  For some reason a lot of  
configure scripts seem to be under the misguided impression that this  
is a sensible thing to do."

Patch by David Chisnall!

llvm-svn: 52579
2008-06-21 17:46:11 +00:00
Nuno Lopes a02e2f991b handle -arch and -isysroot correctly (like ccc-analyszer do).
Patch by Filipe Cabecinhas

llvm-svn: 52417
2008-06-17 17:23:14 +00:00
Ted Kremenek 3dd7724711 Only use colored output when the environment variable SCAN_BUILD_COLOR is set.
llvm-svn: 52379
2008-06-17 03:06:59 +00:00
Ted Kremenek 51ca6fa512 Remove debugging message in ccc-analyzer.
Add color diagnostics from scan-build, and indicate the number of bugs found (if any).

llvm-svn: 52372
2008-06-16 22:40:14 +00:00
Ted Kremenek c17ec3e27f Re-enable the analyzer.
llvm-svn: 52367
2008-06-16 21:41:07 +00:00
Ted Kremenek 2f7a88ddf6 Skip a few more files and linker options.
llvm-svn: 52189
2008-06-10 18:56:59 +00:00
Ted Kremenek dfa8c8aef5 Ignore a few more linker arguments.
llvm-svn: 52023
2008-06-05 22:46:24 +00:00
Ted Kremenek 6da61be501 ccc-analyzer now properly eats the -install_name, -exported_symbols_list, -current_version, -compatibility_version, and -sectorder command line arguments.
llvm-svn: 51965
2008-06-04 20:49:03 +00:00
Ted Kremenek 88bfb62ffe Use the correct 'ccc-analyzer' when the build command is a direct invocation of gcc.
llvm-svn: 51883
2008-06-02 21:52:47 +00:00
Ted Kremenek 7ccc9835ef Use "file_language" for per-language -x options.
llvm-svn: 51871
2008-06-02 17:13:40 +00:00
Ted Kremenek ffdbeefc54 When the build command is xcodebuild, set the magical environment variable LDPLUSPLUS to g++ to ensure that C++ object files are linked with g++ instead of gcc.
llvm-svn: 51621
2008-05-27 23:18:07 +00:00
Ted Kremenek f9671ecbfd Correctly check to see if we are analyzing C++ files (skip).
llvm-svn: 51620
2008-05-27 23:17:16 +00:00
Ted Kremenek e37e612e7a Fix variable misspelling.
llvm-svn: 51548
2008-05-24 16:16:30 +00:00
Ted Kremenek 37d6f58018 Don't use inferlanguage to override the default language for all files.
llvm-svn: 51547
2008-05-24 16:14:34 +00:00
Ted Kremenek 55842bd269 Don't analyze .o files.
llvm-svn: 51546
2008-05-24 16:09:00 +00:00
Ted Kremenek f18f460716 Cleanup indentation and remove some dead code.
Analyze files not compiled using "-c".  This fixes:

<rdar://problem/5961638> invoke checker when gcc is not called with "-c"

llvm-svn: 51545
2008-05-24 15:58:54 +00:00
Ted Kremenek 567f333f23 Disable the use of PCH files when using xcodebuild.
llvm-svn: 51509
2008-05-23 22:18:16 +00:00
Ted Kremenek a4951b7796 When known, include the analyzer build in the output of scan-build.
llvm-svn: 51492
2008-05-23 18:17:05 +00:00
Ted Kremenek 1907394f74 Don't specify a -o option to clang when not using "-checker-cfref".
llvm-svn: 51124
2008-05-14 20:26:52 +00:00
Ted Kremenek e0927a0f49 Fix variable misspelling.
llvm-svn: 51122
2008-05-14 20:20:46 +00:00
Ted Kremenek cf05a830b1 Don't run clang on .s files.
llvm-svn: 51121
2008-05-14 20:17:17 +00:00
Ted Kremenek e3fc13a3e0 Added "-a" option to scan-build to select the analysis (ASTConsumer) used by clang. The default is -checker-cfref.
llvm-svn: 51116
2008-05-14 20:10:33 +00:00
Ted Kremenek 0a8a0fa0b5 Zero-pad the month and day fields in the output HTML directory.
llvm-svn: 51109
2008-05-14 17:23:56 +00:00
Ted Kremenek 20a44ed730 Output #LINE for computing line counts.
llvm-svn: 51079
2008-05-13 22:56:36 +00:00
Ted Kremenek 7147584d03 Use "-i" option with make when ignoring errors.
llvm-svn: 51070
2008-05-13 21:28:02 +00:00
Ted Kremenek 52387a1828 Re-enable the analyzer.
llvm-svn: 51055
2008-05-13 17:10:28 +00:00
Ted Kremenek 80ff5f0696 Place "-x" option before other analyzer options.
llvm-svn: 51014
2008-05-12 23:56:50 +00:00
Ted Kremenek ece302d75b Directly invoke gcc immediately instead of before we process the command line arguments.
llvm-svn: 51012
2008-05-12 23:47:41 +00:00
Ted Kremenek f5a94e7114 Added internal command logging.
llvm-svn: 51003
2008-05-12 22:07:14 +00:00
Ted Kremenek b95635e6ec Fix a few glitches in scan-build with automatically generating class names from bug types.
llvm-svn: 50784
2008-05-06 23:51:45 +00:00
Ted Kremenek 10427bdbb9 Experiment with not converting bug names to lower case.
llvm-svn: 50753
2008-05-06 18:11:36 +00:00
Ted Kremenek 1108d6eef3 Remove debugging statement.
llvm-svn: 50598
2008-05-02 23:40:49 +00:00
Ted Kremenek 5f56cbbf7d Output better paths to display in bug reports and compute a common
prefix for all files.

llvm-svn: 50592
2008-05-02 22:04:53 +00:00
Ted Kremenek 4f3d7cd12e Add missing "-" that prefix arguments to forward to clang.
llvm-svn: 50540
2008-05-01 21:26:22 +00:00
Ted Kremenek 0ae9ed7fab scan-build: Disable distributed builds for xcodebuild
llvm-svn: 50506
2008-04-30 23:47:12 +00:00
Ted Kremenek a8197366db Pass fobjc-gc-only and fobjc-gc options down to clang.
llvm-svn: 50426
2008-04-29 16:24:23 +00:00
Ted Kremenek e5aa10cec4 Pass down more -iXXX options that clang supports
llvm-svn: 50304
2008-04-25 21:28:20 +00:00
Nate Begeman f0168bd208 Don't double-increment counter for -arch and -isysroot
llvm-svn: 50082
2008-04-22 04:47:32 +00:00
Ted Kremenek 405cf2daf9 Remove unused "verbose" argument to compile(). Also unbreaks ccc-analyzer.
llvm-svn: 50066
2008-04-21 21:58:05 +00:00
Ted Kremenek 74a58d780a Pass "-arch" down to clang.
llvm-svn: 50056
2008-04-21 20:28:01 +00:00
Ted Kremenek 31d2176d1e Pass "-isysroot" option down to clang.
llvm-svn: 49956
2008-04-19 18:42:26 +00:00
Ted Kremenek 6267835f57 Fix spelling/grammar in comment.
llvm-svn: 49955
2008-04-19 18:07:44 +00:00
Ted Kremenek b0fa31cefb Use Digest::MD5 (a Perl module that should come bundled standard with Perl) to compute file digests instead of using the external program "sha1sum" (which may not be present).
llvm-svn: 49954
2008-04-19 18:05:48 +00:00
Ted Kremenek cf9e9c5554 Use 'clang' binary in the same dir as scan-build; if it isn't there use the one in the path
llvm-svn: 49933
2008-04-18 22:00:56 +00:00
Ted Kremenek 8886b3021e Turn on CF reference count checker.
llvm-svn: 49931
2008-04-18 21:53:01 +00:00
Ted Kremenek 532ba14fdb Spelling fix.
llvm-svn: 49908
2008-04-18 16:58:34 +00:00
Ted Kremenek b06817e914 scan-build now fixes permissions of report files and directories, which may
be created as "temporary files" that are not world readable.

llvm-svn: 49904
2008-04-18 15:18:20 +00:00
Ted Kremenek 4bf02a0856 Compute a digest of each report file, and nuke reports that have the same
digest as a file already added to the index.  This a workaround for the
analyzer analyzing the same file more than once, which can happen when building
multiple targets.

llvm-svn: 49903
2008-04-18 15:09:30 +00:00
Ted Kremenek 43445b3081 Added "summary table" to generated index.html page that allows one to
toggle which bug reports are displayed in the report table.

llvm-svn: 49738
2008-04-15 20:47:02 +00:00
Ted Kremenek 969bb805f9 Used --checker-simple.
llvm-svn: 49501
2008-04-10 22:17:23 +00:00
Ted Kremenek 42d9db75f0 When not emitting path diagnostics in BugReporter::EmitWarning(), use the
BugReport-specific SourceRanges (when available).

llvm-svn: 49486
2008-04-10 16:12:38 +00:00
Ted Kremenek ba0e4237aa Set the location of ccc-analyzer to be the same directory as where scan-build
is located.

llvm-svn: 49397
2008-04-08 20:22:12 +00:00
Ted Kremenek a378fe0a2e Left-justify text in report table.
llvm-svn: 49358
2008-04-07 23:50:07 +00:00
Ted Kremenek c0f15487c6 Fix analyzer breakage introduced by r49213: http://llvm.org/viewvc/llvm-project?rev=49213&view=rev
The problem is that some clients of gcc lookout at the stdout output of gcc;
this requires that all the analyzer diagnostics go to stderr to avoid polluting
stdout.

llvm-svn: 49355
2008-04-07 23:27:54 +00:00
Seo Sanghyeon b7bf0f3e1e - ccc: print generated command line to stdout instead of stderr
- ccc: quote shell metacharacters in command line to ease copy-and-paste

llvm-svn: 49213
2008-04-04 11:02:21 +00:00
Ted Kremenek bf191c76bd Remove bogus check to prune out analyzing files.
llvm-svn: 49191
2008-04-03 21:29:11 +00:00
Ted Kremenek 4c32d1fcce More reliably remove '\n' from queries of the location of ccc-analyzer
llvm-svn: 49189
2008-04-03 21:17:14 +00:00
Ted Kremenek 0dcd309044 Use full path to ccc-analyzer.
llvm-svn: 49187
2008-04-03 20:08:18 +00:00
Sam Bishop 30d70968fd Remove handling of impossible "-?" option.
llvm-svn: 49161
2008-04-03 14:29:47 +00:00
Ted Kremenek 4d26d194e4 Don't run the analyzer on files whose language is "unknown"
llvm-svn: 49152
2008-04-03 07:14:59 +00:00