Skip to content

Commit 1f60d44

Browse files
author
David Ungar
committed
Work with either source of inputs.
1 parent 76c4742 commit 1f60d44

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/Driver/DarwinToolChains.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,20 @@ toolchains::Darwin::addLinkerInputArgs(InvocationInfo &II,
230230
ArgStringList &Arguments = II.Arguments;
231231
if (context.shouldUseInputFileList()) {
232232
Arguments.push_back("-filelist");
233+
const auto whichFiles = context.Inputs.empty()
234+
? FilelistInfo::WhichFiles::PrimaryInputs
235+
: FilelistInfo::WhichFiles::Input;
233236
Arguments.push_back(context.getTemporaryFilePath("inputs", "LinkFileList"));
234-
II.FilelistInfos.push_back({Arguments.back(), file_types::TY_Object,
235-
FilelistInfo::WhichFiles::PrimaryInputs});
237+
II.FilelistInfos.push_back(
238+
{Arguments.back(), file_types::TY_Object, whichFiles});
239+
assert((context.Inputs.empty() || context.InputActions.empty()) &&
240+
"If both are non-empty the filelist won't work");
236241
} else {
237242
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,
238243
file_types::TY_Object);
244+
addInputsOfType(Arguments, context.InputActions, file_types::TY_Object);
239245
}
240246

241-
addInputsOfType(Arguments, context.InputActions, file_types::TY_Object);
242247

243248
if (context.OI.CompilerMode == OutputInfo::Mode::SingleCompile)
244249
addInputsOfType(Arguments, context.Inputs, context.Args,

0 commit comments

Comments
 (0)