@@ -629,8 +629,8 @@ ASTContext *ASTContext::get(
629
629
ClangImporterOptions &ClangImporterOpts,
630
630
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
631
631
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
+ ) {
634
634
// If more than two data structures are concatentated, then the aggregate
635
635
// size math needs to become more complicated due to per-struct alignment
636
636
// constraints.
@@ -644,7 +644,7 @@ ASTContext *ASTContext::get(
644
644
return new (mem)
645
645
ASTContext (langOpts, typecheckOpts, silOpts, SearchPathOpts,
646
646
ClangImporterOpts, SymbolGraphOpts, SourceMgr, Diags,
647
- std::move (OutputBackend), PreModuleImportCallback );
647
+ std::move (OutputBackend));
648
648
}
649
649
650
650
ASTContext::ASTContext (
@@ -653,16 +653,15 @@ ASTContext::ASTContext(
653
653
ClangImporterOptions &ClangImporterOpts,
654
654
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
655
655
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
+ )
658
658
: LangOpts(langOpts), TypeCheckerOpts(typecheckOpts), SILOpts(silOpts),
659
659
SearchPathOpts (SearchPathOpts), ClangImporterOpts(ClangImporterOpts),
660
660
SymbolGraphOpts(SymbolGraphOpts), SourceMgr(SourceMgr), Diags(Diags),
661
661
OutputBackend(std::move(OutBackend)), evaluator(Diags, langOpts),
662
662
TheBuiltinModule(createBuiltinModule(*this )),
663
663
StdlibModuleName(getIdentifier(STDLIB_NAME)),
664
664
SwiftShimsModuleName(getIdentifier(SWIFT_SHIMS_NAME)),
665
- PreModuleImportCallback(PreModuleImportCallback),
666
665
TheErrorType(new (*this , AllocationArena::Permanent) ErrorType(
667
666
*this , Type(), RecursiveTypeProperties::HasError)),
668
667
TheUnresolvedType(new (*this , AllocationArena::Permanent)
@@ -715,6 +714,10 @@ ASTContext::~ASTContext() {
715
714
getImpl ().~Implementation ();
716
715
}
717
716
717
+ void ASTContext::SetPreModuleImportCallback (std::function<bool (llvm::StringRef ModuleName, bool IsOverlay)> callback) {
718
+ ASTContext::PreModuleImportCallback = callback;
719
+ }
720
+
718
721
llvm::BumpPtrAllocator &ASTContext::getAllocator (AllocationArena arena) const {
719
722
switch (arena) {
720
723
case AllocationArena::Permanent:
0 commit comments