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 <algorithm> | 5 #include <algorithm> |
6 #include <limits> | 6 #include <limits> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
10 #include "tools/gn/functions.h" | 10 #include "tools/gn/functions.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (!block_scope.CheckForUnusedVars(err)) | 489 if (!block_scope.CheckForUnusedVars(err)) |
490 return Value(); | 490 return Value(); |
491 | 491 |
492 // Save this toolchain. | 492 // Save this toolchain. |
493 toolchain->ToolchainSetupComplete(); | 493 toolchain->ToolchainSetupComplete(); |
494 Scope::ItemVector* collector = scope->GetItemCollector(); | 494 Scope::ItemVector* collector = scope->GetItemCollector(); |
495 if (!collector) { | 495 if (!collector) { |
496 *err = Err(function, "Can't define a toolchain in this context."); | 496 *err = Err(function, "Can't define a toolchain in this context."); |
497 return Value(); | 497 return Value(); |
498 } | 498 } |
499 collector->push_back(toolchain.release()); | 499 collector->push_back(std::move(toolchain)); |
500 return Value(); | 500 return Value(); |
501 } | 501 } |
502 | 502 |
503 // tool ------------------------------------------------------------------------ | 503 // tool ------------------------------------------------------------------------ |
504 | 504 |
505 const char kTool[] = "tool"; | 505 const char kTool[] = "tool"; |
506 const char kTool_HelpShort[] = | 506 const char kTool_HelpShort[] = |
507 "tool: Specify arguments to a toolchain tool."; | 507 "tool: Specify arguments to a toolchain tool."; |
508 const char kTool_Help[] = | 508 const char kTool_Help[] = |
509 R"(tool: Specify arguments to a toolchain tool. | 509 R"(tool: Specify arguments to a toolchain tool. |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 | 1084 |
1085 // Make sure there weren't any vars set in this tool that were unused. | 1085 // Make sure there weren't any vars set in this tool that were unused. |
1086 if (!block_scope.CheckForUnusedVars(err)) | 1086 if (!block_scope.CheckForUnusedVars(err)) |
1087 return Value(); | 1087 return Value(); |
1088 | 1088 |
1089 toolchain->SetTool(tool_type, std::move(tool)); | 1089 toolchain->SetTool(tool_type, std::move(tool)); |
1090 return Value(); | 1090 return Value(); |
1091 } | 1091 } |
1092 | 1092 |
1093 } // namespace functions | 1093 } // namespace functions |
OLD | NEW |