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

Method output_stm

src/ReducerOutputMgr.cpp:727–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725 }
726}
727void
728ReducerOutputMgr::output_stm(const Statement* stm, std::ostream &out, FactMgr* fm, int indent)
729{
730 string str_out;
731 // print pre-statement assignments
732 output_pre_stm_assigns(stm, out, indent);
733 output_pre_stm_values(stm, out, fm, indent);
734
735 if (reducer->replaced_stms.find(stm) != reducer->replaced_stms.end()) {
736 const Statement* alt_stm = reducer->replaced_stms[stm];
737 vector<string> labels;
738 // special case for goto target: if the jump source is still around, we have to keep the label somehow
739 if (reducer->find_missing_labels(stm, alt_stm, labels)) {
740 for (size_t i=0; i<labels.size(); i++) {
741 out << labels[i] << ": ;" << endl;
742 }
743 }
744 if (alt_stm && alt_stm->eType == eBlock) {
745 output_block((const Block*)alt_stm, out, indent, true);
746 } else if (alt_stm) {
747 output_stm(reducer->replaced_stms[stm], out, fm, indent);
748 }
749 return;
750 }
751
752 if (stm->func == reducer->rewrite_calls_inside) {
753 rewrite_func_calls(stm, out, indent);
754 }
755 // print lable for jump detination
756 string label = reducer->find_jump_label(stm);
757 label.empty() ? (out << "") : (out << label << ":" << endl);
758
759 output_alt_exprs(stm, out, indent);
760
761 output_reduced_stm(stm, out, indent);
762
763 output_post_stm_values(stm, out, fm, indent);
764}
765
766void
767ReducerOutputMgr::rewrite_func_call(const Statement* stm, const FunctionInvocation* invoke, string tmp_id, std::ostream& out, int indent)

Callers

nothing calls this directly

Calls 4

endMethod · 0.80
find_missing_labelsMethod · 0.80
sizeMethod · 0.80
find_jump_labelMethod · 0.45

Tested by

no test coverage detected