From ab4421747146aa7995f0cfb1a639c9121c82c915 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Jan 2015 13:27:15 +0200 Subject: Implement tracing support Also use to-relative path translation in diagnostics. --- build/algorithm.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build/algorithm.cxx') diff --git a/build/algorithm.cxx b/build/algorithm.cxx index fac0bf6..419bfaf 100644 --- a/build/algorithm.cxx +++ b/build/algorithm.cxx @@ -23,6 +23,8 @@ namespace build target* search (prerequisite& p) { + tracer tr ("search"); + assert (p.target == nullptr); //@@ TODO for now we just default to the directory scope. @@ -36,7 +38,7 @@ namespace build d.normalize (); } - //@@ TODO would be nice to first check if this target is + //@@ TODO: would be nice to first check if this target is // already in the set before allocating a new instance. // Find or insert. @@ -45,8 +47,9 @@ namespace build targets.emplace ( unique_ptr (p.type.factory (p.name, move (d))))); - //if (r.second) - // cout << "new target for prerequsite " << p << " " << d << endl; + trace (4, [&]{ + tr << (r.second ? "new" : "existing") << " target " << **r.first + << " for prerequsite " << p;}); return (p.target = r.first->get ()); } -- cgit v1.1