| 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/functions.h" | 5 #include "tools/gn/functions.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "tools/gn/config.h" | 10 #include "tools/gn/config.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 Err* err) { | 127 Err* err) { |
| 128 if (args.size() != 1) { | 128 if (args.size() != 1) { |
| 129 *err = Err(function->function(), "Incorrect arguments.", | 129 *err = Err(function->function(), "Incorrect arguments.", |
| 130 "This function requires a single string argument."); | 130 "This function requires a single string argument."); |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 return args[0].VerifyTypeIs(Value::STRING, err); | 133 return args[0].VerifyTypeIs(Value::STRING, err); |
| 134 } | 134 } |
| 135 | 135 |
| 136 const Label& ToolchainLabelForScope(const Scope* scope) { | 136 const Label& ToolchainLabelForScope(const Scope* scope) { |
| 137 return scope->settings()->toolchain()->label(); | 137 return scope->settings()->toolchain_label(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 Label MakeLabelForScope(const Scope* scope, | 140 Label MakeLabelForScope(const Scope* scope, |
| 141 const FunctionCallNode* function, | 141 const FunctionCallNode* function, |
| 142 const std::string& name) { | 142 const std::string& name) { |
| 143 const Label& toolchain_label = ToolchainLabelForScope(scope); | 143 const Label& toolchain_label = ToolchainLabelForScope(scope); |
| 144 return Label(scope->GetSourceDir(), name, toolchain_label.dir(), | 144 return Label(scope->GetSourceDir(), name, toolchain_label.dir(), |
| 145 toolchain_label.name()); | 145 toolchain_label.name()); |
| 146 } | 146 } |
| 147 | 147 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 return found_function->second.executed_block_runner( | 643 return found_function->second.executed_block_runner( |
| 644 function, args.list_value(), &block_scope, err); | 644 function, args.list_value(), &block_scope, err); |
| 645 } | 645 } |
| 646 | 646 |
| 647 // Otherwise it's a no-block function. | 647 // Otherwise it's a no-block function. |
| 648 return found_function->second.no_block_runner(scope, function, | 648 return found_function->second.no_block_runner(scope, function, |
| 649 args.list_value(), err); | 649 args.list_value(), err); |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace functions | 652 } // namespace functions |
| OLD | NEW |