@@ -64,6 +64,7 @@ namespace tooling {
6464namespace dependencies {
6565 struct ModuleDeps ;
6666 struct TranslationUnitDeps ;
67+ enum class ModuleOutputKind ;
6768 using ModuleDepsGraph = std::vector<ModuleDeps>;
6869}
6970}
@@ -209,8 +210,7 @@ class ClangImporter final : public ClangModuleLoader {
209210 bool ignoreClangTarget = false );
210211
211212 std::vector<std::string>
212- getClangDepScanningInvocationArguments (ASTContext &ctx,
213- std::optional<StringRef> sourceFileName = std::nullopt );
213+ getClangDepScanningInvocationArguments (ASTContext &ctx);
214214
215215 static std::unique_ptr<clang::CompilerInvocation>
216216 createClangInvocation (ClangImporter *importer,
@@ -497,54 +497,32 @@ class ClangImporter final : public ClangModuleLoader {
497497 void verifyAllModules () override ;
498498
499499 using RemapPathCallback = llvm::function_ref<std::string(StringRef)>;
500- llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
500+ using LookupModuleOutputCallback =
501+ llvm::function_ref<std::string(const clang::tooling::dependencies::ModuleDeps &,
502+ clang::tooling::dependencies::ModuleOutputKind)>;
503+
504+ static llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
501505 bridgeClangModuleDependencies (
506+ const ASTContext &ctx,
502507 clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
503508 clang::tooling::dependencies::ModuleDepsGraph &clangDependencies,
504509 StringRef moduleOutputPath, StringRef stableModuleOutputPath,
510+ LookupModuleOutputCallback LookupModuleOutput,
505511 RemapPathCallback remapPath = nullptr );
506512
507513 llvm::SmallVector<std::pair<ModuleDependencyID, ModuleDependencyInfo>, 1 >
508514 getModuleDependencies (Identifier moduleName, StringRef moduleOutputPath, StringRef sdkModuleOutputPath,
509515 const llvm::DenseSet<clang::tooling::dependencies::ModuleID> &alreadySeenClangModules,
510- clang::tooling::dependencies::DependencyScanningTool &clangScanningTool ,
516+ const std::vector<std::string> &swiftModuleClangCC1CommandLineArgs ,
511517 InterfaceSubContextDelegate &delegate,
512518 llvm::PrefixMapper *mapper,
513519 bool isTestableImport = false ) override ;
514520
515- void recordBridgingHeaderOptions (
516- ModuleDependencyInfo &MDI,
517- const clang::tooling::dependencies::TranslationUnitDeps &deps);
518-
519- void getBridgingHeaderOptions (
521+ static void getBridgingHeaderOptions (
522+ const ASTContext &ctx,
520523 const clang::tooling::dependencies::TranslationUnitDeps &deps,
521524 std::vector<std::string> &swiftArgs);
522525
523- // / Query dependency information for header dependencies
524- // / of a binary Swift module.
525- // /
526- // / \param moduleID the name of the Swift module whose dependency
527- // / information will be augmented with information about the given
528- // / textual header inputs.
529- // /
530- // / \param headerPath the path to the header to be scanned.
531- // /
532- // / \param clangScanningTool The clang dependency scanner.
533- // /
534- // / \param cache The module dependencies cache to update, with information
535- // / about new Clang modules discovered along the way.
536- // /
537- // / \returns \c true if an error occurred, \c false otherwise
538- bool getHeaderDependencies (
539- ModuleDependencyID moduleID, std::optional<StringRef> headerPath,
540- std::optional<llvm::MemoryBufferRef> sourceBuffer,
541- clang::tooling::dependencies::DependencyScanningTool &clangScanningTool,
542- ModuleDependenciesCache &cache,
543- ModuleDependencyIDSetVector &headerClangModuleDependencies,
544- std::vector<std::string> &headerFileInputs,
545- std::vector<std::string> &bridgingHeaderCommandLine,
546- std::optional<std::string> &includeTreeID);
547-
548526 clang::TargetInfo &getModuleAvailabilityTarget () const override ;
549527 clang::ASTContext &getClangASTContext () const override ;
550528 clang::Preprocessor &getClangPreprocessor () const override ;
0 commit comments