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

Go to the source code of this file.

Classes

struct  Array_Segment

Defines

#define OFFSET_IS_IN_FLD(fld, ofst)

Typedefs

typedef struct Array_Segment ARRAY_SEGMENT

Functions

static void Set_Tcon_Value (TCON *tcon, MTYPE mtype, INT typesize, char *bytes)
static void INIT2F_Prepend_Equivalence (TOKEN_BUFFER tokens, TOKEN_BUFFER name1_tokens, UINT tmpvar_idx)
static void INIT2F_Append_Initializer (TOKEN_BUFFER tokens, TOKEN_BUFFER *init_tokens, INT repeat)
static UINT16 INIT2F_choose_repeat (const INITV &initv)
static void INIT2F_Next_Initv (const INITV &initv, UINT *initv_idx, UINT *initv_times)
static void INIT2F_Skip_Padding (INITV_IDX *initv_array, TY_IDX object_ty, STAB_OFFSET *ofst, UINT *initv_idx)
static UINT INIT2F_Number_Of_Initvs (INITV_IDX initv)
static void INIT2F_Collect_Initvs (INITV_IDX *initv_array, UINT *initv_idx, INITV_IDX initv)
static INITV_IDXINIT2F_Get_Initv_Array (ST *st, INITO_IDX first_inito)
static TY_IDX INITVKIND_ty (INITV_IDX initv_idx)
static void INITVKIND_symoff (TOKEN_BUFFER tokens, INT repeat, ST *st, STAB_OFFSET ofst, TY_IDX object_ty)
static void INITVKIND_val (TOKEN_BUFFER tokens, INT repeat, TCON *tcon, TY_IDX object_ty)
static void INITVKIND_const (TOKEN_BUFFER tokens, INT repeat, const char **tbl, TY_IDX ty)
static void INITVKIND_translate (TOKEN_BUFFER tokens, INITV_IDX initv_idx, TY_IDX object_ty, UINT repeat)
static void INIT2F_Translate_Char_Ref (TOKEN_BUFFER tokens, ST *base_object, TY_IDX array_etype, STAB_OFFSET base_ofst, STAB_OFFSET array_ofst, STAB_OFFSET string_ofst, UINT string_size, WN2F_CONTEXT context)
static BOOL INIT2F_is_string_initv (INITV &ini, TY_IDX ty)
static ARRAY_SEGMENT INIT2F_Get_Array_Segment (INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times, TY_IDX object_type, STAB_OFFSET *object_ofst)
static void INIT2F_Translate_Array_Value (TOKEN_BUFFER tokens, const ARRAY_SEGMENT *aseg)
static void INIT2F_Implied_DoLoop (TOKEN_BUFFER tokens, TOKEN_BUFFER *abase_tokens, const ARRAY_SEGMENT *aseg)
static void INIT2F_Translate_Array_Ref (TOKEN_BUFFER tokens, ST *base_object, STAB_OFFSET base_ofst, const ARRAY_SEGMENT *aseg)
static void INIT2F_translate (TOKEN_BUFFER lhs_tokens, TOKEN_BUFFER rhs_tokens, ST *base_object, STAB_OFFSET base_ofst, STAB_OFFSET *object_ofst, TY_IDX object_ty, INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times)
static void INIT2F_ptr_or_scalar (TOKEN_BUFFER lhs_tokens, TOKEN_BUFFER rhs_tokens, ST *base_object, STAB_OFFSET base_ofst, STAB_OFFSET *object_ofst, TY_IDX object_ty, INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times)
static void INIT2F_array (TOKEN_BUFFER lhs_tokens, TOKEN_BUFFER rhs_tokens, ST *base_object, STAB_OFFSET base_ofst, STAB_OFFSET *object_ofst, TY_IDX object_ty, INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times)
static void INIT2F_substring (TOKEN_BUFFER lhs_tokens, TOKEN_BUFFER rhs_tokens, ST *base_object, STAB_OFFSET base_ofst, STAB_OFFSET *object_ofst, TY_IDX object_ty, INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times)
static void INIT2F_structured (TOKEN_BUFFER lhs_tokens, TOKEN_BUFFER rhs_tokens, ST *base_object, STAB_OFFSET *object_ofst, TY_IDX object_ty, INITV_IDX *initv_array, UINT *initv_idx, UINT *initv_times)
void INITO2F_translate (TOKEN_BUFFER tokens, INITO_IDX inito)
void PARAMETER2F_translate (TOKEN_BUFFER tokens, INITO_IDX inito)

