Well, RecomputeDirty() have to load deps early to check if child nodes are
dirty.

If I move the code into the function checking outputs, I will have to call
RecomputeOutputsDirty statting outputs BEFORE checking child nodes status.
This will work, and have the same performance for noop build (as we have to
stat everything in this worst case), but that will do some unnecessary
'stats' on the common case, where a single .c file is modified. Also, it
will start reloading depfiles and updating dependencies dynamically for
restat nodes.

I think that is a way more messy. Or, have I misunderstood you?

(BTW, I was thinking about keeping the flag but making some changes to
remove call to 'RecomputeOutputsDirty' from the 'CleanNode', but let's
first finish with the main purpose of this pull request and continue
refactoring on another one ;).


On Wed, Aug 28, 2013 at 1:38 AM, Nico Weber <notifications@github.com>wrote:

> In src/graph.cc:
>
> > @@ -141,9 +131,23 @@ bool DependencyScan::RecomputeDirty(Edge* edge, string* err) {
> >    return true;
> >  }
> >
> > +bool DependencyScan::RecomputeOutputsDirty(Edge* edge,
> > +                                           Node* most_recent_input) {
>
> Could this
>
> TimeStamp deps_mtime = 0;
> if (!dep_loader_.LoadDeps(edge, &deps_mtime, err)) {
>   if (!err->empty())
>     return false;
>   // Failed to load dependency info: rebuild to regenerate it.
>   dirty = true;
> }
>
> move to the top of this function too? Then outputs_invalid_ wouldn't be
> necessary, right?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/martine/ninja/pull/608/files#r6020731>
> .
>



-- 

Maxim