Rename extra_hard_deps to additional_hard_deps
Every time I read this code I wondered what makes a dependency extra
hard. Turns out it was supposed to be (extra (hard deps)),
not ((extra hard) deps). Maybe s/extra/additional/ makes this more
clear.
No behavior change.
Change-Id: I2ed17795c8ba29fab5ae0e5bbfcbf73ea897a358
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/11220
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
diff --git a/src/gn/ninja_action_target_writer.cc b/src/gn/ninja_action_target_writer.cc
index c48da06..bfceef9 100644
--- a/src/gn/ninja_action_target_writer.cc
+++ b/src/gn/ninja_action_target_writer.cc
@@ -29,18 +29,18 @@
void NinjaActionTargetWriter::Run() {
std::string custom_rule_name = WriteRuleDefinition();
- // Collect our deps to pass as "extra hard dependencies" for input deps. This
- // will force all of the action's dependencies to be completed before the
- // action is run. Usually, if an action has a dependency, it will be
+ // Collect our deps to pass as additional "hard dependencies" for input deps.
+ // This will force all of the action's dependencies to be completed before
+ // the action is run. Usually, if an action has a dependency, it will be
// operating on the result of that previous step, so we need to be sure to
// serialize these.
- std::vector<const Target*> extra_hard_deps;
+ std::vector<const Target*> additional_hard_deps;
std::vector<OutputFile> data_outs;
for (const auto& pair : target_->GetDeps(Target::DEPS_LINKED)) {
if (pair.ptr->IsDataOnly()) {
data_outs.push_back(pair.ptr->dependency_output_file());
} else {
- extra_hard_deps.push_back(pair.ptr);
+ additional_hard_deps.push_back(pair.ptr);
}
}
@@ -50,7 +50,7 @@
size_t num_stamp_uses =
target_->output_type() == Target::ACTION ? 1u : target_->sources().size();
std::vector<OutputFile> input_deps =
- WriteInputDepsStampAndGetDep(extra_hard_deps, num_stamp_uses);
+ WriteInputDepsStampAndGetDep(additional_hard_deps, num_stamp_uses);
out_ << std::endl;
// Collects all output files for writing below.
diff --git a/src/gn/ninja_target_writer.cc b/src/gn/ninja_target_writer.cc
index 421c575..c8e7ebd 100644
--- a/src/gn/ninja_target_writer.cc
+++ b/src/gn/ninja_target_writer.cc
@@ -188,7 +188,7 @@
}
std::vector<OutputFile> NinjaTargetWriter::WriteInputDepsStampAndGetDep(
- const std::vector<const Target*>& extra_hard_deps,
+ const std::vector<const Target*>& additional_hard_deps,
size_t num_stamp_uses) const {
CHECK(target_->toolchain()) << "Toolchain not set on target "
<< target_->label().GetUserVisibleName(true);
@@ -241,9 +241,9 @@
input_deps_targets.push_back(target);
}
- // Extra hard dependencies passed in. These are usually empty or small, and
- // we don't want to duplicate the explicit hard deps of the target.
- for (const Target* target : extra_hard_deps) {
+ // Additional hard dependencies passed in. These are usually empty or small,
+ // and we don't want to duplicate the explicit hard deps of the target.
+ for (const Target* target : additional_hard_deps) {
if (!hard_deps.count(target))
input_deps_targets.push_back(target);
}
diff --git a/src/gn/ninja_target_writer.h b/src/gn/ninja_target_writer.h
index f4c9eae..efcf73d 100644
--- a/src/gn/ninja_target_writer.h
+++ b/src/gn/ninja_target_writer.h
@@ -45,10 +45,10 @@
// order-only dependencies for the current target.
// If num_stamp_uses is small, this might return all input dependencies
// directly, without writing a stamp file.
- // If there are no implicit dependencies and no extra target dependencies
+ // If there are no implicit dependencies and no additional target dependencies
// are passed in, this returns an empty vector.
std::vector<OutputFile> WriteInputDepsStampAndGetDep(
- const std::vector<const Target*>& extra_hard_deps,
+ const std::vector<const Target*>& additional_hard_deps,
size_t num_stamp_uses) const;
// Writes to the output file a final stamp rule for the target that stamps
diff --git a/src/gn/ninja_target_writer_unittest.cc b/src/gn/ninja_target_writer_unittest.cc
index 1b19159..7a04e3c 100644
--- a/src/gn/ninja_target_writer_unittest.cc
+++ b/src/gn/ninja_target_writer_unittest.cc
@@ -23,9 +23,9 @@
// Make this public so the test can call it.
std::vector<OutputFile> WriteInputDepsStampAndGetDep(
- const std::vector<const Target*>& extra_hard_deps,
+ const std::vector<const Target*>& additional_hard_deps,
size_t num_stamp_uses) {
- return NinjaTargetWriter::WriteInputDepsStampAndGetDep(extra_hard_deps,
+ return NinjaTargetWriter::WriteInputDepsStampAndGetDep(additional_hard_deps,
num_stamp_uses);
}
};