From 9a9e0d41e228c72f719757bc1c988f3e2b65a52e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 15 May 2009 04:20:31 +0000 Subject: [PATCH] Re-enable passing analyzer options from scan-build to ccc-analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71836 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/ccc-analyzer | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer index 1b1dc194f5..e4bf415b16 100755 --- a/utils/ccc-analyzer +++ b/utils/ccc-analyzer @@ -131,7 +131,8 @@ sub GetCCArgs { } sub Analyze { - my ($ClangCC, $Args, $Lang, $Output, $Verbose, $HtmlDir, $file, $Analyses) = @_; + my ($ClangCC, $Args, $AnalyzeArgs, $Lang, $Output, $Verbose, $HtmlDir, + $file, $Analyses) = @_; $Args = GetCCArgs($Args); @@ -164,6 +165,11 @@ sub Analyze { $RunAnalyzer = 1; } + # Add the analysis arguments passed down from scan-build. + foreach my $Arg (@$AnalyzeArgs) { + push @CmdArgs, $Arg; + } + my @PrintArgs; my $dir; @@ -560,11 +566,12 @@ if ($Action eq 'compile' or $Action eq 'link') { next if (!defined $FileLang); next if (!defined $LangsAccepted{$FileLang}); - my @AnalyzeArgs; + my @CmdArgs; + my @AnalyzeArgs; if ($FileLang ne 'unknown') { - push @AnalyzeArgs,'-x'; - push @AnalyzeArgs,$FileLang; + push @CmdArgs,'-x'; + push @CmdArgs,$FileLang; } if (defined $StoreModel) { @@ -586,21 +593,21 @@ if ($Action eq 'compile' or $Action eq 'link') { } } - push @AnalyzeArgs,@CompileOpts; - push @AnalyzeArgs,$file; + push @CmdArgs,@CompileOpts; + push @CmdArgs,$file; if (scalar @Archs) { foreach my $arch (@Archs) { my @NewArgs; push @NewArgs, '-arch'; push @NewArgs, $arch; - push @NewArgs, @AnalyzeArgs; - Analyze($ClangCC, \@NewArgs, $FileLang, $Output, + push @NewArgs, @CmdArgs; + Analyze($ClangCC, \@NewArgs, \@AnalyzeArgs, $FileLang, $Output, $Verbose, $HtmlDir, $file, $Analyses); } } else { - Analyze($ClangCC, \@AnalyzeArgs, $FileLang, $Output, + Analyze($ClangCC, \@CmdArgs, \@AnalyzeArgs, $FileLang, $Output, $Verbose, $HtmlDir, $file, $Analyses); } } -- 2.40.0