[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/74919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] introduce a unused local non trival variable check (PR #76101)

2023-12-22 Thread via cfe-commits
@@ -0,0 +1,45 @@ +.. title:: clang-tidy - bugprone-unused-local-non-trivial-variable + +bugprone-unused-local-non-trivial-variable +== + +Warns when a local non trivial variable is unused within a function. +The following types of variables

[clang-tools-extra] [clang-tidy] introduce a unused local non trival variable check (PR #76101)

2023-12-22 Thread Tyler Rockwood via cfe-commits
https://github.com/rockwotj updated https://github.com/llvm/llvm-project/pull/76101 >From fff68e1854d16a166088d7199af09a7aeb19b4c4 Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Thu, 21 Dec 2023 16:31:12 -0600 Subject: [PATCH 1/2] clang-tidy/bugprone: introduce unused-local-non-trivial-va

[clang-tools-extra] [clang-tidy] introduce a unused local non trival variable check (PR #76101)

2023-12-22 Thread Tyler Rockwood via cfe-commits
https://github.com/rockwotj updated https://github.com/llvm/llvm-project/pull/76101 >From 9a9fe7fd0a7b54c90042c64aa9db23b4ca703ec0 Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Thu, 21 Dec 2023 16:31:12 -0600 Subject: [PATCH 1/2] clang-tidy/bugprone: introduce unused-local-non-trivial-va

[clang-tools-extra] [clang-tidy] introduce a unused local non trival variable check (PR #76101)

2023-12-22 Thread Tyler Rockwood via cfe-commits
@@ -0,0 +1,45 @@ +.. title:: clang-tidy - bugprone-unused-local-non-trivial-variable + +bugprone-unused-local-non-trivial-variable +== + +Warns when a local non trivial variable is unused within a function. +The following types of variables

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-22 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/76248 According to [CWG1351](https://cplusplus.github.io/CWG/issues/1351.html), overriding functions that are defined as deleted can have more lax exception specifications compared to the base version. For example, th

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sirui Mu (Lancern) Changes According to [CWG1351](https://cplusplus.github.io/CWG/issues/1351.html), overriding functions that are defined as deleted can have more lax exception specifications compared to the base version. For example, th

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-22 Thread Sirui Mu via cfe-commits
Lancern wrote: > Feel free to put up a PR / issue for this if you are interested. Hi Younan. FYI, I have opened a new PR that addresses this problem. See #76248. https://github.com/llvm/llvm-project/pull/75937 ___ cfe-commits mailing list cfe-commits@

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny created https://github.com/llvm/llvm-project/pull/76249 Closes #75788. The idea is to check each return statements for an expression that has type `void` as this is only possible in a function with `void` return type. The implementation seems too simple. I might

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Danny Mösch (SimplyDanny) Changes Closes #75788. The idea is to check each return statements for an expression that has type `void` as this is only possible in a function with `void` return type. The implementation seems too simple.

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 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 5f254eb05566f5b400a212ae77117a9efd9019a1 579cfd2eec9932aff10bf258811ec772a3503ce0 --

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/76249 From 0daffd13160bc10e15e36327e596f8cabb96706e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 22 Dec 2023 17:09:59 +0100 Subject: [PATCH] [clang-tidy] Add check readability-return-ex

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-22 Thread Nico Weber via cfe-commits
@@ -6158,12 +6158,24 @@ def err_illegal_initializer_type : Error<"illegal initializer type %0">; def ext_init_list_type_narrowing : ExtWarn< "type %0 cannot be narrowed to %1 in initializer list">, InGroup, DefaultError, SFINAEFailure; +// *_narrowing_const_reference diagn

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-22 Thread Nico Weber via cfe-commits
https://github.com/nico edited https://github.com/llvm/llvm-project/pull/76094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-22 Thread Nico Weber via cfe-commits
https://github.com/nico approved this pull request. Thanks! I'm going to merge this since it'll unblock quite a few people. I have a minor comment below that can be addressed in a follow-up. https://github.com/llvm/llvm-project/pull/76094 ___ cfe-comm

[clang] dd85c6c - [Sema] Add -Wc++11-narrowing-const-reference (#76094)

2023-12-22 Thread via cfe-commits
Author: Fangrui Song Date: 2023-12-22T11:28:07-05:00 New Revision: dd85c6cce4fc60fa4850770d66f783300a700f3a URL: https://github.com/llvm/llvm-project/commit/dd85c6cce4fc60fa4850770d66f783300a700f3a DIFF: https://github.com/llvm/llvm-project/commit/dd85c6cce4fc60fa4850770d66f783300a700f3a.diff

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-22 Thread Nico Weber via cfe-commits
https://github.com/nico closed https://github.com/llvm/llvm-project/pull/76094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CMake] Move check for dlfcn.h and dladdr to clang (PR #76163)

2023-12-22 Thread Nico Weber via cfe-commits
nico wrote: Can you say what motivated this? Change looks fine, but it looks like it fixes a problem someone reported somewhere but this doesn't say what the problem says. https://github.com/llvm/llvm-project/pull/76163 ___ cfe-commits mailing list cf

[llvm] [clang] [CMake] Move check for dlfcn.h and dladdr to clang (PR #76163)

2023-12-22 Thread Abhina Sree via cfe-commits
abhina-sree wrote: > Can you say what motivated this? Change looks fine, but it looks like it > fixes a problem someone reported somewhere but this doesn't say what the > problem is. Yes, there was a concern about exposing prefix-less macros in the llvm-config.h here https://github.com/llvm/l

[clang] [llvm] [CMake] Move check for dlfcn.h and dladdr to clang (PR #76163)

2023-12-22 Thread Nico Weber via cfe-commits
nico wrote: Thanks! https://github.com/llvm/llvm-project/pull/76163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #75082)

2023-12-22 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann approved this pull request. Looks good to me! https://github.com/llvm/llvm-project/pull/75082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #75082)

2023-12-22 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/75082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #75082)

2023-12-22 Thread Tom Honermann via cfe-commits
@@ -876,7 +876,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline( << PluginFN << toString(PassPlugin.takeError()); } } - for (auto PassCallback : CodeGenOpts.PassBuilderCallbacks) + for (const auto &PassCallback : CodeGenOpts.PassBuilderCallbacks)

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Not too bad, think more about check name and warning message. https://github.com/llvm/llvm-project/pull/76249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,31 @@ +//===--- ReturnExpressionInVoidFunctionCheck.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 check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/76249 ___ 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 check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
@@ -119,6 +120,8 @@ class ReadabilityModule : public ClangTidyModule { "readability-redundant-preprocessor"); CheckFactories.registerCheck( "readability-reference-to-constructed-temporary"); +CheckFactories.registerCheck( +"readability-return-exp

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,30 @@ +//===--- ReturnExpressionInVoidFunctionCheck.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] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
@@ -371,6 +371,7 @@ Clang-Tidy Checks :doc:`readability-redundant-string-cstr `, "Yes" :doc:`readability-redundant-string-init `, "Yes" :doc:`readability-reference-to-constructed-temporary `, + :doc:`readability-return-expression-in-void-function `, "Yes" ---

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread Michael Klemm via cfe-commits
https://github.com/mjklemm updated https://github.com/llvm/llvm-project/pull/75816 >From 511f3a4537267284554bf6b33470a01d747b8a94 Mon Sep 17 00:00:00 2001 From: Michael Klemm Date: Sat, 16 Dec 2023 20:15:17 +0100 Subject: [PATCH 1/5] Remove -lFortran_main from the link line when -shared is pre

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,23 @@ +// RUN: %check_clang_tidy %s readability-return-expression-in-void-function %t + +void f1(); + +void f2() { +return f1(); PiotrZSL wrote: add tests with normal returns: "return;" https://github.com/llvm/llvm-project/pull/76249 _

[clang] [NFC][Clang] Fix Static Code Analysis Concerns with copy without assign (PR #75091)

2023-12-22 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann requested changes to this pull request. I think the static analysis tool is confused here. The `SVEType` class doesn't actually have a user-declared copy constructor. It does have a constructor that delegates to the implicitly declared copy constructor though. The

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
@@ -119,6 +120,8 @@ class ReadabilityModule : public ClangTidyModule { "readability-redundant-preprocessor"); CheckFactories.registerCheck( "readability-reference-to-constructed-temporary"); +CheckFactories.registerCheck( +"readability-return-exp

[clang] [llvm] [clang-tools-extra] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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] [llvm] [clang-tools-extra] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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] [llvm] [clang-tools-extra] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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] [llvm] [clang] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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] [llvm] [clang] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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

[llvm] [clang] [clang-tools-extra] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-22 Thread David Sherwood via cfe-commits
@@ -0,0 +1,816 @@ +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// 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

[llvm] [clang-tools-extra] [clang] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -245,6 +245,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, opts.AliasAnalysis = opts.OptimizationLevel > 0; + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) { +llvm::StringRef s

[llvm] [clang-tools-extra] [clang] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Kiran Chandramohan via cfe-commits
@@ -245,6 +245,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, opts.AliasAnalysis = opts.OptimizationLevel > 0; + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) { +llvm::StringRef s

[clang-tools-extra] [flang] [clang] [llvm] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: This change doesn't make sense to me. This file tests default pass pipelines for various debug levels. Why is `-fomit-frame-pointer` needed here? https://github.com/llvm/llvm-project/pull/74598 _

[flang] [clang] [llvm] [clang-tools-extra] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -1,9 +1,12 @@ ! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend -! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s -! CHECK: "-mframe-pointer=all" +! RUN: %flang --target

[llvm] [clang-tools-extra] [clang] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,23 @@ +! Test that -mframe-pointer can accept only specific values. banach-space wrote: You seem to be testing a bit more in this file than this comment suggests (e.g. that `-mframe-pointer` will make the compiler insert the new attributes) Please, c

[llvm] [flang] [clang-tools-extra] [clang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -51,9 +51,9 @@ ! Content to check from the MLIR outputs !-- ! MLIR-FIR-NOT: llvm.func -! MLIR-FIR: func.func @{{.*}}main() { +! MLIR-FIR: func.func @{{.*}}main(){{.*}}{ banach-space wrote: Could you explain why it was failing? I just

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/76249 From 0daffd13160bc10e15e36327e596f8cabb96706e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 22 Dec 2023 17:09:59 +0100 Subject: [PATCH 1/5] [clang-tidy] Add check readability-retur

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/76249 ___ 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 check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/76249 ___ 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 check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -119,6 +120,8 @@ class ReadabilityModule : public ClangTidyModule { "readability-redundant-preprocessor"); CheckFactories.registerChec

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/76249 From 0daffd13160bc10e15e36327e596f8cabb96706e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 22 Dec 2023 17:09:59 +0100 Subject: [PATCH 1/5] [clang-tidy] Add check readability-retur

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/76249 From 0daffd13160bc10e15e36327e596f8cabb96706e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 22 Dec 2023 17:09:59 +0100 Subject: [PATCH 1/6] [clang-tidy] Add check readability-retur

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Danny Mösch via cfe-commits
@@ -119,6 +120,8 @@ class ReadabilityModule : public ClangTidyModule { "readability-redundant-preprocessor"); CheckFactories.registerCheck( "readability-reference-to-constructed-temporary"); +CheckFactories.registerCheck( +"readability-return-exp

[clang] [llvm] [SPARC] Support reserving arbitrary general purpose registers (PR #74927)

2023-12-22 Thread via cfe-commits
@@ -1125,6 +1130,10 @@ Register SparcTargetLowering::getRegisterByName(const char* RegName, LLT VT, .Case("g4", SP::G4).Case("g5", SP::G5).Case("g6", SP::G6).Case("g7", SP::G7) .Default(0); + const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo(); + if (!TRI->

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/76256 This patch adds support for `__builtin_riscv_cpop_32/64`, which are used by `riscv_bitmanip.h`. See also https://github.com/llvm/llvm-project/blob/04c473bea3e0f135432698fcaafab52e1fe1b5ec/clang/lib/Headers/riscv

[clang-tools-extra] [llvm] [clang] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
Radu2k wrote: This is needed because depending on the target, if the frame pointer is not specified, then the best option will be automatically added, therefore a ``` 'func.func' Pipeline FunctionAttr ``` will appear or not, depending of the target, at the

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Yingwei Zheng (dtcxzyw) Changes This patch adds support for `__builtin_riscv_cpop_32/64`, which are used by `riscv_bitmanip.h`. See also https://github.com/llvm/llvm-project/blob/04c473bea3e0f135432698fcaafab52e1fe1b5ec/clang/lib

[flang] [clang] [lldb] [clang-tools-extra] [compiler-rt] [libcxx] [llvm] [libc] [RegAllocFast] Refactor dominates algorithm for large basic block (PR #72250)

2023-12-22 Thread Nikita Popov via cfe-commits
@@ -62,6 +62,107 @@ static RegisterRegAlloc fastRegAlloc("fast", "fast register allocator", namespace { +/// Assign ascending index for instructions in machine basic block. The index +/// can be used to determine dominance between instructions in same MBB. +class InstrPosInd

[llvm] [clang-tools-extra] [flang] [clang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
@@ -1,9 +1,12 @@ ! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend -! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s -! CHECK: "-mframe-pointer=all" +! RUN: %flang --target

[llvm] [clang-tools-extra] [flang] [clang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [flang] [clang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -245,6 +245,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, opts.AliasAnalysis = opts.OptimizationLevel > 0; + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) { +llvm::StringRef s

[llvm] [clang-tools-extra] [flang] [clang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
@@ -51,9 +51,9 @@ ! Content to check from the MLIR outputs !-- ! MLIR-FIR-NOT: llvm.func -! MLIR-FIR: func.func @{{.*}}main() { +! MLIR-FIR: func.func @{{.*}}main(){{.*}}{ Radu2k wrote: Since this is target dependent, frame pointer will

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/76249 ___ cfe-commit

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL commented: Last nits. https://github.com/llvm/llvm-project/pull/76249 _

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -0,0 +1,30 @@ +.. title:: clang-tidy - readability-avoid-return-with-void-value + +readability-avoid-return-with-void-valu

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: @@ -0,0 +1,31 @@ +//===--- AvoidReturnWithVoidValueCheck.cpp - clang-tidy -===// ---

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -218,6 +218,13 @@ New checks Detects C++ code where a reference variable is used to extend the lifetime of a tempora

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: @@ -0,0 +1,30 @@ +.. title:: clang-tidy - readability-avoid-return-with-void-value + +readability-av

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -0,0 +1,33 @@ +//===--- AvoidReturnWithVoidValueCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM

[clang-tools-extra] [clang-tidy] Add check readability-return-expression-in-void-function (PR #76249)

2023-12-22 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -0,0 +1,31 @@ +//===--- AvoidReturnWithVoidValueCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
@@ -1,9 +1,12 @@ ! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend -! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s -! CHECK: "-mframe-pointer=all" +! RUN: %flang --target

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Thanks for the explanation! > Therefore it is mandatory to add omitting frame pointer No. You can also update the expected output. So there are 2 options. And what would be preferred - this test is checking pass pipelines and including `-

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread Michael Klemm via cfe-commits
@@ -163,6 +163,40 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver mjklemm wrote:

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread Michael Klemm via cfe-commits
@@ -163,6 +163,40 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
Radu2k wrote: That looks good to me, thought it needs to check line by line(flang/test/Driver/mlir-debug-pass-pipeline.f90 - lines 35-38) but will update, replacing ALL-NEXT to ALL at line 85. https://github.com/llvm/llvm-project/pull/74598 __

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

2023-12-22 Thread Radu Salavat via cfe-commits
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-12-22 Thread Bushev Dmitry via cfe-commits
@@ -184,13 +199,24 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { return getChar(); // Handle pointers and references. - // TODO: Implement C++'s type "similarity" and consider dis-"similar" - // pointers distinct. - if (Ty->isPointerType() || Ty->

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

2023-12-22 Thread Bushev Dmitry via cfe-commits
@@ -216,6 +216,9 @@ ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Defa CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions. CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled. CODEGENOPT(S

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

2023-12-22 Thread Bushev Dmitry via cfe-commits
dybv-sc wrote: @rjmccall , I updated part of commit that handles pointers. Added comment with C/C++ standard references to explain my decisions. Could you please review it again? https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing

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

2023-12-22 Thread Bushev Dmitry via cfe-commits
@@ -105,13 +105,28 @@ static bool isValidBaseType(QualType QTy) { if (RD->hasFlexibleArrayMember()) return false; // RD can be struct, union, class, interface or enum. -// For now, we only handle struct and class. -if (RD->isStruct() || RD->isClass()) +

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

2023-12-22 Thread Nikita Popov via cfe-commits
nikic wrote: (As usual, please make any LLVM changes separately from Clang changes, especially if they affect IR design.) https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[flang] [clang] [flang][Driver] Support `-pthread` to the frontend. (PR #75739)

2023-12-22 Thread Kareem Ergawy via cfe-commits
https://github.com/ergawy closed https://github.com/llvm/llvm-project/pull/75739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Support `-pthread` to the frontend. (PR #75739)

2023-12-22 Thread Kareem Ergawy via cfe-commits
ergawy wrote: Abandoning this PR since for the GNU toolchain there is no need to explicitly link with pthread to use the API. https://github.com/llvm/llvm-project/pull/75739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Breaks multiple bots https://lab.llvm.org/buildbot/#/builders/168/builds/17604 https://lab.llvm.org/buildbot/#/builders/74/builds/24426 https://lab.llvm.org/buildbot/#/builders/239/builds/4971 and some others https://github.com/llvm/llvm-project/pull/76232 _

[llvm] [clang] [SPARC] Support reserving arbitrary general purpose registers (PR #74927)

2023-12-22 Thread Sergei Barannikov via cfe-commits
@@ -1125,6 +1130,10 @@ Register SparcTargetLowering::getRegisterByName(const char* RegName, LLT VT, .Case("g4", SP::G4).Case("g5", SP::G5).Case("g6", SP::G6).Case("g7", SP::G7) .Default(0); + const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo(); + if (!TRI->

[clang] [clang-format] Add an fnmatch-like function for .clang-format-ignore (PR #76021)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -0,0 +1,169 @@ +//===- unittest/Format/MatchFilePathTest.cpp --===// +// +// 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][NFC] Adjust TBAA Base Info API (PR #73263)

2023-12-22 Thread Nathan Sidwell via cfe-commits
urnathan wrote: ping? https://github.com/llvm/llvm-project/pull/73263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Better bitfield access units (PR #65742)

2023-12-22 Thread Nathan Sidwell via cfe-commits
urnathan wrote: ping? https://github.com/llvm/llvm-project/pull/65742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread via cfe-commits
@@ -163,6 +163,62 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread via cfe-commits
@@ -163,6 +163,62 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-22 Thread via cfe-commits
@@ -163,6 +163,62 @@ forward compiler options to the frontend driver, `flang-new -fc1`. You can read more on the design of `clangDriver` in Clang's [Driver Design & Internals](https://clang.llvm.org/docs/DriverInternals.html). +## Linker Driver +When used as a linker, Flang's

[clang] [clang-format] Fix a bug in annotating function declaration names (PR #76206)

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

[clang] [clang-format] Fix a bug in annotating function declaration names (PR #76206)

2023-12-22 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > Thanks for doing this. Does it mean we would have to add every type we use to > our config? It would be much more convenient if clang-format treated the > argument list the same way that it treats in definitions. For example > > ```shell > printf "int\niso_time(time

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Vladimir Vereschaka via cfe-commits
vvereschaka wrote: these changes break the libc++ tests - `llvm-libc++-static.cfg.in::transform_error.mandates.verify.cpp` ``` # .---command stderr # | error: 'expected-error' diagnostics expected but not seen: # | File * Line * (directive at C:\buildbot\as-builder-2\x-aarch64\l

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/76059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -4656,6 +4687,15 @@ struct FormatStyle { /// \version 8 std::vector StatementMacros; + /// Tablegen HazardyKnusperkeks wrote: We need a bit more documentation here. https://github.com/llvm/llvm-project/pull/76059 _

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. I think we all would gain a lot, if you could split this into multiple pull requests. The discussion can be more focused and you have a greater chance to get something merged. Similar to the Verilog changes. https://

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Björn Schäpers via cfe-commits
@@ -4656,6 +4687,15 @@ struct FormatStyle { /// \version 8 std::vector StatementMacros; + /// Tablegen + bool TableGenAllowBreakBeforeInheritColon; + bool TableGenAllowBreakAfterInheritColon; HazardyKnusperkeks wrote: Do you need both options to be ena

<    1   2   3   >