[Lldb-commits] [lldb] [lldb] Implement llvm::formatv overload for Stream::operator << (PR #187462)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 19 02:35:30 PDT 2026


================
@@ -362,7 +372,7 @@ class Stream {
   size_t PrintfVarArg(const char *format, va_list args);
 
   template <typename... Args> void Format(const char *format, Args &&... args) {
-    PutCString(llvm::formatv(format, std::forward<Args>(args)...).str());
+    *this << llvm::formatv(format, std::forward<Args>(args)...);
----------------
felipepiovezan wrote:

I'm not sure how I feel about that, Streams are traditionally a `<<` based class. If I were to kill anything, it would be the `Format` method. E.g. if we swap from lldb's stream to llvm's stream, I wouldn't want  to update all call sites of `Format` to now use raw_ostream::operator <<

https://github.com/llvm/llvm-project/pull/187462


More information about the lldb-commits mailing list