HLVM API Documentation

Function Class Reference

AST Function Node. More...

#include <Linkables.h>

Inheritance diagram for Function:

Inheritance graph
[legend]
List of all members.

Accessors

Public Types

Types

Public Member Functions

Argument Iteration
Mutators

Protected Member Functions

Constructors

Protected Attributes

Data

Friends


Detailed Description

AST Function Node.

This class provides an Abstract Syntax Tree node that represents a Function. A Function is a callable block of code that accepts parameters and returns a result. This is the basic unit of code in HLVM. A Function has a name, a set of formal arguments, a return type, and, optionally, a Block of code to execute. The name of a function is used for linking purposes. The formal arguments and return type are encapsulated in the Function's associated SignatureType. If a Block is associated with the Function then the function is defined and the Block defines the computation the Function provides. If a Block is not associated with the Function, then the function is undefined and serves as a reference to a function in another Bundle.

See also:
Block

Bundle

SignatureType

Definition at line 192 of file Linkables.h.


Member Typedef Documentation

typedef std::vector<Argument*> ArgumentList
 

Definition at line 197 of file Linkables.h.

typedef ArgumentList::const_iterator const_iterator
 

Definition at line 199 of file Linkables.h.

typedef ArgumentList::iterator iterator
 

Definition at line 198 of file Linkables.h.


Constructor & Destructor Documentation

Function NodeIDs  id = FunctionID  )  [inline, protected]
 

Definition at line 205 of file Linkables.h.

~Function  )  [protected, virtual]
 

Definition at line 51 of file Linkables.cpp.


Member Function Documentation

void addArgument Argument arg  )  [inline]
 

Definition at line 250 of file Linkables.h.

References Function::args.

const Argument* back  )  const [inline]
 

Definition at line 241 of file Linkables.h.

References Function::args.

Argument* back  )  [inline]
 

Definition at line 240 of file Linkables.h.

References Function::args.

const_iterator begin  )  const [inline]
 

Definition at line 233 of file Linkables.h.

References Function::args.

iterator begin  )  [inline]
 

Definition at line 232 of file Linkables.h.

References Function::args.

static bool classof const Node N  )  [inline, static]
 

Provide support for isa<X> and friends.

Reimplemented from Linkable.

Reimplemented in Program.

Definition at line 226 of file Linkables.h.

References Node::isFunction().

static bool classof const Function  )  [inline, static]
 

Definition at line 225 of file Linkables.h.

bool empty  )  const [inline]
 

Definition at line 237 of file Linkables.h.

References Function::args.

const_iterator end  )  const [inline]
 

Definition at line 235 of file Linkables.h.

References Function::args.

iterator end  )  [inline]
 

Definition at line 234 of file Linkables.h.

References Function::args.

const Argument* front  )  const [inline]
 

Definition at line 239 of file Linkables.h.

References Function::args.

Argument* front  )  [inline]
 

Definition at line 238 of file Linkables.h.

References Function::args.

unsigned getArgNum const Argument arg  )  const
 

Return the 1-based index of the arg in this function. If arg is not an argument of this function, returns 0;

Definition at line 70 of file Linkables.cpp.

References Function::begin(), and Function::end().

Argument * getArgument unsigned  argnum  )  const
 

Definition at line 63 of file Linkables.cpp.

References Function::args, hlvmAssert, and Function::size().

Argument * getArgument const std::string &  name  )  const
 

Definition at line 54 of file Linkables.cpp.

References Function::begin(), and Function::end().

Block* getBlock  )  const [inline]
 

Definition at line 213 of file Linkables.h.

References Function::block.

const Type* getResultType  )  const [inline]
 

Definition at line 216 of file Linkables.h.

References SignatureType::getResultType(), and Function::getSignature().

const SignatureType* getSignature  )  const [inline]
 

Definition at line 214 of file Linkables.h.

References Value::type.

bool hasBlock  )  const [inline]
 

Definition at line 212 of file Linkables.h.

References Function::block.

void insertChild Node kid  )  [virtual]
 

Reimplemented from Node.

Definition at line 82 of file Linkables.cpp.

References Function::block, and hlvmAssert.

void removeChild Node kid  )  [virtual]
 

Reimplemented from Node.

Definition at line 94 of file Linkables.cpp.

References Function::block, and hlvmAssert.

void resolveTypeTo const Type from,
const Type to
[virtual]
 

Reimplemented from Value.

Definition at line 104 of file Linkables.cpp.

References Function::begin(), Function::end(), and Value::resolveTypeTo().

void setBlock Block blk  )  [inline]
 

Definition at line 249 of file Linkables.h.

References Node::setParent().

size_t size  )  const [inline]
 

Definition at line 236 of file Linkables.h.

References Function::args.


Friends And Related Function Documentation

friend class AST [friend]
 

Reimplemented from Linkable.

Reimplemented in Program.

Definition at line 260 of file Linkables.h.


Member Data Documentation

ArgumentList args [protected]
 

Definition at line 258 of file Linkables.h.

Block* block [protected]
 

The code block to be executed.

Definition at line 257 of file Linkables.h.


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