[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
@@ -724,6 +724,9 @@ enum ASTRecordTypes { /// Record code for vtables to emit. VTABLES_TO_EMIT = 70, + + /// Record code for the FunctionDecl to lambdas mapping. dmpolukhin wrote: Done https://github.com/llvm/llvm-project/pull/109167 ___

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
@@ -4351,6 +4351,15 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) { reader::ASTDeclContextNameLookupTrait(*this, *Update.Mod)); DC->setHasExternalVisibleStorage(true); } + + // Load any pending lambdas for the function. + if (auto *FD

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
@@ -233,6 +233,10 @@ class ASTWriter : public ASTDeserializationListener, /// instead of comparing the result of `getDeclID()` or `GetDeclRef()`. llvm::SmallPtrSet PredefinedDecls; + /// Map that provides the ID of function to the vector of lambdas inside it.

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/109167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: All comments resolved, also I added TODO that we might want to use ondisk hash table to allow lazy deserialization for the new record. https://github.com/llvm/llvm-project/pull/109167 ___ cfe-commits mailing li

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
@@ -532,6 +532,10 @@ class ASTReader /// namespace as if it is not delayed. DelayedNamespaceOffsetMapTy DelayedNamespaceOffsetMap; + /// Mapping from FunctionDecl IDs to the corresponding lambda IDs. dmpolukhin wrote: Done https://github.com/llvm/llvm-p

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-24 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/109167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Quote header unit name in preprocessor output (-E) (PR #112883)

2024-10-24 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin closed https://github.com/llvm/llvm-project/pull/112883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-11-06 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: FYI, in our internal testing we also found a case when this PR fixes issue. Also we don't see any examples when it may break something so I think we should merge it ASAP because it fixes known issues and don't have any known regressions. @alexfh what is the ETA for release t

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-11-15 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @alexfh and @ilya-biryukov do you have any updates? https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-02 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: > The missing bit was `-O1`, as soon as I've added that, I am now getting the > error with this commit and not getting any error without this commit. Here is > a proper reproducer: > [friends.tgz](https://github.com/user-attachments/files/17950471/friends.tgz) Thank you for

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/4] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/5] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @ilya-biryukov could you please test the latest version on your sources? It seems that I found generic enough solution for the problem when clang uses merged decl with no body for template instantiation. See changes in clang/lib/Sema/SemaTemplateInstantiateDecl.cpp. https://

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: Updated PR https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/6] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Dmitry Polukhin via cfe-commits
@@ -1976,14 +1976,16 @@ TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { if (!InstParams) return nullptr; + // Use canonical templated decl because only canonical decl has body + // if declarations were merged during loading from modules.

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-01-29 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: LGTM but let @ChuanqiXu9 approve. https://github.com/llvm/llvm-project/pull/121245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-01-29 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/121245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-01-29 Thread Dmitry Polukhin via cfe-commits
@@ -0,0 +1,90 @@ +// RUN: rm -rf %t dmpolukhin wrote: Please add a comment that the test results in `llvm_unreachable` in debug builds so debug build should be used to investigate problems with the test. https://github.com/llvm/llvm-project/pull/121245

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-11 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/7] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-11 Thread Dmitry Polukhin via cfe-commits
@@ -1976,14 +1976,16 @@ TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { if (!InstParams) return nullptr; + // Use canonical templated decl because only canonical decl has body + // if declarations were merged during loading from modules.

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-11 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-11 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: > The two problems I see are: > > * invalid `no matching constructor for initialization of` errors for some > particular type, I think it is due to applying my changes too wide (i.e. to normal member functions and use first decl for them). I hope I fix

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-11 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/8] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-12 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: FYI, I tested the latest version on our reproducers and it fixed all known issues due to friend inline functions. https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-16 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin closed https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-16 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @ilya-biryukov and @ChuanqiXu9 thank you for your help with the review, testing and reproducers. Very appreciated! https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-16 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/111992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-16 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From 3eaaa7d70f4b57cc13bd00bd3a3a921f7914d599 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/9] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-16 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/111992 >From d71fb50ca68448578b797bb85f3a607dc9739d45 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Fri, 11 Oct 2024 05:35:18 -0700 Subject: [PATCH 1/9] [C++20][Modules] Load function body from the module tha

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-11-21 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: I do believe that the issue about ODR violation cannot be caused by this change itself. I suggest merging this PR as is and I'll take a look at the reproducer as soon as you create it. This PR fixes known issues with reproducers so I'm in doubt what makes this change so speci

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-11-22 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @ilya-biryukov unfortunately it seems that the reproducer is very sensitive to the exact clang revision. I tried it with current main b8eef18868570b2f5244d6d43de02a1812d1c880 and this PR on top of the revision. In both cases I don't see any problems at all (no errors, no warn

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-21 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/2] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-21 Thread Dmitry Polukhin via cfe-commits
@@ -1571,9 +1571,10 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { } else { Record.push_back(0); } -// For lambdas inside canonical FunctionDecl remember the mapping. +// For lambdas inside template functions, remember the mapping to +/

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/3] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/7] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
@@ -799,14 +813,14 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { } if (D->getFriendObjectKind()) { -// For a function defined inline within a class template, we have to force -// the canonical definition to be the one inside the canonical definition

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/6] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
@@ -799,14 +817,12 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { } if (D->getFriendObjectKind()) { -// For a function defined inline within a class template, we have to force -// the canonical definition to be the one inside the canonical definition

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/5] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
@@ -539,11 +539,12 @@ class ASTReader /// Mapping from main decl ID to the related decls IDs. /// - /// These related decls have to be loaded right after the main decl. - /// It is required to have canonical declaration for related decls from the - /// same module as th

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/123648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: Added release note https://github.com/llvm/llvm-project/pull/123648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-22 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/4] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-23 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/123648 >From e5cd06ddbc4193f9d5910eba93f0eb309d67063c Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Mon, 20 Jan 2025 09:03:25 -0800 Subject: [PATCH 1/7] [C++20][Modules] Fix crash/compiler error due broken AS

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-23 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin closed https://github.com/llvm/llvm-project/pull/123648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Fix crash/compiler error due broken AST links (PR #123648)

