[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Ok, got it. Thanks! https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @efriedma-quic ping. https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -1265,13 +1238,62 @@ class TemplateDiff { IsNullPtr = true; return; case TemplateArgument::Expression: -// TODO: Sometimes, the desugared template argument Expr differs from -// the sugared template argument Expr. It may be useful in

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a approved this pull request. One question about the version of the C++ standard under testing, otherwise LGTM, thanks! https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I don't see any C++26-specific stuff here, only C++20. https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-05-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/85837 >From 61abd7b6089ecb87eaf6886e251969d4db87e223 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Tue, 19 Mar 2024 19:05:36 +0300 Subject: [PATCH 1/2] [clang][c++20] Fix code coverage mapping crash with

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-05-15 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks! https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-05-15 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Could you please merge both of these? https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-05-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: This looks like supporting my words: https://github.com/llvm/llvm-project/blob/llvmorg-19-init/clang/lib/CodeGen/CodeGenPGO.cpp#L935-L936 https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-05-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @efriedma-quic ping. CC @AaronBallman https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-22 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @efriedma-quic, would it be OK to add "subexpression" visitation with a comment that I'm not sure that it is actually needed? https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-18 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > But anyway, I think we end up doing the right thing automatically if you > ignore non-unique OpaqueValueExprs. The problem is that there is no initializing "common expression" in the AST besides non-unique `OpaqueValueExpr`, hence some code handling `ArrayInitLoopExpr`

[clang] [Coverage][NFC] Avoid visiting non-unique `OpaqueValueExpr` (PR #88910)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > Please turn off [Keep my email addresses > private](https://github.com/settings/emails) setting in your account. Done. https://github.com/llvm/llvm-project/pull/88910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/1 >From a025b2a45c2a66595c111262dd43c0890f0d54b6 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Tue, 16 Apr 2024 14:21:40 +0300 Subject: [PATCH 1/2] [Coverage] Handle array decomposition correctly

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I don't see any difference on your example (with `main()` and function definitions added) with and without my patch neither in the dumped coverage mapping nor in the output of `llvm-cov show ... --show-branches=count --show-expansions -show-line-counts-or-regions` command.

[clang] [Coverage][NFC] Avoid visiting non-unique `OpaqueValueExpr` (PR #88910)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Could you merge it please? https://github.com/llvm/llvm-project/pull/88910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Honestly, I'm not very familiar with code coverage technique, but it seems to me that only explicitly written code is relevant for that. "Common expression" is exactly the explicitly written part. "Subexpression" is an implicitly generated per-element initializer which

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { -Visit(OVE->getSourceExpr()); +if (const Expr *SE = OVE->getSourceExpr()) bolshakov-a wrote: Makes sense, thanks! Moreover, I've

[clang] [Coverage][NFC] Avoid visiting non-unique `OpaqueValueExpr` (PR #88910)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/88910 Only unique `OpaqueValueExpr`s should be handled in the mapping builder, as [discussed](https://github.com/llvm/llvm-project/pull/85837#discussion_r1542056451) in #85837. However, `getCond()` returns

[clang] [Coverage] Handle `CoroutineSuspendExpr` correctly (PR #88898)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/88898 This avoids visiting `co_await` or `co_yield` operand 5 times (it is repeated under transformed awaiter subexpression, and under `await_ready`, `await_suspend`, and `await_resume` generated call

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/1 `ArrayInitLoopExpr` AST node has two occurences of its as-written initializing expression in its subexpressions through a non-unique `OpaqueValueExpr`. It causes double-visiting of the initializing

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-10 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-10 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { -Visit(OVE->getSourceExpr()); +if (const Expr *SE = OVE->getSourceExpr()) bolshakov-a wrote: > If I'm following correctly, you

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-08 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @erichkeane, @cor3ntin, @Endilll, @efriedma-quic ping. https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-03-28 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { -Visit(OVE->getSourceExpr()); +if (const Expr *SE = OVE->getSourceExpr()) bolshakov-a wrote: Not all `OpaqueValueExpr`s having a

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-03-19 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-03-19 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/85837 >From 398ad87c1e9669223def3561f4cdd72af11857c3 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Tue, 19 Mar 2024 19:05:36 +0300 Subject: [PATCH] [clang][c++20] Fix code coverage mapping crash with generalized

[clang] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-03-19 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name templates.cpp %s | FileCheck %s +// RUN: %clang_cc1 -std=c++20 -mllvm

[clang] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-03-19 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/85837 Introduced in #78041, originally reported as #79957 and fixed partially in #80050. `OpaqueValueExpr` used with `TemplateArgument::StructuralValue` has no corresponding source expression. A test case with

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-02-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -5401,6 +5409,8 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const { // feasible some day. return TA.getAsIntegral().getBitWidth() <= 64 && IsReconstitutableType(TA.getIntegralType()); + case

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > Please do! #80150. I don't know, maybe, some more actions should be done. I cannot add "release:backport" label, at least. https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks! Should I open an issue to backport this to RC? https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @cor3ntin, @erichkeane, could you merge it please? https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > what a proper fix would look like Probably, some more `OpaqueValueExpr` handlers should be rewritten correctly. https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I think the problem is that the generalized NTTP feature is still raw. It should not break already working features, namely array reference NTTPs, hence they are swithed back to the old `TemplateArgument::Declaration`, as they worked prior to #78041, from the new

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @jeremiahar, thanks for reporting! Added a coverage mapping test case. https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/80050 >From ae4b26cbd22a52a932464dfe5c529b296bbf96dd Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Tue, 30 Jan 2024 21:33:34 +0300 Subject: [PATCH] [clang] Represent array refs as `TemplateArgument::Declaration`

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: #80050 opened. Nevertheless, a reproducer for future work would be appreciated. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @erichkeane, @cor3ntin https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/80050 This returns (probably temporarily) array-referring NTTP behavior to which was prior to #78041 because ~~I'm fed up~~ have no time to fix regressions. >From 0ccf1c9eeec7641dfdca9f8a06499512f98ba6da Mon Sep

[clang-tools-extra] [clang] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @eaeltsin, could you try out [that branch](https://github.com/bolshakov-a/llvm-project/tree/avoid_regressions)? https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks! https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-30 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I'm just waiting for someone who would do it instead of me... I don't have commit access. https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/79764 >From b3debeb88fdc3d50f257be56f3e60ae7bf83cc07 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Sun, 28 Jan 2024 21:12:10 +0300 Subject: [PATCH] Fix crashes on 'StructuralValue' `OpaqueValueExpr` doesn't

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-29 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @zmodem, thanks! Added the fix to #79764. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/79764 >From 474f86604c35bea7041bcf3e6f8e2103d180902f Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Sun, 28 Jan 2024 21:12:10 +0300 Subject: [PATCH] Fix crashes on 'StructuralValue' `OpaqueValueExpr` doesn't

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-29 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -40,8 +40,12 @@ static const Expr *ignoreTransparentExprs(const Expr *E) { switch (E->getStmtClass()) { case Stmt::OpaqueValueExprClass: -E = cast(E)->getSourceExpr(); -break; +if (const clang::Expr *SE = cast(E)->getSourceExpr()) { + E = SE; +

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-28 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @steakhal, @cor3ntin, @erichkeane https://github.com/llvm/llvm-project/pull/79764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)

2024-01-28 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/79764 `OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after #78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-26 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -8129,29 +8067,133 @@ Sema::BuildExpressionFromIntegralTemplateArgument(const TemplateArgument , else Kind = CharacterLiteralKind::Ascii; -E = new (Context) CharacterLiteral(Arg.getAsIntegral().getZExtValue(), - Kind, T,

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-26 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -8129,29 +8067,133 @@ Sema::BuildExpressionFromIntegralTemplateArgument(const TemplateArgument , else Kind = CharacterLiteralKind::Ascii; -E = new (Context) CharacterLiteral(Arg.getAsIntegral().getZExtValue(), - Kind, T,

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-26 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Prior to this PR, arrays in NTTP were represented as `Declaration`s and now as `StructuralValue`s referring to their first element. @steakhal, please note

[clang-tools-extra] [clang] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: The tests are passed. Maybe, someone else could write a test and commit? I'm slightly busy. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @erichkeane, @cor3ntin, argument types [here](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplateDeduction.cpp#L3022) occurs to be different with sugar added to one of them. This patch fixes the problem: ``` --- a/clang/lib/AST/TemplateBase.cpp +++

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I suspect the reason is in the array-to-pointer conversion in `StructuralValue` argument. Maybe this will help someone to invent a fix quickly... https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-24 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks! I'll probably take a look in my spare time. Feel free to revert this. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-21 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thank you all, especially to @zygoloid for allowing me to steal its thunder! https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-21 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > Do you need me to merge that for you? Yes, please. I don't have commit access. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-21 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From 6cc472d5a1214e847b7f3a5dce28d6bed86121ed Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Sun, 21 Jan 2024 16:19:51 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type template

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-21 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From e2fa0ec1fbb77a521b92f2a17f45879ca01cd304 Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-20 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From 7abb30826263ad69d529dd6af585bf3bce40f979 Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-20 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From 35e5e87d5c6f250f9f7a6cf5e5aeaebe5929f155 Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[clang-tools-extra] [clang] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-20 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From 9bef9d5dd970f1af653d5b10d0a062d96a69ad01 Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[clang-tools-extra] [clang] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-20 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -6472,7 +6494,20 @@ void CXXNameMangler::mangleValueInTemplateArg(QualType T, const APValue , Out << "plcvPcad"; Kind = Offset; } else { - if (!V.getLValuePath().empty() || V.isLValueOnePastTheEnd()) { + // Clang 11 and before mangled an array

[clang-tools-extra] [clang] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-20 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -4833,9 +4833,26 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity, E = cast(E)->getSubExpr(); goto recurse; - case Expr::SubstNonTypeTemplateParmExprClass: + case Expr::SubstNonTypeTemplateParmExprClass: { +// Mangle a substituted

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -14,6 +14,11 @@ #include "clang/AST/ODRHash.h" +#include "clang/AST/APValue.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/CharUnits.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclCXX.h" bolshakov-a wrote: Removed.

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -25,10 +25,13 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" #include "clang/AST/DeclObjC.h" +#include "clang/AST/Expr.h" #include "clang/AST/NSAPI.h" #include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" #include "clang/Basic/Builtins.h"

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From 459f2c778d42fd5132bf69695537dc5f5a26b160 Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -12,6 +12,7 @@ #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/DeclVisitor.h" +#include "clang/AST/ODRHash.h" bolshakov-a wrote: Just to clarify: do you insist that `#include` set added in a PR should be minimal for

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Btw, I have a local branch with a few distinct commits. I could temporarily push it to simplify review process, and then squash them before merging. https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > Should we add a couple of PCH tests ? [clang/test/Modules/odr_hash.cpp](https://github.com/llvm/llvm-project/pull/78041/files#diff-b0662120e3a8a2bf3ccd95b9e8943640816b457c00e662ebfdd648632e383314) should cover AST serialization/deserialization. But I could missing

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -628,6 +628,10 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext , return IsStructurallyEquivalent(Context, Arg1.getAsExpr(), Arg2.getAsExpr()); + case TemplateArgument::StructuralValue: +// FIXME: Do we need

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/78041 >From b178deb9479e86d2899466c521ebfb28a08d27cb Mon Sep 17 00:00:00 2001 From: Andrey Ali Khan Bolshakov Date: Sun, 6 Aug 2023 19:38:23 +0300 Subject: [PATCH] [c++20] P1907R1: Support for generalized non-type

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -14,6 +14,11 @@ #include "clang/AST/ODRHash.h" +#include "clang/AST/APValue.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/CharUnits.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclCXX.h" bolshakov-a wrote: Types from all of them are

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -12,6 +12,7 @@ #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/DeclVisitor.h" +#include "clang/AST/ODRHash.h" bolshakov-a wrote: `ODRHash` is used inside the newly added code. Btw, what do you mean by "necessary"? I

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -25,10 +25,13 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" #include "clang/AST/DeclObjC.h" +#include "clang/AST/Expr.h" #include "clang/AST/NSAPI.h" #include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" #include "clang/Basic/Builtins.h"

[clang] [lldb] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -80,6 +81,13 @@ class TemplateArgument { /// that was provided for an integral non-type template parameter. Integral, +/// The template argument is a non-type template argument that can't be +/// represented by the special-case Declaration, NullPtr, or

[clang-tools-extra] [lldb] [clang] [Clang] [c++20] P1907R1: Support for generalized non-type template ar… (PR #77428)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @cor3ntin, #78041. https://github.com/llvm/llvm-project/pull/77428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -5401,6 +5409,8 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const { // feasible some day. return TA.getAsIntegral().getBitWidth() <= 64 && IsReconstitutableType(TA.getIntegralType()); + case

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -25,7 +25,7 @@ template struct S {}; // #dr1801-S S V; // #dr1801-S-i // cxx98-14-error@-1 {{non-type template argument does not refer to any declaration}} // cxx98-14-note@#dr1801-S {{template parameter is declared here}} -// since-cxx17-error@#dr1801-S-i {{non-type

[clang-tools-extra] [clang] [lldb] [Clang] [c++20] P1907R1: Support for generalized non-type template ar… (PR #77428)

2024-01-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Seems like I should ping reviewers more actively... Ok, thanks, I'll probably proceed at the weekend. https://github.com/llvm/llvm-project/pull/77428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[lldb] [clang] [clang-tools-extra] [Clang] [c++20] P1907R1: Support for generalized non-type template ar… (PR #77428)

2024-01-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Have I understood correctly that I should open my own PR to proceed working on this? https://github.com/llvm/llvm-project/pull/77428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2024-01-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks! https://github.com/llvm/llvm-project/pull/71077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang-tools-extra] [clang] [Clang] [c++20] P1907R1: Support for generalized non-type template ar… (PR #77428)

2024-01-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @cor3ntin, thank you! Could you please take a look and probably merge #71077? This depends on that PR. https://github.com/llvm/llvm-project/pull/77428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2024-01-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/71077 >From 4435d1ed5ed4785be7df35c129332359d89f132b Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Thu, 2 Nov 2023 19:20:27 +0300 Subject: [PATCH] [clang] Improve bit-field in ref NTTP diagnostic Prior to this,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-04 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/71077 >From e5ad8f5b00a297ef745e1b9341df32b80a7c6b77 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Thu, 2 Nov 2023 19:20:27 +0300 Subject: [PATCH] [clang] Improve bit-field in ref NTTP diagnostic Prior to this,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-04 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I want just note that it is probably not an improvement from the user's point of view, just a change of wording. https://github.com/llvm/llvm-project/pull/71077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/71077 >From ff1b0d96e7beef51a082d59548c49b9c02d79eb0 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Thu, 2 Nov 2023 19:20:27 +0300 Subject: [PATCH] [clang] Improve bit-field in ref NTTP diagnostic Prior to this,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -5992,6 +5992,15 @@ static ExprResult BuildConvertedConstantExpression(Sema , Expr *From, /*InOverloadResolution=*/false, /*AllowObjCWritebackConversion=*/false,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > Can you add a release note? Do you think this small diagnostic wording change is worth noting in relnotes? > Do we need more tests in other contexts where a converted constant expression > is used? Seems like constant expressions converted to references may currently

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/71077 >From bc2ea1ab74b613f700b11390a4715a0f2bec10e7 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Thu, 2 Nov 2023 19:20:27 +0300 Subject: [PATCH] [clang] Improve bit-field in ref NTTP diagnostic Prior to this,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-11-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/71077 >From 02154cf040c55b0d7bd28a3ffbb76c86ca9b878d Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Thu, 2 Nov 2023 19:20:27 +0300 Subject: [PATCH] [clang] Improve bit-field in ref NTTP diagnostic Prior to this,

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-11-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/71077 Prior to this, attempts to bind a bit-field to an NTTP of reference type produced an error because references to subobjects in NTTPs are disallowed. But C++20 allows references to subobjects in NTTPs