Skip to content

Conversation

AlexVlx
Copy link
Contributor

@AlexVlx AlexVlx commented Oct 6, 2025

For the case when multiple .bc files are fed into the link stage we were re-using the provided output filename as intermediate target for bitcode linking. This does not work in Windows, where we'd subsequently try to use it both as input to and output from the translator. Thus, we switch over to using a temporary file as the bitcode linking target, iff it is necessary.

@AlexVlx AlexVlx requested a review from yxsamliu October 6, 2025 22:13
Copy link

github-actions bot commented Oct 6, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp,c -- clang/lib/Driver/ToolChains/HIPAMD.cpp clang/test/Driver/spirv-amd-toolchain.c

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/clang/lib/Driver/ToolChains/HIPAMD.cpp b/clang/lib/Driver/ToolChains/HIPAMD.cpp
index 8b8d6e6f5..68d6aa247 100644
--- a/clang/lib/Driver/ToolChains/HIPAMD.cpp
+++ b/clang/lib/Driver/ToolChains/HIPAMD.cpp
@@ -170,8 +170,8 @@ void AMDGCN::Linker::constructLinkAndEmitSpirvCommand(
 
   InputInfo LinkedBC = Inputs.front();
   if (Inputs.size() > 1) {
-    std::string TempPath = C.getDriver().GetTemporaryPath("pre-spirv-translate",
-                                                          "bc");
+    std::string TempPath =
+        C.getDriver().GetTemporaryPath("pre-spirv-translate", "bc");
     LinkedBC = InputInfo(&JA, C.getArgs().MakeArgString(TempPath),
                          Output.getBaseInput());
     constructLlvmLinkCommand(C, JA, Inputs, LinkedBC, Args);

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant