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

Unified Diff: tools/gn/scheduler.cc

Issue 1126193005: Check for inputs not generated by deps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data
Patch Set: Created 5 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
« no previous file with comments | « tools/gn/scheduler.h ('k') | tools/gn/setup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/scheduler.cc
diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc
index 488149b46ce0275af660956e8fd1bd8debbd5877..622019ef05635af0769107e0f7fa4e01ae31d451 100644
--- a/tools/gn/scheduler.cc
+++ b/tools/gn/scheduler.cc
@@ -108,6 +108,39 @@ std::vector<base::FilePath> Scheduler::GetGenDependencies() const {
return gen_dependencies_;
}
+void Scheduler::AddWrittenFile(const SourceFile& file) {
+ base::AutoLock lock(lock_);
+ written_files_.push_back(file);
+}
+
+void Scheduler::AddUnknownGeneratedInput(const Target* target,
+ const SourceFile& file) {
+ base::AutoLock lock(lock_);
+ unknown_generated_inputs_.insert(std::make_pair(file, target));
+}
+
+std::multimap<SourceFile, const Target*>
+ Scheduler::GetUnknownGeneratedInputs() const {
+ base::AutoLock lock(lock_);
+
+ // Remove all unknown inputs that were written files. These are OK as inputs
+ // to build steps since they were written as a side-effect of running GN.
+ //
+ // It's assumed that this function is called once during cleanup to check for
+ // errors, so performing this work in the lock doesn't matter.
+ std::multimap<SourceFile, const Target*> filtered = unknown_generated_inputs_;
+ for (const SourceFile& file : written_files_)
+ filtered.erase(file);
+
+ return filtered;
+}
+
+void Scheduler::ClearUnknownGeneratedInputsAndWrittenFiles() {
+ base::AutoLock lock(lock_);
+ unknown_generated_inputs_.clear();
+ written_files_.clear();
+}
+
void Scheduler::IncrementWorkCount() {
base::AtomicRefCountInc(&work_count_);
}
« no previous file with comments | « tools/gn/scheduler.h ('k') | tools/gn/setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698