summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 90791f9..2cdba80 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -31,14 +31,13 @@ bool FileStat::Stat(DiskInterface* disk_interface) {
bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
string* err) {
bool dirty = false;
+ outputs_ready_ = true;
if (!rule_->depfile_.empty()) {
if (!LoadDepFile(state, disk_interface, err))
return false;
}
- outputs_ready_ = true;
-
// Visit all inputs; we're dirty if any of the inputs are dirty.
time_t most_recent_input = 1;
for (vector<Node*>::iterator i = inputs_.begin(); i != inputs_.end(); ++i) {
@@ -53,19 +52,20 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
}
// If an input is not ready, neither are our outputs.
- if (Edge* edge = (*i)->in_edge_)
+ if (Edge* edge = (*i)->in_edge_) {
if (!edge->outputs_ready_)
outputs_ready_ = false;
+ }
if (!is_order_only(i - inputs_.begin())) {
- // If a regular input is dirty (or missing), we're dirty.
- // Otherwise consider mtime.
- if ((*i)->dirty_) {
- dirty = true;
- } else {
- if ((*i)->file_->mtime_ > most_recent_input)
- most_recent_input = (*i)->file_->mtime_;
- }
+ // If a regular input is dirty (or missing), we're dirty.
+ // Otherwise consider mtime.
+ if ((*i)->dirty_) {
+ dirty = true;
+ } else {
+ if ((*i)->file_->mtime_ > most_recent_input)
+ most_recent_input = (*i)->file_->mtime_;
+ }
}
}