aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-05 02:18:39 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-05 02:18:39 +0000
commit9f9e0dbc13a85b35fcf36883619c7e6f89ca5a84 (patch)
treedd21854e6c0b459177750b4f339d572854634ee2
parent565e465c6d0093f1bf8414b2cabdc842022385a9 (diff)
Now that the -cc1 options for analyzer checks have a structured naming, add back scanning for analyzer checks to scan-build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95349 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtools/scan-build/scan-build19
1 files changed, 4 insertions, 15 deletions
diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build
index 5bbca3a6bc..985579f734 100755
--- a/tools/scan-build/scan-build
+++ b/tools/scan-build/scan-build
@@ -98,25 +98,14 @@ if (!defined $Clang || ! -x $Clang) {
my %AvailableAnalyses;
# Query clang for analysis options.
-open(PIPE, "-|", $Clang, "-cc1", "--help") or
+open(PIPE, "-|", $Clang, "-cc1", "-help") or
DieDiag("Cannot execute '$Clang'\n");
-my $FoundAnalysis = 0;
-
while(<PIPE>) {
- if ($FoundAnalysis == 0) {
- if (/Checks and Analyses/) {
- $FoundAnalysis = 1;
- }
- next;
- }
- if (/^\s\s\s\s([^\s]+)\s(.+)$/) {
- next if ($1 =~ /-dump/ or $1 =~ /-view/
- or $1 =~ /-warn-uninit/);
- $AvailableAnalyses{$1} = $2;
+ if (/(-analyzer-check-[^\s]+)/) {
+ $AvailableAnalyses{$1} = 1;
next;
}
- last;
}
close (PIPE);
@@ -951,7 +940,7 @@ ENDTEXT
print " ";
}
- print " $Analysis $AvailableAnalyses{$Analysis}\n";
+ print " $Analysis\n";
}
print <<ENDTEXT