[Lldb-commits] [lldb] [lldb] Harden PolicyStack: thread-binding, factory consistency, ODR-safe formatting (PR #195774)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 9 09:48:40 PDT 2026
================
@@ -10,8 +10,30 @@
#define LLDB_UTILITY_POLICY_H
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/raw_ostream.h"
#include <cassert>
+#include <sstream>
+#include <thread>
+
+namespace llvm {
+/// Allow std::thread::id to be passed directly to formatv-based logging
+/// macros (LLDB_LOG, etc.). std::thread::id has no raw_ostream operator<<,
+/// so we route through std::stringstream which it does support.
+///
+/// Defined in this header (rather than a .cpp) so that any TU that wants
+/// to log a std::thread::id sees the same specialization, avoiding ODR
+/// hazards.
----------------
JDevlieghere wrote:
The format providers are well established, these comments add zero value.
```suggestion
```
https://github.com/llvm/llvm-project/pull/195774
More information about the lldb-commits
mailing list