[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-07-16 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [Clang] [NFC] Prevent null pointer dereference in Sema::InstantiateFunctionDefinition (PR #89801)

2024-04-23 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Prevent null pointer dereference in Sema::​CodeCompleteQualifiedId() (PR #90490)

2024-04-30 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Prevent null pointer dereference in Sema::​CodeCompleteQualifiedId() (PR #90490)

2024-04-30 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Fix Null Pointer Dereference in Sema::BuildClassMessageImplicit() (PR #90482)

2024-04-30 Thread Tom Honermann via cfe-commits
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

[clang] [NFC][Clang] Avoid potential null pointer dereferences in Sema::AddInitializerToDecl(). (PR #106235)

2024-08-27 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-08-27 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-08-27 Thread Tom Honermann via cfe-commits
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

[clang] [NFC][Clang] Avoid potential null pointer dereferences in Sema::AddInitializerToDecl(). (PR #106235)

2024-08-27 Thread Tom Honermann via 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.

[clang] [NFC][Clang] Avoid potential null pointer dereferences in Sema::AddInitializerToDecl(). (PR #106235)

2024-08-27 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-27 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-27 Thread Tom Honermann via 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

[clang] [NFC][Clang] Avoid potential null pointer dereferences in Sema::AddInitializerToDecl(). (PR #106235)

2024-08-29 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Protect ObjCMethodList assignment operator against self-assignment (PR #97933)

2024-08-06 Thread Tom Honermann via 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

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-08-07 Thread Tom Honermann via cfe-commits
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

[clang] [Clang][NFC] Fix potential null dereference in encodeTypeForFunctionPointerAuth (PR #104737)

2024-08-19 Thread Tom Honermann via cfe-commits
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

[clang] [libc] [llvm] [NVPTX] Implement variadic functions using IR lowering (PR #96015)

2024-08-20 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Fix potential null pointer dereferences in Sema::AddInitializerToDecl (PR #94368)

2024-08-20 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-22 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-23 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-23 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #97105)

2024-08-23 Thread Tom Honermann via 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" -

[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #105556)

2024-08-23 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-24 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-24 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-25 Thread Tom Honermann via 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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-25 Thread Tom Honermann via cfe-commits
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

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-25 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-12 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-15 Thread Tom Honermann via cfe-commits
@@ -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; +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-11 Thread Tom Honermann via cfe-commits
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_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-07 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-07 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-07 Thread Tom Honermann via cfe-commits
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_

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-18 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-18 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-18 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-21 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-17 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-22 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-22 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-22 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via cfe-commits
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_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,34 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, + const FunctionDecl *FD) { + return {KernelNameType, FD}; +} +

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-11-04 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-05 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-04 Thread Tom Honermann via 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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-11-04 Thread Tom Honermann via cfe-commits
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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-11-05 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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-

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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-

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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-

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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-

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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 \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-30 Thread Tom Honermann via cfe-commits
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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
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_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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; +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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 \

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via 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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-30 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
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_

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, +

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-11-01 Thread Tom Honermann via cfe-commits
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:

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-27 Thread Tom Honermann via cfe-commits
@@ -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

[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

2024-10-27 Thread Tom Honermann via cfe-commits
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_

<    1   2   3   4   >