Skip to content

Conversation

bogner
Copy link
Contributor

@bogner bogner commented Sep 10, 2025

The UID variable is only being used inside the #ifndef _WIN32 block - move the definition into the block as well.

The `UID` variable is only being used inside the `#ifndef _WIN32` block - move
the definition into the block as well.
@bogner bogner enabled auto-merge (squash) September 11, 2025 00:08
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2025

@llvm/pr-subscribers-llvm-support

Author: Justin Bogner (bogner)

Changes

The UID variable is only being used inside the #ifndef _WIN32 block - move the definition into the block as well.


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

1 Files Affected:

  • (modified) llvm/unittests/Support/VirtualOutputBackendsTest.cpp (+1-1)
diff --git a/llvm/unittests/Support/VirtualOutputBackendsTest.cpp b/llvm/unittests/Support/VirtualOutputBackendsTest.cpp
index 3aee880a377df..03a4a9c3c7c32 100644
--- a/llvm/unittests/Support/VirtualOutputBackendsTest.cpp
+++ b/llvm/unittests/Support/VirtualOutputBackendsTest.cpp
@@ -559,9 +559,9 @@ Error OnDiskOutputBackendProvider::checkKept(StringRef FilePath,
   if (Error E = lookupFileInfo(FilePath, Info))
     return E;
 
+#ifndef _WIN32
   sys::fs::UniqueID UID =
       shouldUseTemporaries(*Info) ? *Info->TempUID : *Info->UID;
-#ifndef _WIN32
   if (!Info->F->hasUniqueID(UID))
     return createStringError(inconvertibleErrorCode(),
                              "File not created by keep or changed UID");

@bogner bogner merged commit 9641399 into llvm:main Sep 11, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 11, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-quick running on linaro-clang-aarch64-quick while building llvm at step 5 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clangd Unit Tests :: ./ClangdTests/51/332' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests-Clangd Unit Tests-2851436-51-332.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=332 GTEST_SHARD_INDEX=51 /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests
--

Note: This is test shard 52 of 332.
[==========] Running 4 tests from 4 test suites.
[----------] Global test environment set-up.
[----------] 1 test from ClangdServerTest
[ RUN      ] ClangdServerTest.ForceReparseCompileCommandDefines
ASTWorker building file /clangd-test/foo.cpp version null with command 
[/clangd-test]
clang -DWITH_ERROR /clangd-test/foo.cpp
Driver produced command: cc1 -cc1 -triple aarch64-unknown-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -main-file-name foo.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -enable-tlsdesc -target-cpu generic -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=/clangd-test -fcoverage-compilation-dir=/clangd-test -resource-dir lib/clang/22 -D WITH_ERROR -internal-isystem lib/clang/22/include -internal-isystem /usr/local/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -no-round-trip-args -target-feature -fmv -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /clangd-test/foo.cpp
Building first preamble for /clangd-test/foo.cpp version null
Built preamble of size 817380 for file /clangd-test/foo.cpp version null in 0.63 seconds
File version went from null to null
ASTWorker building file /clangd-test/foo.cpp version null with command clangd fallback
[/clangd-test]
clang /clangd-test/foo.cpp
Driver produced command: cc1 -cc1 -triple aarch64-unknown-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -main-file-name foo.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -enable-tlsdesc -target-cpu generic -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=/clangd-test -fcoverage-compilation-dir=/clangd-test -resource-dir lib/clang/22 -internal-isystem lib/clang/22/include -internal-isystem /usr/local/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -no-round-trip-args -target-feature -fmv -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /clangd-test/foo.cpp
Rebuilding invalidated preamble for /clangd-test/foo.cpp version null (previous was version null)
Built preamble of size 817288 for file /clangd-test/foo.cpp version null in 10.83 seconds
not idle after addDocument
UNREACHABLE executed at ../llvm/clang-tools-extra/clangd/unittests/SyncAPI.cpp:22!
 #0 0x0000c3af436ac200 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xc6c200)
 #1 0x0000c3af436a9cc8 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xc69cc8)
 #2 0x0000c3af436ad05c SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x0000f88e6d7568f8 (linux-vdso.so.1+0x8f8)
 #4 0x0000f88e6d2bf1f0 __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
 #5 0x0000f88e6d27a67c gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x0000f88e6d267130 abort ./stdlib/./stdlib/abort.c:81:7
 #7 0x0000c3af43658d10 llvm::RTTIRoot::anchor() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xc18d10)
 #8 0x0000c3af43503170 clang::clangd::runCodeComplete(clang::clangd::ClangdServer&, llvm::StringRef, clang::clangd::Position, clang::clangd::CodeCompleteOptions) (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xac3170)
 #9 0x0000c3af43011cd0 clang::clangd::(anonymous namespace)::ClangdServerTest_ForceReparseCompileCommandDefines_Test::TestBody() ClangdTests.cpp:0:0
#10 0x0000c3af43704300 testing::Test::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcc4300)
#11 0x0000c3af43705624 testing::TestInfo::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcc5624)
#12 0x0000c3af43706260 testing::TestSuite::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcc6260)
#13 0x0000c3af437165e0 testing::internal::UnitTestImpl::RunAllTests() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcd65e0)
#14 0x0000c3af43715f2c testing::UnitTest::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcd5f2c)
#15 0x0000c3af436f1048 main (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcb1048)
#16 0x0000f88e6d2673fc __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#17 0x0000f88e6d2674cc call_init ./csu/../csu/libc-start.c:128:20
#18 0x0000f88e6d2674cc __libc_start_main ./csu/../csu/libc-start.c:379:5
#19 0x0000c3af42ea95f0 _start (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0x4695f0)

--
exit: -6
--
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants