Skip to content

Strip the full path from __FILE__ in the LDBG macro and keep only the filename #150677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2025

Conversation

joker-eph
Copy link
Collaborator

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2025

@llvm/pr-subscribers-llvm-support

Author: Mehdi Amini (joker-eph)

Changes

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

1 Files Affected:

  • (modified) llvm/include/llvm/Support/DebugLog.h (+19-1)
diff --git a/llvm/include/llvm/Support/DebugLog.h b/llvm/include/llvm/Support/DebugLog.h
index 9556bf2d6242d..a93aa54a54bde 100644
--- a/llvm/include/llvm/Support/DebugLog.h
+++ b/llvm/include/llvm/Support/DebugLog.h
@@ -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,                                                                    \
+      [] {                                                                     \
+        /* Force constexpr eval */                                             \
+        constexpr const char *filename =                                       \
+            ::llvm::impl::LogWithNewline::getFileName(__FILE__);               \
+        return filename;                                                       \
+      }(),                                                                     \
+      __LINE__, (STREAM))
 
 namespace impl {
 class LogWithNewline {
@@ -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) {
+      if (*p == '/' || *p == '\\') {
+        filename = p + 1;
+      }
+    }
+    return filename;
+  }
 
 private:
   raw_ostream &os;

::llvm::impl::LogWithNewline(TYPE, __FILE__, __LINE__, (STREAM))
::llvm::impl::LogWithNewline( \
TYPE, \
[] { \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do this instead in the constructor for LogWithNewline ?

Copy link
Collaborator Author

@joker-eph joker-eph Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can be constexpr evaluated in this case?
(this is why I put it in the macro in the first place)

include/llvm/Support/DebugLog.h:48:27: error: constexpr variable 'filename' must be initialized by a constant expression
   48 |     constexpr const char *filename  =
      |                           ^
   49 |       ::llvm::impl::LogWithNewline::getFileName(file);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/llvm/Support/DebugLog.h:49:49: note: function parameter 'file' with unknown value cannot be used in a constant expression
   49 |       ::llvm::impl::LogWithNewline::getFileName(file);
      |                                                 ^
include/llvm/Support/DebugLog.h:45:64: note: declared here
   45 |   constexpr LogWithNewline(const char *debug_type, const char *file, int line,
      |                                                                ^
1 error generated.

I think this may matter in debug builds.

@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Jul 25, 2025
@joker-eph joker-eph merged commit 5d26e3c into llvm:main Jul 26, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 26, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-b-1 while building llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/20430

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[516/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conj.dir/conj.cpp.obj
[517/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjf.dir/conjf.cpp.obj
[518/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjl.dir/conjl.cpp.obj
[519/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.dir/strtoimax.cpp.obj
[520/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_trailing_ones_ul.dir/stdc_trailing_ones_ul.cpp.obj
[521/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ui.dir/stdc_count_ones_ui.cpp.obj
[522/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ull.dir/stdc_count_ones_ull.cpp.obj
[523/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_us.dir/stdc_has_single_bit_us.cpp.obj
[524/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ui.dir/stdc_has_single_bit_ui.cpp.obj
[525/2522] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/./bin/clang++ --target=armv7m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/include/armv7m-unknown-none-eabi --target=armv7m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" "-Dfputs(string, stream)=puts(string)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/runtimes/runtimes-armv7m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -MF libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/scanf_main.h:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/converter.h:15:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/core_structs.h:16:
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/./lib/clang/22/include/inttypes.h:24:15: fatal error: 'inttypes.h' file not found
   24 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
[526/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_us.dir/stdc_count_ones_us.cpp.obj
[527/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ul.dir/stdc_count_ones_ul.cpp.obj
[528/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ul.dir/stdc_has_single_bit_ul.cpp.obj
[529/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ull.dir/stdc_has_single_bit_ull.cpp.obj
[530/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_uc.dir/stdc_has_single_bit_uc.cpp.obj
[531/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.dir/cprojl.cpp.obj
[532/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.dir/cproj.cpp.obj
[533/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojf.dir/cprojf.cpp.obj
[534/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[535/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_uc.dir/stdc_bit_width_uc.cpp.obj
[536/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist.dir/freelist.cpp.obj
[537/2522] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/error_to_string.cpp.obj
[538/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ui.dir/stdc_bit_ceil_ui.cpp.obj
[539/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[540/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ul.dir/stdc_bit_floor_ul.cpp.obj
[541/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ui.dir/stdc_bit_width_ui.cpp.obj
[542/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ull.dir/stdc_bit_width_ull.cpp.obj
[543/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_us.dir/stdc_bit_width_us.cpp.obj
[544/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_uc.dir/stdc_bit_floor_uc.cpp.obj
[545/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.obj
[546/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicall.dir/iscanonicall.cpp.obj
[547/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ul.dir/stdc_bit_width_ul.cpp.obj
[548/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ui.dir/stdc_bit_floor_ui.cpp.obj
[549/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_us.dir/stdc_bit_ceil_us.cpp.obj
[550/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ull.dir/stdc_bit_floor_ull.cpp.obj
[551/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freetrie.dir/freetrie.cpp.obj
[552/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ui.dir/stdc_first_leading_zero_ui.cpp.obj
[553/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist_heap.dir/freelist_heap.cpp.obj
[554/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_us.dir/stdc_bit_floor_us.cpp.obj
Step 6 (build) failure: build (failure)
...
[516/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conj.dir/conj.cpp.obj
[517/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjf.dir/conjf.cpp.obj
[518/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjl.dir/conjl.cpp.obj
[519/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.dir/strtoimax.cpp.obj
[520/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_trailing_ones_ul.dir/stdc_trailing_ones_ul.cpp.obj
[521/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ui.dir/stdc_count_ones_ui.cpp.obj
[522/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ull.dir/stdc_count_ones_ull.cpp.obj
[523/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_us.dir/stdc_has_single_bit_us.cpp.obj
[524/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ui.dir/stdc_has_single_bit_ui.cpp.obj
[525/2522] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/./bin/clang++ --target=armv7m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/include/armv7m-unknown-none-eabi --target=armv7m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" "-Dfputs(string, stream)=puts(string)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/runtimes/runtimes-armv7m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -MF libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/scanf_main.h:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/converter.h:15:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/core_structs.h:16:
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-uc25jtbt/./lib/clang/22/include/inttypes.h:24:15: fatal error: 'inttypes.h' file not found
   24 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
[526/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_us.dir/stdc_count_ones_us.cpp.obj
[527/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_count_ones_ul.dir/stdc_count_ones_ul.cpp.obj
[528/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ul.dir/stdc_has_single_bit_ul.cpp.obj
[529/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ull.dir/stdc_has_single_bit_ull.cpp.obj
[530/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_uc.dir/stdc_has_single_bit_uc.cpp.obj
[531/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.dir/cprojl.cpp.obj
[532/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.dir/cproj.cpp.obj
[533/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojf.dir/cprojf.cpp.obj
[534/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[535/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_uc.dir/stdc_bit_width_uc.cpp.obj
[536/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist.dir/freelist.cpp.obj
[537/2522] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/error_to_string.cpp.obj
[538/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ui.dir/stdc_bit_ceil_ui.cpp.obj
[539/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[540/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ul.dir/stdc_bit_floor_ul.cpp.obj
[541/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ui.dir/stdc_bit_width_ui.cpp.obj
[542/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ull.dir/stdc_bit_width_ull.cpp.obj
[543/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_us.dir/stdc_bit_width_us.cpp.obj
[544/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_uc.dir/stdc_bit_floor_uc.cpp.obj
[545/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.obj
[546/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicall.dir/iscanonicall.cpp.obj
[547/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ul.dir/stdc_bit_width_ul.cpp.obj
[548/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ui.dir/stdc_bit_floor_ui.cpp.obj
[549/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_us.dir/stdc_bit_ceil_us.cpp.obj
[550/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ull.dir/stdc_bit_floor_ull.cpp.obj
[551/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freetrie.dir/freetrie.cpp.obj
[552/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ui.dir/stdc_first_leading_zero_ui.cpp.obj
[553/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist_heap.dir/freelist_heap.cpp.obj
[554/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_us.dir/stdc_bit_floor_us.cpp.obj

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 26, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/13673

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Parse/Parser.h:20,
                 from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Analysis/MacroExpansionContextTest.cpp:23:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:848:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::UnusedFileScopedDecls’ [-Wattributes]
  848 | class Sema final : public SemaBase {
      |       ^~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:848:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::TentativeDefinitions’ [-Wattributes]
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:848:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::ExtVectorDecls’ [-Wattributes]
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:848:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::DelegatingCtorDecls’ [-Wattributes]
[188/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/AnalyzerOptionsTest.cpp.o
[189/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp.o
FAILED: tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp.o 
/usr/bin/c++ -DEXPERIMENTAL_KEY_INSTRUCTIONS -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__SHORT_FILE__=\"MultiVarConstantPropagationTest.cpp\" -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Tooling -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp.o -MF tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp.o.d -o tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[190/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/APSIntTypeTest.cpp.o
[191/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/CFGMatchSwitchTest.cpp.o
[192/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MapLatticeTest.cpp.o
[193/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/CFGTest.cpp.o
[194/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/DebugSupportTest.cpp.o
[195/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/DeterminismTest.cpp.o
[196/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/RecordOpsTest.cpp.o
[197/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/BlockEntranceCallbackTest.cpp.o
[198/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp.o
[199/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/MatchSwitchTest.cpp.o
[200/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/LifetimeSafetyTest.cpp.o
[201/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/SimplifyConstraintsTest.cpp.o
[202/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/LoggerTest.cpp.o
[203/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TestingSupport.cpp.o
[204/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp.o
[205/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/CFGDominatorTree.cpp.o
[206/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/CallEventTest.cpp.o
[207/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/SmartPointerAccessorCachingTest.cpp.o
[208/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TestingSupportTest.cpp.o
[209/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp.o
[210/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp.o
[211/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/ConflictingEvalCallsTest.cpp.o
[212/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferBranchTest.cpp.o
[213/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/ASTOpsTest.cpp.o
[214/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/WatchedLiteralsSolverTest.cpp.o
[215/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/IntervalPartitionTest.cpp.o
[216/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/SignAnalysisTest.cpp.o
[217/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/BugReportInterestingnessTest.cpp.o
[218/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/ExprMutationAnalyzerTest.cpp.o
[219/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/CallDescriptionTest.cpp.o
[220/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp.o
[221/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp.o
[222/1163] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o
ninja: build stopped: subcommand failed.

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
@RKSimon
Copy link
Collaborator

RKSimon commented Jul 29, 2025

@joker-eph After this cmake change msvc bullds have crawled to a halt - typically building on only a couple of cores at a time and with no build distribution at all :(

@joker-eph
Copy link
Collaborator Author

@RKSimon ouch! I don't have a windows machine, I assume this is need to debug this?
What kind of build is this? DEBUG? RELEASE? RELEASE+ASSERT? Did you try with a clean build?

I looked at some windows bots but they don't seem to be affected (e.g. My change on this bot: https://lab.llvm.org/buildbot/#/builders/63/builds/8184 ), but it's always to tell with incremental builds.

This change has two components:

  1. The CMake change which adds an extra compilation flag (macro definition) to each compiler invocation: this will invalidate the cache of your builders. So it is expected that there is a one-off costly build if you rely on caching.
  2. The code change: but this is a new header (1 week old) that is only used in MLIR so far, so this shouldn't affect anything).

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 29, 2025

Its msbuild builds that seem to be affected, not ninja+msvc which is what I think all the buildbots use. I've deleted and rebuilt the build directories and they are still affected (and I ended up bisecting to find this so was regenerating a lot in the process), seen on both Debug and RelWithDebInfo builds so far.

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 29, 2025

As a temp hack can we just disable the __SHORT_FILE__ defs on MSVC builds?

@joker-eph
Copy link
Collaborator Author

Its msbuild builds that seem to be affected, not ninja+msvc

Oh see my ignorance, I don't even know what is "msbuild" 🫣

As a temp hack can we just disable the SHORT_FILE defs on MSVC builds?

Sure, can you send a PR that works for you?

RKSimon added a commit to RKSimon/llvm-project that referenced this pull request Jul 29, 2025
As reported on llvm#150677 - this prevents build parallelisation as cmake is repeatedly updating the cache
@nathanchance
Copy link
Member

For what it's worth, I bisected my CLANG_VENDOR value appearing to disappear from the version string to this change.

$ cmake \
      -B build \
      -G Ninja \
      -S llvm \
      -Wno-dev \
      -DCLANG_ENABLE_STATIC_ANALYZER=OFF \
      -DCLANG_PLUGIN_SUPPORT=OFF \
      -DCLANG_VENDOR=ClangBuiltLinux \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CXX_COMPILER=clang++ \
      -DCMAKE_C_COMPILER=clang \
      -DLLVM_ENABLE_ASSERTIONS=ON \
      -DLLVM_ENABLE_BINDINGS=OFF \
      -DLLVM_ENABLE_LIBXML2=OFF \
      -DLLVM_ENABLE_OCAMLDOC=OFF \
      -DLLVM_ENABLE_PROJECTS=clang \
      -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR= \
      -DLLVM_INCLUDE_DOCS=OFF \
      -DLLVM_INCLUDE_EXAMPLES=OFF \
      -DLLVM_LINK_LLVM_DYLIB=OFF \
      -DLLVM_TARGETS_TO_BUILD=X86 \
      -DLLVM_USE_LINKER=lld
...

$ ninja -C build clang
ninja: Entering directory `build'
[2920/2920] Creating executable symlink bin/clang

$ build/bin/clang --version | head -1
clang version 22.0.0git (https://github.com/llvm/llvm-project.git 5d26e3c227f4b4a1761a8b0001b3165198def479)

At the parent change, there is no issue.

$ ninja -C build clang
ninja: Entering directory `build'
[2916/2916] Creating executable symlink bin/clang

$ build/bin/clang --version | head -1
ClangBuiltLinux clang version 22.0.0git (https://github.com/llvm/llvm-project.git 5ec6ac882c9fffaae6cf194f738e86f796394cd3)

@joker-eph
Copy link
Collaborator Author

Thanks for the report! It should be fixed with: #151251

RKSimon added a commit to RKSimon/llvm-project that referenced this pull request Jul 30, 2025
As reported on llvm#150677 - this prevents build parallelisation as cmake is repeatedly updating the cache
RKSimon added a commit that referenced this pull request Jul 30, 2025
…udio builds (#151167)

As reported on #150677 - this is preventing msbuild parallelization as cmake is repeatedly being updated
@cachemeifyoucan
Copy link
Collaborator

@joker-eph I think this completely breaks clang module build since a different macro for each source file means the modules are never shared anymore. This causes https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ running out of space (and really really slow).

Also, why we don't use __FILE_NAME__ instead? That is a clang extension but we could check and use that before passing the SHORT_FILE macro.

jroelofs added a commit to swiftlang/llvm-project that referenced this pull request Aug 6, 2025
…only the filename (llvm#150677)"

This reverts commit 5d26e3c.

It breaks the modules build of clang, since every source file has a different
version of this macro, which causes
https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ to run out of space. We
should probably be using __FILE_NAME__ instead when the host compiler supports
it, but until then let's revert-to-green, and un-block some of the bots.

see: llvm#150677
see: llvm#150677 (comment)
jroelofs added a commit to swiftlang/llvm-project that referenced this pull request Aug 6, 2025
…only the filename (llvm#150677)"

This reverts commit 5d26e3c.

It breaks the modules build of clang, since every source file has a different
version of this macro, which causes
https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ to run out of space. We
should probably be using __FILE_NAME__ instead when the host compiler supports
it, but until then let's revert-to-green, and un-block some of the bots.

see: llvm#150677
see: llvm#150677 (comment)

rdar://157465825
jroelofs added a commit to swiftlang/llvm-project that referenced this pull request Aug 6, 2025
…only the filename (llvm#150677)"

This reverts commit 5d26e3c.

It breaks the modules build of clang, since every source file has a different
version of this macro, which causes
https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ to run out of space. We
should probably be using __FILE_NAME__ instead when the host compiler supports
it, but until then let's revert-to-green, and un-block some of the bots.

see: llvm#150677
see: llvm#150677 (comment)

rdar://157465825
jroelofs added a commit that referenced this pull request Aug 6, 2025
…only the filename (#150677)"

This reverts commit 5d26e3c.

It breaks the modules build of clang, since every source file has a different
version of this macro, which causes
https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ to run out of space. We
should probably be using __FILE_NAME__ instead when the host compiler supports
it, but until then let's revert-to-green, and un-block the bots.

see: #150677
see: #150677 (comment)

rdar://157465825
@jroelofs
Copy link
Contributor

jroelofs commented Aug 6, 2025

I reverted this in a15b629 to get https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ back to green (disabled currently, as it was trashing disk space on all the nodes in the label).

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Aug 6, 2025
…o and keep only the filename (#150677)"

This reverts commit 5d26e3c.

It breaks the modules build of clang, since every source file has a different
version of this macro, which causes
https://green.lab.llvm.org/job/clang-stage2-Rthinlto/ to run out of space. We
should probably be using __FILE_NAME__ instead when the host compiler supports
it, but until then let's revert-to-green, and un-block the bots.

see: llvm/llvm-project#150677
see: llvm/llvm-project#150677 (comment)

rdar://157465825
jroelofs added a commit that referenced this pull request Aug 6, 2025
…nd keep only the filename (#150677)""

This reverts commit a15b629.

The revert made things worse. Oops.
@joker-eph
Copy link
Collaborator Author

joker-eph commented Aug 6, 2025

I think this completely breaks clang module build since a different macro for each source file means the modules are never shared anymore.

I'm not sure what does that mean, can you explain a bit more?
(So that in the future I could avoid introducing similar issues)

Also, why we don't use FILE_NAME instead? That is a clang extension but we could check and use that before passing the SHORT_FILE macro.

I could work something out that would only work with gcc and clang, and let MSVC take the slow path.

Thanks @jroelofs for reverting in the meantime, and sorry for the breakage! It does not seem like an easy issue to root cause.

@jroelofs
Copy link
Contributor

jroelofs commented Aug 6, 2025

Thanks @jroelofs for reverting in the meantime, and sorry for the breakage! It does not seem like an easy issue to root cause.

I thought we were going to have to take some more drastic measures to bisect this, and wrote up a whole proposal for how to re-architect GreenDragon jobs for automatic bisection: llvm/llvm-zorg#533. That said, we ended up finding it without that after seeing it hit multiple buildbots and intersecting their commit lists. This commit stuck out to me, but I didn't realize why until it clicked for @cachemeifyoucan. Anyway, long-winded way of saying: if you have some time to review my bisection PR, that would help for next time ;)

p.s: I had to revert the revert in f9386d3. Did it too hastily, and broke more things.

I could work something out that would only work with gcc and clang, and let MSVC take the slow path.

@cachemeifyoucan @joker-eph how about:

diff --git a/llvm/include/llvm/Support/DebugLog.h b/llvm/include/llvm/Support/DebugLog.h
index a3312950da94..c2007a54e613 100644
--- a/llvm/include/llvm/Support/DebugLog.h
+++ b/llvm/include/llvm/Support/DebugLog.h
@@ -71,10 +71,18 @@ namespace llvm {
   DEBUGLOG_WITH_STREAM_TYPE_FILE_AND_LINE(STREAM, LEVEL, TYPE, FILE, __LINE__)
 // When __SHORT_FILE__ is not defined, the File is the full path,
 // otherwise __SHORT_FILE__ is defined in CMake to provide the file name
-// without the path prefix.
+// without the path prefix. In compilers where __FILE_NAME__ is supported (a
+// clang extension), use that instead, since it helps keep the macro definition
+// the same across all TUs, and therefore allows the module cache entries to be
+// shared across all of them, rather than duplicated.
 #if defined(__SHORT_FILE__)
+#if __has_builtin(__builtin_FILE_NAME)
+#define DEBUGLOG_WITH_STREAM_AND_TYPE(STREAM, LEVEL, TYPE)                     \
+  DEBUGLOG_WITH_STREAM_TYPE_AND_FILE(STREAM, LEVEL, TYPE, __FILE_NAME__)
+#else
 #define DEBUGLOG_WITH_STREAM_AND_TYPE(STREAM, LEVEL, TYPE)                     \
   DEBUGLOG_WITH_STREAM_TYPE_AND_FILE(STREAM, LEVEL, TYPE, __SHORT_FILE__)
+#endif
 #else
 #define DEBUGLOG_WITH_STREAM_AND_TYPE(STREAM, LEVEL, TYPE)                     \
   DEBUGLOG_WITH_STREAM_TYPE_AND_FILE(STREAM, LEVEL, TYPE,                      \

joker-eph added a commit to joker-eph/llvm-project that referenced this pull request Aug 6, 2025
This per-file macro definition on the command line breaks caching of
modules. See discussion in llvm#150677

Instead we use a constexpr variable to force the constexpr evaluation
by the frontend, and also the __FILE_NAME__ macro when available
(clang/gcc) to spare compile-time in the frontend.
joker-eph added a commit to joker-eph/llvm-project that referenced this pull request Aug 6, 2025
This per-file macro definition on the command line breaks caching of
modules. See discussion in llvm#150677

Instead we use a constexpr variable to force the constexpr evaluation
by the frontend, and also the __FILE_NAME__ macro when available
(clang/gcc) to spare compile-time in the frontend.
@joker-eph
Copy link
Collaborator Author

@RKSimon do you know if your MSBuild config was using modules? (checking if this is related somehow)

@joker-eph joker-eph deleted the ldb_strip_path branch August 6, 2025 17:38
@RKSimon
Copy link
Collaborator

RKSimon commented Aug 6, 2025

No, it was a very basic cmake build, llvm+clang projects with assertions and EXPENSIVE_CHECKS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular llvm:support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants