mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Front-end: add an option to ignore .swiftsourceinfo file for testing purposes
We generate .swiftsourceinfo for stdlib in the build directory because ABI checker could issue diagnostics to the stdlib source. However, this may also change other diagnostic tests. Both Brent and Jordan have raised concern about this. After adding this flag, other diagnostic tests could ignore .swiftsourceinfo files even though when they are present so our tests will reflect what most users experience when sources for stdlib are unavailable.
This commit is contained in:
@@ -104,8 +104,10 @@ Optional<bool> forEachModuleSearchPath(
|
||||
|
||||
// Defined out-of-line so that we can see ~ModuleFile.
|
||||
SerializedModuleLoaderBase::SerializedModuleLoaderBase(
|
||||
ASTContext &ctx, DependencyTracker *tracker, ModuleLoadingMode loadMode)
|
||||
: ModuleLoader(tracker), Ctx(ctx), LoadMode(loadMode) {}
|
||||
ASTContext &ctx, DependencyTracker *tracker, ModuleLoadingMode loadMode,
|
||||
bool IgnoreSwiftSourceInfoFile)
|
||||
: ModuleLoader(tracker), Ctx(ctx), LoadMode(loadMode),
|
||||
IgnoreSwiftSourceInfoFile(IgnoreSwiftSourceInfoFile) {}
|
||||
|
||||
SerializedModuleLoaderBase::~SerializedModuleLoaderBase() = default;
|
||||
SerializedModuleLoader::~SerializedModuleLoader() = default;
|
||||
@@ -326,11 +328,12 @@ std::error_code SerializedModuleLoaderBase::openModuleFiles(
|
||||
FS.getBufferForFile(ModulePath);
|
||||
if (!ModuleOrErr)
|
||||
return ModuleOrErr.getError();
|
||||
|
||||
// Open .swiftsourceinfo file if it's present.
|
||||
openModuleSourceInfoFileIfPresent(ModuleID, ModulePath,
|
||||
ModuleSourceInfoFileName,
|
||||
ModuleSourceInfoBuffer);
|
||||
if (!IgnoreSwiftSourceInfoFile) {
|
||||
// Open .swiftsourceinfo file if it's present.
|
||||
openModuleSourceInfoFileIfPresent(ModuleID, ModulePath,
|
||||
ModuleSourceInfoFileName,
|
||||
ModuleSourceInfoBuffer);
|
||||
}
|
||||
auto ModuleDocErr =
|
||||
openModuleDocFile(ModuleID, ModuleDocPath, ModuleDocBuffer);
|
||||
if (ModuleDocErr)
|
||||
|
||||
Reference in New Issue
Block a user