Commit 21886543 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Fix a bug in `gn analyze` for host-only file mods.

If you modified a file that only affected targets defined in a
non-default toolchain (e.g., like the host toolchain), `gn analyze`
would skip over it and hence not do the right thing. For example,
if you modified //testing/iossim/iossim.mm, analyze would think
that no compile was needed, when really you'd want to recompile
the simulator and re-run every test.

Unfortunately, I don't remember why I wrote the code the way I did,
but looking at it now I can't think of a reason not to just look in
every toolchain.

BUG=667989

Change-Id: I8e1935d7dc23bf49fa87e191c1a136a5492d3678
Reviewed-on: https://chromium-review.googlesource.com/528527Reviewed-by: default avatarsmut <smut@chromium.org>
Reviewed-by: default avatarBrett Wilson <brettw@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478388}
parent ff9b586e
......@@ -395,9 +395,7 @@ bool Analyzer::TargetRefersToFile(const Target* target,
void Analyzer::AddTargetsDirectlyReferringToFileTo(const SourceFile* file,
TargetSet* matches) const {
for (auto* target : all_targets_) {
// Only handles targets in the default toolchain.
if ((target->label().GetToolchainLabel() == default_toolchain_) &&
TargetRefersToFile(target, file))
if (TargetRefersToFile(target, file))
matches->insert(target);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment