GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::jit_convert Class Reference

#include "pt-jit.h"

Inheritance diagram for octave::jit_convert:
Collaboration diagram for octave::jit_convert:

Public Types

typedef std::pair< jit_type *, std::stringtype_bound
 
typedef std::vector< type_boundtype_bound_vector
 
typedef std::map< std::string, jit_variable * > variable_map
 

Public Member Functions

 jit_convert (tree &tee, jit_type *for_bounds=nullptr)
 
 jit_convert (octave_user_function &fcn, const std::vector< jit_type *> &args)
 
template<typename ... Args>
jit_callcreate_checked (const Args &... args)
 
jit_block_listget_blocks (void)
 
const type_bound_vectorget_bounds (void) const
 
jit_factoryget_factory (void)
 
llvm::Function * get_function (void) const
 
const variable_mapget_variable_map (void) const
 
void visit_anon_fcn_handle (tree_anon_fcn_handle &)
 
void visit_argument_list (tree_argument_list &)
 
void visit_binary_expression (tree_binary_expression &)
 
void visit_boolean_expression (tree_boolean_expression &)
 
void visit_break_command (tree_break_command &)
 
void visit_cell (tree_cell &)
 
virtual void visit_classdef (tree_classdef &)
 
virtual void visit_classdef_attribute (tree_classdef_attribute &)
 
virtual void visit_classdef_attribute_list (tree_classdef_attribute_list &)
 
virtual void visit_classdef_body (tree_classdef_body &)
 
virtual void visit_classdef_enum (tree_classdef_enum &)
 
virtual void visit_classdef_enum_block (tree_classdef_enum_block &)
 
virtual void visit_classdef_enum_list (tree_classdef_enum_list &)
 
virtual void visit_classdef_event (tree_classdef_event &)
 
virtual void visit_classdef_events_block (tree_classdef_events_block &)
 
virtual void visit_classdef_events_list (tree_classdef_events_list &)
 
virtual void visit_classdef_methods_block (tree_classdef_methods_block &)
 
virtual void visit_classdef_methods_list (tree_classdef_methods_list &)
 
virtual void visit_classdef_properties_block (tree_classdef_properties_block &)
 
virtual void visit_classdef_property (tree_classdef_property &)
 
virtual void visit_classdef_property_list (tree_classdef_property_list &)
 
virtual void visit_classdef_superclass (tree_classdef_superclass &)
 
virtual void visit_classdef_superclass_list (tree_classdef_superclass_list &)
 
void visit_colon_expression (tree_colon_expression &)
 
void visit_complex_for_command (tree_complex_for_command &)
 
virtual void visit_compound_binary_expression (tree_compound_binary_expression &expr)
 
void visit_constant (tree_constant &)
 
void visit_continue_command (tree_continue_command &)
 
void visit_decl_command (tree_decl_command &)
 
void visit_decl_elt (tree_decl_elt &)
 
void visit_decl_init_list (tree_decl_init_list &)
 
void visit_do_until_command (tree_do_until_command &)
 
void visit_fcn_handle (tree_fcn_handle &)
 
void visit_funcall (tree_funcall &)
 
void visit_function_def (tree_function_def &)
 
void visit_identifier (tree_identifier &)
 
void visit_if_clause (tree_if_clause &)
 
void visit_if_command (tree_if_command &)
 
void visit_if_command_list (tree_if_command_list &)
 
void visit_index_expression (tree_index_expression &)
 
void visit_matrix (tree_matrix &)
 
void visit_multi_assignment (tree_multi_assignment &)
 
void visit_no_op_command (tree_no_op_command &)
 
void visit_octave_user_function (octave_user_function &)
 
void visit_octave_user_function_header (octave_user_function &)
 
void visit_octave_user_function_trailer (octave_user_function &)
 
void visit_octave_user_script (octave_user_script &)
 
void visit_parameter_list (tree_parameter_list &)
 
void visit_postfix_expression (tree_postfix_expression &)
 
void visit_prefix_expression (tree_prefix_expression &)
 
void visit_return_command (tree_return_command &)
 
void visit_return_list (tree_return_list &)
 
void visit_simple_assignment (tree_simple_assignment &)
 
void visit_simple_for_command (tree_simple_for_command &)
 
void visit_statement (tree_statement &)
 
void visit_statement_list (tree_statement_list &)
 
void visit_switch_case (tree_switch_case &)
 
void visit_switch_case_list (tree_switch_case_list &)
 
