r283573 - [analyzer] Re-apply r283092, attempt no.4, chunk no.3.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 10:12:06 PDT 2016


Author: dergachev
Date: Fri Oct  7 12:12:05 2016
New Revision: 283573

URL: http://llvm.org/viewvc/llvm-project?rev=283573&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, chunk no.3.

This is the primary suspect for causing the msvc crash, now that vector of
smart pointers was proven to be safe. Probably the default {}-initializer
is the problem.




Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h?rev=283573&r1=283572&r2=283573&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h Fri Oct  7 12:12:05 2016
@@ -248,7 +248,23 @@ public:
   void setDeclWithIssue(const Decl *declWithIssue) {
     DeclWithIssue = declWithIssue;
   }
-  
+
+  /// Add new item to the list of additional notes that need to be attached to
+  /// this path-insensitive report. If you want to add extra notes to a
+  /// path-sensitive report, you need to use a BugReporterVisitor because it
+  /// allows you to specify where exactly in the auto-generated path diagnostic
+  /// the extra note should appear.
+  void addNote(StringRef Msg, const PathDiagnosticLocation &Pos,
+                    ArrayRef<SourceRange> Ranges = {}) {
+    PathDiagnosticNotePiece *P =
+        new PathDiagnosticNotePiece(Pos, Msg);
+
+    for (const auto &R : Ranges)
+      P->addRange(R);
+
+    Notes.push_back(P);
+  }
+
   /// \brief This allows for addition of meta data to the diagnostic.
   ///
   /// Currently, only the HTMLDiagnosticClient knows how to display it. 




More information about the cfe-commits mailing list