Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
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 "unparse_target.h"
#include <set>
Include dependency graph for wn2c.cxx:

Go to the source code of this file.

Classes

struct  SCALAR_C_NAME
struct  Opr2handler
struct  Opc2Cname_Map
struct  eqstr

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 MTYPE_PREDEF   MTYPE_F16
#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)

Typedefs

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

Functions

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_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_extract_bits (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
static STATUS WN2C_compose_bits (TOKEN_BUFFER tokens, const WN *wn, CONTEXT context)
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 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)
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)
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 bool lookup (const char *s)
static void init_map ()
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)
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)

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
const char TY2C_Aligned_Block_Name [] = "__block"
static char Name_Unknown_Type [] = "__UNKNOWN_TYPE"
static const SCALAR_C_NAME Scalar_C_Names [MTYPE_PREDEF+1]
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 hash_set< const char
*, hash< const char * >, eqstr
upcr_internal
static bool init = false

Define Documentation

#define MTYPE_PREDEF   MTYPE_F16

Definition at line 181 of file wn2c.cxx.

Definition at line 452 of file wn2c.cxx.

Referenced by WN2C_initialize().

#define NUMBER_OF_OPCODES   (OPCODE_LAST+1)

Definition at line 442 of file wn2c.cxx.

#define NUMBER_OF_OPERATORS   (OPERATOR_LAST + 1)

Definition at line 301 of file wn2c.cxx.

Referenced by WN2C_initialize().

Definition at line 310 of file wn2c.cxx.

Referenced by WN2C_initialize().

#define WN2C_arithmetic_compatible_types (   t1,
  t2 
)
Value:
Stab_Identical_Types(t1, t2, \
                        FALSE, /*check_quals*/ \
                        TRUE,  /*check_scalars*/ \
                        FALSE) /*ptrs_as_scalars*/

Definition at line 107 of file wn2c.cxx.

Referenced by WN2C_Append_Preg(), WN2C_cvtl(), WN2C_iload(), WN2C_iloadx(), WN2C_intrinsic_op(), WN2C_lda(), WN2C_ldid(), WN2C_tas(), and WN2C_Translate_Arithmetic_Operand().

#define WN2C_array_lvalue_as_ptr (   ptr_to_array,
  ptr 
)
Value:
(TY_Is_Pointer(ptr)                    && \
    TY_Is_Pointer(ptr_to_array)           && \
    TY_Is_Array(TY_pointed(ptr_to_array)) && \
    WN2C_arithmetic_compatible_types(TY_AR_etype(TY_pointed(ptr_to_array)), \
                                     TY_pointed(ptr)))

Definition at line 119 of file wn2c.cxx.

Referenced by WN2C_based_lvalue().

#define WN2C_assignment_compatible_types (   lhs_ty,
  rhs_ty 
)
Value:
Stab_Assignment_Compatible_Types(lhs_ty, rhs_ty, \
                                    FALSE, /*check_quals*/ \
                                    FALSE, /*check_scalars*/ \
                                    FALSE) /*ptrs_as_scalars*/

Definition at line 95 of file wn2c.cxx.

Referenced by WN2C_Append_Assignment(), WN2C_based_lvalue(), WN2C_Function_Call_Lhs(), WN2C_Function_Return_Value(), and WN2C_parm().

#define WN2C_compatible_lvalues (   lhs_ty,
  rhs_ty 
)
Value:
Stab_Assignment_Compatible_Types(lhs_ty, rhs_ty, \
                                    FALSE, /*check_quals*/ \
                                    TRUE,  /*check_scalars*/ \
                                    FALSE) /*ptrs_as_scalars*/

Definition at line 101 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) /*ptrs_as_scalars*/

Definition at line 113 of file wn2c.cxx.

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

Definition at line 432 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 WN_pragma_nest (   wn)    WN_pragma_arg1(wn)

Definition at line 86 of file wn2c.cxx.

Referenced by WN2C_Is_Loop_Region().


Typedef Documentation

typedef struct Opc2Cname_Map OPC2CNAME_MAP
typedef struct Opr2handler OPR2HANDLER
typedef struct SCALAR_C_NAME SCALAR_C_NAME

Definition at line 293 of file wn2c.cxx.


Function Documentation

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

Definition at line 3162 of file wn2c.cxx.

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

Referenced by WN2C_block().

Here is the call graph for this function:

static void init_map ( ) [static]