void visit_switch_command (tree_switch_command &)
 
void visit_try_catch_command (tree_try_catch_command &)
 
void visit_unwind_protect_command (tree_unwind_protect_command &)
 
void visit_while_command (tree_while_command &)
 

Private Types

typedef std::list< jit_block * > block_list
 

Private Member Functions

jit_callcreate_checked_impl (jit_call *ret)
 
jit_variablecreate_variable (const std::string &vname, jit_type *type, bool isarg=true)
 
jit_valuedo_assign (tree_expression *exp, jit_value *rhs, bool artificial=false)
 
jit_valuedo_assign (const std::string &lhs, jit_value *rhs, bool print, bool artificial=false)
 
jit_variablefind_variable (const std::string &vname) const
 
void finish_breaks (jit_block *dest, const block_list &lst)
 
jit_variableget_variable (const std::string &vname)
 
void initialize (const symbol_scope &s)
 
std::string next_for_bounds (bool inc=true)
 
std::string next_iterator (bool inc=true)
 
std::string next_name (const char *prefix, size_t &count, bool inc)
 
std::string next_shortcircut_result (bool inc=true)
 
jit_instructionresolve (tree_index_expression &exp, jit_value *extra_arg=nullptr, bool lhs=false)
 
jit_valuevisit (tree *tee)
 
jit_valuevisit (tree &tee)
 

Private Attributes

std::vector< std::pair< std::string, bool > > m_arguments
 
jit_blockm_block
 
jit_block_list m_blocks
 
type_bound_vector m_bounds
 
block_list m_breaks
 
block_list m_continues
 
bool m_converting_function
 
std::vector< jit_magic_end::contextm_end_context
 
jit_blockm_entry_block
 
jit_factory m_factory
 
jit_blockm_final_block
 
size_t m_for_bounds_count
 
llvm::Function * m_function
 
size_t m_iterator_count
 
jit_valuem_result
 
symbol_scope m_scope
 
size_t m_short_count
 
variable_map m_vmap
 

Detailed Description

Definition at line 57 of file pt-jit.h.

Member Typedef Documentation

◆ block_list

Definition at line 251 of file pt-jit.h.

◆ type_bound

Definition at line 62 of file pt-jit.h.

◆ type_bound_vector

◆ variable_map

Constructor & Destructor Documentation

◆ jit_convert() [1/2]

◆ jit_convert() [2/2]

Member Function Documentation

◆ create_checked()

template<typename ... Args>
jit_call* octave::jit_convert::create_checked ( const Args &...  args)
inline

◆ create_checked_impl()

◆ create_variable()

jit_variable * octave::jit_convert::create_variable ( const std::string vname,
jit_type type,
bool  isarg = true 
)
private

◆ do_assign() [1/2]

◆ do_assign() [2/2]

jit_value * octave::jit_convert::do_assign ( const std::string lhs,
jit_value rhs,
bool  print,
bool  artificial = false 
)
private

◆ find_variable()

jit_variable * octave::jit_convert::find_variable ( const std::string vname) const
private

Definition at line 1136 of file pt-jit.cc.

References m_vmap.

Referenced by get_variable(), and visit_simple_for_command().

◆ finish_breaks()

void octave::jit_convert::finish_breaks ( jit_block dest,
const block_list lst 
)
private

◆ get_blocks()

jit_block_list& octave::jit_convert::get_blocks ( void  )
inline

◆ get_bounds()

const type_bound_vector& octave::jit_convert::get_bounds ( void  ) const
inline

Definition at line 79 of file pt-jit.h.

Referenced by octave::jit_info::compile().

◆ get_factory()

jit_factory& octave::jit_convert::get_factory ( void  )
inline

◆ get_function()

llvm::Function* octave::jit_convert::get_function ( void  ) const
inline

Definition at line 83 of file pt-jit.h.

◆ get_variable()

◆ get_variable_map()

const variable_map& octave::jit_convert::get_variable_map ( void  ) const
inline

◆ initialize()

◆ next_for_bounds()

std::string octave::jit_convert::next_for_bounds ( bool  inc = true)
inlineprivate

Definition at line 230 of file pt-jit.h.

Referenced by jit_convert(), and visit_simple_for_command().

◆ next_iterator()

std::string octave::jit_convert::next_iterator ( bool  inc = true)
inlineprivate

Definition at line 227 of file pt-jit.h.

Referenced by visit_simple_for_command().

◆ next_name()

