mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "[LTO] Support LLVM level link time optimization on Darwin, Linux and Windows"
This commit is contained in:
committed by
GitHub
parent
cc84c7b740
commit
71309a8fa9
@@ -238,15 +238,12 @@ toolchains::Darwin::addLinkerInputArgs(InvocationInfo &II,
|
||||
Arguments.push_back("-filelist");
|
||||
Arguments.push_back(context.getTemporaryFilePath("inputs", "LinkFileList"));
|
||||
II.FilelistInfos.push_back(
|
||||
{Arguments.back(), context.OI.CompilerOutputType,
|
||||
{Arguments.back(), file_types::TY_Object,
|
||||
FilelistInfo::WhichFiles::InputJobsAndSourceInputActions});
|
||||
} else {
|
||||
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,
|
||||
file_types::TY_Object);
|
||||
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,
|
||||
file_types::TY_LLVM_BC);
|
||||
addInputsOfType(Arguments, context.InputActions, file_types::TY_Object);
|
||||
addInputsOfType(Arguments, context.InputActions, file_types::TY_LLVM_BC);
|
||||
}
|
||||
|
||||
|
||||
@@ -309,20 +306,6 @@ toolchains::Darwin::addArgsToLinkARCLite(ArgStringList &Arguments,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
toolchains::Darwin::addLTOLibArgs(ArgStringList &Arguments,
|
||||
const JobContext &context) const {
|
||||
llvm::SmallString<128> LTOLibPath;
|
||||
if (findXcodeClangPath(LTOLibPath)) {
|
||||
llvm::sys::path::remove_filename(LTOLibPath); // 'clang'
|
||||
llvm::sys::path::remove_filename(LTOLibPath); // 'bin'
|
||||
llvm::sys::path::append(LTOLibPath, "lib", "libLTO.dylib");
|
||||
|
||||
Arguments.push_back("-lto_library");
|
||||
Arguments.push_back(context.Args.MakeArgString(LTOLibPath));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
toolchains::Darwin::addSanitizerArgs(ArgStringList &Arguments,
|
||||
const DynamicLinkJobAction &job,
|
||||
@@ -740,10 +723,6 @@ toolchains::Darwin::constructInvocation(const DynamicLinkJobAction &job,
|
||||
|
||||
addArgsToLinkARCLite(Arguments, context);
|
||||
|
||||
if (job.PerformLTO()) {
|
||||
addLTOLibArgs(Arguments, context);
|
||||
}
|
||||
|
||||
for (const Arg *arg :
|
||||
context.Args.filtered(options::OPT_F, options::OPT_Fsystem)) {
|
||||
Arguments.push_back("-F");
|
||||
@@ -811,17 +790,14 @@ toolchains::Darwin::constructInvocation(const StaticLinkJobAction &job,
|
||||
if (context.shouldUseInputFileList()) {
|
||||
Arguments.push_back("-filelist");
|
||||
Arguments.push_back(context.getTemporaryFilePath("inputs", "LinkFileList"));
|
||||
II.FilelistInfos.push_back({Arguments.back(), context.OI.CompilerOutputType,
|
||||
II.FilelistInfos.push_back({Arguments.back(), file_types::TY_Object,
|
||||
FilelistInfo::WhichFiles::InputJobs});
|
||||
} else {
|
||||
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,
|
||||
file_types::TY_Object);
|
||||
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,
|
||||
file_types::TY_LLVM_BC);
|
||||
}
|
||||
|
||||
addInputsOfType(Arguments, context.InputActions, file_types::TY_Object);
|
||||
addInputsOfType(Arguments, context.InputActions, file_types::TY_LLVM_BC);
|
||||
|
||||
Arguments.push_back("-o");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user