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

Unified Diff: tools/gn/args.h

Issue 984353002: Makes declared_arguments per toolchain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/args.cc » ('j') | tools/gn/args.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/args.h
diff --git a/tools/gn/args.h b/tools/gn/args.h
index 6852c30930076f5346d021f431cec179e4fd2a4b..345516cb8148f034474dc2f8138bc77701277220 100644
--- a/tools/gn/args.h
+++ b/tools/gn/args.h
@@ -61,19 +61,15 @@ class Args {
// arguments. If there are, this returns false and sets the error.
bool VerifyAllOverridesUsed(Err* err) const;
- // Like VerifyAllOverridesUsed but takes the lists of overrides specified and
- // parameters declared.
- static bool VerifyAllOverridesUsed(
- const Scope::KeyValueMap& overrides,
- const Scope::KeyValueMap& declared_arguments,
- Err* err);
-
// Adds all declared arguments to the given output list. If the values exist
// in the list already, their values will be overwriten, but other values
// already in the list will remain.
void MergeDeclaredArguments(Scope::KeyValueMap* dest) const;
private:
+ using DeclaredArgumentsPerToolchain =
+ base::hash_map<const Settings*, Scope::KeyValueMap>;
+
// Sets the default config based on the current system.
void SetSystemVarsLocked(Scope* scope) const;
@@ -83,6 +79,10 @@ class Args {
void SaveOverrideRecordLocked(const Scope::KeyValueMap& values) const;
+ // Returns the KeyValueMap used for arguments declared for the specified
+ // toolchain.
+ Scope::KeyValueMap& DeclaredArgumentsForToolchainLocked(Scope* scope) const;
+
// Since this is called during setup which we assume is single-threaded,
// this is not protected by the lock. It should be set only during init.
Scope::KeyValueMap overrides_;
@@ -94,9 +94,12 @@ class Args {
// check for overrides that were specified but never used.
mutable Scope::KeyValueMap all_overrides_;
- // Tracks all variables declared in any buildfile. This is so we can see if
- // the user set variables on the command line that are not used anywhere.
- mutable Scope::KeyValueMap declared_arguments_;
+ // Maps from Settings (which corresponds to a toolchain) to the map of
+ // declared variables. This is used to tracks all variables declared in any
+ // buildfile. This is so we can see if the user set variables on the command
+ // line that are not used anywhere. Each map is toolchain specific as each
+ // toolchain may define variables in different locations.
+ mutable DeclaredArgumentsPerToolchain declared_arguments_per_toolchain_;
Args& operator=(const Args& other); // Disallow assignment.
};
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/args.cc » ('j') | tools/gn/args.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698