Index: tools/gn/scope.cc |
diff --git a/tools/gn/scope.cc b/tools/gn/scope.cc |
index f2fe7521dfafc8e94f5a6c35ff2723a9ec960c9f..437fdba835e083d186005d20f3f4c82e5d711faa 100644 |
--- a/tools/gn/scope.cc |
+++ b/tools/gn/scope.cc |
@@ -219,6 +219,16 @@ void Scope::MarkAllUsed() { |
cur.second.used = true; |
} |
+void Scope::MarkAllUsed(const std::set<std::string>& excluded_values) { |
+ for (auto& cur : values_) { |
+ if (!excluded_values.empty() && |
+ excluded_values.find(cur.first.as_string()) != excluded_values.end()) { |
+ continue; // Skip this excluded value. |
+ } |
+ cur.second.used = true; |
+ } |
+} |
+ |
void Scope::MarkUnused(const base::StringPiece& ident) { |
RecordMap::iterator found = values_.find(ident); |
if (found == values_.end()) { |