Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
ty2f.cxx File Reference
#include <iostream>
#include "whirl2f_common.h"
#include "PUinfo.h"
#include "wn2f.h"
#include "ty2f.h"
#include "st2f.h"
#include "tcon2f.h"
#include "wn2f_load_store.h"
#include "ty_ftn.h"
Include dependency graph for ty2f.cxx:

Go to the source code of this file.

Defines

#define NUMBER_OF_OPERATORS   (OPERATOR_LAST + 1)
#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))
#define FLD_INFO_ALLOC_CHUNK   16

Typedefs

typedef WN2F_STATUS(* WN2F_HANDLER_FUNC )(TOKEN_BUFFER, WN *, WN2F_CONTEXT)
typedef void(* TY2F_HANDLER_FUNC )(TOKEN_BUFFER, TY_IDX)

Functions

static void TY2F_invalid (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_scalar (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_array (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_array_for_pointer (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_struct (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_2_struct (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_pointer (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static void TY2F_void (TOKEN_BUFFER decl_tokens, TY_IDX ty)
static WNfind_stmt (ST *st, WN *wn)
void WN2F_Append_Purple_Xsym (TOKEN_BUFFER tokens, ST *st)
static void WN2F_tempvar_rhs (TOKEN_BUFFER tokens, WN *wn)
static BOOL GetTmpVarTransInfo (TOKEN_BUFFER decl_tokens, ST_IDX arbnd, WN *wn)
static void TY2F_Append_Array_Bnd_Ph (TOKEN_BUFFER decl_tokens, ST_IDX arbnd, BOOL purple_assumed_size)
static void TY2F_Append_ARB (TOKEN_BUFFER decl_tokens, ARB_HANDLE arb, BOOL purple_assumed_size)
static void TY2F_Append_Assumed_Single_Dim (TOKEN_BUFFER decl_tokens, ST *st, TY_IDX element_ty)
static void TY2F_Purple_Ptr_As_Array (TOKEN_BUFFER decl_tokens, ST *st, TY_IDX element_ty)
static void TY2F_Purple_Assumed_Sized_Array (TOKEN_BUFFER decl_tokens, ST *st, TY_IDX ty)
static BOOL TY2F_is_character (TY_IDX ty)
static BOOL TY2F_Pointer_To_Dope (TY_IDX ty)
static FLD_PATH_INFONew_Fld_Path_Info (FLD_HANDLE fld)
static STAB_OFFSET TY2F_Fld_Size (FLD_HANDLE this_fld, mUINT64 max_size)
static FLD_PATH_INFOSelect_Best_Fld_Path (FLD_PATH_INFO *path1, FLD_PATH_INFO *path2, TY_IDX desired_ty, mUINT64 desired_offset)
static FLD_PATH_INFOConstruct_Fld_Path (FLD_HANDLE fld, TY_IDX struct_ty, TY_IDX desired_ty, mUINT64 desired_offset, mUINT64 max_fld_size)
const char * TY2F_Fld_Name (FLD_HANDLE fld, BOOL common_or_equivalence, BOOL alt_return_name)
static void TY2F_Equivalence (TOKEN_BUFFER tokens, const char *equiv_name, const char *fld_name)
const char * findEquivFldNm (TY_IDX struct_ty, mUINT64 ofst, FLD_HANDLE *&equivFld)
static void TY2F_Equivalence_FldList (TOKEN_BUFFER tokens, TY_IDX struct_ty, FLD_HANDLE fldlist, mUINT64 ofst)
static void TY2F_Equivalence_List (TOKEN_BUFFER tokens, const TY_IDX struct_ty)
static void TY2F_Translate_Structure (TY_IDX ty)
static void TY2F_Translate_EquivCommon_PtrFld (TOKEN_BUFFER tokens, FLD_HANDLE fld)
static void TY2F_Declare_Common_Flds (TOKEN_BUFFER tokens, FLD_HANDLE fldlist, BOOL alt_return, BOOL *is_equiv)
static void TY2F_List_Common_Flds (TOKEN_BUFFER tokens, FLD_HANDLE fldlist)
void TY2F_translate (TOKEN_BUFFER tokens, TY_IDX ty, BOOL notyapp)
void TY2F_translate (TOKEN_BUFFER tokens, TY_IDX ty)
void TY2F_Translate_Purple_Array (TOKEN_BUFFER tokens, ST *st, TY_IDX ty)
static long GetLB (ARB_HANDLE arb)
void TY2F_Translate_ArrayElt (TOKEN_BUFFER tokens, TY_IDX arr_ty_idx, STAB_OFFSET arr_ofst)
void TY2F_Translate_Common (TOKEN_BUFFER tokens, const char *name, TY_IDX ty_idx)
void TY2F_Translate_Equivalence (TOKEN_BUFFER tokens, TY_IDX ty_idx, BOOL alt_return)
void TY2F_Prepend_Structures (TOKEN_BUFFER tokens)
FLD_PATH_INFOTY2F_Free_Fld_Path (FLD_PATH_INFO *fld_path)
FLD_PATH_INFOTY2F_Get_Fld_Path (const TY_IDX struct_ty, const TY_IDX object_ty, STAB_OFFSET offset)
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)
void TY2F_Fld_Separator (TOKEN_BUFFER tokens)
FLD_HANDLE TY2F_Last_Fld (FLD_PATH_INFO *fld_path)
FLD_PATH_INFOTY2F_Point_At_Path (FLD_PATH_INFO *path, STAB_OFFSET off)
void TY2F_Dump_Fld_Path (FLD_PATH_INFO *fld_path)

Variables

WNPU_Body
BOOL Array_Bnd_Temp_Var
BOOL W2F_OpenAD
WN2F_HANDLER_FUNC WN2F_Handler [NUMBER_OF_OPERATORS]
BOOL Use_Purple_Array_Bnds_Placeholder = FALSE
static const TY2F_HANDLER_FUNC TY2F_Handler [KIND_LAST]
static FLD_PATH_INFOFree_Fld_Path_Info = NULL
static TOKEN_BUFFER TY2F_Structure_Decls = NULL

Define Documentation

#define FLD_INFO_ALLOC_CHUNK   16

Definition at line 546 of file ty2f.cxx.

Referenced by New_Fld_Path_Info().

#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 105 of file ty2f.cxx.

Referenced by TY2F_Get_Fld_Path(), and TY2F_Translate_Structure().

#define NUMBER_OF_OPERATORS   (OPERATOR_LAST + 1)

Definition at line 64 of file ty2f.cxx.


Typedef Documentation

Definition at line 78 of file ty2f.cxx.

Definition at line 68 of file ty2f.cxx.


Function Documentation

static WN * find_stmt ( ST st,
WN wn 
) [static]

Definition at line 196 of file ty2f.cxx.

References NULL, OPR_STID, ST_is_temp_var(), ST_name(), wn, WN_kid0(), WN_next(), WN_operator(), and WN_st().

Here is the call graph for this function:

const char* findEquivFldNm ( TY_IDX  struct_ty,
mUINT64  ofst,
FLD_HANDLE *&  equivFld 
)

Definition at line 939 of file ty2f.cxx.

References ASSERT_FATAL, DIAG_W2F_UNEXPECTED_CONTEXT, FLD_last_field(), FLD_name(), FLD_ofst(), FLD_st(), Make_fld_iter(), ST_name(), ST_ptr(), and TY_fld().

Referenced by TY2F_Equivalence_FldList().

Here is the call graph for this function:

static long GetLB ( ARB_HANDLE  arb) [static]

Definition at line 1841 of file ty2f.cxx.

References ARB_const_lbnd(), and ARB_lbnd_val().

Referenced by TY2F_Translate_ArrayElt().

Here is the call graph for this function:

static BOOL GetTmpVarTransInfo ( TOKEN_BUFFER  decl_tokens,
ST_IDX  arbnd,
WN wn 
) [static]

Definition at line 158 of file ty2f.cxx.

References FALSE, NULL, OPR_ISTORE, OPR_LDA, OPR_STID, ST_name(), ST_ptr(), TRUE, WN2F_tempvar_rhs(), WN_first(), WN_kid1(), WN_next(), WN_operator(), and WN_st().

Referenced by TY2F_Append_Array_Bnd_Ph().

Here is the call graph for this function:

static void TY2F_2_struct ( TOKEN_BUFFER  decl_tokens,
TY_IDX  ty 
) [static]

Definition at line 1710 of file ty2f.cxx.

References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, KIND_STRUCT, Set_TY_is_translated_to_c(), TY2F_Translate_Structure(), TY_is_translated_to_c(), TY_kind(), and Ty_Table.

Referenced by TY2F_translate().

Here is the call graph for this function:

static void TY2F_Append_ARB ( TOKEN_BUFFER  decl_tokens,
ARB_HANDLE  arb,
BOOL  purple_assumed_size 
) [static]
static void TY2F_Append_Array_Bnd_Ph ( TOKEN_BUFFER  decl_tokens,
ST_IDX  arbnd,
BOOL  purple_assumed_size 
) [static]

Definition at line 221 of file ty2f.cxx.

References Append_Token_String(), Array_Bnd_Temp_Var, GetTmpVarTransInfo(), PU_Body, SCLASS_FORMAL, SCLASS_FORMAL_REF, ST_is_temp_var(), ST_name(), ST_ptr(), ST_sclass(), TRUE, and wn.

Referenced by TY2F_Append_ARB().

Here is the call graph for this function:

static void TY2F_Append_Assumed_Single_Dim ( TOKEN_BUFFER  decl_tokens,
ST st,
TY_IDX  element_ty 
) [static]

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

Here is the call graph for this function:

void TY2F_Dump_Fld_Path ( FLD_PATH_INFO fld_path)

Definition at line 2189 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(), Fld_Path_Info::next, NULL, and TY2F_Fld_Name().

Here is the call graph for this function:

static void TY2F_Equivalence ( TOKEN_BUFFER  tokens,
const char *  equiv_name,
const char *  fld_name 
) [static]

Definition at line 923 of file ty2f.cxx.

References Append_Token_Special(), and Append_Token_String().

Referenced by TY2F_Equivalence_FldList().

Here is the call graph for this function:

static void TY2F_Equivalence_FldList ( TOKEN_BUFFER  tokens,
TY_IDX  struct_ty,
FLD_HANDLE  fldlist,
mUINT64  ofst 
) [static]
static void TY2F_Equivalence_List ( TOKEN_BUFFER  tokens,
const TY_IDX  struct_ty 
) [static]

Definition at line 995 of file ty2f.cxx.

References TY2F_Equivalence_FldList(), TY_flist(), and Ty_Table.

Referenced by TY2F_Translate_Common(), and TY2F_Translate_Equivalence().

Here is the call graph for this function:

void TY2F_Fld_Separator ( TOKEN_BUFFER  tokens)

Definition at line 2145 of file ty2f.cxx.

References Append_Token_Special(), and WN2F_F90_pu.

Referenced by TY2F_Translate_Fld_Path(), WN2F_array(), WN2F_Offset_Memref(), and WN2F_Offset_Symref().

Here is the call graph for this function:

static STAB_OFFSET TY2F_Fld_Size ( FLD_HANDLE  this_fld,
mUINT64  max_size 
) [static]

Definition at line 595 of file ty2f.cxx.

References FALSE, FLD_equivalence(), FLD_is_bit_field(), FLD_last_field(), FLD_ofst(), FLD_type(), Make_fld_iter(), TRUE, and TY_size().

Referenced by Construct_Fld_Path().

Here is the call graph for this function:

static void TY2F_invalid ( TOKEN_BUFFER  decl_tokens,
TY_IDX  ty 
) [static]

Definition at line 1277 of file ty2f.cxx.

References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, Prepend_Token_String(), TY_kind(), and Ty_Table.

Here is the call graph for this function:

static BOOL TY2F_is_character ( TY_IDX  ty) [static]

Definition at line 536 of file ty2f.cxx.

References KIND_ARRAY, TY_etype(), TY_is_character(), and TY_kind().

Referenced by Construct_Fld_Path().

Here is the call graph for this function:

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

Here is the call graph for this function:

Definition at line 2172 of file ty2f.cxx.

References Fld_Path_Info::fld, FLD_ofst(), Fld_Path_Info::next, NULL, and path.

Referenced by LOC_INFO::WN2F_Find_And_Mark_Nested_Address().

Here is the call graph for this function:

static BOOL TY2F_Pointer_To_Dope ( TY_IDX  ty) [static]

Definition at line 551 of file ty2f.cxx.

References TY_name(), and TY_pointed().

Referenced by TY2F_pointer().

Here is the call graph for this function:

Definition at line 2014 of file ty2f.cxx.

References NULL, and Prepend_And_Reclaim_Token_List().

Referenced by ST2F_decl_parameter(), ST2F_decl_type(), ST2F_decl_var(), and ST2F_Declare_Return_Type().

Here is the call graph for this function:

static void TY2F_Purple_Ptr_As_Array ( TOKEN_BUFFER  decl_tokens,
ST st,
TY_IDX  element_ty 
) [static]
void TY2F_translate ( TOKEN_BUFFER  tokens,
TY_IDX  ty 
)

Definition at line 1813 of file ty2f.cxx.

References TY2F_translate().

Here is the call graph for this function:

void TY2F_Translate_Equivalence ( TOKEN_BUFFER  tokens,
TY_IDX  ty_idx,
BOOL  alt_return 
)

Definition at line 1971 of file ty2f.cxx.

References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_TYPE_KIND, FLD_next(), KIND_STRUCT, TY2F_Equivalence_List(), TY_flist(), TY_kind(), and Ty_Table.

Referenced by ST2F_decl_var().

Here is the call graph for this function:

static void TY2F_void ( TOKEN_BUFFER  decl_tokens,
TY_IDX  ty 
) [static]

Definition at line 1784 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.

Here is the call graph for this function:

void WN2F_Append_Purple_Xsym ( TOKEN_BUFFER  tokens,
ST st 
)
static void WN2F_tempvar_rhs ( TOKEN_BUFFER  tokens,
WN wn 
) [static]

Definition at line 134 of file ty2f.cxx.

References Append_And_Reclaim_Token_List(), INIT_WN2F_CONTEXT, New_Token_Buffer(), WN2F_translate(), and WN_kid0().

Referenced by GetTmpVarTransInfo().

Here is the call graph for this function:


Variable Documentation

Definition at line 547 of file ty2f.cxx.

Referenced by New_Fld_Path_Info(), and TY2F_Free_Fld_Path().

Definition at line 94 of file wn2f.cxx.

Initial value:

Definition at line 91 of file ty2f.cxx.

Referenced by TY2F_translate().

Definition at line 919 of file ty2f.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines