Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::CFG< forward > Class Template Reference

A Control-Flow Graph. More...

#include <thorin/analyses/cfg.h>

Public Types

template<class Value >
using Map = IndexMap< CFG< forward >, const CFNode *, Value >
 
using Set = IndexSet< CFG< forward >, const CFNode * >
 

Public Member Functions

 CFG (const CFG &)=delete
 
CFGoperator= (CFG)=delete
 
 CFG (const CFA &)
 
const CFAcfa () const
 
size_t size () const
 
const CFNodespreds (const CFNode *n) const
 
const CFNodessuccs (const CFNode *n) const
 
const CFNodespreds (Def *mut) const
 
const CFNodessuccs (Def *mut) const
 
size_t num_preds (const CFNode *n) const
 
size_t num_succs (const CFNode *n) const
 
size_t num_preds (Def *mut) const
 
size_t num_succs (Def *mut) const
 
const CFNodeentry () const
 
const CFNodeexit () const
 
auto reverse_post_order () const
 
auto post_order () const
 
const CFNodereverse_post_order (size_t i) const
 Maps from reverse post-order index to CFNode.
 
const CFNodepost_order (size_t i) const
 Maps from post-order index to CFNode.
 
const CFNodeoperator[] (Def *mut) const
 Maps from mut to CFNode.
 
const DomTreeBase< forward > & domtree () const
 
const LoopTree< forward > & looptree () const
 
const DomFrontierBase< forward > & domfrontier () const
 

Static Public Member Functions

static size_t index (const CFNode *n)
 

Detailed Description

template<bool forward>
class thorin::CFG< forward >

A Control-Flow Graph.

A small wrapper for the information obtained by a CFA. The template parameter forward determines the direction of the edges:

  • true means a conventional CFG.
  • `false* means that all edges in this CFG are reversed. Thus, a [dominance analysis](DomTreeBase), for example, becomes a post-dominance analysis.

Definition at line 116 of file cfg.h.

Member Typedef Documentation

◆ Map

template<bool forward>
template<class Value >
using thorin::CFG< forward >::Map = IndexMap<CFG<forward>, const CFNode*, Value>

Definition at line 118 of file cfg.h.

◆ Set

template<bool forward>
using thorin::CFG< forward >::Set = IndexSet<CFG<forward>, const CFNode*>

Definition at line 119 of file cfg.h.

Constructor & Destructor Documentation

◆ CFG() [1/2]

template<bool forward>
thorin::CFG< forward >::CFG ( const CFG< forward > &  )
delete

◆ CFG() [2/2]

template<bool forward>
thorin::CFG< forward >::CFG ( const CFA cfa)
explicit

Member Function Documentation

◆ cfa()

◆ domfrontier()

template<bool forward>
const DomFrontierBase< forward > & thorin::CFG< forward >::domfrontier ( ) const

Definition at line 182 of file cfg.cpp.

References thorin::lazy_init().

◆ domtree()

template<bool forward>
const DomTreeBase< forward > & thorin::CFG< forward >::domtree ( ) const

Definition at line 180 of file cfg.cpp.

References thorin::lazy_init().

◆ entry()

template<bool forward>
const CFNode * thorin::CFG< forward >::entry ( ) const
inline

Definition at line 136 of file cfg.h.

References thorin::CFG< forward >::cfa().

Referenced by thorin::CFG< forward >::CFG().

◆ exit()

template<bool forward>
const CFNode * thorin::CFG< forward >::exit ( ) const
inline

Definition at line 137 of file cfg.h.

References thorin::CFG< forward >::cfa().

◆ index()

template<bool forward>
static size_t thorin::CFG< forward >::index ( const CFNode n)
inlinestatic

Definition at line 150 of file cfg.h.

Referenced by thorin::CFG< forward >::CFG().

◆ looptree()

template<bool forward>
const LoopTree< forward > & thorin::CFG< forward >::looptree ( ) const

Definition at line 181 of file cfg.cpp.

References thorin::lazy_init().

Referenced by thorin::Scheduler::smart().

◆ num_preds() [1/2]

template<bool forward>
size_t thorin::CFG< forward >::num_preds ( const CFNode n) const
inline

Definition at line 132 of file cfg.h.

References thorin::CFG< forward >::preds().

◆ num_preds() [2/2]

template<bool forward>
size_t thorin::CFG< forward >::num_preds ( Def mut) const
inline

◆ num_succs() [1/2]

template<bool forward>
size_t thorin::CFG< forward >::num_succs ( const CFNode n) const
inline

Definition at line 133 of file cfg.h.

References thorin::CFG< forward >::succs().

◆ num_succs() [2/2]

template<bool forward>
size_t thorin::CFG< forward >::num_succs ( Def mut) const
inline

◆ operator=()

template<bool forward>
CFG & thorin::CFG< forward >::operator= ( CFG< forward >  )
delete

◆ operator[]()

template<bool forward>
const CFNode * thorin::CFG< forward >::operator[] ( Def mut) const
inline

Maps from mut to CFNode.

Definition at line 145 of file cfg.h.

References thorin::CFG< forward >::cfa().

◆ post_order() [1/2]

template<bool forward>
auto thorin::CFG< forward >::post_order ( ) const
inline

Definition at line 140 of file cfg.h.

◆ post_order() [2/2]

template<bool forward>
const CFNode * thorin::CFG< forward >::post_order ( size_t  i) const
inline

Maps from post-order index to CFNode.

Definition at line 144 of file cfg.h.

References thorin::CFG< forward >::size().

◆ preds() [1/2]

template<bool forward>
const CFNodes & thorin::CFG< forward >::preds ( const CFNode n) const

Definition at line 178 of file cfg.cpp.

Referenced by thorin::CFG< forward >::num_preds().

◆ preds() [2/2]

template<bool forward>
const CFNodes & thorin::CFG< forward >::preds ( Def mut) const
inline

Definition at line 130 of file cfg.h.

References thorin::CFG< forward >::cfa(), and thorin::CFG< forward >::preds().

Referenced by thorin::CFG< forward >::preds().

◆ reverse_post_order() [1/2]

template<bool forward>
auto thorin::CFG< forward >::reverse_post_order ( ) const
inline

Definition at line 139 of file cfg.h.

Referenced by thorin::Scheduler::schedule(), and thorin::Scheduler::Scheduler().

◆ reverse_post_order() [2/2]

template<bool forward>
const CFNode * thorin::CFG< forward >::reverse_post_order ( size_t  i) const
inline

Maps from reverse post-order index to CFNode.

Definition at line 142 of file cfg.h.

◆ size()

template<bool forward>
size_t thorin::CFG< forward >::size ( ) const
inline

◆ succs() [1/2]

template<bool forward>
const CFNodes & thorin::CFG< forward >::succs ( const CFNode n) const

Definition at line 179 of file cfg.cpp.

Referenced by thorin::CFG< forward >::num_succs().

◆ succs() [2/2]

template<bool forward>
const CFNodes & thorin::CFG< forward >::succs ( Def mut) const
inline

Definition at line 131 of file cfg.h.

References thorin::CFG< forward >::cfa(), and thorin::CFG< forward >::succs().

Referenced by thorin::CFG< forward >::succs().


The documentation for this class was generated from the following files: