MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Scope Class Reference

A Scope represents a region of Defs that are live from the view of an entry's Var. More...

#include <mim/analyses/scope.h>

Public Member Functions

 Scope (const Scope &)=delete
 
Scopeoperator= (Scope)=delete
 
 Scope (Def *entry)
 
 ~Scope ()
 
getters
Worldworld () const
 
Defentry () const
 
Defexit () const
 
Sym sym () const
 
Defs bound/free in this Scope
bool bound (const Def *def) const
 
const DefSetbound () const
 All Defs within this Scope.
 
const DefSetfree_defs () const
 All non-const Defs directly referenced but not bound within this Scope. May also include Vars or muts.
 
const VarSetfree_vars () const
 All Vars that occurr free in this Scope. Does not transitively contain any free Vars from muts.
 
const MutSetfree_muts () const
 All muts that occurr free in this Scope.
 
simple CFA to construct a CFG
const CFAcfa () const
 
const F_CFGf_cfg () const
 
const B_CFGb_cfg () const
 

Static Public Member Functions

static bool is_free (Def *mut, const Def *def)
 Does mut's Var occurr free in def?
 

Detailed Description

A Scope represents a region of Defs that are live from the view of an entry's Var.

Transitively, all user's of the entry's Var are pooled into this Scope (see defs()). Both entry() and exit() are NOT part of the Scope itself. The exit() is just a virtual dummy to have a unique exit dual to entry().

Definition at line 21 of file scope.h.

Constructor & Destructor Documentation

◆ Scope() [1/2]

mim::Scope::Scope ( const Scope & )
delete

◆ Scope() [2/2]

mim::Scope::Scope ( Def * entry)
explicit

Definition at line 16 of file scope.cpp.

◆ ~Scope()

mim::Scope::~Scope ( )

Definition at line 23 of file scope.cpp.

Member Function Documentation

◆ b_cfg()

const B_CFG & mim::Scope::b_cfg ( ) const

Definition at line 88 of file scope.cpp.

References mim::CFA::b_cfg(), and cfa().

◆ bound() [1/2]

const DefSet & mim::Scope::bound ( ) const
inline

All Defs within this Scope.

Definition at line 41 of file scope.h.

◆ bound() [2/2]

bool mim::Scope::bound ( const Def * def) const
inline

Definition at line 39 of file scope.h.

References bound().

Referenced by bound(), mim::CFA::CFA(), and is_free().

◆ cfa()

const CFA & mim::Scope::cfa ( ) const

Definition at line 86 of file scope.cpp.

References mim::lazy_init().

Referenced by b_cfg(), and f_cfg().

◆ entry()

Def * mim::Scope::entry ( ) const
inline

◆ exit()

Def * mim::Scope::exit ( ) const
inline

◆ f_cfg()

const F_CFG & mim::Scope::f_cfg ( ) const

Definition at line 87 of file scope.cpp.

References cfa(), and mim::CFA::f_cfg().

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

◆ free_defs()

const DefSet & mim::Scope::free_defs ( ) const
inline

All non-const Defs directly referenced but not bound within this Scope. May also include Vars or muts.

Definition at line 42 of file scope.h.

Referenced by mim::LamSpec::rewrite().

◆ free_muts()

const MutSet & mim::Scope::free_muts ( ) const
inline

All muts that occurr free in this Scope.

Definition at line 44 of file scope.h.

Referenced by mim::ScopePhase::start(), and mim::plug::mem::AddMem::visit().

◆ free_vars()

const VarSet & mim::Scope::free_vars ( ) const
inline

All Vars that occurr free in this Scope. Does not transitively contain any free Vars from muts.

Definition at line 43 of file scope.h.

◆ is_free()

bool mim::Scope::is_free ( Def * mut,
const Def * def )
static

Does mut's Var occurr free in def?

Definition at line 90 of file scope.cpp.

References bound(), mim::Def::num_ops(), and mim::Def::var().

◆ operator=()

Scope & mim::Scope::operator= ( Scope )
delete

◆ sym()

Sym mim::Scope::sym ( ) const
inline

Definition at line 34 of file scope.h.

References mim::Def::sym().

◆ world()

World & mim::Scope::world ( ) const
inline

Definition at line 31 of file scope.h.

Referenced by mim::CFA::world().


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