* */
| 56 | * |
| 57 | */ |
| 58 | StatementContinue * |
| 59 | StatementContinue::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 | * |
nothing calls this directly
no test coverage detected