[clang] [HIP][SPIRV] Implicit `new`/`delete` should be `cdecl` on host (PR #152023)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 4 13:20:15 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- clang/lib/Sema/SemaExprCXX.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 5b9cd65c5..8884f34a6 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3501,8 +3501,9 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
     // specializations for the allocation, so in order to prevent a CC clash
     // we set cdecl on the host-side implicit decls, knowing these do not get
     // emitted when compiling for device.
-    if (getLangOpts().CUDAIsDevice && ExtraAttr && isa<CUDAHostAttr>(ExtraAttr)
-        && Context.getTargetInfo().getTriple().isSPIRV())
+    if (getLangOpts().CUDAIsDevice && ExtraAttr &&
+        isa<CUDAHostAttr>(ExtraAttr) &&
+        Context.getTargetInfo().getTriple().isSPIRV())
       EPI.ExtInfo = EPI.ExtInfo.withCallingConv(CallingConv::CC_C);
     QualType FnType = Context.getFunctionType(Return, Params, EPI);
     FunctionDecl *Alloc = FunctionDecl::Create(

``````````

</details>


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


More information about the cfe-commits mailing list