[lldb] Remove undocumented return value from DiagnosticManager::PutString
authorRaphael Isemann <teemperor@gmail.com>
Mon, 12 Aug 2019 14:11:37 +0000 (14:11 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 12 Aug 2019 14:11:37 +0000 (14:11 +0000)
The returned value is currently unused. It also seems to imply that
it somehow represents 'printf-style' the number of characters/bytes
written to some output stream (which is incorrect, as we only know
the actual size of the written message when we have rendered it,
e.g. via GetString and DiagnosticManagers have no associated
output stream).

llvm-svn: 368577

lldb/include/lldb/Expression/DiagnosticManager.h
lldb/source/Expression/DiagnosticManager.cpp

index 472ae0e..39cca98 100644 (file)
@@ -127,7 +127,7 @@ public:
 
   size_t Printf(DiagnosticSeverity severity, const char *format, ...)
       __attribute__((format(printf, 3, 4)));
-  size_t PutString(DiagnosticSeverity severity, llvm::StringRef str);
+  void PutString(DiagnosticSeverity severity, llvm::StringRef str);
 
   void AppendMessageToDiagnostic(llvm::StringRef str) {
     if (!m_diagnostics.empty()) {
index b258ede..5333e3e 100644 (file)
@@ -70,10 +70,9 @@ size_t DiagnosticManager::Printf(DiagnosticSeverity severity,
   return result;
 }
 
-size_t DiagnosticManager::PutString(DiagnosticSeverity severity,
-                                    llvm::StringRef str) {
+void DiagnosticManager::PutString(DiagnosticSeverity severity,
+                                  llvm::StringRef str) {
   if (str.empty())
-    return 0;
+    return;
   AddDiagnostic(str, severity, eDiagnosticOriginLLDB);
-  return str.size();
 }