GNU Octave  3.8.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<OCT_MAKE_DECL_LIST(typename, ARG,1) >
jit_callcreate_checked (OCT_MAKE_LIST(DECL_ARG, 1))
template<OCT_MAKE_DECL_LIST(typename, ARG,2) >
jit_callcreate_checked (OCT_MAKE_LIST(DECL_ARG, 2))
template<OCT_MAKE_DECL_LIST(typename, ARG,3) >
jit_callcreate_checked (OCT_MAKE_LIST(DECL_ARG, 3))
template<OCT_MAKE_DECL_LIST(typename, ARG,4) >
jit_callcreate_checked (OCT_MAKE_LIST(DECL_ARG, 4))
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 &)
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_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 236 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<OCT_MAKE_DECL_LIST(typename, ARG,1) >
jit_call* jit_convert::create_checked ( OCT_MAKE_LIST(DECL_ARG,1)  )
inline
template<OCT_MAKE_DECL_LIST(typename, ARG,2) >
jit_call* jit_convert::create_checked ( OCT_MAKE_LIST(DECL_ARG,2)  )
inline

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

template<OCT_MAKE_DECL_LIST(typename, ARG,3) >
jit_call* jit_convert::create_checked ( OCT_MAKE_LIST(DECL_ARG,3)  )
inline

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

template<OCT_MAKE_DECL_LIST(typename, ARG,4) >
jit_call* jit_convert::create_checked ( OCT_MAKE_LIST(DECL_ARG,4)  )
inline

Definition at line 61 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 936 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 66 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 68 of file pt-jit.h.

Referenced by jit_info::compile().

jit_factory& jit_convert::get_factory ( void  )
inline

Definition at line 70 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 72 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 74 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 215 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 212 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 990 of file pt-jit.cc.

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

Definition at line 218 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 1099 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 231 of file pt-jit.cc.

void jit_convert::visit_argument_list ( tree_argument_list )
virtual

Implements tree_walker.

Definition at line 237 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 306 of file pt-jit.cc.

References block, and breaks.

void jit_convert::visit_cell ( tree_cell )
virtual

Implements tree_walker.

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

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 465 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 331 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 350 of file pt-jit.cc.

void jit_convert::visit_decl_init_list ( tree_decl_init_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_do_until_command ( tree_do_until_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_fcn_handle ( tree_fcn_handle )
virtual

Implements tree_walker.

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

void jit_convert::visit_function_def ( tree_function_def )
virtual

Implements tree_walker.

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

void jit_convert::visit_global_command ( tree_global_command )
virtual

Implements tree_walker.

Definition at line 338 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 519 of file pt-jit.cc.

void jit_convert::visit_if_command ( tree_if_command cmd)
virtual

Implements tree_walker.

Definition at line 525 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 625 of file pt-jit.cc.

References resolve(), and result.

void jit_convert::visit_matrix ( tree_matrix )
virtual

Implements tree_walker.

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

void jit_convert::visit_multi_assignment ( tree_multi_assignment )
virtual

Implements tree_walker.

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

void jit_convert::visit_no_op_command ( tree_no_op_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_octave_user_function ( octave_user_function )
virtual

Implements tree_walker.

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

void jit_convert::visit_octave_user_function_header ( octave_user_function )

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

void jit_convert::visit_octave_user_function_trailer ( octave_user_function )

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

void jit_convert::visit_octave_user_script ( octave_user_script )
virtual

Implements tree_walker.

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

void jit_convert::visit_parameter_list ( tree_parameter_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_persistent_command ( tree_persistent_command )
virtual

Implements tree_walker.

Definition at line 344 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 722 of file pt-jit.cc.

void jit_convert::visit_return_list ( tree_return_list )
virtual

Implements tree_walker.

Definition at line 728 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 806 of file pt-jit.cc.

void jit_convert::visit_switch_case_list ( tree_switch_case_list )
virtual

Implements tree_walker.

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

void jit_convert::visit_switch_command ( tree_switch_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_try_catch_command ( tree_try_catch_command )
virtual

Implements tree_walker.

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

void jit_convert::visit_unwind_protect_command ( tree_unwind_protect_command )
virtual

Implements tree_walker.

Definition at line 830 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 162 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 163 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 165 of file pt-jit.h.

Referenced by get_variable().

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

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

Referenced by resolve(), and visit_identifier().

jit_block* jit_convert::entry_block
private

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

Referenced by initialize().

llvm::Function* jit_convert::function
private

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

size_t jit_convert::iterator_count
private

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

Referenced by get_variable(), and initialize().

size_t jit_convert::short_count
private

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