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 "tools/gn/commands.h" | 5 #include "tools/gn/commands.h" |
6 #include "tools/gn/filesystem_utils.h" | 6 #include "tools/gn/filesystem_utils.h" |
7 #include "tools/gn/item.h" | 7 #include "tools/gn/item.h" |
8 #include "tools/gn/label.h" | 8 #include "tools/gn/label.h" |
9 #include "tools/gn/label_pattern.h" | 9 #include "tools/gn/label_pattern.h" |
10 #include "tools/gn/setup.h" | 10 #include "tools/gn/setup.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // explicitly. | 106 // explicitly. |
107 if (pattern.toolchain().is_null()) { | 107 if (pattern.toolchain().is_null()) { |
108 // No explicit toolchain set. | 108 // No explicit toolchain set. |
109 pattern.set_toolchain(setup->loader()->default_toolchain_label()); | 109 pattern.set_toolchain(setup->loader()->default_toolchain_label()); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 std::vector<const Target*> all_targets = | 113 std::vector<const Target*> all_targets = |
114 setup->builder()->GetAllResolvedTargets(); | 114 setup->builder()->GetAllResolvedTargets(); |
115 | 115 |
116 for (size_t i = 0; i < all_targets.size(); i++) { | 116 for (const auto& target : all_targets) { |
117 if (pattern.Matches(all_targets[i]->label())) | 117 if (pattern.Matches(target->label())) |
118 matches->push_back(all_targets[i]); | 118 matches->push_back(target); |
119 } | 119 } |
120 return true; | 120 return true; |
121 } | 121 } |
122 | 122 |
123 } // namespace commands | 123 } // namespace commands |
OLD | NEW |