]> granicus.if.org Git - clang/commitdiff
[analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to HandlePathD...
authorTed Kremenek <kremenek@apple.com>
Sat, 27 Aug 2011 21:39:14 +0000 (21:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 27 Aug 2011 21:39:14 +0000 (21:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138713 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp

index bfac65bec1e261e243a34be4d94e50f17ed449bd..1afa546874b35c227fffbe5d800fd68eea608d5d 100644 (file)
@@ -52,13 +52,19 @@ public:
   
   virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
                                 const DiagnosticInfo &Info);
-  virtual void HandlePathDiagnostic(const PathDiagnostic* D) = 0;
+  void HandlePathDiagnostic(const PathDiagnostic* D);
 
   enum PathGenerationScheme { Minimal, Extensive };
   virtual PathGenerationScheme getGenerationScheme() const { return Minimal; }
   virtual bool supportsLogicalOpControlFlow() const { return false; }
   virtual bool supportsAllBlockEdges() const { return false; }
   virtual bool useVerboseDescription() const { return true; }
+
+protected:
+  /// The actual logic for handling path diagnostics, as implemented
+  /// by subclasses of PathDiagnosticClient.
+  virtual void HandlePathDiagnosticImpl(const PathDiagnostic* D) = 0;
+
 };
 
 //===----------------------------------------------------------------------===//
index 68a6618878d79a2e9c64608d42208da26384613d..2b377d0078ee31df5f57bab3c9d914174c8dcd1e 100644 (file)
@@ -47,7 +47,7 @@ public:
 
   virtual void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade);
 
-  virtual void HandlePathDiagnostic(const PathDiagnostic* D);
+  virtual void HandlePathDiagnosticImpl(const PathDiagnostic* D);
 
   virtual StringRef getName() const {
     return "HTMLDiagnostics";
@@ -88,7 +88,7 @@ ento::createHTMLDiagnosticClient(const std::string& prefix,
 // Report processing.
 //===----------------------------------------------------------------------===//
 
-void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) {
+void HTMLDiagnostics::HandlePathDiagnosticImpl(const PathDiagnostic* D) {
   if (!D)
     return;
 
index 7f95c950dd9e519d49116dc539e8ba22bac693f3..e56f1572e9233a092943b72a0ef017ddd992dcff 100644 (file)
@@ -117,6 +117,13 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic::Level DiagLevel,
   HandlePathDiagnostic(D);
 }
 
+void PathDiagnosticClient::HandlePathDiagnostic(const PathDiagnostic *D) {
+  // For now this simply forwards to HandlePathDiagnosticImpl.  In the future
+  // we can use this indirection to control for multi-threaded access to
+  // the PathDiagnosticClient from multiple bug reporters.
+  HandlePathDiagnosticImpl(D);
+}
+
 //===----------------------------------------------------------------------===//
 // PathDiagnosticLocation methods.
 //===----------------------------------------------------------------------===//
index cae5bc9a34cbfaa17fc51dbbcf96048c0b7fa895..3133be7860a8dd506c72adbea66a46f2a44a40f4 100644 (file)
@@ -74,7 +74,7 @@ namespace {
 
     void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade);
     
-    void HandlePathDiagnostic(const PathDiagnostic* D);
+    void HandlePathDiagnosticImpl(const PathDiagnostic* D);
     
     virtual StringRef getName() const {
       return "PlistDiagnostics";
@@ -321,7 +321,7 @@ static void ReportDiag(raw_ostream &o, const PathDiagnosticPiece& P,
   }
 }
 
-void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) {
+void PlistDiagnostics::HandlePathDiagnosticImpl(const PathDiagnostic* D) {
   if (!D)
     return;
 
index c4665ef0975eaec1c7f3daac062cc5d99eb693c7..e91b48d9fe3fb748479b7bc3bd65861c7d1b8551 100644 (file)
@@ -31,7 +31,7 @@ public:
   TextPathDiagnostics(const std::string& output, Diagnostic &diag)
     : OutputFile(output), Diag(diag) {}
 
-  void HandlePathDiagnostic(const PathDiagnostic* D);
+  void HandlePathDiagnosticImpl(const PathDiagnostic* D);
 
   void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade) { }
   
@@ -53,7 +53,7 @@ ento::createTextPathDiagnosticClient(const std::string& out,
   return new TextPathDiagnostics(out, PP.getDiagnostics());
 }
 
-void TextPathDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) {
+void TextPathDiagnostics::HandlePathDiagnosticImpl(const PathDiagnostic* D) {
   if (!D)
     return;