[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,364 @@ +//===--- PrerequisiteModulesTests.cpp ---*- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,364 @@ +//===--- PrerequisiteModulesTests.cpp ---*- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -213,10 +213,10 @@ ClangdServer::Options::operator TUScheduler::Options() const { ClangdServer::ClangdServer(const GlobalCompilationDatabase , const ThreadsafeFS , const Options , - Callbacks *Callbacks) +

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,26 @@ +//=== ScanningProjectModules.h ---*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -710,6 +710,7 @@ class ASTWorker { TUScheduler::ASTCache TUScheduler::HeaderIncluderCache const bool RunSync; + ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,81 @@ +//=== ModuleDependencyScanner.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -27,6 +27,9 @@ #include "Diagnostics.h" #include "FS.h" #include "Headers.h" + ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, maybe I was misreading. It looks doable if we only want to avoid DirectoryBasedGlobalCompilationDatabase. Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,347 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-14 Thread Chuanqi Xu via cfe-commits
@@ -112,6 +114,9 @@ class ClangdServer { /// This throttler controls which preambles may be built at a given time. clangd::PreambleThrottler *PreambleThrottler = nullptr; +/// Enable experimental support for modules. ChuanqiXu9 wrote: I add

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-13 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I sent https://github.com/llvm/llvm-project/pull/95506. It is a independent patch which may mitigate the issue you met. @alexfh you can try this when you have time. https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits

[clang] [Serialization] Don't read all declaration id eagerly when merge the tables (PR #95506)

2024-06-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/95506 See the post commit message in https://github.com/llvm/llvm-project/pull/92083 for rationale. Previously, when we merge the lookup tables, we will read the tables completely to get the data. But the above

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-13 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks for the profiling data. It narrows the scope a lot. But it makes me confusing too. Since the scope is pretty narrow, we can do an analysis here:

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-13 Thread Chuanqi Xu via cfe-commits
@@ -318,6 +318,9 @@ namespace { if (Diags.hasUnrecoverableErrorOccurred()) return; + if (RD->shouldEmitInExternalSource()) ChuanqiXu9 wrote: Done. I don't mind doing it really. But what I confuse is, it looks there are a lot of codes in

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/7] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-13 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > The 10x increase in the time spent reading modules does look surprising and I > would need to check if it's related to PCMs becoming larger or is localized > to that particular compile. (Even if on a single example). It should not related to the size of the PCMs otherwise

[clang] [Serialization] Use 32 bit aligned decl id instead of unaligned decl id (PR #95348)

2024-06-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @alexfh Could you try to test this? And if this doesn't mitigate it, it will be helpful to provide the hotspot. https://github.com/llvm/llvm-project/pull/95348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I sent https://github.com/llvm/llvm-project/pull/95348 for aligned related change. For size increase, the reason and the possible solution are clear. We should store the declaration ID as two slots instead of one in the serialized format so that we can utilize VBR6 format

[clang] [Serialization] Use 32 bit aligned decl id instead of unaligned decl id (PR #95348)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/95348 See the post commit message in https://github.com/llvm/llvm-project/pull/92083. I suspect the compile time regression in AArch64 is related to alignments. I am not sure if this is the problem since I can't

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
@@ -318,6 +318,9 @@ namespace { if (Diags.hasUnrecoverableErrorOccurred()) return; + if (RD->shouldEmitInExternalSource()) ChuanqiXu9 wrote: Yes, I think it is not bad to put the check `RD->shouldEmitInExternalSource()` into

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
@@ -318,6 +318,9 @@ namespace { if (Diags.hasUnrecoverableErrorOccurred()) return; + if (RD->shouldEmitInExternalSource()) ChuanqiXu9 wrote: I use `isInCurrentModuleUnit` instead since I feel the semantics are more clear.

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/6] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, the time regression is surprising to me. And I observed that @alexfh only reports (compile performance) problems on AArch64 but @bgra8 reports (size increase problems) on both ARM64 and X86_64. @alexfh is it true? So I **guess** the problem may come from the unaligned

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/95202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +//

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
@@ -1227,7 +1241,8 @@ void CodeGenModule::EmitDeferredVTables() { #endif for (const CXXRecordDecl *RD : DeferredVTables) -if (shouldEmitVTableAtEndOfTranslationUnit(*this, RD)) +if (shouldEmitVTableAtEndOfTranslationUnit(*this, RD) && +

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/5] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I feel better to have a regression test for this if possible. I am just worrying someone someday meet the problem unconsciously. https://github.com/llvm/llvm-project/pull/95202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > It still fixes the original bug report though. Yeah, this is why it is good. > > Otherwise adding a test which directly tests all observable effects of the > profiling fix would be a bit arbitrary, as we don't have any unit tests for > the gazillion ways this could go

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/95202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
@@ -1770,6 +1770,10 @@ class ASTContext : public RefCountedBase { QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent)

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Oh, thanks. This looks generally good. And it looks like true that I abused the Profile components. Since this commit aimed to fix a regression, it will be better to have a regression test. WDYT? https://github.com/llvm/llvm-project/pull/95202

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, this is surprising. Are arm CPUs 32 bit? And how much do these tests get slowed down? https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-11 Thread Chuanqi Xu via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables , if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; ChuanqiXu9 wrote: Yes and agreed. I just don't have an idea for how do that.

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-11 Thread Chuanqi Xu via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +//

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-11 Thread Chuanqi Xu via cfe-commits
@@ -3219,7 +3219,8 @@ void CodeGenModule::EmitVTablesOpportunistically() { for (const CXXRecordDecl *RD : OpportunisticVTables) { assert(getVTables().isVTableExternal(RD) && "This queue should only contain external vtables"); -if

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/4] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [Serialization] No transitive identifier change (PR #92085)

2024-06-10 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @jansvoboda11 ping~ I hope we can land the series of the patches in 2 weeks to give more baking times for them https://github.com/llvm/llvm-project/pull/92085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

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

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks for testing. I've resent https://github.com/llvm/llvm-project/commit/5a0181f568e56e37df80d0f74eca4775776fa8cd. https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 5a0181f - [serialization] no transitive decl change (#92083)

2024-06-07 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-07T20:21:55+08:00 New Revision: 5a0181f568e56e37df80d0f74eca4775776fa8cd URL: https://github.com/llvm/llvm-project/commit/5a0181f568e56e37df80d0f74eca4775776fa8cd DIFF: https://github.com/llvm/llvm-project/commit/5a0181f568e56e37df80d0f74eca4775776fa8cd.diff

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

2024-06-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thank you very much! https://github.com/llvm/llvm-project/pull/94603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Chuanqi Xu via cfe-commits
@@ -2439,6 +2440,12 @@ void ASTWriter::WritePreprocessor(const Preprocessor , bool IsModule) { Record.clear(); } + // Write the safe buffer opt-out region map in PP + for (SourceLocation : PP.serializeSafeBufferOptOutMap()) +AddSourceLocation(std::move(S),

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Serialization changes look good to me. I'll leave the formal approve chance to others. https://github.com/llvm/llvm-project/pull/92031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/92031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodule-name=safe_buffers_test_base -x c++ %S/Inputs/SafeBuffers/safe_buffers_test.modulemap -std=c++20\ +// RUN: -o %t/safe_buffers_test_base.pcm -Wunsafe-buffer-usage

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables , if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; ChuanqiXu9 wrote: Got it. If it is primarily for optimizations, I guess it

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @DavidSpickett oh, sorry. I didn't expect the refined patch will break 32 bit again. Can you try the new patch? https://github.com/llvm/llvm-project/pull/94603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Sadly it looks like the (refined) patch still breaks the alignment on 32 bit machine. https://lab.llvm.org/buildbot/#/builders/174/builds/34307 I've reverted the patch and updated https://github.com/llvm/llvm-project/pull/94603 to test it again.

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

2024-06-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/94603 >From 264041a5819f7842ad5883e76b74de64615ddea1 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 6 Jun 2024 11:51:05 +0800 Subject: [PATCH 1/2] [serialization] no transitive decl change (#92083) Following

[clang] 4f70c5e - Revert "[serialization] no transitive decl change (#92083)"

2024-06-06 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-07T11:29:09+08:00 New Revision: 4f70c5ec4a57e84642fa0772536f120cd9c75edb URL: https://github.com/llvm/llvm-project/commit/4f70c5ec4a57e84642fa0772536f120cd9c75edb DIFF: https://github.com/llvm/llvm-project/commit/4f70c5ec4a57e84642fa0772536f120cd9c75edb.diff

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables , if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; ChuanqiXu9 wrote: > This check seems like it's at the wrong level; if we don't

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/3] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Resent https://github.com/llvm/llvm-project/commit/5c104879c1a98eeb845c03e7c45206bd48e88f0c Thanks for testing it ! https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 5c10487 - [serialization] no transitive decl change (#92083)

2024-06-06 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-07T10:47:53+08:00 New Revision: 5c104879c1a98eeb845c03e7c45206bd48e88f0c URL: https://github.com/llvm/llvm-project/commit/5c104879c1a98eeb845c03e7c45206bd48e88f0c DIFF: https://github.com/llvm/llvm-project/commit/5c104879c1a98eeb845c03e7c45206bd48e88f0c.diff

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -1185,6 +1190,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables , if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; ChuanqiXu9 wrote: > Also, even if the vtable is getting emitted somewhere

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +//

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks! https://github.com/llvm/llvm-project/pull/94603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > I didn't recognize we may still have 32-bit machines > > I think 32 bit Arm are the last. > > > I'll revert it again. > > Sure, if you post the PR I can test the fix too. I know getting 32 bit > machines can be tricky. I sent

[clang] Testing32 bit for https://github.com/llvm/llvm-project/pull/92083 (PR #94603)

2024-06-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/94603 https://github.com/llvm/llvm-project/pull/92083 is failed on 32bit machine but it is not easy to get a 32 bit machine. And thanks for @DavidSpickett would love to test this. I tried to review the code and I

[clang] e285818 - Revert "[serialization] no transitive decl change (#92083)"

2024-06-06 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-06T17:49:59+08:00 New Revision: e2858189bd99e6914dc2f63ab55b053a74b4e58b URL: https://github.com/llvm/llvm-project/commit/e2858189bd99e6914dc2f63ab55b053a74b4e58b DIFF: https://github.com/llvm/llvm-project/commit/e2858189bd99e6914dc2f63ab55b053a74b4e58b.diff

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Just a note, I am building on Windows with MSVC cl.exe and ninja and get this: > > ``` > C:\Program Files\Microsoft Visual > Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(3138): error > C2027: use of undefined type 'clang::clangd::ProjectModules' > ``` >

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I think that needs to happen eventually as well Agreed. > similar to preambles supporting in-memory storage, and it's actually not that > hard, GenerateModuleInterfaceAction already has an overrideable > CreateOutputFile method. I am

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,87 @@ +//===- PrerequisiteModules.h -*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,115 @@ +//===- ModulesBuilder.h --*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,370 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,115 @@ +//===- ModulesBuilder.h --*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -208,15 +208,16 @@ ClangdServer::Options::operator TUScheduler::Options() const { Opts.UpdateDebounce = UpdateDebounce; Opts.ContextProvider = ContextProvider; Opts.PreambleThrottler = PreambleThrottler; + Opts.ExperimentalModulesSupport =

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -44,6 +44,8 @@ struct ParseOptions { bool ImportInsertions = false; }; +class ModulesBuilder; ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -192,8 +192,10 @@ TEST(PreamblePatchTest, PatchesPreambleIncludes) { TU.AdditionalFiles["b.h"] = ""; TU.AdditionalFiles["c.h"] = ""; auto PI = TU.inputs(FS); - auto BaselinePreamble = buildPreamble( - TU.Filename, *buildCompilerInvocation(PI, Diags), PI, true,

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -149,9 +154,13 @@ struct PreambleBuildStats { /// If \p PreambleCallback is set, it will be run on top of the AST while /// building the preamble. /// If Stats is not non-null, build statistics will be exported there. +/// If \p RequiredModuleBuilder is not null, it will

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,339 @@ +//===- ModulesBuilder.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -42,6 +42,8 @@ namespace clang { namespace clangd { + +class ModulesBuilder; ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -222,6 +222,9 @@ class TUScheduler { /// Cache (large) preamble data in RAM rather than temporary files on disk. bool StorePreamblesInMemory = false; +/// Enable experimental support for modules. +bool ExperimentalModulesSupport = false;

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -740,6 +741,21 @@ DirectoryBasedGlobalCompilationDatabase::getProjectInfo(PathRef File) const { return Res->PI; } +std::shared_ptr +DirectoryBasedGlobalCompilationDatabase::getProjectModules(PathRef File) const { + CDBLookupRequest Req; + Req.FileName = File; +

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,81 @@ +//=== ModuleDependencyScanner.cpp *- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -1185,6 +1190,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
@@ -3239,6 +3239,12 @@ bool ASTReader::isConsumerInterestedIn(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) return true; + // The dynamic class defined in a named module is interesting. + // The code generator needs to emit its

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/2] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I've fixed the lldb failure and resent https://github.com/llvm/llvm-project/commit/97c866f6c86456b3316006e6beff47e68a81c00a. https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 97c866f - [serialization] no transitive decl change (#92083)

2024-06-05 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-06T11:51:05+08:00 New Revision: 97c866f6c86456b3316006e6beff47e68a81c00a URL: https://github.com/llvm/llvm-project/commit/97c866f6c86456b3316006e6beff47e68a81c00a DIFF: https://github.com/llvm/llvm-project/commit/97c866f6c86456b3316006e6beff47e68a81c00a.diff

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Maybe you can run individual tests with lit but generally I use `lldb-dotest` > instead: > > ``` > ./bin/lldb-dotest.py -p TestTemplateWithSameArg.py > ``` > > (you only need the filename) Thanks. Reproduced. But it surprised me that I can't run the commands you

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-04 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Unfortunately this is still failing one test on the LLDB macOS CI: > https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/5083/execution/node/97/log > > ``` > == > FAIL:

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread Chuanqi Xu via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From cf8be3c418dde67b74d4a5a4ea98a33f0e2fbd72 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] 99873b3 - [NFC] [AST] Introduce Decl::isInAnotherModuleUnit and Decl::shouldEmitInExternalSource

2024-06-04 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-04T17:08:21+08:00 New Revision: 99873b35da7ecb905143c8a6b8deca4d4416f1a9 URL: https://github.com/llvm/llvm-project/commit/99873b35da7ecb905143c8a6b8deca4d4416f1a9 DIFF: https://github.com/llvm/llvm-project/commit/99873b35da7ecb905143c8a6b8deca4d4416f1a9.diff

[clang] cb60667 - Revert "[serialization] no transitive decl change (#92083)"

2024-06-04 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-06-04T16:10:38+08:00 New Revision: cb60667b6e762aa172b6ad06332465d69f0fd803 URL: https://github.com/llvm/llvm-project/commit/cb60667b6e762aa172b6ad06332465d69f0fd803 DIFF: https://github.com/llvm/llvm-project/commit/cb60667b6e762aa172b6ad06332465d69f0fd803.diff

<    1   2   3   4   5   6   7   8   9   10   >