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

Method post_loop_analysis

src/StatementFor.cpp:331–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void
332StatementFor::post_loop_analysis(CGContext& cg_context, vector<const Fact*>& pre_facts, Effect& pre_effect)
333{
334 FactMgr* fm = get_fact_mgr(&cg_context);
335 assert(fm);
336 // if the control reached the end of this for-loop with must-return body, it means
337 // the loop is never entered. restore facts to pre-loop env
338 fm->global_facts = fm->map_facts_in[&body];
339 if (body.must_return()) {
340 fm->restore_facts(pre_facts);
341 }
342 // add forward edges introduced by "break"
343 for (size_t i=0; i<body.break_stms.size(); i++) {
344 const StatementBreak* stm = dynamic_cast<const StatementBreak*>(body.break_stms[i]);
345 fm->create_cfg_edge(stm, this, true, false);
346 FactMgr::merge_jump_facts(fm->global_facts, fm->map_facts_out[stm]);
347 }
348 // compute accumulated effect
349 set_accumulated_effect_after_block(pre_effect, &body, cg_context);
350}
351
352/*
353 *

Callers 1

make_randomMethod · 0.80

Calls 5

get_fact_mgrFunction · 0.85
restore_factsMethod · 0.80
sizeMethod · 0.80
create_cfg_edgeMethod · 0.80
must_returnMethod · 0.45

Tested by

no test coverage detected