[Lldb-commits] [lldb] r300733 - Add CopyDiagnostic to the DiagnosticManager.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 19 11:56:45 PDT 2017


Author: jingham
Date: Wed Apr 19 13:56:44 2017
New Revision: 300733

URL: http://llvm.org/viewvc/llvm-project?rev=300733&view=rev
Log:
Add CopyDiagnostic to the DiagnosticManager.

>From Gregor Milos (gmilos at apple.com), for:

https://reviews.llvm.org/D32078

Modified:
    lldb/trunk/include/lldb/Expression/DiagnosticManager.h
    lldb/trunk/source/Expression/DiagnosticManager.cpp

Modified: lldb/trunk/include/lldb/Expression/DiagnosticManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DiagnosticManager.h?rev=300733&r1=300732&r2=300733&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/DiagnosticManager.h (original)
+++ lldb/trunk/include/lldb/Expression/DiagnosticManager.h Wed Apr 19 13:56:44 2017
@@ -128,6 +128,8 @@ public:
     m_diagnostics.push_back(diagnostic);
   }
 
+  void CopyDiagnostics(DiagnosticManager &otherDiagnostics);
+
   size_t Printf(DiagnosticSeverity severity, const char *format, ...)
       __attribute__((format(printf, 3, 4)));
   size_t PutString(DiagnosticSeverity severity, llvm::StringRef str);

Modified: lldb/trunk/source/Expression/DiagnosticManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DiagnosticManager.cpp?rev=300733&r1=300732&r2=300733&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DiagnosticManager.cpp (original)
+++ lldb/trunk/source/Expression/DiagnosticManager.cpp Wed Apr 19 13:56:44 2017
@@ -79,3 +79,12 @@ size_t DiagnosticManager::PutString(Diag
   AddDiagnostic(str, severity, eDiagnosticOriginLLDB);
   return str.size();
 }
+
+void DiagnosticManager::CopyDiagnostics(DiagnosticManager &otherDiagnostics) {
+  for (const DiagnosticList::value_type &other_diagnostic:
+       otherDiagnostics.Diagnostics()) {
+    AddDiagnostic(
+        other_diagnostic->GetMessage(), other_diagnostic->GetSeverity(),
+        other_diagnostic->getKind(), other_diagnostic->GetCompilerID());
+  }
+}




More information about the lldb-commits mailing list