aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-07-10 10:46:23 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-07-10 10:58:18 +0800
commit91d40ef6e369a73b0147d9153a95c3bc63e14102 (patch)
tree5b2d00e9ca9c76c394a9d7d46dd9c84abad2d356 /clang/lib/Serialization/ASTWriter.cpp
parent9af1f8fbad6c8c38e7e3d6c1cfe7e4b2519db3d8 (diff)
downloadllvm-91d40ef6e369a73b0147d9153a95c3bc63e14102.zip
llvm-91d40ef6e369a73b0147d9153a95c3bc63e14102.tar.gz
llvm-91d40ef6e369a73b0147d9153a95c3bc63e14102.tar.bz2
Revert "[C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (#75912)"
This reverts commit 18f3bcbb13ca83d33223b00761d8cddf463e9ffb, 15bb02650e26875c48889053d6a9697444583721 and 99873b35da7ecb905143c8a6b8deca4d4416f1a9. See the post commit message in https://github.com/llvm/llvm-project/pull/75912 to see the reasons.
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index c88fb002..5b5b468 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -927,7 +927,6 @@ void ASTWriter::WriteBlockInfoBlock() {
RECORD(DECLS_TO_CHECK_FOR_DEFERRED_DIAGS);
RECORD(PP_ASSUME_NONNULL_LOC);
RECORD(PP_UNSAFE_BUFFER_USAGE);
- RECORD(VTABLES_TO_EMIT);
// SourceManager Block.
BLOCK(SOURCE_MANAGER_BLOCK);
@@ -3962,10 +3961,6 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP,
Stream.EmitRecord(INTERESTING_IDENTIFIERS, InterestingIdents);
}
-void ASTWriter::handleVTable(CXXRecordDecl *RD) {
- PendingEmittingVTables.push_back(RD);
-}
-
//===----------------------------------------------------------------------===//
// DeclContext's Name Lookup Table Serialization
//===----------------------------------------------------------------------===//
@@ -5168,13 +5163,6 @@ void ASTWriter::PrepareWritingSpecialDecls(Sema &SemaRef) {
// Write all of the DeclsToCheckForDeferredDiags.
for (auto *D : SemaRef.DeclsToCheckForDeferredDiags)
GetDeclRef(D);
-
- // Write all classes need to emit the vtable definitions if required.
- if (isWritingStdCXXNamedModules())
- for (CXXRecordDecl *RD : PendingEmittingVTables)
- GetDeclRef(RD);
- else
- PendingEmittingVTables.clear();
}
void ASTWriter::WriteSpecialDeclRecords(Sema &SemaRef) {
@@ -5329,17 +5317,6 @@ void ASTWriter::WriteSpecialDeclRecords(Sema &SemaRef) {
}
if (!DeleteExprsToAnalyze.empty())
Stream.EmitRecord(DELETE_EXPRS_TO_ANALYZE, DeleteExprsToAnalyze);
-
- RecordData VTablesToEmit;
- for (CXXRecordDecl *RD : PendingEmittingVTables) {
- if (!wasDeclEmitted(RD))
- continue;
-
- AddDeclRef(RD, VTablesToEmit);
- }
-
- if (!VTablesToEmit.empty())
- Stream.EmitRecord(VTABLES_TO_EMIT, VTablesToEmit);
}
ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
@@ -6587,12 +6564,10 @@ void ASTRecordWriter::AddCXXDefinitionData(const CXXRecordDecl *D) {
// computed.
Record->push_back(D->getODRHash());
- bool ModulesCodegen =
- !D->isDependentType() &&
- (Writer->Context->getLangOpts().ModulesDebugInfo ||
- D->isInNamedModule());
- Record->push_back(ModulesCodegen);
- if (ModulesCodegen)
+ bool ModulesDebugInfo =
+ Writer->Context->getLangOpts().ModulesDebugInfo && !D->isDependentType();
+ Record->push_back(ModulesDebugInfo);
+ if (ModulesDebugInfo)
Writer->AddDeclRef(D, Writer->ModularCodegenDecls);
// IsLambda bit is already saved.