Fix auto raw pointer deduction on linux
This patch fixes all of the places where the auto raw
pointer deduction is happening on linux
R=danakj@chromium.org
BUG=554600
Review-Url: https://codereview.chromium.org/2691393002
Cr-Original-Commit-Position: refs/heads/master@{#452312}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6d9996c865dc8d6901d0a004ff676d1215f4593c
diff --git a/tools/gn/analyzer.cc b/tools/gn/analyzer.cc
index 06f9336..559287e 100644
--- a/tools/gn/analyzer.cc
+++ b/tools/gn/analyzer.cc
@@ -51,13 +51,13 @@
LabelSet LabelsFor(const TargetSet& targets) {
LabelSet labels;
- for (const auto& target : targets)
+ for (auto* target : targets)
labels.insert(target->label());
return labels;
}
bool AnyBuildFilesWereModified(const SourceFileSet& source_files) {
- for (const auto& file : source_files) {
+ for (auto* file : source_files) {
if (base::EndsWith(file->value(), ".gn", base::CompareCase::SENSITIVE) ||
base::EndsWith(file->value(), ".gni", base::CompareCase::SENSITIVE))
return true;
@@ -287,7 +287,7 @@
TargetSet compile_targets = TargetsFor(inputs.compile_labels);
if (inputs.compile_included_all) {
- for (auto& root : roots_)
+ for (auto* root : roots_)
compile_targets.insert(root);
}
TargetSet filtered_targets = Filter(compile_targets);
@@ -307,10 +307,10 @@
TargetSet Analyzer::AllAffectedTargets(
const SourceFileSet& source_files) const {
TargetSet direct_matches;
- for (const auto& source_file : source_files)
+ for (auto* source_file : source_files)
AddTargetsDirectlyReferringToFileTo(source_file, &direct_matches);
TargetSet all_matches;
- for (const auto& match : direct_matches)
+ for (auto* match : direct_matches)
AddAllRefsTo(match, &all_matches);
return all_matches;
}
@@ -392,7 +392,7 @@
void Analyzer::AddTargetsDirectlyReferringToFileTo(const SourceFile* file,
TargetSet* matches) const {
- for (const auto& target : all_targets_) {
+ for (auto* target : all_targets_) {
// Only handles targets in the default toolchain.
if ((target->label().GetToolchainLabel() == default_toolchain_) &&
TargetRefersToFile(target, file))
diff --git a/tools/gn/import_manager.cc b/tools/gn/import_manager.cc
index 0213c33..c9a44d4 100644
--- a/tools/gn/import_manager.cc
+++ b/tools/gn/import_manager.cc
@@ -111,7 +111,7 @@
base::TimeDelta::FromMilliseconds(20);
if (TracingEnabled() &&
import_block_end - import_block_begin > kImportBlockTraceThreshold) {
- auto import_block_trace =
+ auto* import_block_trace =
new TraceItem(TraceItem::TRACE_IMPORT_BLOCK, file.value(),
base::PlatformThread::CurrentId());
import_block_trace->set_begin(import_block_begin);