OLD | NEW |
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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 131 } |
132 for (const auto& cur_file : target->public_headers()) { | 132 for (const auto& cur_file : target->public_headers()) { |
133 if (cur_file == file) | 133 if (cur_file == file) |
134 return true; | 134 return true; |
135 } | 135 } |
136 for (const auto& cur_file : target->inputs()) { | 136 for (const auto& cur_file : target->inputs()) { |
137 if (cur_file == file) | 137 if (cur_file == file) |
138 return true; | 138 return true; |
139 } | 139 } |
140 for (const auto& cur_file : target->data()) { | 140 for (const auto& cur_file : target->data()) { |
141 if (cur_file == file) | 141 if (cur_file == file.value()) |
142 return true; | 142 return true; |
143 } | 143 } |
144 return false; | 144 return false; |
145 } | 145 } |
146 | 146 |
147 void GetTargetsContainingFile(Setup* setup, | 147 void GetTargetsContainingFile(Setup* setup, |
148 const std::vector<const Target*>& all_targets, | 148 const std::vector<const Target*>& all_targets, |
149 const SourceFile& file, | 149 const SourceFile& file, |
150 bool all_toolchains, | 150 bool all_toolchains, |
151 UniqueVector<const Target*>* matches) { | 151 UniqueVector<const Target*>* matches) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 474 |
475 // If you ask for the references of a valid target, but that target has | 475 // If you ask for the references of a valid target, but that target has |
476 // nothing referencing it, we'll get here without having printed anything. | 476 // nothing referencing it, we'll get here without having printed anything. |
477 if (!quiet && cnt == 0) | 477 if (!quiet && cnt == 0) |
478 OutputString("Nothing references this.\n", DECORATION_YELLOW); | 478 OutputString("Nothing references this.\n", DECORATION_YELLOW); |
479 | 479 |
480 return 0; | 480 return 0; |
481 } | 481 } |
482 | 482 |
483 } // namespace commands | 483 } // namespace commands |
OLD | NEW |