Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
cwh_io.cxx File Reference
#include "defs.h"
#include "glob.h"
#include "stab.h"
#include "strtab.h"
#include "errors.h"
#include "config.h"
#include "config_targ.h"
#include "wn.h"
#include "const.h"
#include "wio.h"
#include "ir_reader.h"
#include "wn_util.h"
#include "targ_const.h"
#include "targ_sim.h"
#include "i_cvrt.h"
#include "cwh_defines.h"
#include "cwh_addr.h"
#include "cwh_dope.h"
#include "cwh_stk.h"
#include "cwh_types.h"
#include "cwh_expr.h"
#include "cwh_block.h"
#include "sgi_cmd_line.h"
#include "cwh_preg.h"
#include "cwh_stab.h"
#include "cwh_auxst.h"
#include "cwh_io.i"
#include "cwh_io.h"
Include dependency graph for cwh_io.cxx:

Go to the source code of this file.

Defines

#define STACK_PUSH(x)
#define IoItem_TY(wn)   (WN_kid(wn,3))
#define NIL   0
#define WRITE_STMT   0
#define READ_STMT   1
#define NML_MASK   2
#define READ_WRITE_MASK   1
#define NAMELIST_MODE(x)   ((x) & NML_MASK)
#define READ_MODE(x)   ((x) & READ_WRITE_MASK)
#define WRITE_MODE(x)   (!((x) & READ_WRITE_MASK))

Enumerations

enum  CILIST_TABLE_ITEM {
  CILIST_EDFLAG = 0, CILIST_EEEFLAG = 1, CILIST_FLFLAG = 2, CILIST_UNIT = 3,
  CILIST_IOSTAT = 4, CILIST_REC = 5, CILIST_PARSFMT = 6, CILIST_FMTSRC = 7,
  CILIST_ADVANCE = 8, CILIST_SIZE = 9, CILIST_ERR = 10, CILIST_END = 11,
  CILIST_EOR = 12
}
enum  OPEN_TABLE_ITEM {
  OPEN_CALLNAME = 0, OPEN_VERSION = 1, OPEN_UNIT = 2, OPEN_IOSTAT = 3,
  OPEN_ERRFLAG = 4, OPEN_FILE = 5, OPEN_STATUS = 6, OPEN_ACCESS = 7,
  OPEN_FORM = 8, OPEN_RECL = 9, OPEN_BLANK = 10, OPEN_POSITION = 11,
  OPEN_ACTION = 12, OPEN_DELIM = 13, OPEN_PAD = 14, OPEN_ERR = 15
}
enum  CLOSE_TABLE_ITEM {
  CLOSE_CALLNAME = 0, CLOSE_VERSION = 1, CLOSE_UNIT = 2, CLOSE_IOSTAT = 3,
  CLOSE_ERRFLAG = 4, CLOSE_STATUS = 5, CLOSE_ERR = 6
}
enum  INQ_TABLE_ITEM {
  INQ_CALLNAME = 0, INQ_VERSION = 1, INQ_UNIT = 2, INQ_FILE = 3,
  INQ_IOSTAT = 4, INQ_ERRFLAG = 5, INQ_EXIST = 6, INQ_OPENED = 7,
  INQ_NUMBER = 8, INQ_NAMED = 9, INQ_NAME = 10, INQ_ACCESS = 11,
  INQ_SEQUENTIAL = 12, INQ_DIRECT = 13, INQ_FORM = 14, INQ_FORMATTED = 15,
  INQ_UNFORMATTED = 16, INQ_RECL = 17, INQ_NEXTREC = 18, INQ_BLANK = 19,
  INQ_POSITION = 20, INQ_ACTION = 21, INQ_READ = 22, INQ_WRITE = 23,
  INQ_READWRITE = 24, INQ_DELIM = 25, INQ_PAD = 26, INQ_ERR = 27
}
enum  BIO_TABLE_ITEM {
  BIO_CALLNAME = 0, BIO_VERSION = 1, BIO_UNIT = 2, BIO_RECMODE = 3,
  BIO_BLOC = 4, BIO_ELOC = 5, BIO_TIPTR = 6
}
enum  NODESC_TABLE_ITEM {
  NODESC_CALLNAME = 0, NODESC_UNIT = 1, NODESC_IOSTAT = 2, NODESC_ERRFLAG = 3,
  NODESC_ERR = 4
}

Functions

static WNcwh_io_ioitem (int mode, WN *craytype)
static WNcwh_io_str_ioitem (IOITEM it, int mode, WN *craytype)
static WNcwh_io_char_ioitem (IOITEM it, WN *len, int mode, WN *craytype)
static TY_IDX cwh_io_scalar_type (WN *wn)
void fei_control_list (int mode)
void fei_IO_list (int num_args, int mode)
void fei_formatted_write (void)
void fei_formatted_read (void)
void fei_unformatted_write (void)
void fei_unformatted_read (void)
void fei_namelist_write (void)
void fei_namelist_read (void)
void fei_implied_do (void)
void fei_iolength (void)
void fei_start_ioblock (void)
void fei_end_ioblock (void)
static BOOL cwh_io_null_address (WN *addr)
void fei_open (void)
void fei_inquire (void)
void fei_close (void)
static void cwh_io_no_desc (IOSTATEMENT statement)
void fei_rewind (void)
void fei_backspace (void)
void fei_endfile (void)
void fei_iotype (void)
static BOOL is_f90_pointer (WN *addr)
static STcwh_io_ST_base (ST *st)
static BOOL cwh_io_analyse_io_statement (WN *tree, int mode)
static BOOL cwh_io_analyse_io_item (WN *tree, IMPDO_INFO *impdo_set, int mode)
static BOOL cwh_io_analyse_expr (WN *tree, IMPDO_INFO *impdo_set, int mode)
static BOOL cwh_io_analyse_arr (WN *tree, IMPDO_INFO *impdo_set, int mode)
static INT32 cwh_io_analyse_index_expr (WN *tree, IMPDO_INFO *impdo_set, int mode)
static mINT32 member (ST *st, IMPDO_INFO *impdo_set)
static void cwh_io_create_dopes (WN *tree)
static void cwh_io_create_dope_from_item (WN *parent, int kid_num, IMPDO_INFO *impdo_set)
static WNcwh_io_conv_array_to_dope (WN *tree, IMPDO_INFO *impdo_set, WN *old_item, WN *char_len, TY_IDX ty, WN *craytype)
static WNcwh_io_conv_arrsection_to_dope (WN *tree, IMPDO_INFO *impdo_set, WN *old_item, WN *char_len, TY_IDX ty, WN *craytype)
static INT32 cwh_io_search_implied_do_index (WN *tree, IMPDO_INFO *impdo_set)
static void cwh_io_add_st_to_marked_set (ST *st)
static void cwh_io_unmark (void)
static WNSubstitute_1_For_Impdo_Index_Val (WN *tree, IMPDO_INFO *impdo)
static void cwh_io_split_io_statement (WN *tree)
static void cwh_io_split_io_items (IOSTATEMENT ios, WN **cilist, INT32 num_cilist_items, WN *item)
static BOOL OPCODE_has_aux (const OPCODE opc)
static WNcwh_io_create_new_label (void)
static WNcwh_io_cvt_tos_label_to_wn (BOOL flag)

Variables

static char * source_file = __FILE__
static INT32 num_list_items_last_processed
static INT32 eeeflag
static MARKED_SETmarked_set

Define Documentation

#define IoItem_TY (   wn)    (WN_kid(wn,3))

Definition at line 100 of file cwh_io.cxx.

#define NAMELIST_MODE (   x)    ((x) & NML_MASK)

Definition at line 208 of file cwh_io.cxx.

Referenced by cwh_io_ioitem(), fei_control_list(), and fei_IO_list().

#define NML_MASK   2

Definition at line 206 of file cwh_io.cxx.

