OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef TOOLS_GN_HEADER_CHECKER_H_ | 5 #ifndef TOOLS_GN_HEADER_CHECKER_H_ |
6 #define TOOLS_GN_HEADER_CHECKER_H_ | 6 #define TOOLS_GN_HEADER_CHECKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 Chain* chain, | 141 Chain* chain, |
142 bool* is_permitted) const; | 142 bool* is_permitted) const; |
143 | 143 |
144 // For internal use by the previous override of IsDependencyOf. If | 144 // For internal use by the previous override of IsDependencyOf. If |
145 // require_public is true, only public dependency chains are searched. | 145 // require_public is true, only public dependency chains are searched. |
146 bool IsDependencyOf(const Target* search_for, | 146 bool IsDependencyOf(const Target* search_for, |
147 const Target* search_from, | 147 const Target* search_from, |
148 bool require_permitted, | 148 bool require_permitted, |
149 Chain* chain) const; | 149 Chain* chain) const; |
150 | 150 |
| 151 // Makes a very descriptive error message for when an include is disallowed |
| 152 // from a given from_target, with a missing dependency to one of the given |
| 153 // targets. |
| 154 static Err MakeUnreachableError(const InputFile& source_file, |
| 155 const LocationRange& range, |
| 156 const Target* from_target, |
| 157 const TargetVector& targets); |
| 158 |
151 // Non-locked variables ------------------------------------------------------ | 159 // Non-locked variables ------------------------------------------------------ |
152 // | 160 // |
153 // These are initialized during construction (which happens on one thread) | 161 // These are initialized during construction (which happens on one thread) |
154 // and are not modified after, so any thread can read these without locking. | 162 // and are not modified after, so any thread can read these without locking. |
155 | 163 |
156 base::MessageLoop* main_loop_; | 164 base::MessageLoop* main_loop_; |
157 base::RunLoop main_thread_runner_; | 165 base::RunLoop main_thread_runner_; |
158 | 166 |
159 const BuildSettings* build_settings_; | 167 const BuildSettings* build_settings_; |
160 | 168 |
161 // Maps source files to targets it appears in (usually just one target). | 169 // Maps source files to targets it appears in (usually just one target). |
162 FileMap file_map_; | 170 FileMap file_map_; |
163 | 171 |
164 // Locked variables ---------------------------------------------------------- | 172 // Locked variables ---------------------------------------------------------- |
165 // | 173 // |
166 // These are mutable during runtime and require locking. | 174 // These are mutable during runtime and require locking. |
167 | 175 |
168 base::Lock lock_; | 176 base::Lock lock_; |
169 | 177 |
170 std::vector<Err> errors_; | 178 std::vector<Err> errors_; |
171 | 179 |
172 DISALLOW_COPY_AND_ASSIGN(HeaderChecker); | 180 DISALLOW_COPY_AND_ASSIGN(HeaderChecker); |
173 }; | 181 }; |
174 | 182 |
175 #endif // TOOLS_GN_HEADER_CHECKER_H_ | 183 #endif // TOOLS_GN_HEADER_CHECKER_H_ |
OLD | NEW |