Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::Scope Class Reference

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

#include <thorin/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 22 of file scope.h.

Constructor & Destructor Documentation

◆ Scope() [1/2]

thorin::Scope::Scope ( const Scope )
delete

◆ Scope() [2/2]

thorin::Scope::Scope ( Def entry)
explicit

Definition at line 16 of file scope.cpp.

◆ ~Scope()

thorin::Scope::~Scope ( )

Definition at line 23 of file scope.cpp.

Member Function Documentation

◆ b_cfg()

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

Definition at line 88 of file scope.cpp.

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

◆ bound() [1/2]

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

All Defs within this Scope.

Definition at line 42 of file scope.h.

◆ bound() [2/2]

bool thorin::Scope::bound ( const Def def) const
inline

Definition at line 40 of file scope.h.

References bound().

Referenced by bound(), thorin::CFA::CFA(), is_free(), and thorin::Scheduler::Scheduler().

◆ cfa()

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

Definition at line 86 of file scope.cpp.

References thorin::lazy_init().

Referenced by b_cfg(), and f_cfg().

◆ entry()

◆ exit()

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

◆ f_cfg()

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

Definition at line 87 of file scope.cpp.

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

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

◆ free_defs()

const DefSet & thorin::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 43 of file scope.h.

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

◆ free_muts()

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

All muts that occurr free in this Scope.

Definition at line 45 of file scope.h.

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

◆ free_vars()

const VarSet & thorin::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 44 of file scope.h.

◆ is_free()

bool thorin::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(), thorin::Def::num_ops(), and thorin::Def::var().

◆ operator=()

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

◆ sym()

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

Definition at line 35 of file scope.h.

References thorin::Def::sym().

◆ world()

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

Definition at line 32 of file scope.h.

Referenced by thorin::Scheduler::smart(), and thorin::CFA::world().


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