#define READ_MODE (   x)    ((x) & READ_WRITE_MASK)

Definition at line 209 of file cwh_io.cxx.

Referenced by cwh_io_analyse_arr(), cwh_io_analyse_expr(), and cwh_io_ioitem().

#define READ_STMT   1

Definition at line 205 of file cwh_io.cxx.

Referenced by fei_formatted_read(), and fei_unformatted_read().

#define READ_WRITE_MASK   1

Definition at line 207 of file cwh_io.cxx.

#define STACK_PUSH (   x)
Value:
if (x != NULL) \
  cwh_stk_push(x, WN_item);

Definition at line 96 of file cwh_io.cxx.

Referenced by fei_control_list().

#define WRITE_MODE (   x)    (!((x) & READ_WRITE_MASK))

Definition at line 210 of file cwh_io.cxx.

#define WRITE_STMT   0

Definition at line 204 of file cwh_io.cxx.

Referenced by fei_formatted_write(), fei_iolength(), and fei_unformatted_write().


Enumeration Type Documentation

Enumerator:
BIO_CALLNAME 
BIO_VERSION 
BIO_UNIT 
BIO_RECMODE 
BIO_BLOC 
BIO_ELOC 
BIO_TIPTR 

Definition at line 183 of file cwh_io.cxx.

Enumerator:
CILIST_EDFLAG 
CILIST_EEEFLAG 
CILIST_FLFLAG 
CILIST_UNIT 
CILIST_IOSTAT 
CILIST_REC 
CILIST_PARSFMT 
CILIST_FMTSRC 
CILIST_ADVANCE 
CILIST_SIZE 
CILIST_ERR 
CILIST_END 
CILIST_EOR 

Definition at line 107 of file cwh_io.cxx.

Enumerator:
CLOSE_CALLNAME 
CLOSE_VERSION 
CLOSE_UNIT 
CLOSE_IOSTAT 
CLOSE_ERRFLAG 
CLOSE_STATUS 
CLOSE_ERR 

Definition at line 142 of file cwh_io.cxx.

Enumerator:
INQ_CALLNAME 
INQ_VERSION 
INQ_UNIT 
INQ_FILE 
INQ_IOSTAT 
INQ_ERRFLAG 
INQ_EXIST 
INQ_OPENED 
INQ_NUMBER 
INQ_NAMED 
INQ_NAME 
INQ_ACCESS 
INQ_SEQUENTIAL 
INQ_DIRECT 
INQ_FORM 
INQ_FORMATTED 
INQ_UNFORMATTED 
INQ_RECL 
INQ_NEXTREC 
INQ_BLANK 
INQ_POSITION 
INQ_ACTION 
INQ_READ 
INQ_WRITE 
INQ_READWRITE 
INQ_DELIM 
INQ_PAD 
INQ_ERR 

Definition at line 152 of file cwh_io.cxx.

Enumerator:
NODESC_CALLNAME 
NODESC_UNIT 
NODESC_IOSTAT 
NODESC_ERRFLAG 
NODESC_ERR 

Definition at line 196 of file cwh_io.cxx.

Enumerator:
OPEN_CALLNAME 
OPEN_VERSION 
OPEN_UNIT 
OPEN_IOSTAT 
OPEN_ERRFLAG 
OPEN_FILE 
OPEN_STATUS 
OPEN_ACCESS 
OPEN_FORM 
OPEN_RECL 
OPEN_BLANK 
OPEN_POSITION 
OPEN_ACTION 
OPEN_DELIM 
OPEN_PAD 
OPEN_ERR 

Definition at line 123 of file cwh_io.cxx.


Function Documentation

static void cwh_io_add_st_to_marked_set ( ST st) [static]

Definition at line 3057 of file cwh_io.cxx.

References Marked_next, marked_set, and Marked_st.

Referenced by cwh_io_analyse_arr(), cwh_io_analyse_expr(), and cwh_io_analyse_io_item().

