[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Evaluating the attribute expression can be successful without resulting in a value. Namely, when the expression is of type void. --- Full diff: https://github.com/llvm/llvm-project/pull/105789.diff 2 Fil

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: I guess it might make sense to create the `ConstantExpr` in any case, even for a `None` `APValue`? Dumping the `ConstantExpr` didn't print any `APValue` though, so I was assuming that it ignores `None` anyway. https://github.com/llvm/llvm-project/pull/105789 ___

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-23 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/12] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-23 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

[clang] a69ba0a - [clang][bytecode][NFC] Get rid of const_casts in Move fns (#105698)

2024-08-23 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-23T09:16:22+02:00 New Revision: a69ba0a5f911ebdfd59b399e82ded8143e89e6cd URL: https://github.com/llvm/llvm-project/commit/a69ba0a5f911ebdfd59b399e82ded8143e89e6cd DIFF: https://github.com/llvm/llvm-project/commit/a69ba0a5f911ebdfd59b399e82ded8143e89e6cd.diff L

[clang] [clang][bytecode][NFC] Get rid of const_casts in Move fns (PR #105698)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/105698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e5f196e - [NFCI] [C++20] [Modules] Relax the case for duplicated declaration in multiple module units for explicit specialization

2024-08-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-23T15:35:57+08:00 New Revision: e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a URL: https://github.com/llvm/llvm-project/commit/e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a DIFF: https://github.com/llvm/llvm-project/commit/e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a.diff LO

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-23 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

[clang] 39986f0 - [NFCI] [Serialization] Use demoteThisDefinitionToDeclaration instead of setCompleteDefinition(false) for CXXRecordDecl

2024-08-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-23T15:43:43+08:00 New Revision: 39986f0b4d797e4ad3c12607f2b4abe2322b82bb URL: https://github.com/llvm/llvm-project/commit/39986f0b4d797e4ad3c12607f2b4abe2322b82bb DIFF: https://github.com/llvm/llvm-project/commit/39986f0b4d797e4ad3c12607f2b4abe2322b82bb.diff LO

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105653 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH 1/4] [analyzer] [NFC] Add tests for and refactor StackAddrE

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] [clang] Increase the default expression nesting limit (PR #104717)

2024-08-23 Thread Mikael Holmén via cfe-commits
mikaelholmen wrote: We also see the ASan complaints on ```Parser/parser_overflow.c``` in downstream bots for several days now. A workaround would be appreciated if a real fix is hard. https://github.com/llvm/llvm-project/pull/104717 ___ cfe-commits ma

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Donát Nagy via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/105799 It is a long standing issue that the duplicated declarations in multiple module units would cause the compilation performance to get slowed down. And there are many questions or issue reports. So I think it

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9) Changes It is a long standing issue that the duplicated declarations in multiple module units would cause the compilation performance to get slowed down. And there are many questions or issue reports. So I

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105802)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105802 This reverts c79d1fa540390f6e37e1ea326153559eeadd0de6 and 125aa10b3d645bd26523a1bc321bb2e6b1cf04e1 Instead, use the previous approach but allow void-typed InitListExprs with 0 initializers. >From ea0509c618a

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105802)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes This reverts c79d1fa540390f6e37e1ea326153559eeadd0de6 and 125aa10b3d645bd26523a1bc321bb2e6b1cf04e1 Instead, use the previous approach but allow void-typed InitListExprs with 0 initializers. --- Full diff:

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Donát Nagy via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

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

