[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -verify=expected,c2y -pedantic -std=c2y %s +// RUN: %clang_cc1 -verify=expected,c2y,compat -Wpre-c2y-compat -std=c2y %s +// RUN: %clang_cc1 -verify=expected,ext -pedantic -std=c23 %s +// RUN: %clang_cc1 -verify=expected,cpp -pedantic -x c++ -W

[clang] 0460418 - [clang][driver][NFC] Remove else after return (#131182)

2025-03-17 Thread via cfe-commits
Author: Paul Kirth Date: 2025-03-17T10:33:19-07:00 New Revision: 046041842022f12ab04403e255ceeec25d6ce11c URL: https://github.com/llvm/llvm-project/commit/046041842022f12ab04403e255ceeec25d6ce11c DIFF: https://github.com/llvm/llvm-project/commit/046041842022f12ab04403e255ceeec25d6ce11c.diff LO

[clang] [clang][driver][NFC] Remove else after return (PR #131182)

2025-03-17 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/131182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Use rva22u64_v as the default march for Fuchsia targets (PR #131183)

2025-03-17 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/131183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Constant Expressions inside of GCC' asm strings (PR #131003)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -1958,6 +1958,24 @@ references can be used instead of numeric references. return -1; } + +Constexpr strings in GNU ASM statememts +=== + +In C++11 mode (and greater), Clang supports specifying the template, +constraints, and clobb

[clang] [clang][driver][NFC] Remove else after return (PR #131182)

2025-03-17 Thread Paul Kirth via cfe-commits
ilovepi wrote: ### Merge activity * **Mar 17, 1:32 PM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/131182). https://github.com/llvm/llvm-project/pull/131182

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/122629 >From ab66262e163a8c63c980d8298480556aad9c5b4c Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Mar 2025 12:31:06 -0400 Subject: [PATCH 1/3] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to s

[clang] Move const qualification of array to its elements (PR #131366)

2025-03-17 Thread Serge Pavlov via cfe-commits
spavloff wrote: MR https://github.com/llvm/llvm-project/pull/131649 implements an alternative fix to the problem. https://github.com/llvm/llvm-project/pull/131366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/131515 >From ae66e1cc48c721badc234ff5bc5a89aeb6cd2ea3 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sun, 16 Mar 2025 14:04:15 +0100 Subject: [PATCH 01/10] [Clang][RFC] Intrododuce a builtin to determine the num

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -verify=expected,c2y -pedantic -std=c2y %s +// RUN: %clang_cc1 -verify=expected,c2y,compat -Wpre-c2y-compat -std=c2y %s +// RUN: %clang_cc1 -verify=expected,ext -pedantic -std=c23 %s +// RUN: %clang_cc1 -verify=expected,cpp -pedantic -x c++ -W

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Shilei Tian via cfe-commits
@@ -84,31 +84,27 @@ OffloadTargetInfo::OffloadTargetInfo(const StringRef Target, : BundlerConfig(BC) { // TODO: Add error checking from ClangOffloadBundler.cpp - auto TargetFeatures = Target.split(':'); - auto TripleOrGPU = TargetFeatures.first.rsplit('-'); - - if (cl

[clang] [llvm] [DataLayout] Introduce sentinel pointer value (PR #131557)

2025-03-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/131557 >From 015964e72ebc223bcd191ceb306de8fdbca360f3 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Mar 2025 13:52:06 -0400 Subject: [PATCH] [DataLayout] Introduce sentinel pointer value MIME-Version: 1.0 C

[clang] [llvm] [DataLayout] Introduce sentinel pointer value (PR #131557)

2025-03-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/131557 >From efda127ecd06ea966df89425d10bd837c0cafe4e Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Mon, 17 Mar 2025 13:45:09 +0900 Subject: [PATCH] [DataLayout] Introduce sentinel pointer value MIME-Version: 1.

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/131626 >From f3c0bc1d271495372b56716e87f033e43aa022b3 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 17 Mar 2025 11:12:56 -0400 Subject: [PATCH 1/6] [C2y] Add octal prefixes, deprecate unprefixed octals

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-17 Thread Rashmi Mudduluru via cfe-commits
@@ -695,9 +695,13 @@ RefPtr object(); void someFunction(const RefCounted&); void test2() { -someFunction(*object()); + someFunction(*object()); } void system_header() { callMethod(object); } + +void log(RefCountable* obj) { + os_log_msg(os_log_create("WebKit", "D

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
@@ -0,0 +1,168 @@ +// RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify + +struct S0 {}; +struct S1 {int a;}; +struct S2 {int a; int b;}; +struct S3 {double a; int b; int c;}; + + + +struct SD : S1 {}; +struct SE1 : S1 { int b;}; + +class P1 {int a;}; // #note-private + + +temp

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/131649 Const-qualification of an array caused by constexpr specifier can produce QualType, where the const qualifier is set both as fast qualifier and as a qualifier of the array element type. It can result in a comp

[clang] [clang][driver] Use rva22u64_v as the default march for Fuchsia targets (PR #131183)

2025-03-17 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/131183 >From 8ea1c3731175dfcd3c44a4917d1b5f96a81ad9c6 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Thu, 13 Mar 2025 10:19:56 -0700 Subject: [PATCH] [clang][driver] Use rva22u64_v as the default march for Fuchsia ta

[clang] [llvm] update_test_checks: add new --filter-out-after option (PR #129739)

2025-03-17 Thread David Sherwood via cfe-commits
david-arm wrote: > I'd be fine with limiting it to update_test_checks, just wanted to make sure > that it works in the instances where it's available. Of course, if we can get > it in the other scripts for free that's great, too! That said, for > update_test_checks, does the regex match the in

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Serge Pavlov (spavloff) Changes Const-qualification of an array caused by constexpr specifier can produce QualType, where the const qualifier is set both as fast qualifier and as a qualifier of the array element type. It can result in a c

[clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

2025-03-17 Thread Alex Hoppen via cfe-commits
https://github.com/ahoppen updated https://github.com/llvm/llvm-project/pull/82061 >From 1285081e8fc7d7ecd162ed8ec7201437dbd708da Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Mon, 29 Jul 2024 17:33:43 -0700 Subject: [PATCH] [clangd] Use `RenameSymbolName` to represent Objective-C selectors

[clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

2025-03-17 Thread Alex Hoppen via cfe-commits
ahoppen wrote: Thanks for the review, @DavidGoldman. I addressed your comments. https://github.com/llvm/llvm-project/pull/82061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -1873,19 +1874,54 @@ TypeTraitExpr::TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind, setDependence(computeDependence(this)); } +TypeTraitExpr::TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind, + ArrayRef Args, +

[clang] b3c5031 - [HLSL] Remove HLSLResource attribute (#130342)

2025-03-17 Thread via cfe-commits
Author: Helena Kotas Date: 2025-03-17T10:00:07-07:00 New Revision: b3c5031b07396959c5d4e7f62d516d63de015358 URL: https://github.com/llvm/llvm-project/commit/b3c5031b07396959c5d4e7f62d516d63de015358 DIFF: https://github.com/llvm/llvm-project/commit/b3c5031b07396959c5d4e7f62d516d63de015358.diff

[clang] Move const qualification of array to its elements (PR #131366)

2025-03-17 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/131366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DataLayout] Introduce sentinel pointer value (PR #131557)

2025-03-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/131557 >From 053949d4dd8f28a2daa57a6143f0267c0bd3af6c Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Mon, 17 Mar 2025 13:45:09 +0900 Subject: [PATCH 1/2] [LoopVectorize] Add test for follow-up metadata for loops

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/129939 >From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 4 Mar 2025 09:53:56 -0800 Subject: [PATCH 01/16] extra scalar vector overloads for clamp --- .../lib/Headers/h

[clang] [clang] Mark some language options as benign. (PR #131569)

2025-03-17 Thread via cfe-commits
matts1 wrote: For now I've removed everything but the TrivialAuto* https://github.com/llvm/llvm-project/pull/131569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -434,6 +434,37 @@ __datasizeof ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of the type ignoring tail padding. +.. _builtin_structured_binding_size-doc: + +__builtin_structured_binding_size (C++) +--- +``__bu

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Jon Chesterfield via cfe-commits
JonChesterfield wrote: Patch opposed internally. Will see if I can think of an alternative. https://github.com/llvm/llvm-project/pull/131190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield closed https://github.com/llvm/llvm-project/pull/131190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Diagnostics] Update select uses in DiagnosticXKinds.td to use enum_select (PR #130868)

2025-03-17 Thread Ayokunle Amodu via cfe-commits
ayokunle321 wrote: @erichkeane thanks a lot for the clarification. I think I have a hang of it now- I was kinda confused before. Now, my approach is to look through DiagnosticXKinds.td files -> check for a `select` with a significant number of items -> check its diagnostic ID -> grep the lib d

[clang] [Clang] Constant Expressions inside of GCC' asm strings (PR #131003)

2025-03-17 Thread via cfe-commits
@@ -1958,6 +1958,24 @@ references can be used instead of numeric references. return -1; } + +Constexpr strings in GNU ASM statememts +=== + +In C++11 mode (and greater), Clang supports specifying the template, +constraints, and clobb

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-17 Thread via cfe-commits
https://github.com/dong-miao updated https://github.com/llvm/llvm-project/pull/131094 >From bcdf9641037507b855a20a8ba5d26b127dd248e8 Mon Sep 17 00:00:00 2001 From: dong-miao Date: Sat, 4 Jan 2025 17:53:58 +0800 Subject: [PATCH 01/28] Update RISCVSystemOperands.td --- llvm/lib/Target/RISCV/RIS

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/131626 >From f3c0bc1d271495372b56716e87f033e43aa022b3 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 17 Mar 2025 11:12:56 -0400 Subject: [PATCH 1/2] [C2y] Add octal prefixes, deprecate unprefixed octals

[clang] [Clang] Constant Expressions inside of GCC' asm strings (PR #131003)

2025-03-17 Thread via cfe-commits
@@ -3326,9 +3325,11 @@ class GCCAsmStmt : public AsmStmt { //===--- Asm String Analysis ---===// - const StringLiteral *getAsmString() const { return AsmStr; } - StringLiteral *getAsmString() { return AsmStr; } - void setAsmString(StringLiteral *E) { AsmStr = E; } + con

[clang] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

2025-03-17 Thread Joseph Huber via cfe-commits
@@ -4357,6 +4357,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.OpenACCMacroOverride = A->getValue(); } + Opts.IsOffloadingTarget = + (Opts.OpenMPIsTargetDevice || Opts.SYCLIsDevice || Opts.CUDAIsDevice) && j

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-17 Thread Florian Hahn via cfe-commits
@@ -9242,3 +9242,15 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def ValueTypeDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``value_type`` attribute can be u

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-03-17 Thread Donát Nagy via cfe-commits
@@ -39,6 +39,9 @@ class ProgramPointTag { public: ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {} virtual ~ProgramPointTag(); + + /// The description of this program point which will be displayed when the + /// ExplodedGraph is dumped in DOT format for debu

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/122629 >From 16509121603e55539a5fa26420343d74c39b7963 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 Mar 2025 12:31:06 -0400 Subject: [PATCH] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to suppo

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-17 Thread Balazs Benics via cfe-commits
@@ -635,6 +668,66 @@ void deque_emplace_back(std::deque &D, int n) { clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}} } +/// append_range() +/// +/// - Design decision: extends containers to the ->RIGHT-> (i.e. the stea

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-17 Thread Balazs Benics via cfe-commits
@@ -635,6 +668,66 @@ void deque_emplace_back(std::deque &D, int n) { clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}} } +/// append_range() +/// +/// - Design decision: extends containers to the ->RIGHT-> (i.e. the +/// past-the-end p

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-03-17 Thread Fangyi Zhou via cfe-commits
fangyi-zhou wrote: May I get a re-review for the changes please? https://github.com/llvm/llvm-project/pull/128251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] update_test_checks: add new --filter-out-after option (PR #129739)

2025-03-17 Thread David Sherwood via cfe-commits
https://github.com/david-arm updated https://github.com/llvm/llvm-project/pull/129739 >From d8487a8d0fb91c0e81636959a80607b9c313bf84 Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Mon, 17 Mar 2025 16:07:03 + Subject: [PATCH] update_test_checks: add new --filter-all-after option Whilst

[clang] [clang][bytecode] Fix builtin_memchr with non-0 start index (PR #131633)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/131633 None >From 72ace33d6a7035f193728607095493d1a5d575ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 17 Mar 2025 17:01:38 +0100 Subject: [PATCH] [clang][bytecode] Fix builtin_memchr with

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-17 Thread Balazs Benics via cfe-commits
@@ -635,6 +668,66 @@ void deque_emplace_back(std::deque &D, int n) { clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}} } +/// append_range() +/// +/// - Design decision: extends containers to the ->RIGHT-> (i.e. the +/// past-the-end p

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/129719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add [[maybe_unused]] forgotten in 57e36419b251 (PR #131617)

2025-03-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/131617 Fixes https://github.com/llvm/llvm-project/pull/131175#discussion_r1998764727 >From e00f2b1fd392079840e8b2b4876552e8e2223bea Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Mon, 17 Mar 2025 14:55:52 +0100 S

[clang] [flang] [flang][OpenMP] Upstream `do concurrent` loop-nest detection. (PR #127595)

2025-03-17 Thread Kareem Ergawy via cfe-commits
https://github.com/ergawy updated https://github.com/llvm/llvm-project/pull/127595 >From 476819d0674af979abcbbc8967376c64506329cb Mon Sep 17 00:00:00 2001 From: ergawy Date: Wed, 5 Feb 2025 23:31:15 -0600 Subject: [PATCH 1/2] [flang][OpenMP] Upstream first part of `do concurrent` mapping This

[clang] [clang][bytecode] Check dtor instance pointers for active-ness (PR #128732)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/128732 >From 12b39425cf4eea776835e786de8e6a6975798d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 25 Feb 2025 17:14:36 +0100 Subject: [PATCH] [clang][bytecode] Check dtor instance pointers

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/131515 >From ae66e1cc48c721badc234ff5bc5a89aeb6cd2ea3 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sun, 16 Mar 2025 14:04:15 +0100 Subject: [PATCH 1/8] [Clang][RFC] Intrododuce a builtin to determine the numbe

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Aaron Ballman via cfe-commits
@@ -176,7 +176,7 @@ C2y implementation status Obsolete implicitly octal literals and add delimited escape sequences https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm";>N3353 - No + Clang 21 AaronBallman wrote: Ah good point

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Dmitry Sidorov via cfe-commits
https://github.com/MrSidims edited https://github.com/llvm/llvm-project/pull/131190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
@@ -1642,6 +1661,50 @@ void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD) { DD->setInvalidDecl(); } +std::optional Sema::GetDecompositionElementCount(QualType T, + SourceLocation Loc) { + con

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
@@ -2135,9 +2135,14 @@ void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) { VisitExpr(E); + E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt(); E->TypeTraitExprBits.NumArgs = Record.r

[clang] [clang] Fix UEFI Target info (PR #127290)

2025-03-17 Thread Petr Hosek via cfe-commits
@@ -835,16 +835,22 @@ class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo public: UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : UEFITargetInfo(Triple, Opts) { +LongWidth = LongAlign = 32; +DoubleAlign = LongLongAlign = 64; +Int

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
@@ -2135,9 +2135,14 @@ void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) { VisitExpr(E); + E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt(); cor3ntin wrote: This is

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread via cfe-commits
@@ -5813,6 +5817,34 @@ static ExprResult CheckConvertibilityForTypeTraits( return Result; } +static APValue EvaluateSizeTTypeTrait(Sema &S, TypeTrait Kind, + SourceLocation KWLoc, + ArrayRef Args, +

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -2135,9 +2135,14 @@ void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) { VisitExpr(E); + E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt(); E->TypeTraitExprBits.NumArgs = Record.r

[clang] disable unary, vector mask (PR #130400)

2025-03-17 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I have no idea how much the two-argument version of __builtin_shufflevector is used in practice. I wouldn't want to remove it without a better idea of that... I vaguely recall it might be relevant for some GPU languages. It should be possible to fix the crash by just reje

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/131515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/129939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -2135,9 +2135,14 @@ void ASTStmtReader::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { void ASTStmtReader::VisitTypeTraitExpr(TypeTraitExpr *E) { VisitExpr(E); + E->TypeTraitExprBits.IsBooleanTypeTrait = Record.readInt(); erichkeane wrote: Is too

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-17 Thread Aaron Ballman via cfe-commits
@@ -591,6 +591,8 @@ def err_decomp_decl_std_tuple_size_not_constant : Error< "is not a valid integral constant expression">; def note_in_binding_decl_init : Note< "in implicit initialization of binding declaration %0">; +def err_arg_is_not_destructurable : Error< + "type %

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread Eli Friedman via cfe-commits
@@ -14171,6 +14171,15 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, static auto unwrapSugar(SplitQualType &T, Qualifiers &QTotal) { SmallVector R; while (true) { +if (const auto *ATy = dyn_cast(T.Ty)) { + // C++ 9.3.3.4p3: Any type of t

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield updated https://github.com/llvm/llvm-project/pull/131190 >From 65dcf7cb54156ec9623c2f04f1d70b479b4623b5 Mon Sep 17 00:00:00 2001 From: Jon Chesterfield Date: Wed, 12 Mar 2025 20:55:17 + Subject: [PATCH] [SPIRV] GPU intrinsics --- clang/include/clang/Basi

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-03-17 Thread Oliver Stöneberg via cfe-commits
firewave wrote: Some thoughts based on the warnings I am seeing in actual code. --- Another way to fix this could be using `std::to_string()`. --- I am seeing this with an enum type which might be valid, working code but have not looked into it yet. --- The fix-it is problematic if it is a

[clang] Improve the -Wundefined-func-template diagnostic note for invisible template functions (PR #129031)

2025-03-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/129031 >From 184a449456f82d26ca8ea253b7c3913df512c1a3 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 27 Feb 2025 11:15:09 +0100 Subject: [PATCH 1/4] Improve the -Wundefined-func-template diagnostic note for invis

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,501 @@ +//===- LowerGPUIntrinsic.cpp --===// +// +// 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: Ap

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Michal Paszkowski via cfe-commits
@@ -0,0 +1,501 @@ +//===- LowerGPUIntrinsic.cpp --===// +// +// 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: Ap

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibi (Branch Immediate) extension (PR #130779)

2025-03-17 Thread Sudharsan Veeravalli via cfe-commits
@@ -1671,6 +1707,8 @@ bool RISCVAsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, return generateImmOutOfRangeError(Operands, ErrorInfo, 0, (1 << 10) - 1); case Match_InvalidUImm11: return generateImmOutOfRangeError(Operands, ErrorInfo, 0, (1 << 11) -

[clang] [clang][bytecode] Compile functions lazily (PR #131596)

2025-03-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/131596 >From b6bb99087ad88f50e18610f92f4fb891e0b48d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 16 Mar 2025 09:17:39 +0100 Subject: [PATCH] [clang][bytecode] Compile functions lazily Cre

[clang] Improve the -Wundefined-func-template diagnostic note for invisible template functions (PR #129031)

2025-03-17 Thread Haojian Wu via cfe-commits
@@ -5654,6 +5654,8 @@ def warn_func_template_missing : Warning<"instantiation of function %q0 " InGroup, DefaultIgnore; def note_forward_template_decl : Note< "forward declaration of template entity is here">; +def note_unreachable_template_decl +: Note<"unreachable de

[clang] Reapply "[Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros" (PR #102135)

2025-03-17 Thread via cfe-commits
yronglin wrote: @cor3ntin @shafik Many thanks for the review! I plan to finish [P1857R3](https://github.com/llvm/llvm-project/pull/107168) first. I'll finish and make it ready for review this week or next week. https://github.com/llvm/llvm-project/pull/102135 __

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-03-17 Thread Ibraim Ganiev via cfe-commits
olologin wrote: Just FYI: I have tested @DeNiCoN on our codebase in the company we work with him together (~8k Translation units), and it seems to work fine. `NOLINT(check-name)` works, .clang-tidy config inheritance works (In case some subfolders want to disable particular matchers). Very use

[clang] [clang-tools-extra] [CudaSPIRV] Allow using integral non-type template parameters as attribute args (PR #131546)

2025-03-17 Thread Shangwu Yao via cfe-commits
@@ -812,6 +838,12 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs, continue; } +if (const auto *ReqdWorkGroupSize = +dyn_cast(TmplAttr)) { + instantiateDependentReqdWorkGroupSizeAttr(*this, TemplateArgs, ---

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s -DTEST_TYPE=half +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s -DTEST_TYPE=half3 +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Dmitry Sidorov via cfe-commits
https://github.com/MrSidims edited https://github.com/llvm/llvm-project/pull/131190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread via cfe-commits
@@ -176,7 +176,7 @@ C2y implementation status Obsolete implicitly octal literals and add delimited escape sequences https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm";>N3353 - No + Clang 21 cor3ntin wrote: https://compiler-

[clang] [llvm] [DataLayout] Introduce sentinel pointer value (PR #131557)

2025-03-17 Thread Shilei Tian via cfe-commits
@@ -552,6 +553,11 @@ class DataLayout { /// /// This includes an explicitly requested alignment (if the global has one). Align getPreferredAlign(const GlobalVariable *GV) const; + + /// Returns the sentinel pointer value for a given address space. If the + /// address s

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,95 @@ +// RUN: %clang_cc1 -verify=expected,c2y -pedantic -std=c2y %s +// RUN: %clang_cc1 -verify=expected,c2y,compat -Wpre-c2y-compat -std=c2y %s +// RUN: %clang_cc1 -verify=expected,ext -pedantic -std=c23 %s +// RUN: %clang_cc1 -verify=expected,ext -pedantic -x c++ -Wn

[clang] [analyzer] Add more C++ list initializer tests and regroup (PR #129182)

2025-03-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Could you annotate the removed hunks with notes where are they tested now? I want to double check that no tests disappear. https://github.com/llvm/llvm-project/pull/129182 ___ cfe-commits mailing list cfe-commits@

[clang] [Clang] Constant Expressions inside of GCC' asm strings (PR #131003)

2025-03-17 Thread Erich Keane via cfe-commits
@@ -3326,9 +3325,11 @@ class GCCAsmStmt : public AsmStmt { //===--- Asm String Analysis ---===// - const StringLiteral *getAsmString() const { return AsmStr; } - StringLiteral *getAsmString() { return AsmStr; } - void setAsmString(StringLiteral *E) { AsmStr = E; } + con

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-03-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Donát Nagy (NagyDonat) Changes The virtual method `ProgramPointTag::getTagDescription` had two very distinct use cases: - It is printed in the DOT graph visualization of the exploded graph (that is, a debug printout). -

[clang] [analyzer] Add [[maybe_unused]] forgotten in 57e36419b251 (PR #131617)

2025-03-17 Thread Mikael Holmén via cfe-commits
https://github.com/mikaelholmen approved this pull request. Thanks, LGTM! https://github.com/llvm/llvm-project/pull/131617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-17 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --*- C++ -*-===// +// +// 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: Ap

[clang] 19adc69 - [analyzer] Add [[maybe_unused]] forgotten in 57e36419b251 (#131617)

2025-03-17 Thread via cfe-commits
Author: Balazs Benics Date: 2025-03-17T15:00:45+01:00 New Revision: 19adc69029ba090d9eae3b89069dee7eadb1bd26 URL: https://github.com/llvm/llvm-project/commit/19adc69029ba090d9eae3b89069dee7eadb1bd26 DIFF: https://github.com/llvm/llvm-project/commit/19adc69029ba090d9eae3b89069dee7eadb1bd26.diff

[clang] [analyzer] Add [[maybe_unused]] forgotten in 57e36419b251 (PR #131617)

2025-03-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/131617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-17 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --*- C++ -*-===// +// +// 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: Ap

[clang] [clang-tools-extra] [CudaSPIRV] Allow using integral non-type template parameters as attribute args (PR #131546)

2025-03-17 Thread Shangwu Yao via cfe-commits
https://github.com/ShangwuYao approved this pull request. Pretty neat!! https://github.com/llvm/llvm-project/pull/131546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s farzonl wrote: rename to `clang/test/SemaHLSL/BuiltIns/clamp-errors-16bit.hlsl` ```suggestion // RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s + +// check we error on 16 bit type if shader model is too old +// CHECK: '-enable-16bit-types' option requires target HLSL Version >= 2018 and shader model >= 6.2, but HLSL Ve

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Jon Chesterfield via cfe-commits
JonChesterfield wrote: I've dropped the clang headers part from this patch, rewritten to elide the grid intrinsic and moved the test. Matt suggested llvm.simt as the prefix which I like very much more than llvm.gpu but the rename is probably going to take a moment. Turns out I do need to upda

[clang] [Clang] Implement Wpointer-bool-conversion-strict (PR #131523)

2025-03-17 Thread Yutong Zhu via cfe-commits
YutongZhuu wrote: > I can't for the life of me see a good way to use this. The `if(p)` pattern > is so common that no code base could ever turn on this warning. We could > PERHAPS check that we're in the process of checking a condition expression > and suppress this diagnostic, or recognize

[clang] [clang][modules] Fix filesystem races in `ModuleManager` (PR #131354)

2025-03-17 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/131354 >From 7945795843a81eb13b0febd752928bfcc3715eba Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 17 Mar 2025 08:11:52 -0700 Subject: [PATCH] [clang][modules] Fix filesystem races in `ModuleManager` The

[clang] [C2y] Add octal prefixes, deprecate unprefixed octals (PR #131626)

2025-03-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes WG14 N3353 added support for 0o and 0O as octal literal prefixes. It also deprecates use of octal literals without a prefix, except for the literal 0. This feature is being exposed as an extension in o

[clang] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

2025-03-17 Thread Nick Sarnie via cfe-commits
sarnex wrote: @arsenm Ping :) https://github.com/llvm/llvm-project/pull/126956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIRV] GPU intrinsics (PR #131190)

2025-03-17 Thread Michal Paszkowski via cfe-commits
@@ -0,0 +1,501 @@ +//===- LowerGPUIntrinsic.cpp --===// +// +// 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: Ap

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-17 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/129939 >From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 4 Mar 2025 09:53:56 -0800 Subject: [PATCH 01/14] extra scalar vector overloads for clamp --- .../lib/Headers/h

[clang] Improve the -Wundefined-func-template diagnostic note for invisible template functions (PR #129031)

2025-03-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/129031 >From 184a449456f82d26ca8ea253b7c3913df512c1a3 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 27 Feb 2025 11:15:09 +0100 Subject: [PATCH 1/5] Improve the -Wundefined-func-template diagnostic note for invis

<    1   2   3   4   5   6   >