GNU Octave  6.2.0
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::string > type_bound
 
typedef std::vector< type_boundtype_bound_vector
 
typedef std::map< std::string, jit_variable * > variable_map
 

Public Member Functions

 jit_convert (octave_user_function &fcn, const std::vector< jit_type * > &args)
 
 jit_convert (tree &tee, jit_type *for_bounds=nullptr)
 
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 &)
 
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_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 &)
 
virtual void visit_metaclass_query (tree_metaclass_query &)
 
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_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 &)
 
virtual void visit_superclass_ref (tree_superclass_ref &)
 
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 (const std::string &lhs, jit_value *rhs, bool print, bool artificial=false)
 
jit_valuedo_assign (tree_expression *exp, jit_value *rhs, 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 51 of file pt-jit.h.

Member Typedef Documentation

◆ block_list

typedef std::list<jit_block *> octave::jit_convert::block_list
private

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

◆ type_bound

typedef std::pair<jit_type *, std::string> octave::jit_convert::type_bound

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

◆ type_bound_vector

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

◆ variable_map

typedef std::map<std::string, jit_variable *> octave::jit_convert::variable_map

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

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]

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

◆ do_assign() [2/2]

jit_value * octave::jit_convert::do_assign ( tree_expression exp,
jit_value rhs,
bool  artificial = false 
)
private

◆ find_variable()

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

Definition at line 1129 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 73 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 77 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 220 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 217 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 1188 of file pt-jit.cc.

◆ next_shortcircut_result()

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

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

Referenced by visit_boolean_expression().

◆ resolve()

◆ visit() [1/2]

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

◆ visit() [2/2]

◆ visit_anon_fcn_handle()

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

Reimplemented from octave::tree_walker.

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

◆ visit_argument_list()

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

Reimplemented from octave::tree_walker.

Definition at line 305 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

Reimplemented from octave::tree_walker.

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

References m_block, and m_breaks.

◆ visit_cell()

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

Reimplemented from octave::tree_walker.

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

◆ visit_classdef()

void octave::tree_walker::visit_classdef ( tree_classdef )
virtualinherited

Definition at line 606 of file pt-walk.cc.

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

◆ visit_classdef_attribute()

void octave::tree_walker::visit_classdef_attribute ( tree_classdef_attribute )
virtualinherited

Definition at line 526 of file pt-walk.cc.

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

◆ visit_classdef_attribute_list()

void octave::tree_walker::visit_classdef_attribute_list ( tree_classdef_attribute_list )
virtualinherited

Definition at line 531 of file pt-walk.cc.

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

◆ visit_classdef_body()

void octave::tree_walker::visit_classdef_body ( tree_classdef_body )
virtualinherited

Definition at line 601 of file pt-walk.cc.

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

◆ visit_classdef_enum()

void octave::tree_walker::visit_classdef_enum ( tree_classdef_enum )
virtualinherited

Definition at line 586 of file pt-walk.cc.

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

◆ visit_classdef_enum_block()

void octave::tree_walker::visit_classdef_enum_block ( tree_classdef_enum_block )
virtualinherited

Definition at line 596 of file pt-walk.cc.

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

◆ visit_classdef_enum_list()

void octave::tree_walker::visit_classdef_enum_list ( tree_classdef_enum_list )
virtualinherited

Definition at line 591 of file pt-walk.cc.

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

◆ visit_classdef_event()

void octave::tree_walker::visit_classdef_event ( tree_classdef_event )
virtualinherited

Definition at line 571 of file pt-walk.cc.

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

◆ visit_classdef_events_block()

void octave::tree_walker::visit_classdef_events_block ( tree_classdef_events_block )
virtualinherited

Definition at line 581 of file pt-walk.cc.

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

◆ visit_classdef_events_list()

void octave::tree_walker::visit_classdef_events_list ( tree_classdef_events_list )
virtualinherited

Definition at line 576 of file pt-walk.cc.

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

◆ visit_classdef_methods_block()

void octave::tree_walker::visit_classdef_methods_block ( tree_classdef_methods_block )
virtualinherited

Definition at line 566 of file pt-walk.cc.

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

◆ visit_classdef_methods_list()