[clang] [clang][bytecode][NFC] Remove containsErrors() check from delegate (PR #105804)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105804 This check was removed a while ago from visit(), remove it from delegate() as well. >From 94a4986d8074bc2dbb4aa7ed11d4cf39cf963444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Au

[clang] [clang][bytecode][NFC] Remove containsErrors() check from delegate (PR #105804)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes This check was removed a while ago from visit(), remove it from delegate() as well. --- Full diff: https://github.com/llvm/llvm-project/pull/105804.diff 1 Files Affected: - (modified) clang/lib/AST/ByteCo

[clang] 96509bb - [Matrix] Preserve signedness when extending matrix index expression. (#103044)

2024-08-23 Thread via cfe-commits
Author: Florian Hahn Date: 2024-08-23T10:11:52+01:00 New Revision: 96509bb98fc0a7e929304a64362baaa2589d5a6b URL: https://github.com/llvm/llvm-project/commit/96509bb98fc0a7e929304a64362baaa2589d5a6b DIFF: https://github.com/llvm/llvm-project/commit/96509bb98fc0a7e929304a64362baaa2589d5a6b.diff

[clang] [Matrix] Preserve signedness when extending matrix index expression. (PR #103044)

2024-08-23 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/103044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105648 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH 1/5] [analyzer] [NFC] Add tests for and refactor StackAddrE

[clang] 3cca522 - [C++20] [Modules] Warn for duplicated decls in mutliple module units (#105799)

2024-08-23 Thread via cfe-commits
Author: Chuanqi Xu Date: 2024-08-23T17:42:47+08:00 New Revision: 3cca522d21876da36145655bc14f334035b4265d URL: https://github.com/llvm/llvm-project/commit/3cca522d21876da36145655bc14f334035b4265d DIFF: https://github.com/llvm/llvm-project/commit/3cca522d21876da36145655bc14f334035b4265d.diff LO

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/105799 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105648 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH 1/6] [analyzer] [NFC] Add tests for and refactor StackAddrE

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Donát Nagy via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

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

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: The removal of `EnableLifetimeWarnings` flag causes some behavior change when we visit a lifetimebound function argument: - before: the `EnableLifetimeWarnings` is always `false`, which means we never run into the GSL codepath - after: we remove this flag, we will continue to run

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105653 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH 1/6] [analyzer] [NFC] Add tests for and refactor StackAddrE

[clang] [clang][bytecode][NFC] Remove containsErrors() check from delegate (PR #105804)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/105804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 38b8e54 - [clang][bytecode][NFC] Remove containsErrors() check from delegate (#105804)

2024-08-23 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-23T11:55:30+02:00 New Revision: 38b8e54682567d685bc03f9fdef26baa6b708ef9 URL: https://github.com/llvm/llvm-project/commit/38b8e54682567d685bc03f9fdef26baa6b708ef9 DIFF: https://github.com/llvm/llvm-project/commit/38b8e54682567d685bc03f9fdef26baa6b708ef9.diff L

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -297,20 +314,29 @@ std::optional printReferrer(const MemRegion *Referrer) { return "global"; assert(isa(Space)); return "stack"; - }(Referrer->getMemorySpace()); - - // We should really only have VarRegions here. - // Anything else is really surprising, and

[clang] 7b4b85b - [clang][bytecode] Reject void InitListExpr differently (#105802)

2024-08-23 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-23T11:56:42+02:00 New Revision: 7b4b85b75d22a792b2ef80e6af4f0faf18da0a43 URL: https://github.com/llvm/llvm-project/commit/7b4b85b75d22a792b2ef80e6af4f0faf18da0a43 DIFF: https://github.com/llvm/llvm-project/commit/7b4b85b75d22a792b2ef80e6af4f0faf18da0a43.diff L

[clang] [clang][bytecode] Reject void InitListExpr differently (PR #105802)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/105802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #105479)

2024-08-23 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec updated https://github.com/llvm/llvm-project/pull/105479 From 9f61f95c1a56b980b82b40b46514dd888c12330d Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 5 Apr 2024 15:20:37 +0200 Subject: [PATCH] [clang] Catch missing format attribute

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

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

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Donát Nagy via cfe-commits
@@ -161,3 +164,619 @@ C make1() { void test_copy_elision() { C c1 = make1(); } + +namespace leaking_via_direct_pointer { +void* returned_direct_pointer_top() { + int local = 42; + int* p = &local; + return p; // expected-warning{{associated with local variable 'local' ret

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Mostly LGTM and thanks for adding the "`origin_region_limitation`" test. (I added one minor remark as inline comment.) https://github.com/llvm/llvm-project/pull/105653 ___ cfe-commits mailing list cfe-commits@li

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-23 Thread via cfe-commits
DenisGZM wrote: Sorry, I dont get it. Should I press the merge button? Because I dont have one... or I can't find it https://github.com/llvm/llvm-project/pull/99646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: Reduced the libcxx failure to: ``` std::string_view test() { return std::move(*std::optional()); } ``` We should not diagnose on this case. I think the PR https://github.com/llvm/llvm-project/pull/104556 should fix this. https://github.com/llvm/llvm-project/pull/104906 ___

[clang] [NFC] Fix an incorrect comment about operator precedence. (PR #105784)

2024-08-23 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks (Hi!). Do you have commit access or should I merge that for you? https://github.com/llvm/llvm-project/pull/105784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-23 Thread Mikael Holmén via cfe-commits
@@ -9955,6 +9955,45 @@ void ASTReader::finishPendingActions() { } PendingDefinitions.clear(); + for (auto [D, Previous] : PendingWarningForDuplicatedDefsInModuleUnits) { +auto hasDefinitionImpl = [this](Decl *D, auto hasDefinitionImpl) { + if (auto *VD = dyn_cast

[clang] [llvm] [Coverage][MC/DC] Show uncoverable and unreachable conditions (PR #94137)

2024-08-23 Thread via cfe-commits
@@ -1128,15 +1132,22 @@ struct CounterCoverageMappingBuilder BranchParams = mcdc::BranchParameters{ID, Conds}; // If a condition can fold to true or false, the corresponding branch - // will be removed. Create a region with both counters hard-coded to -

[clang] [llvm] [Coverage][MC/DC] Show uncoverable and unreachable conditions (PR #94137)

2024-08-23 Thread via cfe-commits
@@ -47,7 +47,7 @@ // CHECK: Branch (103:9): [True: 9, False: 1] // CHECK: switches() -// CHECK: Branch (113:3): [True: 1, False: 0] +// CHECK: Branch (113:3): [Folded - Ignored] Lambdaris wrote: It's likely the object need to be reproduced. I have tried with

[clang] [PS5][clang][test] x86_64-scei-ps5 -> x86_64-sie-ps5 in tests (PR #105810)

2024-08-23 Thread Edd Dawson via cfe-commits
https://github.com/playstation-edd created https://github.com/llvm/llvm-project/pull/105810 `x86_64-sie-ps5` is the triple we share with PS5 toolchain users who have reason to care about such things. The vast majority of PS5 checks and tests already use this variant. Quashing the handful of st

[clang] [PS5][clang][test] x86_64-scei-ps5 -> x86_64-sie-ps5 in tests (PR #105810)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Edd Dawson (playstation-edd) Changes `x86_64-sie-ps5` is the triple we share with PS5 toolchain users who have reason to care about such things. The vast majority of PS5 checks and tests already use this

[clang] [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (PR #105811)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105811 None >From f3e08fd46b07c83eaae700301c2e0c59743c0d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Aug 2024 12:43:50 +0200 Subject: [PATCH] [clang][bytecode][NFC] Remove containsErr

[clang] [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (PR #105811)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/105811.diff 1 Files Affected: - (modified) clang/lib/AST/ByteCode/Compiler.cpp (-3) ``diff diff --git a/clang/lib/AST/ByteCode/Compiler.

[clang] [llvm] [Coverage][MC/DC] Show uncoverable and unreachable conditions (PR #94137)

2024-08-23 Thread via cfe-commits
Lambdaris wrote: > > I have no authority to request reviewers or commit this patch. So let's @ > > someone, @chapuni @ornata @hanickadot > > I had some comments in the pending state that I just now noticed :( sorry > about that. :fearful: Terribly sorry I was not aware that pending views are

[clang] [llvm] [Coverage][MC/DC] Show uncoverable and unreachable conditions (PR #94137)

2024-08-23 Thread via cfe-commits
https://github.com/Lambdaris edited https://github.com/llvm/llvm-project/pull/94137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix crash in include cleaner (PR #99514)

2024-08-23 Thread Yuxuan Shui via cfe-commits
yshui wrote: @HighCommander4 It's been a while. I think I was trying to ignore everything but the main file in CollectMacros, but the naive approach i used wasn't working https://github.com/llvm/llvm-project/pull/99514 ___ cfe-commits mailing list cfe

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105653 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH 1/7] [analyzer] [NFC] Add tests for and refactor StackAddrE

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -161,3 +164,619 @@ C make1() { void test_copy_elision() { C c1 = make1(); } + +namespace leaking_via_direct_pointer { +void* returned_direct_pointer_top() { + int local = 42; + int* p = &local; + return p; // expected-warning{{associated with local variable 'local' ret

[clang] [clang-tools-extra] [lldb] [llvm] [mlir] [Support] Validate number of arguments passed to formatv() (PR #105745)

2024-08-23 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/105745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-23 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto edited https://github.com/llvm/llvm-project/pull/105653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

2024-08-23 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 created https://github.com/llvm/llvm-project/pull/105817 None >From 77003063912f691d246c4f94dd7a952ceace9268 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 23 Aug 2024 11:57:40 + Subject: [PATCH] [clang] Compiler builtin for deduping a list of types ---

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

2024-08-23 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/105817 >From 77003063912f691d246c4f94dd7a952ceace9268 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 23 Aug 2024 11:57:40 + Subject: [PATCH] [clang] Compiler builtin for deduping a list of types --- .../c

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-23 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/99646 >From 4beb77166031e339208cb71d26d4e1bc5ae6b3a9 Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Fri, 19 Jul 2024 15:47:57 +0300 Subject: [PATCH 1/8] [NVPTX] Support __usAtomicCAS builtin --- clang/include/

[clang] [clang][AArch64] Add SME2.1 feature macros (PR #105657)

2024-08-23 Thread via cfe-commits
https://github.com/SpencerAbson updated https://github.com/llvm/llvm-project/pull/105657 >From 32eaafbdfab98781756abd3cb525e2959544f6b8 Mon Sep 17 00:00:00 2001 From: Spencer Abson Date: Thu, 22 Aug 2024 13:14:19 + Subject: [PATCH] [clang][AArch64] Add SME2.1 feature macros This patch adds

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

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

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

2024-08-23 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/105817 >From 77003063912f691d246c4f94dd7a952ceace9268 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 23 Aug 2024 11:57:40 + Subject: [PATCH] [clang] Compiler builtin for deduping a list of types --- .../c

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

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

[clang] Deprecate -fheinous-gnu-extensions; introduce a new warning flag (PR #105821)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Aaron Ballman (AaronBallman) Changes The new warning flag is `-Winvalid-gnu-asm-cast`, which is enabled by default and is a downgradable diagnostic which defaults to an error. This language dialect flag only controls whether a sing

[clang] 2f144ac - [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (#105811)

2024-08-23 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-23T14:28:52+02:00 New Revision: 2f144ac5a13dc39389e1850417f4ac766b1f1ada URL: https://github.com/llvm/llvm-project/commit/2f144ac5a13dc39389e1850417f4ac766b1f1ada DIFF: https://github.com/llvm/llvm-project/commit/2f144ac5a13dc39389e1850417f4ac766b1f1ada.diff L

[clang] [clang][bytecode][NFC] Remove containsErrors check from visitInitializer (PR #105811)

2024-08-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/105811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Update status page for TS 18661 integration (PR #105693)

2024-08-23 Thread Aaron Ballman via cfe-commits
@@ -216,35 +216,31 @@ C23 implementation status https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2341.pdf";>N2341 -Unknown - - -https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2401.pdf";>N2401 -Unknown +No

[clang] [C23] Update status page for TS 18661 integration (PR #105693)

2024-08-23 Thread Aaron Ballman via cfe-commits
@@ -216,35 +216,31 @@ C23 implementation status https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2341.pdf";>N2341 -Unknown - - -https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2401.pdf";>N2401 -Unknown +No

[clang] [C23] Update status page for TS 18661 integration (PR #105693)

2024-08-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > It might be better to list most of these as "N/A" rather than "No", for the > simple reason that decimal floating point is an optional feature we do not > support. Or maybe just a footnote saying something to that effect? I think eventually I'd like to split out optional

[clang] 1e3dc8c - [Serialization] Fix a warning

2024-08-23 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2024-08-23T05:49:49-07:00 New Revision: 1e3dc8cdb49bf7b8344d1d7f7befbb95a9fbdb63 URL: https://github.com/llvm/llvm-project/commit/1e3dc8cdb49bf7b8344d1d7f7befbb95a9fbdb63 DIFF: https://github.com/llvm/llvm-project/commit/1e3dc8cdb49bf7b8344d1d7f7befbb95a9fbdb63.diff L

[clang] [llvm] [NFC] Use const members of `StringToOffsetTable` (PR #105824)

2024-08-23 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/105824 - After the table is populated and emitted as a string, we do not expect any modifications to the table. So use const reference and const members to access the table from that point on. >From 154c0728820a8a6e1

[clang] Enable frame pointer for non-leaf functions on Android (PR #97614)

2024-08-23 Thread Sam Elliott via cfe-commits
@@ -166,7 +155,7 @@ static bool useFramePointerForTargetByDefault(const llvm::opt::ArgList &Args, static bool useLeafFramePointerForTargetByDefault(const llvm::Triple &Triple) { if (Triple.isAArch64() || Triple.isPS() || Triple.isVE() || - (Triple.isAndroid() && Triple

[clang] [Clang] Implement P2747 constexpr placement new (PR #104586)

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

[clang] [Clang] Implement P2747 constexpr placement new (PR #104586)

2024-08-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2747 constexpr placement new (PR #104586)

2024-08-23 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + + +namespace std { + using size_t = decltype(sizeof(0)); +} + +void *operator new(std::size_t, void *p) { return p; } +void* operator new[] (std::size_t, void* p) {return p;} + + +consteval int ok() { +int i; +

[clang] [llvm] [NFC] Use const members of `StringToOffsetTable` (PR #105824)

2024-08-23 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/105824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Use const members of `StringToOffsetTable` (PR #105824)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes - After the table is populated and emitted as a string, we do not expect any modifications to the table. So use const reference and const members to access the table from that point on. --- Full diff: https:

[clang] 2617023 - [clang][AArch64] Add SME2.1 feature macros (#105657)

2024-08-23 Thread via cfe-commits
Author: SpencerAbson Date: 2024-08-23T14:27:49+01:00 New Revision: 2617023923175b0fd2a8cb94ad677c061c01627f URL: https://github.com/llvm/llvm-project/commit/2617023923175b0fd2a8cb94ad677c061c01627f DIFF: https://github.com/llvm/llvm-project/commit/2617023923175b0fd2a8cb94ad677c061c01627f.diff

[clang] [clang][AArch64] Add SME2.1 feature macros (PR #105657)

2024-08-23 Thread via cfe-commits
https://github.com/SpencerAbson closed https://github.com/llvm/llvm-project/pull/105657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat new expressions as simple functions (PR #105168)

2024-08-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/105168 From 089699a673d29e244e750bf1c978292594362cdc Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 20 Aug 2024 19:40:42 +0200 Subject: [PATCH] [clang-format] Treat new expressions as simple functions ccae

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

2024-08-23 Thread via cfe-commits
https://github.com/cor3ntin commented: Sorry for the late review! I think the change make sense but needs more tests. Thanks! After we land that, could you spend some time trying to cleanup some of these functions? - maybe pass an enum instead of a myriad of bool parameters - maybe return a st

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

2024-08-23 Thread via cfe-commits
@@ -5395,11 +5520,100 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult CheckDeductionConsistency( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, QualTyp

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

2024-08-23 Thread via cfe-commits
@@ -5395,11 +5520,100 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult CheckDeductionConsistency( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, QualTyp

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

2024-08-23 Thread via cfe-commits
@@ -1343,6 +1343,9 @@ namespace { DeclarationName Entity; // Whether to evaluate the C++20 constraints or simply substitute into them. bool EvaluateConstraints = true; +// Whether Substitution was Incomplete, that is, we tried to substitute in +// any templ

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

2024-08-23 Thread via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -std=c++23 -verify %s + +namespace t1 { +template struct enable_if { typedef void type; }; +template class Foo {}; +template constexpr bool check() { return true; } +template struct Bar {}; + +template void func(Bar()>::type>) {} +// expecte

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

2024-08-23 Thread via cfe-commits
@@ -5421,34 +5635,139 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: -if (DeduceTemplateArguments(S, TemplateParams, Args2.data(), Args2.size(

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

2024-08-23 Thread via cfe-commits
@@ -5554,38 +5869,50 @@ FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( // "that is a member function with no expicit object argument". // Otherwise the ordering rules for methods with expicit objet arguments // against anything else make no sense. -Shou

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

2024-08-23 Thread via cfe-commits
@@ -5421,34 +5635,139 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: -if (DeduceTemplateArguments(S, TemplateParams, Args2.data(), Args2.size(

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

2024-08-23 Thread via cfe-commits
@@ -5395,11 +5520,100 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult CheckDeductionConsistency( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, QualTyp

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

2024-08-23 Thread via cfe-commits
@@ -1307,6 +1304,62 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, return TemplateDeductionResult::Success; } +/// Deduce the template arguments by comparing the list of parameter +/// types to the list of argument types, as in the parameter-type

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

2024-08-23 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/100692 ___ 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-08-23 Thread via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

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

2024-08-23 Thread via cfe-commits
@@ -859,8 +861,10 @@ class PackDeductionScope { // by this pack expansion, then clear out the deduction. DeducedFromEarlierParameter = !Deduced[Index].isNull(); DeducedPack Pack(Index); -Pack.Saved = Deduced[Index]; -Deduced[Index] = TemplateArgument(); +

[clang] [Clang] Implement P2747 constexpr placement new (PR #104586)

2024-08-23 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/104586 >From 67201d1d2e4d092cf8712b1e1b63f2eceaf8d57c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 9 Jul 2024 08:37:18 +0200 Subject: [PATCH 1/6] [Clang] Implement P2747 constexpr placement new In C++26 a

[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-08-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but please allow some time for @rnk or @MaskRay to review before landing https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [PS5][clang][test] x86_64-scei-ps5 -> x86_64-sie-ps5 in tests (PR #105810)

2024-08-23 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. I appreciate the pedantry. Internally these are equivalent, but SIE is the current company abbreviation so we should try to be consistent going forward. LGTM https://github.com/llvm/llvm-project/pull/105810 _

[clang-tools-extra] [clangd] Construct SmallVector with ArrayRef (NFC) (PR #105829)

2024-08-23 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/105829 None >From 3fbc8e818867ef7ac950a381f98ff013089d8e96 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 23 Aug 2024 06:24:44 -0700 Subject: [PATCH] [clangd] Construct SmallVector with ArrayRef (NFC) -

[clang-tools-extra] [clangd] Construct SmallVector with ArrayRef (NFC) (PR #105829)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/105829.diff 1 Files Affected: - (modified) clang-tools-extra/clangd/TUScheduler.cpp (+1-1) ``diff diff --git a/clang-tools-extra/

  1   2   3   4   >