[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-24 Thread Wei Wang via cfe-commits
https://github.com/apolloww closed https://github.com/llvm/llvm-project/pull/79182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/79182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: LGTM. Thanks! https://github.com/llvm/llvm-project/pull/79182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
https://github.com/apolloww edited https://github.com/llvm/llvm-project/pull/79182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
apolloww wrote: Thanks. Added test case. https://github.com/llvm/llvm-project/pull/79182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
https://github.com/apolloww updated https://github.com/llvm/llvm-project/pull/79182 >From a542d63f472d799eb2d041c82cac402cfb8dec1a Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 23 Jan 2024 10:01:57 -0800 Subject: [PATCH 1/3] [clang] Make sure the same UsingType is searched and inserted

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Wonder what test should I add here. This only affects the content of the > internal folding set so we always create new types but result is still > correct. One possibility is doing an AST test, there are some examples in there that show how you can test two different AST

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
apolloww wrote: > The change is correct. The problem is subtle though. It comes from the > difference in behavior between the member and non-member Profile functions. > > I think we could do better instead with a change which makes it harder to > trip on this. > > I think a simplification

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
https://github.com/apolloww updated https://github.com/llvm/llvm-project/pull/79182 >From a542d63f472d799eb2d041c82cac402cfb8dec1a Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 23 Jan 2024 10:01:57 -0800 Subject: [PATCH 1/2] [clang] Make sure the same UsingType is searched and inserted

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The change is correct. The problem is subtle though. It comes from the difference in behavior between the member and non-member Profile functions. I think we could do better instead with a change which makes it harder to trip on this. I think a simplification like this should

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
apolloww wrote: We saw a huge build speed regression from internal codebase when migrating to clang-17 triggered by this issue. The search for the same `UsingType` always ends up with "not found" and the folding set `UsingTypes` contains lots of duplicated notes. This is a quick fix I come

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Wei Wang (apolloww) Changes When creating a new UsingType, the underlying type may change if it is a declaration. This creates an inconsistency between the type searched and type created. Move the update before search so that we always

[clang] [clang] Make sure the same UsingType is searched and inserted (PR #79182)

2024-01-23 Thread Wei Wang via cfe-commits
https://github.com/apolloww created https://github.com/llvm/llvm-project/pull/79182 When creating a new UsingType, the underlying type may change if it is a declaration. This creates an inconsistency between the type searched and type created. Move the update before search so that we always