diff options
author | Andrew Rogers <andrurogerz@gmail.com> | 2025-05-19 11:18:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-19 11:18:33 -0700 |
commit | dd0a1c56df90f5ff2b4d6a5fba2e28b2e05d6450 (patch) | |
tree | c150a73e7288569b0edb3bfadd8fa1d17f8b0f3b /clang/lib/Serialization/ModuleFile.cpp | |
parent | 3bae8e2ef2ff02dcba745cb47ea1264fd08885cc (diff) | |
download | llvm-dd0a1c56df90f5ff2b4d6a5fba2e28b2e05d6450.zip llvm-dd0a1c56df90f5ff2b4d6a5fba2e28b2e05d6450.tar.gz llvm-dd0a1c56df90f5ff2b4d6a5fba2e28b2e05d6450.tar.bz2 |
[llvm] revert preprocessor dump method guards from llvm::ScaledNumber (#140574)
## Purpose
Reverts the preprocessor guards added to the `dump()` methods in
`llvm/Support/ScaledNumber.h` in #139938 so that the header can be
included when building an external project in debug mode against a
release LLVM build.
## Overview
This is a clean revert of two files modified in #139938. The rest of
that change should not cause similar problems.
## Background
The following new build error was reported on #139938, which was merged
last week:
```
module.cpp:(.text._ZNK4llvm12ScaledNumberImE4dumpEv[_ZNK4llvm12ScaledNumberImE4dumpEv]+0x34): undefined reference to `llvm::ScaledNumberBase::dump(unsigned long, short, int)'
```
See further discussion on #139938.
## Validation
Implemented a simple external LLVM project to reproduce the issue.
Verified the the following link failure is observed on LLVM main
(Windows + Clang) without this change:
```
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -nostartfiles -nostdlib -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -Xlinker /subsystem:console -fuse-ld=lld-link CMakeFiles/llvm-dump-test.dir/main.cxx.obj -o llvm-dump-test.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:llvm-dump-test.lib -Xlinker /pdb:llvm-dump-test.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
lld-link: error: undefined symbol: public: static void __cdecl llvm::ScaledNumberBase::dump(unsigned __int64, short, int)
>>> referenced by S:\llvm\llvm-project\llvm\include\llvm\Support\ScaledNumber.h:614
>>> CMakeFiles/llvm-dump-test.dir/main.cxx.obj:(public: void __cdecl llvm::ScaledNumber<unsigned __int64>::dump(void) const)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
```
Verified the link issue is resolved after applying this change.
Also, manually included all header files that were modified in #139938
in the test program and verified there are no other link errors.
Diffstat (limited to 'clang/lib/Serialization/ModuleFile.cpp')
0 files changed, 0 insertions, 0 deletions