Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include "whirl2c_common.h"
#include "const.h"
#include "PUinfo.h"
#include "cxx_memory.h"
#include "unparse_target.h"
Go to the source code of this file.
#define MAX_NUMSTRING_SIZE 128 |
Definition at line 663 of file stab_attr.cxx.
Referenced by Number_as_String(), and Ptr_as_String().
#define MIN_NAME_BUF_SIZE 1024 |
Definition at line 662 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot().
#define MIN_NAME_SLOTS 8 |
Definition at line 661 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
#define TMPVAR_ALLOC_INCREMENTS 32 |
Definition at line 882 of file stab_attr.cxx.
Referenced by Stab_Lock_Tmpvar().
typedef struct TmpVarInfo TMPVARINFO |
enum W2FC_FLAGS |
Definition at line 126 of file stab_attr.cxx.
void Clear_w2fc_flags | ( | void | ) |
Definition at line 210 of file stab_attr.cxx.
References W2FC_FLAG_ARRAY::Clear_w2fc_flags().
Referenced by Stab_Reset_Referenced_Flag(), W2F_Outfile_Fini(), and W2F_Push_PU().
const char* Concat2_Strings | ( | const char * | name1, |
const char * | name2 | ||
) |
Definition at line 796 of file stab_attr.cxx.
References Get_Name_Buf_Slot(), NULL, and strcpy.
Referenced by Append_Prefetch_Attributes(), Concat3_Strings(), TCON2C_translate(), TCON2F_translate(), TY2F_array_for_pointer(), TY2F_scalar(), WN2C_mstore(), WN2C_prefetch(), WN2C_Prefetch_Map(), WN2F_Append_Prefetch_Map(), WN2F_call(), WN2F_do_loop(), WN2F_io_control(), and WN2F_prefetch().
UINT64 Get_Hash_Value_For_Name | ( | const char * | name | ) |
Definition at line 828 of file stab_attr.cxx.
References NULL.
Referenced by ST2C_Get_Common_Block_Name(), ST2C_New_Common_Block(), W2CF_Create_Symhdr(), and W2CF_Search_Symhdr().
char* Get_Name_Buf_Slot | ( | UINT | size | ) |
Definition at line 702 of file stab_attr.cxx.
References buffer_to_be_freed, delay_count, FREE, MIN_NAME_BUF_SIZE, MIN_NAME_SLOTS, Name_Buf, Name_Buf_Idx, Name_Buf_Size, next_delay_slot, next_to_be_freed, NULL, s, size, and TYPE_ALLOC_N.
Referenced by Concat2_Strings(), Number_as_String(), Ptr_as_String(), W2CF_Create_Symbol(), W2CF_Get_Ftn_St_Name(), W2CF_Symtab_Nameof_Fld(), W2CF_Symtab_Nameof_Fld_Pointee(), W2CF_Symtab_Nameof_Preg(), W2CF_Symtab_Nameof_St(), W2CF_Symtab_Nameof_St_Pointee(), W2CF_Symtab_Nameof_Tempvar(), W2CF_Symtab_Nameof_Ty(), W2CF_Symtab_Unique_Name(), WHIRL2C_make_valid_c_name(), and WHIRL2F_make_valid_name().
const char* Number_as_String | ( | INT64 | number, |
const char * | fmt | ||
) |
Definition at line 762 of file stab_attr.cxx.
References Get_Name_Buf_Slot(), and MAX_NUMSTRING_SIZE.
Referenced by Append_Arg_Numbers(), Append_Prefetch_Attributes(), INIT2F_Append_Initializer(), INIT2F_Implied_DoLoop(), INIT2F_Translate_Char_Ref(), INITV2C_struct_fill(), INITV2C_symoff(), Unparse_Target_C::Intrinsic_Name(), TY2F_Append_Assumed_Single_Dim(), TY2F_array(), TY2F_array_for_pointer(), TY2F_Purple_Assumed_Sized_Array(), TY2F_scalar(), TY2F_Translate_ArrayElt(), WN2C_Append_Purple_Funcinfo(), WN2C_do_loop(), WN2C_End_Prompf_Construct(), WN2C_prefetch(), WN2C_Prefetch_Map(), WN2C_Prompf_Construct_End(), WN2C_Prompf_Construct_Start(), WN2C_Start_Prompf_Construct(), WN2C_Translate_Stmt_Sequence(), WN2F_Append_Purple_Funcinfo(), WN2F_Append_Purple_Xsym(), WN2F_array(), WN2F_Begin_Prompf_Transformed_Func(), WN2F_Block(), WN2F_End_Prompf_Construct(), WN2F_End_Prompf_Transformed_Func(), WN2F_io_control(), WN2F_io_format(), WN2F_Offset_Memref(), WN2F_Prompf_Construct_End(), WN2F_Prompf_Construct_Start(), WN2F_Start_Prompf_Construct(), and WN2F_Translate_DoLoop_Bound().
const char* Ptr_as_String | ( | const void * | ptr | ) |
Definition at line 772 of file stab_attr.cxx.
References FALSE, Get_Name_Buf_Slot(), Is_True, and MAX_NUMSTRING_SIZE.
Referenced by WN2C_prefetch(), WN2C_Prefetch_Map(), WN2F_Append_Prefetch_Map(), and WN2F_prefetch().
void Reset_TY_is_translated_to_c | ( | const TY_IDX | ty | ) |
Definition at line 196 of file stab_attr.cxx.
References W2FC_FLAG_ARRAY::Reset_w2fc_flag(), TY_IDX_index(), and W2FC_TY_TRANS.
Referenced by set_derived_ty_based_on_st::operator()(), ST2C_Get_Common_Ty2c_List(), and Stab_Reset_Referenced_Flag().
void Set_TY_is_translated_to_c | ( | const TY_IDX | ty | ) |
Definition at line 190 of file stab_attr.cxx.
References W2FC_FLAG_ARRAY::Set_w2fc_flag(), TY_IDX_index(), and W2FC_TY_TRANS.
Referenced by write_st::operator()(), ST2C_Get_Common_Ty2c_List(), ST2C_New_Common_Block(), TY2C_initialize(), TY2C_Output_Struct_Type(), TY2C_struct(), TY2F_2_struct(), TY2F_struct(), W2F_Outfile_Translate_Pu(), and WN2F_Exit_PU_Block().
Definition at line 389 of file stab_attr.cxx.
References TRUE, TY_AR_const_lbnd(), TY_AR_const_stride(), TY_AR_const_ubnd(), and TY_AR_ndims().
Referenced by TY2C_array(), and WN2C_array().
TY_IDX Stab_Array_Of | ( | TY_IDX | etype, |
mINT64 | num_elts | ||
) |
Definition at line 535 of file stab_attr.cxx.
References ARB_Init(), KIND_ARRAY, MTYPE_UNKNOWN, New_ARB(), New_TY(), Set_ARB_dimension(), Set_ARB_first_dimen(), Set_ARB_last_dimen(), Set_TY_align(), Set_TY_arb(), Set_TY_etype(), TY_Init(), and TY_size().
Referenced by INIT2F_Implied_DoLoop(), INITVKIND_ty(), ST2F_decl_var(), WN2F_ldid(), and WN_Tree_Type().
BOOL Stab_Assignment_Compatible_Types | ( | TY_IDX | t1, |
TY_IDX | t2, | ||
BOOL | check_quals, | ||
BOOL | check_scalars, | ||
BOOL | ptrs_as_scalars | ||
) |
Definition at line 373 of file stab_attr.cxx.
References FALSE, Stab_Compare_Types(), and TRUE.
Referenced by Stab_Is_Element_Type_Of_Array().
static BOOL Stab_Compare_Types | ( | TY_IDX | t1, |
TY_IDX | t2, | ||
BOOL | check_quals, | ||
BOOL | check_pointed_quals, | ||
BOOL | check_scalars, | ||
BOOL | ptrs_as_scalars, | ||
BOOL | assign_t2_to_t1 | ||
) | [static] |
Definition at line 221 of file stab_attr.cxx.
References EC_Invalid_Case, ErrMsg(), FALSE, Unparse_Target::Func_Return_Type(), KIND_ARRAY, KIND_FUNCTION, KIND_INVALID, KIND_POINTER, KIND_SCALAR, KIND_STRUCT, KIND_VOID, Stab_Assign_Compatible_Pointer_Quals(), Stab_Identical_Quals(), TRUE, TY_AR_const_lbnd(), TY_AR_const_stride(), TY_AR_const_ubnd(), TY_AR_etype(), TY_AR_lbnd_val(), TY_AR_ndims(), TY_AR_stride_val(), TY_AR_ubnd_val(), TY_flist(), TY_has_prototype(), TY_Is_Array(), TY_Is_Array_Of_Chars(), TY_Is_Function(), TY_Is_Pointer(), TY_Is_Pointer_Or_Scalar(), TY_Is_Scalar(), TY_Is_String(), TY_Is_Structured(), TY_is_varargs(), TY_kind(), TY_mtype(), TY_parms(), TY_pointed(), Ty_Table, and W2X_Unparse_Target.
Referenced by Stab_Assignment_Compatible_Types(), and Stab_Identical_Types().
void Stab_finalize | ( | void | ) |
Definition at line 613 of file stab_attr.cxx.
References Arb_Table, ARB_Table_Size(), CURRENT_SYMTAB, SEGMENTED_ARRAY< T, block_size >::Delete_last(), Fld_Table, FLD_Table_Size(), GLOBAL_SYMTAB, Ty_Table, TY_Table_Size(), Tylist_Table, TYLIST_Table_Size(), and Verify_SYMTAB().
Referenced by W2C_Pop_PU(), and W2F_Pop_PU().
void Stab_finalize_flags | ( | void | ) |
Definition at line 592 of file stab_attr.cxx.
References CXX_DELETE, and Malloc_Mem_Pool.
Referenced by W2C_Fini(), and W2F_Fini().
void Stab_Free_Namebufs | ( | void | ) |
Definition at line 676 of file stab_attr.cxx.
References buffer_to_be_freed, delay_count, FREE, MIN_NAME_SLOTS, Name_Buf, Name_Buf_Idx, Name_Buf_Size, next_delay_slot, and next_to_be_freed.
Referenced by W2C_Undo_Whirl_Side_Effects(), and W2F_Undo_Whirl_Side_Effects().
void Stab_Free_Tmpvars | ( | void | ) |
Definition at line 889 of file stab_attr.cxx.
References FREE, Max_Tmpvar_Idx, Next_Tmpvar_Idx, and NULL.
Referenced by W2C_Undo_Whirl_Side_Effects(), W2F_Undo_Whirl_Side_Effects(), WN2C_finalize(), and WN2F_finalize().
STAB_OFFSET Stab_Full_Split_Offset | ( | const ST * | split_out_st | ) |
Definition at line 850 of file stab_attr.cxx.
References name, and ST_name().
Referenced by WN2C_lvalue_st(), and WN2F_Offset_Symref().
TY_IDX Stab_Get_Mload_Ty | ( | TY_IDX | base, |
STAB_OFFSET | offset, | ||
STAB_OFFSET | size | ||
) |
Definition at line 466 of file stab_attr.cxx.
References FLD_next(), FLD_ofst(), FLD_type(), FLD_HANDLE::Is_Null(), Is_True, size, Stab_Get_Mload_Ty(), TY_flist(), TY_Is_Structured(), TY_Is_Union(), TY_size(), and Ty_Table.
Referenced by Stab_Get_Mload_Ty(), and WN_Tree_Type().
BOOL Stab_Identical_Types | ( | TY_IDX | t1, |
TY_IDX | t2, | ||
BOOL | check_quals, | ||
BOOL | check_scalars, | ||
BOOL | ptrs_as_scalars | ||
) |
Definition at line 358 of file stab_attr.cxx.
References FALSE, and Stab_Compare_Types().
Referenced by Construct_Fld_Path(), INITV2C_symoff(), Select_Best_Fld_Path(), Stab_Lock_Tmpvar(), and TY2C_get_field_info().
void Stab_initialize | ( | void | ) |
Definition at line 598 of file stab_attr.cxx.
References ARB_Table_Size(), FLD_Table_Size(), TY_Table_Size(), and TYLIST_Table_Size().
Referenced by W2C_Push_PU(), and W2F_Push_PU().
void Stab_initialize_flags | ( | void | ) |
Definition at line 586 of file stab_attr.cxx.
References CXX_NEW, Malloc_Mem_Pool, and TY_Table_Size().
Referenced by W2C_Init(), and W2F_Init().
Definition at line 406 of file stab_attr.cxx.
References ARB_const_lbnd(), ARB_const_ubnd(), ARB_lbnd_val(), ARB_lbnd_var(), ARB_ubnd_val(), ARB_ubnd_var(), FALSE, TRUE, TY_arb(), and TY_Is_Array().
Referenced by TY2F_Translate_Purple_Array().
BOOL Stab_Is_Element_Type_Of_Array | ( | TY_IDX | atype, |
TY_IDX | etype | ||
) |
Definition at line 436 of file stab_attr.cxx.
References FALSE, Stab_Assignment_Compatible_Types(), Stab_Is_Element_Type_Of_Array(), TRUE, TY_AR_etype(), and TY_Is_Array().
Referenced by Stab_Is_Element_Type_Of_Array().
Definition at line 451 of file stab_attr.cxx.
References FALSE, FLD_equivalence(), FLD_last_field(), Make_fld_iter(), TY_flist(), and Ty_Table.
Referenced by TY2C_complete_struct(), TY2C_get_field_info(), and TY2C_struct().
UINT Stab_Lock_Tmpvar | ( | TY_IDX | ty, |
void(*)(TY_IDX, UINT) | declare_tmpvar | ||
) |
Definition at line 904 of file stab_attr.cxx.
References FALSE, idx, TmpVarInfo::locked, Max_Tmpvar_Idx, Next_Tmpvar_Idx, Stab_Identical_Types(), TMPVAR_ALLOC_INCREMENTS, TRUE, TmpVarInfo::ty, TYPE_ALLOC_N, and TYPE_REALLOC_N.
Referenced by INIT2F_Implied_DoLoop(), WN2C_Append_Assignment(), WN2C_complex(), WN2C_const(), WN2C_Function_Call_Lhs(), WN2C_lda(), WN2C_ldid(), WN2C_mstore(), WN2C_rcomma(), WN2F_do_while(), WN2F_Function_Call_Lhs(), WN2F_pstid(), and WN2F_stid().
BOOL Stab_Reserved_St | ( | const ST * | st | ) |
Definition at line 72 of file stab_attr.cxx.
References Unparse_Target::Reserved_St_Name(), ST_name(), and W2X_Unparse_Target.
Referenced by WN2C_Append_Symtab_Vars().
BOOL Stab_Reserved_Ty | ( | TY_IDX | ty | ) |
Definition at line 64 of file stab_attr.cxx.
References Unparse_Target::Builtin_Type(), Unparse_Target::Reserved_Ty_Name(), TY_name(), and W2X_Unparse_Target.
Referenced by WN2C_Append_Symtab_Types().
void Stab_Reset_Referenced_Flag | ( | SYMTAB_IDX | symtab | ) |
Definition at line 83 of file stab_attr.cxx.
References Clear_BE_ST_w2fc_referenced(), Clear_w2fc_flags(), FOREACH_SYMBOL, GLOBAL_SYMTAB, Unparse_Target::Redeclare_File_Types(), Reset_TY_is_translated_to_c(), TY_Is_Structured(), TY_Table_Size(), and W2X_Unparse_Target.
Referenced by W2C_Fini(), WN2C_block(), and WN2F_Exit_PU_Block().
void Stab_Unlock_Tmpvar | ( | UINT | idx | ) |
Definition at line 950 of file stab_attr.cxx.
References FALSE, idx, Is_True, TmpVarInfo::locked, and Next_Tmpvar_Idx.
Referenced by INIT2F_Implied_DoLoop(), WN2C_Append_Assignment(), WN2C_complex(), WN2C_Function_Call_Lhs(), WN2C_ldid(), WN2C_mstore(), WN2F_do_while(), WN2F_Function_Call_Lhs(), WN2F_pstid(), and WN2F_stid().
BOOL TY_is_translated_to_c | ( | const TY_IDX | ty | ) |
Definition at line 202 of file stab_attr.cxx.
References W2FC_FLAG_ARRAY::Check_w2fc_flag(), TY_IDX_index(), and W2FC_TY_TRANS.
Referenced by TY2C_Output_Struct_Type(), TY2C_struct(), TY2F_2_struct(), TY2F_struct(), and WN2C_Append_Symtab_Types().
char* buffer_to_be_freed[MIN_NAME_SLOTS] [static] |
Definition at line 669 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
UINT delay_count[MIN_NAME_SLOTS] = {0, 0, 0, 0, 0, 0, 0, 0} [static] |
Definition at line 671 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
INT Max_Tmpvar_Idx = -1 [static] |
Definition at line 885 of file stab_attr.cxx.
Referenced by Stab_Free_Tmpvars(), and Stab_Lock_Tmpvar().
char* Name_Buf [static] |
Definition at line 665 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
UINT Name_Buf_Idx = 0 [static] |
Definition at line 666 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
UINT Name_Buf_Size = 0 [static] |
Definition at line 667 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
UINT next_delay_slot = 0 [static] |
Definition at line 670 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
INT Next_Tmpvar_Idx = 0 [static] |
Definition at line 884 of file stab_attr.cxx.
Referenced by Stab_Free_Tmpvars(), Stab_Lock_Tmpvar(), and Stab_Unlock_Tmpvar().
INT next_to_be_freed = -1 [static] |
Definition at line 672 of file stab_attr.cxx.
Referenced by Get_Name_Buf_Slot(), and Stab_Free_Namebufs().
TMPVARINFO* TmpVar = NULL [static] |
Definition at line 883 of file stab_attr.cxx.
W2FC_FLAG_ARRAY* W2fc_ty_tab [static] |
Definition at line 185 of file stab_attr.cxx.