[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-05 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. I'm with @HazardyKnusperkeks you are changing too much in one go, get this established in clang-format first and then look to rolling out to other tools that use lib/format YAML changes should be separate and agreed wit

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

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

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-05 Thread via cfe-commits
@@ -39,6 +39,10 @@ IO::IO(void *Context) : Ctxt(Context) {} IO::~IO() = default; +SourceMgr& IO::getSourceMgr() { mydeveloperday wrote: This feels like an unrelated changes or change that could be done in isolation first https://github.com/llvm/llvm-projec

[clang] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) (PR #107358)

2024-09-05 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/107358 None >From 7d9d7495ab3ea573e8c0a6c087296b6c43c95a65 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 4 Sep 2024 23:52:55 -0700 Subject: [PATCH] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) -

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-05 Thread via cfe-commits
@@ -5274,9 +5274,17 @@ struct FormatStyle { friend std::error_code parseConfiguration(llvm::MemoryBufferRef Config, FormatStyle *Style, + const std::vector &StyleSearchPaths, mydeveloperday wrote: by putting your argument 3rd you made

[clang] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) (PR #107358)

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/107358.diff 1 Files Affected: - (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (+1-3) ``diff

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-05 Thread via cfe-commits
mydeveloperday wrote: > You are touching a lot of projects. I don't know how others feel about that, > but my preference would be to tackle one project per PR. +1 https://github.com/llvm/llvm-project/pull/107312 ___ cfe-commits mailing list cfe-commi

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-05 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-05 Thread via cfe-commits
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) { TT_StructLBrace, TT_UnionLBrace); } +bool LineStartsNamespaceScope(const AnnotatedLine *Line, + const AnnotatedLine *PreviousLine, +

[clang] [clang-format] Add options to set number of empty lines after includes (PR #78957)

2024-09-05 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. https://github.com/llvm/llvm-project/pull/78957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add options to set number of empty lines after includes (PR #78957)

2024-09-05 Thread via cfe-commits
@@ -3220,6 +3220,25 @@ the configuration (without a prefix: ``Auto``). +.. _EmptyLinesAfterIncludes: + +**EmptyLinesAfterIncludes** (``Unsigned``) :versionbadge:`clang-format 18` :ref:`¶ ` mydeveloperday wrote: 18 is now wrong it should be 20 https://gith

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-05 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. https://github.com/llvm/llvm-project/pull/105597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-05 Thread via cfe-commits
@@ -972,6 +972,11 @@ struct FormatStyle { /// \version 3.7 bool AllowShortLoopsOnASingleLine; + /// If ``true``, ``namespace a { class b; }`` can be put on a single a single + /// line. + /// \version 19 mydeveloperday wrote: 19 is now wrong it should

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

2024-09-05 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. 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-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-09-05 Thread via cfe-commits
@@ -6036,12 +6036,106 @@ the configuration (without a prefix: ``Auto``). **SpaceInEmptyBlock** (``Boolean``) :versionbadge:`clang-format 10` :ref:`¶ ` If ``true``, spaces will be inserted into ``{}``. + This option is **deprecated**. The previous behavior is preserved by u

[clang] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) (PR #107358)

2024-09-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Analysis] Avoid repeated hash lookups (NFC) (PR #107357)

2024-09-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (PR #102619)

2024-09-05 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/102619 >From fc436186e37ff9852269599c750f8e836aee5e99 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 9 Aug 2024 15:03:38 +0100 Subject: [PATCH] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in d

[clang] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (PR #102619)

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

[clang] f1ac334 - [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (#102619)

2024-09-05 Thread via cfe-commits
Author: Mital Ashok Date: 2024-09-05T09:41:39+02:00 New Revision: f1ac334b13c2ed5c71bad04ed8345b2be135 URL: https://github.com/llvm/llvm-project/commit/f1ac334b13c2ed5c71bad04ed8345b2be135 DIFF: https://github.com/llvm/llvm-project/commit/f1ac334b13c2ed5c71bad04ed8345b2be135.diff L

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-09-05 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/91895 >From f602189e20d15d7805b40f60b9383c83117b7d04 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 20 Aug 2024 13:23:52 +0100 Subject: [PATCH 1/4] [Clang] Add __builtin_is_within_lifetime to implement P2641R4

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/107213 >From 0d9a5971121bf66608625de3514db346876d9091 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 28 Aug 2024 09:59:41 +0200 Subject: [PATCH 1/2] [clang] Diagnose dangling issues for "Container" case. We teac

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); + + // FIXME: Current only support comparison binary operator,

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); + + // FIXME: Current only support comparison binary operator,

[clang] [clang][bytecode] Implement comparsion operators for vector type (PR #107258)

2024-09-05 Thread Timm Baeder via cfe-commits
@@ -1222,6 +1224,117 @@ bool Compiler::VisitComplexBinOp(const BinaryOperator *E) { return true; } +template +bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { + assert(E->getType()->isVectorType()); tbaederr wrote: Add an assertion that both LH

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-05 Thread Kristóf Umann via cfe-commits
Szelethus wrote: > `CustomAnnexKFunctions` exists because the checker has two different internal > matching modes for whether AnnexK is enabled or not. This both depends on > `__STDC_LIB_EXT1__` (defined by system) `__STDC_WANT_LIB_EXT1__` (defined by > the user), so it's reasonable to expect

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread via cfe-commits
cor3ntin wrote: @MitalAshok can you fix the conflicts and ping me so i can merge? https://github.com/llvm/llvm-project/pull/93046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cf1ad28 - [clang][ExtractAPI] Handle AttributedType fragments transparently (#107262)

2024-09-05 Thread via cfe-commits
Author: Daniel Grumberg Date: 2024-09-05T09:15:09+01:00 New Revision: cf1ad28169be5d026ec95f351b56b0c090b3e682 URL: https://github.com/llvm/llvm-project/commit/cf1ad28169be5d026ec95f351b56b0c090b3e682 DIFF: https://github.com/llvm/llvm-project/commit/cf1ad28169be5d026ec95f351b56b0c090b3e682.dif

[clang] [clang][ExtractAPI] Handle AttributedType fragments transparently (PR #107262)

2024-09-05 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg closed https://github.com/llvm/llvm-project/pull/107262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4137309 - [Clang] Warn with -Wpre-c23-compat instead of -Wpre-c++17-compat for u8 character literals in C23 (#97210)

2024-09-05 Thread via cfe-commits
Author: Mital Ashok Date: 2024-09-05T10:15:54+02:00 New Revision: 41373098421f2aa551a0879537864c87d797a102 URL: https://github.com/llvm/llvm-project/commit/41373098421f2aa551a0879537864c87d797a102 DIFF: https://github.com/llvm/llvm-project/commit/41373098421f2aa551a0879537864c87d797a102.diff L

[clang] [Clang] Warn with -Wpre-c23-compat instead of -Wpre-c++17-compat for u8 character literals in C23 (PR #97210)

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

[clang] 3e47883 - Recover performance loss after PagedVector introduction (#67972)

2024-09-05 Thread via cfe-commits
Author: Giulio Eulisse Date: 2024-09-05T10:16:51+02:00 New Revision: 3e4788377bb29ed389b46521fcba0d06aa985bcf URL: https://github.com/llvm/llvm-project/commit/3e4788377bb29ed389b46521fcba0d06aa985bcf DIFF: https://github.com/llvm/llvm-project/commit/3e4788377bb29ed389b46521fcba0d06aa985bcf.diff

[clang] [llvm] Recover performance loss after PagedVector introduction (PR #67972)

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

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -499,3 +518,28 @@ std::string_view test2(int i, std::optional a) { return std::move(a.value()); } } + +namespace GH100526 { +void test() { + std::vector t1 = {std::string()}; // expected-warning {{object backing the pointer will be destroyed at the end}} ---

[clang] [flang] [flang][driver] Add pre-processing type for Fortran pre-processed files (PR #104664)

2024-09-05 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/104664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Add pre-processing type for Fortran pre-processed files (PR #104664)

2024-09-05 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/104664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Add pre-processing type for Fortran pre-processed files (PR #104664)

2024-09-05 Thread Andrzej Warzyński via cfe-commits
@@ -79,7 +79,17 @@ TYPE("c++-module-cpp-output",PP_CXXModule, INVALID, "iim",phases TYPE("ada", Ada, INVALID, nullptr, phases::Compile, phases::Backend, phases::Assemble, phases::Link) TYPE("assembler",PP_A

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

2024-09-05 Thread via cfe-commits
@@ -222,17 +222,17 @@ static bool DiagnoseNoDiscard(Sema &S, const WarnUnusedResultAttr *A, return S.Diag(Loc, diag::warn_unused_result_msg) << A << Msg << R1 << R2; } -void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { - if (const LabelStmt *Label = dyn

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/93046 >From e1172958f43af7490b5b6e3752a9070265ad17ca Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 22 May 2024 16:01:13 +0100 Subject: [PATCH 1/4] [Clang] CWG2749: relational operators involving pointers to

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Done! https://github.com/llvm/llvm-project/pull/93046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][transformer] Add `join` stencil. (PR #107366)

2024-09-05 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/107366 `join(",", a, b, c)` is the same as `cat(a, ",", b, ",", c)`. >From 0c9d87c0e25e598f40ecf3f4977cd5ed2e205636 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 5 Sep 2024 06:53:07 + Subject: [PA

[clang] [clang][transformer] Add `join` stencil. (PR #107366)

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Clement Courbet (legrosbuffle) Changes `join(",", a, b, c)` is the same as `cat(a, ",", b, ",", c)`. --- Full diff: https://github.com/llvm/llvm-project/pull/107366.diff 3 Files Affected: - (modified) clang/include/clang/Tooling/Transfo

[clang] [clang][Driver] Add a custom error option in multilib.yaml. (PR #105684)

2024-09-05 Thread Simon Tatham via cfe-commits
statham-arm wrote: To be clear, are you asking _me_ to make a followup PR to change that identifier in this already-landed patch, or are you going to do it? (Just to avoid the situation where both of us do it, or both of us think the other is going to) https://github.com/llvm/llvm-project/pul

[clang] b206bf0 - Fix CLANG_BOOTSTRAP_TARGETS in Release.cmake (#106407)

2024-09-05 Thread via cfe-commits
Author: Konrad Kleine Date: 2024-09-05T10:41:18+02:00 New Revision: b206bf0952796cb93f1aca9e47d5764e474e1998 URL: https://github.com/llvm/llvm-project/commit/b206bf0952796cb93f1aca9e47d5764e474e1998 DIFF: https://github.com/llvm/llvm-project/commit/b206bf0952796cb93f1aca9e47d5764e474e1998.diff

[clang] Fix CLANG_BOOTSTRAP_TARGETS in Release.cmake (PR #106407)

2024-09-05 Thread Konrad Kleine via cfe-commits
https://github.com/kwk closed https://github.com/llvm/llvm-project/pull/106407 ___ 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 user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-05 Thread via cfe-commits
@@ -19,6 +19,9 @@ The check implements the following rules from the CERT C Coding Standard: Unsafe functions +The following functions are reported if `ReportDefaultFunctions +`_ is enabled. + whisperity wrote: Referring to the `.html` direct

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Haojian Wu via cfe-commits
hokein wrote: After further testing, this change introduces a new false positive -- we emit a return-stack-address warning for the following case, this is not correct. ``` std::vector kk() { std::vector s; return s; } ``` Looking now. https://github.com/llvm/llvm-project/pull/107213 _

[clang] [llvm] [AArch64] Implement NEON vamin/vamax intrinsics (PR #99041)

2024-09-05 Thread via cfe-commits
@@ -2115,3 +2115,8 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in { def VLUTI4_BF_X2_Q : SInst<"vluti4_laneq_x2", ".2(; } } + +let ArchGuard = "defined(__aarch64__)", TargetGuard = "faminmax" in { SpencerAbson wrote: Should this tar

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-05 Thread Matthias Springer via cfe-commits
https://github.com/matthias-springer approved this pull request. https://github.com/llvm/llvm-project/pull/106658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add options to set number of empty lines after includes (PR #78957)

2024-09-05 Thread Jonas Gollenz via cfe-commits
jgollenz wrote: @seranu if I have a look at this issue may I continue working from your commit or do you want me to start from scratch? https://github.com/llvm/llvm-project/pull/78957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/107369 This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking feature, which collects a stack trace at the point

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-platform-windows Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking featu

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking feature, which collects a stack trace at the po

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-05 Thread kadir çetinkaya via cfe-commits
kadircet wrote: I am not sure if it's best to push a new command line flag to all other tools that use clang-format as a library. Have you considered any other alternatives that can self-contain this in clang-format? e.g can we just treat paths as relative to current `.clang-format` file ? h

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

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

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 commented: Thanks. LG. Some comments on adding more tests. https://github.com/llvm/llvm-project/pull/107213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -525,3 +544,31 @@ void test() { std::string_view svjkk1 = ReturnStringView(StrCat("bar", "x")); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}} } } // namespace GH100549 + +namespace GH100526 { +void test() { + std:

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -6690,6 +6690,20 @@ When the Owner's lifetime ends, it will consider the Pointer to be dangling. P.getInt(); // P is dangling } +If a template class is annotated with [[gsl::Owner]], and the first instantiated +template argument is a [[gsl::Pointer]] type, the analy

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -278,6 +278,8 @@ Improvements to Clang's diagnostics - The lifetimebound and GSL analysis in clang are coherent, allowing clang to detect more use-after-free bugs. (#GH100549). +- Clang now diagnoses cases where a dangling `GSLOwner`` object is constructed, e.g. `std::ve

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -525,3 +544,31 @@ void test() { std::string_view svjkk1 = ReturnStringView(StrCat("bar", "x")); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}} } } // namespace GH100549 + +namespace GH100526 { +void test() { + std:

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -6690,6 +6690,20 @@ When the Owner's lifetime ends, it will consider the Pointer to be dangling. P.getInt(); // P is dangling } +If a template class is annotated with [[gsl::Owner]], and the first instantiated +template argument is a [[gsl::Pointer]] type, the analy

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -525,3 +544,31 @@ void test() { std::string_view svjkk1 = ReturnStringView(StrCat("bar", "x")); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}} } } // namespace GH100549 + +namespace GH100526 { +void test() { + std:

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -525,3 +544,31 @@ void test() { std::string_view svjkk1 = ReturnStringView(StrCat("bar", "x")); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}} } } // namespace GH100549 + +namespace GH100526 { usx95

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-05 Thread Utkarsh Saxena via cfe-commits
@@ -470,10 +474,24 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, VisitGSLPointerArg(Callee, Args[0], !Callee->getReturnType()->isReferenceType()); } else { -if (auto *CCE = dyn_cast(Call); -

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-09-05 Thread Hari Limaye via cfe-commits
hazzlim wrote: Nice - CI seems happy, so I plan to land this later today if no objections. https://github.com/llvm/llvm-project/pull/107257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 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 5f05d5ec8f9bb15c0ac29fce843a2c73165ac414 194069a26418fc4dbb27cee13d5b4263588320b7 --e

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 5f05d5ec8f9bb15c0ac29fce843a2c73165ac414...194069a26418fc4dbb27cee13d5b4263588320b7 llvm/

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

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

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

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

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

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

[clang] [clang-format] Add options to set number of empty lines after includes (PR #78957)

2024-09-05 Thread via cfe-commits
seranu wrote: @jgollenz feel free use those commits https://github.com/llvm/llvm-project/pull/78957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-09-05 Thread Luke Lau via cfe-commits
lukel97 wrote: Here's the version without the rename pass ```c++ template class DoFHandler; template class FiniteElement; class FETools { template void back_interpolate(const DoFHandler &, const InVector &, const FiniteElement &, OutVector &); template class DH,

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107369 >From e45d7e68a371a09ea766c4accf8edc6c030fd7fd Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:09:50 +0100 Subject: [PATCH 1/3] Add CMake option to enable expensive line number origin trac

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread via cfe-commits
cor3ntin wrote: @MitalAshok there is a test failure! https://github.com/llvm/llvm-project/pull/93046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-05 Thread Kito Cheng via cfe-commits
@@ -44,7 +44,7 @@ ArrayRef RISCVTargetInfo::getGCCRegNames() const { "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", // CSRs - "fflags", "frm", "vtype", "vl", "vxsat", "vxrm" + "fflags", "frm", "vtype", "vl", "vxsat", "vxrm", "sf_vcix_state"

[clang] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) (PR #107358)

2024-09-05 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/107358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-05 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

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

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
@@ -254,6 +276,43 @@ class CompilerInstance { /// Produces the string which represents target feature std::string getTargetFeatures(); + /// { + /// @name Timing + /// @{ + bool isTimingEnabled() { return timingMgr.isEnabled(); } tblah wrote: nit: Do

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/107270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for working on this https://github.com/llvm/llvm-project/pull/107270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
@@ -0,0 +1,18 @@ +! Check that -ftime-report flag is passed as-is to fc1. The value of the flag +! is only checked there. This behavior intentionally mirrors that of clang. +! +! -ftime-report= is currently not supported because we do not support detailed +! timing information on

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
@@ -143,6 +144,14 @@ class CompilerInvocation : public CompilerInvocationBase { }, }; + /// Whether to time the invocation. Set when -ftime-report or -ftime-report= + /// is enabled. + bool enableTimers; + + /// Whether to report the timing of each run of an LLVM p

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
@@ -4,6 +4,7 @@ add_subdirectory(Decimal) add_subdirectory(Lower) add_subdirectory(Parser) add_subdirectory(Semantics) +add_subdirectory(Support) tblah wrote: Why did you decide to put this in a new subdirectory and not just part of Frontend? Is there a plan

[clang] [flang] [flang][Driver] Preliminary support for -ftime-report (PR #107270)

2024-09-05 Thread Tom Eccles via cfe-commits
@@ -176,6 +205,26 @@ bool CompilerInstance::executeAction(FrontendAction &act) { act.endSourceFile(); } } + + if (timingMgr.isEnabled()) { +timingScopeRoot.stop(); + +// Write the timings to the associated output stream and clear all timers. +// We need

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/93046 >From e1172958f43af7490b5b6e3752a9070265ad17ca Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 22 May 2024 16:01:13 +0100 Subject: [PATCH 1/5] [Clang] CWG2749: relational operators involving pointers to

[clang] [llvm] [AArch64] Implement NEON vamin/vamax intrinsics (PR #99041)

2024-09-05 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/99041 >From 886c48dd7efa227f8605bfafef4204cefbb75d6e Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Mon, 15 Jul 2024 17:50:43 +0100 Subject: [PATCH 1/4] [AArch64] Implement NEON vamin/vamax intrinsics Th

[clang] [llvm] [AArch64] Implement NEON vamin/vamax intrinsics (PR #99041)

2024-09-05 Thread Momchil Velikov via cfe-commits
@@ -2115,3 +2115,8 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in { def VLUTI4_BF_X2_Q : SInst<"vluti4_laneq_x2", ".2(; } } + +let ArchGuard = "defined(__aarch64__)", TargetGuard = "faminmax" in { momchil-velikov wrote: Done https:

[clang] 87b4b64 - Fix a typo in CheckExprLifetime.cpp, NFC

2024-09-05 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-09-05T13:18:39+02:00 New Revision: 87b4b648585f69a2ea148e86543aa31474e59acd URL: https://github.com/llvm/llvm-project/commit/87b4b648585f69a2ea148e86543aa31474e59acd DIFF: https://github.com/llvm/llvm-project/commit/87b4b648585f69a2ea148e86543aa31474e59acd.diff LO

[clang] 3e07090 - Fix llvm-else-after-return clang-tidy warning in CheckExprLifetime.cpp, NFC

2024-09-05 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-09-05T13:24:38+02:00 New Revision: 3e070906eff720dc44aee86e533e12aafc8bb14b URL: https://github.com/llvm/llvm-project/commit/3e070906eff720dc44aee86e533e12aafc8bb14b DIFF: https://github.com/llvm/llvm-project/commit/3e070906eff720dc44aee86e533e12aafc8bb14b.diff LO

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I investigated this situation and I found that this crash is not limited to empty source files -- I'd guess that the analyzer would crash on any input if it's executed as ``` // RUN: %clang_analyze_cc1 -w -analyzer-checker=nullability \ // RUN:

[clang] [compiler-rt] [libcxx] [lldb] [llvm] Rename Sanitizer Coverage => Coverage Sanitizer (PR #106505)

2024-09-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Precommit CI test failures look related: ``` _bk;t=1725284334938 TEST 'LLVM :: tools/sancov/symbolize.test' FAILED _bk;t=1725284334938Exit Code: 1 _bk;t=1725284334938 _bk;t=1725284334938Command Output (stderr): _bk;t=17252

[clang] [libc] [libc][c11] implement ctime (PR #107285)

2024-09-05 Thread Зишан Мирза via cfe-commits
https://github.com/zimirza updated https://github.com/llvm/llvm-project/pull/107285 From b982621407a1ab1746a023809aae5c6a2b983679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B8=D1=88=D0=B0=D0=BD=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0?= <149377404+zimi...@users.noreply.github.com>

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -169,13 +169,19 @@ enum class GH42372_2 { One }; +enum IncOverflow { + V2 = __INT_MAX__, + V3 // c99-warning {{incremented enumerator value that is exceeding range of 'int' is a C23 extension}} +#if __STDC_VERSION__ >= 202311L AaronBallman wrote: You

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only --embed-dir=%S/Inputs -std=c23 %s -pedantic -Wpre-c23-compat AaronBallman wrote: ```suggestion // RUN: %clang_cc1 -verify -triple x86_64-unknown-linux-gnu -fsyntax-only

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
@@ -6194,9 +6195,12 @@ def err_misplaced_ivar : Error< def warn_ivars_in_interface : Warning< "declaration of instance variables in the interface is deprecated">, InGroup>, DefaultIgnore; -def ext_enum_value_not_int : Extension< - "ISO C restricts enumerator values to rang

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >