[Driver] Make the list of input files available when creating Jobs.

Previously jobs had to grovel this information out of the raw argument
list, which dropped the types we had inferred on input files. This
makes things more consistent across the compiler, though arguably we
should be able to designate "primary" and "non-primary" inputs on a
per-action basis rather than resorting to "global" state.

Use this new information to stop passing object file inputs to the
Swift frontend, fixing rdar://problem/23213785.

The list wouldn't have to live on the Compilation, but I'm going to use
it to fix SR-280 / rdar://problem/23878192 as well.
This commit is contained in:
Jordan Rose
2016-01-12 11:49:07 -08:00
parent af8eb3766d
commit 5f78d24e85
12 changed files with 107 additions and 24 deletions

View File

@@ -39,8 +39,10 @@ ToolChain::constructJob(const JobAction &JA,
std::unique_ptr<CommandOutput> output,
const ActionList &inputActions,
const llvm::opt::ArgList &args,
ArrayRef<InputPair> topLevelInputFiles,
const OutputInfo &OI) const {
JobContext context{inputs, *output, inputActions, args, OI};
JobContext context{inputs, *output, inputActions, args, topLevelInputFiles,
OI};
auto invocationInfo = [&]() -> InvocationInfo {
switch (JA.getKind()) {