[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -0,0 +1,32 @@ +//===--- ConditionaltostdminmaxCheck.h - clang-tidy -*- 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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
https://github.com/EugeneZelenko commented: Check should also add #include if it's not included already. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -62,6 +63,8 @@ namespace readability { class ReadabilityModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { +CheckFactories.registerCheck( +"readability-ConditionalToStdMinMax");

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -0,0 +1,32 @@ +//===--- ConditionaltostdminmaxCheck.h - clang-tidy -*- 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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -224,6 +224,12 @@ New checks Recommends the smallest possible underlying type for an ``enum`` or ``enum`` class based on the range of its enumerators. +- New :doc:`readability-ConditionalToStdMinMax + ` check. + + Replaces certain conditional statements with equivalen

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -0,0 +1,29 @@ +.. title:: clang-tidy - readability-ConditionalToStdMinMax + +readability-ConditionalToStdMinMax +== + +Replaces certain conditional statements with equivalent std::min or std::max expressions, +improving readability and promotin

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang] [clang-format] Don't allow casts in front of ampamp (PR #77704)

2024-01-11 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/77704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-apply-replacements] Apply format only if --format is specified (PR #70801)

2024-01-11 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes LGTM but we should probably add a release note to https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/ReleaseNotes.rst?plain=1 so users know about the fix. https://github.com/llvm/llvm-project/pull/70801 _

[llvm] [clang] [AMDGPU] Add global_load_tr for GFX12 (PR #77772)

2024-01-11 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/2 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-11 Thread Björn Schäpers via cfe-commits
@@ -768,15 +768,25 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // parenthesis by disallowing any further line breaks if there is no line // break after the opening parenthesis. Don't break if it doesn't conserve // columns. + auto

[libcxx] [libc] [clang-tools-extra] [llvm] [lldb] [clang] [mlir] [BOLT][NFC] Print BAT section size (PR #76897)

2024-01-11 Thread Amir Ayupov via cfe-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76897 ___ 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 check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Some tweaks needed. Note that there is also issue for: ``` std::max(a, std::max(b, c)) -> std::max({a, b, c}) ``` and this check would be nice thing for that also, but not under this PR. Overall you got something that works, but is very strict, now I would

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -62,6 +63,8 @@ namespace readability { class ReadabilityModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { +CheckFactories.registerCheck( +"readability-ConditionalToStdMinMax");

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ 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 check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,32 @@ +//===--- ConditionaltostdminmaxCheck.h - clang-tidy -*- 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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,88 @@ +//===--- ConditionaltostdminmaxCheck.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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,29 @@ +.. title:: clang-tidy - readability-ConditionalToStdMinMax + +readability-ConditionalToStdMinMax +== + +Replaces certain conditional statements with equivalent std::min or std::max expressions, +improving readability and promotin

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,88 @@ +//===--- ConditionaltostdminmaxCheck.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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,29 @@ +.. title:: clang-tidy - readability-ConditionalToStdMinMax + +readability-ConditionalToStdMinMax +== + +Replaces certain conditional statements with equivalent std::min or std::max expressions, PiotrZSL wrote: \

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,32 @@ +//===--- ConditionaltostdminmaxCheck.h - clang-tidy -*- 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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,88 @@ +//===--- ConditionaltostdminmaxCheck.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] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,88 @@ +//===--- ConditionaltostdminmaxCheck.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] [clang-format] TableGen keywords support. (PR #77477)

2024-01-11 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: You can of course always ask for commit access: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access https://github.com/llvm/llvm-project/pull/77477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] 0cc3157 - [clang-format] TableGen keywords support. (#77477)

2024-01-11 Thread via cfe-commits
Author: Hirofumi Nakamura Date: 2024-01-11T20:07:49+01:00 New Revision: 0cc31579e0b690e974163da4077a40b49bfc1ebc URL: https://github.com/llvm/llvm-project/commit/0cc31579e0b690e974163da4077a40b49bfc1ebc DIFF: https://github.com/llvm/llvm-project/commit/0cc31579e0b690e974163da4077a40b49bfc1ebc.d

[clang] [clang-format] TableGen keywords support. (PR #77477)

2024-01-11 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/77477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] improve template argument name deduction (PR #77716)

2024-01-11 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/77716 >From c6373dcc5f8c647f483266954fd95a6f7b5df44c Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Wed, 10 Jan 2024 18:28:19 -0800 Subject: [PATCH] [clang][ExtractAPI] improve template argument name deduction The n

[llvm] [compiler-rt] [clang-tools-extra] [libc] [flang] [libcxx] [clang] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-11 Thread Hristo Hristov via cfe-commits
https://github.com/H-G-Hristov edited https://github.com/llvm/llvm-project/pull/76449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [compiler-rt] [lld] [clang-tools-extra] [libc] [flang] [libcxx] [clang] [lldb] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-11 Thread Hristo Hristov via cfe-commits
https://github.com/H-G-Hristov edited https://github.com/llvm/llvm-project/pull/76447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [compiler-rt] [flang] [libcxxabi] [llvm] [lldb] [libunwind] [libclc] [lld] [libc] [clang] [libcxx] [builtins] Generate __multc3 for z/OS (PR #77554)

2024-01-11 Thread Sean Perry via cfe-commits
https://github.com/perry-ca updated https://github.com/llvm/llvm-project/pull/77554 >From 7ba4d61bd2beda03ba0fcefc9ca5c1ff08ffd48e Mon Sep 17 00:00:00 2001 From: Sean Perry Date: Tue, 9 Jan 2024 20:59:28 -0600 Subject: [PATCH 1/4] Generate __multc3 for z/OS --- compiler-rt/lib/builtins/divtc3

[clang-tools-extra] [compiler-rt] [flang] [libcxxabi] [llvm] [lldb] [libunwind] [libclc] [lld] [libc] [clang] [libcxx] [builtins] Generate __multc3 for z/OS (PR #77554)

2024-01-11 Thread Sean Perry via cfe-commits
https://github.com/perry-ca updated https://github.com/llvm/llvm-project/pull/77554 >From 7ba4d61bd2beda03ba0fcefc9ca5c1ff08ffd48e Mon Sep 17 00:00:00 2001 From: Sean Perry Date: Tue, 9 Jan 2024 20:59:28 -0600 Subject: [PATCH 1/5] Generate __multc3 for z/OS --- compiler-rt/lib/builtins/divtc3

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/3] [clang][modules] Print library module manifest path. This i

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Thank you for the suggestions and your guidance I will update it as soon as possible. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Mark de Wever via cfe-commits
mordante wrote: @ChuanqiXu9 can you do a full review? I'd like to have this reviewed so we can land it when the libc++ side is ready. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang-tools-extra] [llvm] [clang] [AArch64][SVE2] Lower OR to SLI/SRI (PR #77555)

2024-01-11 Thread Usman Nadeem via cfe-commits
https://github.com/UsmanNadeem updated https://github.com/llvm/llvm-project/pull/77555 >From 7eeacff38b6d95fb2eb0fe13cad660801e7982fd Mon Sep 17 00:00:00 2001 From: "Nadeem, Usman" Date: Tue, 9 Jan 2024 20:20:10 -0800 Subject: [PATCH 1/2] [AArch64][SVE2] Lower OR to SLI/SRI Code builds on NEON

[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)

2024-01-11 Thread Vlad Serebrennikov via cfe-commits
@@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s -// RUN

[flang] [clang] [flang][Driver] Support -pthread in the frontend (PR #77360)

2024-01-11 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu updated https://github.com/llvm/llvm-project/pull/77360 >From 187f91dcd9e602c944b089adfb243127c31de2ca Mon Sep 17 00:00:00 2001 From: Tarun Prabhu Date: Mon, 8 Jan 2024 10:56:09 -0700 Subject: [PATCH 1/2] [flang][Driver] Support -pthread in the frontend The -pthr

[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)

2024-01-11 Thread Gedare Bloom via cfe-commits
gedare wrote: > > The __attribute((specifier-list)) currently is formatted based on the > > SpacesInParensOptions.Other (previously, SpacesInParentheses). This change > > allows finer control over addition of spaces between the consecutive > > parens, and between the inner parens and the list

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-11 Thread Aaron Ballman via cfe-commits
@@ -2539,6 +2539,12 @@ StmtResult Sema::ActOnCXXForRangeStmt(Scope *S, SourceLocation ForLoc, return StmtError(); } + if (getLangOpts().CPlusPlus23) { +auto Entity = InitializedEntity::InitializeVariable(RangeVar); AaronBallman wrote: Ah `Initiali

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-11 Thread Aaron Ballman via cfe-commits
@@ -8244,11 +8229,33 @@ ExprResult Sema::IgnoredValueConversions(Expr *E) { // If the expression is a prvalue after this optional conversion, the // temporary materialization conversion is applied. // -// We skip this step: IR generation is able to synthesiz

[clang] [ObjC]: Make type encoding safe in symbol names (PR #77797)

2024-01-11 Thread Frederik Carlier via cfe-commits
https://github.com/qmfrederik updated https://github.com/llvm/llvm-project/pull/77797 >From 34933c7dbba8168f9d0e568ef1d5c49ce22511fe Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 10 Jan 2024 16:51:18 + Subject: [PATCH] [ObjC]: Make type encoding safe in symbol names Type encod

[llvm] [libunwind] [compiler-rt] [lld] [clang-tools-extra] [libc] [flang] [libcxx] [clang] [lldb] [libclc] [libcxxabi] [builtins] Generate __multc3 for z/OS (PR #77554)

2024-01-11 Thread Alexander Richardson via cfe-commits
@@ -15,8 +15,6 @@ #include "int_lib.h" #include "int_math.h" -#if defined(CRT_HAS_TF_MODE) arichardson wrote: I'm not sure if we support architectures without a "tf" floating point type. To be safe I believe we still need a guard here since this file is comp

[flang] [clang] [flang][Driver] Support -pthread in the frontend (PR #77360)

2024-01-11 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > > IIUC, this means that on older system compilation will indeed fail without > > `-pthread`, but shouldn't be needed on newer systems. @tarunprabhu - > > perhaps add a link to that article in your test and add a note that on many > > systems compilation will succeed even

[flang] [clang-tools-extra] [lld] [llvm] [libcxx] [compiler-rt] [clang] [libcxxabi] [libc] [libunwind] [lldb] [libclc] [builtins] Generate __multc3 for z/OS (PR #77554)

2024-01-11 Thread Alexander Richardson via cfe-commits
@@ -13,8 +13,6 @@ #define QUAD_PRECISION #include "fp_lib.h" -#if defined(CRT_HAS_TF_MODE) arichardson wrote: I'd suggest replacing this with CRT_HAS_F128 as noted below (unless you're will to audit all current uses of CRT_HAS_TF_MODE since that currently is

[clang] cf3421d - [Format] Fix a warning

2024-01-11 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2024-01-11T12:09:01-08:00 New Revision: cf3421de587d7c947e8f6b5c754393f85a395747 URL: https://github.com/llvm/llvm-project/commit/cf3421de587d7c947e8f6b5c754393f85a395747 DIFF: https://github.com/llvm/llvm-project/commit/cf3421de587d7c947e8f6b5c754393f85a395747.diff L

[clang] [flang] [flang][Driver] Support -pthread in the frontend (PR #77360)

2024-01-11 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. LGTM, thanks! > This has only be tested on x86 Linux. [nit] Note that the test that you've added will run on any platform. Unless that's referring to something else? https://github.com/llvm/llvm-project/pull/77360 ___

[flang] [clang] [flang][Driver] Support -pthread in the frontend (PR #77360)

2024-01-11 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > [nit] Note that the test that you've added will run on any platform. Unless > that's referring to something else? That was only highlighting that I have not tested this on AArch64 or Windows. Could someone test this on AArch64 and/or Windows just to make sure that it pas

[clang] [clang][Interp] Implement IntegralAP::{div, rem} (PR #72614)

2024-01-11 Thread Aaron Ballman via cfe-commits
@@ -44,6 +44,24 @@ static_assert(MulA * MulB == 50, ""); // ref-error {{not an integral constant ex static_assert(MulA * 5 == 25, ""); static_assert(-1 * MulB == -7, ""); + +constexpr _BitInt(4) DivA = 2; +constexpr _BitInt(2) DivB = 1; +static_assert(DivA / DivB == 2, ""); +

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-11 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/77066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [compiler-rt] [clang] [mlir] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-11 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Reverted at e7f794875169811f3801fad6d40bb9fe833e1a69. Will file an issue to track it once reducing is done. https://github.com/llvm/llvm-project/pull/77210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[libcxxabi] [clang-tools-extra] [libc] [clang] [llvm] [lld] [mlir] [flang] [libcxx] [lldb] [libunwind] [openmp] [compiler-rt] [clang] static operators should evaluate object argument (PR #68485)

2024-01-11 Thread Tianlan Zhou via cfe-commits
https://github.com/SuperSodaSea updated https://github.com/llvm/llvm-project/pull/68485 >From 03276260c48d9cafb2a0d80825156e77cdf02eba Mon Sep 17 00:00:00 2001 From: SuperSodaSea Date: Sat, 7 Oct 2023 21:05:17 +0800 Subject: [PATCH 01/15] [clang] static operators should evaluate object argumen

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-11 Thread Utkarsh Saxena via cfe-commits
usx95 wrote: All the blockers to land this have been addressed. Since this is not approved, does it look fine to land @ilya-biryukov ? https://github.com/llvm/llvm-project/pull/72213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-11 Thread Nemanja Ivanovic via cfe-commits
@@ -2110,6 +2110,66 @@ static bool checkFPMathBuiltinElementType(Sema &S, SourceLocation Loc, return false; } +/// SemaBuiltinCpuSupports - Handle __builtin_cpu_supports(char *). +/// This checks that the target supports __builtin_cpu_supports and +/// that the string argum

[clang] [ObjC]: Make type encoding safe in symbol names (PR #77797)

2024-01-11 Thread Frederik Carlier via cfe-commits
@@ -1,5 +1,14 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t %s -// RUN: FileCheck < %t %s +// RUN: FileCheck -check-prefix CHECK-DWARF < %t %s + +// RUN: %clang_cc1 -triple x86_64-w64-windows-gnu -emit-llvm -fobjc-runtime=gnustep-2.0 -o %t %s +// RUN: FileCh

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-11 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/77699 >From ff055d9c064d1fb359d59eeb47cb5f8c6c422bec Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 7 Jul 2023 17:28:47 -0600 Subject: [PATCH 1/4] Fix formatting of if statements with BlockIndent A bug with Blo

[clang] [clang-format] Don't confuse initializer equal signs in for loops (PR #77712)

2024-01-11 Thread Gedare Bloom via cfe-commits
@@ -703,7 +703,9 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, if (Current.is(tok::equal) && (State.Line->First->is(tok::kw_for) || Current.NestingLevel == 0) && - CurrentState.VariablePos == 0) { + CurrentState.VariableP

[compiler-rt] [libcxx] [mlir] [llvm] [clang] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Reverted at > [e7f7948](https://github.com/llvm/llvm-project/commit/e7f794875169811f3801fad6d40bb9fe833e1a69). > Will file an issue to track it once reducing is done. I've reduced it. It's code like below where a memcpy confused StackSafetyAnalysis in a macOS+libc++ build.

[clang] [clang-format] Don't confuse initializer equal signs in for loops (PR #77712)

2024-01-11 Thread Gedare Bloom via cfe-commits
https://github.com/gedare approved this pull request. https://github.com/llvm/llvm-project/pull/77712 ___ 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-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH] [clang-tidy] Add bugprone-move-shared-pointer-contents check. Thi

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
pizzud wrote: > Ack, I messed this up like whoa! Sorry for all the noise and extraneous > commits sneaking in. Okay fixed this, but i'm not sure how to unrequest reviews. https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cf

[llvm] [clang] [lld] [flang] [AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (PR #76955)

2024-01-11 Thread Cory Bloor via cfe-commits
@@ -520,6 +520,106 @@ Every processor supports every OS ABI (see :ref:`amdgpu-os`) with the following === === = = === === == +Generic processors also exist. They group mult

[flang] [lld] [llvm] [clang] [AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (PR #76955)

2024-01-11 Thread Cory Bloor via cfe-commits
@@ -520,6 +520,106 @@ Every processor supports every OS ABI (see :ref:`amdgpu-os`) with the following === === = = === === == +Generic processors also exist. They group mult

[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)

2024-01-11 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/77522 >From 5e5bec9fba56f34c7dd28ca866eef145035a Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 17 Jul 2023 18:24:30 -0600 Subject: [PATCH 1/5] Add SpaceInParensOption for __attribute__ keyword The __attrib

[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)

2024-01-11 Thread Gedare Bloom via cfe-commits
gedare wrote: I'm still making changes on this. Not sure how to mark that in GH. Need to add test cases for double parens, and get it working for the newly added suboptions. https://github.com/llvm/llvm-project/pull/77522 ___ cfe-commits mailing lis

[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)

2024-01-11 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 75efddba0f507282df479a6e296d67fd88aed489 79b4c34eba3a96d869cf4bfc0f0d2ff358bf1b42 --

[clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-11 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/76873 >From 7dbaf037b6b2196cee7c0c837e0a89ce3c2556ed Mon Sep 17 00:00:00 2001 From: Ammarguellat Date: Wed, 3 Jan 2024 14:37:17 -0800 Subject: [PATCH 1/3] [CLANG] Add warning when comparing to INF or NAN in fast math

[clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-11 Thread Zahira Ammarguellat via cfe-commits
@@ -0,0 +1,245 @@ +// RUN: %clang_cc1 -x c++ -verify -triple powerpc64le-unknown-unknown %s \ +// RUN: -menable-no-infs -menable-no-nans -DFAST=1 + +// RUN: %clang_cc1 -x c++ -verify -triple powerpc64le-unknown-unknown %s \ +// RUN: -DNOFAST=1 + +// RUN: %clang_cc1 -x c++ -verify

[clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-11 Thread Zahira Ammarguellat via cfe-commits
@@ -6771,6 +6771,9 @@ def warn_pointer_sub_null_ptr : Warning< def warn_floatingpoint_eq : Warning< "comparing floating point with == or != is unsafe">, InGroup>, DefaultIgnore; +def warn_fast_floatingpoint_eq : Warning< + "explicit comparison with %0 when the program is a

[llvm] [clang] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -5400,6 +5400,16 @@ for clang builtin functions. }]; } +def RISCVVectorCCDocs : Documentation { + let Category = DocCatCallingConvs; + let Content = [{ +The ``riscv_vector_cc`` attribute can be applied to a function. It preserves 15 +registers namely, v1-v7 and v24-v31 as

[llvm] [clang] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -24,6 +24,19 @@ def CSR_ILP32D_LP64D : CalleeSavedRegs<(add CSR_ILP32_LP64, F8_D, F9_D, (sequence "F%u_D", 18, 27))>; +defvar CSR_V = (add (sequence "V%u", 1, 7), (sequence "V%u", 24, 31), + V2M2, V4M2, V6M2, V24M2, V26M2, V28M

[clang] [llvm] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -1416,14 +1560,46 @@ bool RISCVFrameLowering::restoreCalleeSavedRegisters( // first in the epilogue. It increases the opportunity to avoid the // load-to-use data hazard between loading RA and return by RA. // loadRegFromStackSlot can insert multiple instructions. + /

[clang] [llvm] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -1416,14 +1560,46 @@ bool RISCVFrameLowering::restoreCalleeSavedRegisters( // first in the epilogue. It increases the opportunity to avoid the // load-to-use data hazard between loading RA and return by RA. // loadRegFromStackSlot can insert multiple instructions. + /

[llvm] [clang] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -0,0 +1,19 @@ +// REQUIRES: riscv-registered-target topperc wrote: Does this test really require `riscv-registered-target`? It doesn't include any headers and doesn't run any IR passes https://github.com/llvm/llvm-project/pull/77560 _

[llvm] [clang] riscv vector cc (PR #77560)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -563,6 +615,10 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF, // directives. for (const auto &Entry : CSI) { int FrameIdx = Entry.getFrameIdx(); +if (FrameIdx >=0 && topperc wrote: space between `>=` and `0` https://github.com/ll

[llvm] [flang] [clang] [clang-tools-extra] [compiler-rt] [libc] [lldb] [lld] [libcxx] [AMDGPU] Use alias info to relax waitcounts for LDS DMA (PR #74537)

2024-01-11 Thread Stanislav Mekhanoshin via cfe-commits
rampitec wrote: Ping https://github.com/llvm/llvm-project/pull/74537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][FatLTO][UnifiedLTO] Pass -enable-matrix to the LTO driver (PR #77829)

2024-01-11 Thread Matthew Voss via cfe-commits
https://github.com/ormris created https://github.com/llvm/llvm-project/pull/77829 Unified LTO and Fat LTO do not use the regular LTO prelink pipeline when -flto/-flto=full is specified on the command line, thus they require LowerMatrixIntrinsicsPass to be run during the link stage. To enable t

[clang] [clang][FatLTO][UnifiedLTO] Pass -enable-matrix to the LTO driver (PR #77829)

2024-01-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Matthew Voss (ormris) Changes Unified LTO and Fat LTO do not use the regular LTO prelink pipeline when -flto/-flto=full is specified on the command line, thus they require LowerMatrixIntrinsicsPass to be run during the link stage.

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-11 Thread Nemanja Ivanovic via cfe-commits
https://github.com/nemanjai updated https://github.com/llvm/llvm-project/pull/68919 >From 71f1352bf00d6a9eefa3f199859d47d093f272f8 Mon Sep 17 00:00:00 2001 From: Nemanja Ivanovic Date: Thu, 12 Oct 2023 14:08:42 -0400 Subject: [PATCH 1/4] [PowerPC][X86] Make cpu id builtins target independent a

[clang] [RISCV] Overwrite cpu target features for full arch string in target attribute (PR #77426)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -281,10 +248,27 @@ bool RISCVTargetInfo::initFeatureMap( Features["32bit"] = true; } - std::vector NewFeaturesVec = - resolveTargetAttrOverride(FeaturesVec, XLen); + // If a target attribute specified a full arch string, override all the ISA + // extension tar

[clang] [RISCV] Overwrite cpu target features for full arch string in target attribute (PR #77426)

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

[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)

2024-01-11 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/77522 >From 5e5bec9fba56f34c7dd28ca866eef145035a Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 17 Jul 2023 18:24:30 -0600 Subject: [PATCH 1/6] Add SpaceInParensOption for __attribute__ keyword The __attrib

[clang] [clang][FatLTO][UnifiedLTO] Pass -enable-matrix to the LTO driver (PR #77829)

2024-01-11 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 2bb511e277e501d3faa0f2da0d1c98ea0b515507 4f3d4470b696bd4eeb5a59105b4cd5ee741a818f --

[clang] [RISCV] Overwrite cpu target features for full arch string in target attribute (PR #77426)

2024-01-11 Thread Craig Topper via cfe-commits
@@ -413,7 +385,9 @@ static void handleFullArchString(StringRef FullArchStr, // Forward the invalid FullArchStr. Features.push_back("+" + FullArchStr.str()); } else { -std::vector FeatStrings = (*RII)->toFeatures(); +// Append a full list of features, including

[compiler-rt] [libcxx] [lld] [mlir] [clang] [llvm] [openmp] [flang] [lldb] [clang-format] SpacesInSquareBrackets not working for Java (PR #77833)

2024-01-11 Thread via cfe-commits
https://github.com/mydeveloperday created https://github.com/llvm/llvm-project/pull/77833 spaces in [] needs to be handled the same in Java the same as C#. >From 4ccf762ec644b4f79b2862750035ec7a97cd74fc Mon Sep 17 00:00:00 2001 From: paul_hoad Date: Thu, 11 Jan 2024 20:50:48 + Subject: [P

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH 1/2] [clang-tidy] Add bugprone-move-shared-pointer-contents check.

[llvm] [flang] [clang] [compiler-rt] [lldb] [mlir] [lld] [openmp] [libcxx] [clang-format] SpacesInSquareBrackets not working for Java (PR #77833)

2024-01-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: MyDeveloperDay (mydeveloperday) Changes spaces in [] needs to be handled the same in Java the same as C#. --- Full diff: https://github.com/llvm/llvm-project/pull/77833.diff 2 Files Affected: - (modified) clang/lib/Format/TokenA

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
https://github.com/pizzud updated https://github.com/llvm/llvm-project/pull/67467 >From 04a3e8d8cbd6943f44a81fddb0524902202a1a78 Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH 1/3] [clang-tidy] Add bugprone-move-shared-pointer-contents check.

[compiler-rt] [libcxx] [lld] [mlir] [clang] [llvm] [openmp] [flang] [lldb] [clang-format] SpacesInSquareBrackets not working for Java (PR #77833)

2024-01-11 Thread via cfe-commits
mydeveloperday wrote: Fixes #77740 https://github.com/llvm/llvm-project/pull/77833 ___ 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-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I cleaned up the reviewers. I suggest to use `git merge` next time you need to bring your PR up to date with `main`. We are not worried about merge commits, as squash is the only available merge option for PRs. I also suggest to use "Start review" button when you respond to mult

[compiler-rt] [libcxx] [mlir] [llvm] [clang] [openmp] [lld] [libcxxabi] [runtimes] Use LLVM libunwind from libc++abi by default (PR #77687)

2024-01-11 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > @vitalybuka This seems to have broken the ASAN and HWASAN builds here: > https://lab.llvm.org/buildbot/#/builders/236/builds/8629/steps/8/logs/stdio > https://lab.llvm.org/buildbot/#/builders/168/builds/17965/steps/8/logs/stdio > > My understanding is that we'd now need to

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2024-01-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,242 @@ +//===--- RedundantCastingCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2024-01-11 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,242 @@ +//===--- RedundantCastingCheck.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: Ap

[clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-11 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %check_clang_tidy %s readability-ConditionalToStdMinMax %t + +void foo() { + int value1,value2; + + // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: use std::max instead of < [readability-ConditionalToStdMinMax] + if (value1 < value2) +value1 = value2;

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
pizzud wrote: > I cleaned up the reviewers. I suggest to use `git merge` next time you need > to bring your PR up to date with `main`. We are not worried about merge > commits, as squash is the only available merge option for PRs. > Thanks! I'll try merge next time. > I also suggest to use "

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-01-11 Thread via cfe-commits
@@ -0,0 +1,157 @@ +//===--- MoveSharedPointerContentsCheck.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: Ap

[clang] [clang][doc] Block ABI Apple - __weak __block Support : struct typo (PR #77836)

2024-01-11 Thread via cfe-commits
https://github.com/d4wae89d498 created https://github.com/llvm/llvm-project/pull/77836 Added two missing 's' for struct in the doc about block expressions. >From 19629abb573dd25e688f2391ccc1605f73fe95c7 Mon Sep 17 00:00:00 2001 From: d4wae89d498 Date: Thu, 11 Jan 2024 22:25:19 +0100 Subject: [

<    1   2   3   4   5   6   >