Skip to content

Commit 19831be

Browse files
authored
Merge pull request #60585 from artemcm/SeparateUpToDateCheck
[Explicit Modules] On an explicit interface build, early exit if expected output is up-to-date.
2 parents bca9004 + 256c0ff commit 19831be

File tree

6 files changed

+183
-119
lines changed

6 files changed

+183
-119
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,10 @@ REMARK(cross_import_added,none,
979979
REMARK(module_loaded,none,
980980
"loaded module at %0",
981981
(StringRef))
982+
983+
REMARK(explicit_interface_build_skipped,none,
984+
"Skipped rebuilding module at %0 - up-to-date",
985+
(StringRef))
982986

983987
WARNING(cannot_find_project_version,none,
984988
"cannot find user version number for %0 module '%1'; version number ignored", (StringRef, StringRef))

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ namespace swift {
215215

216216
/// Emit a remark after loading a module.
217217
bool EnableModuleLoadingRemarks = false;
218+
219+
/// Emit a remark on early exit in explicit interface build
220+
bool EnableSkipExplicitInterfaceModuleBuildRemarks = false;
218221

219222
///
220223
/// Support for alternate usage modes

include/swift/Option/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ def remark_loading_module : Flag<["-"], "Rmodule-loading">,
340340
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
341341
HelpText<"Emit a remark and file path of each loaded module">;
342342

343+
def remark_skip_explicit_interface_build : Flag<["-"], "Rskip-explicit-interface-build">,
344+
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
345+
HelpText<"Emit a remark if an explicit module interface invocation has an early exit because the expected output is up-to-date">;
346+
343347
def emit_tbd : Flag<["-"], "emit-tbd">,
344348
HelpText<"Emit a TBD file">,
345349
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
799799

800800
Opts.EnableModuleLoadingRemarks = Args.hasArg(OPT_remark_loading_module);
801801

802+
Opts.EnableSkipExplicitInterfaceModuleBuildRemarks = Args.hasArg(OPT_remark_skip_explicit_interface_build);
803+
802804
llvm::Triple Target = Opts.Target;
803805
StringRef TargetArg;
804806
std::string TargetArgScratch;

0 commit comments

Comments
 (0)