mjplusplus
v0.4.1
|
#include <MemberVisitor.hpp>
Public Member Functions | |
MemberVisitor (ClassVisitor &classVisitor) | |
virtual void | visit (shptr< const ast::MethodDeclaration > methodDeclaration) |
virtual void | visit (shptr< const ast::MainMethodDeclaration > mainMethodDecl) |
virtual void | visit (shptr< const ast::FieldDeclaration >) |
ir_graph * | getGraph () const |
![]() | |
FirmVisitor () | |
virtual void | setOwner (ir_type *owner) |
virtual ir_type * | getOwner () const |
![]() | |
virtual void | visit (shptr< Node const > node) |
virtual void | visit (shptr< Arguments const > node) |
virtual void | visit (shptr< be::BinaryExpression const > node) |
virtual void | visit (shptr< be::AndAnd const > node) |
virtual void | visit (shptr< be::Eq const > node) |
virtual void | visit (shptr< be::EqEq const > node) |
virtual void | visit (shptr< be::GreaterThan const > node) |
virtual void | visit (shptr< be::GreaterThanEq const > node) |
virtual void | visit (shptr< be::Invalid const > node) |
virtual void | visit (shptr< be::LessThan const > node) |
virtual void | visit (shptr< be::LessThanEq const > node) |
virtual void | visit (shptr< be::Minus const > node) |
virtual void | visit (shptr< be::Mod const > node) |
virtual void | visit (shptr< be::Mult const > node) |
virtual void | visit (shptr< be::NotEq const > node) |
virtual void | visit (shptr< be::OrOr const > node) |
virtual void | visit (shptr< be::Plus const > node) |
virtual void | visit (shptr< be::Slash const > node) |
virtual void | visit (shptr< ClassDeclaration const > node) |
virtual void | visit (shptr< ClassMember const > node) |
virtual void | visit (shptr< Expression const > node) |
virtual void | visit (shptr< Ident const > node) |
virtual void | visit (shptr< pe::PrimaryExpression const > node) |
virtual void | visit (shptr< pe::Bool const > node) |
virtual void | visit (shptr< pe::Ident const > node) |
virtual void | visit (shptr< pe::Integer const > node) |
virtual void | visit (shptr< pe::MethodInvocation const > node) |
virtual void | visit (shptr< pe::NewArrayExpression const > node) |
virtual void | visit (shptr< pe::NewObjectExpression const > node) |
virtual void | visit (shptr< pe::Object const > node) |
virtual void | visit (shptr< po::PostfixExpression const > node) |
virtual void | visit (shptr< po::PostfixOp const > node) |
virtual void | visit (shptr< po::ArrayAccess const > node) |
virtual void | visit (shptr< po::FieldAccess const > node) |
virtual void | visit (shptr< po::MethodInvocation const > node) |
virtual void | visit (shptr< Program const > node) |
virtual void | visit (shptr< stmt::Statement const > node) |
virtual void | visit (shptr< stmt::Block const > node) |
virtual void | visit (shptr< stmt::ExpressionStatement const > node) |
virtual void | visit (shptr< stmt::IfStatement const > node) |
virtual void | visit (shptr< stmt::LVDStatement const > node) |
virtual void | visit (shptr< stmt::ReturnStatement const > node) |
virtual void | visit (shptr< stmt::WhileStatement const > node) |
virtual void | visit (shptr< Type const > node) |
virtual void | visit (shptr< TypeIdent const > node) |
virtual void | visit (shptr< ue::UnaryExpression const > node) |
virtual void | visit (shptr< ue::Neg const > node) |
virtual void | visit (shptr< ue::Not const > node) |
Protected Member Functions | |
void | visitMethodBodyAndFinalize (shptr< const ast::MethodDeclaration > methodDeclaration, ir_graph *irg) |
Protected Attributes | |
ir_graph * | function_graph |
ClassVisitor & | classVisitor |
![]() | |
ir_type * | owner |
firm::visitor::MemberVisitor::MemberVisitor | ( | ClassVisitor & | classVisitor | ) |
Constructs a MemberVisitor from the given ClassVisitor. Sets this owner to the one from the ClassVisitor.
classVisitor | the given ClassVisitor |
ir_graph * firm::visitor::MemberVisitor::getGraph | ( | ) | const |
Get the current graph.
|
virtual |
Gets the entity of the corresponding method from the FirmInterface using the owner and mangled name and then creates a new function graph from it and the number of local variables. Then it evaluates the method body with the help of a StatementVisitor, optimizes and then finalizes the graph.
methodDeclaration | the method's declaration |
Reimplemented from ast::ASTVisitor.
|
virtual |
Creates a new Method-entity for the main method and uses it for a new function graph. This is then evaluated, optimized and finalized.
mainMethodDecl | the methods' declaration |
Reimplemented from ast::ASTVisitor.
|
virtual |
Nothing to be done for fields.
Reimplemented from ast::ASTVisitor.
|
protected |
Create method body firm nodes, create local variables for parameters and add a trailing return statement if necessary. After that the graph is optimized and then finalized.
methodDeclaration | the method's declaration |
irg | the graph for this method call |
|
protected |
The calling ClassVisitor
|
protected |
The resulting function graph