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

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

Issue 399143006: Check for unused variables in GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « third_party/yasm/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "tools/gn/functions.h" 5 #include "tools/gn/functions.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 if (found_function->second.executed_block_runner) { 732 if (found_function->second.executed_block_runner) {
733 if (!block) { 733 if (!block) {
734 FillNeedsBlockError(function, err); 734 FillNeedsBlockError(function, err);
735 return Value(); 735 return Value();
736 } 736 }
737 737
738 Scope block_scope(scope); 738 Scope block_scope(scope);
739 block->ExecuteBlockInScope(&block_scope, err); 739 block->ExecuteBlockInScope(&block_scope, err);
740 if (err->has_error()) 740 if (err->has_error())
741 return Value(); 741 return Value();
742 return found_function->second.executed_block_runner( 742
743 Value result = found_function->second.executed_block_runner(
743 function, args.list_value(), &block_scope, err); 744 function, args.list_value(), &block_scope, err);
745
746 if (!block_scope.CheckForUnusedVars(err))
747 return Value();
748 return result;
744 } 749 }
745 750
746 // Otherwise it's a no-block function. 751 // Otherwise it's a no-block function.
747 return found_function->second.no_block_runner(scope, function, 752 return found_function->second.no_block_runner(scope, function,
748 args.list_value(), err); 753 args.list_value(), err);
749 } 754 }
750 755
751 } // namespace functions 756 } // namespace functions
OLDNEW
« no previous file with comments | « third_party/yasm/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698