std::string octave::jit_convert::next_name ( const char *  prefix,
size_t count,
bool  inc 
)
private

Definition at line 1195 of file pt-jit.cc.

◆ next_shortcircut_result()

std::string octave::jit_convert::next_shortcircut_result ( bool  inc = true)
inlineprivate

Definition at line 233 of file pt-jit.h.

Referenced by visit_boolean_expression().

◆ resolve()

◆ visit() [1/2]

◆ visit() [2/2]

jit_value * octave::jit_convert::visit ( tree tee)
private

◆ visit_anon_fcn_handle()

void octave::jit_convert::visit_anon_fcn_handle ( tree_anon_fcn_handle )
virtual

Implements octave::tree_walker.

Definition at line 273 of file pt-jit.cc.

◆ visit_argument_list()

void octave::jit_convert::visit_argument_list ( tree_argument_list )
virtual

Implements octave::tree_walker.

Definition at line 279 of file pt-jit.cc.

◆ visit_binary_expression()

◆ visit_boolean_expression()

◆ visit_break_command()

void octave::jit_convert::visit_break_command ( tree_break_command )
virtual

Implements octave::tree_walker.

Definition at line 344 of file pt-jit.cc.

References m_block, and m_breaks.

◆ visit_cell()

void octave::jit_convert::visit_cell ( tree_cell )
virtual

Implements octave::tree_walker.

Definition at line 669 of file pt-jit.cc.

◆ visit_classdef()

virtual void octave::tree_walker::visit_classdef ( tree_classdef )
inlinevirtualinherited

Definition at line 294 of file pt-walk.h.

Referenced by octave::tree_classdef::accept().

◆ visit_classdef_attribute()

virtual void octave::tree_walker::visit_classdef_attribute ( tree_classdef_attribute )
inlinevirtualinherited

Definition at line 246 of file pt-walk.h.

Referenced by octave::tree_classdef_attribute::accept().

◆ visit_classdef_attribute_list()

virtual void octave::tree_walker::visit_classdef_attribute_list ( tree_classdef_attribute_list )
inlinevirtualinherited

Definition at line 249 of file pt-walk.h.

Referenced by octave::tree_classdef_attribute_list::accept().

◆ visit_classdef_body()

virtual void octave::tree_walker::visit_classdef_body ( tree_classdef_body )
inlinevirtualinherited

Definition at line 291 of file pt-walk.h.

Referenced by octave::tree_classdef_body::accept().

◆ visit_classdef_enum()

virtual void octave::tree_walker::visit_classdef_enum ( tree_classdef_enum )
inlinevirtualinherited

Definition at line 282 of file pt-walk.h.

Referenced by octave::tree_classdef_enum::accept().

◆ visit_classdef_enum_block()

virtual void octave::tree_walker::visit_classdef_enum_block ( tree_classdef_enum_block )
inlinevirtualinherited

Definition at line 288 of file pt-walk.h.

Referenced by octave::tree_classdef_enum_block::accept().

◆ visit_classdef_enum_list()

virtual void octave::tree_walker::visit_classdef_enum_list ( tree_classdef_enum_list )
inlinevirtualinherited

Definition at line 285 of file pt-walk.h.

Referenced by octave::tree_classdef_enum_list::accept().

◆ visit_classdef_event()

virtual void octave::tree_walker::visit_classdef_event ( tree_classdef_event )
inlinevirtualinherited

Definition at line 273 of file pt-walk.h.

Referenced by octave::tree_classdef_event::accept().

◆ visit_classdef_events_block()

virtual void octave::tree_walker::visit_classdef_events_block ( tree_classdef_events_block )
inlinevirtualinherited

Definition at line 279 of file pt-walk.h.

Referenced by octave::tree_classdef_events_block::accept().

◆ visit_classdef_events_list()

virtual void octave::tree_walker::visit_classdef_events_list ( tree_classdef_events_list )
inlinevirtualinherited

Definition at line 276 of file pt-walk.h.

Referenced by octave::tree_classdef_events_list::accept().

◆ visit_classdef_methods_block()

virtual void octave::tree_walker::visit_classdef_methods_block ( tree_classdef_methods_block )
inlinevirtualinherited

Definition at line 270 of file pt-walk.h.

Referenced by octave::tree_classdef_methods_block::accept().

◆ visit_classdef_methods_list()

virtual void octave::tree_walker::visit_classdef_methods_list ( tree_classdef_methods_list )
inlinevirtualinherited

