/// 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<BugType *>;
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.
};
/// 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.
/// classof - Used by isa<>, cast<>, and dyn_cast<>.
static bool classof(const BugReporter* R) {
- return R->getKind() == GRBugReporterKind;
+ return R->getKind() == PathSensitiveBRKind;
}
};
};
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(); }
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.
/// a PathDiagnosticBuilder able to construct bug reports for different
/// consumers. Returns None if no valid report is found.
static Optional<PathDiagnosticBuilder>
- findValidReport(ArrayRef<BugReport *> &bugReports, GRBugReporter &Reporter);
+ findValidReport(ArrayRef<BugReport *> &bugReports,
+ PathSensitiveBugReporter &Reporter);
PathDiagnosticBuilder(
BugReporterContext BRC, std::unique_ptr<ExplodedGraph> BugPath,
// 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();
Optional<PathDiagnosticBuilder>
PathDiagnosticBuilder::findValidReport(ArrayRef<BugReport *> &bugReports,
- GRBugReporter &Reporter) {
+ PathSensitiveBugReporter &Reporter) {
BugPathGetter BugGraph(&Reporter.getGraph(), bugReports);
}
std::unique_ptr<DiagnosticForConsumerMapTy>
-GRBugReporter::generatePathDiagnostics(
+PathSensitiveBugReporter::generatePathDiagnostics(
ArrayRef<PathDiagnosticConsumer *> consumers,
ArrayRef<BugReport *> &bugReports) {
assert(!bugReports.empty());