2025-01-20 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin created https://github.com/llvm/llvm-project/pull/123648 Summary: This PR fixes bugreport https://github.com/llvm/llvm-project/issues/122493 The root problem is the same as before lambda function and DeclRefExpr references a variable that does not belong to the sa

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-02-14 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @zixu-w and @ChuanqiXu9 Just want to clarify policies about changes reversion. As far as I understand it was one example in some private codebase with no reproducer publicly available. I can understand and completely agree if it breaks any existing test or llvm-build bot. But

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-20 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-03 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin closed https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-25 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/4] [clang] Fix for regression #130917 Changes in #111992

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-25 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/3] [clang] Fix for regression #130917 Changes in #111992

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-25 Thread Dmitry Polukhin via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-25 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/5] [clang] Fix for regression #130917 Changes in #111992

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-28 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/6] [clang] Fix for regression #130917 Changes in #111992

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-27 Thread Dmitry Polukhin via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-02 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 01/10] [clang] Fix for regression #130917 Changes in #11199

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-02 Thread Dmitry Polukhin via cfe-commits
@@ -1392,6 +1392,20 @@ class ASTReader llvm::DenseMap DefinitionSource; + /// The set of extra flags about declarations that we have read from + /// the module file. + struct ExternalDeclarationBits { +/// Indicates if given function declaration was a definition but

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-02 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: > LGTM. > > But I didn't recognize you didn't update `MultiplexExternalSemaSource`. Every > time we add new interface to `ExternalASTSource`, we need to update > `MultiplexExternalSemaSource` too. Oh, thanks for the good catch! Fixed now. https://github.com/llvm/llvm-projec

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-02 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-04 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin commented: PTAL https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-04 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 01/11] [clang] Fix for regression #130917 Changes in #11199

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin created https://github.com/llvm/llvm-project/pull/132214 Changes in #111992 was too broad. This change reduces scope of previous fix. Unfortunately in clang there is no way to know when redeclaration was craeted artificially due to AST mergse and when it was the c

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-26 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-28 Thread Dmitry Polukhin via cfe-commits
@@ -1390,7 +1390,19 @@ class ASTReader /// predefines buffer may contain additional definitions. std::string SuggestedPredefines; - llvm::DenseMap DefinitionSource; + struct DefinitionSourceFlags { dmpolukhin wrote: Done https://github.com/llvm/llvm-pr

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-28 Thread Dmitry Polukhin via cfe-commits
@@ -1390,7 +1390,19 @@ class ASTReader /// predefines buffer may contain additional definitions. std::string SuggestedPredefines; - llvm::DenseMap DefinitionSource; + struct DefinitionSourceFlags { +ExtKind HasExternalDefinitions : 2; + +/// Indicates if given fu

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-28 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/7] [clang] Fix for regression #130917 Changes in #111992

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/132214 >From 91e057bf990e2c454b897982ed0b4e823bb3faba Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Thu, 20 Mar 2025 06:51:46 -0700 Subject: [PATCH 1/9] [clang] Fix for regression #130917 Changes in #111992

[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-04-05 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin edited https://github.com/llvm/llvm-project/pull/132214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4