[clang] [clang] Add __nullptr as a keyword to C (PR #123119)

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

[clang] [clang] Add __nullptr as a keyword to C (PR #123119)

2025-01-17 Thread Aaron Ballman via cfe-commits
@@ -108,3 +108,8 @@ void test_f1() { int ir = (f1)(nullptr); } +// __nullptr keyword in C +void foo(void *); +void bar() { foo(__nullptr); } +static_assert(nullptr == __nullptr); +static_assert(_Generic(typeof(__nullptr), nullptr_t: true, default: false)); A

[clang] [clang] Add __nullptr as a keyword to C (PR #123119)

2025-01-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please be sure to also update `clang/docs/ReleaseNotes.rst` so users know about the new functionality. Also, not signing you up for this work, but we really should document all of these keywords in `clang/docs/LanguageExtensions.rst`. Maybe it's worth

[clang] [Clang] handle [[warn_unused]] attribute for unused private fields (PR #120734)

2025-01-17 Thread Aaron Ballman via cfe-commits
@@ -3307,6 +3307,29 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc, } } +template +inline static bool HasAttribute(const QualType &T) { AaronBallman wrote: Here's my take on it: https://godbolt.org/z/qxq6jf3jM ``` class [[gnu::warn_unu

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-01-17 Thread Aaron Ballman via cfe-commits
@@ -3324,6 +3324,9 @@ def err_attribute_argument_out_of_range : Error< def err_init_priority_object_attr : Error< "can only use 'init_priority' attribute on file-scope definitions " "of objects of class type">; +def warn_init_priority_reserved : Warning< Aa

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: We talked about this during my morning office hours today (thanks @erichkeane and @philnik777 for coming!) and I'm now comfortable with the approach taken in this patch. Warning which defaults to error strikes a pretty reasonable compromise. https://github.com/llvm/llvm-pr

[clang] [llvm] [TySan] A Type Sanitizer (Clang) (PR #76260)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Sorry for the very late review but do we have clang documentation for this? +1, we do need documentation for this before Clang 20 ships. CC @fhahn https://github.com/llvm/llvm-project/pull/76260 ___ cfe-commits mailing list cfe-

[clang] [clang] Improve the documentation for the init_priority attribute (PR #123098)

2025-01-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Thank you for the improved docs! https://github.com/llvm/llvm-project/pull/123098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > While this is a valid concern, I don't think it's much of a problem in > reality. GCC just warns on this (not even an error by default) and I wasn't > able to find a single use outside implementations of the reserved value range. I wouldn't expect to find uses within the

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > but that leads to the question of: why is including musl's limits.h a > > problem? > > If we build `glibc` on `Alpine` with clang, we will meet the problem like > > ``` > ./include/bits/xopen_lim.h:84:10: warning: "NL_NMAX" redefined >84 | # define NL_NMAXIN

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-01-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. > Allow values within the range 0-100 of init_priority to be used outside > system library, but with a warning This was an intentional decision, not a bug or an oversight (I'm sorry, I didn't see that @philnik777 had marke

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > For > > ```c++ > void f() { > [[clang::annotate("B", (void)1, (void)2, 7)]] int j = 0; > } > ``` > > The IR is: > > ```llvm > @.str = private unnamed_addr constant [2 x i8] c"B\00", section > "llvm.metadata" > @.str.1 = private unnamed_addr constant [10 x i8] c"array.c

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-16 Thread Aaron Ballman via cfe-commits
@@ -760,6 +760,7 @@ def AmbiguousMacro : DiagGroup<"ambiguous-macro">; def KeywordAsMacro : DiagGroup<"keyword-macro">; def ReservedIdAsMacro : DiagGroup<"reserved-macro-identifier">; def ReservedIdAsMacroAlias : DiagGroup<"reserved-id-macro", [ReservedIdAsMacro]>; +def Reserv

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-16 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman @erichkeane I’ve switched back to the version without the std > check. should the diagnostic group be changed? I think we're fine to leave it as-is. https://github.com/llvm/llvm-project/pull/106036 ___ cfe-commits

[clang] [clang][Sema] Simplify err_init_conversion_failed diagnostic message for const variables (PR #82109)

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

[clang] [clang][Sema] Simplify err_init_conversion_failed diagnostic message for const variables (PR #82109)

2025-01-16 Thread Aaron Ballman via cfe-commits
@@ -9804,12 +9804,22 @@ bool InitializationSequence::Diagnose(Sema &S, case FK_ConversionFailed: { QualType FromType = OnlyArg->getType(); -PartialDiagnostic PDiag = S.PDiag(diag::err_init_conversion_failed) - << (int)Entity.getKind() - << DestType - <

[clang] [clang][Sema] Simplify err_init_conversion_failed diagnostic message for const variables (PR #82109)

2025-01-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! I had an idea that might be an improved approach, but the general idea of the patch is great. I think this can likely land without a change to `clang/docs/ReleaseNotes.rst` because it's a minor wording improvement, but y

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-16 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Looks like this change has some compile-time impact even if modules are not > used: > https://llvm-compile-time-tracker.com/compare.php?from=edc02351dd11cc4a39b7c541b26b71c6f36c8e55&to=7201cae106260aeb3e97d5291ff30f05076a&stat=instructions:u > It seems to add about 0.

[clang] [Clang] Deprecate __is_referenceable (PR #123185)

2025-01-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but please add the details back to the commit message before landing (makes code archeology easier on us in the future). https://github.com/llvm/llvm-project/pull/123185 ___ cfe-commits

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with a minor nit on the documentation, but I think this is a great new feature for the diagnostics engine. Thank you for it! btw, if you happen to have a list of diagnostics that could benefit from switching to use it, that sure

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

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

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-15 Thread Aaron Ballman via cfe-commits
@@ -276,6 +276,21 @@ Description: diagnostic instead of having to do things textually. The selected string does undergo formatting. +**"enum_select format** + +Example: + ``unknown frobbling of a %enum_select{%VarDecl{variable declaration}|%FuncDecl{function declaration

[clang] [Clang] Remove __is_referenceable builtin (PR #123078)

2025-01-15 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I would just say 'document for a release' then remove > > Works for me I took a look at the projects I could find using it on sourcegraph and I agree that we should be fine to document for a release and then remove. https://github.com/llvm/llvm-project/pull/123078

[clang] Rename [[clang::requires_explicit_initialization]] to [[clang::require_explicit_initialization]] (PR #122947)

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

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -886,6 +909,11 @@ struct DiagTextDocPrinter : DiagTextVisitor { makeRowSeparator(RST[I]); } + void VisitEnumSelect(EnumSelectPiece *P) { +// For now, document this as if it were a 'select'. AaronBallman wrote: I think that makes sense -- let'

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: clang-tblgen --gen-clang-diags-enums -I%S %s 2>&1 | FileCheck %s +include "DiagnosticBase.inc" + +def DupeNames1 : Error<"%enum_select{}0">; +def DupeNames2 : Error<"%enum_select{}0">; +// CHECK: error: Duplicate enumeration name 'DupeName' +// CHECK-NEXT

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: clang-tblgen --gen-clang-diags-enums -I%S %s 2>&1 | FileCheck %s +include "DiagnosticBase.inc" + +def DupeNames1 : Error<"%enum_select{}0">; AaronBallman wrote: Other test cases: ``` // Missing closing > after the name of the enumeration

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -1042,6 +1119,9 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text, Modifier); }; +if (ModType != MT_EnumSelect && Text[0] == '<') + Builder.PrintFatalError("modifier '<' syntax not valid with " + Modifier

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -886,6 +909,11 @@ struct DiagTextDocPrinter : DiagTextVisitor { makeRowSeparator(RST[I]); } + void VisitEnumSelect(EnumSelectPiece *P) { +// For now, document this as if it were a 'select'. AaronBallman wrote: Should we file an issue to addre

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: clang-tblgen --gen-clang-diags-enums -I%S %s 2>&1 | FileCheck %s +include "DiagnosticBase.inc" + +def DupeNames1 : Error<"%enum_select{}0">; +def DupeNames2 : Error<"%enum_select{}0">; +// CHECK: error: Duplicate enumeration name 'DupeName' +// CHECK-NEXT

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

2025-01-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! We should probably also update https://clang.llvm.org/docs/InternalsManual.html#formatting-a-diagnostic-argument so that folks know how to use this properly and we advertise it more broadly. https://github.com/llvm/llvm-

[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

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

[clang] Rename [[clang::requires_explicit_initialization]] to [[clang::require_explicit_initialization]] (PR #122947)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'll land the changes once pre-commit CI comes back green (I expect it will; I didn't spot any places that were missed) https://github.com/llvm/llvm-project/pull/122947 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] Rename [[clang::requires_explicit_initialization]] to [[clang::require_explicit_initialization]] (PR #122947)

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

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,785 @@ +//===-- Mustache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,785 @@ +//===-- Mustache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,785 @@ +//===-- Mustache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

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

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,785 @@ +//===-- Mustache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,785 @@ +//===-- Mustache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,114 @@ +//===--- Mustache.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: > I will try to get back on this PR tomorrow though so it doesn't stagnate much > longer. I guess that didn't work out as planned, but I got to it today. :-D FWIW, this is a case where fuzz testing may help shake out parser issues. https://github.com

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Ah haha I see, thanks! Looking forward to getting it sometime, that would > definitely be helpful :) FWIW, I think you're fine to ask for commit privs now: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access https://github.com/llvm/llvm-project/pull/102040

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -577,7 +577,17 @@ std::vector StoreDiags::take(const clang::tidy::ClangTidyContext *Tidy) { for (auto &Diag : Output) { if (const char *ClangDiag = getDiagnosticCode(Diag.ID)) { // Warnings controlled by -Wfoo are better recognized by that name. - StringRef

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -892,6 +894,8 @@ class DiagnosticsEngine : public RefCountedBase { /// \param FormatString A fixed diagnostic format string that will be hashed /// and mapped to a unique DiagID. template + // TODO: Deprecate this once all uses are removed from LLVM + // [[deprecat

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

2025-01-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes generally LGTM but I'd really love to hear from @kadircet as to whether this PR fully addresses the issues found before: https://github.com/llvm/llvm-project/pull/70976#discussion_r1775918960 https://github.com/llvm/llvm-project/pull/11971

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

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

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > From the commit message, it sounds like this might introduce warnings that > `-Werror` doesn't turn into warnings. Is that correct? FWIW, that's already the case today (which we found out in the previous iteration of this): https://godbolt.org/z/nG4oWvv3s I think the com

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-01-14 Thread Aaron Ballman via cfe-commits
@@ -179,6 +179,8 @@ def err_opencl_unknown_type_specifier : Error< def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup; +def ext_unknown_attribute_ignored : Extension< + "unknown attribute %0 ignored">, InGroup; AaronBallm

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Fantastic, thank you! Could we merge it? heh, thanks for the poke, I didn't remember you didn't have commit access. I've merged now. https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

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

[clang] [Clang][Comments] Allow HTML tags across multiple lines (PR #120843)

2025-01-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please be sure to also add a release note to `clang/docs/ReleaseNotes.rst` so users know about the fix. In principle, the changes LGTM but I do wonder if this is a part of the compiler that could benefit from some fuzzing to help shake out parsing iss

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2025-01-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you for your patience on the review! https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > IN SUMMARY: I think this proposal minus the std check is acceptable. +1 > I think the proposed-not-implemented warning of "you messed with an attribute > name, and it is doing weird stuff" is also a very valuable, though different, > check. I don't see them as different

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > Oh, I see, you're suggesting we remove the `getStdNamespace` check from > > > > this PR. Yeah, I think that's reasonable. > > > > > > > > > Yep, that is my suggestion, sorry I was insufficiently clear. > > > > But I'd somewhat question whether this PR and warning re

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Oh, I see, you're suggesting we remove the `getStdNamespace` check from > > this PR. Yeah, I think that's reasonable. > > Yep, that is my suggestion, sorry I was insufficiently clear. > > > But I'd somewhat question whether this PR and warning really has anything > > t

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Can you add more details to the patch summary explaining why the changes are needed? That makes it easier for folks to review the patch but also helps us in the future when digging through historical changes. Thanks! https://github.com/llvm/llvm-project/pull/122726

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > Just that the last bit of performance > > > > > > Maybe we're talking about different situations; I may have missed some > > context in the discussion of this PR. I didn't see this as being about the > > last bit of performance. It sounded like this was going to know

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I saw this got updates over break. Did LWG make its decision already? Are you > expecting re-review? I didn't see anything go across my emails about LWG, but > I could definitely have missed it. The LWG issue is still open: https://cplusplus.github.io/LWG/issue4149 but d

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Just that the last bit of performance Maybe we're talking about different situations; I may have missed some context in the discussion of this PR. I didn't see this as being about the last bit of performance. It sounded like this was going to knowingly introduce a perfor

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Anyway, my main point was that there are people who care about performance > > on Windows, so please don't treat it as a second-class citizen. > > Yeah, I don't want to treat folks on Windows as second class citizens by any > means - but I wouldn't mind/hope we can trea

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-01-13 Thread Aaron Ballman via cfe-commits
@@ -179,6 +179,8 @@ def err_opencl_unknown_type_specifier : Error< def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup; +def ext_unknown_attribute_ignored : Extension< + "unknown attribute %0 ignored">, InGroup; AaronBallm

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-13 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -389,6 +389,12 @@ def note_constexpr_assum

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-13 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -4340,6 +4340,18 @@ whole system, the curr

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-13 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -4340,6 +4340,18 @@ whole system, the curr

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-13 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: AaronBallman wrote: > > Also, this should update `clang/www/c

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-13 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: AaronBallman wrote: > > Unfortunately we currently have two c

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

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

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-13 Thread Aaron Ballman via cfe-commits
@@ -3771,6 +3771,12 @@ CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); */ CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); +/** + * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent + * class. + */ +CINDEX_LINKAG

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you for the release note! https://github.com/llvm/llvm-project/pull/122462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-10 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Maybe my brain still isn't engaging after the holidays, but I'm still not seeing why this change is correct. From the point when Clang gets involved: * The absolute path includes glibc's `limits.h`, which includes the next header in the chain, which is Clang's: https://sou

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Aaron Ballman via cfe-commits
@@ -3771,6 +3771,12 @@ CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); */ CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); +/** + * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent + * class. + */ +CINDEX_LINKAG

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-10 Thread Aaron Ballman via cfe-commits
@@ -27,6 +27,33 @@ unsigned clang_isVirtualBase(CXCursor C) { return B->isVirtual(); } +unsigned clang_visitCXXBaseClasses(CXType PT, CXFieldVisitor visitor, + CXClientData client_data) { + CXCursor PC = clang_getTypeDeclaration(PT); + if

[clang] Fix a cmake error when using the Xcode generator. (PR #119403)

2025-01-10 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Whoops, I clicked too soon, so I closed the revert PR, sorry for that noise. I think this is a spurious failure unrelated to your changes, so you can ignore the issue. https://github.com/llvm/llvm-project/pull/119403 ___ cfe-commi

[clang] Revert "Fix a cmake error when using the Xcode generator." (PR #122454)

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

[clang] Revert "Fix a cmake error when using the Xcode generator." (PR #122454)

2025-01-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/122454 Reverts llvm/llvm-project#119403 >From 8876f169829dd3c8dfebcfe9652fb1059ce75325 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 10 Jan 2025 08:48:34 -0500 Subject: [PATCH] Revert "Fix a cmake error

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-09 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,114 @@ +//===--- Mustache.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-01-09 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,114 @@ +//===--- Mustache.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang][TableGen] Add missing __bf16 type to the builtins parser (PR #120662)

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

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2025-01-09 Thread Aaron Ballman via cfe-commits
@@ -1550,6 +1550,8 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, IdResolver.AddDecl(Param); } + ProcessDeclAttributes(S, Param, D); AaronBallman wrote: I think that makes sense, thanks! https://github.com/llvm/llvm-projec

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2025-01-09 Thread Aaron Ballman via cfe-commits
@@ -15978,6 +15988,24 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, CheckCoroutineWrapper(FD); } + // Diagnose invalid SYCL kernel entry point function declarations. + if (FD && !FD->isInvalidDecl() && !FD->isTemplated() && + FD->hasAttr()) { +

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

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

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118800 >From 34d3d3000bc6096bbc9eb35ce85b6ceca50b91ca Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 5 Dec 2024 08:31:24 -0500 Subject: [PATCH 1/8] [C++20] Destroying delete and deleted destructors When

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-09 Thread Aaron Ballman via cfe-commits
@@ -2855,6 +2855,11 @@ class CXXDestructorDecl : public CXXMethodDecl { return getCanonicalDecl()->OperatorDeleteThisArg; } + /// Will this destructor ever be called when considering which deallocation + /// function is associated with the destructor? Can optionally be

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118800 >From 34d3d3000bc6096bbc9eb35ce85b6ceca50b91ca Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 5 Dec 2024 08:31:24 -0500 Subject: [PATCH 1/7] [C++20] Destroying delete and deleted destructors When

[clang] Fix a cmake error when using the Xcode generator. (PR #119403)

2025-01-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but I added our cmake code owners just in case they have the bandwidth to also double-check, since I got this wrong before. :-) https://github.com/llvm/llvm-project/pull/119403 ___ cfe-c

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2025-01-08 Thread Aaron Ballman via cfe-commits
@@ -15978,6 +15988,24 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, CheckCoroutineWrapper(FD); } + // Diagnose invalid SYCL kernel entry point function declarations. + if (FD && !FD->isInvalidDecl() && !FD->isTemplated() && + FD->hasAttr()) { +

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2025-01-08 Thread Aaron Ballman via cfe-commits
@@ -1550,6 +1550,8 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, IdResolver.AddDecl(Param); } + ProcessDeclAttributes(S, Param, D); AaronBallman wrote: We definitely need some changes because we drop the attributes on the

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-08 Thread Aaron Ballman via cfe-commits
@@ -1200,21 +1200,35 @@ CanThrowResult Sema::canThrow(const Stmt *S) { case Expr::CXXDeleteExprClass: { auto *DE = cast(S); -CanThrowResult CT; +CanThrowResult CT = CT_Cannot; QualType DTy = DE->getDestroyedType(); if (DTy.isNull() || DTy->isDependentTy

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118800 >From 34d3d3000bc6096bbc9eb35ce85b6ceca50b91ca Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 5 Dec 2024 08:31:24 -0500 Subject: [PATCH 1/6] [C++20] Destroying delete and deleted destructors When

[clang] [C++20] Destroying delete and deleted destructors (PR #118800)

2025-01-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/118800 >From 34d3d3000bc6096bbc9eb35ce85b6ceca50b91ca Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 5 Dec 2024 08:31:24 -0500 Subject: [PATCH 1/5] [C++20] Destroying delete and deleted destructors When

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: https://github.com/AaronBallman commented: Thank you for working on this! Please be sure to also add release notes to `clang/docs/ReleaseNotes.rst` so users know about the new functionality. Also, this should

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -17893,4 +18005,425 @@ std::optional EvaluateBuiltinIsWithinLifetime(IntExprEvaluator &IEE, IsWithinLifetimeHandler handler{Info}; return findSubobject(Info, E, CO, Val.getLValueDesigna

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -1847,133 +1847,133 @@ def C11AtomicIsLockFree : Builtin { // GNU atomic builtins. def AtomicLoad : AtomicBuiltin { let Spellings = ["__atomic_load"]; - let Attributes = [CustomTypeCheck

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= , Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: @@ -0,0 +1,102 @@ +// RUN: %clang_cc1 -std=c++23 -verify %s AaronBallman wrote: ```suggestion // RUN: %clang_cc1 -std=c++2c -verify %s ``` https://github.co

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= , Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: @@ -16268,6 +16353,25 @@ class VoidExprEvaluator } } + bool VisitAtomicExpr(const AtomicExpr *E) { +if (!EvaluateAtomicOrder(E, Info)) + return false; + +

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -1921,6 +1921,22 @@ static bool EvaluateFixedPointOrInteger(const Expr *E, APFixedPoint &Result, static bool EvaluateFixedPoint(const Expr *E, APFixedPoint &Result,

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -17893,4 +18005,425 @@ std::optional EvaluateBuiltinIsWithinLifetime(IntExprEvaluator &IEE, IsWithinLifetimeHandler handler{Info}; return findSubobject(Info, E, CO, Val.getLValueDesigna

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: @@ -17893,4 +18005,425 @@ std::optional EvaluateBuiltinIsWithinLifetime(IntExprEvaluator &IEE, IsWithinLifetimeHandler handler{Info}; return findSubobject(Info, E, CO, Val.getLValueDesigna

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-08 Thread Aaron Ballman via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/98756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

  1   2   3   4   5   6   7   8   9   10   >