Chromium Code Reviews| 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 #ifndef TOOLS_GN_ARGS_H_ | 5 #ifndef TOOLS_GN_ARGS_H_ |
| 6 #define TOOLS_GN_ARGS_H_ | 6 #define TOOLS_GN_ARGS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/macros.h" | |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "tools/gn/err.h" | |
| 12 #include "tools/gn/scope.h" | 11 #include "tools/gn/scope.h" |
| 13 | 12 |
| 13 class Err; | |
| 14 | |
| 14 extern const char kBuildArgs_Help[]; | 15 extern const char kBuildArgs_Help[]; |
| 15 | 16 |
| 16 // Manages build arguments. It stores the global arguments specified on the | 17 // Manages build arguments. It stores the global arguments specified on the |
| 17 // command line, and sets up the root scope with the proper values. | 18 // command line, and sets up the root scope with the proper values. |
| 18 // | 19 // |
| 19 // This class tracks accesses so we can report errors about unused variables. | 20 // This class tracks accesses so we can report errors about unused variables. |
| 20 // The use case is if the user specifies an override on the command line, but | 21 // The use case is if the user specifies an override on the command line, but |
| 21 // no buildfile actually uses that variable. We want to be able to report that | 22 // no buildfile actually uses that variable. We want to be able to report that |
| 22 // the argument was unused. | 23 // the argument was unused. |
| 23 class Args { | 24 class Args { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 // check for overrides that were specified but never used. | 95 // check for overrides that were specified but never used. |
| 95 mutable Scope::KeyValueMap all_overrides_; | 96 mutable Scope::KeyValueMap all_overrides_; |
| 96 | 97 |
| 97 // Maps from Settings (which corresponds to a toolchain) to the map of | 98 // Maps from Settings (which corresponds to a toolchain) to the map of |
| 98 // declared variables. This is used to tracks all variables declared in any | 99 // declared variables. This is used to tracks all variables declared in any |
| 99 // buildfile. This is so we can see if the user set variables on the command | 100 // buildfile. This is so we can see if the user set variables on the command |
| 100 // line that are not used anywhere. Each map is toolchain specific as each | 101 // line that are not used anywhere. Each map is toolchain specific as each |
| 101 // toolchain may define variables in different locations. | 102 // toolchain may define variables in different locations. |
| 102 mutable DeclaredArgumentsPerToolchain declared_arguments_per_toolchain_; | 103 mutable DeclaredArgumentsPerToolchain declared_arguments_per_toolchain_; |
| 103 | 104 |
| 104 Args& operator=(const Args& other); // Disallow assignment. | 105 DISALLOW_ASSIGN(Args); |
|
brettw
2015/08/09 17:15:18
Ah yeah, I used to copy this around, but all that
| |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 #endif // TOOLS_GN_ARGS_H_ | 108 #endif // TOOLS_GN_ARGS_H_ |
| OLD | NEW |