| 799 | } |
| 800 | |
| 801 | int |
| 802 | ReducerOutputMgr::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 |
nothing calls this directly
no test coverage detected