[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-04 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Ok, thanks! Can you merge it please if you don't think that something should be done with https://github.com/llvm/llvm-project/pull/156329#discussion_r2316159657? https://github.com/llvm/llvm-project/pull/156329 ___ cfe-commits m

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-04 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -84,6 +84,9 @@ C++ Specific Potentially Breaking Changes static_assert((b.*mp)() == 1); // newly rejected static_assert((c.*mp)() == 1); // accepted +- ``VarTemplateSpecializationDecl::getTemplateArgsAsWritten()`` method returns bolshakov-a wrote:

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-04 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/156329 >From 2e0a5fa07d1a52205ee37b98b5f9000522f3a8f0 Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Mon, 1 Sep 2025 12:38:24 +0300 Subject: [PATCH] [clang] Remove written template args from implicit var tpl spec

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-03 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I always forget about release notes, thanks! However, there isn't "Potential AST breaking changes" section but there is "AST Dumping Potentially Breaking Changes" one. But this PR doesn't change AST dumps. Maybe, "C++ Specific Potentially Breaking Changes"? https://github.c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @erichkeane, @mizvekov, @shafik https://github.com/llvm/llvm-project/pull/156329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -84,6 +84,9 @@ C++ Specific Potentially Breaking Changes static_assert((b.*mp)() == 1); // newly rejected static_assert((c.*mp)() == 1); // accepted +- ``VarTemplateSpecializationDecl::getTemplateArgsAsWritten()`` method returns bolshakov-a wrote:

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a updated https://github.com/llvm/llvm-project/pull/156329 >From 69887b3e0a0b3b011d095384422f7319dc2f Mon Sep 17 00:00:00 2001 From: Bolshakov Date: Mon, 1 Sep 2025 12:38:24 +0300 Subject: [PATCH] [clang] Remove written template args from implicit var tpl spec

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-01 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a created https://github.com/llvm/llvm-project/pull/156329 `VarTemplateSpecializationDecl::getTemplateArgsAsWritten()` function should return `nullptr` in the case of implicit instantiation, as its `ClassTemplateSpecializationDecl` counterpart does, and not the arg

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-28 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Yeah, the not-to-break-ABI consideration is obviously the only reason why they haven't fix it so far. But this makes dangerous to mix declarations with different tag kinds despite it is allowed by the standard, and hence MSVC has a warning on that as @kimgr has noticed. So p

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-27 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > We don't want bug-for-bug conformance, but we do want to be ABI compatible. It really looks like an MSVC bug. If its mangling depends on whether the first (forward-)declaration of a class in a translation unit uses `class` or `struct` class-key, the TUs cannot be linked to

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Ah, sorry. I tested on IWYU and get confused because it transforms a declaration to the definition later. https://github.com/llvm/llvm-project/pull/147835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Seems like `getOriginalDecl()` always returns the full definition for enumerations (and not an opaque declaration for enums with fixed underlying type). Is it guaranteed? https://github.com/llvm/llvm-project/pull/147835 ___ cfe-com

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a commented: Looks good, thanks! I didn't review the whole PR, just noticed a couple of issues. https://github.com/llvm/llvm-project/pull/155028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -878,10 +878,10 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, // Treat the enumeration as its underlying type and use the builtin type // class comparison. if (T1->getTypeClass() == Type::Enum) { -T1 = T1->getAs()->

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2883,14 +2883,23 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// because the type is a RecordType or because it is the injected-class-name /// type of a class template or class template partial specialization. CXXRecordDecl *getAsCXXRecordD

[clang] [clang-tools-extra] [clang] AST: fix getAs canonicalization of leaf types (PR #155028)

2025-08-23 Thread Andrey Ali Khan Bolshakov via cfe-commits
https://github.com/bolshakov-a edited https://github.com/llvm/llvm-project/pull/155028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-17 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-17 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-16 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -2586,8 +2561,9 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, } case Type::InjectedClassName: -mangleSourceNameWithAbiTags( -cast(Ty)->getDecl()); +mangleSourceNameWithAbiTags(cast(Ty) +->getOrig

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-15 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Out of curiosity. The old `getDecl()` methods returned the tag type definition (if present), whereas the new `getOriginalDecl()` returns just some of redeclarations (and not necessarily the first one). What is the reason of such change? https://github.com/llvm/llvm-project/

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @kimgr, what do you think? https://github.com/llvm/llvm-project/pull/147835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: The assert doesn't hurt us, as I've said. I just asked if it is a "documented way" of working with the new visitor interface. If it not to be avoided, then we will probably just proceed with the `TraverseQualifier` manipulation. https://github.com/llvm/llvm-project/pull/1478

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-13 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: They should be avoided not always but in certain circumstances, so there should be a new flag field in the visitor class. Not many new code, TBH, but using `TraverseQualifier` was so tempting... https://github.com/llvm/llvm-project/pull/147835 ___

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-08-11 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @kimgr, I've just succeeded in building IWYU against this and getting the tests green. However, I want to spend some time on self-review, probably writing additional tests, and so on. https://github.com/llvm/llvm-project/pull/147835 __

[clang] clang: Make the type_info builtin declaration a singleton (PR #151277)

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

[clang] clang: Make the type_info builtin declaration a singleton (PR #151277)

2025-08-05 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I've noticed that this PR changed the tag type kind of the implicit `type_info` from `class` to `struct`. I don't know if it has any bad consequences, but it looks inconsistent with the definition of `std::type_info`. https://github.com/llvm/llvm-project/pull/151277

[clang] [C23] More improved type compatibility for enumerations (PR #150946)

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

[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-04-07 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks, it becomes now clearer for me. However, I'm still not succeeded in making this code really working, because the default version of `TraverseDecltypeType` doesn't traverse the underlying desugared type: https://github.com/llvm/llvm-project/blob/be6ccc98f38227db02164f17

[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-04-06 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: @mizvekov, could you clarify please what is the point of traversing the host type twice? The tests pass if just remove the `if` statement. https://github.com/llvm/llvm-project/pull/132551 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-08 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > From past conversations with IWYU maintainer, this was desirable, since IWYU > rolls its own resugarer, which is faulty and difficult to maintain. I just want to mention that, actually, IWYU doesn't probably need any resugarer at all. A type template argument as-written is

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: > One possibility here is that if you have the type, then you will have a > template specialization type for the template alias, and that gives you the > template arguments used to specialize the alias. Which should answer this > need. This can probably go, thank you! http

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: No, IWYU has some complex logic to figure out which type components the type alias author intends to provide, and which should be `#include`d at the use site. Of course, substituted template type arguments are the user responsibility, not the alias author's one, hence this i

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: When instantiating such an alias: ```cpp template using Identity = T; ``` before the patch: ``` TemplateSpecializationType 0x676f0a60 'Identity' sugar alias |-name: 'Identity' qualified | `-TypeAliasTemplateDecl 0x676c91d8 Identity |-TemplateArgument type 'IndirectCla

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-14 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: LGTM, but I don't have the commit access, hence cannot merge your PR. Someone closely related to the community should take a look. https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: I'd prefer something simpler like: ```cpp struct A { int* pi; }; template void TplFn(); int i; void Fn() { TplFn(); } ``` with checking of the full mangled name. https://github.com/llvm/llvm-project/pull/97792 _

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-09 Thread Andrey Ali Khan Bolshakov via cfe-commits
@@ -1938,12 +1946,23 @@ void MicrosoftCXXNameMangler::mangleTemplateArgValue(QualType T, mangleNumber(V.getLValueOffset().getQuantity()); } else if (!V.hasLValuePath()) { // FIXME: This can only happen as an extension. Invent a mangling. -break; +

[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 th

[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 cfe-commits@lists.llvm.or

[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 https://lists.llvm.org/cgi-bin/mailman/

[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 generali

[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 cfe-commits@lists.

[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 ht

[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` sh

[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 https:

[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 `ArrayInitLo

[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. I

[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 refer

[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 r

[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 non-uni

[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 subexpressio

[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 expressio

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

2024-04-09 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-09 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 end

[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 s

[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 -emptyline-comment-coverage=fal

[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 s

[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 Template

[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 ht

[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 https://lists.

[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 `Structural

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[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 1

[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 https://lists.ll

[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 https://lists.llvm.org/cgi-bin/mailman

[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 neces

[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 neces

[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; + bre

[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 referr

[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 &Arg, else Kind = CharacterLiteralKind::Ascii; -E = new (Context) CharacterLiteral(Arg.getAsIntegral().getZExtValue(), - Kind,

[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 &Arg, else Kind = CharacterLiteralKind::Ascii; -E = new (Context) CharacterLiteral(Arg.getAsIntegral().getZExtValue(), - Kind,

[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 [here](https://github.com/llvm/llvm-project/pull/78041/files#diff-2f25fdb80b1a63f2e0a5a7c7a7c061b494b430ee8f5759b48022a86

[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 https://lists.llvm.org/cgi-bin/mailma

[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 +++ b/c

[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 cfe-commi

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo

  1   2   >