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

Side by Side Diff: tools/gn/scope.h

Issue 2936923002: Add not_needed function (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « tools/gn/functions_target_unittest.cc ('k') | tools/gn/scope.cc » ('j') | 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 #ifndef TOOLS_GN_SCOPE_H_ 5 #ifndef TOOLS_GN_SCOPE_H_
6 #define TOOLS_GN_SCOPE_H_ 6 #define TOOLS_GN_SCOPE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // Templates associated with this scope. A template can only be set once, so 199 // Templates associated with this scope. A template can only be set once, so
200 // AddTemplate will fail and return false if a rule with that name already 200 // AddTemplate will fail and return false if a rule with that name already
201 // exists. GetTemplate returns NULL if the rule doesn't exist, and it will 201 // exists. GetTemplate returns NULL if the rule doesn't exist, and it will
202 // check all containing scoped rescursively. 202 // check all containing scoped rescursively.
203 bool AddTemplate(const std::string& name, const Template* templ); 203 bool AddTemplate(const std::string& name, const Template* templ);
204 const Template* GetTemplate(const std::string& name) const; 204 const Template* GetTemplate(const std::string& name) const;
205 205
206 // Marks the given identifier as (un)used in the current scope. 206 // Marks the given identifier as (un)used in the current scope.
207 void MarkUsed(const base::StringPiece& ident); 207 void MarkUsed(const base::StringPiece& ident);
208 void MarkAllUsed(); 208 void MarkAllUsed();
209 void MarkAllUsed(const std::set<std::string>& excluded_values);
209 void MarkUnused(const base::StringPiece& ident); 210 void MarkUnused(const base::StringPiece& ident);
210 211
211 // Checks to see if the scope has a var set that hasn't been used. This is 212 // Checks to see if the scope has a var set that hasn't been used. This is
212 // called before replacing the var with a different one. It does not check 213 // called before replacing the var with a different one. It does not check
213 // containing scopes. 214 // containing scopes.
214 // 215 //
215 // If the identifier is present but hasnn't been used, return true. 216 // If the identifier is present but hasnn't been used, return true.
216 bool IsSetButUnused(const base::StringPiece& ident) const; 217 bool IsSetButUnused(const base::StringPiece& ident) const;
217 218
218 // Checks the scope to see if any values were set but not used, and fills in 219 // Checks the scope to see if any values were set but not used, and fills in
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 376
376 typedef std::set<ProgrammaticProvider*> ProviderSet; 377 typedef std::set<ProgrammaticProvider*> ProviderSet;
377 ProviderSet programmatic_providers_; 378 ProviderSet programmatic_providers_;
378 379
379 SourceDir source_dir_; 380 SourceDir source_dir_;
380 381
381 DISALLOW_COPY_AND_ASSIGN(Scope); 382 DISALLOW_COPY_AND_ASSIGN(Scope);
382 }; 383 };
383 384
384 #endif // TOOLS_GN_SCOPE_H_ 385 #endif // TOOLS_GN_SCOPE_H_
OLDNEW
« no previous file with comments | « tools/gn/functions_target_unittest.cc ('k') | tools/gn/scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698