Definition at line 267 of file pt-walk.h.

Referenced by octave::tree_classdef_methods_list::accept().

◆ visit_classdef_properties_block()

virtual void octave::tree_walker::visit_classdef_properties_block ( tree_classdef_properties_block )
inlinevirtualinherited

Definition at line 264 of file pt-walk.h.

Referenced by octave::tree_classdef_properties_block::accept().

◆ visit_classdef_property()

virtual void octave::tree_walker::visit_classdef_property ( tree_classdef_property )
inlinevirtualinherited

Definition at line 258 of file pt-walk.h.

Referenced by octave::tree_classdef_property::accept().

◆ visit_classdef_property_list()

virtual void octave::tree_walker::visit_classdef_property_list ( tree_classdef_property_list )
inlinevirtualinherited

Definition at line 261 of file pt-walk.h.

Referenced by octave::tree_classdef_property_list::accept().

◆ visit_classdef_superclass()

virtual void octave::tree_walker::visit_classdef_superclass ( tree_classdef_superclass )
inlinevirtualinherited

Definition at line 252 of file pt-walk.h.

Referenced by octave::tree_classdef_superclass::accept().

◆ visit_classdef_superclass_list()

virtual void octave::tree_walker::visit_classdef_superclass_list ( tree_classdef_superclass_list )
inlinevirtualinherited

Definition at line 255 of file pt-walk.h.

Referenced by octave::tree_classdef_superclass_list::accept().

◆ visit_colon_expression()

◆ visit_complex_for_command()

void octave::jit_convert::visit_complex_for_command ( tree_complex_for_command )
virtual

Implements octave::tree_walker.

Definition at line 498 of file pt-jit.cc.

◆ visit_compound_binary_expression()

void octave::tree_walker::visit_compound_binary_expression ( tree_compound_binary_expression expr)
virtualinherited

◆ visit_constant()

◆ visit_continue_command()

void octave::jit_convert::visit_continue_command ( tree_continue_command )
virtual

Implements octave::tree_walker.

Definition at line 369 of file pt-jit.cc.

References m_block, and m_continues.

◆ visit_decl_command()

void octave::jit_convert::visit_decl_command ( tree_decl_command )
virtual

Implements octave::tree_walker.

Definition at line 376 of file pt-jit.cc.

◆ visit_decl_elt()

void octave::jit_convert::visit_decl_elt ( tree_decl_elt )
virtual

Implements octave::tree_walker.

Definition at line 382 of file pt-jit.cc.

◆ visit_decl_init_list()

void octave::jit_convert::visit_decl_init_list ( tree_decl_init_list )
virtual

Implements octave::tree_walker.

Definition at line 388 of file pt-jit.cc.

◆ visit_do_until_command()

◆ visit_fcn_handle()

void octave::jit_convert::visit_fcn_handle ( tree_fcn_handle )
virtual

Implements octave::tree_walker.

Definition at line 713 of file pt-jit.cc.

◆ visit_funcall()

void octave::jit_convert::visit_funcall ( tree_funcall )
virtual

Implements octave::tree_walker.

Definition at line 719 of file pt-jit.cc.

◆ visit_function_def()

void octave::jit_convert::visit_function_def ( tree_function_def )
virtual

Implements octave::tree_walker.

Definition at line 528 of file pt-jit.cc.

◆ visit_identifier()

◆ visit_if_clause()

void octave::jit_convert::visit_if_clause ( tree_if_clause )
virtual

Implements octave::tree_walker.

Definition at line 552 of file pt-jit.cc.

◆ visit_if_command()

void octave::jit_convert::visit_if_command ( tree_if_command cmd)
virtual

◆ visit_if_command_list()

◆ visit_index_expression()

void octave::jit_convert::visit_index_expression ( tree_index_expression exp)
virtual

Implements octave::tree_walker.

Definition at line 657 of file pt-jit.cc.

References m_result, and resolve().

◆ visit_matrix()

void octave::jit_convert::visit_matrix ( tree_matrix )
virtual

Implements octave::tree_walker.

Definition at line 663 of file pt-jit.cc.

◆ visit_multi_assignment()

void octave::jit_convert::visit_multi_assignment ( tree_multi_assignment )
virtual

Implements octave::tree_walker.

Definition at line 675 of file pt-jit.cc.

◆ visit_no_op_command()

void octave::jit_convert::visit_no_op_command ( tree_no_op_command )
virtual

Implements octave::tree_walker.

