Skip to content

Commit 3fd5cd1

Browse files
committed
Frontend: remove -swift-module-file. NFC
We are now using a JSON file for explicit module inputs, so this argument can be removed.
1 parent d747ee9 commit 3fd5cd1

File tree

7 files changed

+0
-44
lines changed

7 files changed

+0
-44
lines changed

include/swift/AST/SearchPathOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ class SearchPathOptions {
8282
/// would for a non-system header.
8383
bool DisableModulesValidateSystemDependencies = false;
8484

85-
/// The paths to a set of explicitly built modules from interfaces.
86-
std::vector<std::string> ExplicitSwiftModules;
87-
8885
/// A set of compiled modules that may be ready to use.
8986
std::vector<std::string> CandidateCompiledModules;
9087

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
161161
static std::unique_ptr<ExplicitSwiftModuleLoader>
162162
create(ASTContext &ctx,
163163
DependencyTracker *tracker, ModuleLoadingMode loadMode,
164-
ArrayRef<std::string> ExplicitModulePaths,
165164
StringRef ExplicitSwiftModuleMap,
166165
bool IgnoreSwiftSourceInfoFile);
167166

@@ -180,8 +179,6 @@ struct ExplicitModuleInfo {
180179
std::string moduleDocPath;
181180
// Path of the .swiftsourceinfo file.
182181
std::string moduleSourceInfoPath;
183-
// Opened buffer for the .swiftmodule file.
184-
std::unique_ptr<llvm::MemoryBuffer> moduleBuffer;
185182
// A flag that indicates whether this module is a framework
186183
bool isFramework;
187184
};

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ def disable_typo_correction : Flag<["-"], "disable-typo-correction">,
169169
def disable_implicit_swift_modules: Flag<["-"], "disable-implicit-swift-modules">,
170170
HelpText<"Disable building Swift modules implicitly by the compiler">;
171171

172-
def swift_module_file
173-
: Separate<["-"], "swift-module-file">, MetaVarName<"<path>">,
174-
HelpText<"Specify Swift module explicitly built from textual interface">;
175-
176172
def explict_swift_module_map
177173
: Separate<["-"], "explicit-swift-module-map-file">, MetaVarName<"<path>">,
178174
HelpText<"Specify a JSON file containing information of explict Swift modules">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,9 +1098,6 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts,
10981098
Opts.DisableModulesValidateSystemDependencies |=
10991099
Args.hasArg(OPT_disable_modules_validate_system_headers);
11001100

1101-
for (auto A: Args.filtered(OPT_swift_module_file)) {
1102-
Opts.ExplicitSwiftModules.push_back(resolveSearchPath(A->getValue()));
1103-
}
11041101
if (const Arg *A = Args.getLastArg(OPT_explict_swift_module_map))
11051102
Opts.ExplicitSwiftModuleMap = A->getValue();
11061103
for (auto A: Args.filtered(OPT_candidate_module_file)) {

lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ bool CompilerInstance::setUpModuleLoaders() {
546546
auto ESML = ExplicitSwiftModuleLoader::create(
547547
*Context,
548548
getDependencyTracker(), MLM,
549-
Invocation.getSearchPathOptions().ExplicitSwiftModules,
550549
Invocation.getSearchPathOptions().ExplicitSwiftModuleMap,
551550
IgnoreSourceInfoFile);
552551
this->DefaultSerializedLoader = ESML.get();

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,6 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
14411441
genericSubInvocation.getFrontendOptions().DisableImplicitModules = true;
14421442
GenericArgs.push_back("-disable-implicit-swift-modules");
14431443
}
1444-
genericSubInvocation.getSearchPathOptions().ExplicitSwiftModules =
1445-
searchPathOpts.ExplicitSwiftModules;
14461444
// Pass down -explicit-swift-module-map-file
14471445
// FIXME: we shouldn't need this. Remove it?
14481446
StringRef explictSwiftModuleMap = searchPathOpts.ExplicitSwiftModuleMap;
@@ -1721,12 +1719,6 @@ bool ExplicitSwiftModuleLoader::findModule(ImportPath::Element ModuleID,
17211719
return false;
17221720
}
17231721
auto &moduleInfo = it->getValue();
1724-
if (moduleInfo.moduleBuffer) {
1725-
// We found an explicit module matches the given name, give the buffer
1726-
// back to the caller side.
1727-
*ModuleBuffer = std::move(moduleInfo.moduleBuffer);
1728-
return true;
1729-
}
17301722

17311723
// Set IsFramework bit according to the moduleInfo
17321724
IsFramework = moduleInfo.isFramework;
@@ -1815,7 +1807,6 @@ void ExplicitSwiftModuleLoader::collectVisibleTopLevelModuleNames(
18151807
std::unique_ptr<ExplicitSwiftModuleLoader>
18161808
ExplicitSwiftModuleLoader::create(ASTContext &ctx,
18171809
DependencyTracker *tracker, ModuleLoadingMode loadMode,
1818-
ArrayRef<std::string> ExplicitModulePaths,
18191810
StringRef ExplicitSwiftModuleMap,
18201811
bool IgnoreSwiftSourceInfoFile) {
18211812
auto result = std::unique_ptr<ExplicitSwiftModuleLoader>(
@@ -1827,24 +1818,6 @@ ExplicitSwiftModuleLoader::create(ASTContext &ctx,
18271818
// Parse a JSON file to collect explicitly built modules.
18281819
Impl.parseSwiftExplicitModuleMap(ExplicitSwiftModuleMap);
18291820
}
1830-
// Collect .swiftmodule paths from -swift-module-path
1831-
// FIXME: remove these.
1832-
for (auto path: ExplicitModulePaths) {
1833-
std::string name;
1834-
// Load the explicit module into a buffer and get its name.
1835-
std::unique_ptr<llvm::MemoryBuffer> buffer = getModuleName(ctx, path, name);
1836-
if (buffer) {
1837-
// Register this module for future loading.
1838-
auto &entry = Impl.ExplicitModuleMap[name];
1839-
entry.modulePath = path;
1840-
entry.moduleBuffer = std::move(buffer);
1841-
} else {
1842-
// We cannot read the module content, diagnose.
1843-
ctx.Diags.diagnose(SourceLoc(),
1844-
diag::error_opening_explicit_module_file,
1845-
path);
1846-
}
1847-
}
18481821

18491822
return result;
18501823
}

lib/Serialization/ModuleDependencyScanner.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ std::error_code PlaceholderSwiftModuleScanner::findModuleFilesInDirectory(
8686
return std::make_error_code(std::errc::not_supported);
8787
}
8888
auto &moduleInfo = it->getValue();
89-
assert(!moduleInfo.moduleBuffer &&
90-
"Placeholder dependency module stubs cannot have an associated buffer");
91-
9289
auto dependencies = ModuleDependencies::forPlaceholderSwiftModuleStub(
9390
moduleInfo.modulePath, moduleInfo.moduleDocPath,
9491
moduleInfo.moduleSourceInfoPath);

0 commit comments

Comments
 (0)