Commit d68d3b7e authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent f5681052
...@@ -77,7 +77,8 @@ struct program ...@@ -77,7 +77,8 @@ struct program
void debug_print() const; void debug_print() const;
void debug_print(instruction_ref ins) const; void debug_print(instruction_ref ins) const;
void debug_print(instruction_ref ins, const std::unordered_map<instruction_ref, std::string>& names) const; void debug_print(instruction_ref ins,
const std::unordered_map<instruction_ref, std::string>& names) const;
void print(std::unordered_map<instruction_ref, std::string>& names, void print(std::unordered_map<instruction_ref, std::string>& names,
const std::function<void(instruction_ref, const std::function<void(instruction_ref,
std::unordered_map<instruction_ref, std::string>)>& std::unordered_map<instruction_ref, std::string>)>&
......
...@@ -548,7 +548,7 @@ std::vector<argument> program::eval(parameter_map params) const ...@@ -548,7 +548,7 @@ std::vector<argument> program::eval(parameter_map params) const
if(trace_level > 0) if(trace_level > 0)
{ {
std::unordered_map<instruction_ref, std::string> ins_names; std::unordered_map<instruction_ref, std::string> ins_names;
this->print(ins_names, [&](auto, auto) { }); this->print(ins_names, [&](auto, auto) {});
return generic_eval(*this, return generic_eval(*this,
ctx, ctx,
std::move(params), std::move(params),
...@@ -561,8 +561,9 @@ std::vector<argument> program::eval(parameter_map params) const ...@@ -561,8 +561,9 @@ std::vector<argument> program::eval(parameter_map params) const
double t1 = t.record<milliseconds>(); double t1 = t.record<milliseconds>();
ctx.finish(); ctx.finish();
double t2 = t.record<milliseconds>(); double t2 = t.record<milliseconds>();
std::cout << "Time: " << t1 << "ms, " << t2 << "ms, execution time:\t"; std::cout << "Time: " << t1 << "ms, " << t2
if(trace_level ==2 and ins->name().front() != '@' and << "ms, execution time:\t";
if(trace_level == 2 and ins->name().front() != '@' and
ins->name() != "load" and not result.empty()) ins->name() != "load" and not result.empty())
{ {
target tgt = make_target(this->impl->target_name); target tgt = make_target(this->impl->target_name);
...@@ -581,7 +582,7 @@ std::vector<argument> program::eval(parameter_map params) const ...@@ -581,7 +582,7 @@ std::vector<argument> program::eval(parameter_map params) const
std::cout << "Output: " << buffer << std::endl; std::cout << "Output: " << buffer << std::endl;
} }
} }
else if (trace_level == 3) else if(trace_level == 3)
{ {
// count max instruction length // count max instruction length
auto titles = get_titles(); auto titles = get_titles();
...@@ -943,7 +944,8 @@ void program::debug_print(instruction_ref ins) const ...@@ -943,7 +944,8 @@ void program::debug_print(instruction_ref ins) const
}); });
} }
void program::debug_print(instruction_ref ins, const std::unordered_map<instruction_ref, std::string>& names) const void program::debug_print(instruction_ref ins,
const std::unordered_map<instruction_ref, std::string>& names) const
{ {
if(std::any_of(this->impl->modules.begin(), this->impl->modules.end(), [&](const auto& pp) { if(std::any_of(this->impl->modules.begin(), this->impl->modules.end(), [&](const auto& pp) {
return is_end(pp.second.end(), ins); return is_end(pp.second.end(), ins);
...@@ -960,7 +962,7 @@ void program::debug_print(instruction_ref ins, const std::unordered_map<instruct ...@@ -960,7 +962,7 @@ void program::debug_print(instruction_ref ins, const std::unordered_map<instruct
return; return;
} }
if (contains(names, ins)) if(contains(names, ins))
{ {
instruction::print(std::cout, ins, names); instruction::print(std::cout, ins, names);
std::cout << std::endl; std::cout << std::endl;
......
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