aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorTom Care <tom.care@uqconnect.edu.au>2010-09-10 00:44:44 +0000
committerTom Care <tom.care@uqconnect.edu.au>2010-09-10 00:44:44 +0000
commit52d861ce41ce84d8389495ea78d97bcc962ac5ba (patch)
treeb935271dea250ba726bac204b0e88d360a8671a7 /include/clang
parent36897b05ca2886e287f01802614bc10cbadcec22 (diff)
Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Checker/PathSensitive/GRExprEngine.h1
-rw-r--r--include/clang/Driver/CC1Options.td2
-rw-r--r--include/clang/Frontend/AnalyzerOptions.h3
3 files changed, 5 insertions, 1 deletions
diff --git a/include/clang/Checker/PathSensitive/GRExprEngine.h b/include/clang/Checker/PathSensitive/GRExprEngine.h
index 5ba0b36b31..b8ccc06b7d 100644
--- a/include/clang/Checker/PathSensitive/GRExprEngine.h
+++ b/include/clang/Checker/PathSensitive/GRExprEngine.h
@@ -264,6 +264,7 @@ public:
// Functions for external checking of whether we have unfinished work
bool wasBlockAborted() const { return CoreEngine.wasBlockAborted(); }
+ bool hasEmptyWorkList() const { return !CoreEngine.getWorkList()->hasWork(); }
bool hasWorkRemaining() const {
return wasBlockAborted() || CoreEngine.getWorkList()->hasWork();
}
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index 005f839bf5..99f748e6a7 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -64,6 +64,8 @@ def analysis_WarnSizeofPointer : Flag<"-warn-sizeof-pointer">,
HelpText<"Warn about unintended use of sizeof() on pointer expressions">;
def analysis_WarnIdempotentOps : Flag<"-analyzer-check-idempotent-operations">,
HelpText<"Warn about idempotent operations">;
+def analysis_AnalyzerStats : Flag<"-analyzer-stats">,
+ HelpText<"Emit warnings with analyzer statistics">;
def analyzer_store : Separate<"-analyzer-store">,
HelpText<"Source Code Analysis - Abstract Memory Store Models">;
diff --git a/include/clang/Frontend/AnalyzerOptions.h b/include/clang/Frontend/AnalyzerOptions.h
index 9ed15ba2f9..cd45945899 100644
--- a/include/clang/Frontend/AnalyzerOptions.h
+++ b/include/clang/Frontend/AnalyzerOptions.h
@@ -65,6 +65,7 @@ public:
unsigned AnalyzeAll : 1;
unsigned AnalyzerDisplayProgress : 1;
unsigned AnalyzeNestedBlocks : 1;
+ unsigned AnalyzerStats : 1;
unsigned EagerlyAssume : 1;
unsigned IdempotentOps : 1;
unsigned PurgeDead : 1;
@@ -73,7 +74,6 @@ public:
unsigned VisualizeEGUbi : 1;
unsigned EnableExperimentalChecks : 1;
unsigned EnableExperimentalInternalChecks : 1;
- unsigned EnableIdempotentOperationChecker : 1;
unsigned InlineCall : 1;
unsigned UnoptimizedCFG : 1;
@@ -85,6 +85,7 @@ public:
AnalyzeAll = 0;
AnalyzerDisplayProgress = 0;
AnalyzeNestedBlocks = 0;
+ AnalyzerStats = 0;
EagerlyAssume = 0;
PurgeDead = 1;
TrimGraph = 0;