| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 if (err->has_error()) | 360 if (err->has_error()) |
| 361 return Value(); | 361 return Value(); |
| 362 | 362 |
| 363 // Save the generated item. | 363 // Save the generated item. |
| 364 Scope::ItemVector* collector = scope->GetItemCollector(); | 364 Scope::ItemVector* collector = scope->GetItemCollector(); |
| 365 if (!collector) { | 365 if (!collector) { |
| 366 *err = Err(function, "Can't define a config in this context."); | 366 *err = Err(function, "Can't define a config in this context."); |
| 367 return Value(); | 367 return Value(); |
| 368 } | 368 } |
| 369 collector->push_back(config.release()); | 369 collector->push_back(std::move(config)); |
| 370 | 370 |
| 371 return Value(); | 371 return Value(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 // declare_args ---------------------------------------------------------------- | 374 // declare_args ---------------------------------------------------------------- |
| 375 | 375 |
| 376 const char kDeclareArgs[] = "declare_args"; | 376 const char kDeclareArgs[] = "declare_args"; |
| 377 const char kDeclareArgs_HelpShort[] = | 377 const char kDeclareArgs_HelpShort[] = |
| 378 "declare_args: Declare build arguments."; | 378 "declare_args: Declare build arguments."; |
| 379 const char kDeclareArgs_Help[] = | 379 const char kDeclareArgs_Help[] = |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 std::unique_ptr<Pool> pool( | 912 std::unique_ptr<Pool> pool( |
| 913 new Pool(scope->settings(), label, scope->input_files())); | 913 new Pool(scope->settings(), label, scope->input_files())); |
| 914 pool->set_depth(depth->int_value()); | 914 pool->set_depth(depth->int_value()); |
| 915 | 915 |
| 916 // Save the generated item. | 916 // Save the generated item. |
| 917 Scope::ItemVector* collector = scope->GetItemCollector(); | 917 Scope::ItemVector* collector = scope->GetItemCollector(); |
| 918 if (!collector) { | 918 if (!collector) { |
| 919 *err = Err(function, "Can't define a pool in this context."); | 919 *err = Err(function, "Can't define a pool in this context."); |
| 920 return Value(); | 920 return Value(); |
| 921 } | 921 } |
| 922 collector->push_back(pool.release()); | 922 collector->push_back(std::move(pool)); |
| 923 | 923 |
| 924 return Value(); | 924 return Value(); |
| 925 } | 925 } |
| 926 | 926 |
| 927 // print ----------------------------------------------------------------------- | 927 // print ----------------------------------------------------------------------- |
| 928 | 928 |
| 929 const char kPrint[] = "print"; | 929 const char kPrint[] = "print"; |
| 930 const char kPrint_HelpShort[] = | 930 const char kPrint_HelpShort[] = |
| 931 "print: Prints to the console."; | 931 "print: Prints to the console."; |
| 932 const char kPrint_Help[] = | 932 const char kPrint_Help[] = |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 // Otherwise it's a no-block function. | 1258 // Otherwise it's a no-block function. |
| 1259 if (!VerifyNoBlockForFunctionCall(function, block, err)) | 1259 if (!VerifyNoBlockForFunctionCall(function, block, err)) |
| 1260 return Value(); | 1260 return Value(); |
| 1261 return found_function->second.no_block_runner(scope, function, | 1261 return found_function->second.no_block_runner(scope, function, |
| 1262 args.list_value(), err); | 1262 args.list_value(), err); |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 } // namespace functions | 1265 } // namespace functions |
| OLD | NEW |