mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #24424 from harlanhaskins/an-absolutely-remarkable-thing
[ModuleInterface] Emit remarks when rebuilding from an interface
This commit is contained in:
@@ -18,8 +18,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !(defined(DIAG) || (defined(ERROR) && defined(WARNING) && defined(NOTE)))
|
||||
# error Must define either DIAG or the set {ERROR,WARNING,NOTE}
|
||||
#if !(defined(DIAG) || (defined(ERROR) && defined(WARNING) && defined(NOTE) && \
|
||||
defined(REMARK)))
|
||||
# error Must define either DIAG or the set {ERROR,WARNING,NOTE,REMARK}
|
||||
#endif
|
||||
|
||||
#ifndef ERROR
|
||||
@@ -37,6 +38,11 @@
|
||||
DIAG(NOTE,ID,Options,Text,Signature)
|
||||
#endif
|
||||
|
||||
#ifndef REMARK
|
||||
# define REMARK(ID,Options,Text,Signature) \
|
||||
DIAG(REMARK,ID,Options,Text,Signature)
|
||||
#endif
|
||||
|
||||
WARNING(warning_no_such_sdk,none,
|
||||
"no such SDK: '%0'", (StringRef))
|
||||
|
||||
@@ -278,6 +284,20 @@ ERROR(error_extracting_flags_from_module_interface,none,
|
||||
ERROR(missing_dependency_of_module_interface,none,
|
||||
"missing dependency '%0' of module interface '%1': %2",
|
||||
(StringRef, StringRef, StringRef))
|
||||
REMARK(rebuilding_module_from_interface,none,
|
||||
"rebuilding module '%0' from interface '%1'", (StringRef, StringRef))
|
||||
NOTE(out_of_date_module_here,none,
|
||||
"%select{compiled|cached|forwarding|prebuilt}0 module is out of date: '%1'",
|
||||
(unsigned, StringRef))
|
||||
NOTE(module_interface_dependency_out_of_date,none,
|
||||
"dependency is out of date: '%0'",
|
||||
(StringRef))
|
||||
NOTE(compiled_module_invalid,none,
|
||||
"unable to load compiled module '%0'",
|
||||
(StringRef))
|
||||
NOTE(compiled_module_invalid_reason,none,
|
||||
"unable to load compiled module '%0': %1",
|
||||
(StringRef, StringRef))
|
||||
ERROR(error_extracting_dependencies_from_cached_module,none,
|
||||
"error extracting dependencies from cached module '%0'",
|
||||
(StringRef))
|
||||
@@ -289,6 +309,7 @@ ERROR(unknown_forced_module_loading_mode,none,
|
||||
# if defined(DIAG)
|
||||
# undef DIAG
|
||||
# endif
|
||||
# undef REMARK
|
||||
# undef NOTE
|
||||
# undef WARNING
|
||||
# undef ERROR
|
||||
|
||||
@@ -272,6 +272,10 @@ public:
|
||||
/// times) when compiling a module interface?
|
||||
bool SerializeModuleInterfaceDependencyHashes = false;
|
||||
|
||||
/// Should we warn if an imported module needed to be rebuilt from a
|
||||
/// module interface file?
|
||||
bool RemarkOnRebuildFromModuleInterface = false;
|
||||
|
||||
/// The different modes for validating TBD against the LLVM IR.
|
||||
enum class TBDValidationMode {
|
||||
Default, ///< Do the default validation for the current platform.
|
||||
|
||||
@@ -122,16 +122,18 @@ namespace swift {
|
||||
/// directory, and loading the serialized .swiftmodules from there.
|
||||
class ParseableInterfaceModuleLoader : public SerializedModuleLoaderBase {
|
||||
friend class unittest::ParseableInterfaceModuleLoaderTest;
|
||||
explicit ParseableInterfaceModuleLoader(ASTContext &ctx, StringRef cacheDir,
|
||||
StringRef prebuiltCacheDir,
|
||||
DependencyTracker *tracker,
|
||||
ModuleLoadingMode loadMode)
|
||||
explicit ParseableInterfaceModuleLoader(
|
||||
ASTContext &ctx, StringRef cacheDir, StringRef prebuiltCacheDir,
|
||||
DependencyTracker *tracker, ModuleLoadingMode loadMode,
|
||||
bool RemarkOnRebuildFromInterface)
|
||||
: SerializedModuleLoaderBase(ctx, tracker, loadMode),
|
||||
CacheDir(cacheDir), PrebuiltCacheDir(prebuiltCacheDir)
|
||||
CacheDir(cacheDir), PrebuiltCacheDir(prebuiltCacheDir),
|
||||
RemarkOnRebuildFromInterface(RemarkOnRebuildFromInterface)
|
||||
{}
|
||||
|
||||
std::string CacheDir;
|
||||
std::string PrebuiltCacheDir;
|
||||
bool RemarkOnRebuildFromInterface;
|
||||
|
||||
std::error_code findModuleFilesInDirectory(
|
||||
AccessPathElem ModuleID, StringRef DirPath, StringRef ModuleFilename,
|
||||
@@ -144,10 +146,12 @@ class ParseableInterfaceModuleLoader : public SerializedModuleLoaderBase {
|
||||
public:
|
||||
static std::unique_ptr<ParseableInterfaceModuleLoader>
|
||||
create(ASTContext &ctx, StringRef cacheDir, StringRef prebuiltCacheDir,
|
||||
DependencyTracker *tracker, ModuleLoadingMode loadMode) {
|
||||
DependencyTracker *tracker, ModuleLoadingMode loadMode,
|
||||
bool RemarkOnRebuildFromInterface = false) {
|
||||
return std::unique_ptr<ParseableInterfaceModuleLoader>(
|
||||
new ParseableInterfaceModuleLoader(ctx, cacheDir, prebuiltCacheDir,
|
||||
tracker, loadMode));
|
||||
tracker, loadMode,
|
||||
RemarkOnRebuildFromInterface));
|
||||
}
|
||||
|
||||
/// Unconditionally build \p InPath (a swiftinterface file) to \p OutPath (as
|
||||
|
||||
@@ -388,6 +388,9 @@ def warn_long_expression_type_checking : Separate<["-"], "warn-long-expression-t
|
||||
def warn_long_expression_type_checking_EQ : Joined<["-"], "warn-long-expression-type-checking=">,
|
||||
Alias<warn_long_expression_type_checking>;
|
||||
|
||||
def Rmodule_interface_rebuild : Flag<["-"], "Rmodule-interface-rebuild">,
|
||||
HelpText<"Emits a remark if an imported module needs to be re-compiled from its module interface">;
|
||||
|
||||
def solver_expression_time_threshold_EQ : Joined<["-"], "solver-expression-time-threshold=">;
|
||||
|
||||
def solver_disable_shrink :
|
||||
|
||||
Reference in New Issue
Block a user