@@ -119,9 +119,6 @@ class ASTWriter : public ASTDeserializationListener,
119
119
// / The PCM manager which manages memory buffers for pcm files.
120
120
InMemoryModuleCache &ModuleCache;
121
121
122
- // / The ASTContext we're writing.
123
- ASTContext *Context = nullptr ;
124
-
125
122
// / The preprocessor we're writing.
126
123
Preprocessor *PP = nullptr ;
127
124
@@ -545,7 +542,7 @@ class ASTWriter : public ASTDeserializationListener,
545
542
unsigned getSubmoduleID (Module *Mod);
546
543
547
544
// / Write the given subexpression to the bitstream.
548
- void WriteSubStmt (Stmt *S);
545
+ void WriteSubStmt (ASTContext &Context, Stmt *S);
549
546
550
547
void WriteBlockInfoBlock ();
551
548
void WriteControlBlock (Preprocessor &PP, StringRef isysroot);
@@ -564,34 +561,36 @@ class ASTWriter : public ASTDeserializationListener,
564
561
void WriteHeaderSearch (const HeaderSearch &HS);
565
562
void WritePreprocessorDetail (PreprocessingRecord &PPRec,
566
563
uint64_t MacroOffsetsBase);
567
- void WriteSubmodules (Module *WritingModule);
564
+ void WriteSubmodules (Module *WritingModule, ASTContext &Context );
568
565
569
566
void WritePragmaDiagnosticMappings (const DiagnosticsEngine &Diag,
570
567
bool isModule);
571
568
572
569
unsigned TypeExtQualAbbrev = 0 ;
573
570
void WriteTypeAbbrevs ();
574
- void WriteType (QualType T);
571
+ void WriteType (ASTContext &Context, QualType T);
575
572
576
573
bool isLookupResultExternal (StoredDeclsList &Result, DeclContext *DC);
577
574
578
- void GenerateNameLookupTable (const DeclContext *DC,
575
+ void GenerateNameLookupTable (ASTContext &Context, const DeclContext *DC,
579
576
llvm::SmallVectorImpl<char > &LookupTable);
580
577
uint64_t WriteDeclContextLexicalBlock (ASTContext &Context,
581
578
const DeclContext *DC);
582
579
uint64_t WriteDeclContextVisibleBlock (ASTContext &Context, DeclContext *DC);
583
580
void WriteTypeDeclOffsets ();
584
581
void WriteFileDeclIDsMap ();
585
- void WriteComments ();
582
+ void WriteComments (ASTContext &Context );
586
583
void WriteSelectors (Sema &SemaRef);
587
584
void WriteReferencedSelectorsPool (Sema &SemaRef);
588
585
void WriteIdentifierTable (Preprocessor &PP, IdentifierResolver &IdResolver,
589
586
bool IsModule);
590
587
void WriteDeclAndTypes (ASTContext &Context);
591
588
void PrepareWritingSpecialDecls (Sema &SemaRef);
592
589
void WriteSpecialDeclRecords (Sema &SemaRef);
593
- void WriteDeclUpdatesBlocks (RecordDataImpl &OffsetsRecord);
594
- void WriteDeclContextVisibleUpdate (const DeclContext *DC);
590
+ void WriteDeclUpdatesBlocks (ASTContext &Context,
591
+ RecordDataImpl &OffsetsRecord);
592
+ void WriteDeclContextVisibleUpdate (ASTContext &Context,
593
+ const DeclContext *DC);
595
594
void WriteFPPragmaOptions (const FPOptionsOverride &Opts);
596
595
void WriteOpenCLExtensions (Sema &SemaRef);
597
596
void WriteCUDAPragmas (Sema &SemaRef);
@@ -653,11 +652,6 @@ class ASTWriter : public ASTDeserializationListener,
653
652
bool GeneratingReducedBMI = false );
654
653
~ASTWriter () override ;
655
654
656
- ASTContext &getASTContext () const {
657
- assert (Context && " requested AST context when not writing AST" );
658
- return *Context;
659
- }
660
-
661
655
const LangOptions &getLangOpts () const ;
662
656
663
657
// / Get a timestamp for output into the AST file. The actual timestamp
@@ -723,10 +717,10 @@ class ASTWriter : public ASTDeserializationListener,
723
717
uint32_t getMacroDirectivesOffset (const IdentifierInfo *Name);
724
718
725
719
// / Emit a reference to a type.
726
- void AddTypeRef (QualType T, RecordDataImpl &Record);
720
+ void AddTypeRef (ASTContext &Context, QualType T, RecordDataImpl &Record);
727
721
728
722
// / Force a type to be emitted and get its ID.
729
- serialization::TypeID GetOrCreateTypeID (QualType T);
723
+ serialization::TypeID GetOrCreateTypeID (ASTContext &Context, QualType T);
730
724
731
725
// / Find the first local declaration of a given local redeclarable
732
726
// / decl.
0 commit comments