Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: tools/gn/function_toolchain.cc

Issue 654263004: Simplify ScopedVector<scoped_ptr<T>> to ScopedVector<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698