Commit Graph

112 Commits

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