Variables

TOKEN_BUFFER Data_Stmt_Tokens
static const char * one_consts [6] = { "1", ".TRUE.", "1_1", "1_2" , "1_4", "1_8"}
static const char * zero_consts [6] = { "0", ".FALSE.","0_1", "0_2" , "0_4", "0_8"}

Define Documentation

#define OFFSET_IS_IN_FLD (   fld,
  ofst 
)
Value:
(FLD_ofst(fld) == ofst || \
    (ofst > FLD_ofst(fld) && (ofst - FLD_ofst(fld) < TY_size(FLD_type(fld)))))

Definition at line 97 of file init2f.cxx.

Referenced by INIT2F_structured().


Typedef Documentation

typedef struct Array_Segment ARRAY_SEGMENT

Function Documentation

static void INIT2F_array ( TOKEN_BUFFER  lhs_tokens,
TOKEN_BUFFER  rhs_tokens,
ST base_object,
STAB_OFFSET  base_ofst,
STAB_OFFSET object_ofst,
TY_IDX  object_ty,
INITV_IDX initv_array,
UINT initv_idx,
UINT initv_times 
) [static]
static void INIT2F_Collect_Initvs ( INITV_IDX initv_array,
UINT initv_idx,
INITV_IDX  initv 
) [static]

Definition at line 344 of file init2f.cxx.

References INIT2F_choose_repeat(), INITV_blk(), INITV_kind(), INITV_next(), Initv_Table, and INITVKIND_BLOCK.

Referenced by INIT2F_Get_Initv_Array().

Here is the call graph for this function:

static INITV_IDX* INIT2F_Get_Initv_Array ( ST st,
INITO_IDX  first_inito 
) [static]

Definition at line 361 of file init2f.cxx.

References FOREACH_INITO, INIT2F_Collect_Initvs(), INIT2F_Number_Of_Initvs(), INITO_st(), Inito_Table, INITO_val(), ST_level(), and TYPE_ALLOC_N.

Referenced by INITO2F_translate(), and PARAMETER2F_translate().

Here is the call graph for this function:

static BOOL INIT2F_is_string_initv ( INITV ini,
TY_IDX  ty 
) [static]

Definition at line 659 of file init2f.cxx.

References FALSE, INITV_kind(), INITV_tc_val(), INITVKIND_VAL, MTYPE_STRING, Targ_String_Length(), TCON_ty, and TY_size().

Referenced by INIT2F_Get_Array_Segment(), and INIT2F_Translate_Array_Ref().

Here is the call graph for this function:

static void INIT2F_Next_Initv ( const INITV initv,
UINT initv_idx,
UINT initv_times 
) [static]

Definition at line 276 of file init2f.cxx.

References INIT2F_choose_repeat().

Referenced by INIT2F_Get_Array_Segment(), INIT2F_ptr_or_scalar(), INIT2F_substring(), and INIT2F_Translate_Array_Ref().

Here is the call graph for this function:

static UINT INIT2F_Number_Of_Initvs ( INITV_IDX  initv) [static]

Definition at line 321 of file init2f.cxx.

References INIT2F_choose_repeat(), INITV_blk(), INITV_kind(), INITV_next(), Initv_Table, and INITVKIND_BLOCK.

Referenced by INIT2F_Get_Initv_Array().

Here is the call graph for this function:

static void INIT2F_Prepend_Equivalence ( TOKEN_BUFFER  tokens,
TOKEN_BUFFER  name1_tokens,
UINT  tmpvar_idx 
) [static]

Definition at line 216 of file init2f.cxx.

References NULL, Prepend_And_Copy_Token_List(), Prepend_F77_Indented_Newline(), Prepend_Token_Special(), Prepend_Token_String(), and W2CF_Symtab_Nameof_Tempvar().

Referenced by INIT2F_Implied_DoLoop().

Here is the call graph for this function:

static void INIT2F_ptr_or_scalar ( TOKEN_BUFFER  lhs_tokens,
TOKEN_BUFFER  rhs_tokens,
ST base_object,
STAB_OFFSET  base_ofst,
STAB_OFFSET object_ofst,
TY_IDX  object_ty,
INITV_IDX initv_array,
UINT initv_idx,
UINT initv_times 
) [static]
static void INIT2F_Skip_Padding ( INITV_IDX initv_array,
TY_IDX  object_ty,
STAB_OFFSET ofst,
UINT initv_idx 
) [static]

Definition at line 297 of file init2f.cxx.

References INIT2F_choose_repeat(), INITV_kind(), INITV_pad(), Initv_Table, INITVKIND_PAD, and TY_size().

Referenced by INIT2F_array(), INIT2F_structured(), and INIT2F_substring().

Here is the call graph for this function:

static void INIT2F_structured ( TOKEN_BUFFER  lhs_tokens,
TOKEN_BUFFER  rhs_tokens,
ST base_object,
STAB_OFFSET object_ofst,
TY_IDX  object_ty,
INITV_IDX initv_array,
UINT initv_idx,
UINT initv_times 
) [static]
static void INIT2F_substring ( TOKEN_BUFFER  lhs_tokens,
TOKEN_BUFFER  rhs_tokens,
ST base_object,
STAB_OFFSET  base_ofst,
STAB_OFFSET object_ofst,
TY_IDX  object_ty,
INITV_IDX initv_array,
UINT initv_idx,
UINT initv_times 
) [static]
static void INIT2F_translate ( TOKEN_BUFFER  lhs_tokens,
TOKEN_BUFFER  rhs_tokens,
ST base_object,
STAB_OFFSET  base_ofst,
STAB_OFFSET object_ofst,
TY_IDX  object_ty,
INITV_IDX initv_array,
UINT initv_idx,
UINT initv_times 
) [static]
static void INIT2F_Translate_Char_Ref ( TOKEN_BUFFER  tokens,
ST base_object,
TY_IDX  array_etype,
STAB_OFFSET  base_ofst,
STAB_OFFSET  array_ofst,
STAB_OFFSET  string_ofst,
UINT  string_size,
WN2F_CONTEXT  context 
) [static]

Definition at line 600 of file init2f.cxx.

References Append_Token_Special(), Append_Token_String(), Number_as_String(), ST_type(), Stab_Pointer_To(), TY_size(), and WN2F_Offset_Symref().

Referenced by INIT2F_substring(), and INIT2F_Translate_Array_Ref().

Here is the call graph for this function:

static void INITVKIND_const ( TOKEN_BUFFER  tokens,
INT  repeat,
const char **  tbl,
TY_IDX  ty 
) [static]

Definition at line 532 of file init2f.cxx.

References Append_Token_String(), INIT2F_Append_Initializer(), MTYPE_I1, MTYPE_I2, MTYPE_I4, MTYPE_I8, New_Token_Buffer(), TY_is_logical(), TY_mtype(), Ty_Table, and WN2F_F90_pu.

Referenced by INITVKIND_translate().

Here is the call graph for this function:

static void INITVKIND_symoff ( TOKEN_BUFFER  tokens,
INT  repeat,
ST st,
STAB_OFFSET  ofst,
TY_IDX  object_ty 
) [static]

Definition at line 452 of file init2f.cxx.

References INIT2F_Append_Initializer(), INIT_WN2F_CONTEXT, New_Token_Buffer(), ST_type(), Stab_Pointer_To(), WN2F_Address_Of(), and WN2F_Offset_Symref().

Referenced by INITVKIND_translate().

Here is the call graph for this function:

static void Set_Tcon_Value ( TCON tcon,
MTYPE  mtype,
INT  typesize,
char *  bytes 
) [static]

Variable Documentation

const char* one_consts[6] = { "1", ".TRUE.", "1_1", "1_2" , "1_4", "1_8"} [static]

Definition at line 528 of file init2f.cxx.

Referenced by INITVKIND_translate().

const char* zero_consts[6] = { "0", ".FALSE.","0_1", "0_2" , "0_4", "0_8"} [static]

Definition at line 529 of file init2f.cxx.

Referenced by INITVKIND_translate().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines