Factor out reading in Binary module dependency imports from 'SerializedModuleLoaderBase::scanModuleFile'.

This commit is contained in:
Artem Chikin
2023-04-17 10:05:16 -07:00
parent c1d5118c21
commit 0067c415c4
2 changed files with 60 additions and 29 deletions

View File

@@ -20,6 +20,8 @@
namespace swift {
class ModuleFile;
class PathObfuscator;
enum class ModuleLoadingBehavior;
namespace file_types {
enum ID : uint8_t;
}
@@ -146,6 +148,16 @@ protected:
/// Scan the given serialized module file to determine dependencies.
llvm::ErrorOr<ModuleDependencyInfo> scanModuleFile(Twine modulePath, bool isFramework);
static llvm::ErrorOr<llvm::StringSet<>>
getModuleImportsOfModule(Twine modulePath,
ModuleLoadingBehavior transitiveBehavior,
bool isFramework,
bool isRequiredOSSAModules,
StringRef SDKName,
StringRef packageName,
llvm::vfs::FileSystem *fileSystem,
PathObfuscator &recoverer);
/// Load the module file into a buffer and also collect its module name.
static std::unique_ptr<llvm::MemoryBuffer>
getModuleName(ASTContext &Ctx, StringRef modulePath, std::string &Name);