@@ -65,6 +65,7 @@ namespace tooling {
6565namespace dependencies {
6666 struct ModuleDeps ;
6767 struct TranslationUnitDeps ;
68+ enum class ModuleOutputKind ;
6869 using ModuleDepsGraph = std::vector<ModuleDeps>;
6970}
7071}
@@ -211,8 +212,7 @@ class ClangImporter final : public ClangModuleLoader {
211212 bool ignoreClangTarget = false );
212213
213214 std::vector<std::string>
214- getClangDepScanningInvocationArguments (ASTContext &ctx,
215- std::optional<StringRef> sourceFileName = std::nullopt );
215+ getClangDepScanningInvocationArguments (ASTContext &ctx);
216216
217217 static std::unique_ptr<clang::CompilerInvocation>
218218 createClangInvocation (ClangImporter *importer,
@@ -499,54 +499,32 @@ class ClangImporter final : public ClangModuleLoader {
499499 void verifyAllModules () override ;
500500
501501 using RemapPathCallback = llvm::function_ref<std::string(StringRef)>;
502- llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
502+ using LookupModuleOutputCallback =
503+ llvm::function_ref<std::string(const clang::tooling::dependencies::ModuleDeps &,
504+ clang::tooling::dependencies::ModuleOutputKind)>;
505+
506+ static llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
503507 bridgeClangModuleDependencies (
508+ const ASTContext &ctx,
504509 clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
505510 clang::tooling::dependencies::ModuleDepsGraph &clangDependencies,
506511 StringRef moduleOutputPath, StringRef stableModuleOutputPath,
512+ LookupModuleOutputCallback LookupModuleOutput,
507513 RemapPathCallback remapPath = nullptr );
508514
509515 llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
510516 getModuleDependencies (Identifier moduleName, StringRef moduleOutputPath, StringRef sdkModuleOutputPath,
511517 const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
512- clang::tooling::dependencies::DependencyScanningTool &clangScanningTool ,
518+ const std::vector<std::string> &swiftModuleClangCC1CommandLineArgs ,
513519 InterfaceSubContextDelegate &delegate,
514520 llvm::PrefixMapper *mapper,
515521 bool isTestableImport = false ) override ;
516522
517- void recordBridgingHeaderOptions (
518- ModuleDependencyInfo &MDI,
519- const clang::tooling::dependencies::TranslationUnitDeps &deps);
520-
521- void getBridgingHeaderOptions (
523+ static void getBridgingHeaderOptions (
524+ const ASTContext &ctx,
522525 const clang::tooling::dependencies::TranslationUnitDeps &deps,
523526 std::vector<std::string> &swiftArgs);
524527
525- // / Query dependency information for header dependencies
526- // / of a binary Swift module.
527- // /
528- // / \param moduleID the name of the Swift module whose dependency
529- // / information will be augmented with information about the given
530- // / textual header inputs.
531- // /
532- // / \param headerPath the path to the header to be scanned.
533- // /
534- // / \param clangScanningTool The clang dependency scanner.
535- // /
536- // / \param cache The module dependencies cache to update, with information
537- // / about new Clang modules discovered along the way.
538- // /
539- // / \returns \c true if an error occurred, \c false otherwise
540- bool getHeaderDependencies (
541- ModuleDependencyID moduleID, std::optional<StringRef> headerPath,
542- std::optional<llvm::MemoryBufferRef> sourceBuffer,
543- clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
544- ModuleDependenciesCache &cache,
545- ModuleDependencyIDSetVector &headerClangModuleDependencies,
546- std::vector<std::string> &headerFileInputs,
547- std::vector<std::string> &bridgingHeaderCommandLine,
548- std::optional<std::string> &includeTreeID);
549-
550528 clang::TargetInfo &getModuleAvailabilityTarget () const override ;
551529 clang::ASTContext &getClangASTContext () const override ;
552530 clang::Preprocessor &getClangPreprocessor () const override ;
0 commit comments