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/builder.h" | 5 #include "tools/gn/builder.h" |
6 | 6 |
7 #include "tools/gn/config.h" | 7 #include "tools/gn/config.h" |
8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
9 #include "tools/gn/loader.h" | 9 #include "tools/gn/loader.h" |
10 #include "tools/gn/scheduler.h" | 10 #include "tools/gn/scheduler.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 BuilderRecord* Builder::GetResolvedRecordOfType(const Label& label, | 274 BuilderRecord* Builder::GetResolvedRecordOfType(const Label& label, |
275 const ParseNode* origin, | 275 const ParseNode* origin, |
276 BuilderRecord::ItemType type, | 276 BuilderRecord::ItemType type, |
277 Err* err) { | 277 Err* err) { |
278 BuilderRecord* record = GetRecord(label); | 278 BuilderRecord* record = GetRecord(label); |
279 if (!record) { | 279 if (!record) { |
280 *err = Err(origin, "Item not found", | 280 *err = Err(origin, "Item not found", |
281 "\"" + label.GetUserVisibleName(false) + "\" doesn't\n" | 281 "\"" + label.GetUserVisibleName(false) + "\" doesn't\n" |
282 "refer to an existant thing."); | 282 "refer to an existent thing."); |
283 return NULL; | 283 return NULL; |
284 } | 284 } |
285 | 285 |
286 const Item* item = record->item(); | 286 const Item* item = record->item(); |
287 if (!item) { | 287 if (!item) { |
288 *err = Err(origin, "Item not resolved.", | 288 *err = Err(origin, "Item not resolved.", |
289 "\"" + label.GetUserVisibleName(false) + "\" hasn't been resolved.\n"); | 289 "\"" + label.GetUserVisibleName(false) + "\" hasn't been resolved.\n"); |
290 return NULL; | 290 return NULL; |
291 } | 291 } |
292 | 292 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // Walk backwards since the dependency arrows point in the reverse direction. | 462 // Walk backwards since the dependency arrows point in the reverse direction. |
463 std::string ret; | 463 std::string ret; |
464 for (int i = static_cast<int>(cycle.size()) - 1; i >= 0; i--) { | 464 for (int i = static_cast<int>(cycle.size()) - 1; i >= 0; i--) { |
465 ret += " " + cycle[i]->label().GetUserVisibleName(false); | 465 ret += " " + cycle[i]->label().GetUserVisibleName(false); |
466 if (i != 0) | 466 if (i != 0) |
467 ret += " ->\n"; | 467 ret += " ->\n"; |
468 } | 468 } |
469 | 469 |
470 return ret; | 470 return ret; |
471 } | 471 } |
OLD | NEW |