[Serialization] Remark on transitive dependencies

This commit is contained in:
Alexis Laferrière
2023-03-21 14:13:20 -07:00
parent abe377ce68
commit bf2d2475f3
4 changed files with 18 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
#include "ModuleFormat.h"
#include "swift/Serialization/SerializationOptions.h"
#include "swift/Subsystems.h"
#include "swift/AST/DiagnosticsSema.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/ASTMangler.h"
#include "swift/AST/GenericSignature.h"
@@ -197,6 +198,14 @@ Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc,
ModuleLoadingBehavior transitiveBehavior =
getTransitiveLoadingBehavior(dependency);
if (ctx.LangOpts.EnableModuleLoadingRemarks) {
ctx.Diags.diagnose(diagLoc,
diag::transitive_dependency_behavior,
dependency.Core.getPrettyPrintedPath(),
M->getName(),
unsigned(transitiveBehavior));
}
// Skip this dependency?
if (transitiveBehavior == ModuleLoadingBehavior::Ignored)
continue;