mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[LTO] Driver support for -lto_library flag
This commit adds support for the -lto_library flag, allowing users to specify a custom LTO library on Darwin. This also fixes an issue where the default LTO library is used even if Driver is run from inside an alternate toolchain.
This commit is contained in:
@@ -1448,6 +1448,12 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
A->getAsString(Args), A->getValue());
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_lto_library)) {
|
||||
OI.LibLTOPath = A->getValue();
|
||||
} else {
|
||||
OI.LibLTOPath = "";
|
||||
}
|
||||
|
||||
auto CompilerOutputType = OI.LTOVariant != OutputInfo::LTOKind::None
|
||||
? file_types::TY_LLVM_BC
|
||||
|
||||
Reference in New Issue
Block a user