GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
jit_convert Class Reference

#include "pt-jit.h"

Inheritance diagram for jit_convert:
Inheritance graph
[legend]
Collaboration diagram for jit_convert:
Collaboration graph
[legend]

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 (tree &tee, jit_type *for_bounds=0)
 
 jit_convert (octave_user_function &fcn, const std::vector< jit_type * > &args)
 
template<typename ARG0 , typename ARG1 >
jit_callcreate_checked (const ARG0 &arg0, const ARG1 &arg1)
 
template<typename ARG0 , typename ARG1 , typename ARG2 >
jit_callcreate_checked (const ARG0 &arg0, const ARG1 &arg1, const ARG2 &arg2)
 
template<typename ARG0 >
jit_callcreate_checked (const ARG0 &arg0)
 
template<typename ARG0 , typename ARG1 , typename ARG2 , typename ARG3 >
jit_callcreate_checked (const ARG0 &arg0, const ARG1 &arg1, const ARG2 &arg2, const ARG3 &arg3)
 
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_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 &)
 
void visit_constant (tree_constant &)
 
void visit_continue_command (tree_continue_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_global_command (tree_global_command &)
 
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_persistent_command (tree_persistent_command &)
 
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 (symbol_table::scope_id 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=0, bool lhs=false)
 
jit_valuevisit (tree *tee)
 
jit_valuevisit (tree &tee)
 

Private Attributes

std::vector< std::pair
< std::string, bool > > 
arguments
 
jit_blockblock
 
jit_block_list blocks
 
type_bound_vector bounds
 
block_list breaks
 
block_list continues
 
bool converting_function
 
std::vector
< jit_magic_end::context
end_context
 
jit_blockentry_block
 
jit_factory factory
 
jit_blockfinal_block
 
size_t for_bounds_count
 
llvm::Function * function
 
size_t iterator_count
 
jit_valueresult
 
symbol_table::scope_id scope
 
size_t short_count
 
variable_map vmap
 

Detailed Description

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

Member Typedef Documentation

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

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

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

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

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

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

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

Constructor & Destructor Documentation

jit_convert::jit_convert ( tree tee,
jit_type for_bounds = 0 
)
jit_convert::jit_convert ( octave_user_function fcn,
const std::vector< jit_type * > &  args 
)

Member Function Documentation

template<typename ARG0 >
jit_call* jit_convert::create_checked ( const ARG0 &  arg0)
inline
template<typename ARG0 , typename ARG1 >
jit_call* jit_convert::create_checked ( const ARG0 &  arg0,
const ARG1 &  arg1 
)
inline

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

template<typename ARG0 , typename ARG1 , typename ARG2 , typename ARG3 >
jit_call* jit_convert::create_checked ( const ARG0 &  arg0,
const ARG1 &  arg1,
const ARG2 &  arg2,
const ARG3 &  arg3 
)
inline

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

template<typename ARG0 , typename ARG1 , typename ARG2 >
jit_call* jit_convert::create_checked ( const ARG0 &  arg0,
const ARG1 &  arg1,
const ARG2 &  arg2 
)
inline

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

jit_call * jit_convert::create_checked_impl ( jit_call ret)
private
jit_variable * jit_convert::create_variable ( const std::string &  vname,
jit_type type,
bool  isarg = true 
)
private
jit_value * jit_convert::do_assign ( tree_expression exp,
jit_value rhs,
bool  artificial = false 
)
private
jit_value * jit_convert::do_assign ( const std::string &  lhs,
jit_value rhs,
bool  print,
bool  artificial = false 
)
private
jit_variable * jit_convert::find_variable ( const std::string &  vname) const
private

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

References vmap.

Referenced by get_variable(), and visit_simple_for_command().

void jit_convert::finish_breaks ( jit_block dest,
const block_list lst 
)
private
jit_block_list& jit_convert::get_blocks ( void  )
inline

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

Referenced by jit_info::compile(), and jit_function_info::jit_function_info().

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

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

Referenced by jit_info::compile().

jit_factory& jit_convert::get_factory ( void  )
inline

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

Referenced by jit_info::compile(), and jit_function_info::jit_function_info().

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

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

jit_variable * jit_convert::get_variable ( const std::string &  vname)
private
const variable_map& jit_convert::get_variable_map ( void  ) const
inline

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

Referenced by jit_info::compile(), and jit_function_info::jit_function_info().

void jit_convert::initialize ( symbol_table::scope_id  s)
private
std::string jit_convert::next_for_bounds ( bool  inc = true)
inlineprivate

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

Referenced by jit_convert(), and visit_simple_for_command().

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

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

Referenced by visit_simple_for_command().

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

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

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

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

Referenced by visit_binary_expression().

jit_instruction * jit_convert::resolve ( tree_index_expression exp,
jit_value extra_arg = 0,
bool  lhs = false 
)
private
jit_value* jit_convert::visit ( tree tee)
inlineprivate
jit_value * jit_convert::visit ( tree tee)
private

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

References tree::accept(), action_container::protect_var(), and result.

void jit_convert::visit_anon_fcn_handle ( tree_anon_fcn_handle )
virtual

Implements tree_walker.

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

void jit_convert::visit_argument_list ( tree_argument_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_binary_expression ( tree_binary_expression be)
virtual
void jit_convert::visit_break_command ( tree_break_command )
virtual

Implements tree_walker.

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

References block, and breaks.

void jit_convert::visit_cell ( tree_cell )
virtual

Implements tree_walker.

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

virtual void tree_walker::visit_classdef ( tree_classdef )
inlinevirtualinherited

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

Referenced by tree_classdef::accept().

virtual void tree_walker::visit_classdef_attribute ( tree_classdef_attribute )
inlinevirtualinherited

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

Referenced by tree_classdef_attribute::accept().

virtual void tree_walker::visit_classdef_attribute_list ( tree_classdef_attribute_list )
inlinevirtualinherited

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

Referenced by tree_classdef_attribute_list::accept().

virtual void tree_walker::visit_classdef_body ( tree_classdef_body )
inlinevirtualinherited

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

virtual void tree_walker::visit_classdef_enum ( tree_classdef_enum )
inlinevirtualinherited

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

Referenced by tree_classdef_enum::accept().

virtual void tree_walker::visit_classdef_enum_block ( tree_classdef_enum_block )
inlinevirtualinherited

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

Referenced by tree_classdef_enum_block::accept().

virtual void tree_walker::visit_classdef_enum_list ( tree_classdef_enum_list )
inlinevirtualinherited

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

Referenced by tree_classdef_enum_list::accept().

virtual void tree_walker::visit_classdef_event ( tree_classdef_event )
inlinevirtualinherited

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

Referenced by tree_classdef_event::accept().

virtual void tree_walker::visit_classdef_events_block ( tree_classdef_events_block )
inlinevirtualinherited

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

Referenced by tree_classdef_events_block::accept().

virtual void tree_walker::visit_classdef_events_list ( tree_classdef_events_list )
inlinevirtualinherited

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

Referenced by tree_classdef_events_list::accept().

virtual void tree_walker::visit_classdef_methods_block ( tree_classdef_methods_block )
inlinevirtualinherited

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

Referenced by tree_classdef_methods_block::accept().

virtual void tree_walker::visit_classdef_methods_list ( tree_classdef_methods_list )
inlinevirtualinherited

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

Referenced by tree_classdef_methods_list::accept().

virtual void tree_walker::visit_classdef_properties_block ( tree_classdef_properties_block )
inlinevirtualinherited

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

Referenced by tree_classdef_properties_block::accept().

virtual void tree_walker::visit_classdef_property ( tree_classdef_property )
inlinevirtualinherited

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

Referenced by tree_classdef_property::accept().

virtual void tree_walker::visit_classdef_property_list ( tree_classdef_property_list )
inlinevirtualinherited

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

Referenced by tree_classdef_property_list::accept().

virtual void tree_walker::visit_classdef_superclass ( tree_classdef_superclass )
inlinevirtualinherited

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

Referenced by tree_classdef_superclass::accept().

virtual void tree_walker::visit_classdef_superclass_list ( tree_classdef_superclass_list )
inlinevirtualinherited

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

Referenced by tree_classdef_superclass_list::accept().

void jit_convert::visit_colon_expression ( tree_colon_expression expr)
virtual
void jit_convert::visit_complex_for_command ( tree_complex_for_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_constant ( tree_constant tc)
virtual
void jit_convert::visit_continue_command ( tree_continue_command )
virtual

Implements tree_walker.

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

References block, and continues.

void jit_convert::visit_decl_elt ( tree_decl_elt )
virtual

Implements tree_walker.

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

void jit_convert::visit_decl_init_list ( tree_decl_init_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_do_until_command ( tree_do_until_command duc)
virtual
void jit_convert::visit_fcn_handle ( tree_fcn_handle )
virtual

Implements tree_walker.

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

void jit_convert::visit_funcall ( tree_funcall )
virtual

Implements tree_walker.

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

void jit_convert::visit_function_def ( tree_function_def )
virtual

Implements tree_walker.

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

void jit_convert::visit_global_command ( tree_global_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_identifier ( tree_identifier ti)
virtual
void jit_convert::visit_if_clause ( tree_if_clause )
virtual

Implements tree_walker.

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

void jit_convert::visit_if_command ( tree_if_command cmd)
virtual

Implements tree_walker.

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

References tree_if_command_list::accept(), and tree_if_command::cmd_list().

void jit_convert::visit_if_command_list ( tree_if_command_list lst)
virtual
void jit_convert::visit_index_expression ( tree_index_expression exp)
virtual

Implements tree_walker.

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

References resolve(), and result.

void jit_convert::visit_matrix ( tree_matrix )
virtual

Implements tree_walker.

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

void jit_convert::visit_multi_assignment ( tree_multi_assignment )
virtual

Implements tree_walker.

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

void jit_convert::visit_no_op_command ( tree_no_op_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_octave_user_function ( octave_user_function )
virtual

Implements tree_walker.

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

void jit_convert::visit_octave_user_function_header ( octave_user_function )

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

void jit_convert::visit_octave_user_function_trailer ( octave_user_function )

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

void jit_convert::visit_octave_user_script ( octave_user_script )
virtual

Implements tree_walker.

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

void jit_convert::visit_parameter_list ( tree_parameter_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_persistent_command ( tree_persistent_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_postfix_expression ( tree_postfix_expression tpe)
virtual
void jit_convert::visit_prefix_expression ( tree_prefix_expression tpe)
virtual
void jit_convert::visit_return_command ( tree_return_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_return_list ( tree_return_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_simple_assignment ( tree_simple_assignment tsa)
virtual
void jit_convert::visit_simple_for_command ( tree_simple_for_command cmd)
virtual
void jit_convert::visit_statement ( tree_statement stmt)
virtual
void jit_convert::visit_statement_list ( tree_statement_list lst)
virtual
void jit_convert::visit_switch_case ( tree_switch_case )
virtual

Implements tree_walker.

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

void jit_convert::visit_switch_case_list ( tree_switch_case_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_switch_command ( tree_switch_command cmd)
virtual
void jit_convert::visit_try_catch_command ( tree_try_catch_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_unwind_protect_command ( tree_unwind_protect_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_while_command ( tree_while_command wc)
virtual

Member Data Documentation

std::vector<std::pair<std::string, bool> > jit_convert::arguments
private

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

jit_block* jit_convert::block
private
jit_block_list jit_convert::blocks
private
type_bound_vector jit_convert::bounds
private

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

Referenced by get_variable().

block_list jit_convert::breaks
private
block_list jit_convert::continues
private
bool jit_convert::converting_function
private

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

Referenced by get_variable().

std::vector<jit_magic_end::context> jit_convert::end_context
private

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

Referenced by resolve(), and visit_identifier().

jit_block* jit_convert::entry_block
private

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

Referenced by create_variable(), and initialize().

jit_factory jit_convert::factory
private
jit_block* jit_convert::final_block
private
size_t jit_convert::for_bounds_count
private

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

Referenced by initialize().

llvm::Function* jit_convert::function
private

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

size_t jit_convert::iterator_count
private

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

Referenced by initialize().

jit_value* jit_convert::result
private
symbol_table::scope_id jit_convert::scope
private

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

Referenced by get_variable(), and initialize().

size_t jit_convert::short_count
private

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

Referenced by initialize().

variable_map jit_convert::vmap
private

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