Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: tools/gn/ninja_binary_target_writer.cc

Issue 986113002: tools/gn: Convert for loops to use the new range-based loops in C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/ninja_binary_target_writer.h" 5 #include "tools/gn/ninja_binary_target_writer.h"
6 6
7 #include <set> 7 #include <set>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 } 434 }
435 } 435 }
436 436
437 void NinjaBinaryTargetWriter::WriteOrderOnlyDependencies( 437 void NinjaBinaryTargetWriter::WriteOrderOnlyDependencies(
438 const UniqueVector<const Target*>& non_linkable_deps) { 438 const UniqueVector<const Target*>& non_linkable_deps) {
439 const std::vector<SourceFile>& data = target_->data(); 439 const std::vector<SourceFile>& data = target_->data();
440 if (!non_linkable_deps.empty() || !data.empty()) { 440 if (!non_linkable_deps.empty() || !data.empty()) {
441 out_ << " ||"; 441 out_ << " ||";
442 442
443 // Non-linkable targets. 443 // Non-linkable targets.
444 for (size_t i = 0; i < non_linkable_deps.size(); i++) { 444 for (const auto& non_linkable_dep : non_linkable_deps) {
445 out_ << " "; 445 out_ << " ";
446 path_output_.WriteFile( 446 path_output_.WriteFile(out_, non_linkable_dep->dependency_output_file());
447 out_, non_linkable_deps[i]->dependency_output_file());
448 } 447 }
449 } 448 }
450 } 449 }
451 450
452 bool NinjaBinaryTargetWriter::GetOutputFilesForSource( 451 bool NinjaBinaryTargetWriter::GetOutputFilesForSource(
453 const Target* target, 452 const Target* target,
454 const SourceFile& source, 453 const SourceFile& source,
455 Toolchain::ToolType* computed_tool_type, 454 Toolchain::ToolType* computed_tool_type,
456 std::vector<OutputFile>* outputs) const { 455 std::vector<OutputFile>* outputs) const {
457 outputs->clear(); 456 outputs->clear();
(...skipping 14 matching lines...) Expand all
472 return false; // No tool for this file (it's a header file or something). 471 return false; // No tool for this file (it's a header file or something).
473 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type); 472 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type);
474 if (!tool) 473 if (!tool)
475 return false; // Tool does not apply for this toolchain.file. 474 return false; // Tool does not apply for this toolchain.file.
476 475
477 // Figure out what output(s) this compiler produces. 476 // Figure out what output(s) this compiler produces.
478 SubstitutionWriter::ApplyListToCompilerAsOutputFile( 477 SubstitutionWriter::ApplyListToCompilerAsOutputFile(
479 target, source, tool->outputs(), outputs); 478 target, source, tool->outputs(), outputs);
480 return !outputs->empty(); 479 return !outputs->empty();
481 } 480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698