static BOOL cwh_io_analyse_arr ( WN tree,
IMPDO_INFO impdo_set,
int  mode 
) [static]
static BOOL cwh_io_analyse_expr ( WN tree,
IMPDO_INFO impdo_set,
int  mode 
) [static]
static INT32 cwh_io_analyse_index_expr ( WN tree,
IMPDO_INFO impdo_set,
int  mode 
) [static]
static BOOL cwh_io_analyse_io_statement ( WN tree,
int  mode 
) [static]

Definition at line 2126 of file cwh_io.cxx.

References cwh_io_analyse_io_item(), FALSE, NULL, TRUE, wn, WN_io_item(), WN_kid(), and WN_kid_count().

Referenced by fei_formatted_read(), fei_formatted_write(), fei_iolength(), fei_unformatted_read(), and fei_unformatted_write().

Here is the call graph for this function:

static WN * cwh_io_char_ioitem ( IOITEM  it,
WN len,
int  mode,
WN craytype 
) [static]

Definition at line 1015 of file cwh_io.cxx.

References cwh_addr_find_section(), cwh_expr_address(), cwh_stk_get_TY(), f_NONE, p_RETURN_SECTION, wn, and WN_CreateIoItem3().

Referenced by cwh_io_str_ioitem().

Here is the call graph for this function:

static void cwh_io_create_dope_from_item ( WN parent,
int  kid_num,
IMPDO_INFO impdo_set 
) [static]

Definition at line 2603 of file cwh_io.cxx.

References DevAssert, free(), Impdo_index, Impdo_next, NULL, WN_index, WN_intrinsic(), WN_kid(), WN_kid0(), WN_kid_count(), WN_st(), and WNOPR.

Referenced by cwh_io_create_dopes().

Here is the call graph for this function:

static void cwh_io_create_dopes ( WN tree) [static]

Definition at line 2568 of file cwh_io.cxx.

References cwh_io_create_dope_from_item(), NULL, wn, WN_io_item(), WN_kid(), and WN_kid_count().

Here is the call graph for this function:

static WN* cwh_io_create_new_label ( void  ) [static]

Definition at line 3390 of file cwh_io.cxx.

References CURRENT_SYMTAB, New_LABEL(), NIL, and WN_CreateLabel().

Referenced by cwh_io_split_io_items().

Here is the call graph for this function:

static WN* cwh_io_cvt_tos_label_to_wn ( BOOL  flag) [static]
static BOOL cwh_io_null_address ( WN addr) [static]

Definition at line 1198 of file cwh_io.cxx.

References FALSE, OPR_INTCONST, TRUE, WN_const_val(), WN_Delete, and WN_operator().

Referenced by cwh_io_no_desc(), fei_close(), fei_inquire(), and fei_open().

Here is the call graph for this function:

static TY_IDX cwh_io_scalar_type ( WN wn) [static]

Definition at line 220 of file cwh_io.cxx.

References cwh_types_array_TY(), cwh_types_scalar_TY(), cwh_types_WN_TY(), FALSE, and NIL.

Referenced by cwh_io_no_desc(), fei_close(), fei_control_list(), fei_inquire(), and fei_open().

Here is the call graph for this function:

static INT32 cwh_io_search_implied_do_index ( WN tree,
IMPDO_INFO impdo_set 
) [static]

Definition at line 3027 of file cwh_io.cxx.

References member(), OPR_LDID, WN_kid(), WN_kid_count(), WN_st(), and WNOPR.

Referenced by cwh_io_conv_array_to_dope(), and cwh_io_conv_arrsection_to_dope().

Here is the call graph for this function:

static WN * cwh_io_str_ioitem ( IOITEM  it,
int  mode,
WN craytype 
) [static]

Definition at line 993 of file cwh_io.cxx.

References cwh_expr_operand(), cwh_io_char_ioitem(), cwh_stk_pop_STR(), NULL, and wn.

Referenced by fei_IO_list().

Here is the call graph for this function:

static void cwh_io_unmark ( void  ) [static]

