mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Emit a warning when failing to load a binary module of a non-resilient dependency
This failure will most-likely result in the dependency query failure which will fail the scan. It will be helpful if the scanner emitted diagnostic for each such module it rejected to explain the reason why. Resolves rdar://142906530
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "swift/AST/ModuleDependencies.h"
|
||||
#include "swift/AST/ModuleLoader.h"
|
||||
#include "swift/AST/SearchPathOptions.h"
|
||||
#include "swift/Serialization/Validation.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/PrefixMapper.h"
|
||||
#include "llvm/TargetParser/Triple.h"
|
||||
@@ -165,7 +166,8 @@ protected:
|
||||
|
||||
/// Scan the given serialized module file to determine dependencies.
|
||||
llvm::ErrorOr<ModuleDependencyInfo>
|
||||
scanModuleFile(Twine modulePath, bool isFramework, bool isTestableImport);
|
||||
scanModuleFile(Twine modulePath, bool isFramework,
|
||||
bool isTestableImport, bool isCandidateForTextualModule);
|
||||
|
||||
struct BinaryModuleImports {
|
||||
llvm::StringSet<> moduleImports;
|
||||
@@ -267,6 +269,10 @@ public:
|
||||
InterfaceSubContextDelegate &delegate,
|
||||
llvm::PrefixMapper *mapper,
|
||||
bool isTestableImport) override;
|
||||
|
||||
/// A textual reason why the compiler rejected a binary module load
|
||||
/// attempt with a given status, to be used for diagnostic output.
|
||||
static std::optional<std::string> invalidModuleReason(serialization::Status status);
|
||||
};
|
||||
|
||||
/// Imports serialized Swift modules into an ASTContext.
|
||||
|
||||
Reference in New Issue
Block a user