[clang] [clang-tools-extra] [llvm] [clang] Simplify device kernel attributes (PR #137882)

Nick Sarnie via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 12:58:06 PDT 2025


================
@@ -3541,7 +3541,7 @@ bool FunctionDecl::isExternC() const {
 }
 
 bool FunctionDecl::isInExternCContext() const {
-  if (hasAttr<OpenCLKernelAttr>())
+  if (hasAttr<DeviceKernelAttr>() && getASTContext().getLangOpts().OpenCL)
----------------
sarnex wrote:

Sorry for the delay, I just pushed a commit updating all the sites I previously had checking the language to now check for the OpenCL spelling. Should be less risky. Please take a look when you have a sec, thanks.

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


More information about the llvm-commits mailing list