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

Unified Diff: tools/gn/scope.h

Issue 2940873002: Implement tracking of BUILD.gn files used to define target, toolchain or (Closed)
Patch Set: Use base::flat_set instead of std::set. Created 3 years, 6 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
Index: tools/gn/scope.h
diff --git a/tools/gn/scope.h b/tools/gn/scope.h
index 31bac6261464826a3bd069b3dd7d87ba5f5eaeba..8e053f8a14e9a631ae2713f9a73b9829b328bf1c 100644
--- a/tools/gn/scope.h
+++ b/tools/gn/scope.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "tools/gn/err.h"
+#include "tools/gn/input_file.h"
#include "tools/gn/pattern.h"
#include "tools/gn/source_dir.h"
#include "tools/gn/value.h"
@@ -99,7 +100,7 @@ class Scope {
};
// Creates an empty toplevel scope.
- explicit Scope(const Settings* settings);
+ Scope(const Settings* settings, const InputFileSet& input_files);
// Creates a dependent scope.
explicit Scope(Scope* parent);
@@ -283,6 +284,10 @@ class Scope {
const SourceDir& GetSourceDir() const;
void set_source_dir(const SourceDir& d) { source_dir_ = d; }
+ // The set of source files which affected this scope.
+ const InputFileSet& input_files() const { return input_files_; }
+ void AddInputFile(const InputFile* input_file);
+
// The item collector is where Items (Targets, Configs, etc.) go that have
// been defined. If a scope can generate items, this non-owning pointer will
// point to the storage for such items. The creator of this scope will be
@@ -378,6 +383,8 @@ class Scope {
SourceDir source_dir_;
+ InputFileSet input_files_;
+
DISALLOW_COPY_AND_ASSIGN(Scope);
};

Powered by Google App Engine
This is Rietveld 408576698