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

Method set_default_statement_prob

src/Probabilities.cpp:791–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791void
792Probabilities::set_default_statement_prob()
793{
794 std::map<ProbName, int> m;
795
796 // never generate stand-alone blocks
797 SET_SINGLE_NAME("statement_block_prob", Block, 0);
798 SET_SINGLE_NAME("statement_ifelse_prob", IfElse, 15);
799 SET_SINGLE_NAME("statement_for_prob", For, 30);
800 SET_SINGLE_NAME("statement_return_prob", Return, 35);
801 SET_SINGLE_NAME("statement_continue_prob", Continue, 40);
802 SET_SINGLE_NAME("statement_break_prob", Break, 45);
803 if (CGOptions::jumps() && CGOptions::arrays()) {
804 SET_SINGLE_NAME("statement_goto_prob", Goto, 50);
805 SET_SINGLE_NAME("statement_arrayop_prob", ArrayOp, 60);
806 }
807 else if (CGOptions::jumps() && !CGOptions::arrays()) {
808 SET_SINGLE_NAME("statement_arrayop_prob", ArrayOp, 0);
809 SET_SINGLE_NAME("statement_goto_prob", Goto, 50);
810 }
811 else if (!CGOptions::jumps() && CGOptions::arrays()) {
812 SET_SINGLE_NAME("statement_goto_prob", Goto, 0);
813 SET_SINGLE_NAME("statement_arrayop_prob", ArrayOp, 55);
814 }
815 else {
816 SET_SINGLE_NAME("statement_goto_prob", Goto, 0);
817 SET_SINGLE_NAME("statement_arrayop_prob", ArrayOp, 0);
818 }
819 // use the remaining probabilities for assignments
820 SET_SINGLE_NAME("statement_assign_prob", Assign, 100);
821
822 set_group_prob(false, pStatementProb, m);
823}
824
825Filter*
826Probabilities::get_prob_filter(ProbName pname)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected