@@ -629,8 +629,8 @@ ASTContext *ASTContext::get(
629629 ClangImporterOptions &ClangImporterOpts,
630630 symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
631631 SourceManager &SourceMgr, DiagnosticEngine &Diags,
632- llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutputBackend,
633- std::function< bool (llvm::StringRef, bool )> PreModuleImportCallback ) {
632+ llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutputBackend
633+ ) {
634634 // If more than two data structures are concatentated, then the aggregate
635635 // size math needs to become more complicated due to per-struct alignment
636636 // constraints.
@@ -644,7 +644,7 @@ ASTContext *ASTContext::get(
644644 return new (mem)
645645 ASTContext (langOpts, typecheckOpts, silOpts, SearchPathOpts,
646646 ClangImporterOpts, SymbolGraphOpts, SourceMgr, Diags,
647- std::move (OutputBackend), PreModuleImportCallback );
647+ std::move (OutputBackend));
648648}
649649
650650ASTContext::ASTContext (
@@ -653,16 +653,15 @@ ASTContext::ASTContext(
653653 ClangImporterOptions &ClangImporterOpts,
654654 symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
655655 SourceManager &SourceMgr, DiagnosticEngine &Diags,
656- llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutBackend,
657- std::function< bool (llvm::StringRef, bool )> PreModuleImportCallback )
656+ llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutBackend
657+ )
658658 : LangOpts(langOpts), TypeCheckerOpts(typecheckOpts), SILOpts(silOpts),
659659 SearchPathOpts (SearchPathOpts), ClangImporterOpts(ClangImporterOpts),
660660 SymbolGraphOpts(SymbolGraphOpts), SourceMgr(SourceMgr), Diags(Diags),
661661 OutputBackend(std::move(OutBackend)), evaluator(Diags, langOpts),
662662 TheBuiltinModule(createBuiltinModule(*this )),
663663 StdlibModuleName(getIdentifier(STDLIB_NAME)),
664664 SwiftShimsModuleName(getIdentifier(SWIFT_SHIMS_NAME)),
665- PreModuleImportCallback(PreModuleImportCallback),
666665 TheErrorType(new (*this , AllocationArena::Permanent) ErrorType(
667666 *this , Type(), RecursiveTypeProperties::HasError)),
668667 TheUnresolvedType(new (*this , AllocationArena::Permanent)
@@ -715,6 +714,10 @@ ASTContext::~ASTContext() {
715714 getImpl ().~Implementation ();
716715}
717716
717+ void ASTContext::SetPreModuleImportCallback (std::function<bool (llvm::StringRef ModuleName, bool IsOverlay)> callback) {
718+ ASTContext::PreModuleImportCallback = callback;
719+ }
720+
718721llvm::BumpPtrAllocator &ASTContext::getAllocator (AllocationArena arena) const {
719722 switch (arena) {
720723 case AllocationArena::Permanent:
0 commit comments