#include "whirl2f_common.h"#include "PUinfo.h"#include "wn2f.h"#include "ty2f.h"#include "st2f.h"#include "tcon2f.h"#include "wn2f_load_store.h"

Go to the source code of this file.
| #define FLD_INFO_ALLOC_CHUNK 16 |
| #define NOT_BITFIELD_OR_IS_FIRST_OF_BITFIELD | ( | f | ) | (!FLD_is_bit_field(f) || (FLD_is_bit_field(f) && (FLD_bofst(f) == 0) || FLD_bofst(f) > 16)) |
Definition at line 98 of file ty2f.cxx.
Referenced by TY2F_Get_Fld_Path(), and TY2F_Translate_Structure().
| typedef void(* TY2F_HANDLER_FUNC)(TOKEN_BUFFER, TY_IDX) |
| static FLD_PATH_INFO* Construct_Fld_Path | ( | FLD_HANDLE | fld, | |
| TY_IDX | struct_ty, | |||
| TY_IDX | desired_ty, | |||
| mUINT64 | desired_offset, | |||
| mUINT64 | max_fld_size | |||
| ) | [static] |
Definition at line 552 of file ty2f.cxx.
References Fld_Path_Info::arr_elt, Fld_Path_Info::arr_ofst, BOOL, FALSE, FLD_name, FLD_ofst, FLD_type, mUINT64, New_Fld_Path_Info(), Fld_Path_Info::next, NULL, printf(), Stab_Identical_Types(), TRUE, TY2F_Fld_Size(), TY2F_Get_Fld_Path(), TY2F_is_character(), TY_align, TY_AR_etype, TY_Is_Array(), TY_is_character, TY_Is_Structured(), TY_name, TY_size, TY_split, and Ty_Table.
Referenced by TY2F_Get_Fld_Path().
| static FLD_PATH_INFO* New_Fld_Path_Info | ( | FLD_HANDLE | fld | ) | [static] |
Definition at line 385 of file ty2f.cxx.
References Fld_Path_Info::arr_elt, Fld_Path_Info::arr_ofst, Fld_Path_Info::arr_wn, FALSE, Fld_Path_Info::fld, FLD_INFO_ALLOC_CHUNK, INT, next, Fld_Path_Info::next, NULL, and TYPE_ALLOC_N.
Referenced by Construct_Fld_Path().
| static FLD_PATH_INFO* Select_Best_Fld_Path | ( | FLD_PATH_INFO * | path1, | |
| FLD_PATH_INFO * | path2, | |||
| TY_IDX | desired_ty, | |||
| mUINT64 | desired_offset | |||
| ) | [static] |
Definition at line 474 of file ty2f.cxx.
References Fld_Path_Info::arr_elt, Fld_Path_Info::arr_ofst, ASSERT_DBG_FATAL, DIAG_W2F_UNEXPEXTED_NULL_PTR, DIAG_W2F_UNEXPEXTED_OFFSET, FALSE, Fld_Path_Info::fld, FLD_ofst, FLD_type, mUINT64, Fld_Path_Info::next, NULL, p1, p2, Stab_Identical_Types(), t1, t2, TRUE, TY2F_Free_Fld_Path(), TY_AR_etype, and TY_mtype.
Referenced by TY2F_Get_Fld_Path().
| static void TY2F_Append_ARB | ( | TOKEN_BUFFER | decl_tokens, | |
| ARB_HANDLE | arb, | |||
| BOOL | purple_assumed_size | |||
| ) | [static] |
Definition at line 156 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), ARB_const_lbnd, ARB_const_ubnd, ARB_lbnd_val, ARB_lbnd_var(), ARB_ubnd_val, ARB_ubnd_var(), BOOL, FALSE, Host_To_Targ(), INIT_WN2F_CONTEXT, MTYPE_I8, set_WN2F_CONTEXT_no_parenthesis, TCON2F_translate(), and TY2F_Append_Array_Bnd_Ph().
Referenced by TY2F_array(), and TY2F_Purple_Assumed_Sized_Array().
| static void TY2F_Append_Array_Bnd_Ph | ( | TOKEN_BUFFER | decl_tokens, | |
| ST_IDX | arbnd, | |||
| BOOL | purple_assumed_size | |||
| ) | [static] |
Definition at line 126 of file ty2f.cxx.
References Append_Token_String(), p, sprintf(), ST_name, and ST_ptr().
Referenced by TY2F_Append_ARB().
| static void TY2F_Append_Assumed_Single_Dim | ( | TOKEN_BUFFER | decl_tokens, | |
| ST * | st, | |||
| TY_IDX | element_ty | |||
| ) | [static] |
Definition at line 253 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), Number_as_String(), TY_size, and WN2F_Append_Purple_Xsym().
Referenced by TY2F_Purple_Assumed_Sized_Array(), and TY2F_Purple_Ptr_As_Array().
| static void TY2F_array | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1173 of file ty2f.cxx.
References Append_Token_Special(), ARB_dimension(), ASSERT_DBG_FATAL, Concat2_Strings(), DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, INT32, KIND_ARRAY, Number_as_String(), Prepend_Token_String(), Stab_Mtype_To_Ty(), TY2F_Append_ARB(), TY2F_translate(), TY_AR_etype, TY_arb(), TY_is_character, TY_Is_Pointer(), TY_kind, TY_mtype, TY_size, and Ty_Table.
| static void TY2F_Declare_Common_Flds | ( | TOKEN_BUFFER | tokens, | |
| FLD_HANDLE | fldlist, | |||
| BOOL | alt_return, | |||
| BOOL * | is_equiv | |||
| ) | [static] |
Definition at line 965 of file ty2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_String(), FLD_equivalence(), FLD_last_field(), FLD_type, Make_fld_iter(), New_Token_Buffer(), NULL, TRUE, TY2F_Fld_Name(), TY2F_translate(), TY2F_Translate_EquivCommon_PtrFld(), TY_flist, TY_Is_Pointer(), TY_split, and Ty_Table.
Referenced by TY2F_Translate_Common(), and TY2F_Translate_Equivalence().
| void TY2F_Dump_Fld_Path | ( | FLD_PATH_INFO * | fld_path | ) |
Definition at line 1658 of file ty2f.cxx.
References Fld_Path_Info::arr_elt, Fld_Path_Info::arr_ofst, Fld_Path_Info::arr_wn, f, FALSE, Fld_Path_Info::fld, FLD_HANDLE::Idx(), mINT32, Fld_Path_Info::next, NULL, printf(), and TY2F_Fld_Name().
| static void TY2F_Equivalence | ( | TOKEN_BUFFER | tokens, | |
| const char * | equiv_name, | |||
| const char * | fld_name, | |||
| STAB_OFFSET | fld_ofst | |||
| ) | [static] |
Definition at line 737 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), and Number_as_String().
Referenced by TY2F_Equivalence_FldList().
| static void TY2F_Equivalence_FldList | ( | TOKEN_BUFFER | tokens, | |
| FLD_HANDLE | fldlist, | |||
| UINT | equiv_var_idx, | |||
| mUINT64 | ofst, | |||
| BOOL * | common_block_equivalenced | |||
| ) | [static] |
Definition at line 758 of file ty2f.cxx.
References Append_F77_Indented_Newline(), FALSE, FLD_equivalence(), FLD_last_field(), FLD_ofst, FLD_type, Make_fld_iter(), NULL, TRUE, TY2F_Equivalence(), TY2F_Fld_Name(), TY_flist, TY_split, Ty_Table, and W2CF_Symtab_Nameof_Tempvar().
Referenced by TY2F_Equivalence_List().
| static void TY2F_Equivalence_List | ( | TOKEN_BUFFER | tokens, | |
| const TY_IDX | struct_ty | |||
| ) | [static] |
Definition at line 796 of file ty2f.cxx.
References BOOL, FALSE, MTYPE_I1, ST2F_Declare_Tempvar(), Stab_Array_Of(), Stab_Lock_Tmpvar(), Stab_Mtype_To_Ty(), TY2F_Equivalence_FldList(), TY_flist, TY_size, Ty_Table, and UINT.
Referenced by TY2F_Translate_Common(), and TY2F_Translate_Equivalence().
| static const char* TY2F_Fld_Name | ( | FLD_HANDLE | fld, | |
| BOOL | common_or_equivalence, | |||
| BOOL | alt_return_name | |||
| ) | [static] |
Definition at line 704 of file ty2f.cxx.
References FALSE, FLD_name, NULL, W2CF_Symtab_Nameof_Fld(), and WHIRL2F_make_valid_name().
Referenced by TY2F_Declare_Common_Flds(), TY2F_Dump_Fld_Path(), TY2F_Equivalence_FldList(), TY2F_List_Common_Flds(), TY2F_Translate_EquivCommon_PtrFld(), TY2F_Translate_Fld_Path(), and TY2F_Translate_Structure().
| void TY2F_Fld_Separator | ( | TOKEN_BUFFER | tokens | ) |
Definition at line 1615 of file ty2f.cxx.
References Append_Token_Special(), p, and WN2F_F90_pu.
Referenced by TY2F_Translate_Fld_Path(), and WN2F_Offset_Memref().
| static STAB_OFFSET TY2F_Fld_Size | ( | FLD_HANDLE | this_fld, | |
| mUINT64 | max_size | |||
| ) | [static] |
Definition at line 421 of file ty2f.cxx.
References BOOL, break, FALSE, FLD_equivalence(), FLD_is_bit_field, FLD_last_field(), FLD_ofst, FLD_type, Make_fld_iter(), mUINT64, TRUE, and TY_size.
Referenced by Construct_Fld_Path().
| FLD_PATH_INFO* TY2F_Free_Fld_Path | ( | FLD_PATH_INFO * | fld_path | ) |
Definition at line 1500 of file ty2f.cxx.
References free_list(), Fld_Path_Info::next, and NULL.
Referenced by INIT2F_structured(), Select_Best_Fld_Path(), WN2F_Load_Return_Reg(), WN2F_Offset_Memref(), WN2F_Offset_Symref(), and WN2F_String_Argument().
| FLD_PATH_INFO* TY2F_Get_Fld_Path | ( | const TY_IDX | struct_ty, | |
| const TY_IDX | object_ty, | |||
| STAB_OFFSET | offset | |||
| ) |
Definition at line 1517 of file ty2f.cxx.
References ASSERT_DBG_FATAL, Construct_Fld_Path(), DIAG_W2F_UNEXPECTED_TYPE_KIND, FLD_last_field(), KIND_STRUCT, Make_fld_iter(), NOT_BITFIELD_OR_IS_FIRST_OF_BITFIELD, NULL, Select_Best_Fld_Path(), TY_flist, TY_kind, TY_size, and Ty_Table.
Referenced by Construct_Fld_Path(), INIT2F_structured(), WN2F_Load_Return_Reg(), WN2F_Offset_Memref(), WN2F_Offset_Symref(), and WN2F_String_Argument().
| static void TY2F_invalid | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1056 of file ty2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, Prepend_Token_String(), TY_kind, and Ty_Table.
Definition at line 362 of file ty2f.cxx.
References KIND_ARRAY, TY_etype, TY_is_character, and TY_kind.
Referenced by Construct_Fld_Path().
| FLD_HANDLE TY2F_Last_Fld | ( | FLD_PATH_INFO * | fld_path | ) |
Definition at line 1628 of file ty2f.cxx.
References f, Fld_Path_Info::fld, Fld_Path_Info::next, and NULL.
Referenced by WN2F_String_Argument().
| static void TY2F_List_Common_Flds | ( | TOKEN_BUFFER | tokens, | |
| FLD_HANDLE | fldlist | |||
| ) | [static] |
Definition at line 1017 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), FALSE, FLD_equivalence(), FLD_last_field(), FLD_type, Make_fld_iter(), next, TRUE, TY2F_Fld_Name(), TY_flist, TY_split, and Ty_Table.
Referenced by TY2F_Translate_Common().
| FLD_PATH_INFO* TY2F_Point_At_Path | ( | FLD_PATH_INFO * | path, | |
| STAB_OFFSET | off | |||
| ) |
Definition at line 1642 of file ty2f.cxx.
References break, Fld_Path_Info::fld, FLD_ofst, Fld_Path_Info::next, and NULL.
Referenced by LOC_INFO::WN2F_Find_And_Mark_Nested_Address().
| static void TY2F_pointer | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1262 of file ty2f.cxx.
References Append_Token_Special(), ASSERT_DBG_WARN, Be_Type_Tbl, DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, KIND_STRUCT, Pointer_Mtype, Prepend_Token_Special(), Prepend_Token_String(), TY2F_Pointer_To_Dope(), TY2F_translate(), TY_kind, TY_pointed, W2CF_Symtab_Nameof_Ty(), and WN2F_F90_pu.
Definition at line 377 of file ty2f.cxx.
References strcmp(), TY_name, and TY_pointed.
Referenced by TY2F_pointer().
| void TY2F_Prepend_Structures | ( | TOKEN_BUFFER | tokens | ) |
Definition at line 1492 of file ty2f.cxx.
References NULL, and Prepend_And_Reclaim_Token_List().
Referenced by ST2F_decl_var(), and ST2F_Declare_Return_Type().
| static void TY2F_Purple_Assumed_Sized_Array | ( | TOKEN_BUFFER | decl_tokens, | |
| ST * | st, | |||
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 296 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), ARB_dimension(), ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, INT32, KIND_ARRAY, New_Token_Buffer(), Number_as_String(), Prepend_And_Reclaim_Token_List(), TRUE, TY2F_Append_ARB(), TY2F_Append_Assumed_Single_Dim(), TY2F_translate(), TY_AR_etype, TY_AR_ndims, TY_arb(), TY_is_character, TY_kind, TY_size, and WN2F_Append_Purple_Xsym().
Referenced by TY2F_Translate_Purple_Array().
| static void TY2F_Purple_Ptr_As_Array | ( | TOKEN_BUFFER | decl_tokens, | |
| ST * | st, | |||
| TY_IDX | element_ty | |||
| ) | [static] |
Definition at line 275 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), New_Token_Buffer(), Prepend_And_Reclaim_Token_List(), TY2F_Append_Assumed_Single_Dim(), and TY_is_character.
Referenced by TY2F_Translate_Purple_Array().
| static void TY2F_scalar | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1066 of file ty2f.cxx.
References ASSERT_DBG_FATAL, Concat2_Strings(), Concat3_Strings(), DIAG_W2F_UNEXPECTED_BTYPE, DIAG_W2F_UNEXPECTED_TYPE_KIND, DIAG_W2F_UNEXPECTED_TYPE_SIZE, FALSE, INT64, KIND_SCALAR, MTYPE_C4, MTYPE_C8, MTYPE_CQ, MTYPE_F4, MTYPE_F8, MTYPE_FQ, MTYPE_I1, MTYPE_I2, MTYPE_I4, MTYPE_I8, MTYPE_is_complex, MTYPE_M, MTYPE_name, MTYPE_U1, MTYPE_U2, MTYPE_U4, MTYPE_U8, Number_as_String(), Prepend_Token_String(), TY_is_character, TY_is_logical, TY_kind, TY_mtype, TY_size, Ty_Table, and WN2F_F90_pu.
| static void TY2F_struct | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1230 of file ty2f.cxx.
References ASSERT_DBG_FATAL, Concat3_Strings(), DIAG_W2F_UNEXPECTED_TYPE_KIND, KIND_STRUCT, Prepend_Token_String(), Set_TY_is_translated_to_c, TY2F_Translate_Structure(), TY_is_translated_to_c, TY_kind, Ty_Table, W2CF_Symtab_Nameof_Ty(), and WN2F_F90_pu.
| void TY2F_translate | ( | TOKEN_BUFFER | tokens, | |
| TY_IDX | ty | |||
| ) |
Definition at line 1326 of file ty2f.cxx.
References TY2F_Handler, TY_kind, and Ty_Table.
Referenced by ST2F_decl_var(), ST2F_Declare_Return_Type(), ST2F_Declare_Tempvar(), ST2F_Define_Preg(), ST2F_func_header(), TY2F_array(), TY2F_Declare_Common_Flds(), TY2F_pointer(), TY2F_Purple_Assumed_Sized_Array(), TY2F_Translate_EquivCommon_PtrFld(), TY2F_Translate_Purple_Array(), TY2F_Translate_Structure(), and WN2F_translate_purple_main().
| void TY2F_Translate_ArrayElt | ( | TOKEN_BUFFER | tokens, | |
| TY_IDX | arr_ty_idx, | |||
| STAB_OFFSET | arr_ofst | |||
| ) |
Definition at line 1353 of file ty2f.cxx.
References Append_And_Reclaim_Token_List(), Append_Token_Special(), Append_Token_String(), ARB_const_stride, ARB_dimension(), ARB_stride_val, ASSERT_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, idx, INT32, New_Token_Buffer(), Number_as_String(), Prepend_Token_Special(), Prepend_Token_String(), TY_arb(), TY_Is_Array(), and TY_kind.
Referenced by INIT2F_Translate_Array_Ref(), TY2F_Translate_Fld_Path(), WN2F_Offset_Memref(), and WN2F_Offset_Symref().
| void TY2F_Translate_Common | ( | TOKEN_BUFFER | tokens, | |
| const char * | name, | |||
| TY_IDX | ty_idx | |||
| ) |
Definition at line 1413 of file ty2f.cxx.
References Append_Token_String(), ASSERT_DBG_FATAL, BOOL, Concat3_Strings(), DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, KIND_STRUCT, NULL, TY2F_Declare_Common_Flds(), TY2F_Equivalence_List(), TY2F_List_Common_Flds(), TY_flist, TY_kind, and Ty_Table.
Referenced by ST2F_decl_var().
| void TY2F_Translate_Equivalence | ( | TOKEN_BUFFER | tokens, | |
| TY_IDX | ty_idx, | |||
| BOOL | alt_return | |||
| ) |
Definition at line 1450 of file ty2f.cxx.
References ASSERT_DBG_FATAL, BOOL, DIAG_W2F_UNEXPECTED_TYPE_KIND, FLD_next, KIND_STRUCT, TY2F_Declare_Common_Flds(), TY2F_Equivalence_List(), TY_flist, TY_kind, and Ty_Table.
Referenced by ST2F_decl_var().
| static void TY2F_Translate_EquivCommon_PtrFld | ( | TOKEN_BUFFER | tokens, | |
| FLD_HANDLE | fld | |||
| ) | [static] |
Definition at line 939 of file ty2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), FALSE, FLD_type, New_Token_Buffer(), NULL, TRUE, TY2F_Fld_Name(), TY2F_translate(), TY_pointed, and W2CF_Symtab_Nameof_Fld_Pointee().
Referenced by TY2F_Declare_Common_Flds().
| void TY2F_Translate_Fld_Path | ( | TOKEN_BUFFER | tokens, | |
| FLD_PATH_INFO * | fld_path, | |||
| BOOL | deref, | |||
| BOOL | member_of_common, | |||
| BOOL | alt_ret_name, | |||
| WN2F_CONTEXT | context | |||
| ) |
Definition at line 1564 of file ty2f.cxx.
References Append_Token_String(), Fld_Path_Info::arr_elt, Fld_Path_Info::arr_ofst, Fld_Path_Info::arr_wn, f, FALSE, Fld_Path_Info::fld, FLD_type, Fld_Path_Info::next, NULL, TY2F_Fld_Name(), TY2F_Fld_Separator(), TY2F_Translate_ArrayElt(), TY_Is_Pointer(), W2CF_Symtab_Nameof_Fld_Pointee(), and WN2F_array_bounds().
Referenced by WN2F_Load_Return_Reg(), WN2F_Offset_Memref(), and WN2F_Offset_Symref().
| void TY2F_Translate_Purple_Array | ( | TOKEN_BUFFER | tokens, | |
| ST * | st, | |||
| TY_IDX | ty | |||
| ) |
Definition at line 1334 of file ty2f.cxx.
References Stab_Is_Assumed_Sized_Array(), TY2F_Purple_Assumed_Sized_Array(), TY2F_Purple_Ptr_As_Array(), TY2F_translate(), TY_Is_Pointer(), TY_pointed, TY_ptr_as_array, and Ty_Table.
Referenced by ST2F_decl_var().
Definition at line 835 of file ty2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_String(), ASSERT_DBG_FATAL, Concat3_Strings(), Current_Indentation(), Decrement_Indentation(), DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, TY::Fld(), FLD_begin_map(), FLD_begin_union(), FLD_end_map(), FLD_end_union(), FLD_last_field(), FLD_type, Increment_Indentation(), KIND_STRUCT, Make_fld_iter(), New_Token_Buffer(), NOT_BITFIELD_OR_IS_FIRST_OF_BITFIELD, NULL, PUinfo_local_decls_indent, Set_Current_Indentation(), TY2F_Fld_Name(), TY2F_translate(), TY_flist, TY_kind, Ty_Table, UINT, W2CF_Symtab_Nameof_Ty(), and WN2F_F90_pu.
Referenced by TY2F_struct().
| static void TY2F_void | ( | TOKEN_BUFFER | decl_tokens, | |
| TY_IDX | ty | |||
| ) | [static] |
Definition at line 1309 of file ty2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, KIND_VOID, NULL, Prepend_F77_Indented_Newline(), Prepend_Token_String(), TY_kind, and Ty_Table.
| void WN2F_Append_Purple_Xsym | ( | TOKEN_BUFFER | tokens, | |
| ST * | st | |||
| ) |
Definition at line 106 of file ty2f.cxx.
References Append_Token_Special(), Append_Token_String(), mUINT32, Number_as_String(), ST_export, ST_sclass, ST_st_idx, and W2F_Object_Name().
Referenced by TY2F_Append_Assumed_Single_Dim(), and TY2F_Purple_Assumed_Sized_Array().
FLD_PATH_INFO* Free_Fld_Path_Info = NULL [static] |
const TY2F_HANDLER_FUNC TY2F_Handler[KIND_LAST] [static] |
Initial value:
{
&TY2F_invalid,
&TY2F_scalar,
&TY2F_array,
&TY2F_struct,
&TY2F_pointer,
&TY2F_invalid,
&TY2F_void,
}
Definition at line 84 of file ty2f.cxx.
Referenced by TY2F_translate().
TOKEN_BUFFER TY2F_Structure_Decls = NULL [static] |
Definition at line 67 of file ty2f.cxx.
Referenced by ST2F_decl_var(), and WN2F_translate_purple_main().
1.5.6