osprey/be/whirl2c/wn2c.cxx File Reference

#include <alloca.h>
#include "whirl2c_common.h"
#include "mempool.h"
#include "const.h"
#include "pf_cg.h"
#include "region_util.h"
#include "w2cf_parentize.h"
#include "PUinfo.h"
#include "wn2c.h"
#include "wn2c_pragma.h"
#include "st2c.h"
#include "ty2c.h"
#include "tcon2c.h"
#include "ir_reader.h"
#include "inttypes.h"
#include "stdarg.h"
#include <set>
#include <vector>

Include dependency graph for wn2c.cxx:

Go to the source code of this file.

Data Types

type  Opr2handler
type  Opc2Cname_Map
type  FLD_list

Defines

#define WN_pragma_nest(wn)   WN_pragma_arg1(wn)
#define WN2C_assignment_compatible_types(lhs_ty, rhs_ty)
#define WN2C_compatible_lvalues(lhs_ty, rhs_ty)
#define WN2C_arithmetic_compatible_types(t1, t2)
#define WN2C_compatible_qualified_types(t1, t2)
#define WN2C_array_lvalue_as_ptr(ptr_to_array, ptr)
#define NUMBER_OF_OPERATORS   (OPERATOR_LAST + 1)
#define NUMBER_OF_OPR2HANDLER_MAPS   (sizeof(WN2C_Opr_Handler_Map) / sizeof(OPR2HANDLER))
#define WN2C_IS_INFIX_OP(opc)   ((WN2C_Opc2cname[opc]!=NULL)? (WN2C_Opc2cname[opc][0]!='_') : FALSE)
#define WN2C_IS_FUNCALL_OP(opc)   ((WN2C_Opc2cname[opc]!=NULL)? (WN2C_Opc2cname[opc][0]=='_') : FALSE)
#define NUMBER_OF_OPCODES   (OPCODE_LAST+1)
#define NUMBER_OF_OPC2CNAME_MAPS   sizeof(WN2C_Opc2cname_Map) / sizeof(OPC2CNAME_MAP)
#define WN2C_MAX_FLD_LEVEL   10
#define OPR_LOC   OPERATOR_LAST+12

Typedefs

typedef STATUS(* WN2C_HANDLER_FUNC )(TOKEN_BUFFER, const WN *, CONTEXT)
typedef const WNCWN
typedef struct Opr2handler OPR2HANDLER
typedef struct Opc2Cname_Map OPC2CNAME_MAP

Functions/Subroutines

