summaryrefslogtreecommitdiffstats
path: root/tools/scan-build/ccc-analyzer
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scan-build/ccc-analyzer')
-rwxr-xr-xtools/scan-build/ccc-analyzer45
1 files changed, 21 insertions, 24 deletions
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer
index 60b0185..b463ec0 100755
--- a/tools/scan-build/ccc-analyzer
+++ b/tools/scan-build/ccc-analyzer
@@ -325,11 +325,6 @@ sub Analyze {
my %CompileOptionMap = (
'-nostdinc' => 0,
- '-fblocks' => 0,
- '-fno-builtin' => 0,
- '-fobjc-gc-only' => 0,
- '-fobjc-gc' => 0,
- '-ffreestanding' => 0,
'-include' => 1,
'-idirafter' => 1,
'-imacros' => 1,
@@ -346,18 +341,16 @@ my %LinkerOptionMap = (
);
my %CompilerLinkerOptionMap = (
- '-fobjc-arc' => 0,
- '-fno-objc-arc' => 0,
- '-fobjc-abi-version' => 0, # This is really a 1 argument, but always has '='
- '-fobjc-legacy-dispatch' => 0,
+ '-Wwrite-strings' => 0,
+ '-ftrapv-handler' => 1, # specifically call out separated -f flag
'-mios-simulator-version-min' => 0, # This really has 1 argument, but always has '='
'-isysroot' => 1,
'-arch' => 1,
'-m32' => 0,
'-m64' => 0,
'-stdlib' => 0, # This is really a 1 argument, but always has '='
+ '-target' => 1,
'-v' => 0,
- '-fpascal-strings' => 0,
'-mmacosx-version-min' => 0, # This is really a 1 argument, but always has '='
'-miphoneos-version-min' => 0 # This is really a 1 argument, but always has '='
);
@@ -427,8 +420,8 @@ my %Uniqued;
# Forward arguments to gcc.
my $Status = system($Compiler,@ARGV);
-if (defined $ENV{'CCC_ANALYZER_LOG'}) {
- print "$Compiler @ARGV\n";
+if (defined $ENV{'CCC_ANALYZER_LOG'}) {
+ print STDERR "$Compiler @ARGV\n";
}
if ($Status) { exit($Status >> 8); }
@@ -453,8 +446,8 @@ if (!defined $OutputFormat) { $OutputFormat = "html"; }
# Determine the level of verbosity.
my $Verbose = 0;
-if (defined $ENV{CCC_ANALYZER_VERBOSE}) { $Verbose = 1; }
-if (defined $ENV{CCC_ANALYZER_LOG}) { $Verbose = 2; }
+if (defined $ENV{'CCC_ANALYZER_VERBOSE'}) { $Verbose = 1; }
+if (defined $ENV{'CCC_ANALYZER_LOG'}) { $Verbose = 2; }
# Get the HTML output directory.
my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'};
@@ -491,10 +484,6 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; }
next;
}
- if ($Arg =~ /-m.*/) {
- push @CompileOpts,$Arg;
- next;
- }
# Handle the case where there isn't a space after -iquote
if ($Arg =~ /-iquote.*/) {
push @CompileOpts,$Arg;
@@ -556,6 +545,11 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
next;
}
+ if ($Arg =~ /-m.*/) {
+ push @CompileOpts,$Arg;
+ next;
+ }
+
# Language.
if ($Arg eq '-x') {
$Lang = $ARGV[$i+1];
@@ -574,6 +568,9 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
if ($Arg eq '-O') { push @LinkOpts,'-O1'; }
elsif ($Arg eq '-Os') { push @LinkOpts,'-O2'; }
else { push @LinkOpts,$Arg; }
+
+ # Must pass this along for the __OPTIMIZE__ macro
+ if ($Arg =~ /^-O/) { push @CompileOpts,$Arg; }
next;
}
@@ -582,12 +579,6 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
next;
}
-# if ($Arg =~ /^-f/) {
-# # FIXME: Not sure if the remaining -fxxxx options have no arguments.
-# push @CompileOpts,$Arg;
-# push @LinkOpts,$Arg; # FIXME: Not sure if these are link opts.
-# }
-
# Get the compiler/link mode.
if ($Arg =~ /^-F(.+)$/) {
my $Tmp = $Arg;
@@ -611,6 +602,12 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
next;
}
+ if ($Arg =~ /^-f/) {
+ push @CompileOpts,$Arg;
+ push @LinkOpts,$Arg;
+ next;
+ }
+
# Handle -Wno-. We don't care about extra warnings, but
# we should suppress ones that we don't want to see.
if ($Arg =~ /^-Wno-/) {
OpenPOWER on IntegriCloud