[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

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

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

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -501,6 +501,9 @@ Improvements to Clang's diagnostics - Clang emits a ``-Wparentheses`` warning for expressions with consecutive comparisons like ``x < y < z``. Fixes #GH20456. +- Clang now diagnoses missing format attributes for non-template functions and +

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

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,277 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s + +typedef unsigned short char16_t; +typedef unsigned int char32_t; +typedef __WCHAR_TYPE__ wchar_t; +typedef __SIZE_TYPE__ size_t; +typedef __builtin_va_list va_list; +

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

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -7131,6 +7138,114 @@ static void handleSwiftAsyncAttr(Sema , Decl *D, const ParsedAttr ) { checkSwiftAsyncErrorBlock(S, D, ErrorAttr, AsyncAttr); } +// This function is called only if function call is not inside template body. +// TODO: Add call for function calls

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

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,277 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-format-attribute %s + +typedef unsigned short char16_t; +typedef unsigned int char32_t; +typedef __WCHAR_TYPE__ wchar_t; +typedef __SIZE_TYPE__ size_t; +typedef __builtin_va_list va_list; +

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

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,303 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,beforeCxx2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++23 -Wmissing-format-attribute %s

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

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

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec , ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else if

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-31 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. I think the changes are reasonable, but I'd like to wait a bit before landing to give @erichkeane a chance to review as templates code owner. https://github.com/llvm/llvm-project/pull/80801

[clang] [clang] require template arg list after template kw (PR #80801)

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

[clang] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-05-31 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Ah thank you for pointing that out, I had missed some updates on that thread. I think `defined(__wasi__)` would address my concerns. @MaskRay asked a good question about whether we should tie this to `LLVM_ON_UNIX` as well and I don't have a strong intuition there, but my

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-31 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > How do I reopen the PR after fixing the test case? AIUI, you cannot reopen a merged PR, you have to start a new PR and mention the old one to link the two together. https://github.com/llvm/llvm-project/pull/81545 ___

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-31 Thread Aaron Ballman via cfe-commits
@@ -1329,6 +1341,100 @@ bool Preprocessor::LexAfterModuleImport(Token ) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name

[clang] [clang] ``README.txt``: Replace the link to the old bug tracker with the new one. (PR #93878)

2024-05-31 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Do you need someone to land this on your behalf? https://github.com/llvm/llvm-project/pull/93878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] remove goma support from clang (PR #93942)

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

[clang] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-05-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Comments in the config file isn't a harmful thing, but I'm also worried about folks who never see the config file. e.g., they're working in Path.inc on something, see `HAVE_PWD_H` in the code, and just make assumptions from there. So perhaps a two-pronged approach: a

[clang] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

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

[clang] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Sorry for not responding sooner, but I think this approach makes sense to me. It's basically similar to autoconf where we're checking whether a feature is supported and guarding against it. One concern I have is that someone adding new code may think

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

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -92,3 +92,43 @@ 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] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -92,3 +92,43 @@ 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] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -92,3 +92,43 @@ 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] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -67,15 +67,13 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to

