GCC Middle and Back End API Reference
infinite-loop.cc File Reference
Include dependency graph for infinite-loop.cc:

Data Structures

struct  infinite_loop
 
class  perpetual_start_cfg_edge_event
 
class  looping_back_event
 
class  infinite_loop_diagnostic
 
class  infinite_loop_checking_context
 

Macros

#define PROPERTY_PREFIX   "gcc/analyzer/infinite_loop_diagnostic/"
 

Functions

static const exploded_edgeget_in_edge_back_edge (const exploded_node &enode)
 
static std::unique_ptr< infinite_loopstarts_infinite_loop_p (const exploded_node &enode, const exploded_graph &eg, logger *logger)
 

Macro Definition Documentation

◆ PROPERTY_PREFIX

#define PROPERTY_PREFIX   "gcc/analyzer/infinite_loop_diagnostic/"

Function Documentation

◆ get_in_edge_back_edge()

static const exploded_edge * get_in_edge_back_edge ( const exploded_node & enode)
static
If ENODE has an in-edge corresponding to a CFG backedge, return that exploded in-edge. Otherwise, return nullptr.

References ana::cfg_superedge::back_edge_p(), ana::superedge::dyn_cast_cfg_superedge(), and dnode< GraphTraits >::m_preds.

Referenced by starts_infinite_loop_p().

◆ starts_infinite_loop_p()

static std::unique_ptr< infinite_loop > starts_infinite_loop_p ( const exploded_node & enode,
const exploded_graph & eg,
logger * logger )
static
Determine if an infinite loop starts at ENODE. Return the loop if it is found, nullptr otherwise. Look for cycles in the exploded graph in which: - no externally visible work occurs - no escape from the cycle - the program state is "sufficiently concrete" at each step: - no unknown activity could be occurring - the worklist was fully drained for each enode in the cycle i.e. every enode in the cycle is processed.

References BUILTINS_LOCATION, ana::exploded_edge::could_do_work_p(), free(), ana::superedge::get_any_cfg_edge(), get_in_edge_back_edge(), ana::program_point::get_location(), ana::exploded_node::get_point(), ana::exploded_node::get_state(), ana::exploded_node::get_status(), ana::exploded_graph::get_supergraph(), ana::logger::log(), LOG_FUNC_1, dedge< GraphTraits >::m_dest, ana::exploded_node::m_index, ana::program_state::m_region_model, ana::exploded_edge::m_sedge, dnode< GraphTraits >::m_succs, ana::feasibility_state::maybe_update_for_edge(), pp_formatted_text(), pp_printf(), UNKNOWN_LOCATION, infinite_loop_checking_context::unusable_p(), and visited.

Referenced by ana::exploded_graph::detect_infinite_loops().