Definition at line 3079 of file cwh_io.cxx.

References FALSE, free(), Marked_next, marked_set, Marked_st, Set_ST_auxst_visited, and ST_auxst_visited.

Referenced by fei_formatted_read(), fei_formatted_write(), fei_iolength(), fei_unformatted_read(), and fei_unformatted_write().

Here is the call graph for this function:

void fei_backspace ( void  )

Definition at line 1988 of file cwh_io.cxx.

References cwh_io_no_desc().

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_end_ioblock ( void  )

Definition at line 1168 of file cwh_io.cxx.

References cwh_auxst_clear(), cwh_block_append(), cwh_io_in_ioblock, free(), IO_Comments, NIL, strcpy, wn, WN_CreateComment(), WN_CreatePragma(), WN_PRAGMA_END_STMT_CLUMP, and WN_st().

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_endfile ( void  )

Definition at line 2003 of file cwh_io.cxx.

References cwh_io_no_desc().

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_formatted_read ( void  )

Definition at line 704 of file cwh_io.cxx.

References cwh_block_append(), cwh_io_analyse_io_statement(), cwh_io_split_io_statement(), cwh_io_unmark(), cwh_stk_pop_iostmt(), eeeflag, NULL, READ_STMT, Use_Three_Call, and wn.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_formatted_write ( void  )
void fei_implied_do ( void  )

Definition at line 849 of file cwh_io.cxx.

References cwh_expr_operand(), cwh_stk_pop_ST(), cwh_stk_push(), free(), NIL, NULL, num_list_items_last_processed, start, wn, WN_CreateIdname(), WN_CreateIoItemN(), WN_end, WN_index, WN_item, WN_kid(), WN_start, and WN_step.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_IO_list ( int  num_args,
int  mode 
)
void fei_iotype ( void  )

Definition at line 2020 of file cwh_io.cxx.

References cwh_expr_operand(), cwh_stk_push(), DELETE_ARRAYEXP_WN, wn, and WN_item.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_namelist_read ( void  )

Definition at line 826 of file cwh_io.cxx.

References cwh_block_append(), cwh_stk_pop_iostmt(), eeeflag, and wn.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_namelist_write ( void  )

Definition at line 807 of file cwh_io.cxx.

References cwh_block_append(), cwh_stk_pop_iostmt(), eeeflag, and wn.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_rewind ( void  )

Definition at line 1973 of file cwh_io.cxx.

References cwh_io_no_desc().

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_unformatted_read ( void  )

Definition at line 774 of file cwh_io.cxx.

References cwh_block_append(), cwh_io_analyse_io_statement(), cwh_io_split_io_statement(), cwh_io_unmark(), cwh_stk_pop_iostmt(), eeeflag, NULL, READ_STMT, Use_Three_Call, and wn.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

void fei_unformatted_write ( void  )

Definition at line 739 of file cwh_io.cxx.

References cwh_block_append(), cwh_io_analyse_io_statement(), cwh_io_split_io_statement(), cwh_io_unmark(), cwh_stk_pop_iostmt(), eeeflag, NULL, Use_Three_Call, wn, and WRITE_STMT.

Referenced by cvrt_exp_to_pdg().

Here is the call graph for this function:

static mINT32 member ( ST st,
IMPDO_INFO impdo_set 
) [static]
static BOOL OPCODE_has_aux ( const OPCODE  opc) [static]

Definition at line 3372 of file cwh_io.cxx.

References OPCODE_operator(), OPR_IDNAME, OPR_LDA, OPR_LDID, and OPR_STID.

Referenced by cwh_io_analyse_expr().

Here is the call graph for this function:


Variable Documentation

Definition at line 217 of file cwh_io.cxx.

Referenced by cwh_io_add_st_to_marked_set(), and cwh_io_unmark().

Definition at line 105 of file cwh_io.cxx.

Referenced by fei_implied_do(), and fei_IO_list().

char* source_file = __FILE__ [static]

Definition at line 52 of file cwh_io.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines