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

Root for abstract assembly instructions. More...

#include <instr.hh>

Inheritance diagram for assem::Instr:
Collaboration diagram for assem::Instr:

Public Member Functions

 Instr (const std::string &assem, const temp::temp_list_type &used_temps=temp::temp_list_type(), const temp::temp_list_type &defd_temps=temp::temp_list_type(), const temp::label_list_type &jump_labels=temp::label_list_type())
virtual ~Instr ()
const temp::temp_list_typeuse () const
const temp::temp_list_typedef () const
const temp::label_list_typejumps () const
temp::temp_list_typeuse ()
temp::temp_list_typedef ()
virtual std::ostream & dump (std::ostream &ostr) const
 Output the TempMap m onto ostr.

Static Public Attributes

static const misc::xalloc< bool > debug
 Set whether Instr::print report debugging information? Return the previous value.

Protected Attributes

std::string assem_
temp::temp_list_type use_
temp::temp_list_type def_
temp::label_list_type jumps_

Detailed Description

Root for abstract assembly instructions.

Assemly instructions are composed of a string (the instruction itself) a` la printf, where

  • "'s" designates a source register
  • "'d" designates a destination register
  • "'j" designates a destination (jump) label

and of three lists

  • source registers
  • destination registers
  • destination labels

After instruction selection, the registers are mostly soft (or pseudo) registers, and register allocation replaces then with hard registers.

Constructor & Destructor Documentation

assem::Instr::Instr ( const std::string &  assem,
const temp::temp_list_type used_temps = temp::temp_list_type(),
const temp::temp_list_type defd_temps = temp::temp_list_type(),
const temp::label_list_type jump_labels = temp::label_list_type() 
)
inline
assem::Instr::~Instr ( )
virtual

Member Function Documentation

const temp::temp_list_type & assem::Instr::def ( ) const
inline

References def_.

Referenced by assem::Move::dst_get(), and dump().

temp::temp_list_type & assem::Instr::def ( )
inline

References def_.

std::ostream & assem::Instr::dump ( std::ostream &  ostr) const
virtual

Output the TempMap m onto ostr.

Reimplemented in assem::Move, and assem::Oper.

References assem_, assertion, debug, def(), jumps(), unreached, and use().

Referenced by assem::operator<<().

const temp::label_list_type & assem::Instr::jumps ( ) const
inline

References jumps_.

Referenced by dump().

const temp::temp_list_type & assem::Instr::use ( ) const
inline

References use_.

Referenced by dump(), and assem::Move::src_get().

temp::temp_list_type & assem::Instr::use ( )
inline

References use_.

Member Data Documentation

std::string assem::Instr::assem_
protected

Referenced by dump(), and assem::Comment::print().

const misc::xalloc< bool > assem::Instr::debug
static

Set whether Instr::print report debugging information? Return the previous value.

Referenced by dump(), and target::instructions_dump().

temp::temp_list_type assem::Instr::def_
protected

Referenced by def(), and assem::Move::def_get().

temp::label_list_type assem::Instr::jumps_
protected

Referenced by jumps().

temp::temp_list_type assem::Instr::use_
protected

Referenced by use(), and assem::Move::use_get().


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