diff options
| author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-09-09 20:34:40 +0000 | 
|---|---|---|
| committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-09-09 20:34:40 +0000 | 
| commit | 2f169e7cdd9973d2aa4cba6b0a09126a5e7268ec (patch) | |
| tree | 583758bdf33ed6ba3d9780cd37cb30ebf977ee5e /clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp | |
| parent | 48453bb8eda3d25b50ab098ebdc33a08724b2e2f (diff) | |
| download | bcm5719-llvm-2f169e7cdd9973d2aa4cba6b0a09126a5e7268ec.tar.gz bcm5719-llvm-2f169e7cdd9973d2aa4cba6b0a09126a5e7268ec.zip | |
[analyzer] NFC: Introduce sub-classes for path-sensitive and basic reports.
Checkers are now required to specify whether they're creating a
path-sensitive report or a path-insensitive report by constructing an
object of the respective type.
This makes BugReporter more independent from the rest of the Static Analyzer
because all Analyzer-specific code is now in sub-classes.
Differential Revision: https://reviews.llvm.org/D66572
llvm-svn: 371450
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp | 18 | 
1 files changed, 10 insertions, 8 deletions
| diff --git a/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp b/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp index d87e30782b7..bbf2ddec576 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp @@ -30,8 +30,8 @@ void MPIBugReporter::reportDoubleNonblocking(    ErrorText = "Double nonblocking on request " +                RequestRegion->getDescriptiveName() + ". "; -  auto Report = std::make_unique<BugReport>(*DoubleNonblockingBugType, -                                             ErrorText, ExplNode); +  auto Report = std::make_unique<PathSensitiveBugReport>( +      *DoubleNonblockingBugType, ErrorText, ExplNode);    Report->addRange(MPICallEvent.getSourceRange());    SourceRange Range = RequestRegion->sourceRange(); @@ -53,8 +53,8 @@ void MPIBugReporter::reportMissingWait(    std::string ErrorText{"Request " + RequestRegion->getDescriptiveName() +                          " has no matching wait. "}; -  auto Report = -      std::make_unique<BugReport>(*MissingWaitBugType, ErrorText, ExplNode); +  auto Report = std::make_unique<PathSensitiveBugReport>(*MissingWaitBugType, +                                                         ErrorText, ExplNode);    SourceRange Range = RequestRegion->sourceRange();    if (Range.isValid()) @@ -73,8 +73,8 @@ void MPIBugReporter::reportUnmatchedWait(    std::string ErrorText{"Request " + RequestRegion->getDescriptiveName() +                          " has no matching nonblocking call. "}; -  auto Report = -      std::make_unique<BugReport>(*UnmatchedWaitBugType, ErrorText, ExplNode); +  auto Report = std::make_unique<PathSensitiveBugReport>(*UnmatchedWaitBugType, +                                                         ErrorText, ExplNode);    Report->addRange(CE.getSourceRange());    SourceRange Range = RequestRegion->sourceRange(); @@ -84,8 +84,10 @@ void MPIBugReporter::reportUnmatchedWait(    BReporter.emitReport(std::move(Report));  } -PathDiagnosticPieceRef MPIBugReporter::RequestNodeVisitor::VisitNode( -    const ExplodedNode *N, BugReporterContext &BRC, BugReport &BR) { +PathDiagnosticPieceRef +MPIBugReporter::RequestNodeVisitor::VisitNode(const ExplodedNode *N, +                                              BugReporterContext &BRC, +                                              PathSensitiveBugReport &BR) {    if (IsNodeFound)      return nullptr; | 

