LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
regalloc::RegisterAllocator Class Reference

"Allocate-registers" functor. More...

#include <regallocator.hh>

Inheritance diagram for regalloc::RegisterAllocator:
Collaboration diagram for regalloc::RegisterAllocator:

Public Types

typedef assem::Visitor super_type

Public Member Functions

virtual void operator() (assem::ProcFrag &frag) override
 Allocate registers.
temp::TempMap allocation_get () const
 The result.
const misc::timertimer_get () const
 The timer.
virtual void operator() (typename Const< ProcFrag >::type &a)
 Visit an assembly procedure fragment.
virtual void operator() (typename Const< DataFrag >::type &a)
 Visit an assembly data fragment.
template<class E >
void operator() (E *e)
 To enable the use of standard algorithm on containers of pointers.
virtual void operator() (typename Const< Fragments >::type &fs)
 Visit a list of assembly fragments.
template<template< typename > class Const>
void operator() (typename Const< ast::Ast >::type &e)
Ctor & Dtor
 RegisterAllocator (const target::Target &target, const temp::TempMap &tempmap, bool coalesce_p=true, bool trace_p=false)
 Construct a RegisterAllocator.

Private Member Functions

void remove_useless_moves (assem::Instrs &instrs)

Private Attributes

const target::Targettarget_
 The current target.
temp::TempMap tempmap_
 The allocation itself.
bool coalesce_p_
 Shall we coalesce registers.
bool trace_p_
 Produce detailed logs on register allocation.
misc::timer timer_
 Register allocation timer.

Detailed Description

"Allocate-registers" functor.

Member Typedef Documentation

Constructor & Destructor Documentation

regalloc::RegisterAllocator::RegisterAllocator ( const target::Target target,
const temp::TempMap tempmap,
bool  coalesce_p = true,
bool  trace_p = false 
)

Construct a RegisterAllocator.

Member Function Documentation

temp::TempMap regalloc::RegisterAllocator::allocation_get ( ) const

The result.

References tempmap_.

Referenced by regalloc::allocate_registers().

template<template< typename > class Const>
template<template< typename > class Const>
void assem::GenVisitor< Const >::operator() ( typename Const< ast::Ast >::type &  e)
inherited
template<template< typename > class Const>
void assem::GenVisitor< Const >::operator() ( typename Const< ProcFrag >::type &  a)
virtualinherited

Visit an assembly procedure fragment.

template<template< typename > class Const>
void assem::GenVisitor< Const >::operator() ( typename Const< DataFrag >::type &  a)
virtualinherited

Visit an assembly data fragment.

template<template< typename > class Const>
template<class E >
void assem::GenVisitor< Const >::operator() ( E *  e)
inherited

To enable the use of standard algorithm on containers of pointers.

template<template< typename > class Const>
void assem::GenVisitor< Const >::operator() ( typename Const< Fragments >::type &  fs)
virtualinherited

Visit a list of assembly fragments.

References misc::for_each().

void regalloc::RegisterAllocator::remove_useless_moves ( assem::Instrs instrs)
private

Referenced by operator()().

const misc::timer & regalloc::RegisterAllocator::timer_get ( ) const

The timer.

References timer_.

Referenced by regalloc::allocate_registers().

Member Data Documentation

bool regalloc::RegisterAllocator::coalesce_p_
private

Shall we coalesce registers.

Referenced by operator()().

const target::Target& regalloc::RegisterAllocator::target_
private

The current target.

Referenced by operator()().

temp::TempMap regalloc::RegisterAllocator::tempmap_
private

The allocation itself.

Referenced by allocation_get(), and operator()().

misc::timer regalloc::RegisterAllocator::timer_
private

Register allocation timer.

Referenced by operator()(), and timer_get().

bool regalloc::RegisterAllocator::trace_p_
private

Produce detailed logs on register allocation.

Referenced by operator()().


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