Skip to content

Commit 6f0d137

Browse files
author
Harlan Haskins
committed
[Frontend] Add -Rmodule-interface-rebuild
Passing this will turn on remarks if the module loader needed to fall back and compile a module from an interface.
1 parent 42e1c2f commit 6f0d137

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/swift/Frontend/FrontendOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ class FrontendOptions {
272272
/// times) when compiling a module interface?
273273
bool SerializeModuleInterfaceDependencyHashes = false;
274274

275+
/// Should we warn if an imported module needed to be rebuilt from a
276+
/// module interface file?
277+
bool RemarkOnRebuildFromModuleInterface = false;
278+
275279
/// The different modes for validating TBD against the LLVM IR.
276280
enum class TBDValidationMode {
277281
Default, ///< Do the default validation for the current platform.

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ def warn_long_expression_type_checking : Separate<["-"], "warn-long-expression-t
388388
def warn_long_expression_type_checking_EQ : Joined<["-"], "warn-long-expression-type-checking=">,
389389
Alias<warn_long_expression_type_checking>;
390390

391+
def Rmodule_interface_rebuild : Flag<["-"], "Rmodule-interface-rebuild">,
392+
HelpText<"Emits a remark if an imported module needs to be re-compiled from its module interface">;
393+
391394
def solver_expression_time_threshold_EQ : Joined<["-"], "solver-expression-time-threshold=">;
392395

393396
def solver_disable_shrink :

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ bool ArgsToFrontendOptionsConverter::convert(
8383
Opts.SerializeModuleInterfaceDependencyHashes |=
8484
Args.hasArg(OPT_serialize_module_interface_dependency_hashes);
8585

86+
Opts.RemarkOnRebuildFromModuleInterface |=
87+
Args.hasArg(OPT_Rmodule_interface_rebuild);
88+
8689
computePrintStatsOptions();
8790
computeDebugTimeOptions();
8891
computeTBDOptions();

0 commit comments

Comments
 (0)