@@ -1413,15 +1413,12 @@ static bool isSDKTooOld(StringRef sdkPath, const llvm::Triple &target) {
1413
1413
void Driver::buildOutputInfo (const ToolChain &TC, const DerivedArgList &Args,
1414
1414
const bool BatchMode, const InputFileList &Inputs,
1415
1415
OutputInfo &OI) const {
1416
- auto LinkerInputType = Args.hasArg (options::OPT_lto)
1417
- ? file_types::TY_LLVM_BC
1418
- : file_types::TY_Object;
1419
1416
// By default, the driver does not link its output; this will be updated
1420
1417
// appropriately below if linking is required.
1421
1418
1422
1419
OI.CompilerOutputType = driverKind == DriverKind::Interactive
1423
1420
? file_types::TY_Nothing
1424
- : LinkerInputType ;
1421
+ : file_types::TY_Object ;
1425
1422
1426
1423
if (const Arg *A = Args.getLastArg (options::OPT_num_threads)) {
1427
1424
if (BatchMode) {
@@ -1451,14 +1448,14 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
1451
1448
diag::error_static_emit_executable_disallowed);
1452
1449
1453
1450
OI.LinkAction = LinkKind::Executable;
1454
- OI.CompilerOutputType = LinkerInputType ;
1451
+ OI.CompilerOutputType = file_types::TY_Object ;
1455
1452
break ;
1456
1453
1457
1454
case options::OPT_emit_library:
1458
1455
OI.LinkAction = Args.hasArg (options::OPT_static) ?
1459
1456
LinkKind::StaticLibrary :
1460
1457
LinkKind::DynamicLibrary;
1461
- OI.CompilerOutputType = LinkerInputType ;
1458
+ OI.CompilerOutputType = file_types::TY_Object ;
1462
1459
break ;
1463
1460
1464
1461
case options::OPT_static:
@@ -1768,18 +1765,6 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
1768
1765
1769
1766
}
1770
1767
1771
- if (const Arg *A = Args.getLastArg (options::OPT_lto)) {
1772
- auto LTOVariant = llvm::StringSwitch<Optional<OutputInfo::LTOKind>>(A->getValue ())
1773
- .Case (" llvm" , OutputInfo::LTOKind::LLVMThin)
1774
- .Case (" llvm-full" , OutputInfo::LTOKind::LLVMFull)
1775
- .Default (llvm::None);
1776
- if (LTOVariant)
1777
- OI.LTOVariant = LTOVariant.getValue ();
1778
- else
1779
- Diags.diagnose (SourceLoc (), diag::error_invalid_arg_value,
1780
- A->getAsString (Args), A->getValue ());
1781
- }
1782
-
1783
1768
if (TC.getTriple ().isOSWindows ()) {
1784
1769
if (const Arg *A = Args.getLastArg (options::OPT_libc)) {
1785
1770
OI.RuntimeVariant =
@@ -2114,17 +2099,15 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2114
2099
MergeModuleAction = C.createAction <MergeModuleJobAction>(AllModuleInputs);
2115
2100
}
2116
2101
2117
- auto PerformLTO = Args.hasArg (options::OPT_lto);
2118
2102
if (OI.shouldLink () && !AllLinkerInputs.empty ()) {
2119
2103
JobAction *LinkAction = nullptr ;
2120
2104
2121
2105
if (OI.LinkAction == LinkKind::StaticLibrary) {
2122
2106
LinkAction = C.createAction <StaticLinkJobAction>(AllLinkerInputs,
2123
- OI.LinkAction );
2107
+ OI.LinkAction );
2124
2108
} else {
2125
2109
LinkAction = C.createAction <DynamicLinkJobAction>(AllLinkerInputs,
2126
- OI.LinkAction ,
2127
- PerformLTO);
2110
+ OI.LinkAction );
2128
2111
}
2129
2112
2130
2113
// On ELF platforms there's no built in autolinking mechanism, so we
@@ -2133,7 +2116,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2133
2116
const auto &Triple = TC.getTriple ();
2134
2117
SmallVector<const Action *, 2 > AutolinkExtractInputs;
2135
2118
for (const Action *A : AllLinkerInputs)
2136
- if (A->getType () == OI. CompilerOutputType ) {
2119
+ if (A->getType () == file_types::TY_Object ) {
2137
2120
// Shared objects on ELF platforms don't have a swift1_autolink_entries
2138
2121
// section in them because the section in the .o files is marked as
2139
2122
// SHF_EXCLUDE.
@@ -2149,7 +2132,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2149
2132
(Triple.getObjectFormat () == llvm::Triple::ELF && !Triple.isPS4 ()) ||
2150
2133
Triple.getObjectFormat () == llvm::Triple::Wasm ||
2151
2134
Triple.isOSCygMing ();
2152
- if (!AutolinkExtractInputs.empty () && AutolinkExtractRequired && !PerformLTO ) {
2135
+ if (!AutolinkExtractInputs.empty () && AutolinkExtractRequired) {
2153
2136
auto *AutolinkExtractAction =
2154
2137
C.createAction <AutolinkExtractJobAction>(AutolinkExtractInputs);
2155
2138
// Takes the same inputs as the linker...
0 commit comments