aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
commitab4421747146aa7995f0cfb1a639c9121c82c915 (patch)
treedeb08893c02ed0238f73becbbe80ede5568b946e /build/algorithm.cxx
parentd3e624ef7c0fb274e62b81c4c7bd59640770520a (diff)
Implement tracing support
Also use to-relative path translation in diagnostics.
Diffstat (limited to 'build/algorithm.cxx')
-rw-r--r--build/algorithm.cxx9
1 files changed, 6 insertions, 3 deletions
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<target> (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 ());
}