Definition at line 2294 of file wn2c.cxx.

References init, and upcr_internal.

Referenced by WN2C_Append_Symtab_Vars().

static bool lookup ( const char *  s) [static]

Definition at line 2290 of file wn2c.cxx.

References upcr_internal.

Referenced by WN2C_Append_Symtab_Vars().

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

Definition at line 6039 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), WN2C_translate(), and WN_kid0().

Here is the call graph for this function:

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

Definition at line 4156 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), EMPTY_STATUS, Is_True, OPR_ALTENTRY, ST_name(), WN_operator(), and WN_st().

Here is the call graph for this function:

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

Definition at line 1592 of file wn2c.cxx.

References Append_Token_Special(), Host_To_Targ(), Is_True, MTYPE_I8, TCON2C_translate(), and WHIRL2C_parenthesize().

Referenced by WN2C_based_lvalue().

Here is the call graph for this function:

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

Definition at line 1621 of file wn2c.cxx.

References Append_And_Reclaim_Token_List(), Append_Token_Special(), Host_To_Targ(), Is_True, MTYPE_I8, TCON2C_translate(), and WHIRL2C_parenthesize().

Referenced by WN2C_Load_From_PregIdx().

Here is the call graph for this function:

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

Definition at line 1003 of file wn2c.cxx.

References Append_And_Reclaim_Token_List(), and WN2C_generate_cast().

Referenced by WN2C_address_add(), and WN2C_mstore().

Here is the call graph for this function:

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

Definition at line 2178 of file wn2c.cxx.

References Append_Token_String(), WHIRL2C_number_as_c_name, and WN_label_number().

Referenced by WN2C_condbr(), WN2C_goto(), and WN2C_label().

Here is the call graph for this function:

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

Definition at line 2995 of file wn2c.cxx.

References Current_Indentation(), Set_Current_Indentation(), and WN2C_Stmt_Newline().

Referenced by WN2C_Callsite_Directives(), and WN2C_region().

Here is the call graph for this function:

static void WN2C_Append_Prompf_Flag_Newline ( TOKEN_BUFFER  tokens) [static]

Definition at line 3214 of file wn2c.cxx.

References Append_Indented_Newline(), Current_Indentation(), and Set_Current_Indentation().

Referenced by WN2C_Prompf_Construct_End(), and WN2C_Prompf_Construct_Start().

Here is the call graph for this function:

static void WN2C_Append_Symtab_Consts ( TOKEN_BUFFER  tokens,
BOOL  use_const_tab,
UINT  lines_between_decls,
CONTEXT  context 
) [static]
static void WN2C_Assign_Complex_Const ( TOKEN_BUFFER  tokens,
const char *  lhs_name,
TCON  realpart,
TCON  imagpart 
) [static]

Definition at line 1013 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), TCON2C_translate(), TY2C_Complex_Imagpart_Name, and TY2C_Complex_Realpart_Name.

Referenced by WN2C_const(), and WN2C_lda().

Here is the call graph for this function:

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

Definition at line 3380 of file wn2c.cxx.

References FALSE, Is_True, WN2C_funcall_op(), WN2C_infix_op(), WN2C_IS_FUNCALL_OP, WN2C_IS_INFIX_OP, WN_kid0(), WN_kid1(), WN_kid_count(), WN_opc_name, WN_opcode(), and WN_Tree_Type().

Here is the call graph for this function:

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

Definition at line 3006 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), CONTEXT_srcpos, ST2C_use_translate(), WN2C_Append_Pragma_Newline(), WN2C_Stmt_Newline(), WN_Call_Dont_Inline, and WN_Call_Inline.

Referenced by WN2C_call().

Here is the call graph for this function:

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]

Definition at line 4836 of file wn2c.cxx.

References Append_Token_String(), Concat3_Strings(), EMPTY_STATUS, Index_To_Str(), Is_True, OPR_COMMENT, WN_GetComment(), and WN_operator().

Here is the call graph for this function:

static STATUS WN2C_compose_bits ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]
static void WN2C_create_ref_param_lda ( WN lda,
const WN ldid 
) [static]

Definition at line 1968 of file wn2c.cxx.

References bzero(), MTYPE_V, OPR_LDA, Stab_Pointer_To(), TY_mtype(), WN_load_offset(), WN_map_id(), WN_set_kid_count(), WN_set_opcode(), WN_set_ty(), WN_st_idx(), and WN_ty().

