diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-01-02 04:31:34 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-01-02 04:31:34 (GMT) |
commit | b2e6fcf7031cfaf995c65820d14d4aa390daf9fb (patch) | |
tree | febb947ed184e0bff21fa0556adc941c2dca4c82 /src/build_log.h | |
parent | 38db96cba7886aeaec7f9af7f5f2eb960d3e1175 (diff) | |
download | Ninja-b2e6fcf7031cfaf995c65820d14d4aa390daf9fb.zip Ninja-b2e6fcf7031cfaf995c65820d14d4aa390daf9fb.tar.gz Ninja-b2e6fcf7031cfaf995c65820d14d4aa390daf9fb.tar.bz2 |
Remove dead entries in .ninja_log and .ninja_deps while recompacting.
For .ninja_deps, remove objects that have no in-edges or whose in-edges
do not have a "deps" attribute. (This matches the behaviour of `-t
deps`).
BuildLog doesn't know about state, so let its recompact method take
delegate that decides is a path is life or not, and implement it in
NinjaMain.
Diffstat (limited to 'src/build_log.h')
-rw-r--r-- | src/build_log.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/build_log.h b/src/build_log.h index eeac5b3..bb474fc 100644 --- a/src/build_log.h +++ b/src/build_log.h @@ -25,6 +25,10 @@ using namespace std; struct Edge; +struct IsDead { + virtual bool IsPathDead(StringPiece s) = 0; +}; + /// Store a log of every command ran for every build. /// It has a few uses: /// @@ -36,7 +40,7 @@ struct BuildLog { BuildLog(); ~BuildLog(); - bool OpenForWrite(const string& path, string* err); + bool OpenForWrite(const string& path, IsDead* is_dead, string* err); // XXX bool RecordCommand(Edge* edge, int start_time, int end_time, TimeStamp restat_mtime = 0); void Close(); @@ -72,7 +76,7 @@ struct BuildLog { bool WriteEntry(FILE* f, const LogEntry& entry); /// Rewrite the known log entries, throwing away old data. - bool Recompact(const string& path, string* err); + bool Recompact(const string& path, IsDead* is_dead, string* err); // XXX typedef ExternalStringHashMap<LogEntry*>::Type Entries; const Entries& entries() const { return entries_; } |