[clang] [clang] Replace X && isa(X) with isa_and_nonnull(X). NFC (PR #94987)

2024-06-10 Thread Pavel Samolysov via cfe-commits
@@ -2772,7 +2772,7 @@ fixVariable(const VarDecl *VD, FixitStrategy::Kind K, // also covers call-operator of lamdas isa(FD) || // skip when the function body is a try-block -(FD->hasBody() && isa(FD->getBody())) || +isa_and_nonnull(FD->get

[clang] [clang] Replace X && isa(X) with isa_and_nonnull(X). NFC (PR #94987)

2024-06-10 Thread Pavel Samolysov via cfe-commits
@@ -8510,7 +8510,8 @@ class MappableExprsHandler { assert(VDecl == VD && "We got information for the wrong declaration??"); assert(!Components.empty() && "Not expecting declaration with no component lists."); -if (VD && E && VD->getType()

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 1/4] [RISCV] Add support for getHostCPUFeatures using hwprobe Co-a

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-10 Thread Yingwei Zheng via cfe-commits
@@ -1998,6 +1998,66 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(__linux__) && defined(__riscv) +// struct riscv_hwprobe +struct RISCVHwProbe { + int64_t Key; + uint64_t Value; +}; +bool sys::getHostCPUFeatures(StringMap &Features) {

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Yingwei Zheng (dtcxzyw) Changes This patch adds support for `sys::getHostCPUFeatures` using the RISC-V hardware probing interface. References: + Loongarch patch: https://github.com/llvm/llvm-project/commit/e53f41c39f3eb5052965c720d

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-06-10 Thread Eli Friedman via cfe-commits
@@ -214,7 +232,8 @@ declare double @za_shared_callee(double) "aarch64_inout_za" define double @za_new_caller_to_za_shared_callee(double %x) nounwind noinline optnone "aarch64_new_za"{ ; CHECK-COMMON-LABEL: za_new_caller_to_za_shared_callee: ; CHECK-COMMON: // %bb.0: //

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-06-10 Thread Eli Friedman via cfe-commits
@@ -196,12 +196,14 @@ bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo( const MachineFunction &MF) const { if (!NeedsAsyncDwarfUnwindInfo) { const Function &F = MF.getFunction(); +const AArch64FunctionInfo *AFI = MF.getInfo(); // The check got "minsize" i

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/94352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I evaluated the effects of the additional change [Generalize the suppression to all sizeof(array[0]) expressions](https://github.com/llvm/llvm-project/pull/94356/commits/ce3a37610228ceb9a9e60575f87886bf8e183493) compared to the earlier version of this PR, and it seems that thi

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-06-10 Thread Artem Dergachev via cfe-commits
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D, } } } + +void clang::checkUnsafeBufferUsage(const Decl *D, + UnsafeBufferUsageHandler &Handler, + bool EmitSuggestions) { +#ifndef

[clang] [clang] Replace X && isa(X) with isa_and_nonnull(X). NFC (PR #94987)

2024-06-10 Thread Pavel Samolysov via cfe-commits
https://github.com/samolisov updated https://github.com/llvm/llvm-project/pull/94987 >From 691223b4e873257a74b295bfb77839406adc742a Mon Sep 17 00:00:00 2001 From: Pavel Samolysov Date: Mon, 10 Jun 2024 17:35:14 +0300 Subject: [PATCH 1/2] [clang] Replace X && isa(X) with isa_and_nonnull(X). NFC

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Ameer J via cfe-commits
https://github.com/ameerj created https://github.com/llvm/llvm-project/pull/95013 By default, clang-format packs binary operations, but it may be desirable to have compound operations be on individual lines instead of being packed. This PR adds the option `BinPackBinaryOperations`, which mimic

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Ameer J (ameerj) Changes By default, clang-format packs binary operations, but it may be desirable to have compound operations be on individual lines instead of being packed. This PR adds the option `BinPackBinaryOperations`, which

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-10 Thread Carlos Galvez via cfe-commits
@@ -15,3 +15,5 @@ std::string HelloString; // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: no header providing "std::string" is directly included [misc-include-cleaner] int FooBarResult = foobar(); // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: no header providing "foobar" is direc

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-06-10 Thread Dana Jansens via cfe-commits
@@ -3328,3 +3300,63 @@ void clang::checkUnsafeBufferUsage(const Decl *D, } } } + +void clang::checkUnsafeBufferUsage(const Decl *D, + UnsafeBufferUsageHandler &Handler, + bool EmitSuggestions) { +#ifndef

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/94923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-06-10 Thread William Junda Huang via cfe-commits
huangjd wrote: By just specifying `-g` Even without `-fdebug-info-for-profiling` it is going to introduce debug variables as a sequence of alloca-store-load too, so is it a requirement to guarantee `-O0` output stays identical with or without debug info? Emitting a dbg.value was what I origi

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/94356 ___ cfe-commits mai

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/PiotrZSL approved this pull request. Overall LGTM. It doesn't look to break (by default) previous beha

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -292,11 +318,17 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(),

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-06-10 Thread Nick Zavaritsky via cfe-commits
https://github.com/mejedi updated https://github.com/llvm/llvm-project/pull/91310 >From defe9d0fe64edafdc2e1ff5905c36bf229323692 Mon Sep 17 00:00:00 2001 From: Nick Zavaritsky Date: Sun, 5 May 2024 10:20:52 + Subject: [PATCH] [BPF] Fix linking issues in static map initializers When BPF obj

[clang] [CMake][Fuchsia] Enable libc++ in the baremetal build (PR #95017)

2024-06-10 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/95017 For now, we include headers and don't use libc++abi. >From f638a3a959bc79f0349fbfd6c79b8f386fb31218 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 10 Jun 2024 11:10:44 -0700 Subject: [PATCH] [CMake][Fuch

[clang] [CMake][Fuchsia] Enable libc++ in the baremetal build (PR #95017)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) Changes For now, we include headers and don't use libc++abi. --- Full diff: https://github.com/llvm/llvm-project/pull/95017.diff 1 Files Affected: - (modified) clang/cmake/caches/Fuchsia-stage2.cmake (+32-2) ``

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-06-10 Thread Nick Zavaritsky via cfe-commits
mejedi wrote: @yonghong-song @dwblaikie > Is there some test coverage that shows that unreferenced variables/functions > aren't included in the output? Test added. https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-comm

[clang-tools-extra] fix(clang-tools-extra/**.py): fix comparison to None (PR #94013)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 7c8a8bd - [clang-tidy] fix(clang-tools-extra/**.py): fix comparison to None (#94013)

2024-06-10 Thread via cfe-commits
Author: Eisuke Kawashima Date: 2024-06-10T20:16:25+02:00 New Revision: 7c8a8bdc3a555e531e79af6ea9a60eb30c41475d URL: https://github.com/llvm/llvm-project/commit/7c8a8bdc3a555e531e79af6ea9a60eb30c41475d DIFF: https://github.com/llvm/llvm-project/commit/7c8a8bdc3a555e531e79af6ea9a60eb30c41475d.di

[clang-tools-extra] fix(clang-tools-extra/**.py): fix comparison to None (PR #94013)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/94013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fix(clang-tools-extra/**.py): fix comparison to None (PR #94013)

2024-06-10 Thread via cfe-commits
github-actions[bot] wrote: @e-kwsm 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 with a build,

[clang-tools-extra] fix(clang-tools-extra/**.py): fix invalid escape sequences (PR #94028)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, I will merge this once I confirm that it still works. https://github.com/llvm/llvm-project/pull/94028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[libclc] [libclc] Improve dependencies to avoid build errors (PR #95018)

2024-06-10 Thread Tim Creech via cfe-commits
https://github.com/tcreech-intel created https://github.com/llvm/llvm-project/pull/95018 With the Makefile generator and particularly high build parallelism some intermediate dependencies may be generated redundantly and concurrently, leading to build failures. To fix this, arrange for libclc

[clang] [lldb] [llvm] [BOLT][DWARF][NFC] Remove old GDB Index functions (PR #95019)

2024-06-10 Thread Sayhaan Siddiqui via cfe-commits
https://github.com/sayhaan created https://github.com/llvm/llvm-project/pull/95019 Remove old usages of GDB Index functions after replacing them with new ones. >From b2fe35ae825dc757ea1daaf49142e789c4a560fc Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Tue, 1 Jun 2021 11:37:41 -0700 Subject

[clang] [lldb] [llvm] [BOLT][DWARF][NFC] Remove old GDB Index functions (PR #95019)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sayhaan Siddiqui (sayhaan) Changes Remove old usages of GDB Index functions after replacing them with new ones. --- Patch is 38.13 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/95019.diff 22

[clang] [lldb] [llvm] [BOLT][DWARF][NFC] Remove old GDB Index functions (PR #95019)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Sayhaan Siddiqui (sayhaan) Changes Remove old usages of GDB Index functions after replacing them with new ones. --- Patch is 38.13 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/95019.dif

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From 015a05707caad5d39909bc68a5371161de464d9d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class t

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

2024-06-10 Thread Jeremy Morse via cfe-commits
jmorse wrote: dblaikie wrote: > I hope that isn't the intent, I thought the intent was just [...] Ah, by which I mean "it's not an accident", > By just specifying -g Even without -fdebug-info-for-profiling it is going to > introduce debug variables as a sequence of alloca-store-load too, so i

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
https://github.com/Sirraide commented: This looks reasonable, but as was already pointed out, it needs a few tests, and also a release note (in `clang/docs/ReleaseNotes.rst`, probably in the ‘Improvements to Clang’s Diagnostics’ section or whatever it was called). https://github.com/llvm/llvm-

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/94865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
@@ -1246,7 +1246,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (auto *BD = R.getAsSingle()) Var = BD; - else + else if (auto *FD = R.getAsSingle()) { +Var = R.getAsSingle(); Sirraide wrote:

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
@@ -1246,7 +1246,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (auto *BD = R.getAsSingle()) Var = BD; - else + else if (auto *FD = R.getAsSingle()) { +Var = R.getAsSingle(); Sirraide wrote:

[clang] [lldb] [llvm] [BOLT][DWARF][NFC] Remove old GDB Index functions (PR #95019)

2024-06-10 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 77f75b45fd8a4bbc061e85a4432c23b64ca7d4f2...b9273c87b2ae189024b6bb08af5a2ee8ecf26de9 cross

[clang] [lldb] [llvm] [BOLT][DWARF][NFC] Remove old GDB Index functions (PR #95019)

2024-06-10 Thread Sayhaan Siddiqui via cfe-commits
https://github.com/sayhaan updated https://github.com/llvm/llvm-project/pull/95019 >From 2ec98177d6e328f966e7eedb1581ede921fa8e8b Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Tue, 1 Jun 2021 11:37:41 -0700 Subject: [PATCH 1/4] Rebase: [Facebook] Add clang driver options to test debug info

[clang] c5978f1 - [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (#86609)

2024-06-10 Thread via cfe-commits
Author: Paul Kirth Date: 2024-06-10T11:27:21-07:00 New Revision: c5978f1eb5eeca8610b9dfce1fcbf1f473911cd8 URL: https://github.com/llvm/llvm-project/commit/c5978f1eb5eeca8610b9dfce1fcbf1f473911cd8 DIFF: https://github.com/llvm/llvm-project/commit/c5978f1eb5eeca8610b9dfce1fcbf1f473911cd8.diff LO

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-10 Thread via cfe-commits
https://github.com/Sirraide commented: The implementation looks fine, but a few more tests involving templates would be nice to see what this does with dependent types, e.g. ```c++ template void f(T& t) { ++t; } void g() { int* a; int* const b = a; const int* const c = a;

[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

2024-06-10 Thread via cfe-commits
@@ -9,7 +9,15 @@ void h() { SEL s = @selector(dealloc); SEL* ps = &s; + /* + FIXME: https://github.com/llvm/llvm-project/pull/94159 + + This would assign the value of s to the SEL object pointed to by @selector(dealloc). However, in Objective-C, selectors are not

[clang-tools-extra] [compiler-rt] [lldb] [llvm] [Memprof] Adds the option to collect AccessCountHistograms for memprof. (PR #94264)

2024-06-10 Thread Matthew Weingarten via cfe-commits
https://github.com/mattweingarten updated https://github.com/llvm/llvm-project/pull/94264 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] baba78d - [clang] Fix loss of `dllexport` for exported template specialization (#94664)

2024-06-10 Thread via cfe-commits
Author: Andrew Ng Date: 2024-06-10T19:39:28+01:00 New Revision: baba78daf2b3a3ee9bfa21f1f8ff3584aa982ac8 URL: https://github.com/llvm/llvm-project/commit/baba78daf2b3a3ee9bfa21f1f8ff3584aa982ac8 DIFF: https://github.com/llvm/llvm-project/commit/baba78daf2b3a3ee9bfa21f1f8ff3584aa982ac8.diff LOG

[clang] [clang] Fix loss of `dllexport` for exported template specialization (PR #94664)

2024-06-10 Thread Andrew Ng via cfe-commits
https://github.com/nga888 closed https://github.com/llvm/llvm-project/pull/94664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CMake][Fuchsia] Enable libc++ in the baremetal build (PR #95017)

2024-06-10 Thread via cfe-commits
https://github.com/zeroomega approved this pull request. https://github.com/llvm/llvm-project/pull/95017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -1203,6 +1214,10 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State, } } + if (!Style.BinPackBinaryOperations && Previous.is(TT_BinaryOperator) && HazardyKnusperkeks wrote: Couldn't you just call `startsNextOperand`? https://gith

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Current starts a new operand in a binary operation. +static bool startsNextOperand(const Forma

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] Sema: Fix CXXRecordDecl::isTriviallyCopyable() for classes with all deleted special functions. (PR #94831)

2024-06-10 Thread via cfe-commits
pcc wrote: Ack. I hadn't considered that overloads could be deleted like that. I think I've found a workaround for the issue that prompted this change, so I might not get back to this any time soon. https://github.com/llvm/llvm-project/pull/94831 ___

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
https://github.com/CedricSwa updated https://github.com/llvm/llvm-project/pull/94865 >From 012849c5410960001ca5bbcb90ea2cf4a661b840 Mon Sep 17 00:00:00 2001 From: Cedric Schwarzer Date: Sat, 8 Jun 2024 17:52:02 +0200 Subject: [PATCH 1/2] Improve error message for invalid lambda captures --- c

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
@@ -1246,7 +1246,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (auto *BD = R.getAsSingle()) Var = BD; - else + else if (auto *FD = R.getAsSingle()) { +Var = R.getAsSingle(); CedricSwa wrote:

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

2024-06-10 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Yes, to my knowledge Swift emits dbg.values out of its front end, so there's probably no reason (on the LLVM side) that clang couldn't do so as well. There might be good reasons internal to clang that it doesn't use debug values atm, and it's not inconceivable that we'd hit some

[clang] Improve error message for invalid lambda captures (PR #94865)

2024-06-10 Thread via cfe-commits
@@ -1246,7 +1246,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (auto *BD = R.getAsSingle()) Var = BD; - else + else if (auto *FD = R.getAsSingle()) { +Var = R.getAsSingle(); Sirraide wrote:

[clang] [llvm] [mlir] [OMPIRBuilder] - Handle dependencies in `createTarget` (PR #93977)

2024-06-10 Thread Pranav Bhandarkar via cfe-commits
@@ -5212,6 +5273,78 @@ static Function *createOutlinedFunction( return Func; } +// Create an entry point for a target task with the following. +// It'll have the following signature +// void @.omp_target_task_proxy_func(i32 %thread.id, ptr %task) +// This function is called

[clang] [clang] Implement -Wmissing-include-dirs (PR #94827)

2024-06-10 Thread Braden Helmer via cfe-commits
https://github.com/bradenhelmer updated https://github.com/llvm/llvm-project/pull/94827 >From 317e4c2fe7fb0ee76f7917b64ee447ba3ed838bc Mon Sep 17 00:00:00 2001 From: Braden Helmer Date: Fri, 7 Jun 2024 21:38:04 -0400 Subject: [PATCH 1/2] Implement -Wmissing-include-dirs --- clang/include/clan

[clang-tools-extra] d63be47 - [clang-tidy] fix(clang-tools-extra/**.py): fix invalid escape sequences (#94028)

2024-06-10 Thread via cfe-commits
Author: Eisuke Kawashima Date: 2024-06-10T21:05:40+02:00 New Revision: d63be475e889ba3361799f6907b3c95354684c7d URL: https://github.com/llvm/llvm-project/commit/d63be475e889ba3361799f6907b3c95354684c7d DIFF: https://github.com/llvm/llvm-project/commit/d63be475e889ba3361799f6907b3c95354684c7d.di

[clang-tools-extra] fix(clang-tools-extra/**.py): fix invalid escape sequences (PR #94028)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/94028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fix(clang-tools-extra/**.py): fix invalid escape sequences (PR #94028)

2024-06-10 Thread via cfe-commits
github-actions[bot] wrote: @e-kwsm 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 with a build,

[clang] [clang] Implement -Wmissing-include-dirs (PR #94827)

2024-06-10 Thread Braden Helmer via cfe-commits
@@ -809,4 +809,7 @@ def warn_android_unversioned_fallback : Warning< def err_drv_triple_version_invalid : Error< "version '%0' in target triple '%1' is invalid">; + +def warn_missing_include_dirs : Warning < bradenhelmer wrote: Tested with GCC, its not enab

[clang] [llvm] [mlir] [OMPIRBuilder] - Handle dependencies in `createTarget` (PR #93977)

2024-06-10 Thread Pranav Bhandarkar via cfe-commits
@@ -5212,6 +5273,78 @@ static Function *createOutlinedFunction( return Func; } +// Create an entry point for a target task with the following. +// It'll have the following signature +// void @.omp_target_task_proxy_func(i32 %thread.id, ptr %task) +// This function is called

[clang-tools-extra] bc70c29 - [clang-tidy][DOC] Update doc for Clang Static Analyzer checks

2024-06-10 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-06-10T19:07:49Z New Revision: bc70c29558c6ecb53e61cc8d668768e919e81bde URL: https://github.com/llvm/llvm-project/commit/bc70c29558c6ecb53e61cc8d668768e919e81bde DIFF: https://github.com/llvm/llvm-project/commit/bc70c29558c6ecb53e61cc8d668768e919e81bde.diff LOG: [

[clang] [llvm] [RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. Alias -m[no-]strict-align to scalar. (PR #95024)

2024-06-10 Thread Craig Topper via cfe-commits
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/95024 __riscv_misaligned_fast will be set based on -mno-scalar-strict-align or -mno-strict-align. This matches the direction gcc is proposing. See https://github.com/riscv-non-isa/riscv-c-api-doc/issues/73 https://gi

[clang] [llvm] [RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. Alias -m[no-]strict-align to scalar. (PR #95024)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Craig Topper (topperc) Changes __riscv_misaligned_fast will be set based on -mno-scalar-strict-align or -mno-strict-align. This matches the direction gcc is proposing. See https://github.com/riscv-non-isa/riscv-c-api-doc/issues/73 https:

[clang] [llvm] [RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. Alias -m[no-]strict-align to scalar. (PR #95024)

2024-06-10 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/95024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +746,127 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -103,27 +114,226 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// Indirect call promotion pass will fall back to function-based comparison if +// vtable-count / function-

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/95025 In ContinuationIndenter::mustBreak, a break is required between a template declaration and the function/class declaration it applies to, if the template declaration spans multiple lines. However, this also inclu

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Emilia Kond (rymiel) Changes In ContinuationIndenter::mustBreak, a break is required between a template declaration and the function/class declaration it applies to, if the template declaration spans multiple lines. However, this

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread Emilia Kond via cfe-commits
rymiel wrote: Note: I understand my solution of adding a member variable is inelegant, I am of course open to ways on making it better https://github.com/llvm/llvm-project/pull/95025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From 57e60fb4d4d37f19ddfbc4a0878b7ee2e180aa2d Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 10 Jun 2024 15:23:07 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-10 Thread Shilei Tian via cfe-commits
@@ -2201,6 +2207,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { Align = 8; \ break; #include "clang/Basic/WebAssemblyReferenceTypes.def" +case BuiltinType::AMDGPUBufferRsrc: + W

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/94830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel edited https://github.com/llvm/llvm-project/pull/95025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2024-06-10 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: This is really sweet. However, I feel like this is a property that needs to propagate through types. We can't guarantee that a `std::vector>` doesn't escape the pointer. Similarly, I think we'd like ```c++ struct my_pair { int i; std::string str; }; ``` to have this proper

[clang] [clang] Don't use -Wno-nested-anon-types on GCC (PR #95029)

2024-06-10 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/95029 GCC usually doesn't warn about unrecognized -Wno- options, if no diagnostics are printed. However if some diagnostics are printed, it also mentions that there were unrecognized -Wno- options. Before 4feae05c6a

[clang] [clang] Don't use -Wno-nested-anon-types on GCC (PR #95029)

2024-06-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Martin Storsjö (mstorsjo) Changes GCC usually doesn't warn about unrecognized -Wno- options, if no diagnostics are printed. However if some diagnostics are printed, it also mentions that there were unrecognized -Wno- options. B

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-10 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From 731c2adb3bf69bd1f337691eeb34756e521d47f3 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 10 Jun 2024 15:40:41 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Few nits: - storeOptions needs fix - Consider excluding implicit code with TK_IgnoreUnlessSpelledInSource (not this may exclude also template instances, so I leave it up to you) - Documentation require small work - Make check mo

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -126,6 +126,11 @@ New checks reference. This may cause use-after-free errors if the caller uses xvalues as arguments. +- New :doc:`bugprone-pointer-arithmetic-on-polymorphic-object + ` check. + + Finds pointer arithmetic performed on classes that declare a virtual fu

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.cpp - clang-tidy---===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,38 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -126,6 +126,11 @@ New checks reference. This may cause use-after-free errors if the caller uses xvalues as arguments. +- New :doc:`bugprone-pointer-arithmetic-on-polymorphic-object PiotrZSL wrote: add in line 173 info about new alias (check release not

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-06-10 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @BenBlaise Clang-tidy 19 branch out is in ... a month. Any plans to finish this ? It's fine if this would get in limited scope (only for explicit casts), but some current issues need fixes. https://github.com/llvm/llvm-project/pull/76065

<    1   2   3   4   5   >