Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
wn2f_stmt.cxx File Reference
#include <iostream>
#include <alloca.h>
#include "whirl2f_common.h"
#include "const.h"
#include "pf_cg.h"
#include "w2cf_parentize.h"
#include "PUinfo.h"
#include "wn2f.h"
#include "st2f.h"
#include "ty2f.h"
#include "tcon2f.h"
#include "wn2f_stmt.h"
#include "wn2f_load_store.h"
#include "wn2f_io.h"
#include "wn2f_pragma.h"
#include "init2f.h"
#include "be_symtab.h"
#include "intrn_info.h"
#include "unparse_target.h"
#include "ty_ftn.h"
Include dependency graph for wn2f_stmt.cxx:

Go to the source code of this file.

Classes

struct  Partial_Op
struct  Do_Loop_Bound
struct  write_st
struct  set_derived_ty_based_on_st
struct  WN2F_emit_commons

Defines

#define WN_pragma_nest(wn)   WN_pragma_arg1(wn)
#define MAX_TEST_OPERATIONS   16
#define WN2F_Reverse_Bounds_Comparison(comparison_opr)

Typedefs

typedef struct Partial_Op PARTIAL_OP
typedef struct Do_Loop_Bound DO_LOOP_BOUND

Functions

static void WN2F_Load_Return_Reg (TOKEN_BUFFER tokens, TY_IDX return_ty, const char *var_name, STAB_OFFSET var_offset, MTYPE preg_mtype, PREG_IDX preg_offset, WN2F_CONTEXT context)
static void WN2F_Callsite_Directives (TOKEN_BUFFER tokens, WN *call_wn, ST *func_st)
static void WN2F_Function_Call_Lhs (TOKEN_BUFFER rhs_tokens, TY_IDX return_ty, WN2F_CONTEXT context)
static INTRINSIC WN2F_Get_Divfloor_Intr (MTYPE mtype)
static INTRINSIC WN2F_Get_Divceil_Intr (MTYPE mtype)
static WNWN2F_Get_DoLoop_StepSize (WN *step, ST *idx_var, STAB_OFFSET idx_ofst)
static UINT WN2F_LoopBound_VarRef (WN *wn, ST *st, STAB_OFFSET st_ofst, INT *ldid_in_kid, UINT level)
static void WN2F_Get_Next_LoopBoundOp (PARTIAL_OP *op, OPERATOR *comp_opr, BOOL *ok, WN *wn, INT idx_kid)
static DO_LOOP_BOUNDWN2F_Get_DoLoop_Bound (WN *end_test, ST *idx_var, STAB_OFFSET idx_ofst, WN *step_size)
static WN2F_STATUS WN2F_Translate_DoLoop_Bound (TOKEN_BUFFER tokens, DO_LOOP_BOUND *bound, WN2F_CONTEXT context)
static BOOL WN2F_Is_Loop_Region (const WN *region, WN2F_CONTEXT context)
static BOOL WN2F_Is_Parallel_Region (WN *region, WN2F_CONTEXT context)
static void WN2F_Prompf_Construct_Start (TOKEN_BUFFER tokens, WN *construct)
static void WN2F_Prompf_Construct_End (TOKEN_BUFFER tokens, WN *construct)
static void WN2F_Start_Prompf_Transformed_Loop (TOKEN_BUFFER tokens, WN *loop, WN2F_CONTEXT context)
static void WN2F_End_Prompf_Transformed_Loop (TOKEN_BUFFER tokens, WN *loop, WN2F_CONTEXT context)
static void WN2F_Start_Prompf_Transformed_Region (TOKEN_BUFFER tokens, WN *region, WN2F_CONTEXT context)
static void WN2F_End_Prompf_Transformed_Region (TOKEN_BUFFER tokens, WN *region, WN2F_CONTEXT context)
static void WN2F_Append_Symtab_Consts (TOKEN_BUFFER tokens, SYMTAB_IDX symtab, UINT lines_between_decls)
static void WN2F_Append_Symtab_Vars (TOKEN_BUFFER tokens, SYMTAB_IDX symtab, UINT lines_between_decls)
static void WN2F_Enter_PU_Block (void)
static void WN2F_Exit_PU_Block (TOKEN_BUFFER tokens, TOKEN_BUFFER *stmts)
void WN2F_Stmt_initialize (void)
void WN2F_Stmt_finalize (void)
BOOL WN2F_Skip_Stmt (WN *stmt)
void WN2F_Append_Block_Data (TOKEN_BUFFER tokens)
void WN2F_Append_Purple_Funcinfo (TOKEN_BUFFER tokens)
WN2F_STATUS WN2F_block (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_compgoto (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_do_loop (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_implied_do (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_do_while (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_while_do (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_if (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_goto (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_agoto (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_condbr (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_return (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_return_val (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_label (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_intrinsic_call (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_call (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_prefetch (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_eval (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_use_stmt (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_namelist_stmt (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_implicit_bnd (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_switch (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_casegoto (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_nullify_stmt (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_interface_blk (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_ar_construct (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_noio_implied_do (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)
WN2F_STATUS WN2F_idname (TOKEN_BUFFER tokens, WN *wn, WN2F_CONTEXT context)

Variables

WN_MAP W2F_Frequency_Map
WN_MAPW2F_Construct_Map
BOOL W2F_Prompf_Emission
BOOL W2F_Emit_Cgtag
TOKEN_BUFFER param_tokens
static const char WN2F_Purple_Region_Name [] = "prp___region"
static const char unnamed_interface [] = "unnamed interface"
static RETURNSITEWN2F_Next_ReturnSite = NULL
static CALLSITEWN2F_Prev_CallSite = NULL

Define Documentation

#define MAX_TEST_OPERATIONS   16

Definition at line 352 of file wn2f_stmt.cxx.

Referenced by WN2F_Get_DoLoop_Bound(), and WN2F_LoopBound_VarRef().

#define WN2F_Reverse_Bounds_Comparison (   comparison_opr)
Value:
(comparison_opr == OPR_GE? OPR_LE : \
    comparison_opr == OPR_LE? OPR_GE : \
    comparison_opr == OPR_GT? OPR_LT : \
    OPR_GT)

Definition at line 392 of file wn2f_stmt.cxx.

Referenced by WN2F_Get_DoLoop_Bound(), and WN2F_Get_Next_LoopBoundOp().

#define WN_pragma_nest (   wn)    WN_pragma_arg1(wn)

Definition at line 96 of file wn2f_stmt.cxx.

Referenced by WN2F_Is_Loop_Region().


Typedef Documentation

typedef struct Do_Loop_Bound DO_LOOP_BOUND
typedef struct Partial_Op PARTIAL_OP

Function Documentation

static void WN2F_Append_Symtab_Consts ( TOKEN_BUFFER  tokens,
SYMTAB_IDX  symtab,
UINT  lines_between_decls 
) [static]

Definition at line 1189 of file wn2f_stmt.cxx.

References Append_F77_Indented_Newline(), New_Token_Buffer(), NULL, ST2F_decl_translate(), W2F_File, W2F_FTN_FILE, W2F_LOC_FILE, and Write_And_Reclaim_Tokens().

Referenced by WN2F_Exit_PU_Block().

Here is the call graph for this function:

static void WN2F_Append_Symtab_Vars ( TOKEN_BUFFER  tokens,
SYMTAB_IDX  symtab,
UINT  lines_between_decls 
) [static]

Definition at line 1435 of file wn2f_stmt.cxx.

References For_all(), and St_Table.

Referenced by WN2F_Exit_PU_Block().

Here is the call graph for this function:

WN2F_STATUS WN2F_ar_construct ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 3458 of file wn2f_stmt.cxx.

References Append_Token_Special(), EMPTY_WN2F_STATUS, WN2F_translate(), WN_kid(), and WN_kid_count().

Here is the call graph for this function:

WN2F_STATUS WN2F_call ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 2506 of file wn2f_stmt.cxx.

References Append_And_Reclaim_Token_List(), Append_Token_Special(), Append_Token_String(), ASSERT_DBG_FATAL, ASSERT_DBG_WARN, CALLSITE_call, CALLSITE_next, Concat2_Strings(), DIAG_A_STRING, DIAG_W2F_UNEXPECTED_CALLSITE, DIAG_W2F_UNEXPECTED_CONTEXT, DIAG_W2F_UNEXPECTED_OPC, EMPTY_WN2F_STATUS, FALSE, fld_type_z, Unparse_Target::Func_Return_Character(), Unparse_Target::Func_Return_To_Param(), Unparse_Target::Func_Return_Type(), INTR_is_valtmp, KIND_VOID, MTYPE_M, New_Token_Buffer(), NULL, OPR_CALL, OPR_ICALL, OPR_IMPLICIT_BND, OPR_INTRINSIC_CALL, OPR_INTRINSIC_OP, OPR_LDA, OPR_PICCALL, Prepend_Token_String(), PU_prototype(), Pu_Table, PUinfo_Get_CallSites(), reset_WN2F_CONTEXT_has_no_arr_elmt, reset_WN2F_CONTEXT_no_parenthesis, set_WN2F_CONTEXT_has_no_arr_elmt, set_WN2F_CONTEXT_no_parenthesis, ST2F_FIRST_PARAM_IDX, ST2F_output_keyword(), ST2F_use_translate(), ST_name(), ST_pu(), ST_pu_type(), St_Table, ST_type(), TRUE, WN::ty_fields, TY_is_character(), TY_Is_Character_Reference(), TY_Is_Chararray_Reference(), TY_Is_Pointer(), TY_kind(), TY_mtype(), TY_pointed(), W2X_Unparse_Target, WN2F_Callsite_Directives(), WN2F_CONTEXT_io_stmt, WN2F_io_prefix_tokens(), WN2F_Offset_Memref(), WN2F_Stmt_Newline(), WN2F_String_Argument(), WN2F_translate(), WN_Get_Linenum(), WN_has_sym, WN_intrinsic(), WN_intrinsic_name(), WN_intrinsic_return_to_param(), WN_intrinsic_return_ty(), WN_kid(), WN_kid0(), WN_kid_count(), WN_opc_operator, WN_opcode(), WN_operator(), WN_Parm_By_Value, WN_st(), WN_Tree_Type(), and WN_ty().

Referenced by WN2F_intrinsic_call().

Here is the call graph for this function:

static void WN2F_Callsite_Directives ( TOKEN_BUFFER  tokens,
WN call_wn,
ST func_st 
) [static]

Definition at line 142 of file wn2f_stmt.cxx.

References Append_F77_Directive_Newline(), Append_Token_Special(), Append_Token_String(), ST2F_use_translate(), WN_Call_Dont_Inline, and WN_Call_Inline.

Referenced by WN2F_call().

Here is the call graph for this function:

static void WN2F_End_Prompf_Transformed_Loop ( TOKEN_BUFFER  tokens,
WN loop,
WN2F_CONTEXT  context 
) [static]

Definition at line 1137 of file wn2f_stmt.cxx.

References W2CF_Get_Parent(), WN2F_Is_Loop_Region(), and WN2F_Prompf_Construct_End().

Referenced by WN2F_do_loop(), WN2F_do_while(), and WN2F_while_do().

Here is the call graph for this function:

static void WN2F_End_Prompf_Transformed_Region ( TOKEN_BUFFER  tokens,
WN region,
WN2F_CONTEXT  context 
) [static]

Definition at line 1168 of file wn2f_stmt.cxx.

References WN2F_Is_Loop_Region(), WN2F_Is_Parallel_Region(), and WN2F_Prompf_Construct_End().

Here is the call graph for this function:

static void WN2F_Enter_PU_Block ( void  ) [static]

Definition at line 1450 of file wn2f_stmt.cxx.

References Data_Stmt_Tokens, New_Token_Buffer(), NULL, and PUinfo_Get_ReturnSites().

Referenced by WN2F_block().

Here is the call graph for this function:

static INTRINSIC WN2F_Get_Divceil_Intr ( MTYPE  mtype) [static]
static INTRINSIC WN2F_Get_Divfloor_Intr ( MTYPE  mtype) [static]
static WN* WN2F_Get_DoLoop_StepSize ( WN step,
ST idx_var,
STAB_OFFSET  idx_ofst 
) [static]

Definition at line 452 of file wn2f_stmt.cxx.

References ASSERT_DBG_FATAL, ASSERT_DBG_WARN, DIAG_W2F_UNEXPECTED_OPC, FALSE, NULL, OPR_ADD, OPR_LDID, OPR_STID, WN_kid0(), WN_kid1(), WN_offset(), WN_operator(), and WN_st().

Referenced by WN2F_do_loop().

Here is the call graph for this function:

WN2F_STATUS WN2F_implicit_bnd ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 3108 of file wn2f_stmt.cxx.

References Append_Token_Special(), and EMPTY_WN2F_STATUS.

Here is the call graph for this function:

static void WN2F_Load_Return_Reg ( TOKEN_BUFFER  tokens,
TY_IDX  return_ty,
const char *  var_name,
STAB_OFFSET  var_offset,
MTYPE  preg_mtype,
PREG_IDX  preg_offset,
WN2F_CONTEXT  context 
) [static]
static UINT WN2F_LoopBound_VarRef ( WN wn,
ST st,
STAB_OFFSET  st_ofst,
INT ldid_in_kid,
UINT  level 
) [static]

Definition at line 493 of file wn2f_stmt.cxx.

References MAX_TEST_OPERATIONS, OPR_ADD, OPR_DIV, OPR_LDID, OPR_MPY, OPR_NEG, OPR_SUB, WN_kid0(), WN_kid1(), WN_num_var_refs(), WN_offset(), WN_operator(), and WN_st().

Referenced by WN2F_Get_DoLoop_Bound().

Here is the call graph for this function:

WN2F_STATUS WN2F_noio_implied_do ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 3480 of file wn2f_stmt.cxx.

References Append_Token_Special(), EMPTY_WN2F_STATUS, WN2F_translate(), WN_kid(), WN_kid0(), and WN_kid1().

Here is the call graph for this function:

static void WN2F_Prompf_Construct_End ( TOKEN_BUFFER  tokens,
WN construct 
) [static]
static void WN2F_Prompf_Construct_Start ( TOKEN_BUFFER  tokens,
WN construct 
) [static]
WN2F_STATUS WN2F_return_val ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 2369 of file wn2f_stmt.cxx.

References Append_Token_String(), EMPTY_WN2F_STATUS, Is_True, NULL, OPR_LDID, OPR_RETURN_VAL, WN2F_Stmt_Newline(), WN2F_translate(), WN_Get_Linenum(), WN_kid0(), and WN_operator().

Here is the call graph for this function:

static void WN2F_Start_Prompf_Transformed_Loop ( TOKEN_BUFFER  tokens,
WN loop,
WN2F_CONTEXT  context 
) [static]

Definition at line 1123 of file wn2f_stmt.cxx.

References W2CF_Get_Parent(), WN2F_Is_Loop_Region(), and WN2F_Prompf_Construct_Start().

Referenced by WN2F_do_loop(), WN2F_do_while(), and WN2F_while_do().

Here is the call graph for this function:

static void WN2F_Start_Prompf_Transformed_Region ( TOKEN_BUFFER  tokens,
WN region,
WN2F_CONTEXT  context 
) [static]

Definition at line 1151 of file wn2f_stmt.cxx.

References WN2F_Is_Loop_Region(), WN2F_Is_Parallel_Region(), and WN2F_Prompf_Construct_Start().

Here is the call graph for this function:

void WN2F_Stmt_finalize ( void  )

Definition at line 1598 of file wn2f_stmt.cxx.

Referenced by WN2F_finalize().

void WN2F_Stmt_initialize ( void  )

Definition at line 1591 of file wn2f_stmt.cxx.

Referenced by WN2F_initialize().

WN2F_STATUS WN2F_switch ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 3117 of file wn2f_stmt.cxx.

References EMPTY_WN2F_STATUS, NULL, OPR_CASEGOTO, WN2F_Skip_Stmt(), WN2F_translate(), WN_first(), WN_kid0(), WN_kid1(), WN_kid2(), WN_kid_count(), WN_next(), WN_operator(), and WN_st_idx().

Here is the call graph for this function:

WN2F_STATUS WN2F_use_stmt ( TOKEN_BUFFER  tokens,
WN wn,
WN2F_CONTEXT  context 
)

Definition at line 3067 of file wn2f_stmt.cxx.

References EMPTY_WN2F_STATUS.


Variable Documentation

Definition at line 137 of file st2f.cxx.

Referenced by TY2C_prototype_params().

const char unnamed_interface[] = "unnamed interface" [static]

Definition at line 94 of file wn2f_stmt.cxx.

Referenced by WN2F_interface_blk().

Definition at line 159 of file w2f_driver.cxx.

Referenced by W2F_Process_Command_Line(), and WN2F_do_loop().

Definition at line 105 of file wn2f_stmt.cxx.

Definition at line 106 of file wn2f_stmt.cxx.

const char WN2F_Purple_Region_Name[] = "prp___region" [static]

Definition at line 93 of file wn2f_stmt.cxx.

Referenced by WN2F_Append_Purple_Funcinfo(), and WN2F_Exit_PU_Block().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines