[PATCH][Review request][analyzer] scan-build for windows

Jordan Rose jordan_rose at apple.com
Tue Apr 30 19:29:21 PDT 2013


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.


> @@ -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?

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130430/b9d633e5/attachment.html>


More information about the cfe-commits mailing list