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
This commit is contained in:
Ted Kremenek 2009-05-15 04:20:31 +00:00
Родитель 621cc4ebcc
Коммит 9a9e0d41e2
1 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -131,7 +131,8 @@ sub GetCCArgs {
} }
sub Analyze { sub Analyze {
my ($ClangCC, $Args, $Lang, $Output, $Verbose, $HtmlDir, $file, $Analyses) = @_; my ($ClangCC, $Args, $AnalyzeArgs, $Lang, $Output, $Verbose, $HtmlDir,
$file, $Analyses) = @_;
$Args = GetCCArgs($Args); $Args = GetCCArgs($Args);
@ -164,6 +165,11 @@ sub Analyze {
$RunAnalyzer = 1; $RunAnalyzer = 1;
} }
# Add the analysis arguments passed down from scan-build.
foreach my $Arg (@$AnalyzeArgs) {
push @CmdArgs, $Arg;
}
my @PrintArgs; my @PrintArgs;
my $dir; my $dir;
@ -560,11 +566,12 @@ if ($Action eq 'compile' or $Action eq 'link') {
next if (!defined $FileLang); next if (!defined $FileLang);
next if (!defined $LangsAccepted{$FileLang}); next if (!defined $LangsAccepted{$FileLang});
my @AnalyzeArgs; my @CmdArgs;
my @AnalyzeArgs;
if ($FileLang ne 'unknown') { if ($FileLang ne 'unknown') {
push @AnalyzeArgs,'-x'; push @CmdArgs,'-x';
push @AnalyzeArgs,$FileLang; push @CmdArgs,$FileLang;
} }
if (defined $StoreModel) { if (defined $StoreModel) {
@ -586,21 +593,21 @@ if ($Action eq 'compile' or $Action eq 'link') {
} }
} }
push @AnalyzeArgs,@CompileOpts; push @CmdArgs,@CompileOpts;
push @AnalyzeArgs,$file; push @CmdArgs,$file;
if (scalar @Archs) { if (scalar @Archs) {
foreach my $arch (@Archs) { foreach my $arch (@Archs) {
my @NewArgs; my @NewArgs;
push @NewArgs, '-arch'; push @NewArgs, '-arch';
push @NewArgs, $arch; push @NewArgs, $arch;
push @NewArgs, @AnalyzeArgs; push @NewArgs, @CmdArgs;
Analyze($ClangCC, \@NewArgs, $FileLang, $Output, Analyze($ClangCC, \@NewArgs, \@AnalyzeArgs, $FileLang, $Output,
$Verbose, $HtmlDir, $file, $Analyses); $Verbose, $HtmlDir, $file, $Analyses);
} }
} }
else { else {
Analyze($ClangCC, \@AnalyzeArgs, $FileLang, $Output, Analyze($ClangCC, \@CmdArgs, \@AnalyzeArgs, $FileLang, $Output,
$Verbose, $HtmlDir, $file, $Analyses); $Verbose, $HtmlDir, $file, $Analyses);
} }
} }