static BOOL WN2C_is_pointer_diff (OPCODE op, const WN *kid0, const WN *kid1)
static BOOL WN2C_Skip_Stmt (const WN *stmt)
static STATUS WN2C_lda_label (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_ignore (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_unsupported (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_binaryop (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_unaryop (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_func_entry (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_block (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_region (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_switch (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_compgoto (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_do_loop (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_do_while (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_while_do (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_if (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_goto (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_condbr (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_return (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_return_val (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_label (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_exc_scope_end (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_exc_scope_begin (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_istore (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_istorex (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_mstore (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_stid (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_call (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_eval (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_prefetch (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_comment (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_iload (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_iloadx (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_mload (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_array (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_intrinsic_op (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_tas (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_select (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_cvt (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_cvtl (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_realpart (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_imagpart (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_paren (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_complex (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_bnor (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_madd (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_msub (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_nmadd (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_nmsub (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_ldid (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_lda (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_const (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_intconst (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_parm (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_comma (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_rcomma (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_alloca (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_dealloca (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_asm_stmt (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_extract_bits (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_agoto (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static bool WN2C_is_void_ptr (TY_IDX idx)
static UINT WN2C_get_union_offset (TY_IDX ty, UINT field_id)
static void translator_warning (const char *str,...)
static void WN2C_Stmt_Newline (TOKEN_BUFFER tokens, SRCPOS srcpos)
static STATUS WN2C_lvalue_wn (TOKEN_BUFFER tokens, const WN *wn, TY_IDX addr_ty, TY_IDX object_ty, STAB_OFFSET addr_offset, CONTEXT context)
static void WN2C_incr_indentation_for_stmt_body (const WN *body)
static void WN2C_decr_indentation_for_stmt_body (const WN *body)
static TOKEN_BUFFER WN2C_generate_cast (TY_IDX cast_to, BOOL pointer_to_type)
static void WN2C_prepend_cast (TOKEN_BUFFER tokens, TY_IDX cast_to, BOOL pointer_to_type)
static void WN2C_append_cast (TOKEN_BUFFER tokens, TY_IDX cast_to, BOOL pointer_to_type)
static void WN2C_Assign_Complex_Const (TOKEN_BUFFER tokens, const char *lhs_name, TCON realpart, TCON imagpart)
static TOKEN_BUFFER WN2C_Translate_Arithmetic_Operand (const WN *wn, TY_IDX result_ty, CONTEXT context)
static STATUS WN2C_address_add (TOKEN_BUFFER tokens, OPCODE opcode, TY_IDX expr_ty, WN *wn0, WN *wn1, CONTEXT context)
static STATUS WN2C_infix_op (TOKEN_BUFFER tokens, OPCODE opcode, TY_IDX result_ty, WN *wn0, WN *wn1, CONTEXT context)
static STATUS WN2C_funcall_op (TOKEN_BUFFER tokens, OPCODE opcode, WN *wn0, WN *wn1, CONTEXT context)
static TY_IDX WN2C_MemAccess_Type (TY_IDX base_ty, TY_IDX load_ty, MTYPE load_mtype, STAB_OFFSET offset)
static void WN2C_SymAccess_Type (TY_IDX *base_addr_ty, TY_IDX *object_ty, TY_IDX base_ty, TY_IDX load_ty, MTYPE load_mtype, STAB_OFFSET offset)
static void WN2C_append_addr_plus_const (TOKEN_BUFFER tokens, INT64 element_size, STAB_OFFSET byte_offset)
static void WN2C_append_addr_plus_expr (TOKEN_BUFFER tokens, INT64 element_size, TOKEN_BUFFER *byte_offset)
static FLD_HANDLE get_to_field_with_name (TY_IDX struct_ty_idx, UINT field_id, UINT &cur_field_id, FLD_list *fld_stack)
static STAB_OFFSET WN2C_Gen_Const_Array_Index (TOKEN_BUFFER expr_tokens, TY_IDX ty_idx, STAB_OFFSET cur_offset)
static STAB_OFFSET WN2C_Gen_Field_Access (TOKEN_BUFFER expr_tokens, TY_IDX fld_ty, STAB_OFFSET cur_offset, UINT field_id)
static STATUS WN2C_based_lvalue (TOKEN_BUFFER expr_tokens, BOOL expr_is_lvalue, TY_IDX expr_ty, TY_IDX addr_ty, TY_IDX object_ty, STAB_OFFSET addr_offset, UINT field_id=0)
static STATUS WN2C_lvalue_st (TOKEN_BUFFER tokens, const ST *st, TY_IDX addr_ty, TY_IDX object_ty, STAB_OFFSET addr_offset, CONTEXT context, UINT field_id=0)
static STATUS WN2C_ptr_array_wn (TOKEN_BUFFER tokens, const WN *wn, TY_IDX object_ty, STAB_OFFSET addr_offset, CONTEXT context)
static void WN2C_create_ref_param_lda (WN *lda, const WN *ldid)
static void WN2C_Append_Preg (TOKEN_BUFFER tokens, const ST *st, PREG_IDX preg_idx, TY_IDX ty, CONTEXT context)
static void WN2C_Load_From_PregIdx (TOKEN_BUFFER tokens, const ST *preg1, PREG_IDX preg_idx1, const ST *preg2, PREG_IDX preg_idx2, TY_IDX object_ty, CONTEXT context)
static void WN2C_Append_Assignment (TOKEN_BUFFER tokens, TOKEN_BUFFER *lhs_tokens, const WN *rhs, TY_IDX assign_ty, CONTEXT context)
static void WN2C_Normalize_Idx_To_Onedim (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static void WN2C_append_label_name (TOKEN_BUFFER tokens, const WN *wn)
static void WN2C_Append_Symtab_Types (TOKEN_BUFFER tokens, UINT lines_between_decls)
static void WN2C_Append_Symtab_Consts (TOKEN_BUFFER tokens, BOOL use_const_tab, UINT lines_between_decls, CONTEXT context)
static TY_IDX WN2C_get_base_type (TY_IDX idx)
static void WN2C_Append_Symtab_Vars (TOKEN_BUFFER tokens, INT lines_between_decls, CONTEXT context)
static void WN2C_Declare_Return_Variable (TOKEN_BUFFER tokens)
static void WN2C_Declare_Return_Parameter (TOKEN_BUFFER tokens, CONTEXT context)
static void WN2C_Store_Return_Reg (TOKEN_BUFFER tokens, const char *var_name, STAB_OFFSET var_offset, MTYPE preg_mtype, PREG_IDX preg_offset, CONTEXT context)
static void WN2C_Load_Return_Reg (TOKEN_BUFFER tokens, TY_IDX return_ty, const char *var_name, STAB_OFFSET var_offset, MTYPE preg_mtype, PREG_IDX preg_offset, CONTEXT context)
static void WN2C_Function_Call_Lhs (TOKEN_BUFFER rhs_tokens, BOOL parm_return, TY_IDX return_ty, const WN *first_arg, CONTEXT context)
static void WN2C_Function_Return_Value (TOKEN_BUFFER tokens, CONTEXT context)
static void WN2C_Append_Pragma_Newline (TOKEN_BUFFER tokens, SRCPOS srcpos)
static void WN2C_Callsite_Directives (TOKEN_BUFFER tokens, const WN *call_wn, const ST *func_st, CONTEXT context)
static void WN2C_Translate_Stmt_Sequence (TOKEN_BUFFER tokens, const WN *first, BOOL first_on_newline, CONTEXT context)
static void WN2C_Translate_Comma_Sequence (TOKEN_BUFFER tokens, const WN *first, CONTEXT context)
void WN2C_Append_Purple_Funcinfo (TOKEN_BUFFER tokens)
static void Append_Cplus_Initialization (TOKEN_BUFFER tokens, CONTEXT context)
static void WN2C_Prefetch_Map (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static void WN2C_Append_Prompf_Flag_Newline (TOKEN_BUFFER tokens)
static BOOL WN2C_Is_Loop_Region (const WN *region, CONTEXT context)
static BOOL WN2C_Is_Parallel_Region (const WN *region, CONTEXT context)
static void WN2C_Prompf_Construct_Start (TOKEN_BUFFER tokens, const WN *construct)
static void WN2C_Prompf_Construct_End (TOKEN_BUFFER tokens, const WN *construct)
static void WN2C_Start_Prompf_Transformed_Loop (TOKEN_BUFFER tokens, const WN *loop, CONTEXT context)
static void WN2C_End_Prompf_Transformed_Loop (TOKEN_BUFFER tokens, const WN *loop, CONTEXT context)
static void WN2C_Start_Prompf_Transformed_Region (TOKEN_BUFFER tokens, const WN *region, CONTEXT context)
static void WN2C_End_Prompf_Transformed_Region (TOKEN_BUFFER tokens, const WN *region, CONTEXT context)
static STATUS WN2C_altentry (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static BOOL WN2C_int_downcast (TY_IDX from, TY_IDX to)
void WN2C_initialize (void)
void WN2C_finalize (void)
BOOL WN2C_new_symtab (void)
STATUS WN2C_translate (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
void WN2C_translate_structured_types (void)
STATUS WN2C_translate_file_scope_defs (CONTEXT context)
STATUS WN2C_translate_purple_main (TOKEN_BUFFER tokens, const WN *pu, const char *region_name, CONTEXT context)
void WN2C_memref_lhs (TOKEN_BUFFER tokens, TY_IDX *memref_typ, const WN *lhs, STAB_OFFSET memref_ofst, TY_IDX memref_addr_ty, TY_IDX memref_object_ty, MTYPE dtype, CONTEXT context)
void WN2C_stid_lhs (TOKEN_BUFFER tokens, TY_IDX *stored_typ, const ST *lhs_st, STAB_OFFSET stid_ofst, TY_IDX stid_ty, MTYPE dtype, CONTEXT context, UINT field_id)

Variables

static const char WN2C_Purple_Region_Name [] = "prp___region"
static const char WN2C_Return_Value_Name [] = "_RetVal"
static BOOL WN2C_Used_Return_Value = FALSE
static const RETURNSITEWN2C_Next_ReturnSite = NULL
static const CALLSITEWN2C_Prev_CallSite = NULL
static char last_ret_tmp [64]
CWNlast_loc
static WN2C_HANDLER_FUNC WN2C_Opr_Handler [NUMBER_OF_OPERATORS]
static const OPR2HANDLER WN2C_Opr_Handler_Map []
static const char * WN2C_Opc2cname [NUMBER_OF_OPCODES]
static const OPC2CNAME_MAP WN2C_Opc2cname_Map []
static SRCPOS last_source_line
int debug_requested


Define Documentation

#define NUMBER_OF_OPC2CNAME_MAPS   sizeof(WN2C_Opc2cname_Map) / sizeof(OPC2CNAME_MAP)

Definition at line 458 of file wn2c.cxx.

Referenced by WN2C_initialize().

#define NUMBER_OF_OPCODES   (OPCODE_LAST+1)

Definition at line 448 of file wn2c.cxx.

#define NUMBER_OF_OPERATORS   (OPERATOR_LAST + 1)

Definition at line 293 of file wn2c.cxx.

Referenced by WN2C_initialize(), and WN2F_initialize().

#define NUMBER_OF_OPR2HANDLER_MAPS   (sizeof(WN2C_Opr_Handler_Map) / sizeof(OPR2HANDLER))

Definition at line 302 of file wn2c.cxx.

Referenced by WN2C_initialize().

#define OPR_LOC   OPERATOR_LAST+12

Referenced by WN2C_translate().

#define WN2C_arithmetic_compatible_types ( t1,
t2   ) 

#define WN2C_array_lvalue_as_ptr ( ptr_to_array,
ptr   ) 

Value:

Definition at line 137 of file wn2c.cxx.

Referenced by WN2C_based_lvalue().

#define WN2C_assignment_compatible_types ( lhs_ty,
rhs_ty   ) 

#define WN2C_compatible_lvalues ( lhs_ty,
rhs_ty   ) 

Value:

Stab_Assignment_Compatible_Types(lhs_ty, rhs_ty, \
            FALSE, /*check_quals*/ \
            TRUE,  /*check_scalars*/ \
            FALSE)

Definition at line 119 of file wn2c.cxx.

Referenced by WN2C_based_lvalue(), WN2C_MemAccess_Type(), and WN2C_SymAccess_Type().

#define WN2C_compatible_qualified_types ( t1,
t2   ) 

Value:

Stab_Identical_Types(t1, t2, \
      TRUE,  /*check_quals*/ \
      TRUE,  /*check_scalars*/ \
            FALSE)

Definition at line 131 of file wn2c.cxx.

Referenced by WN2C_tas().

#define WN2C_IS_FUNCALL_OP ( opc   )     ((WN2C_Opc2cname[opc]!=NULL)? (WN2C_Opc2cname[opc][0]=='_') : FALSE)

Definition at line 437 of file wn2c.cxx.

Referenced by WN2C_binaryop(), and WN2C_unaryop().

#define WN2C_IS_INFIX_OP ( opc   )     ((WN2C_Opc2cname[opc]!=NULL)? (WN2C_Opc2cname[opc][0]!='_') : FALSE)

Definition at line 429 of file wn2c.cxx.

Referenced by WN2C_binaryop(), and WN2C_unaryop().

#define WN2C_MAX_FLD_LEVEL   10

Definition at line 1991 of file wn2c.cxx.

Referenced by WN2C_array(), and WN2C_Gen_Field_Access().

#define WN_pragma_nest ( wn   )     WN_pragma_arg1(wn)


Typedef Documentation

typedef const WN* CWN

Definition at line 284 of file wn2c.cxx.

Definition at line 282 of file wn2c.cxx.


Function Documentation

static void Append_Cplus_Initialization ( TOKEN_BUFFER  tokens,
CONTEXT  context 
) [static]

Definition at line 3562 of file wn2c.cxx.

References Append_Token_String(), CONTEXT_srcpos, and WN2C_Stmt_Newline().

Referenced by WN2C_block().

static FLD_HANDLE get_to_field_with_name ( TY_IDX  struct_ty_idx,
UINT  field_id,
UINT cur_field_id,
FLD_list fld_stack 
) [static]

static void translator_warning ( const char *  str,
  ... 
) [static]

static STATUS WN2C_address_add ( TOKEN_BUFFER  tokens,
OPCODE  opcode,
TY_IDX  expr_ty,
WN wn0,
WN wn1,
CONTEXT  context 
) [static]

static STATUS WN2C_agoto ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_alloca ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_altentry ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_append_addr_plus_const ( TOKEN_BUFFER  tokens,
INT64  element_size,
STAB_OFFSET  byte_offset 
) [static]

static void WN2C_append_addr_plus_expr ( TOKEN_BUFFER  tokens,
INT64  element_size,
TOKEN_BUFFER byte_offset 
) [static]

static void WN2C_Append_Assignment ( TOKEN_BUFFER  tokens,
TOKEN_BUFFER lhs_tokens,
const WN rhs,
TY_IDX  assign_ty,
CONTEXT  context 
) [static]

static void WN2C_append_cast ( TOKEN_BUFFER  tokens,
TY_IDX  cast_to,
BOOL  pointer_to_type 
) [static]

Definition at line 1327 of file wn2c.cxx.

References Append_And_Reclaim_Token_List(), and WN2C_generate_cast().

Referenced by WN2C_address_add(), and WN2C_mstore().

static void WN2C_append_label_name ( TOKEN_BUFFER  tokens,
const WN wn 
) [static]

static void WN2C_Append_Pragma_Newline ( TOKEN_BUFFER  tokens,
SRCPOS  srcpos 
) [static]

static void WN2C_Append_Preg ( TOKEN_BUFFER  tokens,
const ST st,
PREG_IDX  preg_idx,
TY_IDX  ty,
CONTEXT  context 
) [static]

static void WN2C_Append_Prompf_Flag_Newline ( TOKEN_BUFFER  tokens  )  [static]

void WN2C_Append_Purple_Funcinfo ( TOKEN_BUFFER  tokens  ) 

static void WN2C_Append_Symtab_Consts ( TOKEN_BUFFER  tokens,
BOOL  use_const_tab,
UINT  lines_between_decls,
CONTEXT  context 
) [static]

static void WN2C_Append_Symtab_Types ( TOKEN_BUFFER  tokens,
UINT  lines_between_decls 
) [static]

static void WN2C_Append_Symtab_Vars ( TOKEN_BUFFER  tokens,
INT  lines_between_decls,
CONTEXT  context 
) [static]

static STATUS WN2C_array ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_asm_stmt ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Assign_Complex_Const ( TOKEN_BUFFER  tokens,
const char *  lhs_name,
TCON  realpart,
TCON  imagpart 
) [static]

static STATUS WN2C_based_lvalue ( TOKEN_BUFFER  expr_tokens,
BOOL  expr_is_lvalue,
TY_IDX  expr_ty,
TY_IDX  addr_ty,
TY_IDX  object_ty,
STAB_OFFSET  addr_offset,
UINT  field_id = 0 
) [static]

static STATUS WN2C_binaryop ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_block ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_bnor ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_call ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Callsite_Directives ( TOKEN_BUFFER  tokens,
const WN call_wn,
const ST func_st,
CONTEXT  context 
) [static]

static STATUS WN2C_comma ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_comment ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_compgoto ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_complex ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_condbr ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_const ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_create_ref_param_lda ( WN lda,
const WN ldid 
) [static]

static STATUS WN2C_cvt ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_cvtl ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_dealloca ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Declare_Return_Parameter ( TOKEN_BUFFER  tokens,
CONTEXT  context 
) [static]

static void WN2C_Declare_Return_Variable ( TOKEN_BUFFER  tokens  )  [static]

static void WN2C_decr_indentation_for_stmt_body ( const WN body  )  [static]

Definition at line 1280 of file wn2c.cxx.

References Decrement_Indentation(), OPR_BLOCK, and WN_operator().

Referenced by WN2C_do_loop(), WN2C_do_while(), WN2C_if(), and WN2C_while_do().

static STATUS WN2C_do_loop ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_do_while ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_End_Prompf_Transformed_Loop ( TOKEN_BUFFER  tokens,
const WN loop,
CONTEXT  context 
) [static]

static void WN2C_End_Prompf_Transformed_Region ( TOKEN_BUFFER  tokens,
const WN region,
CONTEXT  context 
) [static]

Definition at line 3743 of file wn2c.cxx.

References WN2C_Is_Loop_Region(), WN2C_Is_Parallel_Region(), and WN2C_Prompf_Construct_End().

Referenced by WN2C_region().

static STATUS WN2C_eval ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

Definition at line 5244 of file wn2c.cxx.

References Is_True, OPR_EVAL, WN2C_translate(), WN_kid0(), and WN_operator().

static STATUS WN2C_exc_scope_begin ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_exc_scope_end ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_extract_bits ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

void WN2C_finalize ( void   ) 

Definition at line 6802 of file wn2c.cxx.

References Stab_Free_Tmpvars().

Referenced by W2C_Fini().

static STATUS WN2C_func_entry ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_funcall_op ( TOKEN_BUFFER  tokens,
OPCODE  opcode,
WN wn0,
WN wn1,
CONTEXT  context 
) [static]

static void WN2C_Function_Call_Lhs ( TOKEN_BUFFER  rhs_tokens,
BOOL  parm_return,
TY_IDX  return_ty,
const WN first_arg,
CONTEXT  context 
) [static]

static void WN2C_Function_Return_Value ( TOKEN_BUFFER  tokens,
CONTEXT  context 
) [static]

static STAB_OFFSET WN2C_Gen_Const_Array_Index ( TOKEN_BUFFER  expr_tokens,
TY_IDX  ty_idx,
STAB_OFFSET  cur_offset 
) [static]

static STAB_OFFSET WN2C_Gen_Field_Access ( TOKEN_BUFFER  expr_tokens,
TY_IDX  fld_ty,
STAB_OFFSET  cur_offset,
UINT  field_id 
) [static]

static TOKEN_BUFFER WN2C_generate_cast ( TY_IDX  cast_to,
BOOL  pointer_to_type 
) [static]

static TY_IDX WN2C_get_base_type ( TY_IDX  idx  )  [static]

Definition at line 2799 of file wn2c.cxx.

References KIND_ARRAY, KIND_POINTER, TY_etype, TY_kind, and TY_pointed.

static UINT WN2C_get_union_offset ( TY_IDX  ty,
UINT  field_id 
) [static]

Definition at line 1202 of file wn2c.cxx.

References FLD_get_to_field(), FLD_ofst, and UINT.

Referenced by WN2C_iload(), WN2C_istore(), WN2C_ldid(), and WN2C_stid().

static STATUS WN2C_goto ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_if ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_ignore ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

Definition at line 3760 of file wn2c.cxx.

References EMPTY_STATUS.

static STATUS WN2C_iload ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_iloadx ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_imagpart ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_incr_indentation_for_stmt_body ( const WN body  )  [static]

Definition at line 1268 of file wn2c.cxx.

References Increment_Indentation(), OPR_BLOCK, and WN_operator().

Referenced by WN2C_do_loop(), WN2C_do_while(), WN2C_if(), and WN2C_while_do().

static STATUS WN2C_infix_op ( TOKEN_BUFFER  tokens,
OPCODE  opcode,
TY_IDX  result_ty,
WN wn0,
WN wn1,
CONTEXT  context 
) [static]

void WN2C_initialize ( void   ) 

static BOOL WN2C_int_downcast ( TY_IDX  from,
TY_IDX  to 
) [static]

Definition at line 6638 of file wn2c.cxx.

References KIND_SCALAR, MTYPE_is_signed, strcmp(), TY_is_logical, TY_kind, TY_mtype, TY_name, and TY_size.

Referenced by WN2C_parm().

static STATUS WN2C_intconst ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_intrinsic_op ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static BOOL WN2C_Is_Loop_Region ( const WN region,
CONTEXT  context 
) [static]

static BOOL WN2C_Is_Parallel_Region ( const WN region,
CONTEXT  context 
) [static]

static BOOL WN2C_is_pointer_diff ( OPCODE  op,
const WN kid0,
const WN kid1 
) [static]

static bool WN2C_is_void_ptr ( TY_IDX  idx  )  [static]

Definition at line 1194 of file wn2c.cxx.

References KIND_POINTER, KIND_VOID, TY_kind, and TY_pointed.

Referenced by WN2C_ldid().

static STATUS WN2C_istore ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_istorex ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_label ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_lda ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_lda_label ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_ldid ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Load_From_PregIdx ( TOKEN_BUFFER  tokens,
const ST preg1,
PREG_IDX  preg_idx1,
const ST preg2,
PREG_IDX  preg_idx2,
TY_IDX  object_ty,
CONTEXT  context 
) [static]

static void WN2C_Load_Return_Reg ( TOKEN_BUFFER  tokens,
TY_IDX  return_ty,
const char *  var_name,
STAB_OFFSET  var_offset,
MTYPE  preg_mtype,
PREG_IDX  preg_offset,
CONTEXT  context 
) [static]

static STATUS WN2C_lvalue_st ( TOKEN_BUFFER  tokens,
const ST st,
TY_IDX  addr_ty,
TY_IDX  object_ty,
STAB_OFFSET  addr_offset,
CONTEXT  context,
UINT  field_id = 0 
) [static]

static STATUS WN2C_lvalue_wn ( TOKEN_BUFFER  tokens,
const WN wn,
TY_IDX  addr_ty,
TY_IDX  object_ty,
STAB_OFFSET  addr_offset,
CONTEXT  context 
) [static]

static STATUS WN2C_madd ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static TY_IDX WN2C_MemAccess_Type ( TY_IDX  base_ty,
TY_IDX  load_ty,
MTYPE  load_mtype,
STAB_OFFSET  offset 
) [static]

void WN2C_memref_lhs ( TOKEN_BUFFER  tokens,
TY_IDX memref_typ,
const WN lhs,
STAB_OFFSET  memref_ofst,
TY_IDX  memref_addr_ty,
TY_IDX  memref_object_ty,
MTYPE  dtype,
CONTEXT  context 
)

static STATUS WN2C_mload ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_mstore ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_msub ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

BOOL WN2C_new_symtab ( void   ) 

Definition at line 6814 of file wn2c.cxx.

References BOOL, and CURRENT_SYMTAB.

Referenced by W2C_Pop_PU(), WN2C_block(), and WN2C_translate_file_scope_defs().

static STATUS WN2C_nmadd ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_nmsub ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Normalize_Idx_To_Onedim ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_paren ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_parm ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_prefetch ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_Prefetch_Map ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_prepend_cast ( TOKEN_BUFFER  tokens,
TY_IDX  cast_to,
BOOL  pointer_to_type 
) [static]

static void WN2C_Prompf_Construct_End ( TOKEN_BUFFER  tokens,
const WN construct 
) [static]

static void WN2C_Prompf_Construct_Start ( TOKEN_BUFFER  tokens,
const WN construct 
) [static]

static STATUS WN2C_ptr_array_wn ( TOKEN_BUFFER  tokens,
const WN wn,
TY_IDX  object_ty,
STAB_OFFSET  addr_offset,
CONTEXT  context 
) [static]

static STATUS WN2C_rcomma ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_realpart ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_region ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_return ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_return_val ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_select ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static BOOL WN2C_Skip_Stmt ( const WN stmt  )  [static]

static void WN2C_Start_Prompf_Transformed_Loop ( TOKEN_BUFFER  tokens,
const WN loop,
CONTEXT  context 
) [static]

static void WN2C_Start_Prompf_Transformed_Region ( TOKEN_BUFFER  tokens,
const WN region,
CONTEXT  context 
) [static]

Definition at line 3729 of file wn2c.cxx.

References WN2C_Is_Loop_Region(), WN2C_Is_Parallel_Region(), and WN2C_Prompf_Construct_Start().

Referenced by WN2C_region().

static STATUS WN2C_stid ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

void WN2C_stid_lhs ( TOKEN_BUFFER  tokens,
TY_IDX stored_typ,
const ST lhs_st,
STAB_OFFSET  stid_ofst,
TY_IDX  stid_ty,
MTYPE  dtype,
CONTEXT  context,
UINT  field_id 
)

static void WN2C_Stmt_Newline ( TOKEN_BUFFER  tokens,
SRCPOS  srcpos 
) [static]

static void WN2C_Store_Return_Reg ( TOKEN_BUFFER  tokens,
const char *  var_name,
STAB_OFFSET  var_offset,
MTYPE  preg_mtype,
PREG_IDX  preg_offset,
CONTEXT  context 
) [static]

static STATUS WN2C_switch ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static void WN2C_SymAccess_Type ( TY_IDX base_addr_ty,
TY_IDX object_ty,
TY_IDX  base_ty,
TY_IDX  load_ty,
MTYPE  load_mtype,
STAB_OFFSET  offset 
) [static]

static STATUS WN2C_tas ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

STATUS WN2C_translate ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
)

static TOKEN_BUFFER WN2C_Translate_Arithmetic_Operand ( const WN wn,
TY_IDX  result_ty,
CONTEXT  context 
) [static]

static void WN2C_Translate_Comma_Sequence ( TOKEN_BUFFER  tokens,
const WN first,
CONTEXT  context 
) [static]

STATUS WN2C_translate_file_scope_defs ( CONTEXT  context  ) 

STATUS WN2C_translate_purple_main ( TOKEN_BUFFER  tokens,
const WN pu,
const char *  region_name,
CONTEXT  context 
)

static void WN2C_Translate_Stmt_Sequence ( TOKEN_BUFFER  tokens,
const WN first,
BOOL  first_on_newline,
CONTEXT  context 
) [static]

void WN2C_translate_structured_types ( void   ) 

static STATUS WN2C_unaryop ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_unsupported ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

static STATUS WN2C_while_do ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]


Variable Documentation

Definition at line 285 of file wn2c.cxx.

Referenced by register_new_assert_for(), and tsubst().

char last_ret_tmp[64] [static]

Definition at line 187 of file wn2c.cxx.

Referenced by WN2C_Function_Call_Lhs(), and WN2C_ldid().

Definition at line 1209 of file wn2c.cxx.

Referenced by translator_warning(), and WN2C_Stmt_Newline().

const RETURNSITE* WN2C_Next_ReturnSite = NULL [static]

Definition at line 184 of file wn2c.cxx.

const char* WN2C_Opc2cname[NUMBER_OF_OPCODES] [static]

Definition at line 449 of file wn2c.cxx.

Referenced by WN2C_funcall_op(), WN2C_infix_op(), and WN2C_initialize().

Definition at line 460 of file wn2c.cxx.

WN2C_HANDLER_FUNC WN2C_Opr_Handler[NUMBER_OF_OPERATORS] [static]

Definition at line 294 of file wn2c.cxx.

Referenced by WN2C_initialize(), and WN2C_translate().

Definition at line 305 of file wn2c.cxx.

const CALLSITE* WN2C_Prev_CallSite = NULL [static]

Definition at line 185 of file wn2c.cxx.

const char WN2C_Purple_Region_Name[] = "prp___region" [static]

Definition at line 173 of file wn2c.cxx.

Referenced by WN2C_Append_Purple_Funcinfo(), and WN2C_block().

const char WN2C_Return_Value_Name[] = "_RetVal" [static]

BOOL WN2C_Used_Return_Value = FALSE [static]

Definition at line 175 of file wn2c.cxx.

Referenced by WN2C_block(), WN2C_func_entry(), and WN2C_Function_Return_Value().


Generated on Wed Apr 8 14:37:02 2009 for Open64 by  doxygen 1.5.6