From ee92f12fd18e42dd417174bcbb6429da60f47afa Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Tue, 20 Aug 2019 02:15:50 +0000 Subject: [PATCH] [analyzer] NFC: Rename GRBugReporter to PathSensitiveBugReporter. The GR prefix is super ancient. llvm-svn: 369320 --- .../StaticAnalyzer/Core/BugReporter/BugReporter.h | 21 +++++++++++---------- .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 6 +++--- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 21 +++++++++++++-------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 046847b..3e9749c 100644 --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -405,7 +405,7 @@ public: /// The base class is used for generating path-insensitive class BugReporter { public: - enum Kind { BaseBRKind, GRBugReporterKind }; + enum Kind { BasicBRKind, PathSensitiveBRKind }; private: using BugTypesTy = llvm::ImmutableSet; @@ -437,7 +437,7 @@ protected: public: BugReporter(BugReporterData& d) - : BugTypes(F.getEmptySet()), kind(BaseBRKind), D(d) {} + : BugTypes(F.getEmptySet()), kind(BasicBRKind), D(d) {} virtual ~BugReporter(); /// Generate and flush diagnostics for all bug reports. @@ -504,14 +504,14 @@ private: }; /// GRBugReporter is used for generating path-sensitive reports. -class GRBugReporter : public BugReporter { +class PathSensitiveBugReporter : public BugReporter { ExprEngine& Eng; public: - GRBugReporter(BugReporterData& d, ExprEngine& eng) - : BugReporter(d, GRBugReporterKind), Eng(eng) {} + PathSensitiveBugReporter(BugReporterData& d, ExprEngine& eng) + : BugReporter(d, PathSensitiveBRKind), Eng(eng) {} - ~GRBugReporter() override = default; + ~PathSensitiveBugReporter() override = default; /// getGraph - Get the exploded graph created by the analysis engine /// for the analyzed method or function. @@ -534,7 +534,7 @@ public: /// classof - Used by isa<>, cast<>, and dyn_cast<>. static bool classof(const BugReporter* R) { - return R->getKind() == GRBugReporterKind; + return R->getKind() == PathSensitiveBRKind; } }; @@ -551,18 +551,19 @@ public: }; class BugReporterContext { - GRBugReporter &BR; + PathSensitiveBugReporter &BR; NodeMapClosure NMC; virtual void anchor(); public: - BugReporterContext(GRBugReporter &br, InterExplodedGraphMap &Backmap) + BugReporterContext(PathSensitiveBugReporter &br, + InterExplodedGraphMap &Backmap) : BR(br), NMC(Backmap) {} virtual ~BugReporterContext() = default; - GRBugReporter& getBugReporter() { return BR; } + PathSensitiveBugReporter& getBugReporter() { return BR; } const ExplodedGraph &getGraph() const { return BR.getGraph(); } diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h index 2629d71..eb20b7d 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h @@ -145,9 +145,9 @@ private: ObjCNoReturn ObjCNoRet; /// The BugReporter associated with this engine. It is important that - /// this object be placed at the very end of member variables so that its - /// destructor is called before the rest of the ExprEngine is destroyed. - GRBugReporter BR; + /// this object be placed at the very end of member variables so that its + /// destructor is called before the rest of the ExprEngine is destroyed. + PathSensitiveBugReporter BR; /// The functions which have been analyzed through inlining. This is owned by /// AnalysisConsumer. It can be null. diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 847174a..a2d7420 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -215,7 +215,8 @@ public: /// a PathDiagnosticBuilder able to construct bug reports for different /// consumers. Returns None if no valid report is found. static Optional - findValidReport(ArrayRef &bugReports, GRBugReporter &Reporter); + findValidReport(ArrayRef &bugReports, + PathSensitiveBugReporter &Reporter); PathDiagnosticBuilder( BugReporterContext BRC, std::unique_ptr BugPath, @@ -2213,13 +2214,17 @@ PathDiagnosticLocation BugReport::getLocation(const SourceManager &SM) const { // Methods for BugReporter and subclasses. //===----------------------------------------------------------------------===// -const ExplodedGraph &GRBugReporter::getGraph() const { return Eng.getGraph(); } +const ExplodedGraph &PathSensitiveBugReporter::getGraph() const { + return Eng.getGraph(); +} -ProgramStateManager& -GRBugReporter::getStateManager() { return Eng.getStateManager(); } +ProgramStateManager &PathSensitiveBugReporter::getStateManager() { + return Eng.getStateManager(); +} -ProgramStateManager& -GRBugReporter::getStateManager() const { return Eng.getStateManager(); } +ProgramStateManager &PathSensitiveBugReporter::getStateManager() const { + return Eng.getStateManager(); +} BugReporter::~BugReporter() { FlushReports(); @@ -2592,7 +2597,7 @@ generateVisitorsDiagnostics(BugReport *R, const ExplodedNode *ErrorNode, Optional PathDiagnosticBuilder::findValidReport(ArrayRef &bugReports, - GRBugReporter &Reporter) { + PathSensitiveBugReporter &Reporter) { BugPathGetter BugGraph(&Reporter.getGraph(), bugReports); @@ -2642,7 +2647,7 @@ PathDiagnosticBuilder::findValidReport(ArrayRef &bugReports, } std::unique_ptr -GRBugReporter::generatePathDiagnostics( +PathSensitiveBugReporter::generatePathDiagnostics( ArrayRef consumers, ArrayRef &bugReports) { assert(!bugReports.empty()); -- 2.7.4