Commit 238f0a02 authored by vmpstr's avatar vmpstr Committed by Commit bot

tools/gn: Change auto to not deduce raw pointers.

This patch updates the code to prevent auto deducing to a raw pointer.

R=brettw@chromium.org, danakj, dcheng
BUG=554600

Review-Url: https://codereview.chromium.org/2105553005
Cr-Commit-Position: refs/heads/master@{#405292}
parent 8b05f575
...@@ -33,7 +33,7 @@ typedef BuilderRecord::BuilderRecordSet BuilderRecordSet; ...@@ -33,7 +33,7 @@ typedef BuilderRecord::BuilderRecordSet BuilderRecordSet;
bool RecursiveFindCycle(const BuilderRecord* search_in, bool RecursiveFindCycle(const BuilderRecord* search_in,
std::vector<const BuilderRecord*>* path) { std::vector<const BuilderRecord*>* path) {
path->push_back(search_in); path->push_back(search_in);
for (const auto& cur : search_in->unresolved_deps()) { for (auto* cur : search_in->unresolved_deps()) {
std::vector<const BuilderRecord*>::iterator found = std::vector<const BuilderRecord*>::iterator found =
std::find(path->begin(), path->end(), cur); std::find(path->begin(), path->end(), cur);
if (found != path->end()) { if (found != path->end()) {
...@@ -182,7 +182,7 @@ bool Builder::CheckForBadItems(Err* err) const { ...@@ -182,7 +182,7 @@ bool Builder::CheckForBadItems(Err* err) const {
bad_records.push_back(src); bad_records.push_back(src);
// Check dependencies. // Check dependencies.
for (const auto& dest : src->unresolved_deps()) { for (auto* dest : src->unresolved_deps()) {
if (!dest->item()) { if (!dest->item()) {
depstring += src->label().GetUserVisibleName(true) + depstring += src->label().GetUserVisibleName(true) +
"\n needs " + dest->label().GetUserVisibleName(true) + "\n"; "\n needs " + dest->label().GetUserVisibleName(true) + "\n";
...@@ -204,7 +204,7 @@ bool Builder::CheckForBadItems(Err* err) const { ...@@ -204,7 +204,7 @@ bool Builder::CheckForBadItems(Err* err) const {
// Something's very wrong, just dump out the bad nodes. // Something's very wrong, just dump out the bad nodes.
depstring = "I have no idea what went wrong, but these are unresolved, " depstring = "I have no idea what went wrong, but these are unresolved, "
"possibly due to an\ninternal error:"; "possibly due to an\ninternal error:";
for (const auto& bad_record : bad_records) { for (auto* bad_record : bad_records) {
depstring += "\n\"" + depstring += "\n\"" +
bad_record->label().GetUserVisibleName(false) + "\""; bad_record->label().GetUserVisibleName(false) + "\"";
} }
...@@ -252,7 +252,7 @@ bool Builder::ConfigDefined(BuilderRecord* record, Err* err) { ...@@ -252,7 +252,7 @@ bool Builder::ConfigDefined(BuilderRecord* record, Err* err) {
// anything they depend on is actually written, the "generate" flag isn't // anything they depend on is actually written, the "generate" flag isn't
// relevant and means extra book keeping. Just force load any deps of this // relevant and means extra book keeping. Just force load any deps of this
// config. // config.
for (const auto& cur : record->all_deps()) for (auto* cur : record->all_deps())
ScheduleItemLoadIfNecessary(cur); ScheduleItemLoadIfNecessary(cur);
return true; return true;
...@@ -408,7 +408,7 @@ void Builder::RecursiveSetShouldGenerate(BuilderRecord* record, ...@@ -408,7 +408,7 @@ void Builder::RecursiveSetShouldGenerate(BuilderRecord* record,
return; // Already set. return; // Already set.
record->set_should_generate(true); record->set_should_generate(true);
for (const auto& cur : record->all_deps()) { for (auto* cur : record->all_deps()) {
if (!cur->should_generate()) { if (!cur->should_generate()) {
ScheduleItemLoadIfNecessary(cur); ScheduleItemLoadIfNecessary(cur);
RecursiveSetShouldGenerate(cur, false); RecursiveSetShouldGenerate(cur, false);
......
...@@ -100,7 +100,7 @@ int RunLs(const std::vector<std::string>& args) { ...@@ -100,7 +100,7 @@ int RunLs(const std::vector<std::string>& args) {
matches = setup->builder()->GetAllResolvedTargets(); matches = setup->builder()->GetAllResolvedTargets();
} else { } else {
// List all resolved targets in the default toolchain. // List all resolved targets in the default toolchain.
for (const auto& target : setup->builder()->GetAllResolvedTargets()) { for (auto* target : setup->builder()->GetAllResolvedTargets()) {
if (target->settings()->is_default()) if (target->settings()->is_default())
matches.push_back(target); matches.push_back(target);
} }
......
...@@ -32,7 +32,7 @@ typedef std::multimap<const Target*, const Target*> DepMap; ...@@ -32,7 +32,7 @@ typedef std::multimap<const Target*, const Target*> DepMap;
// Populates the reverse dependency map for the targets in the Setup. // Populates the reverse dependency map for the targets in the Setup.
void FillDepMap(Setup* setup, DepMap* dep_map) { void FillDepMap(Setup* setup, DepMap* dep_map) {
for (const auto& target : setup->builder()->GetAllResolvedTargets()) { for (auto* target : setup->builder()->GetAllResolvedTargets()) {
for (const auto& dep_pair : target->GetDeps(Target::DEPS_ALL)) for (const auto& dep_pair : target->GetDeps(Target::DEPS_ALL))
dep_map->insert(std::make_pair(dep_pair.ptr, target)); dep_map->insert(std::make_pair(dep_pair.ptr, target));
} }
...@@ -160,7 +160,7 @@ void GetTargetsContainingFile(Setup* setup, ...@@ -160,7 +160,7 @@ void GetTargetsContainingFile(Setup* setup,
bool all_toolchains, bool all_toolchains,
UniqueVector<const Target*>* matches) { UniqueVector<const Target*>* matches) {
Label default_toolchain = setup->loader()->default_toolchain_label(); Label default_toolchain = setup->loader()->default_toolchain_label();
for (const auto& target : all_targets) { for (auto* target : all_targets) {
if (!all_toolchains) { if (!all_toolchains) {
// Only check targets in the default toolchain. // Only check targets in the default toolchain.
if (target->label().GetToolchainLabel() != default_toolchain) if (target->label().GetToolchainLabel() != default_toolchain)
...@@ -189,7 +189,7 @@ void GetTargetsReferencingConfig(Setup* setup, ...@@ -189,7 +189,7 @@ void GetTargetsReferencingConfig(Setup* setup,
bool all_toolchains, bool all_toolchains,
UniqueVector<const Target*>* matches) { UniqueVector<const Target*>* matches) {
Label default_toolchain = setup->loader()->default_toolchain_label(); Label default_toolchain = setup->loader()->default_toolchain_label();
for (const auto& target : all_targets) { for (auto* target : all_targets) {
if (!all_toolchains) { if (!all_toolchains) {
// Only check targets in the default toolchain. // Only check targets in the default toolchain.
if (target->label().GetToolchainLabel() != default_toolchain) if (target->label().GetToolchainLabel() != default_toolchain)
...@@ -442,7 +442,7 @@ int RunRefs(const std::vector<std::string>& args) { ...@@ -442,7 +442,7 @@ int RunRefs(const std::vector<std::string>& args) {
GetTargetsContainingFile(setup, all_targets, file, all_toolchains, GetTargetsContainingFile(setup, all_targets, file, all_toolchains,
&explicit_target_matches); &explicit_target_matches);
} }
for (const auto& config : config_matches) { for (auto* config : config_matches) {
GetTargetsReferencingConfig(setup, all_targets, config, all_toolchains, GetTargetsReferencingConfig(setup, all_targets, config, all_toolchains,
&explicit_target_matches); &explicit_target_matches);
} }
......
...@@ -298,7 +298,7 @@ void PrintTargetsAsLabels(bool indent, ...@@ -298,7 +298,7 @@ void PrintTargetsAsLabels(bool indent,
const std::vector<const Target*>& targets) { const std::vector<const Target*>& targets) {
// Putting the labels into a set automatically sorts them for us. // Putting the labels into a set automatically sorts them for us.
std::set<Label> unique_labels; std::set<Label> unique_labels;
for (const auto& target : targets) for (auto* target : targets)
unique_labels.insert(target->label()); unique_labels.insert(target->label());
// Grab the label of the default toolchain from the first target. // Grab the label of the default toolchain from the first target.
...@@ -446,7 +446,7 @@ bool ResolveFromCommandLineInput( ...@@ -446,7 +446,7 @@ bool ResolveFromCommandLineInput(
void FilterTargetsByPatterns(const std::vector<const Target*>& input, void FilterTargetsByPatterns(const std::vector<const Target*>& input,
const std::vector<LabelPattern>& filter, const std::vector<LabelPattern>& filter,
std::vector<const Target*>* output) { std::vector<const Target*>* output) {
for (const auto& target : input) { for (auto* target : input) {
for (const auto& pattern : filter) { for (const auto& pattern : filter) {
if (pattern.Matches(target->label())) { if (pattern.Matches(target->label())) {
output->push_back(target); output->push_back(target);
...@@ -459,7 +459,7 @@ void FilterTargetsByPatterns(const std::vector<const Target*>& input, ...@@ -459,7 +459,7 @@ void FilterTargetsByPatterns(const std::vector<const Target*>& input,
void FilterTargetsByPatterns(const std::vector<const Target*>& input, void FilterTargetsByPatterns(const std::vector<const Target*>& input,
const std::vector<LabelPattern>& filter, const std::vector<LabelPattern>& filter,
UniqueVector<const Target*>* output) { UniqueVector<const Target*>* output) {
for (const auto& target : input) { for (auto* target : input) {
for (const auto& pattern : filter) { for (const auto& pattern : filter) {
if (pattern.Matches(target->label())) { if (pattern.Matches(target->label())) {
output->push_back(target); output->push_back(target);
......
...@@ -92,7 +92,7 @@ Value RunGetTargetOutputs(Scope* scope, ...@@ -92,7 +92,7 @@ Value RunGetTargetOutputs(Scope* scope,
*err = Err(function, "No targets defined in this context."); *err = Err(function, "No targets defined in this context.");
return Value(); return Value();
} }
for (const auto& item : *collector) { for (auto* item : *collector) {
if (item->label() != label) if (item->label() != label)
continue; continue;
......
...@@ -129,7 +129,7 @@ HeaderChecker::HeaderChecker(const BuildSettings* build_settings, ...@@ -129,7 +129,7 @@ HeaderChecker::HeaderChecker(const BuildSettings* build_settings,
const std::vector<const Target*>& targets) const std::vector<const Target*>& targets)
: main_loop_(base::MessageLoop::current()), : main_loop_(base::MessageLoop::current()),
build_settings_(build_settings) { build_settings_(build_settings) {
for (const auto& target : targets) for (auto* target : targets)
AddTargetToFileMap(target, &file_map_); AddTargetToFileMap(target, &file_map_);
} }
...@@ -140,7 +140,7 @@ bool HeaderChecker::Run(const std::vector<const Target*>& to_check, ...@@ -140,7 +140,7 @@ bool HeaderChecker::Run(const std::vector<const Target*>& to_check,
bool force_check, bool force_check,
std::vector<Err>* errors) { std::vector<Err>* errors) {
FileMap files_to_check; FileMap files_to_check;
for (const auto& check : to_check) for (auto* check : to_check)
AddTargetToFileMap(check, &files_to_check); AddTargetToFileMap(check, &files_to_check);
RunCheckOverFiles(files_to_check, force_check); RunCheckOverFiles(files_to_check, force_check);
...@@ -567,9 +567,9 @@ Err HeaderChecker::MakeUnreachableError( ...@@ -567,9 +567,9 @@ Err HeaderChecker::MakeUnreachableError(
std::string msg = "It is not in any dependency of\n " + std::string msg = "It is not in any dependency of\n " +
from_target->label().GetUserVisibleName(include_toolchain); from_target->label().GetUserVisibleName(include_toolchain);
msg += "\nThe include file is in the target(s):\n"; msg += "\nThe include file is in the target(s):\n";
for (const auto& target : targets_with_matching_toolchains) for (auto* target : targets_with_matching_toolchains)
msg += " " + target->label().GetUserVisibleName(include_toolchain) + "\n"; msg += " " + target->label().GetUserVisibleName(include_toolchain) + "\n";
for (const auto& target : targets_with_other_toolchains) for (auto* target : targets_with_other_toolchains)
msg += " " + target->label().GetUserVisibleName(include_toolchain) + "\n"; msg += " " + target->label().GetUserVisibleName(include_toolchain) + "\n";
if (targets_with_other_toolchains.size() + if (targets_with_other_toolchains.size() +
targets_with_matching_toolchains.size() > 1) targets_with_matching_toolchains.size() > 1)
......
...@@ -158,7 +158,7 @@ TEST_F(InputConversionTest, ValueError) { ...@@ -158,7 +158,7 @@ TEST_F(InputConversionTest, ValueError) {
"[rebase_path(\"//\")]", "[rebase_path(\"//\")]",
}; };
for (auto test : kTests) { for (auto* test : kTests) {
Err err; Err err;
std::string input(test); std::string input(test);
Value result = ConvertInputToValue(settings(), input, nullptr, Value result = ConvertInputToValue(settings(), input, nullptr,
......
...@@ -273,7 +273,7 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings, ...@@ -273,7 +273,7 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings,
// Pass all of the items that were defined off to the builder. // Pass all of the items that were defined off to the builder.
for (auto& item : collected_items) { for (auto*& item : collected_items) {
settings->build_settings()->ItemDefined(base::WrapUnique(item)); settings->build_settings()->ItemDefined(base::WrapUnique(item));
item = nullptr; item = nullptr;
} }
......
...@@ -948,7 +948,7 @@ void NinjaBinaryTargetWriter::WriteSourceSetStamp( ...@@ -948,7 +948,7 @@ void NinjaBinaryTargetWriter::WriteSourceSetStamp(
DCHECK(extra_object_files.empty()); DCHECK(extra_object_files.empty());
std::vector<OutputFile> order_only_deps; std::vector<OutputFile> order_only_deps;
for (const auto& dep : non_linkable_deps) for (auto* dep : non_linkable_deps)
order_only_deps.push_back(dep->dependency_output_file()); order_only_deps.push_back(dep->dependency_output_file());
WriteStampForTarget(object_files, order_only_deps); WriteStampForTarget(object_files, order_only_deps);
...@@ -965,8 +965,7 @@ void NinjaBinaryTargetWriter::GetDeps( ...@@ -965,8 +965,7 @@ void NinjaBinaryTargetWriter::GetDeps(
} }
// Inherited libraries. // Inherited libraries.
for (const auto& inherited_target : for (auto* inherited_target : target_->inherited_libraries().GetOrdered()) {
target_->inherited_libraries().GetOrdered()) {
ClassifyDependency(inherited_target, extra_object_files, ClassifyDependency(inherited_target, extra_object_files,
linkable_deps, non_linkable_deps); linkable_deps, non_linkable_deps);
} }
...@@ -1029,7 +1028,7 @@ void NinjaBinaryTargetWriter::WriteOrderOnlyDependencies( ...@@ -1029,7 +1028,7 @@ void NinjaBinaryTargetWriter::WriteOrderOnlyDependencies(
out_ << " ||"; out_ << " ||";
// Non-linkable targets. // Non-linkable targets.
for (const auto& non_linkable_dep : non_linkable_deps) { for (auto* non_linkable_dep : non_linkable_deps) {
out_ << " "; out_ << " ";
path_output_.WriteFile(out_, non_linkable_dep->dependency_output_file()); path_output_.WriteFile(out_, non_linkable_dep->dependency_output_file());
} }
......
...@@ -242,7 +242,7 @@ void NinjaBuildWriter::WriteAllPools() { ...@@ -242,7 +242,7 @@ void NinjaBuildWriter::WriteAllPools() {
} }
void NinjaBuildWriter::WriteSubninjas() { void NinjaBuildWriter::WriteSubninjas() {
for (const auto& elem : all_settings_) { for (auto* elem : all_settings_) {
out_ << "subninja "; out_ << "subninja ";
path_output_.WriteFile(out_, GetNinjaFileForToolchain(elem)); path_output_.WriteFile(out_, GetNinjaFileForToolchain(elem));
out_ << std::endl; out_ << std::endl;
......
...@@ -255,7 +255,7 @@ OutputFile NinjaTargetWriter::WriteInputDepsStampAndGetDep( ...@@ -255,7 +255,7 @@ OutputFile NinjaTargetWriter::WriteInputDepsStampAndGetDep(
std::sort( std::sort(
input_deps_targets.begin(), input_deps_targets.end(), input_deps_targets.begin(), input_deps_targets.end(),
[](const Target* a, const Target* b) { return a->label() < b->label(); }); [](const Target* a, const Target* b) { return a->label() < b->label(); });
for (const auto& dep : input_deps_targets) { for (auto* dep : input_deps_targets) {
DCHECK(!dep->dependency_output_file().value().empty()); DCHECK(!dep->dependency_output_file().value().empty());
out_ << " "; out_ << " ";
path_output_.WriteFile(out_, dep->dependency_output_file()); path_output_.WriteFile(out_, dep->dependency_output_file());
......
...@@ -136,7 +136,7 @@ void NinjaToolchainWriter::WriteRulePattern(const char* name, ...@@ -136,7 +136,7 @@ void NinjaToolchainWriter::WriteRulePattern(const char* name,
void NinjaToolchainWriter::WriteSubninjas() { void NinjaToolchainWriter::WriteSubninjas() {
// Write subninja commands for each generated target. // Write subninja commands for each generated target.
for (const auto& target : targets_) { for (auto* target : targets_) {
OutputFile ninja_file(target->settings()->build_settings(), OutputFile ninja_file(target->settings()->build_settings(),
GetNinjaFileForTarget(target)); GetNinjaFileForTarget(target));
out_ << "subninja "; out_ << "subninja ";
......
...@@ -58,7 +58,7 @@ bool NinjaWriter::WriteToolchains(std::vector<const Settings*>* all_settings, ...@@ -58,7 +58,7 @@ bool NinjaWriter::WriteToolchains(std::vector<const Settings*>* all_settings,
CategorizedMap categorized; CategorizedMap categorized;
std::vector<const BuilderRecord*> all_records = builder_->GetAllRecords(); std::vector<const BuilderRecord*> all_records = builder_->GetAllRecords();
for (const auto& all_record : all_records) { for (auto* all_record : all_records) {
if (all_record->type() == BuilderRecord::ITEM_TARGET && if (all_record->type() == BuilderRecord::ITEM_TARGET &&
all_record->should_generate()) { all_record->should_generate()) {
categorized[all_record->label().GetToolchainLabel()].push_back( categorized[all_record->label().GetToolchainLabel()].push_back(
......
...@@ -225,7 +225,7 @@ TEST(ParseTree, Integers) { ...@@ -225,7 +225,7 @@ TEST(ParseTree, Integers) {
"9223372036854775807", // INT64_MAX "9223372036854775807", // INT64_MAX
"-9223372036854775808", // INT64_MIN "-9223372036854775808", // INT64_MIN
}; };
for (auto s : kGood) { for (auto* s : kGood) {
TestParseInput input(std::string("x = ") + s); TestParseInput input(std::string("x = ") + s);
EXPECT_FALSE(input.has_error()); EXPECT_FALSE(input.has_error());
...@@ -242,7 +242,7 @@ TEST(ParseTree, Integers) { ...@@ -242,7 +242,7 @@ TEST(ParseTree, Integers) {
"9223372036854775808", // INT64_MAX + 1 "9223372036854775808", // INT64_MAX + 1
"-9223372036854775809", // INT64_MIN - 1 "-9223372036854775809", // INT64_MIN - 1
}; };
for (auto s : kBad) { for (auto* s : kBad) {
TestParseInput input(std::string("x = ") + s); TestParseInput input(std::string("x = ") + s);
EXPECT_FALSE(input.has_error()); EXPECT_FALSE(input.has_error());
......
...@@ -711,7 +711,7 @@ void Parser::AssignComments(ParseNode* file) { ...@@ -711,7 +711,7 @@ void Parser::AssignComments(ParseNode* file) {
// Assign line comments to syntax immediately following. // Assign line comments to syntax immediately following.
int cur_comment = 0; int cur_comment = 0;
for (const auto& node : pre) { for (auto* node : pre) {
const Location& start = node->GetRange().begin(); const Location& start = node->GetRange().begin();
while (cur_comment < static_cast<int>(line_comment_tokens_.size())) { while (cur_comment < static_cast<int>(line_comment_tokens_.size())) {
if (start.byte() >= line_comment_tokens_[cur_comment].location().byte()) { if (start.byte() >= line_comment_tokens_[cur_comment].location().byte()) {
......
...@@ -69,7 +69,7 @@ Scope::~Scope() { ...@@ -69,7 +69,7 @@ Scope::~Scope() {
const Value* Scope::GetValue(const base::StringPiece& ident, const Value* Scope::GetValue(const base::StringPiece& ident,
bool counts_as_used) { bool counts_as_used) {
// First check for programmatically-provided values. // First check for programmatically-provided values.
for (const auto& provider : programmatic_providers_) { for (auto* provider : programmatic_providers_) {
const Value* v = provider->GetProgrammaticValue(ident); const Value* v = provider->GetProgrammaticValue(ident);
if (v) if (v)
return v; return v;
......
...@@ -128,7 +128,7 @@ bool EnsureFileIsGeneratedByDependency(const Target* target, ...@@ -128,7 +128,7 @@ bool EnsureFileIsGeneratedByDependency(const Target* target,
return true; // Found a path. return true; // Found a path.
} }
if (target->output_type() == Target::CREATE_BUNDLE) { if (target->output_type() == Target::CREATE_BUNDLE) {
for (const auto& dep : target->bundle_data().bundle_deps()) { for (auto* dep : target->bundle_data().bundle_deps()) {
if (EnsureFileIsGeneratedByDependency(dep, file, false, if (EnsureFileIsGeneratedByDependency(dep, file, false,
consider_object_files, consider_object_files,
check_data_deps, seen_targets)) check_data_deps, seen_targets))
...@@ -521,7 +521,7 @@ void Target::PullRecursiveBundleData() { ...@@ -521,7 +521,7 @@ void Target::PullRecursiveBundleData() {
bundle_data_.AddBundleData(pair.ptr); bundle_data_.AddBundleData(pair.ptr);
// Recursive bundle_data informations from all dependencies. // Recursive bundle_data informations from all dependencies.
for (const auto& target : pair.ptr->bundle_data().bundle_deps()) for (auto* target : pair.ptr->bundle_data().bundle_deps())
bundle_data_.AddBundleData(target); bundle_data_.AddBundleData(target);
} }
......
...@@ -70,7 +70,7 @@ void SummarizeParses(std::vector<const TraceItem*>& loads, ...@@ -70,7 +70,7 @@ void SummarizeParses(std::vector<const TraceItem*>& loads,
out << "File parse times: (time in ms, name)\n"; out << "File parse times: (time in ms, name)\n";
std::sort(loads.begin(), loads.end(), &DurationGreater); std::sort(loads.begin(), loads.end(), &DurationGreater);
for (const auto& load : loads) { for (auto* load : loads) {
out << base::StringPrintf(" %8.2f ", load->delta().InMillisecondsF()); out << base::StringPrintf(" %8.2f ", load->delta().InMillisecondsF());
out << load->name() << std::endl; out << load->name() << std::endl;
} }
...@@ -80,7 +80,7 @@ void SummarizeCoalesced(std::vector<const TraceItem*>& items, ...@@ -80,7 +80,7 @@ void SummarizeCoalesced(std::vector<const TraceItem*>& items,
std::ostream& out) { std::ostream& out) {
// Group by file name. // Group by file name.
std::map<std::string, Coalesced> coalesced; std::map<std::string, Coalesced> coalesced;
for (const auto& item : items) { for (auto* item : items) {
Coalesced& c = coalesced[item->name()]; Coalesced& c = coalesced[item->name()];
c.name_ptr = &item->name(); c.name_ptr = &item->name();
c.total_duration += item->delta().InMillisecondsF(); c.total_duration += item->delta().InMillisecondsF();
...@@ -186,7 +186,7 @@ std::string SummarizeTraces() { ...@@ -186,7 +186,7 @@ std::string SummarizeTraces() {
std::vector<const TraceItem*> script_execs; std::vector<const TraceItem*> script_execs;
std::vector<const TraceItem*> check_headers; std::vector<const TraceItem*> check_headers;
int headers_checked = 0; int headers_checked = 0;
for (const auto& event : events) { for (auto* event : events) {
switch (event->type()) { switch (event->type()) {
case TraceItem::TRACE_FILE_PARSE: case TraceItem::TRACE_FILE_PARSE:
parses.push_back(event); parses.push_back(event);
...@@ -225,7 +225,7 @@ std::string SummarizeTraces() { ...@@ -225,7 +225,7 @@ std::string SummarizeTraces() {
// parallel. Just report the total of all of them. // parallel. Just report the total of all of them.
if (!check_headers.empty()) { if (!check_headers.empty()) {
double check_headers_time = 0; double check_headers_time = 0;
for (const auto& cur : check_headers) for (auto* cur : check_headers)
check_headers_time += cur->delta().InMillisecondsF(); check_headers_time += cur->delta().InMillisecondsF();
out << "Header check time: (total time in ms, files checked)\n"; out << "Header check time: (total time in ms, files checked)\n";
......
...@@ -419,7 +419,7 @@ void XcodeWriter::WriteProjectContent(std::ostream& out, PBXProject* project) { ...@@ -419,7 +419,7 @@ void XcodeWriter::WriteProjectContent(std::ostream& out, PBXProject* project) {
[](const PBXObject* a, const PBXObject* b) { [](const PBXObject* a, const PBXObject* b) {
return a->id() < b->id(); return a->id() < b->id();
}); });
for (const auto& object : pair.second) { for (auto* object : pair.second) {
object->Print(out, 2); object->Print(out, 2);
} }
out << "/* End " << ToString(pair.first) << " section */\n"; out << "/* End " << ToString(pair.first) << " section */\n";
......
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