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

Fragment for some code `data'. More...

#include <fragment.hh>

Inheritance diagram for tree::ProcFrag:
Collaboration diagram for tree::ProcFrag:

Public Member Functions

virtual std::ostream & dump (std::ostream &o) const override
 Display this fragment.
Constructor and Destructor.
 ProcFrag (const temp::Label &label, const misc::symbol &name, const rStm &body, const frame::Frame *frame)
 ~ProcFrag ()
Accessors.
temp::Label label_get () const
 Code label.
const misc::symbolname_get () const
 Procedure name.
rStm body_get () const
 Body.
void body_set (const rStm &body)
const frame::Frameframe_get () const
 Procedure frame.
Visitors entry point.
virtual void accept (Visitor &v) override
 Accept a Visitor v.
virtual void accept (ConstVisitor &v) const override

Private Attributes

temp::Label label_
 This function's label.
const misc::symbol name_
 The function's original (possibly ambiguous) name.
rStm body_
 The function's body.
const frame::Frameframe_
 The frame, including accesses to locals and formals.
temp::Temp save_fp_
 To save/restore the frame pointer.

Detailed Description

Fragment for some code `data'.

Procedures need a LABEL, so that we can jump to them, a BODY to execute, but also details in the prologue and the epilogue which depend upon the content of the frame of the function. So we also need to store its FRAME.

Constructor & Destructor Documentation

tree::ProcFrag::ProcFrag ( const temp::Label label,
const misc::symbol name,
const rStm &  body,
const frame::Frame frame 
)
inline
tree::ProcFrag::~ProcFrag ( )
inline

References frame_.

Member Function Documentation

void tree::ProcFrag::accept ( Visitor v)
overridevirtual

Accept a Visitor v.

Implements tree::Fragment.

void tree::ProcFrag::accept ( ConstVisitor v) const
overridevirtual

Implements tree::Fragment.

rStm tree::ProcFrag::body_get ( ) const
inline

Body.

References body_.

Referenced by canon::canonicalize(), and target::lir_to_assem().

void tree::ProcFrag::body_set ( const rStm &  body)
inline

References body_.

Referenced by canon::canonicalize().

std::ostream & tree::ProcFrag::dump ( std::ostream &  o) const
overridevirtual

Display this fragment.

Implements tree::Fragment.

const frame::Frame & tree::ProcFrag::frame_get ( ) const
inline

Procedure frame.

References frame_.

temp::Label tree::ProcFrag::label_get ( ) const
inline

Code label.

References label_.

const misc::symbol & tree::ProcFrag::name_get ( ) const
inline

Procedure name.

References name_.

Member Data Documentation

rStm tree::ProcFrag::body_
private

The function's body.

Referenced by body_get(), and body_set().

const frame::Frame* tree::ProcFrag::frame_
private

The frame, including accesses to locals and formals.

Referenced by frame_get(), and ~ProcFrag().

temp::Label tree::ProcFrag::label_
private

This function's label.

Referenced by label_get().

const misc::symbol tree::ProcFrag::name_
private

The function's original (possibly ambiguous) name.

Referenced by name_get().

temp::Temp tree::ProcFrag::save_fp_
private

To save/restore the frame pointer.


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