summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-06-26 23:10:05 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-06-26 23:10:05 +0000
commit32919a58612669d472bc6d88a80aaf54c20016d1 (patch)
tree173f7dc7d4ab639ac9157ca9561a374c1290d9d8 /clang
parentb9c1a234d2c8a3f82d4d45b74bc1ea90bcb79195 (diff)
downloadbcm5719-llvm-32919a58612669d472bc6d88a80aaf54c20016d1.tar.gz
bcm5719-llvm-32919a58612669d472bc6d88a80aaf54c20016d1.zip
[analyzer] Minor cleanups for BugReporter, expose a getter for AnalyzerOptions.
llvm-svn: 335683
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h8
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h2
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp14
3 files changed, 9 insertions, 15 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
index 9f0a83d255b..111e1d1e8e2 100644
--- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -519,10 +519,6 @@ public:
~GRBugReporter() override;
- /// getEngine - Return the analysis engine used to analyze a given
- /// function or method.
- ExprEngine &getEngine() { return Eng; }
-
/// getGraph - Get the exploded graph created by the analysis engine
/// for the analyzed method or function.
ExplodedGraph &getGraph();
@@ -590,6 +586,10 @@ public:
return BR.getSourceManager();
}
+ AnalyzerOptions &getAnalyzerOptions() {
+ return BR.getAnalyzerOptions();
+ }
+
NodeMapClosure& getNodeResolver() { return NMC; }
};
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
index e469df0d15e..3c0ab4d7520 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
@@ -537,7 +537,7 @@ public:
void evalEagerlyAssumeBinOpBifurcation(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
const Expr *Ex);
- std::pair<const ProgramPointTag *, const ProgramPointTag *>
+ static std::pair<const ProgramPointTag *, const ProgramPointTag *>
geteagerlyAssumeBinOpBifurcationTags();
SVal evalMinus(SVal X) {
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index cd134123015..a4ac93d59b3 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -769,8 +769,7 @@ public:
// If we have counter-suppression enabled, make sure we keep visiting
// future nodes. We want to emit a path note as well, in case
// the report is resurrected as valid later on.
- ExprEngine &Eng = BRC.getBugReporter().getEngine();
- AnalyzerOptions &Options = Eng.getAnalysisManager().options;
+ AnalyzerOptions &Options = BRC.getAnalyzerOptions();
if (EnableNullFPSuppression && hasCounterSuppression(Options))
Mode = MaybeUnsuppress;
@@ -808,8 +807,7 @@ public:
visitNodeMaybeUnsuppress(const ExplodedNode *N, const ExplodedNode *PrevN,
BugReporterContext &BRC, BugReport &BR) {
#ifndef NDEBUG
- ExprEngine &Eng = BRC.getBugReporter().getEngine();
- AnalyzerOptions &Options = Eng.getAnalysisManager().options;
+ AnalyzerOptions &Options = BRC.getAnalyzerOptions();
assert(hasCounterSuppression(Options));
#endif
@@ -1756,11 +1754,8 @@ ConditionBRVisitor::VisitNodeImpl(const ExplodedNode *N,
}
if (Optional<PostStmt> PS = progPoint.getAs<PostStmt>()) {
- // FIXME: Assuming that BugReporter is a GRBugReporter is a layering
- // violation.
const std::pair<const ProgramPointTag *, const ProgramPointTag *> &tags =
- cast<GRBugReporter>(BRC.getBugReporter()).
- getEngine().geteagerlyAssumeBinOpBifurcationTags();
+ ExprEngine::geteagerlyAssumeBinOpBifurcationTags();
const ProgramPointTag *tag = PS->getTag();
if (tag == tags.first)
@@ -2152,8 +2147,7 @@ void LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor(
BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR) {
// Here we suppress false positives coming from system headers. This list is
// based on known issues.
- ExprEngine &Eng = BRC.getBugReporter().getEngine();
- AnalyzerOptions &Options = Eng.getAnalysisManager().options;
+ AnalyzerOptions &Options = BRC.getAnalyzerOptions();
const Decl *D = N->getLocationContext()->getDecl();
if (AnalysisDeclContext::isInStdNamespace(D)) {
OpenPOWER on IntegriCloud