Commit dba5bc56 authored by Paul's avatar Paul
Browse files

Improve print out of trace eval

parent 6eb13d95
......@@ -97,9 +97,9 @@ struct program
void perf_report(std::ostream& os, std::size_t n, parameter_map params) const;
void debug_print();
void debug_print(instruction_ref ins);
void debug_print(const std::vector<instruction_ref>& inss);
void debug_print() const;
void debug_print(instruction_ref ins) const;
void debug_print(const std::vector<instruction_ref>& inss) const;
friend std::ostream& operator<<(std::ostream& os, const program& p);
friend bool operator==(const program& x, const program& y);
......
......@@ -366,7 +366,8 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
auto& ctx = this->impl->ctx;
return generic_eval(*this, this->impl->ctx, std::move(params), [&](auto& ins, auto f) {
ctx.finish();
std::cout << "Run instruction: " << ins->name() << std::endl;
std::cout << "Run instruction: ";
this->debug_print(ins);
return f();
});
}
......@@ -473,8 +474,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
<< ", " << std::round(calculate_overhead_percent) << "%" << std::endl;
}
void program::debug_print() { std::cout << *this << std::endl; }
void program::debug_print(instruction_ref ins)
void program::debug_print() const { std::cout << *this << std::endl; }
void program::debug_print(instruction_ref ins) const
{
std::stringstream ss;
print_program(ss, *this, [&](auto x, auto&& names) {
......@@ -485,7 +486,7 @@ void program::debug_print(instruction_ref ins)
}
});
}
void program::debug_print(const std::vector<instruction_ref>& inss)
void program::debug_print(const std::vector<instruction_ref>& inss) const
{
for(auto ins : inss)
debug_print(ins);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment