[llvm] Remove __SHORT_FILE__ macro definition in CMake (PR #152344)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 08:40:02 PDT 2025
================
@@ -56,6 +56,16 @@ namespace llvm {
DEBUGLOG_WITH_STREAM_AND_TYPE(llvm::dbgs(), LEVEL, DEBUG_TYPE)
#define LDBG_LOG_LEVEL_1() LDBG_LOG_LEVEL(1)
+// We want the filename without the full path. We are using the __FILE__ macro
+// and a constexpr function to strip the path prefix. We can avoid the frontend
+// repeated evaluation of __FILE__ by using the __FILE_NAME__ when defined
+// (gcc and clang do) which contains the file name already.
+#if defined(__FILE_NAME__)
----------------
joker-eph wrote:
I think what I have now is the most portable, look here:
https://godbolt.org/z/WrMhsTMq8
https://github.com/llvm/llvm-project/pull/152344
More information about the llvm-commits
mailing list