[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/144420 Adds support for trivial relocation of polymorphic objects with address discriminated vtable pointers. This is implemented as a post-memmove fixup pass over the impacted objects. We do this by traversing the ob

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
@@ -1442,6 +1442,10 @@ class ASTReader const StringRef &operator*() && = delete; }; + /// VarDecls with initializers containing side effects must be emitted, + /// but DeclMustBeEmitted is not allowed to deserialize the intializer. + llvm::SmallPtrSet InitSideEffectVa

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oliver Hunt (ojhunt) Changes Adds support for trivial relocation of polymorphic objects with address discriminated vtable pointers. This is implemented as a post-memmove fixup pass over the impacted objects. We do this by traversing the

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 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/StaticAnalyzer/Checkers/MallocChecker.cpp

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/144341 >From 44fe99cfc6ab394ba94301b94323be87f98c06dd Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Fri, 13 Jun 2025 17:43:57 +0200 Subject: [PATCH 1/2] [analyzer] Fix a false memory leak report involving pl

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -4495,6 +4495,98 @@ CINDEX_LINKAGE CXStringSet *clang_Cursor_getCXXManglings(CXCursor); */ CINDEX_LINKAGE CXStringSet *clang_Cursor_getObjCManglings(CXCursor); +/** + * @} + */ + +/** + * \defgroup CINDEX_MODULE Inline Assembly introspection + * + * The functions in this

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -4495,6 +4495,98 @@ CINDEX_LINKAGE CXStringSet *clang_Cursor_getCXXManglings(CXCursor); */ CINDEX_LINKAGE CXStringSet *clang_Cursor_getObjCManglings(CXCursor); +/** + * @} + */ + +/** + * \defgroup CINDEX_MODULE Inline Assembly introspection + * + * The functions in this

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -8648,6 +8646,119 @@ void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, } } +//===--===// +// Operations for querying information of a GCC inline assembly block under a +// cursor. +//===--

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thanks for working on this! Mostly just nits, the implementation itself looks pretty reasonable so far. Please be sure to add a release note to `clang/docs/ReleaseNotes.rst` so users know about the new functionality. https://github.com/llvm/llvm-proj

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/143424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -4495,6 +4495,98 @@ CINDEX_LINKAGE CXStringSet *clang_Cursor_getCXXManglings(CXCursor); */ CINDEX_LINKAGE CXStringSet *clang_Cursor_getObjCManglings(CXCursor); +/** + * @} + */ + +/** + * \defgroup CINDEX_MODULE Inline Assembly introspection + * + * The functions in this

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -8648,6 +8646,119 @@ void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, } } +//===--===// +// Operations for querying information of a GCC inline assembly block under a +// cursor. +//===--

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -8648,6 +8646,119 @@ void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, } } +//===--===// +// Operations for querying information of a GCC inline assembly block under a +// cursor. +//===--

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-16 Thread Aaron Ballman via cfe-commits
@@ -8648,6 +8646,119 @@ void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, } } +//===--===// +// Operations for querying information of a GCC inline assembly block under a +// cursor. +//===--

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 Thread Balázs Benics via cfe-commits
@@ -63,6 +64,42 @@ void testGlobalNoThrowPlacementExprNewBeforeOverload() { int *p = new(std::nothrow) int; } // leak-warning{{Potential leak of memory pointed to by 'p'}} +//- Standard pointer placement operators +void testGlobalPointerPlacementNew() { + int i; + void

[clang] [clang] Check constexpr int->enum conversions consistently. (PR #143034)

2025-06-16 Thread via cfe-commits
eaeltsin wrote: Sorry, I over-generalized :) Here is the proper sample: ``` template< typename T, T N > struct IC { static const T next_value = static_cast(N + 1); typedef IC< T, next_value > next; }; enum E { integral_to_integral, integral_to_float, float_to_integral, float_to_floa

[clang] [clang][bytecode] Allocate IntegralAP and Floating types using an allocator (PR #144246)

2025-06-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/144246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to override pure virtuals (PR #139348)

2025-06-16 Thread Marco Maia via cfe-commits
https://github.com/marcogmaia updated https://github.com/llvm/llvm-project/pull/139348 >From 76503bd8f5618b710e2909d1303de5d34723 Mon Sep 17 00:00:00 2001 From: Marco Maia Date: Sat, 10 May 2025 00:48:39 -0300 Subject: [PATCH 01/13] [clangd] Add tweak to add pure virtual overrides --- ...

[clang] [clang][Sema] Fixed Compound Literal is not Constant Expression (PR #143852)

2025-06-16 Thread via cfe-commits
https://github.com/Mr-Anyone updated https://github.com/llvm/llvm-project/pull/143852 >From 76a34f3e55eed586e63d21e7c45137cb33f94530 Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 12 Jun 2025 16:03:58 +0800 Subject: [PATCH 1/2] [clang][Sema] Fixed Compound Literal is not Constant Expression

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/144341 >From 44fe99cfc6ab394ba94301b94323be87f98c06dd Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Fri, 13 Jun 2025 17:43:57 +0200 Subject: [PATCH 1/3] [analyzer] Fix a false memory leak report involving pl

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -1371,6 +1371,19 @@ void MallocChecker::checkIfFreeNameIndex(ProgramStateRef State, C.addTransition(State); } +bool isVoidStar(QualType T) { + return !T.isNull() && T->isPointerType() && T->getPointeeType()->isVoidType(); necto wrote: Indeed, thanks!

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-06-16 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,120 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. + +## Implementation + +See the [LLVM docs](../../llvm/docs/KeyInst

[clang] [Clang][Sema] Reject invalid member using-declaration whose nested-name-specifier doesn't refer to a base class of the current class in C++98 mode (PR #143492)

2025-06-16 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/143492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] remove dead loads, such as memcpy from undef (PR #143958)

2025-06-16 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,63 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -passes='instcombine' -S | FileCheck %s + +; This is a fuzzer-generated test that would assert because +; we'd get into foldAndOfICmps() without running InstSimplify +; on

[clang] [llvm] [InstCombine] remove dead loads, such as memcpy from undef (PR #143958)

2025-06-16 Thread Nikita Popov via cfe-commits
@@ -3382,6 +3418,17 @@ Instruction *InstCombinerImpl::visitAllocSite(Instruction &MI) { eraseInstFromFunction(*I); Users[i] = nullptr; // Skip examining in the next loop. } +if (auto *MTI = dyn_cast(I)) { + if (KnowInitZero && getUn

[clang] [clang][Parser] Fix crash on malformed using declaration in constexpr function (PR #144286)

2025-06-16 Thread Iris Shi via cfe-commits
https://github.com/el-ev edited https://github.com/llvm/llvm-project/pull/144286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Parser] Fix crash on invalid attribute in constexpr function (PR #144286)

2025-06-16 Thread Iris Shi via cfe-commits
https://github.com/el-ev updated https://github.com/llvm/llvm-project/pull/144286 >From 6e10acb31f5975aad222bf211bcd61976a1c5108 Mon Sep 17 00:00:00 2001 From: Iris Shi <0...@owo.li> Date: Mon, 16 Jun 2025 09:37:17 +0800 Subject: [PATCH] [clang][Parser] Fix crash on malformed using declaration i

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-16 Thread Nathan Gauër via cfe-commits
@@ -12919,6 +12919,18 @@ def err_spirv_enum_not_int : Error< def err_spirv_enum_not_valid : Error< "invalid value for %select{storage class}0 argument">; +def err_specialization_const_lit_init +: Error<"variable with 'vk::constant_id' attribute cannot have an " +

[clang] [clang][Parser] Fix crash on malformed using declaration in constexpr function (PR #144286)

2025-06-16 Thread Iris Shi via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// issue144264 +constexpr void test() +{ +using TT = struct T[deprecated{}; el-ev wrote: Updated, thanks! https://github.com/llvm/llvm-project/pull/144286

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-16 Thread via cfe-commits
https://github.com/someoneinjd updated https://github.com/llvm/llvm-project/pull/142903 >From 02a1c469ce7a546b6c9fe3b452f69ec737cd1406 Mon Sep 17 00:00:00 2001 From: someoneinjd Date: Thu, 5 Jun 2025 13:51:40 +0800 Subject: [PATCH] [clangd] Implement LSP 3.17 positionEncoding --- clang-tools-

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-16 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Thanks for the fix @kiranchandramohan. I didn't spot the issue with `llvm-profdata` https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-16 Thread via cfe-commits
@@ -497,6 +497,12 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R, if (auto Cancel = StaleRequestSupport->getBoolean("cancel")) R.CancelsStaleRequests = *Cancel; } +if (auto *OffsetEncoding = General->get("positionEncodings")) { +

[clang-tools-extra] [clangd] Implement LSP 3.17 positionEncoding (PR #142903)

2025-06-16 Thread via cfe-commits
https://github.com/someoneinjd updated https://github.com/llvm/llvm-project/pull/142903 >From 04587058be104dbb8059527ef97dcc602cf739f7 Mon Sep 17 00:00:00 2001 From: someoneinjd Date: Thu, 5 Jun 2025 13:51:40 +0800 Subject: [PATCH] [clangd] Implement LSP 3.17 positionEncoding --- clang-tools-

[clang-tools-extra] [clang-reorder-fields] Prevent rewriting unsupported cases (PR #142149)

2025-06-16 Thread Vladimir Vuksanovic via cfe-commits
https://github.com/vvuksanovic updated https://github.com/llvm/llvm-project/pull/142149 >From b8481a36b33e71248170c8cc195b45fa9de4f777 Mon Sep 17 00:00:00 2001 From: Vladimir Vuksanovic Date: Fri, 30 May 2025 05:42:55 -0700 Subject: [PATCH 1/2] [clang-reorder-fields] Prevent rewriting unsupport

[clang-tools-extra] [clang-reorder-fields] Prevent rewriting unsupported cases (PR #142149)

2025-06-16 Thread Vladimir Vuksanovic via cfe-commits
@@ -0,0 +1,15 @@ +// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order y,x %s -- | FileCheck %s + +namespace bar { + +#define DEFINE_FIELDS + +// This is okay to reorder. +struct Foo { +#ifdef DEFINE_FIELDS // CHECK: {{^#ifdef DEFINE_FIELDS}} + int y;

[clang] [Driver] Add options to control workaround for Cortex-A53 Erratum 843419 (PR #143915)

2025-06-16 Thread Bryan Chan via cfe-commits
https://github.com/bryanpkc updated https://github.com/llvm/llvm-project/pull/143915 >From 6e55f9af33afd33d87ab2629bf1b5df7d21a09d0 Mon Sep 17 00:00:00 2001 From: Bryan Chan Date: Thu, 12 Jun 2025 11:09:43 -0400 Subject: [PATCH] [Driver] Add options to control workaround for Cortex-A53 Erratum

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Amr Hesham via cfe-commits
@@ -176,3 +176,27 @@ void foo7() { // OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4 // OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4 +void foo9(double r, double i) { + double _Complex c = __builtin_complex(r, i); AmrDeveloper wrote

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2025-06-16 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH 01/19] [clang-tidy] Add bugprone-move-shared-pointer-contents chec

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2025-06-16 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH 01/18] [clang-tidy] Add bugprone-move-shared-pointer-contents chec

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-16 Thread via cfe-commits
https://github.com/sivadeilra updated https://github.com/llvm/llvm-project/pull/138972 >From a971e0f2df99bd701b4b2f73ee28ee9b36f8a73f Mon Sep 17 00:00:00 2001 From: Arlie Davis Date: Thu, 3 Apr 2025 16:10:50 -0700 Subject: [PATCH] Windows hotpatching support --- clang/include/clang/Basic/Code

[clang] f83d09a - Revert "[RISCV] Remove B and Zbc extension from Andes series cpus." (#144402)

2025-06-16 Thread via cfe-commits
Author: Aaron Ballman Date: 2025-06-16T14:53:15-04:00 New Revision: f83d09a1f60aee28a8ed9020cd72971ec2885f24 URL: https://github.com/llvm/llvm-project/commit/f83d09a1f60aee28a8ed9020cd72971ec2885f24 DIFF: https://github.com/llvm/llvm-project/commit/f83d09a1f60aee28a8ed9020cd72971ec2885f24.diff

[clang] [llvm] Revert "[RISCV] Remove B and Zbc extension from Andes series cpus." (PR #144402)

2025-06-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/144402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [openmp] [clang][OpenMP] New OpenMP 6.0 threadset clause (PR #135807)

2025-06-16 Thread via cfe-commits
@@ -364,7 +364,7 @@ implementation. +=+===+===+==+ | free-agent threads

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-06-16 Thread Ben Dunkin via cfe-commits
bdunkin wrote: I will gladly add a new option, if that is deemed necessary. I just want to make sure that's the direction I should go. My experience has been it is very hard to take back an option once it has been released, so they should be added deliberately, and with careful consideration.

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread via cfe-commits
https://github.com/schittir edited https://github.com/llvm/llvm-project/pull/140282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ComplexRealPtrOp for ComplexType (PR #144235)

2025-06-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/144235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ComplexRealPtrOp for ComplexType (PR #144235)

2025-06-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: I have concerns about the CIR representation here. I think we should be aligning our representation of complex operations with the MLIR complex dialect. As such, we want `__real__` to be lowerable to `complex.re` but the explicit representation of inter

[clang] [KeyInstr][Clang] Ctor memcpy-able members init source atom (PR #144346)

2025-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-debuginfo Author: Orlando Cazalet-Hyams (OCHyams) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/144346.diff 3 Files Affected: - (modified) clang/lib/CodeGen/CGClass.cpp (+4-1) - (added) clang/test/DebugInfo/KeyInstructions/init-m

[clang] [KeyInstr][Clang] Ctor memcpy-able members init source atom (PR #144346)

2025-06-16 Thread Orlando Cazalet-Hyams via cfe-commits
https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/144346 None >From 99c40d7c7eeaf8f1a58b7223491abe0e4ad9936a Mon Sep 17 00:00:00 2001 From: Orlando Cazalet-Hyams Date: Mon, 16 Jun 2025 12:07:08 +0100 Subject: [PATCH 1/2] [KeyInstr][Clang] Memcopyable members init - s

[clang] [clang][Sema] Fixed Compound Literal is not Constant Expression (PR #143852)

2025-06-16 Thread via cfe-commits
@@ -7219,6 +7219,17 @@ Sema::ActOnCompoundLiteral(SourceLocation LParenLoc, ParsedType Ty, return BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc, InitExpr); } +static bool IsInsideFunction(Scope *S) { Mr-Anyone wrote: I do see people using this from

[clang] [clang][Sema] Fixed Compound Literal is not Constant Expression (PR #143852)

2025-06-16 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 c,h,cpp -- clang/test/Sema/gh87867.c clang/include/clang/Sem

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -1621,6 +1621,13 @@ def DeviceKernel : DeclOrTypeAttr { }]; } +def SYCLExternal : InheritableAttr { + let Spellings = [Clang<"sycl_external">]; + let Subjects = SubjectList<[Function]>; tahonermann wrote: Error diagnostics are explicitly requested for ma

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s + +// Semantic tests for sycl_external attribute + +[[clang::sycl_external(3)]] // expected-error {{'sycl_external' attribute takes no arguments}} +void bar() {} tahonermann wrote: Th

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -476,6 +476,31 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLExternalDocs : Documentation { + let Category = DocCatFunction; + let Heading = "sycl_external"; + let Content = [{ +The ``sycl_external`` attribute can only be appl

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/140282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s + +// Semantic tests for sycl_external attribute + +[[clang::sycl_external(3)]] // expected-error {{'sycl_external' attribute takes no arguments}} +void bar() {} + +[[clang::sycl_external]] // expected

[clang] [clang][Sema] Fixed Compound Literal is not Constant Expression (PR #143852)

2025-06-16 Thread via cfe-commits
https://github.com/Mr-Anyone updated https://github.com/llvm/llvm-project/pull/143852 >From 76a34f3e55eed586e63d21e7c45137cb33f94530 Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 12 Jun 2025 16:03:58 +0800 Subject: [PATCH 1/2] [clang][Sema] Fixed Compound Literal is not Constant Expression

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -202,6 +202,17 @@ void SemaSYCL::handleKernelAttr(Decl *D, const ParsedAttr &AL) { handleSimpleAttribute(*this, D, AL); } +void SemaSYCL::handleExternalAttr(Decl *D, const ParsedAttr &AL) { + auto *ND = cast(D); + if (!ND->isExternallyVisible()) { +Diag(AL.getLoc()

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -1,128 +1,128 @@ // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s void bar(int &Data) {} -// CHECK: define dso_local void @[[RAW_REF:[a-zA-Z0-9_]+]](ptr noundef nonnull align 4 dereferenceable(4) % +// CHEC

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -12851,6 +12851,10 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +//SYCL external attribute diagnostics tahonermann wrote: ```suggestion // SYC

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -202,6 +202,17 @@ void SemaSYCL::handleKernelAttr(Decl *D, const ParsedAttr &AL) { handleSimpleAttribute(*this, D, AL); } +void SemaSYCL::handleExternalAttr(Decl *D, const ParsedAttr &AL) { + auto *ND = cast(D); + if (!ND->isExternallyVisible()) { taho

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s + +// expected-warning@+1{{'sycl_external' attribute only applies to functions}} +[[clang::sycl_external]] int a; + + +// expected-warning@+2{{'sycl_external' attribute only applies to functions}} +stru

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -476,6 +476,31 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLExternalDocs : Documentation { + let Category = DocCatFunction; + let Heading = "sycl_external"; + let Content = [{ +The ``sycl_external`` attribute can only be appl

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann requested changes to this pull request. Thanks @schittir, here are my initial review comments. I expect to review the newly added tests more closely once these comments are all addressed. https://github.com/llvm/llvm-project/pull/140282 ___

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-16 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// expected-warning@+1{{'sycl_external' attribute ignored}} +[[clang::sycl_external]] void bar() {} + +// expected-warning@+1{{'sycl_external' attribute ignored}} +[[clang::sycl_external]] int a; tah

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143544 >From 954a86f3c8da88c4ac276231a40cd88e6f628253 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 30 May 2025 12:32:21 -0400 Subject: [PATCH 1/7] [HLSL][SPIRV] Add vk::constant_id attribute. The vk::const

[clang] [analyzer] Fix a false memory leak reports involving placement new (PR #144341)

2025-06-16 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, nice little patch :smile: https://github.com/llvm/llvm-project/pull/144341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-16 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > Thank you! But before accepting the merge, does this mean that we discard > everything that i said about refactoring these variables and just keep it as > it is in both reviews @alexey-bataev ? Also, could you @Meinersbur specify > what exactly do you mean with a regression

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-16 Thread Balázs Benics via cfe-commits
balazs-benics-sonarsource wrote: > Unfortunately I'm not convinced that this is the right direction for > improving the analyzer runtime. > > On the "risks" side I think that adding the corner case that "this may also > return `UnknownVal` in rare situations" into many functions complicates th

[clang] [CIR] Upstream ComplexType ImaginaryLiteral (PR #144223)

2025-06-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good, with request for additional test case https://github.com/llvm/llvm-project/pull/144223 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [CIR] Upstream ComplexType ImaginaryLiteral (PR #144223)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -176,3 +176,17 @@ void foo7() { // OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4 // OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4 +void foo8() { andykaylor wrote: Can you add a test case for integer types? https://github.com/ll

[clang] [CIR] Upstream ComplexType ImaginaryLiteral (PR #144223)

2025-06-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/144223 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [DebugInfo][RemoveDIs] Suppress getNextNonDebugInfoInstruction (PR #144383)

2025-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Jeremy Morse (jmorse) Changes There are no longer debug-info instructions, thus we don't need this skipping. Horray! CC @WenleiHe , `getNextNonDebugInfoInstruction` has a "skip pseudo-probes" argument that appears to be unused thro

[clang] [libc] [llvm] [DebugInfo][RemoveDIs] Suppress getNextNonDebugInfoInstruction (PR #144383)

2025-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Jeremy Morse (jmorse) Changes There are no longer debug-info instructions, thus we don't need this skipping. Horray! CC @WenleiHe , `getNextNonDebugInfoInstruction` has a "skip pseudo-probes" argument that appears to be unused th

[clang] [clang] Check constexpr int->enum conversions consistently. (PR #143034)

2025-06-16 Thread Lei Wang via cfe-commits
wlei-llvm wrote: > > Internally, we discovered that this patch breaks Boost as used by MySQL. I > > don't have a full external reproducer at the moment and I don't know > > whether the code is valid or not, but I wanted to give a heads up that we > > may need to revisit this. This seems like t

[clang] [llvm] [llvm] minor fixes for clang-cl Windows DLL build (PR #144386)

2025-06-16 Thread Andrew Rogers via cfe-commits
https://github.com/andrurogerz created https://github.com/llvm/llvm-project/pull/144386 ## Purpose This patch makes a minor changes to LLVM and Clang so that LLVM can be built as a Windows DLL with `clang-cl`. These changes were not required for building a Windows DLL with MSVC. ## Backgroun

[clang] [llvm] [AArch64][VecLib] Add libmvec support for AArch64 targets (PR #143696)

2025-06-16 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm approved this pull request. The documentation build failure has been verified locally as an existing upstream issue and not the fault of this PR. https://github.com/llvm/llvm-project/pull/143696 ___ cfe-commits mailin

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -176,3 +176,27 @@ void foo7() { // OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4 // OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4 +void foo9(double r, double i) { andykaylor wrote: ```suggestion void foo9(double a, double b) { `

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -50,6 +50,14 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, } mlir::Location loc = getLoc(e->getExprLoc()); - cgm.errorNYI(loc, "non constant foldable builtin calls"); + switch (builtinID) { + case Builtin::BI__builtin_complex: {

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -176,3 +176,27 @@ void foo7() { // OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4 // OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4 +void foo9(double r, double i) { + double _Complex c = __builtin_complex(r, i); andykaylor wrote:

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -32,6 +46,16 @@ static const ComplexType *getComplexType(QualType type) { return cast(cast(type)->getValueType()); } +mlir::Value ComplexExprEmitter::emitLoadOfLValue(LValue lv, + SourceLocation loc) { + assert(lv.isSimple(

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -96,6 +96,7 @@ class RValue { er.isVolatile = false; return er; } + andykaylor wrote: Not needed in this PR https://github.com/llvm/llvm-project/pull/144225 ___ cfe-commits mailing list cfe-commits@list

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-16 Thread Teresa Johnson via cfe-commits
@@ -21,46 +24,64 @@ using namespace llvm; PreservedAnalyses BitcodeWriterPass::run(Module &M, ModuleAnalysisManager &AM) { M.removeDebugIntrinsicDeclarations(); - const ModuleSummaryIndex *Index = - EmitSummaryIndex ? &(AM.getResult(M)) - : nullp

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-16 Thread Teresa Johnson via cfe-commits
@@ -568,31 +572,44 @@ bool writeThinLTOBitcode(raw_ostream &OS, raw_ostream *ThinLinkOS, // produced for the full link. ModuleHash ModHash = {{0}}; WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, Index, - /*GenerateHash=*/true, &ModHash); +

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-16 Thread Teresa Johnson via cfe-commits
@@ -139,39 +146,43 @@ initializeRecordStreamer(const Module &M, void ModuleSymbolTable::CollectAsmSymbols( const Module &M, -function_ref AsmSymbol) { - initializeRecordStreamer(M, [&](RecordStreamer &Streamer) { -Streamer.flushSymverDirectives(); - -for (auto

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-16 Thread Teresa Johnson via cfe-commits
@@ -89,6 +93,8 @@ initializeRecordStreamer(const Module &M, std::unique_ptr MAI(T->createMCAsmInfo(*MRI, TT.str(), MCOptions)); teresajohnson wrote: Should the MCOptions from TM be passed down to createMCAsmInfo? https://github.com/llvm/llvm-project/pull/143

[clang] Add warning for blocks capturing {'this', raw pointers, references} (PR #144388)

2025-06-16 Thread Sylvain Defresne via cfe-commits
https://github.com/sdefresne created https://github.com/llvm/llvm-project/pull/144388 Add three new warning that reports when blocks captures 'this', a raw pointer (i.e. not a pointer to a reference counted object) or a reference. Those warnings can be used in Objective-C++ to detect blocks th

[clang] Add warning for blocks capturing {'this', raw pointers, references} (PR #144388)

2025-06-16 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Add warning for blocks capturing {'this', raw pointers, references} (PR #144388)

2025-06-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sylvain Defresne (sdefresne) Changes Add three new warning that reports when blocks captures 'this', a raw pointer (i.e. not a pointer to a reference counted object) or a reference. Those warnings can be used in Objective-C++ to detect bl

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-16 Thread Andy Kaylor via cfe-commits
@@ -44,6 +68,15 @@ void ComplexExprEmitter::emitStoreOfComplex(mlir::Location loc, mlir::Value val, builder.createStore(loc, val, destAddr); } +mlir::Value ComplexExprEmitter::VisitCallExpr(const CallExpr *e) { + if (e->getCallReturnType(cgf.getContext())->isReferenceType(

[clang] [CIR][NFC] Refactor constant pointer l-value handling (PR #144165)

2025-06-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/144165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/144420 >From b43a7e9295dfdbe0a11fb7dff669b82d8ed0630c Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 16 Jun 2025 20:48:57 +0300 Subject: [PATCH 1/2] [clang][PAC] Support trivially_relocating polymorphic objects

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -1727,6 +1727,11 @@ ASTContext::PointerAuthContent ASTContext::findPointerAuthContent(QualType T) { T = T.getCanonicalType(); if (T.hasAddressDiscriminatedPointerAuth()) return PointerAuthContent::AddressDiscriminatedData; + + T = getBaseElementType(T).getCanonical

[clang] [clang][PAC] Support trivially_relocating polymorphic objects (PR #144420)

2025-06-16 Thread Oliver Hunt via cfe-commits
@@ -420,6 +420,222 @@ void CodeGenFunction::EmitPointerAuthCopy(PointerAuthQualifier Qual, QualType T, Builder.CreateStore(Value, DestAddress); } +static const ConstantArrayType *tryGetTypeAsConstantArrayType(QualType T) { + if (!T->isConstantArrayType()) +return nullp

[clang] b0378e7 - [AArch64TargetParser]Fix reconstructFromParsedFeatures ignoring negative features (#142236)

2025-06-16 Thread via cfe-commits
Author: Matthias Braun Date: 2025-06-16T12:55:12-07:00 New Revision: b0378e7ca953c2390168f352c5a88fd325cde894 URL: https://github.com/llvm/llvm-project/commit/b0378e7ca953c2390168f352c5a88fd325cde894 DIFF: https://github.com/llvm/llvm-project/commit/b0378e7ca953c2390168f352c5a88fd325cde894.diff

[clang] [clang-tools-extra] [lldb] [llvm] [mlir] A couple of grammar fixes (PR #144368)

2025-06-16 Thread Roman A via cfe-commits
https://github.com/GameRoMan created https://github.com/llvm/llvm-project/pull/144368 None >From 2b50682f230efa03c3b9a1f5c5e48e708734bf4d Mon Sep 17 00:00:00 2001 From: Roman A <121314722+gamero...@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:59:01 +0100 Subject: [PATCH] A couple of gram

[clang] [clang-tools-extra] [lldb] [llvm] [mlir] A couple of grammar fixes (PR #144368)

2025-06-16 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [C++][Modules] A module directive may only appear as the first preprocessing tokens in a file (PR #144233)

2025-06-16 Thread via cfe-commits
@@ -3725,13 +3727,21 @@ bool Lexer::Lex(Token &Result) { HasLeadingEmptyMacro = false; } + if (IsFirstPPToken) { +Result.setFlag(Token::FirstPPToken); +IsFirstPPToken = false; + } + bool atPhysicalStartOfLine = IsAtPhysicalStartOfLine; IsAtPhysicalStartOf

[clang] f037329 - [clang][Parser] Fix crash on malformed using declaration in constexpr function (#144286)

2025-06-16 Thread via cfe-commits
Author: Iris Shi Date: 2025-06-16T23:17:47+08:00 New Revision: f0373295e82315f95a97ce1b34c78ff46f475863 URL: https://github.com/llvm/llvm-project/commit/f0373295e82315f95a97ce1b34c78ff46f475863 DIFF: https://github.com/llvm/llvm-project/commit/f0373295e82315f95a97ce1b34c78ff46f475863.diff LOG:

[clang] [clang][Parser] Fix crash on malformed using declaration in constexpr function (PR #144286)

2025-06-16 Thread Iris Shi via cfe-commits
https://github.com/el-ev closed https://github.com/llvm/llvm-project/pull/144286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   >