3#include <gyoji-misc/pointers.hpp>
4#include <gyoji-mir/types.hpp>
5#include <gyoji-mir/operations.hpp>
13 class SimpleStatement;
76 void dump(FILE *out)
const;
203 void dump(FILE *out)
const;
319 const Type *_return_type,
409 void dump(FILE *out)
const;
465 const Type *return_type;
References a location in the source-file.
Definition source-reference.hpp:16
Basic block of a function.
Definition functions.hpp:103
const std::vector< Gyoji::owned< Operation > > & get_operations() const
Access to list of Operation of basic block.
Definition functions.cpp:161
bool contains_terminator() const
Definition functions.cpp:165
void add_operation(Gyoji::owned< Operation > operation)
Add an Operation to the block.
Definition functions.cpp:148
BasicBlock()
Create a new basic block.
Definition functions.cpp:141
size_t size() const
Return the number of operations in this block.
Definition functions.cpp:174
~BasicBlock()
Move along, nothing to see here.
Definition functions.cpp:144
void dump(FILE *out) const
Dump block to file handle.
Definition functions.cpp:154
void insert_operation(size_t position, Gyoji::owned< Operation > operation)
Insert operations at a specific point.
Definition functions.cpp:178
A single named argument to a function.
Definition functions.hpp:225
const std::string & get_name() const
Name of the argument.
Definition functions.cpp:210
~FunctionArgument()
Move along, nothing to see here.
Definition functions.cpp:206
const Type * get_type() const
Type of the argument.
Definition functions.cpp:214
Function inside a translation unit.
Definition functions.hpp:303
size_t add_block()
Creates a new basic block and returns the ID.
Definition functions.cpp:85
void dump(FILE *out) const
Dump a function to the given file handle for debugging.
Definition functions.cpp:114
const Type * get_return_type() const
Return type of the function.
Definition functions.cpp:60
const Type * tmpvar_get(size_t tmpvar_id) const
Temporary values used by opcodes.
Definition functions.cpp:98
const Gyoji::context::SourceReference & get_source_ref() const
Reference to the source location where the function is defined.
Definition functions.cpp:68
size_t tmpvar_duplicate(size_t tmpvar_id)
Duplicate a temporary variable/reigster.
Definition functions.cpp:108
const BasicBlock & get_basic_block(size_t blockid) const
Get an immutable basic block from the function by ID.
Definition functions.cpp:72
size_t tmpvar_define(const Type *tmpvar_type)
Define a new temporary variable with the given type.
Definition functions.cpp:102
const std::string & get_name() const
Name of the function.
Definition functions.cpp:56
const std::map< size_t, Gyoji::owned< BasicBlock > > & get_blocks() const
Get the blocks of the function.
Definition functions.cpp:94
const std::vector< FunctionArgument > & get_arguments() const
Arguments to the function.
Definition functions.cpp:64
Container for functions.
Definition functions.hpp:24
Functions()
Construct an empty function table.
Definition functions.cpp:10
void dump(FILE *out) const
Dump the function table to a file handle.
Definition functions.cpp:28
const std::vector< Gyoji::owned< Function > > & get_functions() const
Returns the list of functions defined.
Definition functions.cpp:24
void add_function(Gyoji::owned< Function > _function)
Add a function to the MIR.
Definition functions.cpp:18
~Functions()
Move along, nothing to see here.
Definition functions.cpp:14
This represents a type as declared in a translation unit.
Definition types.hpp:299
Middle intermediate representation (MIR) of a translation unit.
Definition gyoji-mir.hpp:37