[clang] 843d074 - Update the C Status page for the Clang 15 release

2022-09-13 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2022-09-13T09:36:54-04:00 New Revision: 843d074400fe9868329e870d6423728333cc7e1a URL: https://github.com/llvm/llvm-project/commit/843d074400fe9868329e870d6423728333cc7e1a DIFF: https://github.com/llvm/llvm-project/commit/843d074400fe9868329e870d6423728333cc7e1a.diff

[clang] b8266f5 - Correct the __has_c_attribute value for fallthrough

2022-09-13 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2022-09-13T11:08:58-04:00 New Revision: b8266f512a6218e8319379b65a637fa82b3900f6 URL: https://github.com/llvm/llvm-project/commit/b8266f512a6218e8319379b65a637fa82b3900f6 DIFF: https://github.com/llvm/llvm-project/commit/b8266f512a6218e8319379b65a637fa82b3900f6.diff

[clang] e076680 - Add a "Potentially Breaking Changes" section to the Clang release notes

2022-09-15 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2022-09-15T07:29:49-04:00 New Revision: e076680bd59cec5e98fe05aeb91891a1e5745e5b URL: https://github.com/llvm/llvm-project/commit/e076680bd59cec5e98fe05aeb91891a1e5745e5b DIFF: https://github.com/llvm/llvm-project/commit/e076680bd59cec5e98fe05aeb91891a1e5745e5b.diff

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -2034,18 +2035,19 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, // - If the new-initializer is omitted, the object is default- // initialized (8.5); if no initialization is performed, // the object has indeterminate val

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -2008,22 +2008,23 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, SourceRange TypeRange = AllocTypeInfo->getTypeLoc().getSourceRange(); SourceLocation StartLoc = Range.getBegin(); - CXXNewExpr::InitializationStyle initStyle; + CXXNewInitializationS

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

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

