@@ -646,8 +646,7 @@ ASTContext *ASTContext::get(
646646 ClangImporterOptions &ClangImporterOpts,
647647 symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
648648 SourceManager &SourceMgr, DiagnosticEngine &Diags,
649- llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutputBackend,
650- std::function<bool (llvm::StringRef, bool )> PreModuleImportCallback) {
649+ llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutputBackend) {
651650 // If more than two data structures are concatentated, then the aggregate
652651 // size math needs to become more complicated due to per-struct alignment
653652 // constraints.
@@ -661,7 +660,7 @@ ASTContext *ASTContext::get(
661660 return new (mem)
662661 ASTContext (langOpts, typecheckOpts, silOpts, SearchPathOpts,
663662 ClangImporterOpts, SymbolGraphOpts, SourceMgr, Diags,
664- std::move (OutputBackend), PreModuleImportCallback );
663+ std::move (OutputBackend));
665664}
666665
667666ASTContext::ASTContext (
@@ -670,16 +669,15 @@ ASTContext::ASTContext(
670669 ClangImporterOptions &ClangImporterOpts,
671670 symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
672671 SourceManager &SourceMgr, DiagnosticEngine &Diags,
673- llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutBackend,
674- std::function< bool (llvm::StringRef, bool )> PreModuleImportCallback )
672+ llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutBackend
673+ )
675674 : LangOpts(langOpts), TypeCheckerOpts(typecheckOpts), SILOpts(silOpts),
676675 SearchPathOpts (SearchPathOpts), ClangImporterOpts(ClangImporterOpts),
677676 SymbolGraphOpts(SymbolGraphOpts), SourceMgr(SourceMgr), Diags(Diags),
678677 OutputBackend(std::move(OutBackend)), evaluator(Diags, langOpts),
679678 TheBuiltinModule(createBuiltinModule(*this )),
680679 StdlibModuleName(getIdentifier(STDLIB_NAME)),
681680 SwiftShimsModuleName(getIdentifier(SWIFT_SHIMS_NAME)),
682- PreModuleImportCallback(PreModuleImportCallback),
683681 TheErrorType(new (*this , AllocationArena::Permanent) ErrorType(
684682 *this , Type(), RecursiveTypeProperties::HasError)),
685683 TheUnresolvedType(new (*this , AllocationArena::Permanent)
@@ -731,6 +729,11 @@ ASTContext::~ASTContext() {
731729 getImpl ().~Implementation ();
732730}
733731
732+ void ASTContext::SetPreModuleImportCallback (
733+ std::function<void (llvm::StringRef ModuleName, bool IsOverlay)> callback) {
734+ PreModuleImportCallback = callback;
735+ }
736+
734737llvm::BumpPtrAllocator &ASTContext::getAllocator (AllocationArena arena) const {
735738 switch (arena) {
736739 case AllocationArena::Permanent:
0 commit comments