[clang] Add sycl_external attribute (PR #140282)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 26 15:45:43 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 h,cpp -- clang/test/SemaSYCL/sycl-external-attribute.cpp clang/include/clang/Sema/SemaSYCL.h clang/lib/AST/ASTContext.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaSYCL.cpp clang/test/CodeGenSYCL/kernel-caller-entry-point.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index a17df019a..9076c8ced 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -12907,8 +12907,8 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
   if (D->hasAttr<WeakRefAttr>())
     return false;
 
-  if (LangOpts.SYCLIsDevice &&
-       (!D->hasAttr<SYCLKernelEntryPointAttr>() || !D->hasAttr<SYCLExternalAttr>()))
+  if (LangOpts.SYCLIsDevice && (!D->hasAttr<SYCLKernelEntryPointAttr>() ||
+                                !D->hasAttr<SYCLExternalAttr>()))
     return false;
 
   // Aliases and used decls are required.

``````````

</details>


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


More information about the cfe-commits mailing list