mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[driver] Use the OutputMode to determine the value to pass with -module-name.
Swift SVN r12499
This commit is contained in:
@@ -101,13 +101,8 @@ Job *Swift::constructJob(const JobAction &JA, std::unique_ptr<JobList> Inputs,
|
||||
}
|
||||
}
|
||||
|
||||
if (Args.hasArg(options::OPT_module_name)) {
|
||||
Args.AddLastArg(Arguments, options::OPT_module_name);
|
||||
} else if (const Arg *A = Args.getLastArgNoClaim(options::OPT_o)) {
|
||||
Arguments.push_back("-module-name");
|
||||
StringRef InferredModuleName = llvm::sys::path::stem(A->getValue());
|
||||
Arguments.push_back(Args.MakeArgString(InferredModuleName));
|
||||
}
|
||||
Arguments.push_back("-module-name");
|
||||
Arguments.push_back(Args.MakeArgString(OM.ModuleName));
|
||||
|
||||
Args.AddLastArg(Arguments, options::OPT_g);
|
||||
|
||||
@@ -170,6 +165,9 @@ Job *MergeModule::constructJob(const JobAction &JA,
|
||||
// serialized ASTs.
|
||||
Arguments.push_back("-parse-as-library");
|
||||
|
||||
Arguments.push_back("-module-name");
|
||||
Arguments.push_back(Args.MakeArgString(OM.ModuleName));
|
||||
|
||||
// We just want to emit a module, so pa
|
||||
Arguments.push_back("-emit-module");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user