From 91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 5 Oct 2017 21:52:50 +0200 Subject: Remove Log and Path dependency from CompiledGraph --- src/server/CompiledGraph.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/server/CompiledGraph.cpp') diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp index 337baf95..0d51f284 100644 --- a/src/server/CompiledGraph.cpp +++ b/src/server/CompiledGraph.cpp @@ -53,9 +53,7 @@ has_provider_with_many_dependants(BlockImpl* n) } CompiledGraph::CompiledGraph(GraphImpl* graph) - : _log(graph->engine().log()) - , _path(graph->path()) - , _master(Task::Mode::SEQUENTIAL) + : _master(Task::Mode::SEQUENTIAL) { compile_graph(graph); } @@ -146,10 +144,8 @@ CompiledGraph::compile_graph(GraphImpl* graph) _master = Task::simplify(std::move(_master)); if (graph->engine().world()->conf().option("trace").get()) { - dump([this](const std::string& msg) { - ColorContext ctx(stderr, ColorContext::Color::YELLOW); - fwrite(msg.c_str(), 1, msg.size(), stderr); - }); + ColorContext ctx(stderr, ColorContext::Color::YELLOW); + dump(graph->path()); } } @@ -261,10 +257,14 @@ CompiledGraph::run(RunContext& context) } void -CompiledGraph::dump(std::function sink) const +CompiledGraph::dump(const std::string& name) const { + auto sink = [](const std::string& s) { + fwrite(s.c_str(), 1, s.size(), stderr); + }; + sink("(compiled-graph "); - sink(_path); + sink(name); _master.dump(sink, 2, false); sink(")\n"); } -- cgit v1.2.1