| 989 | } |
| 990 | |
| 991 | void |
| 992 | ReducerOutputMgr::Output() |
| 993 | { |
| 994 | // configure reducer |
| 995 | reducer->configure(); |
| 996 | |
| 997 | // find all the functions and variables that are used after reductions |
| 998 | const Function* main = reducer->main; |
| 999 | reducer->get_used_vars_and_funcs_and_labels(main->body, reducer->used_vars, reducer->used_funcs, reducer->used_labels); |
| 1000 | reducer->expand_used_vars(); |
| 1001 | |
| 1002 | std::ostream &out = get_main_out(); |
| 1003 | OutputStructUnions(out); |
| 1004 | output_vars(*VariableSelector::GetGlobalVariables(), out, 0); |
| 1005 | output_artificial_globals(out); |
| 1006 | size_t i; |
| 1007 | for (i=0; i<reducer->used_funcs.size(); i++) { |
| 1008 | output_func_header(reducer->used_funcs[i], out); |
| 1009 | out << ";" << endl; |
| 1010 | } |
| 1011 | for (int j=reducer->used_funcs.size(); j>0; j--) { |
| 1012 | const Function* f = reducer->used_funcs[j-1]; |
| 1013 | outputln(out); |
| 1014 | output_func(f, out); |
| 1015 | outputln(out); |
| 1016 | } |
| 1017 | outputln(out); |
| 1018 | output_main_func(out); |
| 1019 | output_tail(out); |
| 1020 | } |
| 1021 |
no test coverage detected