[clang] [clang][Interp] Fix IntAP(s) to IntAP(s) casts (PR #69915)

2023-11-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but please add the description to the patch commit message when landing. https://github.com/llvm/llvm-project/pull/69915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-11-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1894,6 +1894,8 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, case attr::ArmMveStrictPolymorphism:

[clang-tools-extra] [libcxx] [llvm] [flang] [clang] [compiler-rt] [libc] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/71398 In Clang 16, we implemented the ability to add a label at the end of a compound statement. These changes complete the implementation by allowing a label to be followed by a declaration in C. Note, this see

[clang] [libc] [llvm] [compiler-rt] [clang-tools-extra] [libcxx] [flang] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -299,6 +299,12 @@ def note_missing_selector_name : Note< def note_force_empty_selector_name : Note< "or insert whitespace before ':' to use %0 as parameter name " "and have an empty entry in the selector">; +def ext_c_label_followed_by_declaration : ExtWarn< + "label fo

[libc] [libcxx] [compiler-rt] [clang-tools-extra] [clang] [llvm] [flang] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/71398 >From 1d54a5cc6b34aca0e34ab57d7ee62815707d9153 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 6 Nov 2023 08:54:40 -0500 Subject: [PATCH 1/2] [C23] Complete support for WG14 N2508 In Clang 16, we im

[flang] [clang] [compiler-rt] [libcxx] [clang-tools-extra] [llvm] [libc] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -299,6 +299,12 @@ def note_missing_selector_name : Note< def note_force_empty_selector_name : Note< "or insert whitespace before ':' to use %0 as parameter name " "and have an empty entry in the selector">; +def ext_c_label_followed_by_declaration : ExtWarn< + "label fo

[clang] [clang][Interp] Fix creating APSInt from IntegralAP (PR #71410)

2023-11-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, sorry for missing that during previous review! https://github.com/llvm/llvm-project/pull/71410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -10026,6 +10026,11 @@ def err_duplicate_case_differing_expr : Error< def warn_case_empty_range : Warning<"empty case range specified">; def warn_missing_case_for_condition : Warning<"no case matching constant switch condition '%0'">; +def err_loop_attr_duplication : Error<

[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -788,6 +797,17 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx, } } + // Identify loop attribute 'code_align' from Attrs. + // For attribute code_align: + // n - 'llvm.loop.align i32 n' metadata will be emitted. + for (const auto *A : Attrs

[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -322,6 +322,57 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -322,6 +322,57 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[flang] [llvm] [clang-tools-extra] [libcxx] [compiler-rt] [libc] [clang] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/71398 >From 1d54a5cc6b34aca0e34ab57d7ee62815707d9153 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 6 Nov 2023 08:54:40 -0500 Subject: [PATCH 1/3] [C23] Complete support for WG14 N2508 In Clang 16, we im

[flang] [llvm] [clang-tools-extra] [libcxx] [compiler-rt] [libc] [clang] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-06 Thread Aaron Ballman via cfe-commits
@@ -32,8 +32,8 @@ T tmain(T argc) { } switch (argc) { #pragma omp error // expected-error {{ERROR}} - case 1: -#pragma omp error // expected-error {{ERROR}} + case 1: // FIXME: error without 'at execution' is not a stand-alone directive and so this should be accepted. --

[clang-tools-extra] [llvm] [flang] [libc] [clang] [libcxx] [compiler-rt] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-07 Thread Aaron Ballman via cfe-commits
@@ -712,9 +722,7 @@ StmtResult Parser::ParseLabeledStatement(ParsedAttributes &Attrs, assert(Tok.is(tok::identifier) && Tok.getIdentifierInfo() && "Not an identifier!"); - // The substatement is always a 'statement', not a 'declaration', but is - // otherwise in

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Me and Aaron are also wondering now how did it pass CI, and what's wrong > > with changes here. I'm sorry @zmodem that we got you involved. > > Just to be clear, my comment wasn't intended as criticism of this patch. This > does seem like a good opportunity to improve o

[compiler-rt] [libcxx] [libc] [llvm] [clang-tools-extra] [flang] [clang] [C23] Complete support for WG14 N2508 (PR #71398)

2023-11-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/71398 >From 1d54a5cc6b34aca0e34ab57d7ee62815707d9153 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 6 Nov 2023 08:54:40 -0500 Subject: [PATCH 1/4] [C23] Complete support for WG14 N2508 In Clang 16, we im

[clang] [clang] Improve `_Alignas` on a `struct` declaration diagnostic (PR #65638)

2023-11-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/65638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > If you see failures locally, it's best to understand where they coming > > from: even if it passes on bots it just means we have a hole in our test > > coverage. > > Sure, but it wasn't the first time I've seen local test failures that doesn't > reproduce anywhere else

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > tests will fail locally but pass everywhere else (for example, people > > working on slightly out-of-norm configurations will sometimes have > > persistent local failures that are unrelated to changes in the patch). > > It never happened to me, in a way that can't be ro

[clang] 24060db - Silence diagnostics about not all control paths returning a value; NFC

2023-11-07 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-11-07T10:42:50-05:00 New Revision: 24060db3a93297ca77abef8feae301af2e9163b5 URL: https://github.com/llvm/llvm-project/commit/24060db3a93297ca77abef8feae301af2e9163b5 DIFF: https://github.com/llvm/llvm-project/commit/24060db3a93297ca77abef8feae301af2e9163b5.diff

[clang] [clang][Interp] Consider bit width in IntegralAP::toAPSInt() (PR #71646)

2023-11-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

2023-11-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/71648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

2023-11-08 Thread Aaron Ballman via cfe-commits
@@ -256,28 +255,23 @@ template class IntegralAP final { } private: - static bool CheckAddUB(const IntegralAP &A, const IntegralAP &B, - unsigned BitWidth, IntegralAP *R) { -if (!A.isSigned()) { - R->V = A.V + B.V; + template class Op> +

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

2023-11-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Feel free to ignore the suggestions if you think they're not useful, but I tend to prefer not using a local variable for something used as a functor unless it's going to be reused. Generally LG but I'd prefer to hold off on approval until CI is green

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

2023-11-08 Thread Aaron Ballman via cfe-commits
@@ -256,28 +255,23 @@ template class IntegralAP final { } private: - static bool CheckAddUB(const IntegralAP &A, const IntegralAP &B, - unsigned BitWidth, IntegralAP *R) { -if (!A.isSigned()) { - R->V = A.V + B.V; + template class Op> +

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-08 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-11-08 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang] Fixes compile error that double colon operator cannot resolve macro with parentheses. (PR #68618)

2023-11-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, but please add a release note about the fix to clang/docs/ReleaseNotes.rst https://github.com/llvm/llvm-project/pull/68618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] 8569465 - Add a Clang NATVIS visualizer for StringLiteral

2023-11-12 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-11-12T09:22:15-05:00 New Revision: 8569465adf5e6c792e88be56b0e6b24f1c74e633 URL: https://github.com/llvm/llvm-project/commit/8569465adf5e6c792e88be56b0e6b24f1c74e633 DIFF: https://github.com/llvm/llvm-project/commit/8569465adf5e6c792e88be56b0e6b24f1c74e633.diff

Re: [clang] 8569465 - Add a Clang NATVIS visualizer for StringLiteral

2023-11-13 Thread Aaron Ballman via cfe-commits
x27;t use any of the accessors). ~Aaron > > On Sun, Nov 12, 2023 at 6:22 AM Aaron Ballman via cfe-commits > wrote: >> >> >> Author: Aaron Ballman >> Date: 2023-11-12T09:22:15-05:00 >> New Revision: 8569465adf5e6c792e88be56b0e6b24f1c74e633 >> >> UR

[clang] [clang] Use new interpreter in EvaluateAsConstantExpr if requested (PR #70763)

2023-11-14 Thread Aaron Ballman via cfe-commits
@@ -129,7 +129,13 @@ class ByteCodeExprGen : public ConstStmtVisitor, bool>, /// Classifies a type. std::optional classify(const Expr *E) const { -return E->isGLValue() ? PT_Ptr : classify(E->getType()); +if (E->isGLValue()) { + if (E->getType()->isFunctionTy

[clang] [clang][Interp] Fix stack peek offset for This ptr (PR #70663)

2023-11-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/70663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix variables refering to their own address (PR #70587)

2023-11-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, lol, yes, everything is possible in C. :-D https://github.com/llvm/llvm-project/pull/70587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang-tools-extra] [clang][AST] Fix crash in MatchChildASTVisitor::TraverseLambdaExpr (PR #70962)

2023-11-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > * @AaronBallman Having a nullptr init capture seems fishy, do we actually > mean to allow capturing vla by reference here? That does seem fishy to me -- I would expect VLA to behave the same as a constant-size array in terms of what we capture. So I think we do want to c

[clang] [clang] Use new interpreter in EvaluateAsConstantExpr if requested (PR #70763)

2023-11-14 Thread Aaron Ballman via cfe-commits
@@ -129,7 +129,13 @@ class ByteCodeExprGen : public ConstStmtVisitor, bool>, /// Classifies a type. std::optional classify(const Expr *E) const { -return E->isGLValue() ? PT_Ptr : classify(E->getType()); +if (E->isGLValue()) { + if (E->getType()->isFunctionTy

[clang] [clang] Use new interpreter in EvaluateAsConstantExpr if requested (PR #70763)

2023-11-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with unrelated changes pulled; I'm fine landing this PR after landing the fix for the function pointer classification changes if necessary. https://github.com/llvm/llvm-project/pull/70763 __

[clang] [clang] Add __has_feature(swiftcc) that checks whether the target supports the Swift calling convention (PR #72159)

2023-11-14 Thread Aaron Ballman via cfe-commits
@@ -99,6 +99,9 @@ FEATURE(memory_sanitizer, FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread)) FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow)) FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) +FEATURE(swiftcc, ---

[clang] [clang] Add __has_feature(swiftcc) that checks whether the target supports the Swift calling convention (PR #72159)

2023-11-14 Thread Aaron Ballman via cfe-commits
@@ -99,6 +99,9 @@ FEATURE(memory_sanitizer, FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread)) FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow)) FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) +FEATURE(swiftcc, ---

[clang] d554355 - Fix the NATVIS visualizer for FileEntry

2023-11-14 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-11-14T10:22:46-05:00 New Revision: d554355dce523ec4e06305519b83161beca0f417 URL: https://github.com/llvm/llvm-project/commit/d554355dce523ec4e06305519b83161beca0f417 DIFF: https://github.com/llvm/llvm-project/commit/d554355dce523ec4e06305519b83161beca0f417.diff

[clang] [clang][Interp] Fix classify for glvalues of function type (PR #72269)

2023-11-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/72269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread Aaron Ballman via cfe-commits
@@ -10044,6 +10044,8 @@ def warn_missing_case : Warning<"%plural{" "3:enumeration values %1, %2, and %3 not handled in switch|" ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, InGroup; +def warn_switch_default : Warning<"switch missing default case">, --

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I think there is value to adding this if only for the GCC compat story here. > I realize we don't like non-on-by-default warnings, but it IS something that > folks use reasonably often, and we've even acquiesced to making it an ignored > flag IIRC. Aaron is the real decis

[clang] [Clang] Emit TBAA info for enums in C (PR #73326)

2023-12-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > enums should be treated as 'int' types unless explicitly specified (C23) or > if 'int' would not be large enough to hold all the enumerated values. In the > latter case the compiler is free to choose a suitable integer that would hold > all such values. In C23, the enume

[clang] a855b2c - Formatting change; NFC

2023-12-05 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-12-05T14:43:49-05:00 New Revision: a855b2c89419c3689aff6fd0381fdeb02491 URL: https://github.com/llvm/llvm-project/commit/a855b2c89419c3689aff6fd0381fdeb02491 DIFF: https://github.com/llvm/llvm-project/commit/a855b2c89419c3689aff6fd0381fdeb02491.diff

[clang] Move documentation about -verify from a header to public docs (PR #73694)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman After moving the docs, none of the code blocks are rendering: > https://clang.llvm.org/docs/InternalsManual.html#verifying-diagnostics huh? there are zero sphinx diagnostics about the blocks, so that's exciting. https://github.com/llvm/llvm-project/pull/7369

[clang] Move documentation about -verify from a header to public docs (PR #73694)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Neato! `.. code-block: c++` should be: `.. code-block:: c++` -- did someone disable sphinx diagnostics or something? That should have been diagnosed... https://github.com/llvm/llvm-project/pull/73694 ___ cfe-commits mailing list cf

[clang] a9673bd - Fix code blocks so that they render properly

2023-12-06 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-12-06T07:41:31-05:00 New Revision: a9673bd1ca217e46800f3c2b705c1bed01fdc457 URL: https://github.com/llvm/llvm-project/commit/a9673bd1ca217e46800f3c2b705c1bed01fdc457 DIFF: https://github.com/llvm/llvm-project/commit/a9673bd1ca217e46800f3c2b705c1bed01fdc457.diff

[clang] e8ce188 - Fix a cross reference

2023-12-06 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-12-06T07:49:03-05:00 New Revision: e8ce1889eee83eb03fbd8d2dc1627f0e97fd26f0 URL: https://github.com/llvm/llvm-project/commit/e8ce1889eee83eb03fbd8d2dc1627f0e97fd26f0 DIFF: https://github.com/llvm/llvm-project/commit/e8ce1889eee83eb03fbd8d2dc1627f0e97fd26f0.diff

[clang] Move documentation about -verify from a header to public docs (PR #73694)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > It would also be nice to fix the link to full `-verify` docs in > https://clang.llvm.org/docs/InternalsManual.html#the-diagnosticconsumer-interface Done. https://github.com/llvm/llvm-project/pull/73694 ___ cfe-commits mailing li

[clang] [clang] Strict aliasing warning ala GCC [PR50066] (PR #74155)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > FWIW the GCC doc is > > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict-aliasing_003dn > > It says for Level 3 "If optimization is enabled, it also runs in the back > > end, where it deals with multiple statement cases using flow-sensitive > > poi

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -482,7 +482,7 @@ def MainReturnType : DiagGroup<"main-return-type">; def MaxUnsignedZero : DiagGroup<"max-unsigned-zero">; def MissingBraces : DiagGroup<"missing-braces">; def MissingDeclarations: DiagGroup<"missing-declarations">; -def : DiagGroup<"missing-format-attribute"

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -6849,6 +6849,71 @@ static void handleSwiftAsyncAttr(Sema &S, Decl *D, const ParsedAttr &AL) { checkSwiftAsyncErrorBlock(S, D, ErrorAttr, AsyncAttr); } +// Warn if parent function misses format attribute. Parent function misses +// format attribute if there is an argum

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,58 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -Wmissing-format-attribute %s + +#include +#include + +__attribute__((__format__ (__scanf__, 1, 4))) +void f1(char *out, const size_t len,

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,58 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -Wmissing-format-attribute %s AaronBallman wrote: ```suggestion ``` Our default is C17 and there's no C99-specific logic to

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -936,6 +936,9 @@ def err_opencl_invalid_param : Error< def err_opencl_invalid_return : Error< "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">; def warn_enum_value_overflow : Warning<"overflow in enumeration value">; +def warn_m

[clang] [clang] Catch missing format attributes (PR #70024)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -6849,6 +6849,71 @@ static void handleSwiftAsyncAttr(Sema &S, Decl *D, const ParsedAttr &AL) { checkSwiftAsyncErrorBlock(S, D, ErrorAttr, AsyncAttr); } +// Warn if parent function misses format attribute. Parent function misses +// format attribute if there is an argum

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1894,6 +1894,8 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, case attr::ArmMveStrictPolymorphism:

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -8938,6 +8957,11 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, attr.setUsedAsTypeAttr();

[clang] [Clang] Emit TBAA info for enums in C (PR #73326)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Do you think it's worth adding something to the Clang release note? Yes, please! https://github.com/llvm/llvm-project/pull/73326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Add separate C++23 extension flag for attrs on lambda (PR #74553)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Changes LGTM but we should probably document this extension at this point. Can you add this to the table at: https://github.com/llvm/llvm-project/blob/546a9ce80cac8fe73d239496010ae84972da3ca8/clang/docs/LanguageExtensions.rst?plain=1#L1455 https://git

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -3341,7 +3341,7 @@ def RequiresCapability : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Should this only apply in C23 mode? Standard behavior until C23 is that > `_Float16` promotes to `double`. What about C++? `_Float16` wasn't standardized until C23; before then it was part of TS 18661, but we never claimed conformance to that (that I'm aware of), so I thi

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

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

[llvm] [clang] [clang-tools-extra] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -802,9 +845,25 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, } } } else { + InitListExpr *SForm = + ILE->isSyntacticForm() ? ILE : ILE->getSyntacticForm(); // The fields beyond ILE->getNumInits() are d

[llvm] [clang-tools-extra] [clang] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

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

[clang] [llvm] [clang-tools-extra] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -802,9 +845,25 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, } } } else { + InitListExpr *SForm = + ILE->isSyntacticForm() ? ILE : ILE->getSyntacticForm(); // The fields beyond ILE->getNumInits() are d

[llvm] [clang-tools-extra] [clang] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I think the changes here look reasonable. CC @zygoloid to make sure he agrees as there's still one potentially outstanding comment (if we don't hear back from Richard, I think we can address his concerns post-commit as it seems like a refactoring rath

[llvm] [clang] [Sema] Implement support for -Wformat-signedness (PR #74440)

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

[llvm] [clang] [Sema] Implement support for -Wformat-signedness (PR #74440)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -264,6 +264,8 @@ class ArgType { /// The conversion specifier and the argument type are compatible. For /// instance, "%d" and int. Match = 1, +/// The conversion specifier and the argument type have different sign AaronBallman wrote: ```sug

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'd like to understand the need for this diagnostic a bit more. I realize GCC has it, but it's off-by-default in GCC and `-Wformat` does not enable it either: https://godbolt.org/z/Gxczsjdj5 We believe that users don't enable off by default warnings o

[llvm] [clang] [Sema] Implement support for -Wformat-signedness (PR #74440)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -918,6 +918,9 @@ def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">; def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, Visibility<[ClangOption, CC1Option]>; +def Wformat_signedness

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,844 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,362 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,362 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,844 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: FWIW, there were other comments from a previous round of review that didn't get addressed (GitHub may have helpfully hidden them from view for you -- I had to click on a "More" button to get them to show for me.) https://github.com/llvm/llvm-project/p

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,844 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,844 @@ +== +``-fbounds-safety``: Enforcing bounds safety for C +== + +.. contents:: + :local: + +Overview + + +``-fbounds-safety`` is a C extension to enforce bound

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I'd like to understand the need for this diagnostic a bit more. I realize > > GCC has it, but it's off-by-default in GCC and `-Wformat` does not enable > > it either: https://godbolt.org/z/Gxczsjdj5 > > We believe that users don't enable off by default warnings often eno

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

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

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -3806,6 +3840,21 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, return handler.found(Index ? O->getComplexFloatImag() : O->getComplexFloatReal(), ObjType); } +} else if (ObjType->isVectorType()

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: You should also add a release note about the changes. https://github.com/llvm/llvm-project/pull/72607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -8721,15 +8771,63 @@ bool LValueExprEvaluator::VisitMemberExpr(const MemberExpr *E) { return LValueExprEvaluatorBaseTy::VisitMemberExpr(E); } +bool LValueExprEvaluator::VisitExtVectorElementExpr( +const ExtVectorElementExpr *E) { + bool Success = true; + + APValue

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -221,6 +221,12 @@ namespace { ArraySize = 2; MostDerivedLength = I + 1; IsArray = true; + } else if (Type->isVectorType()) { +const auto *VT = Type->castAs(); AaronBallman wrote: ```suggestion } else if (const auto

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -8721,15 +8771,63 @@ bool LValueExprEvaluator::VisitMemberExpr(const MemberExpr *E) { return LValueExprEvaluatorBaseTy::VisitMemberExpr(E); } +bool LValueExprEvaluator::VisitExtVectorElementExpr( +const ExtVectorElementExpr *E) { + bool Success = true; + + APValue

[libcxxabi] [libc] [mlir] [clang] [libunwind] [libcxx] [clang-tools-extra] [openmp] [lldb] [lld] [llvm] [flang] [Clang][Sema] Don't say "is declared here" for invalid template locations (PR #71264)

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

[llvm] [lldb] [mlir] [libc] [libcxx] [openmp] [libunwind] [clang-tools-extra] [flang] [libcxxabi] [lld] [clang] [Clang][Sema] Don't say "is declared here" for invalid template locations (PR #71264)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. I like the behavior of this and the changes LGTM, but please give @ErichKeane a chance to weigh in as templates code owner before landing. https://github.com/llvm/llvm-project/pull/71264 ___

[llvm] [libcxxabi] [lld] [clang-tools-extra] [clang] [openmp] [libc] [libcxx] [libunwind] [lldb] [mlir] [flang] [Clang][Sema] Don't say "is declared here" for invalid template locations (PR #71264)

2023-12-06 Thread Aaron Ballman via cfe-commits
@@ -898,8 +895,9 @@ void Sema::DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl) { // Make this a warning when MSVC compatibility is requested. unsigned DiagId = getLangOpts().MSVCCompat ? diag::ext_template_param_shadow

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

2023-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a testing request https://github.com/llvm/llvm-project/pull/72984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang][Interp] Implement __builtin_rotate{right, left} (PR #72984)

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

<    1   2   3   4   5   6   7   8   9   10   >