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

Method rewrite_func_calls

src/ReducerOutputMgr.cpp:801–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801int
802ReducerOutputMgr::rewrite_func_calls(const Statement* stm, std::ostream &out, int indent)
803{
804 vector<const FunctionInvocationUser*> calls;
805 const FunctionInvocation* fi = stm->get_direct_invocation();
806 if (fi) {
807 vector<string> ids;
808 string init_name = "t" + StringUtils::int2str(stm->stm_id);
809 reducer->find_called_funcs(fi, init_name, calls, ids);
810 if (!calls.empty()) {
811 size_t i;
812 for (i=0; i<calls.size(); i++) {
813 // exclude calls that return struct/union for now because struct const is not accepted as parameter value
814 if (calls[i]->get_type().is_aggregate()) {
815 continue;
816 }
817 output_tab(out, indent);
818 out << "/* " << "replacing " << ids[i] << endl;
819 rewrite_func_call(stm, calls[i], ids[i], out, indent);
820 output_tab(out, indent);
821 out << "*/" << endl;
822 }
823 }
824 }
825 return calls.size();
826}
827
828/*
829 * dumping global states at the function entry point for path shortcutting purpose

Callers

nothing calls this directly

Calls 6

output_tabFunction · 0.85
get_direct_invocationMethod · 0.80
find_called_funcsMethod · 0.80
sizeMethod · 0.80
is_aggregateMethod · 0.45
get_typeMethod · 0.45

Tested by

no test coverage detected