@@ -646,8 +646,7 @@ ASTContext *ASTContext::get(
646
646
ClangImporterOptions &ClangImporterOpts,
647
647
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
648
648
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) {
651
650
// If more than two data structures are concatentated, then the aggregate
652
651
// size math needs to become more complicated due to per-struct alignment
653
652
// constraints.
@@ -661,7 +660,7 @@ ASTContext *ASTContext::get(
661
660
return new (mem)
662
661
ASTContext (langOpts, typecheckOpts, silOpts, SearchPathOpts,
663
662
ClangImporterOpts, SymbolGraphOpts, SourceMgr, Diags,
664
- std::move (OutputBackend), PreModuleImportCallback );
663
+ std::move (OutputBackend));
665
664
}
666
665
667
666
ASTContext::ASTContext (
@@ -670,16 +669,15 @@ ASTContext::ASTContext(
670
669
ClangImporterOptions &ClangImporterOpts,
671
670
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
672
671
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
+ )
675
674
: LangOpts(langOpts), TypeCheckerOpts(typecheckOpts), SILOpts(silOpts),
676
675
SearchPathOpts (SearchPathOpts), ClangImporterOpts(ClangImporterOpts),
677
676
SymbolGraphOpts(SymbolGraphOpts), SourceMgr(SourceMgr), Diags(Diags),
678
677
OutputBackend(std::move(OutBackend)), evaluator(Diags, langOpts),
679
678
TheBuiltinModule(createBuiltinModule(*this )),
680
679
StdlibModuleName(getIdentifier(STDLIB_NAME)),
681
680
SwiftShimsModuleName(getIdentifier(SWIFT_SHIMS_NAME)),
682
- PreModuleImportCallback(PreModuleImportCallback),
683
681
TheErrorType(new (*this , AllocationArena::Permanent) ErrorType(
684
682
*this , Type(), RecursiveTypeProperties::HasError)),
685
683
TheUnresolvedType(new (*this , AllocationArena::Permanent)
@@ -731,6 +729,11 @@ ASTContext::~ASTContext() {
731
729
getImpl ().~Implementation ();
732
730
}
733
731
732
+ void ASTContext::SetPreModuleImportCallback (
733
+ std::function<void (llvm::StringRef ModuleName, bool IsOverlay)> callback) {
734
+ PreModuleImportCallback = callback;
735
+ }
736
+
734
737
llvm::BumpPtrAllocator &ASTContext::getAllocator (AllocationArena arena) const {
735
738
switch (arena) {
736
739
case AllocationArena::Permanent:
0 commit comments