[llvm] Adjust LDBG output: surround DebugType between `[` and `]` (PR #150671)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 11:13:24 PDT 2025


https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/150671

This makes the output more readable by clearly showing the current debug type as a keyword.

>From a6c9cbc4ab188174c97a1c85ad6324ac814755a8 Mon Sep 17 00:00:00 2001
From: Mehdi Amini <joker.eph at gmail.com>
Date: Fri, 25 Jul 2025 11:10:04 -0700
Subject: [PATCH] Adjust LDBG output: surround DebugType between `[` and `]`

This makes the output more readable by clearly showing the current debug
type as a keyword.
---
 llvm/include/llvm/Support/DebugLog.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Support/DebugLog.h b/llvm/include/llvm/Support/DebugLog.h
index 9556bf2d6242d..964f033fb16cf 100644
--- a/llvm/include/llvm/Support/DebugLog.h
+++ b/llvm/include/llvm/Support/DebugLog.h
@@ -38,8 +38,8 @@ class LogWithNewline {
                  raw_ostream &os)
       : os(os) {
     if (debug_type)
-      os << debug_type << " ";
-    os << "[" << file << ":" << line << "] ";
+      os << "[" << debug_type << "]";
+    os << "@" << file << ":" << line << "| ";
   }
   ~LogWithNewline() { os << '\n'; }
   template <typename T> raw_ostream &operator<<(const T &t) && {



More information about the llvm-commits mailing list