tipc
A TIP to LLVM compiler
|
Class for defining the signature, local declarations, and a body of a function. More...
#include <ASTFunction.h>
Public Member Functions | |
std::vector< std::shared_ptr< ASTNode > > | getChildren () override |
Return all of the children for the node. More... | |
ASTFunction (std::shared_ptr< ASTDeclNode > DECL, std::vector< std::shared_ptr< ASTDeclNode >> FORMALS, const std::vector< std::shared_ptr< ASTDeclStmt >> &DECLS, std::vector< std::shared_ptr< ASTStmt >> BODY, bool ISPOLY) | |
~ASTFunction ()=default | |
ASTDeclNode * | getDecl () const |
std::string | getName () const |
bool | isPoly () const |
std::vector< ASTDeclNode * > | getFormals () const |
std::vector< ASTDeclStmt * > | getDeclarations () const |
std::vector< ASTStmt * > | getStmts () const |
void | accept (ASTVisitor *visitor) override |
Visit the children of this node and apply the visitor. More... | |
llvm::Value * | codegen () override |
Perform code generation and return an LLVM value the code. More... | |
![]() | |
virtual | ~ASTNode ()=default |
void | setLocation (int l, int c) |
int | getLine () |
int | getColumn () |
Protected Member Functions | |
std::ostream & | print (std::ostream &out) const override |
Print an abbreviated shared string for the function. More... | |
Class for defining the signature, local declarations, and a body of a function.
|
inline |
|
default |
|
overridevirtual |
Visit the children of this node and apply the visitor.
This virtual function is overridden by each ASTNode subtype in order to visit each of its child nodes, by calling their accept methods. The visitor parameter defines the operations that are applied to each node that is visited; a subtype of ASTVisitor defines those operations.
visitor | The subtype of ASTVisitor that carries out per-ASTNode work. |
Implements ASTNode.
|
overridevirtual |
Perform code generation and return an LLVM value the code.
This virtual function is overridden by each ASTNode subtype in order to generate the executable code. This function does not use the visitor due to the fact that a high-degree of control on the ordering of the nodes is required.
Implements ASTNode.
|
overridevirtual |
Return all of the children for the node.
This is not a pure virtual function so subclasses can selectively override it.
Reimplemented from ASTNode.
|
inline |
std::vector< ASTDeclStmt * > ASTFunction::getDeclarations | ( | ) | const |
std::vector< ASTDeclNode * > ASTFunction::getFormals | ( | ) | const |
|
inline |
std::vector< ASTStmt * > ASTFunction::getStmts | ( | ) | const |
|
inline |
|
overrideprotectedvirtual |
Print an abbreviated shared string for the function.
Implements ASTNode.