Definition at line 681 of file pt-jit.cc.

◆ visit_octave_user_function()

void octave::jit_convert::visit_octave_user_function ( octave_user_function )
virtual

Implements octave::tree_walker.

Definition at line 510 of file pt-jit.cc.

◆ visit_octave_user_function_header()

void octave::jit_convert::visit_octave_user_function_header ( octave_user_function )

Definition at line 516 of file pt-jit.cc.

◆ visit_octave_user_function_trailer()

void octave::jit_convert::visit_octave_user_function_trailer ( octave_user_function )

Definition at line 522 of file pt-jit.cc.

◆ visit_octave_user_script()

void octave::jit_convert::visit_octave_user_script ( octave_user_script )
virtual

Implements octave::tree_walker.

Definition at line 504 of file pt-jit.cc.

◆ visit_parameter_list()

void octave::jit_convert::visit_parameter_list ( tree_parameter_list )
virtual

Implements octave::tree_walker.

Definition at line 725 of file pt-jit.cc.

◆ visit_postfix_expression()

◆ visit_prefix_expression()

◆ visit_return_command()

void octave::jit_convert::visit_return_command ( tree_return_command )
virtual

Implements octave::tree_walker.

Definition at line 761 of file pt-jit.cc.

◆ visit_return_list()

void octave::jit_convert::visit_return_list ( tree_return_list )
virtual

Implements octave::tree_walker.

Definition at line 767 of file pt-jit.cc.

◆ visit_simple_assignment()

◆ visit_simple_for_command()

◆ visit_statement()

◆ visit_statement_list()

void octave::jit_convert::visit_statement_list ( tree_statement_list lst)
virtual

◆ visit_switch_case()

void octave::jit_convert::visit_switch_case ( tree_switch_case )
virtual

Implements octave::tree_walker.

Definition at line 846 of file pt-jit.cc.

◆ visit_switch_case_list()

void octave::jit_convert::visit_switch_case_list ( tree_switch_case_list )
virtual

Implements octave::tree_walker.

Definition at line 852 of file pt-jit.cc.

◆ visit_switch_command()

◆ visit_try_catch_command()

void octave::jit_convert::visit_try_catch_command ( tree_try_catch_command )
virtual

Implements octave::tree_walker.

Definition at line 966 of file pt-jit.cc.

◆ visit_unwind_protect_command()

void octave::jit_convert::visit_unwind_protect_command ( tree_unwind_protect_command )
virtual

Implements octave::tree_walker.

Definition at line 972 of file pt-jit.cc.

◆ visit_while_command()

Member Data Documentation

◆ m_arguments

std::vector<std::pair<std::string, bool> > octave::jit_convert::m_arguments
private

Definition at line 177 of file pt-jit.h.

◆ m_block

◆ m_blocks

◆ m_bounds

type_bound_vector octave::jit_convert::m_bounds
private

Definition at line 178 of file pt-jit.h.

Referenced by get_variable().

◆ m_breaks

◆ m_continues

◆ m_converting_function

bool octave::jit_convert::m_converting_function
private

Definition at line 180 of file pt-jit.h.

Referenced by get_variable().

◆ m_end_context

std::vector<jit_magic_end::context> octave::jit_convert::m_end_context
private

Definition at line 200 of file pt-jit.h.

Referenced by resolve(), and visit_identifier().

◆ m_entry_block

jit_block* octave::jit_convert::m_entry_block
private

Definition at line 190 of file pt-jit.h.

Referenced by create_variable(), and initialize().

◆ m_factory

◆ m_final_block

jit_block* octave::jit_convert::m_final_block
private

◆ m_for_bounds_count

size_t octave::jit_convert::m_for_bounds_count
private

Definition at line 203 of file pt-jit.h.

Referenced by initialize().

◆ m_function

llvm::Function* octave::jit_convert::m_function
private

Definition at line 196 of file pt-jit.h.

◆ m_iterator_count

size_t octave::jit_convert::m_iterator_count
private

Definition at line 202 of file pt-jit.h.

Referenced by initialize().

◆ m_result

◆ m_scope

symbol_scope octave::jit_convert::m_scope
private

Definition at line 183 of file pt-jit.h.

Referenced by get_variable(), initialize(), and visit_statement().

◆ m_short_count

size_t octave::jit_convert::m_short_count
private

Definition at line 204 of file pt-jit.h.

Referenced by initialize().

◆ m_vmap

variable_map octave::jit_convert::m_vmap
private

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