[clang] [Clang] Non-polymorphic trivially relocatable types can have [[trivial_abi]] (PR #143111)

2025-06-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'd like to see codegen tests which verify that we actually do try to pass in registers in this case. Also, the changes should come with a release note. https://github.com/llvm/llvm-project/pull/143111 ___ cf

[clang] [clang] Reduce TemplateDeclInstantiator size. (PR #142983)

2025-06-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/142983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/140911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,113 @@ +// RUN: %clang_cc1 -std=c23 -verify %s + +/* WG14 N3006: Yes + * Underspecified object declarations + */ + +void struct_test(void) { + struct S1 { int x, y; }; // expected-note {{field 'x' has type 'int' here}}

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,113 @@ +// RUN: %clang_cc1 -std=c23 -verify %s + +/* WG14 N3006: Yes + * Underspecified object declarations + */ + +void struct_test(void) { + struct S1 { int x, y; }; // expected-note {{field 'x' has type 'int' here}}

[clang] [Clang] Fix constant eval of assignment operators with an explicit object parameter (PR #142964)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/142964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-05 Thread Aaron Ballman via cfe-commits
@@ -6501,3 +6501,59 @@ qualifications. Note, Clang does not allow an ``_Atomic`` function type because of explicit constraints against atomically qualified (arrays and) function types. + + +Underspecified Object Declarations in C +=== + +C23

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thanks for the new diagnostic! I think you should also add a release note to `clang/docs/ReleaseNotes.rst` so users know about the new diagnostic group. https://github.com/llvm/llvm-project/pull/141599 ___ cf

[clang] [clang] Remove the experimental prefix from -fexperimental-relative-c++-abi-vtables (PR #142845)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes should come with a release note to let the users know this is no longer experimental. That said, I think we're still missing something for this to no longer be experimental: documentation. I can't find any mention of this flag in `Languag

[clang] [clang] Reduce LateInstantiatedAttrVec vector default size. (PR #142840)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, wow, that's a really nice win for such an easy change. Thank you! https://github.com/llvm/llvm-project/pull/142840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [clang-tools-extra] Fix cross-references in Clang attribute reference (PR #142967)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! This all looks correct to me, so LG assume precommit CI doesn't find issues with the Sphinx markdown. https://github.com/llvm/llvm-project/pull/142967 ___ cfe-commits mailing list cfe-c

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-06-05 Thread Aaron Ballman via cfe-commits
@@ -7223,4 +7225,10 @@ class TestNegativeWithReentrantMutex { } }; +typedef int __attribute__((capability("role"), reentrant_capability)) ThreadRole; +ThreadRole FlightControl1, FlightControl2; +void dispatch_log(const char *msg) __attribute__((requires_capability(!FlightC

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

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

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-06-05 Thread Aaron Ballman via cfe-commits
@@ -4222,6 +4222,11 @@ def warn_fun_requires_lock_precise : InGroup, DefaultIgnore; def note_found_mutex_near_match : Note<"found near match '%0'">; +// Pedantic thread safety warnings enabled by default +def warn_thread_reentrant_with_negative_capability : Warning< + "%0 i

[clang] Thread Safety Analysis: Use replaceLock instead of removeLock+addLock (PR #141500)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, nice improvement! https://github.com/llvm/llvm-project/pull/141500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang] Simplify device kernel attributes (PR #137882)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Use move in std::vector local in HandleTranslationUnit (PR #142851)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/142851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141657 >From c7a41997f41daea5669e1a5b003e0b42699c56d4 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 27 May 2025 14:52:35 -0400 Subject: [PATCH 1/5] [Docs] Explicitly document libclang ABI and

[clang-tools-extra] [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-06-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I think that having such a check is a reasonable idea, but yeah, I doubt we could turn it on in CI without limiting to just new code. But it would be a handy tool when writing new code, so I think it's probably worth it. https://github.com/llvm/llvm-project/pull/142839

[clang] [Clang] Set the FTM for trivial relocation (PR #142936)

2025-06-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: This has been in the tree for less than a month and we've not had a release out to the public with it yet, right? That seems a bit premature if we were waiting for some user experience before flipping the switch. I don't have a good intuition for how

[clang] [clang][python][test] Move python binding tests to lit framework (PR #142948)

2025-06-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @llvm/infrastructure-area-team -- I'm not certain who is the best person to review `lit` work; that's sort of the confluence between infraustructure and the rest of the project. Do you have any good suggestions? (We don't have a maintainer listed for it that I could find

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-04 Thread Aaron Ballman via cfe-commits
@@ -6454,3 +6454,51 @@ qualifications. Note, Clang does not allow an ``_Atomic`` function type because of explicit constraints against atomically qualified (arrays and) function types. + + +Underspecified object declarations in C +=== + +In C

[clang] [C23][N3006] Documented behavior of underspecified object declarations (PR #140911)

2025-06-04 Thread Aaron Ballman via cfe-commits
@@ -6454,3 +6454,51 @@ qualifications. Note, Clang does not allow an ``_Atomic`` function type because of explicit constraints against atomically qualified (arrays and) function types. + + +Underspecified object declarations in C AaronBallman wrote: ```suggest

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/135836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-06-04 Thread Aaron Ballman via cfe-commits
@@ -12711,6 +12711,11 @@ def warn_noderef_on_non_pointer_or_array : Warning< def warn_noderef_to_dereferenceable_pointer : Warning< "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup; +def warn_cast_discards_cfi_unchecked_callee +: Warning<"impli

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-06-04 Thread Aaron Ballman via cfe-commits
@@ -8253,6 +8275,19 @@ inline bool Type::isObjectPointerType() const { return false; } +inline bool Type::isCFIUncheckedCalleeFunctionType() const { + if (const auto *Fn = getAs()) +return Fn->hasCFIUncheckedCallee(); + return false; +} + +inline bool Type::isPointer

[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

2025-06-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/141695 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2025-06-03 Thread Aaron Ballman via cfe-commits
@@ -402,7 +402,7 @@ def warn_unused_function : Warning<"unused function %0">, InGroup, DefaultIgnore; def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">, InGroup, DefaultIgnore; -def warn_unused_member_function : Warning<"unused member fun

[clang] [SPIR-V] Only emit __spirv__ when targeting HLSL (PR #142401)

2025-06-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! @jsji does this resolve the issue on your end? https://github.com/llvm/llvm-project/pull/142401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [HLSL] Add __spirv__ macro (PR #132848)

2025-06-02 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Hi! I'm wondering why this macro needs to be exposed outside of HLSL given that there's already `__SPIRV__` exposed for this exact purpose. These changes turn out to be disruptive in a downstream SYCL implementation (https://github.com/intel/llvm/issues/18219) because of a

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

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

[clang] Work around a build issue with MSVC; NFC (PR #142195)

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

[clang] Work around a build issue with MSVC; NFC (PR #142195)

2025-05-30 Thread Aaron Ballman via cfe-commits
collision. Rename the members to better match our naming conventions. Fixes #142186 >From 7572e195a7c3985442e74c6e0a8eebb3e16ea4f2 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 30 May 2025 14:29:14 -0400 Subject: [PATCH] Work around a build issue with MSVC; NFC Microsoft helpfu

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Failing docs build in precommit CI appears to be unrelated https://github.com/llvm/llvm-project/pull/139429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang][Frontend] Add overload to ASTPrinter that doesn't own output stream (PR #142163)

2025-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/142163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang] Simplify device kernel attributes (PR #137882)

2025-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. This looks reasonable to me, but please wait for @erichkeane to sign off before landing https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,46 @@ +// RUN: %clang_cc1 %s -verify=expected -Wimplicit-int-conversion +// RUN: %clang_cc1 %s -verify=none -Wimplicit-int-conversion -Wno-implicit-int-conversion-on-negation + +// none-no-diagnostics + +char test_char(char x) { + return -x; // expected-warning {{impl

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: LGTM aside from a request for another test https://github.com/llvm/llvm-project/pull/139429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

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

[clang] [Modules] Don't fail when an unused textual header is missing. (PR #138227)

2025-05-29 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: We reviewed this thread today at the Clang Area Team meeting and it seems like y'all have perhaps found a solution everyone is happy with. However, if you'd like a meeting or if there's some other way we can support you, we're definitely happy to help! > Please let me know

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-05-29 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Due to inappropriate behavior from @BukeBeyond, the age of the PR, and the fact that it's merged, I've locked the PR as resolved. https://github.com/llvm/llvm-project/pull/115821 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-05-29 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman locked https://github.com/llvm/llvm-project/pull/115821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

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

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -373,19 +373,21 @@ implementation of the facilities by Clang may change behavior as bugs are fixed, features get implemented, etc. The library should be ABI and API stable over time, but ABI- and API-breaking -changes can happen in the following situations: +changes can ha

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141783 >From deeb52c330fc0c1fbdbfe77403c1320d76fa460d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 10:51:07 -0400 Subject: [PATCH 1/5] [C23] Handle type compatibility of unnamed records

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/139429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -352,6 +352,9 @@ Improvements to Clang's diagnostics - Now correctly diagnose a tentative definition of an array with static storage duration in pedantic mode in C. (#GH50661) +- Split diagnosis of implicit integer comparison on negation to a new diagnostic group ``-Wimp

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,64 @@ +// RUN: %clang_cc1 %s -verify -Wimplicit-int-conversion +// RUN: %clang_cc1 %s -verify -Wimplicit-int-conversion -Wno-implicit-int-conversion-on-negation -DNO_DIAG + +char test_char(char x) { + return -x; +#ifndef NO_DIAG + // expected-warning@-2 {{implicit co

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,64 @@ +// RUN: %clang_cc1 %s -verify -Wimplicit-int-conversion +// RUN: %clang_cc1 %s -verify -Wimplicit-int-conversion -Wno-implicit-int-conversion-on-negation -DNO_DIAG AaronBallman wrote: A better approach than using `-D` is to specify a prefix to

[clang] [Clang] Separate implicit int conversion on negation sign to new diagnostic group (PR #139429)

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

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -359,3 +359,35 @@ struct alignment { // c17-error {{redefinition of 'alignment'}} \ c23-error {{type 'struct alignment' has a member with an attribute which currently causes the types to be treated as though they are incompatible}} int x; }; + +//

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141783 >From deeb52c330fc0c1fbdbfe77403c1320d76fa460d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 10:51:07 -0400 Subject: [PATCH 1/4] [C23] Handle type compatibility of unnamed records

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141783 >From deeb52c330fc0c1fbdbfe77403c1320d76fa460d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 10:51:07 -0400 Subject: [PATCH 1/3] [C23] Handle type compatibility of unnamed records

[clang] [llvm] [clang] Simplify device kernel attributes (PR #137882)

2025-05-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Precommit CI found relevant failures; it looks like clang-tools-extra needs some updates as well https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang] Rename -Wdeprecated-switch-case to -Wdeprecated-declarations-switch-case (PR #141779)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/141779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -1432,14 +1432,26 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { Diags.Report(TokLoc, DiagId); ++s; DigitsBegin = s; -SawOctalPrefix = true; +radix = 8; AaronBallman wrote: Oh, you're right, I missed

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141783 >From deeb52c330fc0c1fbdbfe77403c1320d76fa460d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 10:51:07 -0400 Subject: [PATCH 1/2] [C23] Handle type compatibility of unnamed records

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -359,3 +359,29 @@ struct alignment { // c17-error {{redefinition of 'alignment'}} \ c23-error {{type 'struct alignment' has a member with an attribute which currently causes the types to be treated as though they are incompatible}} int x; }; + +//

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -1751,9 +1751,20 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, // fulfill the preceding requirements. ... Otherwise, the structure, union, // or enumerated types are incompatible. - if (!NameIsStructurallyEquivalent(*D1, *D2)) { + //

[clang] [C23] Handle type compatibility of unnamed records (PR #141783)

2025-05-28 Thread Aaron Ballman via cfe-commits
. Fixes #141724 >From deeb52c330fc0c1fbdbfe77403c1320d76fa460d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 10:51:07 -0400 Subject: [PATCH] [C23] Handle type compatibility of unnamed records At the top-level, both types need to have a tag in order for them to be compati

[clang] [C] Fix parsing of [[clang::assume]] (PR #141747)

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

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Clang bits LGTM! https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -1432,14 +1432,26 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { Diags.Report(TokLoc, DiagId); ++s; DigitsBegin = s; -SawOctalPrefix = true; +radix = 8; AaronBallman wrote: There's code below which al

[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I added @cor3ntin and @tahonermann for some extra sets of eyes, seeing as how I already messed this up once before. :-) https://github.com/llvm/llvm-project/pull/141695 ___ cfe-commits mailing list cfe-commit

[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

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

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-28 Thread Aaron Ballman via cfe-commits
@@ -358,3 +358,46 @@ Complete example code .. _Index.h: https://github.com/llvm/llvm-project/blob/main/clang/include/clang-c/Index.h + +.. _Stability: + +ABI and API Stability +- + +The C interfaces in libclang are intended to be relatively stable. This a

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141657 >From c7a41997f41daea5669e1a5b003e0b42699c56d4 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 27 May 2025 14:52:35 -0400 Subject: [PATCH 1/4] [Docs] Explicitly document libclang ABI and

[clang] [C] Fix parsing of [[clang::assume]] (PR #141747)

2025-05-28 Thread Aaron Ballman via cfe-commits
n C++. But in C, where there is thankfully no [[assume]] standard attribute, the lack of a scope meant we would set the attribute kind to "unknown". >From 83104f072456c346ecf9463e78804b19deaa64dd Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 May 2025 07:55:20 -0400 S

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-05-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > If you feel that there's a technical reason that the compiler output is no > longer reasonable, you are welcome to bring it up as a technical argument. My > point is simply that "my transform stopped working because clang's compiler > output changed" is not, in and of its

[clang] [C2y] Add stdcountof.h (PR #140890)

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

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -7867,15 +7867,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange(); + SourceLocation

[clang] [llvm] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -5311,6 +5313,90 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && + "Expected an identifier to denote which MS at

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Aaron Ballman via cfe-commits
me changes which can impact ABI and API stability that we reserve the right to make, lists some scenarios we explicitly do not support, but otherwise tries to assure the reader that the APIs and ABI are stable. >From c7a41997f41daea5669e1a5b003e0b42699c56d4 Mon Sep 17 00:00:00 2001 From: Aaron

[clang] [C2y] Fix _Countof handling of VLAs (PR #141621)

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

[clang] clang_EvalResult_getAsCXString impl (PR #134551)

2025-05-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I think this problem is an important one to solve, and this is not the first > time our rigid ABI has caused us problems. I wonder at what point we should > decide to break ABI, because there are other cleanups we also want to do > (removing deprecated APIs, for example).

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I've added a handful of folks who might be reasonable reviewers for this, but if you know of anyone else who may have an opinion, feel free to rope them in. These changes came about because of https://github.com/llvm/llvm-project/pull/134551 where someone was trying to add

[clang] Thread safety analysis: Skip functions acquiring/releasing parameters (PR #141432)

2025-05-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I think adding more attributes is a viable option, but it doesn't scale particularly well and I would not be surprised if it caused some confusion in practice. > But maybe we can exclude functions where the attribute directly refers to a > parameter. This doesn't work for

[clang] [C2y] Fix _Countof handling of VLAs (PR #141621)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -3574,20 +3574,26 @@ ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( CGF.EmitIgnoredExpr(E->getArgumentExpr()); } -auto VlaSize = CGF.getVLASize(VAT); -llvm::Value *size = VlaSize.NumElts; - // For sizeof and __datasizeof, we nee

[clang] [C2y] Fix _Countof handling of VLAs (PR #141621)

2025-05-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/141621 >From b7736e6c6c6c39fab5a21059995a0dbf4eed4e2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 27 May 2025 11:30:00 -0400 Subject: [PATCH 1/2] [C2y] Fix _Countof handling of VLAs It turns out t

[clang] [C2y] Fix _Countof handling of VLAs (PR #141621)

2025-05-27 Thread Aaron Ballman via cfe-commits
switched to using getVLAElements1D() instead, which only gets a single dimension. Fixes #141409 >From b7736e6c6c6c39fab5a21059995a0dbf4eed4e2f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 27 May 2025 11:30:00 -0400 Subject: [PATCH] [C2y] Fix _Countof handling of VLAs It turns out t

[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)

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

[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -1874,9 +1874,11 @@ ExprResult Sema::CreateGenericSelectionExpr( if (D != 0) { Diag(Types[i]->getTypeLoc().getBeginLoc(), D) -<< Types[i]->getTypeLoc().getSourceRange() -<< Types[i]->getType(); - TypeErrorFound = true; +

[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -1874,9 +1874,11 @@ ExprResult Sema::CreateGenericSelectionExpr( if (D != 0) { Diag(Types[i]->getTypeLoc().getBeginLoc(), D) -<< Types[i]->getTypeLoc().getSourceRange() -<< Types[i]->getType(); - TypeErrorFound = true; +

[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -1874,9 +1874,11 @@ ExprResult Sema::CreateGenericSelectionExpr( if (D != 0) { Diag(Types[i]->getTypeLoc().getBeginLoc(), D) -<< Types[i]->getTypeLoc().getSourceRange() -<< Types[i]->getType(); - TypeErrorFound = true; +

[clang] [clang][ASTMatchers][NFC] fix typos in AST-matchers docs. (PR #141307)

2025-05-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/141307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)

2025-05-27 Thread Aaron Ballman via cfe-commits
:00 2001 From: Aaron Ballman Date: Tue, 27 May 2025 09:10:46 -0400 Subject: [PATCH] [C2y] Correctly handle incomplete types in generic selections We were emitting a non-error diagnostic but claiming we emitted an error, which caused some obvious follow-on problems. Fixes #141549 --- clang/lib/S

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -Wunknown-attributes -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wunknown-attributes -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s + +[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored;

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-27 Thread Aaron Ballman via cfe-commits
@@ -7867,15 +7867,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange(); + SourceLocation

[clang] [Clang] Add missing macro undefs in AttributeSpellingList emitter (PR #141090)

2025-05-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/141090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/140890 >From 10cb78bd9f361dd442c40702dad3c7809f466615 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 21 May 2025 08:59:47 -0400 Subject: [PATCH 1/4] [C2y] Add stdcountof.h WG14 N3469 changed _Lengt

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -389,6 +389,7 @@ SYMBOL(cosh, None, ) SYMBOL(coshf, None, ) SYMBOL(coshl, None, ) SYMBOL(cosl, None, ) +SYMBOL(countof, None, ) AaronBallman wrote: Yup, I missed: ``` // Generated from cppreference offline HTML book (modified on 2018-10-28). //===--

[clang] clang_EvalResult_getAsCXString impl (PR #134551)

2025-05-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > It means all such string accesses would require two indirections to get to > > the string data > > I don't think that's true. Getting the pointer would be `ptr+sizeof(size_t)`. > > > I also wonder if we want to be slightly less memory efficient and add a > > version fi

[clang] [Clang] Allow parsing arbitrary order of attributes for declarations (PR #133107)

2025-05-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I think we need to understand what we want before we can make decisions on > > what needs changing, though. Are there invariants we want to introduce, > > like the source range for the AST node should encompass the source > > locations tracked within the AST node? Or ar

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

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

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -2901,34 +2907,44 @@ class CallExpr : public Expr { // // * An optional of type FPOptionsOverride. // - // Note that we store the offset in bytes from the this pointer to the start - // of the trailing objects. It would be perfectly possible to compute it - // based

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -2901,34 +2907,44 @@ class CallExpr : public Expr { // // * An optional of type FPOptionsOverride. // - // Note that we store the offset in bytes from the this pointer to the start - // of the trailing objects. It would be perfectly possible to compute it - // based

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -3187,9 +3216,59 @@ class CallExpr : public Expr { SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getEndLoc() const LLVM_READONLY; +

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -1510,41 +1519,41 @@ CallExpr *CallExpr::Create(const ASTContext &Ctx, Expr *Fn, unsigned NumArgs = std::max(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects( /*NumPreArgs=*/0, NumArgs, FPFeatures.requiresTrailingStorage()

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -1510,41 +1519,41 @@ CallExpr *CallExpr::Create(const ASTContext &Ctx, Expr *Fn, unsigned NumArgs = std::max(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects( /*NumPreArgs=*/0, NumArgs, FPFeatures.requiresTrailingStorage()

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Aaron Ballman via cfe-commits
@@ -3187,9 +3216,59 @@ class CallExpr : public Expr { SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getEndLoc() const LLVM_READONLY; +

  1   2   3   4   5   6   7   8   9   10   >