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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,174 @@ +// 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 #105479)

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,174 @@ +// 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-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
@@ -534,6 +534,8 @@ TEST(WalkAST, Enums) { testWalk(R"(namespace ns { enum E { A = 42 }; } struct S { using ns::E::A; };)", "int e = S::^A;"); + testWalk(R"(namespace ns { enum E { $explicit^A = 42 }; })", + "namespace z = ns; int e = z::^A

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. LGTM. See a small suggestion about adding another test too. https://github.com/llvm/llvm-project/pull/106706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-08-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/106658 >From 5ee1d2e03be855f5cbdd3d1555860f7d4205ebe2 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Thu, 29 Aug 2024 20:36:05 -0700 Subject: [PATCH] [TableGen] Add const variants of accessors for backend Split Reco

[clang] [clang][bytecode] Implement __noop (PR #106714)

2024-08-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/106714 This does nothing and returns 0. >From 45d97a71f5e76091234d0d919db4cb605d2d1949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 30 Aug 2024 13:45:37 +0200 Subject: [PATCH] [clang][bytec

[clang] [clang][bytecode] Implement __noop (PR #106714)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes This does nothing and returns 0. --- Full diff: https://github.com/llvm/llvm-project/pull/106714.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+4) - (modified) clang/test/A

[clang] [compiler-rt] [libcxx] [lldb] [llvm] Rename Sanitizer Coverage => Coverage Sanitizer (PR #106505)

2024-08-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this; it's a minor inconsistency, but a needless one as best I can tell. The changes mostly look good, but there are a bunch of binary files (.exe) that seem to have changed; do you know why? https://github.com/llvm/llvm-proje

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

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

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this, the changes mostly LGTM aside from some minor nits. https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -336,13 +337,24 @@ a starting point for your test cases. A rough outline of the process looks like The quickest way to prototype your matcher is to use :program:`clang-query` to interactively build up your matcher. For complicated matchers, build up a matching expression

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -646,10 +658,13 @@ directory. The path to this directory is available in a lit test with the varia Out-of-tree check plugins - + Developing an out-of-tree check as a plugin largely follows the steps -outlined above. The plugin is a shared library

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-08-30 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-08-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > Was this discussed/reviewed/motivated? There are drawbacks to this > > > > approach outlined in #72383 > > > > @iains @jyknight @AaronBallman @Bigcheese > > > > > > > > > The motivation is in #72383 and I comment in [#72383 > > > (comment)](https://github.com/llvm/

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
https://github.com/ivanaivanovska updated https://github.com/llvm/llvm-project/pull/103039 >From 6d3e4470dfe21f8f3832a2d38b4c4327aa7422a3 Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Tue, 13 Aug 2024 10:30:34 + Subject: [PATCH 1/4] Added instant events and marking defered templated

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks! https://github.com/llvm/llvm-project/pull/106654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-08-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: I think the general direction is fine here. I would suggest to split this up into three parts: 1. Add noext attribute and disabled verification, 2. fix any verification failures (e.g. by emitting noext), 3. enable verification. It would be good to still be a

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -114,27 +132,46 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - TimeTraceProfilerEntry *begin(std::string Name, -llvm::function_ref Detail, -bool AsyncEvent = false) { -Sta

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-08-30 Thread Nikita Popov via cfe-commits
nikic wrote: > Patch updated per @nikic suggestion to use a TargetOption flag to simply > disable this for llc. > > With all the llc lit tests out of the way, I now see: > > * 1 test failing in CodeGenObjC > > * failing tests in clang/test/Interpreter > > * failing tetss in llvm/test/E

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -194,13 +236,15 @@ struct llvm::TimeTraceProfiler { J.attribute("pid", Pid); J.attribute("tid", int64_t(Tid)); J.attribute("ts", StartUs); -if (E.AsyncEvent) { +if (TimeTraceEventType::AsyncEvent == E.EventType) { J.attribut

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread kadir çetinkaya via cfe-commits
@@ -534,6 +534,8 @@ TEST(WalkAST, Enums) { testWalk(R"(namespace ns { enum E { A = 42 }; } struct S { using ns::E::A; };)", "int e = S::^A;"); + testWalk(R"(namespace ns { enum E { $explicit^A = 42 }; })", + "namespace z = ns; int e = z::^A

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/106706 From 55be096324da41a17612fb67bfa521a8f42c7874 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Fri, 30 Aug 2024 12:28:02 +0200 Subject: [PATCH] [include-cleaner] Report refs for enum constants used through

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -18046,6 +18048,19 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func, std::make_pair(Func, PointOfInstantiation)); // Notify the consumer that a function was implicitly instantiated. Consumer.HandleCXXImplici

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -18046,6 +18048,19 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func, std::make_pair(Func, PointOfInstantiation)); // Notify the consumer that a function was implicitly instantiated. Consumer.HandleCXXImplici

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -152,6 +154,11 @@ timeTraceProfilerBegin(StringRef Name, TimeTraceProfilerEntry *timeTraceAsyncProfilerBegin(StringRef Name, StringRef Detail); +// Mark an instant event. +void timeTraceProfilerInsert(StringRef Name, +

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -75,18 +76,18 @@ struct llvm::TimeTraceProfilerEntry { const std::string Name; TimeTraceMetadata Metadata; - const bool AsyncEvent = false; + TimeTraceEventType EventType; ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/103039

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -104,6 +105,23 @@ struct llvm::TimeTraceProfilerEntry { } }; +struct InProgressEntry { + std::unique_ptr Event; ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/103039 ___ cfe-commits mai

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-08-30 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/106724 This patch adds flags to clang to emit fake use intrinsics into IR, preserving the value of variables through codegen to improve the debugging experience. The two flags added are `-fextend-lifetimes`, which ext

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Stephen Tozer (SLTozer) Changes This patch adds flags to clang to emit fake use intrinsics into IR, preserving the value of variables through codegen to improve the debugging experience. The two flags added are `-fextend-lifetimes

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -104,6 +105,23 @@ struct llvm::TimeTraceProfilerEntry { } }; +struct InProgressEntry { + std::unique_ptr Event; + std::vector InstantEvents; + + InProgressEntry(TimePointType &&S, TimePointType &&E, std::string &&N, ivanaivanovska wrote: Agree. Howeve

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -104,6 +105,23 @@ struct llvm::TimeTraceProfilerEntry { } }; +struct InProgressEntry { + std::unique_ptr Event; + std::vector InstantEvents; + + InProgressEntry(TimePointType &&S, TimePointType &&E, std::string &&N, + std::string &&Dt, TimeTraceEventTy

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Thanks for clearing things up in the docs https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -664,6 +679,17 @@ compiled against the version of clang-tidy that will be loading the plugin. The plugins can use threads, TLS, or any other facilities available to in-tree code which is accessible from the external headers. +Note that testing checks out of tree might invo

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -336,13 +337,24 @@ a starting point for your test cases. A rough outline of the process looks like The quickest way to prototype your matcher is to use :program:`clang-query` to interactively build up your matcher. For complicated matchers, build up a matching expression

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -690,8 +716,8 @@ warnings and errors. The script provides multiple configuration flags. that the file names are matched against. ``run-clang-tidy.py clang-tidy/.*Check\.cpp`` will only analyze clang-tidy checks. It may also be necessary to restrict the header files th

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -83,6 +83,8 @@ namespace llvm { class raw_pwrite_stream; +enum class TimeTraceEventType { CompleteEvent, InstantEvent, AsyncEvent }; ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/103039

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -406,34 +450,50 @@ TimeTraceProfilerEntry *llvm::timeTraceProfilerBegin(StringRef Name, StringRef Detail) { if (TimeTraceProfilerInstance != nullptr) return TimeTraceProfilerInstance->begin( -std::string(Nam

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -92,13 +94,17 @@ struct TimeTraceMetadata { bool isEmpty() const { return Detail.empty() && File.empty(); } }; +struct TimeTraceProfilerEntry; ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/103039 _

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-08-30 Thread via cfe-commits
@@ -181,9 +187,18 @@ class TimeTraceScope { Entry = timeTraceProfilerBegin(Name, Detail); } TimeTraceScope(StringRef Name, ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/103039 ___ c

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -809,8 +809,9 @@ class RedeclarableTemplateDecl : public TemplateDecl, }; /// Pointer to the common data shared by all declarations of this - /// template. - mutable CommonBase *Common = nullptr; + /// template, and a flag indicating if the template is a member + //

[clang] [compiler-rt] [libcxx] [lldb] [llvm] Rename Sanitizer Coverage => Coverage Sanitizer (PR #106505)

2024-08-30 Thread via cfe-commits
cor3ntin wrote: > Thank you for working on this; it's a minor inconsistency, but a needless one > as best I can tell. The changes mostly look good, but there are a bunch of > binary files (.exe) that seem to have changed; do you know why? Global find of replace in the binaries. Sadly I'm not s

[clang] [clang-tools-extra] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

2024-08-30 Thread kadir çetinkaya via cfe-commits
@@ -216,7 +216,7 @@ enum OpenCLTypeKind : uint8_t { /// class TargetInfo : public TransferrableTargetInfo, public RefCountedBase { - std::shared_ptr TargetOpts; + TargetOptions *TargetOpts; kadircet wrote: this is making me a little anxiou

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Great idea to add this. Although, we should be careful to not end up with abandoned projects. I sampled three from the page in Clang, and they had their last activity at around ~10 years. At that point, API's have changed. Either way, adding external exam

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,31 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with clang-tidy that +might serve as useful guides (or starting points) to develop your own check

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/106672 >From 3518ede871664d3d0f45a51b9e462b53ffa4a7d4 Mon Sep 17 00:00:00 2001 From: MichelleCDjunaidi <87893361+michellecdjuna...@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:40:39 +0800 Subject: [PATC

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
@@ -336,13 +337,24 @@ a starting point for your test cases. A rough outline of the process looks like The quickest way to prototype your matcher is to use :program:`clang-query` to interactively build up your matcher. For complicated matchers, build up a matching expression

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
@@ -646,10 +658,13 @@ directory. The path to this directory is available in a lit test with the varia Out-of-tree check plugins - + Developing an out-of-tree check as a plugin largely follows the steps -outlined above. The plugin is a shared library

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
@@ -664,6 +679,17 @@ compiled against the version of clang-tidy that will be loading the plugin. The plugins can use threads, TLS, or any other facilities available to in-tree code which is accessible from the external headers. +Note that testing checks out of tree might invo

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with clang-tidy that +might serve as useful guides (or starting points) to develop your own check

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/106675 >From 08324e3586acb16cbf010fd6013c21f2b5faa64e Mon Sep 17 00:00:00 2001 From: MichelleCDjunaidi <87893361+michellecdjuna...@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:55:16 +0800 Subject: [PATC

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)

2024-08-30 Thread Chris Apple via cfe-commits
cjappl wrote: > I'm seeing a test failure but I'm not sure if it's an issue with RTSan or > compiler-rt atomic implementation: Interesting, so that test basically tests that large atomics that insert locks under the hood die as expected. Zooming in on the second part of the test: ``` std::at

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -5,21 +5,22 @@ External Clang-Tidy Examples Introduction -This page provides examples of what people have done with clang-tidy that +This page provides examples of what people have done with `clang-tidy`` that might serve as useful guides (or starting points

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread Julian Schmidt via cfe-commits
@@ -5,21 +5,22 @@ External Clang-Tidy Examples Introduction -This page provides examples of what people have done with clang-tidy that +This page provides examples of what people have done with `clang-tidy`` that 5chmidti wrote: unintended doub

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -317,7 +317,8 @@ struct ConvertConstructorToDeductionGuideTransform { } if (NestedPattern) - OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs(Template); + OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs( + /*D=*/nullptr,

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -1056,16 +1052,20 @@ bool Sema::AreConstraintExpressionsEqual(const NamedDecl *Old, bool Sema::FriendConstraintsDependOnEnclosingTemplate(const FunctionDecl *FD) { assert(FD->getFriendObjectKind() && "Must be a friend!"); + FunctionTemplateDecl *FTD = FD->getDescribedFu

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { AaronBallman wrote: I was going to say we should be handling this at the `Attr

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/106675 >From 08324e3586acb16cbf010fd6013c21f2b5faa64e Mon Sep 17 00:00:00 2001 From: MichelleCDjunaidi <87893361+michellecdjuna...@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:55:16 +0800 Subject: [PATC

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

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

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Do you need someone to land the changes on your behalf? https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -171,374 +139,379 @@ bool isLambdaEnclosedByTypeAliasDecl( .TraverseType(Underlying); } -// Add template arguments from a variable template instantiation. -Response -HandleVarTemplateSpec(const VarTemplateSpecializationDecl *VarTemplSpec, -

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-30 Thread via cfe-commits
jeanPerier wrote: HI @mizvekov, after your patch, some llvm build broke because a piece of code in flang does not compile anymore with tip of the tree clang: See: https://lab.llvm.org/buildbot/#/builders/4/builds/1670 Here is a reproducer: ``` #include std::complex test(std::complex z1) { u

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -1669,25 +1640,43 @@ namespace { ExprResult RebuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, LambdaScopeInfo *LSI) { +#if 1 CXXMethodDecl *MD = LSI->CallOperator; - for (ParmVarDecl *PVD : MD->parameters())

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
MichelleCDjunaidi wrote: Yeah, I don't have write permissions, so I need someone to land the changes on my behalf. https://github.com/llvm/llvm-project/pull/106672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
MichelleCDjunaidi wrote: Side note, but I don't have write permissions, so once the PR looks great feel free to land it on my behalf. https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/106585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 362d37a - Update clang tidy Contributing guide (#106672)

2024-08-30 Thread via cfe-commits
Author: MichelleCDjunaidi Date: 2024-08-30T09:55:13-04:00 New Revision: 362d37aeab7e8ba5dc4125480de3d45cc6bb23dc URL: https://github.com/llvm/llvm-project/commit/362d37aeab7e8ba5dc4125480de3d45cc6bb23dc DIFF: https://github.com/llvm/llvm-project/commit/362d37aeab7e8ba5dc4125480de3d45cc6bb23dc.d

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

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

[clang] [clang-tools-extra] [Clang] Add __type_list_dedup builtin to deduplicate types in templat… (PR #106730)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/106730 …e arguments This allows to deduplicate the type lists efficiently in C++. It is possible to achieve the same effect via template metaprogramming, but performance of the resulting code is much lower than

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Yeah, I don't have write permissions, so I need someone to land the changes > on my behalf. Thank you so much! @AaronBallman Thank you! We always appreciate improved documentation! https://github.com/llvm/llvm-project/pull/106672 __

[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: @MichelleCDjunaidi Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem wit

[clang] [clang-tools-extra] [Clang] Add __type_list_dedup builtin to deduplicate types in templat… (PR #106730)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff fee48365b44d161575314c67328fa21104c4537d 0151fbf9a8cea2d1c60dc399f088258dd94ad562 --e

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec updated https://github.com/llvm/llvm-project/pull/105479 From 0d3923a05fe4388a7025e15d17d957fbaf008e4e Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 5 Apr 2024 15:20:37 +0200 Subject: [PATCH] [clang] Catch missing format attribute

[clang] [clang-tools-extra] [Clang] Add __type_list_dedup builtin to deduplicate types in templat… (PR #106730)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/106730 >From 0151fbf9a8cea2d1c60dc399f088258dd94ad562 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Fri, 23 Aug 2024 17:27:26 +0200 Subject: [PATCH 1/2] [Clang] Add __type_list_dedup builtin to deduplicate

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -5335,6 +5335,221 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
@@ -0,0 +1,32 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with `clang-tidy` that EugeneZelenko wrote: :program:`clang-tidy`. Same in othe

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
@@ -0,0 +1,32 @@ +=== EugeneZelenko wrote: Please make same length as title. Same below. https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
@@ -0,0 +1,32 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with `clang-tidy` that +might serve as useful guides (or starting points) to develop your own che

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-08-30 Thread via cfe-commits
@@ -0,0 +1,32 @@ +=== +External Clang-Tidy Examples +=== + +Introduction + + +This page provides examples of what people have done with `clang-tidy` that +might serve as useful guides (or starting points) to develop your own che

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

2024-08-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/106733 Don't diagnose them, but literals still have distinct addresses. Fixes https://github.com/llvm/llvm-project/issues/58754 >From b77e5f928ff6acd2c44bfc27c178aa4121a24228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Don't diagnose them, but literals still have distinct addresses. Fixes https://github.com/llvm/llvm-project/issues/58754 --- Full diff: https://github.com/llvm/llvm-project/pull/106733.diff 3 Files Affecte

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. Still LGTM. See one minor comment about the code style, but up to you if you want to apply it or not. https://github.com/llvm/llvm-project/pull/106706 ___ cfe-commits mailing list cfe-commit

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread Ilya Biryukov via cfe-commits
@@ -146,9 +148,24 @@ class ASTWalker : public RecursiveASTVisitor { // // If it's an enum constant, it must be due to prior decl. Report references // to it when qualifier isn't a type. -if (llvm::isa(FD)) { - if (!DRE->getQualifier() || DRE->getQualifier(

<    1   2   3   4   5   >