Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::mir::Functions Class Reference

Container for functions. More...

#include <functions.hpp>

Public Member Functions

 Functions ()
 Construct an empty function table.
 
 ~Functions ()
 Move along, nothing to see here.
 
void add_function (Gyoji::owned< Function > _function)
 Add a function to the MIR.
 
const std::vector< Gyoji::owned< Function > > & get_functions () const
 Returns the list of functions defined.
 
void dump (FILE *out) const
 Dump the function table to a file handle.
 

Detailed Description

Container for functions.

This class is a container for the functions defined in a translation unit.

Constructor & Destructor Documentation

◆ Functions()

Functions::Functions ( )

Construct an empty function table.

This constructs an empty function table.

◆ ~Functions()

Functions::~Functions ( )

Move along, nothing to see here.

Move along, nothing to see here.

Member Function Documentation

◆ add_function()

void Functions::add_function ( Gyoji::owned< Function _function)

Add a function to the MIR.

Adds a function to the MIR representation. This function takes ownership of the provided function, so you must std::move it when calling.

◆ dump()

void Functions::dump ( FILE *  out) const

Dump the function table to a file handle.

This method dumps the "Functions" portion of the MIR to the given file handle.

◆ get_functions()

const std::vector< Gyoji::owned< Function > > & Functions::get_functions ( ) const

Returns the list of functions defined.

This method returns the list of functions defined in this function table. The list is returned as an immutable reference to owned pointers. The caller may not aquire ownership through this method, but may get access to the functions by de-referencing the pointer. The pointer is guaranteed to be valid because this container owns them and they cannot be removed once created. The returned reference must not live longer than this container.


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