[llvm] Strip the full path from __FILE__ in the LDBG macro and keep only the filename (PR #150677)

Jacques Pienaar via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 11:43:36 PDT 2025


================
@@ -29,7 +29,15 @@ namespace llvm {
 #define DEBUGLOG_WITH_STREAM_AND_TYPE(STREAM, TYPE)                            \
   for (bool _c = (::llvm::DebugFlag && ::llvm::isCurrentDebugType(TYPE)); _c;  \
        _c = false)                                                             \
-  ::llvm::impl::LogWithNewline(TYPE, __FILE__, __LINE__, (STREAM))
+  ::llvm::impl::LogWithNewline(                                                \
+      TYPE,                                                                    \
+      [] {                                                                     \
----------------
jpienaar wrote:

Could we do this instead in the constructor for LogWithNewline ?

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


More information about the llvm-commits mailing list