Skip to content

Commit 01c18d0

Browse files
committed
Frontend: move ExplicitSwiftModules into SearchPathOptions, NFC
1 parent 9e88549 commit 01c18d0

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

include/swift/AST/SearchPathOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ 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+
8588
private:
8689
static StringRef
8790
pathStringFromFrameworkSearchPath(const FrameworkSearchPath &next) {

include/swift/Frontend/FrontendOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ class FrontendOptions {
262262
/// built and given to the compiler invocation.
263263
bool DisableImplicitModules = false;
264264

265-
/// The paths to a set of explicitly built modules from interfaces.
266-
std::vector<std::string> ExplicitSwiftModules;
267-
268265
/// The different modes for validating TBD against the LLVM IR.
269266
enum class TBDValidationMode {
270267
Default, ///< Do the default validation for the current platform.

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,10 @@ struct ModuleInterfaceLoaderOptions {
131131
bool remarkOnRebuildFromInterface = false;
132132
bool disableInterfaceLock = false;
133133
bool disableImplicitSwiftModule = false;
134-
std::vector<std::string> explicitSwiftModules;
135134
ModuleInterfaceLoaderOptions(const FrontendOptions &Opts):
136135
remarkOnRebuildFromInterface(Opts.RemarkOnRebuildFromModuleInterface),
137136
disableInterfaceLock(Opts.DisableInterfaceFileLock),
138-
disableImplicitSwiftModule(Opts.DisableImplicitModules),
139-
explicitSwiftModules(Opts.ExplicitSwiftModules) {}
137+
disableImplicitSwiftModule(Opts.DisableImplicitModules) {}
140138
ModuleInterfaceLoaderOptions() = default;
141139
};
142140
/// A ModuleLoader that runs a subordinate \c CompilerInvocation and

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ bool ArgsToFrontendOptionsConverter::convert(
8585

8686
Opts.DisableImplicitModules |= Args.hasArg(OPT_disable_implicit_swift_modules);
8787

88-
for (auto A: Args.getAllArgValues(OPT_swift_module_file_EQ)) {
89-
Opts.ExplicitSwiftModules.push_back(A);
90-
}
91-
9288
// Always track system dependencies when scanning dependencies.
9389
if (const Arg *ModeArg = Args.getLastArg(OPT_modes_Group)) {
9490
if (ModeArg->getOption().matches(OPT_scan_dependencies))

lib/Frontend/CompilerInvocation.cpp

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

868+
for (auto A: Args.filtered(OPT_swift_module_file_EQ)) {
869+
Opts.ExplicitSwiftModules.push_back(resolveSearchPath(A->getValue()));
870+
}
868871
// Opts.RuntimeIncludePath is set by calls to
869872
// setRuntimeIncludePath() or setMainExecutablePath().
870873
// Opts.RuntimeImportPath is set by calls to

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,12 +1201,12 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
12011201
subInvocation.getFrontendOptions().DisableImplicitModules = true;
12021202
GenericArgs.push_back("-disable-implicit-swift-modules");
12031203
}
1204-
subInvocation.getFrontendOptions().ExplicitSwiftModules =
1205-
LoaderOpts.explicitSwiftModules;
1204+
subInvocation.getSearchPathOptions().ExplicitSwiftModules =
1205+
searchPathOpts.ExplicitSwiftModules;
12061206
// Dependencies scanner shouldn't know any explict Swift modules to use.
12071207
// Adding these argumnets may not be necessary.
12081208
// FIXME: remove it?
1209-
for (auto EM: LoaderOpts.explicitSwiftModules) {
1209+
for (auto EM: searchPathOpts.ExplicitSwiftModules) {
12101210
GenericArgs.push_back(ArgSaver.save((llvm::Twine("-swift-module-file=") + EM).str()));
12111211
}
12121212
if (clangImporter) {

0 commit comments

Comments
 (0)