void octave::tree_walker::visit_classdef_methods_list ( tree_classdef_methods_list )
virtualinherited

Definition at line 561 of file pt-walk.cc.

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

◆ visit_classdef_properties_block()

void octave::tree_walker::visit_classdef_properties_block ( tree_classdef_properties_block )
virtualinherited

Definition at line 556 of file pt-walk.cc.

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

◆ visit_classdef_property()

void octave::tree_walker::visit_classdef_property ( tree_classdef_property )
virtualinherited

Definition at line 546 of file pt-walk.cc.

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

◆ visit_classdef_property_list()

void octave::tree_walker::visit_classdef_property_list ( tree_classdef_property_list )
virtualinherited

Definition at line 551 of file pt-walk.cc.

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

◆ visit_classdef_superclass()

void octave::tree_walker::visit_classdef_superclass ( tree_classdef_superclass )
virtualinherited

Definition at line 536 of file pt-walk.cc.

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

◆ visit_classdef_superclass_list()

void octave::tree_walker::visit_classdef_superclass_list ( tree_classdef_superclass_list )
virtualinherited

Definition at line 541 of file pt-walk.cc.

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

Reimplemented from octave::tree_walker.

Definition at line 524 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

Reimplemented from octave::tree_walker.

Definition at line 395 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

Reimplemented from octave::tree_walker.

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

◆ visit_decl_elt()

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

Reimplemented from octave::tree_walker.

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

◆ visit_decl_init_list()

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

Reimplemented from octave::tree_walker.

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

◆ visit_do_until_command()

◆ visit_fcn_handle()

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

Reimplemented from octave::tree_walker.

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

◆ visit_function_def()

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

Reimplemented from octave::tree_walker.

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

◆ visit_identifier()

void octave::jit_convert::visit_identifier ( tree_identifier ti)
virtual

◆ visit_if_clause()

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

Reimplemented from octave::tree_walker.

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

◆ visit_if_command()

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

Reimplemented from octave::tree_walker.

◆ visit_if_command_list()

◆ visit_index_expression()

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

Reimplemented from octave::tree_walker.

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

References m_result, and resolve().

◆ visit_matrix()

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

Reimplemented from octave::tree_walker.

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

◆ visit_metaclass_query()

void octave::tree_walker::visit_metaclass_query ( tree_metaclass_query )
virtualinherited

Reimplemented in octave::tree_print_code, and octave::tree_evaluator.

Definition at line 521 of file pt-walk.cc.

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

◆ visit_multi_assignment()

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

Reimplemented from octave::tree_walker.

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

◆ visit_no_op_command()

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

Reimplemented from octave::tree_walker.

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

◆ visit_octave_user_function()

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

Reimplemented from octave::tree_walker.

Definition at line 536 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 542 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 548 of file pt-jit.cc.

◆ visit_octave_user_script()

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

Reimplemented from octave::tree_walker.

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

◆ visit_parameter_list()

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

Reimplemented from octave::tree_walker.

Definition at line 737 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

Reimplemented from octave::tree_walker.

Definition at line 773 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 )
virtual

Reimplemented from octave::tree_walker.

Referenced by jit_convert().

◆ visit_superclass_ref()

void octave::tree_walker::visit_superclass_ref ( tree_superclass_ref )
virtualinherited

◆ visit_switch_case()

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

Reimplemented from octave::tree_walker.

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

◆ visit_switch_case_list()

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

Reimplemented from octave::tree_walker.

Definition at line 845 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

Reimplemented from octave::tree_walker.

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

◆ visit_unwind_protect_command()

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

Reimplemented from octave::tree_walker.

Definition at line 965 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 167 of file pt-jit.h.

◆ m_block

◆ m_blocks

◆ m_bounds

type_bound_vector octave::jit_convert::m_bounds
private

Definition at line 168 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 170 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 190 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 180 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 193 of file pt-jit.h.

Referenced by initialize().

◆ m_function

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

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

◆ m_iterator_count

size_t octave::jit_convert::m_iterator_count
private

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

Referenced by initialize().

◆ m_result

◆ m_scope

symbol_scope octave::jit_convert::m_scope
private

Definition at line 173 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 194 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: