Skip to content

Commit 17f73a5

Browse files
committed
[Driver] Apply review comments
Signed-off-by: Victor Lomuller <[email protected]>
1 parent d462dc1 commit 17f73a5

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

clang/include/clang/Driver/Action.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,8 @@ class StaticLibJobAction : public JobAction {
876876
/// - No change of toolchain, boundarch and offloading kind should occur
877877
/// within the sub-region;
878878
/// - No job should produce multiple outputs;
879-
/// - Results of action within the sub-region should not be used the wrapped
880-
/// region.
879+
/// - Results of action within the sub-region should not be used ouside the
880+
/// wrapped region.
881881
/// Note: this doesn't bind to a tool directly and this need special casing
882882
/// anyhow. Hence why this is an Action and not a JobAction, even if there is a
883883
/// command behind.

clang/include/clang/Driver/Job.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ class JobList {
319319
/// Clear the job list.
320320
void clear();
321321

322-
list_type &getJobs() { return Jobs; }
322+
/// Return a mutable list of Jobs for llvm-foreach wrapping.
323+
list_type &getJobsForOverride() { return Jobs; }
323324
const list_type &getJobs() const { return Jobs; }
324325

325326
bool empty() const { return Jobs.empty(); }

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6369,13 +6369,13 @@ InputInfo Driver::BuildJobsForActionNoCache(
63696369
/*AtTopLevel=*/false, MultipleArchs, LinkingOutput,
63706370
CachedResults, TargetDeviceOffloadKind);
63716371

6372-
auto begin = C.getJobs().getJobs().begin() + OffsetIdx;
6373-
auto end = C.getJobs().getJobs().end();
6372+
auto begin = C.getJobs().getJobsForOverride().begin() + OffsetIdx;
6373+
auto end = C.getJobs().getJobsForOverride().end();
63746374

63756375
// Steal the commands.
63766376
llvm::SmallVector<std::unique_ptr<Command>, 4> JobsToWrap(
63776377
std::make_move_iterator(begin), std::make_move_iterator(end));
6378-
C.getJobs().getJobs().erase(begin, end);
6378+
C.getJobs().getJobsForOverride().erase(begin, end);
63796379

63806380
InputInfo ActionResult;
63816381
for (std::unique_ptr<Command> Cmd :

0 commit comments

Comments
 (0)