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

Method make_random

src/StatementContinue.cpp:58–82  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

56 *
57 */
58StatementContinue *
59StatementContinue::make_random(CGContext &cg_context)
60{
61 //static int g =0;
62 FactMgr* fm = get_fact_mgr(&cg_context);
63 // find the closest looping parent block: the one "continue"
64 // would apply to
65 //int h = g++;
66 const Block* b = cg_context.get_current_block();
67 const Statement* prev_stm = b->get_last_stm();
68 // don't generate "continue" as the first statement in a block
69 if (prev_stm == 0) {
70 return 0;
71 }
72 while (b && !b->looping) {
73 b = b->parent;
74 }
75 assert(b);
76 cg_context.get_effect_stm().clear();
77 Expression *expr = Expression::make_random(cg_context, get_int_type(), 0, true, true, eVariable);
78 ERROR_GUARD(NULL);
79 StatementContinue* sc = new StatementContinue(cg_context.get_current_block(), *expr, *b);
80 fm->create_cfg_edge(sc, b, false, true);
81 return sc;
82}
83
84/*
85 *

Callers

nothing calls this directly

Calls 6

get_fact_mgrFunction · 0.85
get_int_typeFunction · 0.85
get_current_blockMethod · 0.80
get_last_stmMethod · 0.80
create_cfg_edgeMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected