mjplusplus
v0.4.1
|
#include <FirmInterface.hpp>
Public Types | |
enum | OptimizationFlags { NONE = 0, DEFAULT = 1 << 0, FIRM_COMPATIBLE = 1 << 1, CUSTOM_PRINT = 1 << 2 } |
Public Member Functions | |
std::tuple< ir_node *, ir_type * > | createNodeForMethodCall (shptr< ast::pe::MethodInvocation const > expr) |
std::tuple< ir_node *, ir_type * > | createNodeForMethodCall (ir_node *caller, shptr< ast::po::MethodInvocation const > expr) |
ir_node * | createNodeForCallocCall (ir_node *count, unsigned int size) |
ir_node * | createNodeForIntegerConstant (int64_t) |
ir_node * | createNodeForBooleanConstant (bool) |
ir_node * | createModOperation (ir_node *left, ir_node *right) |
ir_node * | createDivOperation (ir_node *left, ir_node *right) |
ir_node * | createNullPointerNode () |
~FirmInterface () | |
void | convert (shptr< ast::Program > program) |
void | build () |
void | outputFirmGraph (ir_graph *irg, std::string suffix) |
void | optimizeGraphs () |
void | handleConvNodes (ir_graph *irg) |
void | buildWithFirm () |
ir_mode * | getIntegerMode () |
ir_mode * | getBooleanMode () |
ir_mode * | getReferenceMode () |
ir_op * | getLeaOp () const |
ir_mode * | getMode (shptr< ast::Type > ast_type) |
ir_type * | getType (shptr< ast::Type > ast_type) |
void | addClassType (shptr< ast::Ident > class_ident, ir_type *class_type) |
void | addMethod (ir_type *class_type, std::string method_name, ir_entity *ent) |
void | addField (ir_type *class_type, std::string method_name, ir_entity *ent) |
ir_entity * | getMethodEntity (ir_type *class_type, std::string method_name) |
ir_entity * | getFieldEntity (ir_type *class_type, std::string method_name) |
ir_entity * | createMethodEntity (ir_type *caller, shptr< ast::MethodDeclaration const > methodDeclaration) |
void | setInput (std::string const &in) |
void | setOutput (std::string const &out) |
void | setOptimizationFlag (int flag) |
int | getOptimizationFlag () const |
void | setFirmGraphOutput (bool dumpFirmGraph) |
shptr< std::map< std::string, int > > | getVarMap () |
void | setVarMap (shptr< std::map< std::string, int >> newVar2pos) |
std::queue< ir_node * > | getWorklist (ir_graph *irg) |
std::vector< std::pair < ir_node *, unsigned int > > | getOuts (ir_node const *n) |
Static Public Member Functions | |
static FirmInterface & | getInstance () |
static std::string | replaceDollarAndUnderscores (std::string name) |
firm::FirmInterface::~FirmInterface | ( | ) |
void firm::FirmInterface::addClassType | ( | shptr< ast::Ident > | class_ident, |
ir_type * | class_type | ||
) |
void firm::FirmInterface::addField | ( | ir_type * | class_type, |
std::string | method_name, | ||
ir_entity * | ent | ||
) |
void firm::FirmInterface::addMethod | ( | ir_type * | class_type, |
std::string | method_name, | ||
ir_entity * | ent | ||
) |
void firm::FirmInterface::build | ( | ) |
Convert the generated Firm graphs to assembler and save in file out_name
void firm::FirmInterface::buildWithFirm | ( | ) |
Convert the generated Firm graphs to assembler using FIRM itself and save in file out_name
void firm::FirmInterface::convert | ( | shptr< ast::Program > | program | ) |
Convert program to Firm representation and call build() if successful
ir_node * firm::FirmInterface::createDivOperation | ( | ir_node * | left, |
ir_node * | right | ||
) |
ir_entity * firm::FirmInterface::createMethodEntity | ( | ir_type * | caller, |
shptr< ast::MethodDeclaration const > | methodDeclaration | ||
) |
ir_node * firm::FirmInterface::createModOperation | ( | ir_node * | left, |
ir_node * | right | ||
) |
ir_node * firm::FirmInterface::createNodeForBooleanConstant | ( | bool | x | ) |
ir_node * firm::FirmInterface::createNodeForCallocCall | ( | ir_node * | count, |
unsigned int | size | ||
) |
ir_node * firm::FirmInterface::createNodeForIntegerConstant | ( | int64_t | x | ) |
std::tuple< ir_node *, ir_type * > firm::FirmInterface::createNodeForMethodCall | ( | shptr< ast::pe::MethodInvocation const > | expr | ) |
std::tuple< ir_node *, ir_type * > firm::FirmInterface::createNodeForMethodCall | ( | ir_node * | caller, |
shptr< ast::po::MethodInvocation const > | expr | ||
) |
ir_node * firm::FirmInterface::createNullPointerNode | ( | ) |
ir_mode * firm::FirmInterface::getBooleanMode | ( | ) |
ir_entity * firm::FirmInterface::getFieldEntity | ( | ir_type * | class_type, |
std::string | method_name | ||
) |
|
inlinestatic |
ir_mode * firm::FirmInterface::getIntegerMode | ( | ) |
ir_op * firm::FirmInterface::getLeaOp | ( | ) | const |
ir_entity * firm::FirmInterface::getMethodEntity | ( | ir_type * | class_type, |
std::string | method_name | ||
) |
int firm::FirmInterface::getOptimizationFlag | ( | ) | const |
std::vector< std::pair< ir_node *, unsigned int > > firm::FirmInterface::getOuts | ( | ir_node const * | n | ) |
ir_mode * firm::FirmInterface::getReferenceMode | ( | ) |
shptr< std::map< std::string, int > > firm::FirmInterface::getVarMap | ( | ) |
std::queue< ir_node * > firm::FirmInterface::getWorklist | ( | ir_graph * | irg | ) |
void firm::FirmInterface::handleConvNodes | ( | ir_graph * | irg | ) |
Replaces chains of Conv nodes with a single node.
irg | the given firm graph |
void firm::FirmInterface::optimizeGraphs | ( | ) |
Optimize all firm graphs using the optimization flags. Calls optimize(ir_graph*)
void firm::FirmInterface::outputFirmGraph | ( | ir_graph * | irg, |
std::string | suffix | ||
) |
Outputs the given firm graph with the given string as suffix as vcg file, if the graph output option is enabled.
irg | the given firm graph |
suffix | the given suffix |
|
static |
Replace all dollar signs in name with _C
void firm::FirmInterface::setFirmGraphOutput | ( | bool | dumpFirmGraph | ) |
void firm::FirmInterface::setInput | ( | std::string const & | in | ) |
void firm::FirmInterface::setOptimizationFlag | ( | int | flag | ) |
void firm::FirmInterface::setOutput | ( | std::string const & | out | ) |
void firm::FirmInterface::setVarMap | ( | shptr< std::map< std::string, int >> | newVar2pos | ) |