[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
Sat Jul 26 02:38:46 PDT 2025
================
@@ -51,6 +59,16 @@ class LogWithNewline {
LogWithNewline(const LogWithNewline &) = delete;
LogWithNewline &operator=(const LogWithNewline &) = delete;
LogWithNewline &operator=(LogWithNewline &&) = delete;
+ static constexpr const char *getFileName(const char *path) {
+ // Remove the path prefix from the file name.
+ const char *filename = path;
+ for (const char *p = path; *p != '\0'; ++p) {
----------------
jpienaar wrote:
That's a good idea, yes.
https://github.com/llvm/llvm-project/pull/150677
More information about the llvm-commits
mailing list