[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: > This is an alternative approach to address the issue described in > [discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570](https://discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570) > which doesn't require a custom section type. This RFC is about `SH

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -75,6 +75,10 @@ static cl::opt JumpTableInFunctionSection( "jumptable-in-function-section", cl::Hidden, cl::init(false), cl::desc("Putting Jump Table in function section")); +static cl::opt UniqueExplicitSections( +"unique-explicit-sections", cl::Hidden, cl::ini

[clang] [NFC][Driver] Clean up RenderFloatingPointOptions() (PR #91017)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/91017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxxabi] [llvm] Add support for WASI builds (PR #91051)

2024-05-04 Thread Luca Versari via cfe-commits
https://github.com/veluca93 created https://github.com/llvm/llvm-project/pull/91051 This PR modifies the LLVM source code to compile (and run) in a WASI environment. The question of whether having WASI support in LLVM is one that doesn't have a clear answer for me (although of course I can se

[clang] [libcxxabi] [llvm] Add support for WASI builds (PR #91051)

2024-05-04 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() like foo()->bar(). (PR #91052)

2024-05-04 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/91052 None >From 357b8bfa0cef2632930e3f037ed66360b0fa3615 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 4 May 2024 00:38:08 -0700 Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() li

[clang] 294eecd - [clang][docs] fix rendering issue in UsersManual.rst (#90308)

2024-05-04 Thread via cfe-commits
Author: Nikita Kniazev Date: 2024-05-04T09:57:38+02:00 New Revision: 294eecd4cbd8a1e0dcc0cdbe1238817b92ba7668 URL: https://github.com/llvm/llvm-project/commit/294eecd4cbd8a1e0dcc0cdbe1238817b92ba7668 DIFF: https://github.com/llvm/llvm-project/commit/294eecd4cbd8a1e0dcc0cdbe1238817b92ba7668.diff

[clang] [clang][docs] fix rendering issue in UsersManual.rst (PR #90308)

2024-05-04 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/90308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-04 Thread via cfe-commits
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool HasEmptyBody) { + if (CGM.getCode

[clang] [llvm] [AArch64] Add support for Qualcomm Oryon processor (PR #91022)

2024-05-04 Thread Andrew Pinski via cfe-commits
pinskia wrote: Note the corresponding GCC patch: https://gcc.gnu.org/pipermail/gcc-patches/2024-May/650664.html https://github.com/llvm/llvm-project/pull/91022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread Andrew Pinski via cfe-commits
pinskia wrote: I don't think you can use x16 and x17 for argument passing due to them being reserved for PLTs and call veneers. https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread via cfe-commits
lipracer wrote: This change seems to be unrelated to the platform, and I don't think it's the change that caused the CI error. From the compiled log, it seems that there is not enough memory space. https://github.com/llvm/llvm-project/assets/22370779/d1acbd6b-45e4-46c0-b297-9d0a8f8abedb";> ht

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

2024-05-04 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. I can definitely think of cases where an expression might contain `...` and still have redundant parentheses, i.e. if the ellipsis isn't part of a fold expression For example: ```c++ template std::tuple foo() { return (std::tuple{}); }

[clang] [clang-format] Don't allow comma in front of structural enum (PR #91056)

2024-05-04 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/91056 Assume that a comma in front of `enum` means it is actually a part of an elaborated type in a template parameter list. Fixes https://github.com/llvm/llvm-project/issues/47782 >From f625311fe7259a07607cc2bb8c13e0

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
SimplyDanny wrote: > This change seems to be unrelated to the platform, and I don't think it's the > change that caused the CI error. From the compiled log, it seems that there > is not enough memory space. width="1499" > src="https://private-user-images.githubusercontent.com/22370779/3279381

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

2024-05-04 Thread Hendrik Hübner via cfe-commits
https://github.com/HendrikHuebner created https://github.com/llvm/llvm-project/pull/91057 When an atomic builtin is called with a pointer to an object of size zero, an arithmetic exception gets thrown because there is a modulo operation with the objects size in codegen. This is described here:

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

2024-05-04 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

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

2024-05-04 Thread Chris Apple via cfe-commits
cjappl wrote: I can confirm that now if I try to use any argument with `blocking` I get: ``` /Users/topher/Desktop/test_radsan/main.cpp:25:40: error: 'blocking' attribute takes no arguments 25 | float process (float* data) noexcept [[clang::blocking(false)]] ``` Great! https://github.com/l

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

2024-05-04 Thread Chris Apple via cfe-commits
cjappl wrote: Possibly another bug here (or user error). I am trying to see the warnings show up for a simple test program. The clang used in this example is the tip of your branch at time of writing b95964c2570c11d1d80ae6874be5e400f7b504ad ```cpp #include #include int* process () [[clang:

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-05-04 Thread zhijian lin via cfe-commits
https://github.com/diggerlin edited https://github.com/llvm/llvm-project/pull/77732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-04 Thread Chris Apple via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

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

2024-05-04 Thread Chris Apple via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, cjappl wro

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

2024-05-04 Thread Chris Apple via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

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

2024-05-04 Thread Chris Apple via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

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

2024-05-04 Thread Chris Apple via cfe-commits
https://github.com/cjappl commented: Just doing a first pass review. The guts of this are above my paygrade, but after playing with this functionally for a few days it seems to behave as intended from the realtime sanitizer team! :) https://github.com/llvm/llvm-project/pull/84983 _

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

2024-05-04 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-04 Thread Chris Apple via cfe-commits
@@ -0,0 +1,124 @@ +// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s + +// Make sure that the attribute gets parsed and attached to the correct AST elements. + +#pragma clang diagnostic ignored "-Wunused-variable" + +// =

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/91061 Previously treatment of the attribute `optnone` was modified in https://github.com/llvm/llvm-project/pull/85605 ([clang] Set correct FPOptions if attribute 'optnone' presents). As a side effect FPContract was d

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Serge Pavlov (spavloff) Changes Previously treatment of the attribute `optnone` was modified in https://github.com/llvm/llvm-project/pull/85605 ([clang] Set correct FPOptions if attribute 'optnone' presents). As a side effect FPContract w

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

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Nathan Lanza (lanza) Changes Build out the necessary infrastructure for the main entry point into ClangIR generation -- CIRGenModule. A set of boilerplate classes exist to facilitate this -- CIRGenerator, CIRGenAction, EmitCIRAction and C

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #90966. --- Full diff: https://github.com/llvm/llvm-project/pull/91045.diff 2 Files Affected: - (modified) clang/lib/Format/UnwrappedLineParser.cpp (+6-1) - (modified) clang/unittests/Format/Forma

[clang] [HLSL] Implement 202x conforming literals (PR #91015)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Chris B (llvm-beanz) Changes This implements the HLSL 202x conforming literals feature. The feature proposal is available here: https://github.com/microsoft/hlsl-specs/blob/main/proposals/0017-conforming-literals.md The language specificat

[clang] [AMDGPU] Allow the `__builtin_flt_rounds` functions on AMDGPU (PR #90994)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Joseph Huber (jhuber6) Changes Summary: Previous patches added support for the LLVM rounding intrinsic functions. This patch allows them to me emitted using the clang builtins when targeting AMDGPU. --- Full diff: https://github.

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 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 1aeb64c8ec7b96b2301929d8a325a6e1d9ddaa2f 32c0ec8a03b0c669dc595894730dd6f8a7933dea --

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-05-04 Thread Serge Pavlov via cfe-commits
spavloff wrote: Hi @wjristow, Thank you for your detailed analysis. Indeed, FPContract looks more like mandatory option rather than optional optimization. I prepared PR: https://github.com/llvm/llvm-project/pull/91061, which fixes this issue. https://github.com/llvm/llvm-project/pull/85605 __

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > * The auto-fix should be configurable to choose `static` or anonymous > namespace. Should I implement auto-fix for this check? Maybe some functions / variables will be marked incorrectly and cause link error because the coder just forget to include the header file but thi

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() like foo()->bar(). (PR #91052)

2024-05-04 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 37f6ba4fb2db2c78cda7d0a69cd0a2eff2b924e3 357b8bfa0cef2632930e3f037ed66360b0fa3615 --

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-04 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 a8fbe500fe2ecdbd3c09ed06788092937819411f ae7c7fd37eed7ff76ffddd778685450f084f3162 --

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-04 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 a8fbe500fe2ecdbd3c09ed06788092937819411f ebb6ac3dc1cc5f4e604ec3c7e68821432856920f --

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore WTF::RefCounted and its variants missing virtual destructor (PR #91009)

2024-05-04 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 37f6ba4fb2db2c78cda7d0a69cd0a2eff2b924e3 2b5782f9a7f6473174ccefa005268debb79aa744 --

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore WTF::RefCounted and its variants missing virtual destructor (PR #91009)

2024-05-04 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 37f6ba4fb2db2c78cda7d0a69cd0a2eff2b924e3 a9eb73de2ee7d2eadb742498bc0efb651e0b4d9a --

[clang] [NFC][Driver] Clean up RenderFloatingPointOptions() (PR #91017)

2024-05-04 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 7ec698e6edf5add1f0b49b42fba707bea4b80225 82e51e4cea0cb889842273fcac874bb52d6bd780 --

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 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 1aeb64c8ec7b96b2301929d8a325a6e1d9ddaa2f aeb607513587924106081213335f73ba6eb0 --

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 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 1aeb64c8ec7b96b2301929d8a325a6e1d9ddaa2f cf6ff55ad4a45875a821b3ac82c22bb7917b4d67 --

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From 5b74f02a766d66cfdd97adf4e89c091b9aa1823d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH] reformat --- .../clang-tidy/readability/CMakeLists.txt |

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/2] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread via cfe-commits
@@ -1,4 +1,4 @@ -//===--- UnnecessaryExternalLinkageCheck.cpp - clang-tidy +//===--- UseInternalLinkageCheck.cpp - clang-tidy EugeneZelenko wrote: Please merge into single line. https://github.com/llvm/llvm-project/pull/90830

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread via cfe-commits
@@ -1,7 +1,7 @@ -.. title:: clang-tidy - readability-unnecessary-external-linkage +.. title:: clang-tidy - misc-use-internal-linkage -readability-unnecessary-external-linkage - +misc-use-internal-linkage += Detec

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread via cfe-commits
@@ -151,8 +151,8 @@ New checks Enforces consistent style for enumerators' initialization, covering three styles: none, first only, or all initialized explicitly. -- New :doc:`readability-unnecessary-external-linkage - ` check. +- New :doc:`misc-use-internal-linkage --

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-05-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Bump @HighCommander4 - did you get a chance to review this? I've been using this with great success in my local build for several months now, and the feature is _extremely_ handy. There is a slight bug that overlapping fixes are troublesome if you choose "clangd apply all",

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-05-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ping https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-04 Thread via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, Sirraide w

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > Should I implement auto-fix for this check? As a first step we can have it without auto-fix and add that as a second step once we figure out a good way to do it. https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits m

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

2024-05-04 Thread via cfe-commits
cor3ntin wrote: > > I think the approach looks good. > > Do we have existing tests for the use of `module` as an identifier outside > > of a module declaration? > > IIUC, do you mean something looks like the following? I didn't find it in the > test case: > > ``` > void foo() { > int module

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/3] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang-tools-extra] [clang-tidy] new check readability-mark-static (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/3] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,79 @@ +//===--- UseInternalLinkageCheck.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] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread via cfe-commits
@@ -0,0 +1,26 @@ +.. title:: clang-tidy - readability-mark-static + +readability-mark-static +=== + +Detects variable and function can be marked as static. + +Static functions and variables are scoped to a single file. Marking functions +and variables as static

[clang] clang-format: Allow open brace with trailing comment (no line break) (PR #89956)

2024-05-04 Thread via cfe-commits
GertyP wrote: Ping https://github.com/llvm/llvm-project/pull/89956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/4] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang] cb015b9 - [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (#90377)

2024-05-04 Thread via cfe-commits
Author: Karl-Johan Karlsson Date: 2024-05-04T17:47:48+02:00 New Revision: cb015b9ec9446b3a1303980c095fa442d5e46fbf URL: https://github.com/llvm/llvm-project/commit/cb015b9ec9446b3a1303980c095fa442d5e46fbf DIFF: https://github.com/llvm/llvm-project/commit/cb015b9ec9446b3a1303980c095fa442d5e46fbf

[clang] [clang][CodeGen] Propagate pragma set fast-math flags to floating point builtins (PR #90377)

2024-05-04 Thread Karl-Johan Karlsson via cfe-commits
https://github.com/karka228 closed https://github.com/llvm/llvm-project/pull/90377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-04 Thread via cfe-commits
yronglin wrote: Thanks! I'd like to move the implementation from Parser to Preprocessor. I think It would make more sense to do these checks during lexing. https://github.com/llvm/llvm-project/pull/90574 ___ cfe-commits mailing list cfe-commits@lists.

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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 modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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 modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Use `const&` avoiding copies (PR #90334)

2024-05-04 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334 From e8420d3d39d729ee83e187913bb3a8d790f5779d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 27 Apr 2024 11:38:20 +0200 Subject: [PATCH] [NFC] Use const& avoiding copies --- clang/

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 Thread Mikhail R. Gadelha via cfe-commits
https://github.com/mikhailramalho created https://github.com/llvm/llvm-project/pull/91068 This patch also updates safeGetName to get names from operators without hitting an assertion >From 7f59654193385e78e1635c9bb2a627522f888b8d Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Sat,

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Thanks! I wasn't aware that was possible since I started with all these checks before fbf611ed2a768999202e2c5e1e1a6c3c6bb94725 and had been battling with the JSON syntax. https://github.com/llvm/llvm-project/pull/90397 ___

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mikhail R. Gadelha (mikhailramalho) Changes This patch also updates safeGetName to get names from operators without hitting an assertion --- Full diff: https://github.com/llvm/llvm-project/pull/91068.diff 2 Files Affected: - (modified)

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 Thread Mikhail R. Gadelha via cfe-commits
mikhailramalho wrote: Hey @rniwa, if you want I can send the `safeGetName` changes in a separate patch. I was planning to unify this with `isMethodOnWTFContainerType` so there is some duplicated code here. I'll update the PR next week with some tests. https://github.com/llvm/llvm-project/p

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 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 76aa042dde6ba9ba57c680950f5818259ee02690 7f59654193385e78e1635c9bb2a627522f888b8d --

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 Thread Mikhail R. Gadelha via cfe-commits
https://github.com/mikhailramalho updated https://github.com/llvm/llvm-project/pull/91068 >From dde31272c1599a699c49117c1612ae72d0491384 Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Sat, 4 May 2024 13:08:32 -0300 Subject: [PATCH] [alpha.webkit.UncountedLocalVarsChecker] Ignore loca

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/91061 >From 32c0ec8a03b0c669dc595894730dd6f8a7933dea Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sat, 4 May 2024 12:26:22 +0700 Subject: [PATCH 1/2] [clang] Enable FPContract with optnone Previously treatment o

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 01/16] [clang-tidy] Add modernize-use-std-format check Add a new c

[clang] [alpha.webkit.UncountedLocalVarsChecker] Ignore local vars of JSC::VM& type (PR #91068)

2024-05-04 Thread Mikhail R. Gadelha via cfe-commits
https://github.com/mikhailramalho updated https://github.com/llvm/llvm-project/pull/91068 >From a770060da101720ffddc033fd37db790eaa17710 Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Sat, 4 May 2024 13:08:32 -0300 Subject: [PATCH] [alpha.webkit.UncountedLocalVarsChecker] Ignore loca

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/91069 The set of functions for the PrintfLikeFunctions and FprintfLikeFunctions options replaces the default, so remove the word "extra" from the description which implies that they are in addition to the default.

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Mike Crowe (mikecrowe) Changes The set of functions for the PrintfLikeFunctions and FprintfLikeFunctions options replaces the default, so remove the word "extra" from the description which implies that they are in addition to the def

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: The equivalent mistake was spotted by @5chmidti in https://github.com/llvm/llvm-project/pull/90397/files/54c325d7a5e24441adbe8036800a2f50e2ff5fa0#r1589697782 in the new use-std-format check. https://github.com/llvm/llvm-project/pull/91069 __

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/91070 Incomplete types are assumed to need the llvm.launder.invariant.group intrinsic Fixes #90949 >From 21d9f27692b2a2fa9ac99f4644109e62e3730133 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Mital Ashok (MitalAshok) Changes Incomplete types are assumed to need the llvm.launder.invariant.group intrinsic Fixes #90949 --- Full diff: https://github.com/llvm/llvm-project/pull/91070.diff 5 Files Affected: - (modified) cl

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

2024-05-04 Thread Doug Wyatt via cfe-commits
dougsonos wrote: > So seems like I was just premature, makes sense to break this in to pieces > :). Am I right to assume that these warnings will be back, just in PR 2? Yes, you can revert c18b77459fb34482f169323de9a81142a922b6a7 to bring the caller/callee diagnostics back. https://github.com

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 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 028f1b078193b9120ddb441808521b6bd6eaed0e 21d9f27692b2a2fa9ac99f4644109e62e3730133 --

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From fe8c0dc5f7beacae7b1494a5987c3674dbd330d3 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

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

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

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

2024-05-04 Thread via cfe-commits
@@ -768,6 +776,18 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); + // - function effects --- + + /// Warn when implicitly changing function effects. + void di

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

2024-05-04 Thread via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

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

2024-05-04 Thread via cfe-commits
@@ -5119,6 +5448,62 @@ class FunctionProtoType final return false; } + unsigned getNumFunctionEffects() const { +return hasExtraBitfields() + ? getTrailingObjects() + ->NumFunctionEffects + : 0; + } + + // For serial

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

2024-05-04 Thread via cfe-commits
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto &EllipsisLoc = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto &ExtraBits = *getTrailingObjects(); +// TO

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

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

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

2024-05-04 Thread via cfe-commits
@@ -352,6 +352,12 @@ let Class = FunctionProtoType in { def : Property<"AArch64SMEAttributes", UInt32> { let Read = [{ node->getAArch64SMEAttributes() }]; } + def : Property<"functionEffects", Array> { +let Read = [{ node->getFunctionEffectsOnly() }]; -

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

2024-05-04 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. Overall, it’s looking pretty good I’d say; there are some minor things here and there, but nothing major. Missing are also more tests that involve dependent expressions, especially tests that actually instantiate such template

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

2024-05-04 Thread via cfe-commits
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto &EllipsisLoc = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto &ExtraBits = *getTrailingObjects(); +// TO

  1   2   3   >