@@ -242,15 +242,19 @@ makeBatchCommandOutput(ArrayRef<const Job *> jobs, Compilation &C,
242
242
return output;
243
243
}
244
244
245
- // / Set-union the \c Inputs and \c Actions from each \c Job in \p jobs into the
246
- // / provided \p inputJobs and \p inputActions vectors, further adding all \c
247
- // / Actions from the resulting merger to \p batchCJA. Do set-union rather than
248
- // / concatenation here to avoid mentioning the same input multiple times.
245
+ // / Set-union the \c Inputs and \c InputActions from each \c Job in \p jobs into
246
+ // / the provided \p inputJobs and \p inputActions vectors, further adding all \c
247
+ // / Actions in the \p jobs -- InputActions or otherwise -- to \p batchCJA. Do
248
+ // / set-union rather than concatenation here to avoid mentioning the same input
249
+ // / multiple times.
249
250
static bool
250
251
mergeBatchInputs (ArrayRef<const Job *> jobs,
251
252
llvm::SmallSetVector<const Job *, 16 > &inputJobs,
252
253
llvm::SmallSetVector<const Action *, 16 > &inputActions,
253
254
CompileJobAction *batchCJA) {
255
+
256
+ llvm::SmallSetVector<const Action *, 16 > allActions;
257
+
254
258
for (auto const *J : jobs) {
255
259
for (auto const *I : J->getInputs ()) {
256
260
inputJobs.insert (I);
@@ -259,11 +263,18 @@ mergeBatchInputs(ArrayRef<const Job *> jobs,
259
263
if (!CJA)
260
264
return true ;
261
265
for (auto const *I : CJA->getInputs ()) {
262
- inputActions.insert (I);
266
+ // Capture _all_ input actions -- whether or not they are InputActions --
267
+ // in allActions, to set as the inputs for batchCJA below.
268
+ allActions.insert (I);
269
+ // Only collect input actions that _are InputActions_ in the inputActions
270
+ // array, to load into the JobContext in our caller.
271
+ if (auto const *IA = dyn_cast<InputAction>(I)) {
272
+ inputActions.insert (IA);
273
+ }
263
274
}
264
275
}
265
276
266
- for (auto const *I : inputActions ) {
277
+ for (auto const *I : allActions ) {
267
278
batchCJA->addInput (I);
268
279
}
269
280
return false ;
0 commit comments