@@ -13681,12 +13681,13 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr
*Init, bool DirectInit) {
}
Init = Result.getAs();
+assert(Init && "Init must not be null");
+
IsParenListInit = !InitSeq.steps().empty() &&
InitSeq.step_beg
https://github.com/tahonermann approved this pull request.
Looks good to me, thanks @smanna12!
https://github.com/llvm/llvm-project/pull/89801
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
tahonermann wrote:
Adding Sam McCall as an additional reviewer since he originally authored this
code in commit a76e68c9704fb5b3faf25bb8d51e405b5310ff08.
https://github.com/llvm/llvm-project/pull/90490
___
cfe-commits mailing list
cfe-commits@lists.ll
https://github.com/tahonermann approved this pull request.
The change looks good to me. I recommend giving @sam-mccall a day or so to
comment if he wants to.
https://github.com/llvm/llvm-project/pull/90490
___
cfe-commits mailing list
cfe-commits@list
https://github.com/tahonermann requested changes to this pull request.
I believe the static analyzer is reporting a false positive in this case. I
don't think this change is correct. `BuildClassMessage()` only dereferences
`receiverTypeInfo` if the provided source location is not valid. The exi
https://github.com/tahonermann created
https://github.com/llvm/llvm-project/pull/106235
Control flow analysis performed by a static analysis tool revealed the
potential for null pointer dereferences to occur in conjunction with the `Init`
parameter in `Sema::AddInitializerToDecl()`. On entry t
tahonermann wrote:
A new PR has been submitted to address this static analysis concern as
@smanna12 is unavailable for the next week and I can't push to her fork. She
coordinated with me to do this hand off. I'm now closing this issue on her
behalf.
https://github.com/llvm/llvm-project/pull/1
https://github.com/tahonermann closed
https://github.com/llvm/llvm-project/pull/94368
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tahonermann wrote:
See https://github.com/llvm/llvm-project/pull/94368 for a prior attempt to
address this static analysis concern.
https://github.com/llvm/llvm-project/pull/106235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/106235
>From 787efaec5a565d118cacd306c91ed002bea7a992 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Sun, 25 Aug 2024 11:33:29 -0700
Subject: [PATCH 1/2] [NFC][Clang] Avoid potential null pointer dereferences i
https://github.com/tahonermann converted_to_draft
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tahonermann wrote:
*Sigh*, reverted to draft again. I noticed a vestigial file in both test cases,
a misplaced `#include_next` directive, and on further investigation discovered
that there is an additional divergence in the MSVC behavior that the patch
doesn't address (it looks like a user inc
https://github.com/tahonermann closed
https://github.com/llvm/llvm-project/pull/106235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tahonermann wrote:
I'm sorry, @smanna12, I misread the code earlier and misled you. That
`PunnedPointer` assignment operator I directed you too isn't a copy assignment
operator (it takes a `intptr_t`, not a reference or value of `PunnedPointer`).
Changing that assignment operator won't affect
tahonermann wrote:
I don't think the currently proposed change is right for a few reasons.
The proposed change silently marks the declaration as invalid and performs an
early return. I don't think this should be a silent behavior. In most, if not
all, of the existing early return cases, a diag
https://github.com/tahonermann approved this pull request.
Thanks, @smanna12! The change looks clearly correct since the type has already
been verified.
https://github.com/llvm/llvm-project/pull/104737
___
cfe-commits mailing list
cfe-commits@lists.ll
tahonermann wrote:
For historical reference, @jhuber6 backed out the change to
`NVPTXTargetInfo::getBuiltinVaListKind()` in
https://github.com/llvm/llvm-project/pull/100438 (commit
https://github.com/llvm/llvm-project/commit/fb1e077982e90e715058188fa667ea5dd8027a98)
https://github.com/llvm/ll
tahonermann wrote:
> The removal of the null check on `Init` in the code snippet leads to a
> segmentation fault when `Init` is null because it attempts to access a member
> function on a null pointer. The test case
> `test/SemaCXX/paren-list-agg-init.cpp` below expects compiler diagnostics fo
https://github.com/tahonermann created
https://github.com/llvm/llvm-project/pull/105738
Clang has historically mimicked gcc behavior for header file searching in which
user search paths are ordered before system search paths, user search paths
that duplicate a (later) system search path are ig
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 6377cc2f64ba494e769848d257fe683fb0059e6c Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
https://github.com/tahonermann edited
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8;
// CHECK-NOT: DIFlagEnumClass
// CHECK: !DIEnumerator(name: "A8", value: -128)
+// Forward declaration of an enum class.
+enum class Color : int;
+// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
-
https://github.com/tahonermann approved this pull request.
Per discussion in https://github.com/llvm/llvm-project/pull/97105, this looks
good to me.
However, please do update the PR title and adjust the commit message
accordingly when merging the change as requested by @pogo59.
https://github
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 57192d52acfdab7f253da013b89cc2f7cef037a3 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
https://github.com/tahonermann converted_to_draft
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 79b2ceb45cbc4ffb823f56e4c5eedb62f475c780 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
https://github.com/tahonermann ready_for_review
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tahonermann wrote:
It took me a few tries to get the tests tweaked just right for the `clang-cl`
driver to pass on Windows, but the tests now pass and this PR is now ready for
review.
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits m
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -0,0 +1,47 @@
+//===--- SYCLKernelInfo.h --- Information about SYCL kernels
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,47 @@
+//===--- SYCLKernelInfo.h --- Information about SYCL kernels
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -0,0 +1,137 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -fsyntax-only
-fsycl-is-device -verify %s
tahonermann wrote:
Those tests are included with the diagnostic work that will be in the next PR.
See
[here](https://github.com/tahonermann/llvm
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -198,3 +198,12 @@ void SemaSYCL::handleKernelAttr(Decl *D, const ParsedAttr
&AL) {
handleSimpleAttribute(*this, D, AL);
}
+
+void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) {
+ ParsedType PT = AL.getTypeArg();
+ TypeSourceInfo *TSI = nullptr;
+
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/3] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
https://github.com/tahonermann created
https://github.com/llvm/llvm-project/pull/111389
The `sycl_kernel_entry_point` attribute is used to declare a function that
defines a pattern for an offload kernel to be emitted. The attribute requires a
single type argument that specifies the type used a
tahonermann wrote:
This is the first in a series of PRs to provide core language support for
SYCL-aware host and device compilation and support for SYCL library
implementations. The following links present a preliminary set of changes for
future PRs that depend on this one. Some of these need
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/2] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From b775b7288035d83281434e27341b98a76623802f Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH 1/3] [Clang] Match MSVC handling of duplicate header search
tahonermann wrote:
@erichkeane, I think I have addressed or replied to all of your comments.
Another round of review feedback would be much appreciated!
@bader, as SYCL code maintainer, I would appreciate if you can take a look.
https://github.com/llvm/llvm-project/pull/111389
tahonermann wrote:
> This choice seems like a question of how the driver's command line is
> interpreted, rather than a language mode, so I wonder if it makes sense for
> it to consider `-fms-compatibility` at all or whether this should just be
> based on the driver mode. Do you have rationale
tahonermann wrote:
@zygoloid,
> On the fourth hand, IIRC the choice of whether header search for a relative
> path looks in the directory of includers as well as the directory of the
> current file already depends on `-fms-compatibility`, and this seems sort of
> similar.
I confirmed the sear
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From b775b7288035d83281434e27341b98a76623802f Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH 1/2] [Clang] Match MSVC handling of duplicate header search
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From b775b7288035d83281434e27341b98a76623802f Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH 1/4] [Clang] Match MSVC handling of duplicate header search
tahonermann wrote:
There is some interesting MSVC behavior that I'm not planning to replicate with
the changes being done for this issue but that I thought are worth documenting
(here at least, perhaps in Clang docs as well).
MSVC documentation for the
[`/external`](https://learn.microsoft.co
@@ -14296,6 +14296,30 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
tahonermann wrote:
Oops, yes. It will be needed in future PRs, but should be added then. I'll
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/9] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
@@ -14296,6 +14296,34 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType,
+ const FunctionDecl *FD) {
+ return {KernelNameType, FD};
+}
+
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 14538f86fba30eec50e3a5a85c4e569af8435048 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
https://github.com/tahonermann closed
https://github.com/llvm/llvm-project/pull/111389
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From a9b1711372a5f1a2294ba5f8b437a6020023a810 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 35e3cb1c9901c365c0cd6225a61067987d6c40b8 Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -0,0 +1,42 @@
+//===--- SYCLKernelInfo.h --- Information about SYCL kernels
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (LangOpts.OpenMP)
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
+ if (LangOpts.isSYCL() && NewFD->hasAttr() &&
+ !NewFD->isInvalidDecl() && !NewFD-
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (LangOpts.OpenMP)
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
+ if (LangOpts.isSYCL() && NewFD->hasAttr() &&
+ !NewFD->isInvalidDecl() && !NewFD-
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (LangOpts.OpenMP)
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
+ if (LangOpts.isSYCL() && NewFD->hasAttr() &&
+ !NewFD->isInvalidDecl() && !NewFD-
https://github.com/tahonermann ready_for_review
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (LangOpts.OpenMP)
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
+ if (LangOpts.isSYCL() && NewFD->hasAttr() &&
+ !NewFD->isInvalidDecl() && !NewFD-
https://github.com/tahonermann edited
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
if (LangOpts.OpenMP)
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
+ if (LangOpts.isSYCL() && NewFD->hasAttr() &&
+ !NewFD->isInvalidDecl() && !NewFD-
tahonermann wrote:
This PR is finally ready for review. I would especially appreciate it if @rnk
and @nico took a close look. Please add other known stakeholders.
https://github.com/llvm/llvm-project/pull/105738
___
cfe-commits mailing list
cfe-commit
@@ -0,0 +1,144 @@
+// Tests without serialization:
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \
+// RUN: -ast-dump %s \
+// RUN: | FileCheck --match-full-lines %s
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">;
def Borland : LangOpt<"Borland">;
def CUDA : LangOpt<"CUDA">;
def HIP : LangOpt<"HIP">;
-def SYCL : LangOpt<"SYCLIsDevice">;
+def SYCLHost : LangOpt<"SYCLIsHost">;
tahonermann wrote:
I've never lo
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">;
def Borland : LangOpt<"Borland">;
def CUDA : LangOpt<"CUDA">;
def HIP : LangOpt<"HIP">;
-def SYCL : LangOpt<"SYCLIsDevice">;
+def SYCLHost : LangOpt<"SYCLIsHost">;
tahonermann wrote:
The `SYCLIsDe
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/105738
>From 346c9693c7c02c82358208f8cf2a36ccab5cb70d Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Thu, 22 Aug 2024 09:44:56 -0700
Subject: [PATCH] [Clang] Match MSVC handling of duplicate header search paths
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -14296,6 +14296,29 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType,
tahonermann wrote:
I agree it is silly as is. It will get bigger; see
[here](https://gi
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">;
def Borland : LangOpt<"Borland">;
def CUDA : LangOpt<"CUDA">;
def HIP : LangOpt<"HIP">;
-def SYCL : LangOpt<"SYCLIsDevice">;
+def SYCLHost : LangOpt<"SYCLIsHost">;
tahonermann wrote:
Thanks, Erich
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/7] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -198,3 +198,12 @@ void SemaSYCL::handleKernelAttr(Decl *D, const ParsedAttr
&AL) {
handleSimpleAttribute(*this, D, AL);
}
+
+void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) {
+ ParsedType PT = AL.getTypeArg();
+ TypeSourceInfo *TSI = nullptr;
+
@@ -0,0 +1,144 @@
+// Tests without serialization:
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-device \
+// RUN: -ast-dump %s \
+// RUN: | FileCheck --match-full-lines %s
+// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -fsycl-is-host \
@@ -407,7 +407,8 @@ def MicrosoftExt : LangOpt<"MicrosoftExt">;
def Borland : LangOpt<"Borland">;
def CUDA : LangOpt<"CUDA">;
def HIP : LangOpt<"HIP">;
-def SYCL : LangOpt<"SYCLIsDevice">;
+def SYCLHost : LangOpt<"SYCLIsHost">;
tahonermann wrote:
With regard t
@@ -455,6 +455,174 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute facilitates the generation of a
@@ -0,0 +1,42 @@
+//===--- SYCLKernelInfo.h --- Information about SYCL kernels
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
@@ -455,6 +455,64 @@ The SYCL kernel in the previous code sample meets these
expectations.
}];
}
+def SYCLKernelEntryPointDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``sycl_kernel_entry_point`` attribute specifies that a function defini
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/8] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
@@ -14296,6 +14296,31 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
+ CanQualType KernelNameType,
+
@@ -1155,6 +1155,15 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
for (unsigned I = 0; I != NumParams; ++I)
Params.push_back(readDeclAs());
FD->setParams(Reader.getContext(), Params);
+
+ // If the declaration is a SYCL kernel entry point function as ind
tahonermann wrote:
@erichkeane, I believe all of the concerns you raised have been resolved with
the exception of the `constexpr` question for which you asked @keryell to weigh
in. I hope we're close to consensus on no need for a change for that one.
Please re-review when time permits.
https:
@@ -14296,6 +14296,30 @@ void
ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap,
}
}
+static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context,
tahonermann wrote:
Done.
https://github.com/llvm/llvm-project/pull/111389
https://github.com/tahonermann updated
https://github.com/llvm/llvm-project/pull/111389
>From 3c4a2b8a52d3f1c730df88a308dece21a67834ef Mon Sep 17 00:00:00 2001
From: Tom Honermann
Date: Fri, 4 Oct 2024 11:10:32 -0700
Subject: [PATCH 1/4] [SYCL] The sycl_kernel_entry_point attribute.
The `sycl_
101 - 200 of 393 matches
Mail list logo