[clang] [flang] [mlir] Avoid object libraries in the VS IDE (PR #93519)

2024-05-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I applied the patch locally and tried it out, and I think this is an improvement for folks generating VS solutions. https://github.com/llvm/llvm-project/pull/93519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -1064,6 +1090,8 @@ void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) { prettyPrintAttributes(D); + if (const char *lang = tryGetUnbracedLinkageLanguage(D)) +Out << "extern \"" << lang << "\";";

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -662,6 +678,11 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { CXXConversionDecl *ConversionDecl = dyn_cast(D); CXXDeductionGuideDecl *GuideDecl = dyn_cast(D); if (!Policy.SuppressSpecifiers) { +if (const char *lang = tryGetUnbracedLinkageLanguage(D)) {

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-30 Thread Aaron Ballman via cfe-commits
@@ -932,6 +953,11 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { : D->getASTContext().getUnqualifiedObjCPointerType(D->getType()); if (!Policy.SuppressSpecifiers) { +if (const char *lang = tryGetUnbracedLinkageLanguage(D)) { + // the "extern" specifier is

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from some coding style nits. Because AST printing is not part of the public interface for Clang, I don't think these changes need a release note. https://github.com/llvm/llvm-project/pull/93131

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

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

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

2024-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Adding @jyknight because of our discussions on related behavior regarding `DefaultError` diagnostics and suppression. https://github.com/llvm/llvm-project/pull/93647 ___ cfe-commits mailing list

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

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

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

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

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

2024-05-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! Please add a release note to clang/docs/ReleaseNotes.rst so users know about the behavioral change. Also, should we update some documentation as well? https://github.com/llvm/llvm-project/pull/93647

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

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

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

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

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-29 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,36 @@ +//===- Attr.h --- Helper functions for attribute handling in Sema -===// +// +// 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] require template arg list after template kw (PR #80801)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec , ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else if

[clang] [clang] require template arg list after template kw (PR #80801)

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

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! The changes should also come with a release note in clang/docs/ReleaseNotes.rst so users know about the change. https://github.com/llvm/llvm-project/pull/80801 ___ cfe-commits mailing

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

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

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator , D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this.

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types + /// AND the ParsedAttr. + template + static std::enable_if_t, SourceLocation> + getAttrLoc(const AttrInfo ) {

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -817,11 +817,11 @@ class alignas(8) Decl { "owned local decl but no local module storage"); return reinterpret_cast(this)[-1]; } - void setLocalOwningModule(Module *M) { + void setLocalOwningModule(const Module *M) { AaronBallman wrote:

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > My philosophy on problems like that is that the first step to getting out of > a hole is to stop digging the hole. We aren't going to make all of clang > const-correct overnight, right? Yup! I think we're in agreement with the long-term goal and how we get there. The

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: You don't have to convince me that being const-correct is a good thing, I'm already in full support of that. :-) The push back isn't "no, don't do this", it's "we're not const correct in a *lot* of places and so adding const correctness to a part of the compiler without

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types + /// AND the ParsedAttr. + template + static std::enable_if_t, SourceLocation> + getAttrLoc(const AttrInfo ) {

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

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

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: In general, I'm in favor of improving const-correctness like this. That said, I share the concerns of other reviewers that we should be sure we're adding const-correctness where it makes sense to do so. e.g., functions named `getSomething()` that

[clang] 273777e - clang:: to llvm::; NFC

2024-05-28 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-05-28T12:05:55-04:00 New Revision: 273777ead296c9ab2c157d16b750e3ee1ace08ec URL: https://github.com/llvm/llvm-project/commit/273777ead296c9ab2c157d16b750e3ee1ace08ec DIFF: https://github.com/llvm/llvm-project/commit/273777ead296c9ab2c157d16b750e3ee1ace08ec.diff

[clang] [ASTMatchers] forCallable should not erase binding on success (PR #89657)

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

[clang] [ASTMatchers] forCallable should not erase binding on success (PR #89657)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes look reasonable to me, but can you also add a release note to clang/docs/ReleaseNotes.rst so that users of AST matchers know about the fix? https://github.com/llvm/llvm-project/pull/89657 ___

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I think we're going to be printing incorrect code either way, but with this patch, we're more likely to be closer to the original intent of the code than without the patch. So even though this isn't perfect, it's forward progress and I think we're

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s + +// CHECK: extern "C" int printf(const char *, ...); +extern "C" int printf(const char *...); + +// CHECK: extern "C++" { AaronBallman wrote: Oofda, there are differences between the braced

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

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

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -4845,6 +4845,55 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState , // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto isClassType =

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -7525,6 +7525,8 @@ def err_explicit_object_parameter_mutable: Error< def err_invalid_explicit_object_type_in_lambda: Error< "invalid explicit object parameter type %0 in lambda with capture; " "the type must be the same as, or derived from, the lambda">; +def

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -4845,6 +4845,55 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState , // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto isClassType =

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

2024-05-28 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-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Precommit CI failure is unrelated to your changes. https://github.com/llvm/llvm-project/pull/92767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -1086,45 +1106,100 @@ void TextNodeDumper::VisitNullTemplateArgument(const TemplateArgument &) { void TextNodeDumper::VisitTypeTemplateArgument(const TemplateArgument ) { OS << " type"; - dumpType(TA.getAsType()); + dumpTemplateArgument(TA); } void

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

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

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Should we also be updating JSONNodeDumper.cpp at the same time? https://github.com/llvm/llvm-project/pull/93431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument ) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

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

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -239,7 +239,10 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes( auto IsStmtAttr = [](ParsedAttr ) { return Attr.isStmtAttr(); }; bool AllAttrsAreStmtAttrs = llvm::all_of(CXX11Attrs, IsStmtAttr) &&

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

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/92908 >From 219dae02c3235c17bc4568496a7df9763d798e2a Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 20 May 2024 13:40:28 -0400 Subject: [PATCH 1/5] [C] Fix declaration parsing

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

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/92908 >From 219dae02c3235c17bc4568496a7df9763d798e2a Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 20 May 2024 13:40:28 -0400 Subject: [PATCH 1/4] [C] Fix declaration parsing

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

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

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

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

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

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

[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

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