[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH 1/5] Diagnose problematic diagnostic messages Clang has

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH 1/4] Diagnose problematic diagnostic messages Clang has

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH 1/3] Diagnose problematic diagnostic messages Clang has

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH 1/3] Diagnose problematic diagnostic messages Clang has

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-23 Thread Aaron Ballman via cfe-commits
@@ -1355,7 +1357,7 @@ static void verifyDiagnosticWording(const Record ) { if (isDigit(FullDiagText.back()) && *(FullDiagText.end() - 2) == '}') { // Scan backwards to find the opening curly brace. size_t BraceCount = 1; -auto Iter = FullDiagText.end() - /*}0*/

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH 1/2] Diagnose problematic diagnostic messages Clang has

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-23 Thread Aaron Ballman via cfe-commits
@@ -1213,6 +1213,194 @@ static bool isRemark(const Record ) { return ClsName == "CLASS_REMARK"; } +// Presumes the text has been split at the first whitespace or hyphen. +static bool isExemptAtStart(StringRef Text) { + // Fast path, the first character is lowercase or not

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/93229 >From 38d6d9b809e1cf9d6a8f577630c838421486cd04 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 23 May 2024 14:55:16 -0400 Subject: [PATCH] Diagnose problematic diagnostic messages Clang has some

[clang] 10be6c9 - Fix an accidental escape sequence in a unit test

2024-05-23 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-23T15:52:15-04:00 New Revision: 10be6c96b831a3511d2b381d5e1130d6b7e3e2ff URL: https://github.com/llvm/llvm-project/commit/10be6c96b831a3511d2b381d5e1130d6b7e3e2ff DIFF: https://github.com/llvm/llvm-project/commit/10be6c96b831a3511d2b381d5e1130d6b7e3e2ff.diff

[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)

2024-05-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/93229 Clang has some unwritten rules about diagnostic wording regarding things like punctuation and capitalization. This patch documents those rules and adds some tablegen support for checking diagnostics follow

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

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

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits
@@ -10362,12 +10362,12 @@ def err_shufflevector_argument_too_large : Error< "index for __builtin_shufflevector must be less than the total number " "of vector elements">; def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error< - "index for

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits
@@ -4526,7 +4526,7 @@ def err_objc_attr_typedef_not_void_pointer : Error< def err_objc_cf_bridged_not_interface : Error< "CF object of type %0 is bridged to %1, which is not an Objective-C class">; def err_objc_ns_bridged_invalid_cfobject : Error< - "ObjectiveC object of

[clang] [Clang] Only check exprs that might be immediate escalating in evaluated contexts (PR #93187)

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

[clang] [Clang] Only check exprs that might be immediate escalating in evaluated contexts (PR #93187)

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

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Despite not showing up in the list of precommit CI checks for some reason, this did pass testing: https://buildkite.com/llvm-project/github-pull-requests/builds/66650 https://github.com/llvm/llvm-project/pull/93190 ___

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits
@@ -337,7 +337,7 @@ def warn_atomic_op_oversized : Warning< InGroup; def warn_sync_op_misaligned : Warning< - "__sync builtin operation MUST have natural alignment (consider using __atomic).">, + "__sync builtin operation MUST have natural alignment (consider using

[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: All of the issues were found using some new tooling I've not yet put up for review. The changes were largely mechanical (uppercase->lowercase, remove trailing punctuation), but there were some surgical fixes to grammar, punctuation, etc. Also, if the diagnostic was not

[clang] [Clang] [NFC] Clarify assume diagnostic (PR #93077)

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

[clang] [Clang] [NFC] Clarify assume diagnostic (PR #93077)

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

[clang] cc3b6c3 - Fix more diagnostic wording for style; NFC

2024-05-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-22T13:43:34-04:00 New Revision: cc3b6c3ba9c0dd7df0fd7ac23c8609c4675dd62a URL: https://github.com/llvm/llvm-project/commit/cc3b6c3ba9c0dd7df0fd7ac23c8609c4675dd62a DIFF: https://github.com/llvm/llvm-project/commit/cc3b6c3ba9c0dd7df0fd7ac23c8609c4675dd62a.diff

[clang] f203cb0 - Fix a benign typo in a test; NFC

2024-05-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-22T13:17:56-04:00 New Revision: f203cb03d93240cfd79e603b742006f96227a00b URL: https://github.com/llvm/llvm-project/commit/f203cb03d93240cfd79e603b742006f96227a00b DIFF: https://github.com/llvm/llvm-project/commit/f203cb03d93240cfd79e603b742006f96227a00b.diff

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-22 Thread Aaron Ballman via cfe-commits
@@ -3123,10 +3172,28 @@ bool ByteCodeExprGen::VisitCallExpr(const CallExpr *E) { } } + std::optional CalleeOffset; // Add the (optional, implicit) This pointer. if (const auto *MC = dyn_cast(E)) { -if (!this->visit(MC->getImplicitObjectArgument())) -

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-22 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,112 @@ +//===- MemberPointer.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:

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-22 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,112 @@ +//===- MemberPointer.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:

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-22 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,112 @@ +//===- MemberPointer.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:

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-22 Thread Aaron Ballman via cfe-commits
@@ -3123,10 +3172,28 @@ bool ByteCodeExprGen::VisitCallExpr(const CallExpr *E) { } } + std::optional CalleeOffset; // Add the (optional, implicit) This pointer. if (const auto *MC = dyn_cast(E)) { -if (!this->visit(MC->getImplicitObjectArgument())) -

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: It gets set a few lines down for `Compound`: `Compound = AllowDeclarationsInC | AllowStandaloneOpenMPDirectives` https://github.com/llvm/llvm-project/pull/92908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 87a6865 - Fix another diagnostic wording for style; NFC

2024-05-21 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-21T15:14:03-04:00 New Revision: 87a6865d2c8eba802a7e9f42fa8b6ac1edd0664e URL: https://github.com/llvm/llvm-project/commit/87a6865d2c8eba802a7e9f42fa8b6ac1edd0664e DIFF: https://github.com/llvm/llvm-project/commit/87a6865d2c8eba802a7e9f42fa8b6ac1edd0664e.diff

[clang] 32cf7a2 - Fix another diagnostic for style; NFC

2024-05-21 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-21T15:03:26-04:00 New Revision: 32cf7a25f2f8174bc448ae7032e419dc0375fd6a URL: https://github.com/llvm/llvm-project/commit/32cf7a25f2f8174bc448ae7032e419dc0375fd6a DIFF: https://github.com/llvm/llvm-project/commit/32cf7a25f2f8174bc448ae7032e419dc0375fd6a.diff

[clang] 01c600d - Reword a diagnostic for style; NFC

2024-05-21 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-21T15:01:13-04:00 New Revision: 01c600dec6f506ae305abf04cf955e08aa59b234 URL: https://github.com/llvm/llvm-project/commit/01c600dec6f506ae305abf04cf955e08aa59b234 DIFF: https://github.com/llvm/llvm-project/commit/01c600dec6f506ae305abf04cf955e08aa59b234.diff

[clang] ce1d28e - Fix diagnostic wording style; NFC

2024-05-21 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-21T14:47:15-04:00 New Revision: ce1d28e645b53ba9518d295dad35a4578dd8e8dc URL: https://github.com/llvm/llvm-project/commit/ce1d28e645b53ba9518d295dad35a4578dd8e8dc DIFF: https://github.com/llvm/llvm-project/commit/ce1d28e645b53ba9518d295dad35a4578dd8e8dc.diff

[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -8497,7 +8498,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, << 0 << AdjustedNumArgs << static_cast(Args.size()) << /*is non object*/ 0 << ExprRange; return ExprError(); - } else if (Args.size() > AdjustedNumArgs) {

[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -8544,6 +8546,13 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, } } + // pointer to object of size zero is not allowed AaronBallman wrote: ```suggestion // Pointer to object of size zero is not allowed. ```

[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -330,6 +330,9 @@ def warn_atomic_op_misaligned : Warning< "; the expected alignment (%0 bytes) exceeds the actual alignment (%1 bytes)">, InGroup; +def err_atomic_op_size_zero : Error< AaronBallman wrote: Rather than introduce a new diagnostic, I

[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for the fix! Please be sure to add a release note to clang/docs/ReleaseNotes.rst so users know about the improved behavior. https://github.com/llvm/llvm-project/pull/91057 ___ cfe-commits mailing

[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

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

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -269,7 +267,10 @@ const char *const Runtimes = R"( void __clang_Interpreter_SetValueCopyArr(const T (*Src)[N], void* Placement, unsigned long Size) { __clang_Interpreter_SetValueCopyArr(Src[0], Placement, Size); } +extern "C" AaronBallman

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

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

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, feel free to apply my suggestion if you like it. https://github.com/llvm/llvm-project/pull/89811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

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

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -42,6 +42,9 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Host.h" + +#include AaronBallman wrote: `` instead? https://github.com/llvm/llvm-project/pull/89811

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Generally looks good, but it seems that some parts of this PR are also incorporated into another PR, so it's a bit hard to review. https://github.com/llvm/llvm-project/pull/89811 ___ cfe-commits mailing list

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I have no idea whether that returns a `SourceLocation`, a `PresumedLoc`, a > > `FullSourceLoc`, etc, so I don't think that is a use of `auto` I would want > > to have to reason about as a reviewer. That said, if the only use of `loc` > > is: `Diag(loc,

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > What part of the "camelBack" is visible to the user of the API? (we're not > talking about method names or class names here I believe) Parameter names, which show up in tooltips in IDEs, etc. But again, the important thing is to at least be self-consistent. e.g., ```

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with a possible improvement in the code (take it or leave it, your call). https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit ) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +auto *ND = dyn_cast(D); +if (!ND) + continue; +// Check if we

[clang] [clang-repl] Extend the C support. (PR #89804)

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

[clang] [clang] Introduce `SemaAccess` (PR #92674)

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

[clang] [clang] Introduce `SemaAccess` (PR #92674)

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

[clang] [clang] Introduce `SemaAccess` (PR #92674)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -1459,11 +1460,11 @@ static AccessResult CheckEffectiveAccess(Sema , llvm_unreachable("invalid access result"); } -static Sema::AccessResult CheckAccess(Sema , SourceLocation Loc, - AccessTarget ) { +static SemaAccess::AccessResult

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Also, please be sure to add a release note about the new functionality. https://github.com/llvm/llvm-project/pull/91306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

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

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -1176,6 +1176,12 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def SelectVector : Builtin { + let Spellings = ["__builtin_selectvector"]; + let Attributes = [NoThrow, Const, CustomTypeChecking]; AaronBallman wrote: Should this also

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -3013,6 +3013,62 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, break; } + case Builtin::BI__builtin_selectvector: { +if (checkArgCount(*this, TheCall, 3)) + return ExprError(); + +ExprResult LHS = TheCall->getArg(0); +

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -3013,6 +3013,62 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, break; } + case Builtin::BI__builtin_selectvector: { +if (checkArgCount(*this, TheCall, 3)) + return ExprError(); + +ExprResult LHS = TheCall->getArg(0); +

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'm less certain, but CC @jdoerfert @mikerice1969 for more opinions. The original changes actually fixed a bug in OpenMP related to standalone directives. > Note, this seems to have fixed an issue with some OpenMP stand-alone directives not being properly diagnosed as per:

[clang] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes generally LG, but there's a merge conflict preventing the PR from going through precommit CI. https://github.com/llvm/llvm-project/pull/92767 ___ cfe-commits mailing list

[clang] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -2092,8 +2096,8 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; -LLVM_PREFERRED_TYPE(bool) -unsigned IsUnqual : 1; // If true: typeof_unqual, else: typeof +

[clang] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

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

[clang] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-05-21 Thread Aaron Ballman via cfe-commits
@@ -92,3 +92,35 @@ extern __attribute__((address_space(0))) int type_attr_test_2; // expec void invalid_param_fn(__attribute__((address_space(1))) int i); // expected-error {{parameter may not be qualified with an address space}} typeof(invalid_param_fn)

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/92908 This fixes a regression introduced in 8bd06d5b65845e5e01dd899a2deb773580460b89 where Clang began to accept a declaration where a statement is required. e.g., ``` if (1) int x; // Previously accepted, now

[clang] [clang] Introduce `SemaPseudoObject` (PR #92646)

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

[clang] [clang] Introduce `SemaPseudoObject` (PR #92646)

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

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: FWIW, I landed 3591da9f1ccbd8b19fef4814f96638dbbe9c2b40 to address testing issues on Windows. https://github.com/llvm/llvm-project/pull/91446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 3591da9 - Fix test for non-Itanium ABIs.

2024-05-20 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-20T14:23:17-04:00 New Revision: 3591da9f1ccbd8b19fef4814f96638dbbe9c2b40 URL: https://github.com/llvm/llvm-project/commit/3591da9f1ccbd8b19fef4814f96638dbbe9c2b40 DIFF: https://github.com/llvm/llvm-project/commit/3591da9f1ccbd8b19fef4814f96638dbbe9c2b40.diff

[clang] [llvm] Disable compiling and testing Flang on Clang changes (PR #92740)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -68,7 +68,7 @@ function compute-projects-to-test() { done ;; clang) - for p in clang-tools-extra compiler-rt flang lldb cross-project-tests; do + for p in clang-tools-extra compiler-rt lldb cross-project-tests; do AaronBallman wrote:

[clang] [llvm] Disable compiling and testing Flang on Clang changes (PR #92740)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -68,7 +68,7 @@ function compute-projects-to-test() { done ;; clang) - for p in clang-tools-extra compiler-rt flang lldb cross-project-tests; do + for p in clang-tools-extra compiler-rt lldb cross-project-tests; do AaronBallman wrote:

[clang] [llvm] Disable compiling and testing Flang on Clang changes (PR #92740)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -68,7 +68,7 @@ function compute-projects-to-test() { done ;; clang) - for p in clang-tools-extra compiler-rt flang lldb cross-project-tests; do + for p in clang-tools-extra compiler-rt lldb cross-project-tests; do AaronBallman wrote:

[clang] [llvm] Disable compiling Flang and running its tests on Clang changes (PR #92740)

2024-05-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please add more of a description to the patch summary so it's clear why these changes are being made. https://github.com/llvm/llvm-project/pull/92740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit ) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -2282,7 +2282,8 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { // Remove this name from our lexical scope, and warn on it if we haven't // already. -IdResolver.RemoveDecl(D); +if (!PP.isIncrementalProcessingEnabled()) +

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Aaron Ballman via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit ) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the

[clang] [clang] Introduce `SemaCoroutine` (PR #92645)

2024-05-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > What is the goal here? The eventual goal is for Sema to have appropriate layering instead of being a monolithic design. "Appropriate layering" can be handled in many different ways, but the goal when this was discussed extensively in the past was to split by "category"

[clang] [clang] Introduce `SemaCodeCompletion` (PR #92311)

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

[clang] [clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr` (PR #92277)

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

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -2282,7 +2282,8 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { // Remove this name from our lexical scope, and warn on it if we haven't // already. -IdResolver.RemoveDecl(D); +if (!PP.isIncrementalProcessingEnabled()) +

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit ) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

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

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr { let Documentation = [CXX11NoReturnDocs]; } +def NonBlocking : TypeAttr { + let Spellings = [CXX11<"clang", "nonblocking">, AaronBallman wrote: Present Aaron thanks you and Past Aaron apologized

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] [clang-tools-extra] [llvm] [clang-query] Remove support for srcloc output (PR #92442)

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

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -1527,20 +1527,20 @@ struct DeclaratorChunk { /// Retrieve the location of the 'const' qualifier. SourceLocation getConstQualifierLoc() const { - assert(MethodQualifiers); - return MethodQualifiers->getConstSpecLoc(); + return MethodQualifiers ?

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(),

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -487,6 +487,9 @@ Improvements to Clang's diagnostics } }; +- Clang emits a ``-Wparentheses`` warning for expressions with consecutive comparisons like ``x < y < z``. + It was made a ``-Wparentheses`` warning to be consistent with gcc.

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a small nit with the release notes. https://github.com/llvm/llvm-project/pull/92200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

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

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Aaron Ballman via cfe-commits
@@ -215,3 +215,10 @@ namespace PR20735 { // fix-it:"{{.*}}":{[[@LINE-9]]:20-[[@LINE-9]]:20}:")" } } + +void consecutive_builtin_compare(int x, int y, int z) { + (void)(x < y < z); // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr { let Documentation = [CXX11NoReturnDocs]; } +def NonBlocking : TypeAttr { + let Spellings = [CXX11<"clang", "nonblocking">, AaronBallman wrote: Yeah, Present Aaron regrets Past Aaron's caution

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr { let Documentation = [CXX11NoReturnDocs]; } +def NonBlocking : TypeAttr { + let Spellings = [CXX11<"clang", "nonblocking">, AaronBallman wrote: CC @erichkeane `clang_builtin_alias` is the only

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -4381,11 +4381,13 @@ class PackIndexingExpr final PackIndexingExpr(QualType Type, SourceLocation EllipsisLoc, SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr, - ArrayRef SubstitutedExprs = {}) +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID , const ASTContext ) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID , const ASTContext ) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -3649,6 +3649,35 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto = *getTrailingObjects(); +const size_t EffectsCount

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-16 Thread Aaron Ballman via cfe-commits
@@ -2743,3 +2759,153 @@ bool Sema::isDeclaratorFunctionLike(Declarator ) { }); return Result; } + +FunctionEffectDifferences::FunctionEffectDifferences( +const FunctionEffectsRef , const FunctionEffectsRef ) { + + FunctionEffectsRef::iterator POld = Old.begin(); +

  1   2   3   4   5   6   7   8   9   10   >