summaryrefslogtreecommitdiffstats
path: root/tools/gn/scope.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gn/scope.cc')
-rw-r--r--tools/gn/scope.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/gn/scope.cc b/tools/gn/scope.cc
index 9315749..437b31f 100644
--- a/tools/gn/scope.cc
+++ b/tools/gn/scope.cc
@@ -22,21 +22,24 @@ Scope::Scope(const Settings* settings)
: const_containing_(NULL),
mutable_containing_(NULL),
settings_(settings),
- mode_flags_(0) {
+ mode_flags_(0),
+ item_collector_(NULL) {
}
Scope::Scope(Scope* parent)
: const_containing_(NULL),
mutable_containing_(parent),
settings_(parent->settings()),
- mode_flags_(0) {
+ mode_flags_(0),
+ item_collector_(NULL) {
}
Scope::Scope(const Scope* parent)
: const_containing_(parent),
mutable_containing_(NULL),
settings_(parent->settings()),
- mode_flags_(0) {
+ mode_flags_(0),
+ item_collector_(NULL) {
}
Scope::~Scope() {
@@ -390,6 +393,14 @@ const SourceDir& Scope::GetSourceDir() const {
return source_dir_;
}
+Scope::ItemVector* Scope::GetItemCollector() {
+ if (item_collector_)
+ return item_collector_;
+ if (mutable_containing())
+ return mutable_containing()->GetItemCollector();
+ return NULL;
+}
+
void Scope::SetProperty(const void* key, void* value) {
if (!value) {
DCHECK(properties_.find(key) != properties_.end());