| 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 | 7 |
| 8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
| 9 #include "tools/gn/functions.h" | 9 #include "tools/gn/functions.h" |
| 10 #include "tools/gn/parse_tree.h" | 10 #include "tools/gn/parse_tree.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (!block_scope.CheckForUnusedVars(err)) | 335 if (!block_scope.CheckForUnusedVars(err)) |
| 336 return Value(); | 336 return Value(); |
| 337 | 337 |
| 338 // Save this toolchain. | 338 // Save this toolchain. |
| 339 toolchain->ToolchainSetupComplete(); | 339 toolchain->ToolchainSetupComplete(); |
| 340 Scope::ItemVector* collector = scope->GetItemCollector(); | 340 Scope::ItemVector* collector = scope->GetItemCollector(); |
| 341 if (!collector) { | 341 if (!collector) { |
| 342 *err = Err(function, "Can't define a toolchain in this context."); | 342 *err = Err(function, "Can't define a toolchain in this context."); |
| 343 return Value(); | 343 return Value(); |
| 344 } | 344 } |
| 345 collector->push_back(new scoped_ptr<Item>(toolchain.PassAs<Item>())); | 345 collector->push_back(toolchain.release()); |
| 346 return Value(); | 346 return Value(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 // tool ------------------------------------------------------------------------ | 349 // tool ------------------------------------------------------------------------ |
| 350 | 350 |
| 351 const char kTool[] = "tool"; | 351 const char kTool[] = "tool"; |
| 352 const char kTool_HelpShort[] = | 352 const char kTool_HelpShort[] = |
| 353 "tool: Specify arguments to a toolchain tool."; | 353 "tool: Specify arguments to a toolchain tool."; |
| 354 const char kTool_Help[] = | 354 const char kTool_Help[] = |
| 355 "tool: Specify arguments to a toolchain tool.\n" | 355 "tool: Specify arguments to a toolchain tool.\n" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 return Value(); | 911 return Value(); |
| 912 | 912 |
| 913 Scope::KeyValueMap values; | 913 Scope::KeyValueMap values; |
| 914 block_scope.GetCurrentScopeValues(&values); | 914 block_scope.GetCurrentScopeValues(&values); |
| 915 toolchain->args() = values; | 915 toolchain->args() = values; |
| 916 | 916 |
| 917 return Value(); | 917 return Value(); |
| 918 } | 918 } |
| 919 | 919 |
| 920 } // namespace functions | 920 } // namespace functions |
| OLD | NEW |