Skip to content

Commit

Permalink
[NFC] [Serialization] Extract logics to write special decls from
Browse files Browse the repository at this point in the history
ASTWriter::WriteASTCore

ASTWriter::WriteASTCore is a big function and slightly hard to read.
This patch extracts the logics to force emitting special declarations
and writing special records for these declarations into member
functions.

This is helpful to improve the readability and also helpful for the
following patch to write special declarations lazily.
  • Loading branch information
ChuanqiXu9 committed Apr 18, 2024
1 parent b5aff11 commit 83cc605
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 152 deletions.
2 changes: 2 additions & 0 deletions clang/include/clang/Serialization/ASTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ class ASTWriter : public ASTDeserializationListener,
void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver &IdResolver,
bool IsModule);
void WriteDeclAndTypes(ASTContext &Context);
void PrepareWritingSpecialDecls(Sema &SemaRef);
void WriteSpecialDeclRecords(Sema &SemaRef);
void WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord);
void WriteDeclContextVisibleUpdate(const DeclContext *DC);
void WriteFPPragmaOptions(const FPOptionsOverride &Opts);
Expand Down

0 comments on commit 83cc605

Please sign in to comment.