[PATCH][Review request][analyzer] scan-build for windows
Anton Yartsev
anton.yartsev at gmail.com
Wed May 1 06:38:45 PDT 2013
On 01.05.2013 6:29, Jordan Rose wrote:
> Comments:
>
>> +use English;
>
> According to http://perldoc.perl.org/English.html, it's probably
> better to use
>
> use English qw( -no_match_vars ) ;
>
> ...not that scan-build's startup time matters /that/ much.
Currently this is used only for $OSNAME while short names are used for
all other special perl variables.
Considering that using English affects performance, what about rolling
back to $^O and adding explanatory comment instead?
>> @@ -1576,16 +1584,17 @@
>> # Determine the location of ccc-analyzer.
>> my $AbsRealBin = Cwd::realpath($RealBin);
>> +my $CXXAnalyzerExecName = "c++-analyzer";
>> my $Cmd = "$AbsRealBin/libexec/ccc-analyzer";
>> -my $CmdCXX = "$AbsRealBin/libexec/c++-analyzer";
>> +my $CmdCXX = "$AbsRealBin/libexec/$CXXAnalyzerExecName";
>> if (!defined $Cmd || ! -x $Cmd) {
>> $Cmd = "$AbsRealBin/ccc-analyzer";
>> DieDiag("Executable 'ccc-analyzer' does not exist at '$Cmd'\n")
>> if(! -x $Cmd);
>> }
>> if (!defined $CmdCXX || ! -x $CmdCXX) {
>> - $CmdCXX = "$AbsRealBin/c++-analyzer";
>> - DieDiag("Executable 'c++-analyzer' does not exist at '$CmdCXX'\n")
>> if(! -x $CmdCXX);
>> + $CmdCXX = "$AbsRealBin/$CXXAnalyzerExecName";
>> + DieDiag("Executable '$CXXAnalyzerExecName' does not exist at
>> '$CmdCXX'\n") if(! -x $CmdCXX);
>> }
>
> This section is no longer necessary.
>
>
> Finally, it seems a bit funny to have a .pm file that contains
> top-level code and then exits, rather than just declaring stuff.
> Here's another redesign: ccc-analyzer stays the same, and c++-analyzer
> is just "do 'ccc-analyzer'". How's that sound?
'do' is just what I searched for, but missed.
>
> If you don't like that, then the top-level code in analyzer_common.pm
> should probably be organized into some run()-like function. That would
> at least take out the check for $FindBin::Script: each wrapper script
> would already know if it was supposed to be a C++ compiler or not.
>
> Jordan
--
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130501/1198847a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scan-build-for-win_v2.patch
Type: text/x-diff
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130501/1198847a/attachment.patch>
More information about the cfe-commits
mailing list