[clang] [CIR] Upstream support for cir.get_global (PR #135095)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -200,6 +200,105 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd, } } +mlir::Operation *CIRGenModule::getGlobalValue(StringRef name) { + mlir::Operation *global = mlir::SymbolTable::lookupSymbolIn(theModule, name); + if (!global)

[clang] Treat ipynb as json (PR #135137)

2025-04-09 Thread Tim Clephas via cfe-commits
https://github.com/Timple created https://github.com/llvm/llvm-project/pull/135137 Fixes #110727 I do not have merge access on this repository. So please merge if approved. >From a924a68f906a14ee479b547658f6633328427ecd Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Thu, 10 Apr 2025 08:53:2

[clang] [Clang][P1061] Fix invalid pack binding crash (PR #135129)

2025-04-09 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/135129 >From 1597be864b8617a6e325590b742746572df0d78e Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Wed, 9 Apr 2025 21:31:00 -0700 Subject: [PATCH] [Clang][P1061] Fix invalid pack binding crash --- clang/include

[clang] [llvm] reduce max wrt divergent mask (PR #135138)

2025-04-09 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp llvm/lib

[clang] [llvm] reduce max wrt divergent mask (PR #135138)

2025-04-09 Thread Aniket Lal via cfe-commits
https://github.com/lalaniket8 created https://github.com/llvm/llvm-project/pull/135138 None >From 810ad9859bbcd66d6942e497c25bdde27978bf3c Mon Sep 17 00:00:00 2001 From: anikelal Date: Wed, 9 Apr 2025 11:24:21 +0530 Subject: [PATCH] reduce max wrt divergent mask --- clang/include/clang/Basic

[clang] Treat ipynb as json (PR #135137)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Tim Clephas (Timple) Changes Fixes #110727 I do not have merge access on this repository. So please merge if approved. --- Full diff: https://github.com/llvm/llvm-project/pull/135137.diff 1 Files Affected: - (modified) clang/lib

[clang] [llvm] reduce over divergent mask (PR #133228)

2025-04-09 Thread Aniket Lal via cfe-commits
https://github.com/lalaniket8 updated https://github.com/llvm/llvm-project/pull/133228 >From c8989dc07dec2af1ecc7e8fd07e422e760d3bfb6 Mon Sep 17 00:00:00 2001 From: anikelal Date: Tue, 8 Apr 2025 14:14:10 +0530 Subject: [PATCH] reduce wrt divergent mask --- clang/include/clang/Basic/BuiltinsA

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/2] Initialize resources by constructors - add resource record con

[clang] d1badf5 - [cfi][NFCI] Precommit tests to show nomerge functionality (#135104)

2025-04-09 Thread via cfe-commits
Author: Thurston Dang Date: 2025-04-09T19:46:59-07:00 New Revision: d1badf5635c5876a8c0b9558fe149ef0e293b865 URL: https://github.com/llvm/llvm-project/commit/d1badf5635c5876a8c0b9558fe149ef0e293b865 DIFF: https://github.com/llvm/llvm-project/commit/d1badf5635c5876a8c0b9558fe149ef0e293b865.diff

[clang] cuda clang: Add support for CUDA surfaces (PR #132883)

2025-04-09 Thread Artem Belevich via cfe-commits
Artem-B wrote: @AustinSchuh One thing I've missed during review is that the test clang/test/CodeGen/nvptx-surface.cu should probably go into clang/test/CodeGenCUDA This would also obviate the need for #134459. Can you send the patch to move the test to the right location? https://github.com

[clang] Revert "[Clang][CodeGen][UBSan] Add more precise attributes to recoverable ubsan handlers" (PR #135130)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yingwei Zheng (dtcxzyw) Changes Reverts llvm/llvm-project#130990 Breaks buildbot https://lab.llvm.org/buildbot/#/builders/186/builds/8072 --- Patch is 88.85 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-p

[clang] [Clang][P1061] Fix invalid pack binding crash (PR #135129)

2025-04-09 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf created https://github.com/llvm/llvm-project/pull/135129 Fixes #134882 Consider ``` struct foo { char a; int b; }; constexpr foo t{'a', 1}; constexpr auto [...m] = t; ``` Without the `constexpr` qualifier, the decomposition declaration just happens to not crash i

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

2025-04-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/135128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130734 >From 0f6ff605da3cbadc5311d4bf6c08fe98970a69c3 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 10 Apr 2025 09:54:33 +0800 Subject: [PATCH 1/3] [Clang][CodeGen] Do not set inbounds flag for struct GEP wi

[clang] [llvm] MCAsmStreamer: Replace the MCInstPrinter * parameter with unique_ptr (PR #135128)

2025-04-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/135128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes - Adds resource constructor that takes explicit binding for all resource classes. - Updates implementation of default resource constructor to initialize resource handle to `poison`. - Removes initialization o

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/3] Initialize resources by constructors - add resource record con

[clang] [clang][modules] Name the module map files on PCM file conflict (PR #134475)

2025-04-09 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida edited https://github.com/llvm/llvm-project/pull/134475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Do not set inbounds flag in `EmitMemberDataPointerAddress` when the base pointer is null (PR #130952)

2025-04-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130952 >From 0f6ff605da3cbadc5311d4bf6c08fe98970a69c3 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 10 Apr 2025 09:54:33 +0800 Subject: [PATCH 1/5] [Clang][CodeGen] Do not set inbounds flag for struct GEP wi

[clang] 98ea512 - [clang][bytecode] Clear inactive union fields when copying (#134982)

2025-04-09 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-10T06:12:00+02:00 New Revision: 98ea512f720ec954a6f096dbb39534f06affa196 URL: https://github.com/llvm/llvm-project/commit/98ea512f720ec954a6f096dbb39534f06affa196 DIFF: https://github.com/llvm/llvm-project/commit/98ea512f720ec954a6f096dbb39534f06affa196.diff L

[clang] [clang][bytecode] Clear inactive union fields when copying (PR #134982)

2025-04-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add support for modulo of floating point scalar and vectors (PR #135125)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Farzon Lotfi (farzonl) Changes fixes #135122 SemaExpr.cpp - Make all doubles fail. Add sema support for float scalars and vectors when language mode is HLSL. CGExprScalar.cpp - Allow emit frem when language mode is HLSL. --- Full

[clang] [HLSL] Add support for modulo of floating point scalar and vectors (PR #135125)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl @llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) Changes fixes #135122 SemaExpr.cpp - Make all doubles fail. Add sema support for float scalars and vectors when language mode is HLSL. CGExprScalar.cpp - Allow emit frem when language mode

[clang] [llvm] [IR] Mark convergence intrins as has-side-effect (PR #134844)

2025-04-09 Thread Sameer Sahasrabuddhe via cfe-commits
ssahasra wrote: To take this to its logical conclusion, when convergence tokens are in use, the `convergent` attribute is redundant. All we need is a `noconvergent` attribute for function declarations. A function definition is convergent iff the body contains a call to the `entry` intrinsic, a

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/134769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130734 >From 0f6ff605da3cbadc5311d4bf6c08fe98970a69c3 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 10 Apr 2025 09:54:33 +0800 Subject: [PATCH 1/2] [Clang][CodeGen] Do not set inbounds flag for struct GEP wi

[clang] [Clang][CodeGen][UBSan] Add more precise attributes to recoverable ubsan handlers (PR #130990)

2025-04-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/130990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0283bb3 - [Clang][CodeGen][UBSan] Add more precise attributes to recoverable ubsan handlers (#130990)

2025-04-09 Thread via cfe-commits
Author: Yingwei Zheng Date: 2025-04-10T11:09:45+08:00 New Revision: 0283bb3afcc5dc521f6b2e7d541a830a9546ed80 URL: https://github.com/llvm/llvm-project/commit/0283bb3afcc5dc521f6b2e7d541a830a9546ed80 DIFF: https://github.com/llvm/llvm-project/commit/0283bb3afcc5dc521f6b2e7d541a830a9546ed80.diff

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-04-09 Thread Jorge Gorbe Moya via cfe-commits
slackito wrote: > @slackito this will be fixed here: #135111 Thanks for the quick fix! https://github.com/llvm/llvm-project/pull/133610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
@@ -1959,6 +1964,52 @@ the configuration (without a prefix: ``Auto``). }; void f() { bar(); } + Also can be specified as a nested configuration flag: + + .. code-block:: c++ + +# Example of usage: +AllowShortFunctionsOnASingleLine: InlineOnly + +# or

[clang] [cfi][NFCI] Precommit tests to show nomerge functionality (PR #135104)

2025-04-09 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/135104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
@@ -1959,6 +1964,52 @@ the configuration (without a prefix: ``Auto``). }; void f() { bar(); } + Also can be specified as a nested configuration flag: + + .. code-block:: c++ + +# Example of usage: +AllowShortFunctionsOnASingleLine: InlineOnly + +# or

[clang] [cfi][NFCI] Precommit tests to show nomerge functionality (PR #135104)

2025-04-09 Thread Thurston Dang via cfe-commits
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/135104 https://github.com/llvm/llvm-project/pull/120464 (and earlier CLs) added -fsanitize-merge functionality, which is intended to work for all "sanitizers". It is nearly correct for CFI. This patch precommits so

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/135111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/135120 - Adds resource constructor that takes explicit binding for all resource classes. - Updates implementation of default resource constructor to initialize resource handle to `poison`. - Removes initialization of r

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
https://github.com/irymarchyk edited https://github.com/llvm/llvm-project/pull/134337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
https://github.com/irymarchyk edited https://github.com/llvm/llvm-project/pull/134337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
@@ -611,20 +611,40 @@ TEST(ConfigParseTest, ParsesConfiguration) { CHECK_PARSE("AllowShortBlocksOnASingleLine: true", AllowShortBlocksOnASingleLine, FormatStyle::SBS_Always); - Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; + // Style.Allow

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-09 Thread via cfe-commits
@@ -5687,11 +5687,11 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && !Left.Children.empty()) { // Support AllowShortFunctionsOnASingleLine for JavaScript. - return Style.AllowShort

[clang] [clang-tools-extra] [clang] Improved canonicalization for template specialization types (PR #135119)

2025-04-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135119 >From 03801aef9b4f950940d33276095c14047da0a3e6 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] [clang] Improved canonicalization for template specialization

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A little more testing on comma would be nice, else seems reasonable. https://github.com/llvm/llvm-project/pull/135115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang-tools-extra] [clang] Improved canonicalization for template specialization types (PR #135119)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Matheus Izvekov (mizvekov) Changes This changes the TemplateArgument representation to hold a flag indicating whether a template argument of expression type is supposed to be canonical or not. This gets one step closer to solving

[clang] [clang-tools-extra] [clang] Improved canonicalization for template specialization types (PR #135119)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clangd Author: Matheus Izvekov (mizvekov) Changes This changes the TemplateArgument representation to hold a flag indicating whether a template argument of expression type is supposed to be canonical or not. This gets one st

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

[clang] 98feb05 - [clang] fix unresolved dependent template specialization mangling (#135111)

2025-04-09 Thread via cfe-commits
Author: Matheus Izvekov Date: 2025-04-09T23:23:52-03:00 New Revision: 98feb05825a179c56f965d936b948a95d2a6b888 URL: https://github.com/llvm/llvm-project/commit/98feb05825a179c56f965d936b948a95d2a6b888 DIFF: https://github.com/llvm/llvm-project/commit/98feb05825a179c56f965d936b948a95d2a6b888.dif

[clang] [clang-tools-extra] [clang] Improved canonicalization for template specialization types (PR #135119)

2025-04-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135119 This changes the TemplateArgument representation to hold a flag indicating whether a template argument of expression type is supposed to be canonical or not. This gets one step closer to solving https://gith

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread via cfe-commits
llvmbot wrote: /pull-request llvm/llvm-project#135118 https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick f34483838937b1a01ee11ee22bdd6e13c81e9fff https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -807,6 +808,65 @@ class ScalarExprEmitter : public StmtVisitor { VISITCOMP(EQ) VISITCOMP(NE) #undef VISITCOMP + + mlir::Value VisitBinAssign(const BinaryOperator *e) { +const bool ignore = std::exchange(ignoreResultAssign, false); + +mlir::Value rhs; +LValu

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

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

[clang-tools-extra] e10f67a - [clang-doc][NFC] refactor out file helpers (#134298)

2025-04-09 Thread via cfe-commits
Author: PeterChou1 Date: 2025-04-09T17:21:28-04:00 New Revision: e10f67a8270c7745b8a9306a9910b06cfc8d2c55 URL: https://github.com/llvm/llvm-project/commit/e10f67a8270c7745b8a9306a9910b06cfc8d2c55 DIFF: https://github.com/llvm/llvm-project/commit/e10f67a8270c7745b8a9306a9910b06cfc8d2c55.diff LO

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca demilestoned https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Morris Hafner (mmha) Changes This patch adds `VisitBinAssign` and `VisitBinComma` to the ClangIR `ScalarExprEmitter` to enable assignments and the comma operator. --- Full diff: https://github.com/llvm/llvm-project/pull/135115.diff 8 Fi

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread Morris Hafner via cfe-commits
mmha wrote: cc @erichkeane @andykaylor @dkolsen-pgi https://github.com/llvm/llvm-project/pull/135115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-09 Thread Yingwei Zheng via cfe-commits
@@ -42,6 +42,11 @@ Potentially Breaking Changes C/C++ Language Potentially Breaking Changes --- +- Some old-style offsetof idioms like ``((int)(&(((struct S *)0)->field)))`` are treated dtcxzyw wrote: Fixed. https://g

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-09 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Rebased on the top of https://github.com/llvm/llvm-project/pull/134269 and https://github.com/llvm/llvm-project/pull/134221 https://github.com/llvm/llvm-project/pull/130734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-09 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/135115 This patch adds `VisitBinAssign` and `VisitBinComma` to the ClangIR `ScalarExprEmitter` to enable assignments and the comma operator. >From bcaeadf7fff01d2d92b0d234b40f8d5884974e4c Mon Sep 17 00:00:00 2001 From: Mo

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130734 >From 0f6ff605da3cbadc5311d4bf6c08fe98970a69c3 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 10 Apr 2025 09:54:33 +0800 Subject: [PATCH] [Clang][CodeGen] Do not set inbounds flag for struct GEP with n

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-09 Thread Dan Liew via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. https://github.com/llvm/llvm-project/pull/135111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-09 Thread Matheus Izvekov via cfe-commits
@@ -143,8 +143,8 @@ def note_constexpr_null_subobject : Note< "access array element of|perform pointer arithmetic on|" "access real component of|" "access imaginary component of}0 null pointer">; -def note_constexpr_null_callee : Note< - "'%0' evaluates to a null functio

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread Sam Elliott via cfe-commits
@@ -940,6 +947,14 @@ struct RISCVOperand final : public MCParsedAsmOperand { [](int64_t Imm) { return Imm != INT64_MIN && isInt<5>(Imm - 1); }); } + bool isSImm18() const { return isBareSimmNLsbK<18, 0>(); } + + bool isSImm18Lsb0() const { return isBareSimmNLsb0<18

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-09 Thread Dan Liew via cfe-commits
delcypher wrote: @Sirraide Apologies for taking so long to get back to this PR. I think I've addressed all your feedback now. Is this ok to land now? https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-09 Thread Matheus Izvekov via cfe-commits
@@ -18,19 +18,19 @@ int D = 1; #pragma data_seg(".data") int a = 1; extern const Mutable mutable_custom_section; -const Mutable mutable_custom_section; // expected-warning {{`#pragma const_seg` for section ".my_const" will not apply to 'mutable_custom_section' due to the pres

[clang] [clang] Track final substitution for Subst* AST nodes (PR #132748)

2025-04-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @pranavk this test case is fixed by the same fix as for the first mangling issue: https://github.com/llvm/llvm-project/pull/135111 https://github.com/llvm/llvm-project/pull/132748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 747d4a9 - [DirectX] Implement UseNativeLowPrecision shader flag analysis (#134288)

2025-04-09 Thread via cfe-commits
Author: Deric C. Date: 2025-04-09T18:14:23-07:00 New Revision: 747d4a952bf7ed4adec72ddf3c9038aeff4fe8ee URL: https://github.com/llvm/llvm-project/commit/747d4a952bf7ed4adec72ddf3c9038aeff4fe8ee DIFF: https://github.com/llvm/llvm-project/commit/747d4a952bf7ed4adec72ddf3c9038aeff4fe8ee.diff LOG:

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,116 @@ +//===--===// +// +// 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] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread Sam Elliott via cfe-commits
@@ -535,21 +540,29 @@ RISCVMCCodeEmitter::getImmOpValueSlist(const MCInst &MI, unsigned OpNo, } } -uint64_t -RISCVMCCodeEmitter::getImmOpValueAsr1(const MCInst &MI, unsigned OpNo, +template +unsigned +RISCVMCCodeEmitter::getImmOpValueAsrN(const MCInst &MI, unsigned OpNo,

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/135111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This fixes a regression introduced in https://github.com/llvm/llvm-project/pull/133610#issuecomment-2787332042 which was reported here https://github.com/llvm/llvm-project/pull/133610#issuecomment-278733

[clang] [sanitizer] Apply AlwaysIn/Out in parseSanitizeArgs (PR #129405)

2025-04-09 Thread Thurston Dang via cfe-commits
thurstond wrote: > Maybe wait a month or so with landing, in case vptr backfire. @vitalybuka Any last objections to landing? https://github.com/llvm/llvm-project/pull/129405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135111 This fixes a regression introduced in https://github.com/llvm/llvm-project/pull/133610#issuecomment-2787332042 which was reported here https://github.com/llvm/llvm-project/pull/133610#issuecomment-2787332042

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-09 Thread Deric C. via cfe-commits
https://github.com/Icohedron closed https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-09 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-04-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @slackito this will be fixed here: https://github.com/llvm/llvm-project/pull/135111 https://github.com/llvm/llvm-project/pull/133610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-09 Thread Dan Liew via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2025-04-09 Thread John McCall via cfe-commits
@@ -0,0 +1,142 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s +// RUN: %clang_cc1 -triple aarch64-linux-gnu -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s + +#define AQ __ptrauth

[clang] f344838 - [clang-format] Keep the space between `not` and a unary operator (#135035)

2025-04-09 Thread via cfe-commits
Author: Owen Pan Date: 2025-04-09T17:52:12-07:00 New Revision: f34483838937b1a01ee11ee22bdd6e13c81e9fff URL: https://github.com/llvm/llvm-project/commit/f34483838937b1a01ee11ee22bdd6e13c81e9fff DIFF: https://github.com/llvm/llvm-project/commit/f34483838937b1a01ee11ee22bdd6e13c81e9fff.diff LOG:

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Jim Lin (tclin914) Changes The spec can be found at: https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release. This patch only supports assembler. Relocation and fixup for the branch and gp-implied instructions wil

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mc Author: Jim Lin (tclin914) Changes The spec can be found at: https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release. This patch only supports assembler. Relocation and fixup for the branch and gp-implied instructions will be added

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread Jim Lin via cfe-commits
https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/135110 The spec can be found at: https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release. This patch only supports assembler. Relocation and fixup for the branch and gp-implied instructions will be

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -400,13 +400,126 @@ def VoidPtr : Type< "cir::VoidType::get($_builder.getContext()))"> { } +//===--===// +// StructType +// +// The base type for all RecordDecls. +//===---

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -86,10 +86,80 @@ mlir::Type CIRGenTypes::convertFunctionTypeInternal(QualType qft) { return cir::FuncType::get(SmallVector{}, cgm.VoidTy); } +// This is CIR's version of CodeGenTypes::addRecordTypeName. It isn't shareable +// because CIR has different uniquing requiremen

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -86,10 +86,80 @@ mlir::Type CIRGenTypes::convertFunctionTypeInternal(QualType qft) { return cir::FuncType::get(SmallVector{}, cgm.VoidTy); } +// This is CIR's version of CodeGenTypes::addRecordTypeName. It isn't shareable +// because CIR has different uniquing requiremen

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,116 @@ +//===--===// +// +// 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] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread via cfe-commits
llvmbot wrote: >/cherry-pick f34483838937b1a01ee11ee22bdd6e13c81e9fff Error: Command failed due to missing milestone. https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick f34483838937b1a01ee11ee22bdd6e13c81e9fff https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: cir-opt %s | FileCheck %s + +!s32i = !cir.int erichkeane wrote: what is this doing? I dont really see it in the check or definition lines. https://github.com/llvm/llvm-project/pull/135105 ___

[clang] [llvm] [HLSL][SPIR-V] Add hlsl_private address space for SPIR-V (PR #133464)

2025-04-09 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/133464 From 12524667594d413c93a2c88a206a930cff638da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Thu, 28 Nov 2024 15:00:56 +0100 Subject: [PATCH 1/5] [SPIR-V] Add hlsl_private address space for

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -37,6 +50,32 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("Unsupported format for long double"); } + /// Get a CIR record kind from a AST declaration tag. + cir::StructType::RecordKind getRecordKind(const clang::TagTypeKind kind) { +

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Keep the space between `not` and a unary operator (PR #135035)

2025-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/135035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make enums trivially equality comparable (PR #133587)

2025-04-09 Thread Shafik Yaghmour via cfe-commits
@@ -5240,9 +5249,13 @@ static bool HasNonDeletedDefaultedEqualityComparison(Sema &S, static bool isTriviallyEqualityComparableType(Sema &S, QualType Type, SourceLocation KeyLoc) { QualType CanonicalType = Type.getCanonicalType(); if (CanonicalType->isIncompleteType() || C

[clang] 75cbb1f - [clang-format][NFC] Add FormatToken::is(tok::ObjCKeywordKind) (#134973)

2025-04-09 Thread via cfe-commits
Author: Owen Pan Date: 2025-04-09T17:49:26-07:00 New Revision: 75cbb1f0fa734efb79c1a1233f1aba377dfad9e1 URL: https://github.com/llvm/llvm-project/commit/75cbb1f0fa734efb79c1a1233f1aba377dfad9e1 DIFF: https://github.com/llvm/llvm-project/commit/75cbb1f0fa734efb79c1a1233f1aba377dfad9e1.diff LOG:

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -37,6 +50,32 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("Unsupported format for long double"); } + /// Get a CIR record kind from a AST declaration tag. + cir::StructType::RecordKind getRecordKind(const clang::TagTypeKind kind) { +

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -86,10 +86,80 @@ mlir::Type CIRGenTypes::convertFunctionTypeInternal(QualType qft) { return cir::FuncType::get(SmallVector{}, cgm.VoidTy); } +// This is CIR's version of CodeGenTypes::addRecordTypeName. It isn't shareable +// because CIR has different uniquing requiremen

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll +// RUN: FileCheck --chec

  1   2   3   4   5   >