Referenced by WN2C_iload(), and WN2C_istore().

Here is the call graph for this function:

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

Definition at line 6052 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), WN2C_Stmt_Newline(), WN2C_translate(), WN_kid(), WN_kid_count(), and WN_linenum().

Here is the call graph for this function:

static void WN2C_Declare_Return_Parameter ( TOKEN_BUFFER  tokens,
CONTEXT  context 
) [static]
static void WN2C_decr_indentation_for_stmt_body ( const WN body) [static]

Definition at line 955 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().

Here is the call graph for this function:

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

Definition at line 3315 of file wn2c.cxx.

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

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

Here is the call graph for this function:

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

Definition at line 3343 of file wn2c.cxx.

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

Referenced by WN2C_region().

Here is the call graph for this function:

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

Definition at line 4775 of file wn2c.cxx.

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

Here is the call graph for this function:

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

Definition at line 4271 of file wn2c.cxx.

References Append_Token_String(), CONTEXT_srcpos, Current_Indentation(), EMPTY_STATUS, Set_Current_Indentation(), and WN2C_Stmt_Newline().

Here is the call graph for this function:

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

Definition at line 4257 of file wn2c.cxx.

References Append_Token_String(), CONTEXT_srcpos, Current_Indentation(), EMPTY_STATUS, Set_Current_Indentation(), and WN2C_Stmt_Newline().

Here is the call graph for this function:

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

Definition at line 6167 of file wn2c.cxx.

References Stab_Free_Tmpvars().

Referenced by W2C_Fini().

Here is the call graph for this function:

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

Definition at line 967 of file wn2c.cxx.

References Append_Token_Special(), New_Token_Buffer(), TY2C_translate_unqualified(), TY_Is_Array_Or_Function(), and WHIRL2C_parenthesize().

Referenced by WN2C_append_cast(), and WN2C_prepend_cast().

Here is the call graph for this function:

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

Definition at line 4142 of file wn2c.cxx.

References Append_Token_String(), EMPTY_STATUS, Is_True, OPR_CASEGOTO, OPR_GOTO, OPR_REGION_EXIT, WN2C_append_label_name(), and WN_operator().

Here is the call graph for this function:

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

Definition at line 3360 of file wn2c.cxx.

References EMPTY_STATUS.

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 943 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().

Here is the call graph for this function:

void WN2C_initialize ( void  )

Definition at line 6136 of file wn2c.cxx.

References NUMBER_OF_OPC2CNAME_MAPS, NUMBER_OF_OPERATORS, NUMBER_OF_OPR2HANDLER_MAPS, WN2C_Opc2cname, WN2C_Opc2cname_Map, WN2C_Opr_Handler, WN2C_Opr_Handler_Map, and WN2C_unsupported().

Referenced by W2C_Init().

Here is the call graph for this function:

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

Definition at line 5938 of file wn2c.cxx.

References CONTEXT_reset_needs_lvalue, EMPTY_STATUS, Host_To_Targ(), Is_True, OPR_INTCONST, TCON2C_translate(), WN_const_val(), WN_opc_rtype, and WN_operator().

Here is the call graph for this function:

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

Definition at line 127 of file wn2c.cxx.

References FALSE, OPCODE_operator(), OPR_ASHR, OPR_INTCONST, OPR_SUB, TRUE, TY_Is_Pointer(), TY_pointed(), TY_size(), WN_const_val(), WN_kid0(), WN_kid1(), WN_operator(), and WN_Tree_Type().

Referenced by WN2C_funcall_op(), and WN2C_infix_op().

Here is the call graph for this function:

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

Definition at line 4244 of file wn2c.cxx.

References Append_Token_Special(), EMPTY_STATUS, Is_True, OPR_LABEL, WN2C_append_label_name(), and WN_operator().

Here is the call graph for this function:

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]
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 
)
BOOL WN2C_new_symtab ( void  )

Definition at line 6179 of file wn2c.cxx.

References CURRENT_SYMTAB.

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

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

Definition at line 2135 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), CONTEXT_set_top_level_expr, W2C_Emit_Adims, WN2C_translate(), WN_array_dim, WN_array_index, and WN_num_dim.

Referenced by WN2C_array().

Here is the call graph for this function:

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

Definition at line 5376 of file wn2c.cxx.

References Append_Token_Special(), CONTEXT_set_top_level_expr, Is_True, OPR_PAREN, WN2C_translate(), WN_kid0(), and WN_operator().

Here is the call graph for this function:

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_realpart ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]
static STATUS WN2C_return_val ( TOKEN_BUFFER  tokens,
const WN wn,
CONTEXT  context 
) [static]

Definition at line 4231 of file wn2c.cxx.

References Append_Token_Special(), Append_Token_String(), buf, EMPTY_STATUS, Is_True, OPR_RETURN_VAL, WN2C_translate(), WN_kid0(), and WN_operator().

Here is the call graph for this function:

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

Definition at line 5258 of file wn2c.cxx.

References Append_Token_Special(), EMPTY_STATUS, Is_True, OPR_CSELECT, OPR_SELECT, WN2C_translate(), WN_kid(), WN_kid0(), WN_kid1(), and WN_operator().

Here is the call graph for this function:

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

Definition at line 3301 of file wn2c.cxx.

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

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

Here is the call graph for this function:

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

Definition at line 3329 of file wn2c.cxx.

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

Referenced by WN2C_region().

Here is the call graph for this function:

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 
)
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 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 void WN2C_Translate_Comma_Sequence ( TOKEN_BUFFER  tokens,
const WN first,
CONTEXT  context 
) [static]

Definition at line 3107 of file wn2c.cxx.

References Append_Token_Special(), CONTEXT_set_srcpos, NULL, WN2C_Skip_Stmt(), WN2C_translate(), WN_Get_Linenum(), and WN_next().

Referenced by WN2C_comma(), and WN2C_rcomma().

Here is the call graph for this function:

Definition at line 6208 of file wn2c.cxx.

References NULL, W2C_DOTH_FILE, W2C_File, WN2C_Append_Symtab_Types(), and Write_String().

Referenced by W2C_Outfile_Init(), and W2C_Translate_Global_Types().

Here is the call graph for this function:

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

Definition at line 3409 of file wn2c.cxx.

References EMPTY_STATUS, FALSE, Is_True, NULL, WN2C_funcall_op(), WN2C_infix_op(), WN2C_IS_FUNCALL_OP, WN2C_IS_INFIX_OP, WN_kid0(), WN_kid_count(), WN_opc_name, WN_opcode(), and WN_Tree_Type().

Here is the call graph for this function:

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

Definition at line 3367 of file wn2c.cxx.

References Append_Token_String(), Concat3_Strings(), EMPTY_STATUS, fprintf(), WN_opc_name, and WN_operator().

Referenced by WN2C_initialize().

Here is the call graph for this function:


Variable Documentation

bool init = false [static]

Definition at line 2288 of file wn2c.cxx.

Referenced by init_map(), and INITV_index().

char Name_Unknown_Type[] = "__UNKNOWN_TYPE" [static]

Definition at line 183 of file wn2c.cxx.

Initial value:
   {{"void",               Name_Unknown_Type},  
    {"char",               "_BOOLEAN"},         
    {"signed char",        "_INT8"},            
    {"signed short",       "_INT16"},           
    {"signed int",         "_INT32"},           
    {"signed long long",   "_INT64"},           
    {"unsigned char",      "_UINT8"},           
    {"unsigned short",     "_UINT16"},          
    {"unsigned int",       "_UINT32"},          
    {"unsigned long long", "_UINT64"},          
    {"float",              "_IEEE32"},          
    {"double",             "_IEEE64"},          
    {Name_Unknown_Type,    "_IEEE80"},          
    {Name_Unknown_Type,    "_IEEE128"}  
   }

Definition at line 184 of file wn2c.cxx.

Referenced by WN2C_ldid().

const char TY2C_Aligned_Block_Name[] = "__block"

Definition at line 179 of file wn2c.cxx.

hash_set<const char*, hash<const char*>, eqstr> upcr_internal [static]

Definition at line 2287 of file wn2c.cxx.

Referenced by init_map(), and lookup().

Definition at line 443 of file wn2c.cxx.

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

Definition at line 454 of file wn2c.cxx.

Referenced by WN2C_initialize().

Definition at line 302 of file wn2c.cxx.

Referenced by WN2C_initialize(), and WN2C_translate().

Definition at line 313 of file wn2c.cxx.

Referenced by WN2C_initialize().

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

Definition at line 154 of file wn2c.cxx.

Referenced by WN2C_Append_Purple_Funcinfo(), and WN2C_block().

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

Definition at line 156 of file wn2c.cxx.

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines