[clang] [Clang][CUDA][Driver] Diagnose unsupported -emit-llvm with fatbinary (PR #177577)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 23 04:49:01 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/Driver/ToolChains/Cuda.cpp --diff_from_common_commit
``````````

:warning:
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.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 6b6e38def..111c7b5c4 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -546,7 +546,8 @@ void NVPTX::FatBinary::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-g");
 
   for (const auto &II : Inputs) {
-    if (II.getType() == types::TY_LLVM_BC || II.getType() == types::TY_LLVM_IR) {
+    if (II.getType() == types::TY_LLVM_BC ||
+        II.getType() == types::TY_LLVM_IR) {
       C.getDriver().Diag(diag::err_drv_cuda_fatbinary_requires_elf_or_ptx);
       return;
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/177577


More information about the cfe-commits mailing list