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

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

Issue 964203002: tools/gn: Fix errors found by Facebook's flint tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromium-style plugin errors 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
« no previous file with comments | « tools/gn/loader.h ('k') | tools/gn/parse_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29 matching lines...) Expand all
40 40
41 void operator()(const std::string& s, std::ostream& out) const { 41 void operator()(const std::string& s, std::ostream& out) const {
42 out << " -D"; 42 out << " -D";
43 EscapeStringToStream(out, s, options); 43 EscapeStringToStream(out, s, options);
44 } 44 }
45 45
46 EscapeOptions options; 46 EscapeOptions options;
47 }; 47 };
48 48
49 struct IncludeWriter { 49 struct IncludeWriter {
50 IncludeWriter(PathOutput& path_output) : path_output_(path_output) { 50 explicit IncludeWriter(PathOutput& path_output) : path_output_(path_output) {
51 } 51 }
52 ~IncludeWriter() { 52 ~IncludeWriter() {
53 } 53 }
54 54
55 void operator()(const SourceDir& d, std::ostream& out) const { 55 void operator()(const SourceDir& d, std::ostream& out) const {
56 std::ostringstream path_out; 56 std::ostringstream path_out;
57 path_output_.WriteDir(path_out, d, PathOutput::DIR_NO_LAST_SLASH); 57 path_output_.WriteDir(path_out, d, PathOutput::DIR_NO_LAST_SLASH);
58 const std::string& path = path_out.str(); 58 const std::string& path = path_out.str();
59 if (path[0] == '"') 59 if (path[0] == '"')
60 out << " \"-I" << path.substr(1); 60 out << " \"-I" << path.substr(1);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 return false; // No tool for this file (it's a header file or something). 472 return false; // No tool for this file (it's a header file or something).
473 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type); 473 const Tool* tool = target->toolchain()->GetTool(*computed_tool_type);
474 if (!tool) 474 if (!tool)
475 return false; // Tool does not apply for this toolchain.file. 475 return false; // Tool does not apply for this toolchain.file.
476 476
477 // Figure out what output(s) this compiler produces. 477 // Figure out what output(s) this compiler produces.
478 SubstitutionWriter::ApplyListToCompilerAsOutputFile( 478 SubstitutionWriter::ApplyListToCompilerAsOutputFile(
479 target, source, tool->outputs(), outputs); 479 target, source, tool->outputs(), outputs);
480 return !outputs->empty(); 480 return !outputs->empty();
481 } 481 }
OLDNEW
« no previous file with comments | « tools/gn/loader.h ('k') | tools/gn/parse_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698