MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::CFG< bool > Class Template Reference

A Control-Flow Graph. More...

#include <mim/analyses/cfg.h>

Inheritance diagram for mim::CFG< bool >:
[legend]

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>
class mim::CFG< bool >

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 8 of file scope.h.

Member Typedef Documentation

◆ Map

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

Definition at line 118 of file cfg.h.

◆ Set

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

Definition at line 119 of file cfg.h.

Constructor & Destructor Documentation

◆ CFG() [1/2]

template<bool >
mim::CFG< bool >::CFG ( const CFG< bool > & )
delete

◆ CFG() [2/2]

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

Member Function Documentation

◆ cfa()

◆ domfrontier()

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

Definition at line 179 of file cfg.cpp.

References mim::lazy_init().

◆ domtree()

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

Definition at line 177 of file cfg.cpp.

References mim::lazy_init().

◆ entry()

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

Definition at line 136 of file cfg.h.

References mim::CFG< bool >::cfa().

Referenced by mim::CFG< bool >::CFG().

◆ exit()

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

Definition at line 137 of file cfg.h.

References mim::CFG< bool >::cfa().

◆ index()

template<bool >
static size_t mim::CFG< bool >::index ( const CFNode * n)
inlinestatic

Definition at line 150 of file cfg.h.

Referenced by mim::CFG< bool >::CFG(), and mim::DomTreeBase< bool >::index().

◆ looptree()

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

Definition at line 178 of file cfg.cpp.

References mim::lazy_init().

◆ num_preds() [1/2]

template<bool >
size_t mim::CFG< bool >::num_preds ( const CFNode * n) const
inline

Definition at line 132 of file cfg.h.

References mim::CFG< bool >::preds().

◆ num_preds() [2/2]

template<bool >
size_t mim::CFG< bool >::num_preds ( Def * mut) const
inline

Definition at line 134 of file cfg.h.

References mim::CFG< bool >::cfa(), and mim::CFG< bool >::num_preds().

Referenced by mim::CFG< bool >::num_preds().

◆ num_succs() [1/2]

template<bool >
size_t mim::CFG< bool >::num_succs ( const CFNode * n) const
inline

Definition at line 133 of file cfg.h.

References mim::CFG< bool >::succs().

◆ num_succs() [2/2]

template<bool >
size_t mim::CFG< bool >::num_succs ( Def * mut) const
inline

Definition at line 135 of file cfg.h.

References mim::CFG< bool >::cfa(), and mim::CFG< bool >::num_succs().

Referenced by mim::CFG< bool >::num_succs().

◆ operator=()

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

◆ operator[]()

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

Maps from mut to CFNode.

Definition at line 145 of file cfg.h.

References mim::CFG< bool >::cfa().

◆ post_order() [1/2]

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

Definition at line 140 of file cfg.h.

◆ post_order() [2/2]

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

Maps from post-order index to CFNode.

Definition at line 144 of file cfg.h.

References mim::CFG< bool >::size().

◆ preds() [1/2]

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

Definition at line 175 of file cfg.cpp.

Referenced by mim::CFG< bool >::num_preds().

◆ preds() [2/2]

template<bool >
const CFNodes & mim::CFG< bool >::preds ( Def * mut) const
inline

Definition at line 130 of file cfg.h.

References mim::CFG< bool >::cfa(), and mim::CFG< bool >::preds().

Referenced by mim::CFG< bool >::preds().

◆ reverse_post_order() [1/2]

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

Definition at line 139 of file cfg.h.

Referenced by mim::Scheduler::schedule().

◆ reverse_post_order() [2/2]

template<bool >
const CFNode * mim::CFG< bool >::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 >
size_t mim::CFG< bool >::size ( ) const
inline

◆ succs() [1/2]

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

Definition at line 176 of file cfg.cpp.

Referenced by mim::CFG< bool >::num_succs().

◆ succs() [2/2]

template<bool >
const CFNodes & mim::CFG< bool >::succs ( Def * mut) const
inline

Definition at line 131 of file cfg.h.

References mim::CFG< bool >::cfa(), and mim::CFG< bool >::succs().

Referenced by mim::CFG< bool >::succs().


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