MCPcopy Create free account
hub / github.com/csmith-project/csmith / Output

Method Output

src/ReducerOutputMgr.cpp:991–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991void
992ReducerOutputMgr::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

Callers 4

output_alt_exprsMethod · 0.45
output_if_stmMethod · 0.45
output_reduced_stmMethod · 0.45
rewrite_func_callMethod · 0.45

Calls 5

outputlnFunction · 0.85
configureMethod · 0.80
expand_used_varsMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected