Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <alloca.h>
#include <set>
#include "x_string.h"
#include "whirl2f_common.h"
#include "PUinfo.h"
#include "wn2f.h"
#include "wn2f_stmt.h"
#include "wn2f_pragma.h"
#include "wn2f_expr.h"
#include "wn2f_load_store.h"
#include "wn2f_io.h"
#include "st2f.h"
#include "ty2f.h"
#include "tcon2f.h"
#include "unparse_target.h"
#include "ty_ftn.h"
Go to the source code of this file.
#define NUMBER_OF_OPERATORS (OPERATOR_LAST + 1) |
Definition at line 140 of file wn2f.cxx.
Referenced by WN2F_initialize().
#define NUMBER_OF_OPR_HANDLERS (sizeof(WN2F_Opr_Handler_List) / sizeof(WN2F_OPR_HANDLER)) |
Definition at line 149 of file wn2f.cxx.
Referenced by WN2F_initialize().
typedef WN2F_STATUS(* WN2F_HANDLER_FUNC)(TOKEN_BUFFER, WN *, WN2F_CONTEXT) |
typedef struct WN2F_Opr_Handler WN2F_OPR_HANDLER |
void WN2F_Address_Of | ( | TOKEN_BUFFER | tokens | ) |
Definition at line 505 of file wn2f.cxx.
References Append_Token_Special(), Prepend_Token_Special(), and Prepend_Token_String().
Referenced by INITVKIND_symoff().
WN2F_STATUS WN2F_altentry | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) | [static] |
Definition at line 1119 of file wn2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_OPC, EMPTY_WN2F_STATUS, OPC_ALTENTRY, WN2F_Entry_Point(), and WN_opcode().
static void WN2F_Begin_Prompf_Transformed_Func | ( | TOKEN_BUFFER | tokens, |
INT32 | func_id | ||
) | [static] |
Definition at line 304 of file wn2f.cxx.
References Append_F77_Directive_Newline(), Append_Token_String(), Number_as_String(), and sgi_comment_str.
Referenced by WN2F_func_entry().
WN2F_STATUS WN2F_comment | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) | [static] |
Definition at line 1135 of file wn2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_OPC, EMPTY_WN2F_STATUS, Index_To_Str(), OPC_COMMENT, ux_strncasecmp(), WHIRL2F_Append_Comment(), WN_GetComment(), and WN_opcode().
void WN2F_dump_context | ( | WN2F_CONTEXT | c | ) |
Definition at line 1209 of file wn2f.cxx.
References WN2F_CONTEXT_cray_io, WN2F_CONTEXT_deref_addr, WN2F_CONTEXT_deref_io_item, WN2F_CONTEXT_emit_stid, WN2F_CONTEXT_explicit_region, WN2F_CONTEXT_fmt_io, WN2F_CONTEXT_has_logical_arg, WN2F_CONTEXT_insert_induction, WN2F_CONTEXT_io_stmt, WN2F_CONTEXT_keyword_ioctrl, WN2F_CONTEXT_new_pu, WN2F_CONTEXT_no_newline, WN2F_CONTEXT_no_parenthesis, and WN2F_CONTEXT_origfmt_ioctrl.
void WN2F_Emit_End_Stmt | ( | TOKEN_BUFFER | tokens, |
BOOL | start | ||
) |
Definition at line 1419 of file wn2f.cxx.
References Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), FALSE, Is_Empty_Token_Buffer(), NULL, PU_Dangling_Contains, PU_Host_Func_Id, PU_Need_End_Contains, W2F_Prompf_Emission, and WN2F_End_Prompf_Transformed_Func().
Referenced by W2F_Outfile_Fini(), and W2F_Outfile_Translate_Pu().
static void WN2F_End_Prompf_Transformed_Func | ( | TOKEN_BUFFER | tokens, |
INT32 | func_id | ||
) | [static] |
Definition at line 312 of file wn2f.cxx.
References Append_F77_Directive_Newline(), Append_Token_String(), Number_as_String(), and sgi_comment_str.
Referenced by WN2F_Emit_End_Stmt(), and WN2F_End_Routine_Strings().
static void WN2F_End_Routine_Strings | ( | TOKEN_BUFFER | tokens, |
INT32 | func_id | ||
) | [static] |
Definition at line 1457 of file wn2f.cxx.
References Append_Token_Special(), Append_Token_String(), KIND_VOID, PU_Dangling_Contains, PU_has_nested(), PU_Host_Func_Id, PU_is_mainpu(), PU_is_nested_func(), PU_Need_End_Contains, Pu_Table, PUINFO_FUNC_NAME, PUINFO_FUNC_ST, PUINFO_RETURN_TY, ST_is_block_data(), ST_is_in_module(), ST_pu(), TRUE, TY_kind(), W2F_Prompf_Emission, WN2F_End_Prompf_Transformed_Func(), and WN2F_F90_pu.
Referenced by WN2F_func_entry().
void WN2F_Entry_Point | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 992 of file wn2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_OPC, NULL, OPC_ALTENTRY, OPC_FUNC_ENTRY, ST2F_func_header(), St_Table, WN_entry_name, WN_formal, WN_kid_count(), WN_num_formals, WN_opcode(), and WN_st().
Referenced by WN2F_altentry(), and WN2F_func_entry().
void WN2F_finalize | ( | void | ) |
Definition at line 1194 of file wn2f.cxx.
References Stab_Free_Tmpvars(), WN2F_Expr_finalize(), WN2F_Io_finalize(), WN2F_Load_Store_finalize(), and WN2F_Stmt_finalize().
Referenced by W2F_Fini().
static WN2F_STATUS WN2F_func_entry | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) | [static] |
Definition at line 1060 of file wn2f.cxx.
References ASSERT_DBG_FATAL, Current_Indentation(), DIAG_W2F_UNEXPECTED_OPC, EMPTY_WN2F_STATUS, NULL, OPC_FUNC_ENTRY, PUinfo_local_decls_indent, PUinfo_pragmas, set_WN2F_CONTEXT_new_pu, W2F_Construct_Map, W2F_No_Pragmas, W2F_Prompf_Emission, WN2F_Begin_Prompf_Transformed_Func(), WN2F_End_Routine_Strings(), WN2F_Entry_Point(), WN2F_pragma_list_begin(), WN2F_pragma_list_end(), WN2F_Stmt_Newline(), WN2F_translate(), WN_first(), WN_func_body, WN_func_pragmas, WN_Get_Linenum(), WN_MAP32_Get, and WN_opcode().
static WN2F_STATUS WN2F_ignore | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) | [static] |
Definition at line 1038 of file wn2f.cxx.
References EMPTY_WN2F_STATUS.
void WN2F_initialize | ( | void | ) |
Definition at line 1171 of file wn2f.cxx.
References NUMBER_OF_OPERATORS, NUMBER_OF_OPR_HANDLERS, WN2F_Expr_initialize(), WN2F_Handler, WN2F_Io_initialize(), WN2F_Load_Store_initialize(), WN2F_Stmt_initialize(), and WN2F_unsupported().
Referenced by W2F_Init().
WN2F_STATUS WN2F_Offset_Memref | ( | TOKEN_BUFFER | tokens, |
WN * | addr, | ||
TY_IDX | addr_ty, | ||
TY_IDX | object_ty, | ||
STAB_OFFSET | offset, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 730 of file wn2f.cxx.
References LOC_INFO::_nested_addr, Append_Token_Special(), Append_Token_String(), Fld_Path_Info::arr_wn, ASSERT_DBG_WARN, ASSERT_WARN, DIAG_W2F_INCOMPATIBLE_TYS, DIAG_W2F_NONEXISTENT_FLD_PATH, DIAG_W2F_UNEXPEXTED_OFFSET, FALSE, Fld_Path_Info::fld, FLD_name(), FLD_type(), fld_type_z, KIND_STRUCT, Fld_Path_Info::next, NULL, Number_as_String(), OPR_ARRAYEXP, OPR_LDA, OPR_LDID, reset_WN2F_CONTEXT_deref_addr, set_WN2F_CONTEXT_deref_addr, ST_type(), Stab_Is_Common_Block(), Stab_Is_Equivalence_Block(), TY2F_Fld_Separator(), TY2F_Free_Fld_Path(), TY2F_Get_Fld_Path(), TY2F_Translate_Fld_Path(), TY_AR_etype(), TY_Is_Array(), TY_Is_Character_String(), TY_is_f90_deferred_shape(), TY_kind(), TY_pointed(), TY_size(), WN2F_Can_Assign_Types, WN2F_CONTEXT_deref_addr, LOC_INFO::WN2F_Find_And_Mark_Nested_Address(), WN2F_Is_Address_Preg(), WN2F_Offset_Symref(), WN2F_Sum_Offsets(), WN2F_translate(), WN_kid0(), WN_lda_offset(), WN_opc_operator, WN_operator(), and WN_st().
Referenced by W2F_Translate_Istore_Lhs(), WN2F_call(), WN2F_Function_Call_Lhs(), WN2F_iload(), WN2F_intrinsic_call(), WN2F_istore(), WN2F_mload(), WN2F_mstore(), WN2F_pstore(), WN2F_String_Argument(), and WN2F_Translate_Arithmetic_Operand().
WN2F_STATUS WN2F_Offset_Symref | ( | TOKEN_BUFFER | tokens, |
ST * | st, | ||
TY_IDX | addr_ty, | ||
TY_IDX | object_ty, | ||
STAB_OFFSET | offset, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 513 of file wn2f.cxx.
References Append_Token_Special(), Append_Token_String(), ASSERT_DBG_WARN, ASSERT_WARN, Clear_BE_ST_w2fc_referenced(), DIAG_W2F_INCOMPATIBLE_TYS, DIAG_W2F_NONEXISTENT_FLD_PATH, DIAG_W2F_UNEXPEXTED_OFFSET, EMPTY_WN2F_STATUS, FALSE, KIND_FUNCTION, KIND_STRUCT, NULL, PUinfo_current_func, PUINFO_RETURN_PARAM, PUINFO_RETURN_TO_PARAM, reset_WN2F_CONTEXT_has_no_arr_elmt, SCLASS_FORMAL, Set_BE_ST_w2fc_referenced(), ST2F_deref_translate(), ST2F_use_translate(), ST_base(), ST_full(), ST_is_return_var(), ST_is_split_common(), ST_ofst(), ST_sclass(), ST_type(), Stab_Full_Split_Offset(), Stab_Is_Based_At_Common_Or_Equivalence(), Stab_Is_Equivalence_Block(), Stab_Pointer_To(), TRUE, TY2F_Fld_Separator(), TY2F_Free_Fld_Path(), TY2F_Get_Fld_Path(), TY2F_Translate_ArrayElt(), TY2F_Translate_Fld_Path(), TY_AR_etype(), TY_Is_Array(), TY_Is_Character_String(), TY_is_f90_pointer(), TY_Is_Pointer(), TY_kind(), TY_pointed(), WN2F_Can_Assign_Types, WN2F_CONTEXT_deref_addr, and WN2F_CONTEXT_has_no_arr_elmt.
Referenced by Append_A_Clause_Symbol(), Append_Nest_Clauses(), INIT2F_ptr_or_scalar(), INIT2F_Translate_Array_Ref(), INIT2F_Translate_Char_Ref(), INITVKIND_symoff(), ST2F_use_var(), W2F_Translate_Stid_Lhs(), WN2F_Function_Call_Lhs(), WN2F_implied_do(), WN2F_lda(), WN2F_ldid(), WN2F_Offset_Memref(), WN2F_pstid(), WN2F_return(), and WN2F_stid().
void WN2F_Stmt_Newline | ( | TOKEN_BUFFER | tokens, |
const char * | label, | ||
SRCPOS | srcpos, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 278 of file wn2f.cxx.
References Append_F77_Indented_Newline(), Append_Srcpos_Directive(), Append_Srcpos_Map(), NULL, W2F_Emit_Linedirs, W2F_File, W2F_LOC_FILE, and WN2F_CONTEXT_no_newline.
Referenced by WN2F_agoto(), WN2F_call(), WN2F_compgoto(), WN2F_condbr(), WN2F_dealloca(), WN2F_do_loop(), WN2F_do_while(), WN2F_func_entry(), WN2F_Function_Call_Lhs(), WN2F_goto(), WN2F_if(), WN2F_intrinsic_call(), WN2F_io(), WN2F_io_control(), WN2F_istore(), WN2F_istorex(), WN2F_label(), WN2F_mstore(), WN2F_pstid(), WN2F_pstore(), WN2F_return(), WN2F_return_val(), WN2F_stid(), WN2F_translate_purple_main(), WN2F_unsupported(), WN2F_where(), and WN2F_while_do().
WN_OFFSET WN2F_Sum_Offsets | ( | WN * | addr | ) |
Definition at line 476 of file wn2f.cxx.
References OPR_ADD, OPR_ARRAY, OPR_ARRAYEXP, OPR_ARRSECTION, OPR_INTCONST, WN2F_Sum_Offsets(), WN_const_val(), WN_kid0(), WN_kid1(), and WN_operator().
Referenced by WN2F_Offset_Memref(), WN2F_String_Argument(), and WN2F_Sum_Offsets().
WN2F_STATUS WN2F_translate | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 1232 of file wn2f.cxx.
References OPCODE_is_boolean(), reset_WN2F_CONTEXT_has_logical_arg, reset_WN2F_CONTEXT_is_logical_arg, ret, set_WN2F_CONTEXT_has_logical_arg, set_WN2F_CONTEXT_is_logical_arg, wn, WN2F_CONTEXT_has_logical_arg, WN2F_CONTEXT_no_parenthesis, WN2F_expr_has_boolean_arg, WN2F_Handler, WN_opc_operator, and WN_opcode().
Referenced by Append_Distribution(), W2F_Outfile_Translate_Pu(), W2F_Translate_Wn(), W2F_Translate_Wn_Str(), WN2F_agoto(), WN2F_alloca(), WN2F_Append_Value_Reference(), WN2F_ar_construct(), WN2F_array(), WN2F_arrayexp(), WN2F_arrsection(), WN2F_Arrsection_Slots(), WN2F_block(), WN2F_call(), WN2F_comma(), WN2F_compgoto(), WN2F_complex(), WN2F_condbr(), WN2F_cvt(), WN2F_cvtl(), WN2F_dealloca(), WN2F_Denormalize_Array_Idx(), WN2F_do_loop(), WN2F_do_while(), WN2F_eq(), WN2F_eval(), WN2F_Expr_Plus_Literal(), WN2F_func_entry(), WN2F_if(), WN2F_iload(), WN2F_imagpart(), WN2F_implied_do(), WN2F_intrinsic_op(), WN2F_io_control(), WN2F_io_format(), WN2F_io_list(), WN2F_io_unit(), WN2F_ios_decode(), WN2F_ios_definefile(), WN2F_ios_encode(), WN2F_ios_inqlength(), WN2F_istore(), WN2F_mstore(), WN2F_ne(), WN2F_noio_implied_do(), WN2F_Normalize_Idx_To_Onedim(), WN2F_nullify_stmt(), WN2F_Offset_Memref(), WN2F_OLD_Den_Arr_Idx(), WN2F_paren(), WN2F_parm(), WN2F_prefetch(), WN2F_Prepend_Value_Reference(), WN2F_pstid(), WN2F_pstore(), WN2F_realpart(), WN2F_return(), WN2F_return_val(), WN2F_select(), WN2F_src_triplet(), WN2F_stid(), WN2F_strctfld(), WN2F_String_Argument(), WN2F_Substring(), WN2F_switch(), WN2F_tas(), WN2F_tempvar_rhs(), WN2F_Translate_Arithmetic_Operand(), WN2F_Translate_DoLoop_Bound(), WN2F_triplet(), WN2F_where(), and WN2F_while_do().
WN2F_STATUS WN2F_translate_purple_main | ( | TOKEN_BUFFER | tokens, |
WN * | pu, | ||
const char * | region_name, | ||
WN2F_CONTEXT | context | ||
) |
Definition at line 1277 of file wn2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_OPC, EMPTY_WN2F_STATUS, FALSE, Unparse_Target::Func_Return_Type(), KIND_VOID, New_Token_Buffer(), NULL, OPC_FUNC_ENTRY, ST2F_decl_translate(), ST2F_FIRST_PARAM_IDX, ST_type(), Stab_Mtype_To_Ty(), STAB_PARAM_HAS_IMPLICIT_LENGTH(), TRUE, TY2F_translate(), TY_Is_Pointer(), TY_kind(), TY_mtype(), Use_Purple_Array_Bnds_Placeholder, W2CF_Symtab_Nameof_St(), W2X_Unparse_Target, WHIRL2F_Append_Comment(), WN2F_Append_Purple_Funcinfo(), WN2F_Stmt_Newline(), WN_entry_name, WN_formal, WN_Get_Linenum(), WN_num_formals, WN_opcode(), and WN_st().
Referenced by W2F_Translate_Purple_Main().
static WN2F_STATUS WN2F_unsupported | ( | TOKEN_BUFFER | tokens, |
WN * | wn, | ||
WN2F_CONTEXT | context | ||
) | [static] |
Definition at line 1045 of file wn2f.cxx.
References Append_Token_String(), ASSERT_WARN, Concat3_Strings(), DIAG_W2F_CANNOT_HANDLE_OPC, EMPTY_WN2F_STATUS, FALSE, NULL, WN2F_Stmt_Newline(), WN_Get_Linenum(), WN_opc_name, and WN_opcode().
Referenced by WN2F_initialize().
Definition at line 104 of file wn2f.cxx.
Referenced by write_st::operator()(), ST2F_decl_var(), WN2F_Append_Block_Data(), WN2F_Enter_PU_Block(), and WN2F_Exit_PU_Block().
Definition at line 94 of file wn2f.cxx.
Referenced by ST2F_func_header(), and TY2F_Append_Array_Bnd_Ph().
BOOL PU_Dangling_Contains = FALSE [static] |
Definition at line 91 of file wn2f.cxx.
Referenced by WN2F_Emit_End_Stmt(), and WN2F_End_Routine_Strings().
INT32 PU_Host_Func_Id = 0 [static] |
Definition at line 92 of file wn2f.cxx.
Referenced by WN2F_Emit_End_Stmt(), and WN2F_End_Routine_Strings().
BOOL PU_Need_End_Contains = FALSE [static] |
Definition at line 90 of file wn2f.cxx.
Referenced by WN2F_Emit_End_Stmt(), and WN2F_End_Routine_Strings().
char* sgi_comment_str = "CSGI$ " |
Definition at line 87 of file wn2f.cxx.
Referenced by WN2F_Begin_Prompf_Transformed_Func(), WN2F_End_Prompf_Construct(), WN2F_End_Prompf_Transformed_Func(), WN2F_Prompf_Construct_End(), WN2F_Prompf_Construct_Start(), and WN2F_Start_Prompf_Construct().
Definition at line 172 of file w2f_driver.cxx.
Definition at line 171 of file w2f_driver.cxx.
WN2F_HANDLER_FUNC WN2F_Handler[NUMBER_OF_OPERATORS] [static] |
const WN2F_OPR_HANDLER WN2F_Opr_Handler_List[] [static] |