[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - auto applyChildFormatTexts = [&](FormatStyl

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - owenca wrote: Sorry! We do n

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-14 Thread Kohei Asano via cfe-commits
https://github.com/khei4 edited https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][HIP] Suppress availability diagnostics for mismatched host/device overloads (PR #93546)

2024-06-14 Thread Fabian Ritter via cfe-commits
ritter-x2a wrote: Ping @zygoloid, your input would be highly appreciated. Thanks! https://github.com/llvm/llvm-project/pull/93546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-14 Thread Kohei Asano via cfe-commits
https://github.com/khei4 updated https://github.com/llvm/llvm-project/pull/93634 >From 02b4de5799efe104f352d3f586e8779c5cd4 Mon Sep 17 00:00:00 2001 From: Kohei Asano Date: Mon, 3 Jun 2024 09:15:44 +0900 Subject: [PATCH] [clang-format] add an option to insert a space only for empty braces

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-14 Thread Kohei Asano via cfe-commits
khei4 wrote: @owenca Thank you for the review! > @khei4 maybe an enum for SpaceInEmptyBraces with Always, Never, and Custom. > (IMO Leave doesn't make sense.) I make those variants. How do you think the behavior of config, which has only ` SpaceInEmptyBraces.SpacesInParensOptions.InEmptyPar

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-14 Thread Kohei Asano via cfe-commits
https://github.com/khei4 ready_for_review https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add scheduling model for Syntacore SCR3 (PR #95427)

2024-06-14 Thread Elena Lepilkina via cfe-commits
https://github.com/el-sc approved this pull request. https://github.com/llvm/llvm-project/pull/95427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c947709 - [Driver] Support -Wa, --defsym similar to -Wa, -defsym

2024-06-14 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-06-14T00:30:03-07:00 New Revision: c947709df7859bb7285873593adab70349a5ab3e URL: https://github.com/llvm/llvm-project/commit/c947709df7859bb7285873593adab70349a5ab3e DIFF: https://github.com/llvm/llvm-project/commit/c947709df7859bb7285873593adab70349a5ab3e.diff

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

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

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

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

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
@@ -18,20 +17,87 @@ namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( returnStmt( - hasReturnValue(declRefExpr(to(parmVarDecl(hasType(hasCanonicalType( - qualType(ma

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
@@ -18,20 +17,87 @@ namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( returnStmt( - hasReturnValue(declRefExpr(to(parmVarDecl(hasType(hasCanonicalType( - qualType(ma

[clang] d712ae4 - [Driver] Support -Wa, --defsym similar to -Wa, -defsym

2024-06-14 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-06-14T00:40:33-07:00 New Revision: d712ae4a21822a51817941e7007e0dd41343cde3 URL: https://github.com/llvm/llvm-project/commit/d712ae4a21822a51817941e7007e0dd41343cde3 DIFF: https://github.com/llvm/llvm-project/commit/d712ae4a21822a51817941e7007e0dd41343cde3.diff

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Martin Storsjö via cfe-commits
@@ -1010,6 +1034,9 @@ def : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16, [TuneAppleA16]>; def : ProcessorModel<"apple-a17", CycloneModel, ProcessorFeatures.AppleA17, [TuneAppleA17]>; +def : ProcessorModel<"appl

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread Mital Ashok via cfe-commits
@@ -1140,26 +1131,68 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, BaseExpr = BuildCXXThisExpr(Loc, BaseExprType, /*IsImplicit=*/true); } + // C++17 [expr.ref]p2, per CWG2813: + // For the first option (dot), if the id-expression names a s

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread Mital Ashok via cfe-commits
@@ -1174,6 +1207,9 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, valueKind = VK_PRValue; type = Context.BoundMemberTy; MitalAshok wrote: For non-static member function, we don't require a glvalue anymore (to allow by-val

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread Mital Ashok via cfe-commits
@@ -387,9 +388,16 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { // Do not diagnose use of a comma operator in a SFINAE context because the // type of the left operand could be used for SFINAE, so technically it is // *used*. - if (DiagID != di

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Thorsten Schütt via cfe-commits
tschuett wrote: It is a problem that is worth fixing long term. How to correctly model release versions and their optional dependencies. Furthermore, for the BTI example how remove features. https://github.com/llvm/llvm-project/pull/95478 ___ cfe-com

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread via cfe-commits
@@ -1174,6 +1207,9 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, valueKind = VK_PRValue; type = Context.BoundMemberTy; Sirraide wrote: Oh yeah, duh, makes sense. https://github.com/llvm/llvm-project/pull/95112 __

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread via cfe-commits
@@ -387,9 +388,16 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { // Do not diagnose use of a comma operator in a SFINAE context because the // type of the left operand could be used for SFINAE, so technically it is // *used*. - if (DiagID != di

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread via cfe-commits
@@ -1140,26 +1131,68 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, BaseExpr = BuildCXXThisExpr(Loc, BaseExprType, /*IsImplicit=*/true); } + // C++17 [expr.ref]p2, per CWG2813: + // For the first option (dot), if the id-expression names a s

[clang] da249ca - [clang-cl] Map /Ot to -O3 instead of -O2 (#95406)

2024-06-14 Thread via cfe-commits
Author: Hans Date: 2024-06-14T10:23:33+02:00 New Revision: da249cad8d398939e0c608d38d0c038954941316 URL: https://github.com/llvm/llvm-project/commit/da249cad8d398939e0c608d38d0c038954941316 DIFF: https://github.com/llvm/llvm-project/commit/da249cad8d398939e0c608d38d0c038954941316.diff LOG: [cl

[clang] [clang-cl] Map /Ot to -O3 instead of -O2 (PR #95406)

2024-06-14 Thread via cfe-commits
https://github.com/zmodem closed https://github.com/llvm/llvm-project/pull/95406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 880d370 - [APFloat] Add APFloat support for FP4 data type (#95392)

2024-06-14 Thread via cfe-commits
Author: Durgadoss R Date: 2024-06-14T14:17:37+05:30 New Revision: 880d37038c7bbff53ef02c9d6b01cbbc87875243 URL: https://github.com/llvm/llvm-project/commit/880d37038c7bbff53ef02c9d6b01cbbc87875243 DIFF: https://github.com/llvm/llvm-project/commit/880d37038c7bbff53ef02c9d6b01cbbc87875243.diff L

[clang] [llvm] [APFloat] Add APFloat support for FP4 data type (PR #95392)

2024-06-14 Thread Durgadoss R via cfe-commits
https://github.com/durga4github closed https://github.com/llvm/llvm-project/pull/95392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-14 Thread via cfe-commits
zmodem wrote: This broke the lit tests on mac: https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/1096/ I'll revert to green for now. https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -112,6 +114,9 @@ class ClangdServer { /// This throttler controls which preambles may be built at a given time. clangd::PreambleThrottler *PreambleThrottler = nullptr; +/// Enable experimental support for modules. ChuanqiXu9 wrote: I add Module

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, maybe I was misreading. It looks doable if we only want to avoid DirectoryBasedGlobalCompilationDatabase. Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -27,6 +27,9 @@ #include "Diagnostics.h" #include "FS.h" #include "Headers.h" + ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,81 @@ +//=== ModuleDependencyScanner.cpp *- 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] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,26 @@ +//=== ScanningProjectModules.h ---*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -710,6 +710,7 @@ class ASTWorker { TUScheduler::ASTCache &IdleASTs; TUScheduler::HeaderIncluderCache &HeaderIncluders; const bool RunSync; + ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 __

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -213,10 +213,10 @@ ClangdServer::Options::operator TUScheduler::Options() const { ClangdServer::ClangdServer(const GlobalCompilationDatabase &CDB, const ThreadsafeFS &TFS, const Options &Opts, - Callbacks *Callbacks) +

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,364 @@ +//===--- PrerequisiteModulesTests.cpp ---*- 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-Identifi

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,364 @@ +//===--- PrerequisiteModulesTests.cpp ---*- 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-Identifi

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- 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: Ap

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,199 @@ +//===-- ProjectModules.h -*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][ARM] Fix warning for VFP function calls from interrupts. (PR #91870)

2024-06-14 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc updated https://github.com/llvm/llvm-project/pull/91870 >From b892c59a27089b4753b7677a1ada1ee8da59301b Mon Sep 17 00:00:00 2001 From: Chris Copeland Date: Sat, 11 May 2024 00:15:50 -0700 Subject: [PATCH 1/2] [clang][ARM] Fix warning for using VFP from interrupts. Thi

[clang] [clang][ARM] Fix warning for VFP function calls from interrupts. (PR #91870)

2024-06-14 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc edited https://github.com/llvm/llvm-project/pull/91870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] dc726c3 - Reapply#4 "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)"

2024-06-14 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2024-06-14T09:54:56+01:00 New Revision: dc726c340392d4a0f3af9dde5f34c58d98198667 URL: https://github.com/llvm/llvm-project/commit/dc726c340392d4a0f3af9dde5f34c58d98198667 DIFF: https://github.com/llvm/llvm-project/commit/dc726c340392d4a0f3af9dde5f34c58d98198667.diff

[clang] [clang][ARM] Fix warning for using VFP from interrupts. (PR #91870)

2024-06-14 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc edited https://github.com/llvm/llvm-project/pull/91870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ARM] Fix warning for using VFP from interrupts. (PR #91870)

2024-06-14 Thread Chris Copeland via cfe-commits
chrisnc wrote: Updated to just warn if the attribute is used while vfp is enabled, and added an error for calling an interrupt handler, similar to x86. https://github.com/llvm/llvm-project/pull/91870 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Tomas Matheson via cfe-commits
@@ -521,7 +521,14 @@ inline constexpr CpuInfo CpuInfos[] = { AArch64::ExtensionBitset({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3, AArch64::AEK_FP16, AArch64::AEK_FP16FML})}, - +// Technically ap

[clang] 32cd703 - [clang-cl] Support the /Ob3 flag

2024-06-14 Thread Hans Wennborg via cfe-commits
Author: Hans Wennborg Date: 2024-06-14T11:11:30+02:00 New Revision: 32cd703da578e769787a921d76b768164a4256b6 URL: https://github.com/llvm/llvm-project/commit/32cd703da578e769787a921d76b768164a4256b6 DIFF: https://github.com/llvm/llvm-project/commit/32cd703da578e769787a921d76b768164a4256b6.diff

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread via cfe-commits
https://github.com/pointhex updated https://github.com/llvm/llvm-project/pull/91317 >From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 7 May 2024 12:27:29 +0200 Subject: [PATCH] [clang-format] Add DiagHandler for getStyle function It allo

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -3334,7 +3347,9 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, return true; } - if (isa(VD)) { + // P2280R4 struck the restriction that variable of referene type lifetime Fznamznon wrote: ```suggestion // P2280R4 struck the re

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -3700,6 +3730,11 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const FieldDecl *LastField = nullptr; const FieldDecl *VolatileField = nullptr; + // P2280R4 If we have an unknown referene or pointer and we don't have a Fzna

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -3420,6 +3441,15 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, } Result = VD->getEvaluatedValue(); + + // P2280R4 If we don't have a value because this is a reference that was not + // initialized or whose lifetime began within E then create a val

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -3358,7 +3373,9 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, // FIXME: We should eventually check whether the variable has a reachable // initializing declaration. const Expr *Init = VD->getAnyInitializer(VD); - if (!Init) { + // P2280R4 struck

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -3420,6 +3441,15 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, } Result = VD->getEvaluatedValue(); + + // P2280R4 If we don't have a value because this is a reference that was not + // initialized or whose lifetime began within E then create a val

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - pointhex wrote: No problem.

[clang] 88e42c6 - [libclang/python] Fix bugs in custom enum implementation and add tests (#95381)

2024-06-14 Thread via cfe-commits
Author: Jannick Kremer Date: 2024-06-14T13:19:28+04:00 New Revision: 88e42c6779067c4b65624939be74db2d56ee017b URL: https://github.com/llvm/llvm-project/commit/88e42c6779067c4b65624939be74db2d56ee017b DIFF: https://github.com/llvm/llvm-project/commit/88e42c6779067c4b65624939be74db2d56ee017b.diff

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - auto applyChildFormatTexts = [&](FormatStyl

[clang] [libclang/python] Fix bugs in custom enum implementation and add tests (PR #95381)

2024-06-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/95381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix bugs in custom enum implementation and add tests (PR #95381)

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

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread via cfe-commits
cor3ntin wrote: Can you make sure the PR/commit have titles and messages that follow our guidelines? Thanks! https://github.com/llvm/llvm-project/pull/95479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/95519 This is the second attempt. We should be inserting the Driver features in front of the features of a parsed target attribute to avoid errors like the following: ``` % cat neon.c __attribute__((target("arch=armv8

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alexandros Lamprineas (labrinea) Changes This is the second attempt. We should be inserting the Driver features in front of the features of a parsed target attribute to avoid errors like the following: ``` % cat neon.c __attribute__((targe

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Vikram Hegde via cfe-commits
vikramRH wrote: > That's another option. The only real plus to the intermediate is it's > slightly less annoying to write combines for. But there are limited combining > opportunities for these we now legalize to intrinsics directly. The SDAG lowering uses a new helper to unroll vector ca

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 Thread via cfe-commits
Sirraide wrote: I candidly don’t really see the use case for this feature. This seems like it should be done by an LSP rather than by Clang itself—and `clangd` for instance can already do this: when I hover over a variable, it shows me the type of that variable, irrespective of whether it was

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-14 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, thanks for rapidly rewriting this. I think dereferencing the insertion iterator with `&**` will eventually need addressing with the move away from intrinsics and insertion, but that can be a matter for when the DIBuilder APIs get depr

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-06-14 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: Oh, it's apple-specific continuous mode test :( https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 Thread via cfe-commits
Sirraide wrote: > when I hover over a variable, it shows me the type of that variable For example: ![image](https://github.com/llvm/llvm-project/assets/74590115/ab0cf4a7-2967-4278-8109-0a8d8ebbe1bb) https://github.com/llvm/llvm-project/pull/95509 __

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-14 Thread Tom Eccles via cfe-commits
@@ -39,6 +39,7 @@ ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate ENUM_CODEGENOPT(VecLib, llvm::driver::

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-14 Thread Tom Eccles via cfe-commits
@@ -39,6 +39,7 @@ ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate ENUM_CODEGENOPT(VecLib, llvm::driver::

[clang] [clang] SourceLocIdentKind::Function should not be dependent (PR #94942)

2024-06-14 Thread via cfe-commits
cor3ntin wrote: So, looked into this more. You are correct that `Function` needs not be dependent because we only ever show the name of the function unqualified. However, `FunctionSig` does. Here is an example of what we are trying to preserve https://godbolt.org/z/M3eTa8nn5 (the clang 17 behav

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Thank you for working on this, but I'm not sure this is the right direction. The flag you're proposing is going to add unwieldy amount of remarks if used on a typical translation unit as opposed to a small example, because from what I understand, it dumps

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-14 Thread Sander de Smalen via cfe-commits
@@ -559,31 +559,86 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-14 Thread Sander de Smalen via cfe-commits
@@ -622,7 +679,8 @@ bool SemaARM::CheckSMEBuiltinFunctionCall(unsigned BuiltinID, } if (BuiltinType) - checkArmStreamingBuiltin(SemaRef, TheCall, FD, *BuiltinType); + HasError |= checkArmStreamingBuiltin(SemaRef, TheCall, FD, *BuiltinType, s

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-14 Thread Sander de Smalen via cfe-commits
@@ -559,31 +559,86 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-14 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: While this looks like a useful optimization, I am still not sure why 2x more data (is that a correct upper bound?) can lead to a 10x slowdown. I will try to dig further to understand what's going on here. https://github.com/llvm/llvm-project/pull/92083

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-14 Thread Donát Nagy via cfe-commits
@@ -26,16 +50,12 @@ void top(char *dst) { void *mempcpy(void *restrict s1, const void *restrict s2, size_t n); -void mempcpy14() { +void mempcpy13() { NagyDonat wrote: Why are you renaming this to `memcpy13`? I see only two `memcpy` tests after this and the

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/95408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I read the rest of the commit and only found two very minor observations. https://github.com/llvm/llvm-project/pull/95408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-14 Thread Donát Nagy via cfe-commits
@@ -413,38 +588,18 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C, if (!ER) return state; - SValBuilder &svalBuilder = C.getSValBuilder(); - ASTContext &Ctx = svalBuilder.getContext(); - // Get the index of the accessed element. - NonLoc Idx =

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 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 11c08327dab425b67d80e99850e654e4c6c17864 df232a67ac0f5a294e8db4c86e10b6bdf664d673 --

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,65 @@ +; RUN: llc -stop-after=amdgpu-isel -mtriple=amdgcn-- -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=CHECK,ISEL %s + +; CHECK-LABEL: name:basic_readfirstlane_i64 +; CHECK:[[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Matt Arsenault via cfe-commits
@@ -6129,13 +6150,55 @@ static SDValue lowerLaneOp(const SITargetLowering &TLI, SDNode *N, if (ValSize % 32 != 0) return SDValue(); + auto unrollLaneOp = [&DAG, &SL](SDNode *N) -> SDValue { +EVT VT = N->getValueType(0); +unsigned NE = VT.getVectorNumElements();

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/95128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-14 Thread Donát Nagy via cfe-commits
@@ -50,16 +45,17 @@ void Z3ErrorHandler(Z3_context Context, Z3_error_code Error) { /// Wrapper for Z3 context class Z3Context { NagyDonat wrote: Another class that manages a resource in a destructor, but does not handle copy/move assignment/construction. htt

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I tried to review the resource management code thoroughly, but I admit that I'm not skilled in this area -- I'm used to working in modern C++ and Python where these footguns are less relevant. I found two classed that (if I understand correctly) violate

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-14 Thread Donát Nagy via cfe-commits
@@ -26,17 +28,10 @@ namespace { class Z3Config { NagyDonat wrote: If I understand it correctly, rule of three/five dictates that the copy/move assignment/construction of this class needs to be handled (or deleted). https://github.com/llvm/llvm-project/pull/951

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
https://github.com/cor3ntin commented: Thanks a lot Shafik! I like the direction, it looks less complex than i thought it would be I agree with @frederick-vs-ja that some diagnostics seem to have regressed. Maybe a variable should not treated as constexpr-unknown if it's not within its lifetime

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

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

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
@@ -314,53 +316,69 @@ class APValue { DataType Data; public: - APValue() : Kind(None) {} - explicit APValue(APSInt I) : Kind(None) { + bool allowConstexprUnknown() const { return AllowConstexprUnknown; } + + void setConstexprUnknown() { AllowConstexprUnknown = true; } +

  1   2   3   4   >