Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
wn_util.cxx File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "defs.h"
#include "stab.h"
#include "wn.h"
#include "wn_simp.h"
#include "opcode.h"
#include "wn_util.h"
#include "ir_reader.h"
#include "region_util.h"
Include dependency graph for wn_util.cxx:

Go to the source code of this file.

Functions

static WN_STACKWN_InitStack (void)
WNWN_Pop (WN_STACK *wns)
void WN_Push (WN *wn, WN_STACK *wns)
static void WN_FreeStack (WN_STACK *wns)
WN_ITERWN_WALK_TreeIter (WN *wn)
WN_ITERWN_WALK_SCFIter (WN *wn)
WN_ITERWN_WALK_StmtIter (WN *wn)
WN_ITERWN_WALK_TreeNext (WN_ITER *wni)
WN_ITERWN_WALK_StmtNext (WN_ITER *wni)
WN_ITERWN_WALK_SCFNext (WN_ITER *wni)
void WN_WALK_Abort (WN_ITER *wni)
void WN_INSERT_BlockBefore (WN *blck, WN *wn, WN *in)
void WN_INSERT_BlockAfter (WN *blck, WN *wn, WN *in)
WNWN_COPY_Tree (WN *wn)
void WN_COPY_All_Maps (WN *dst, WN *src)
WNWN_COPY_Tree_With_Map (WN *wn)
void WN_DELETE_Tree (WN *tree)
void WN_DELETE_FromBlock (WN *blck, WN *wn)
WNWN_EXTRACT_FromBlock (WN *parent, WN *item)
WNWN_EXTRACT_ItemsFromBlock (WN *parent, WN *first_item, WN *last_item)
static void wn_loop_get_st_ofst (const WN *var, ST_IDX &var_st, WN_OFFSET &var_offset)
static BOOL wn_loop_ref_matches_var (const WN *ref, ST_IDX st, WN_OFFSET ofst)
static OPCODE wn_loop_reverse_compare (OPCODE comparison)
WNWN_LOOP_InductionVariable (const WN *loop)
WNWN_LOOP_LowerBound (const WN *loop)
WNWN_LOOP_UpperBound (const WN *loop, OPCODE *compare)
WNWN_LOOP_Increment (const WN *loop, BOOL *is_incr)
WNWN_LOOP_TripCount (const WN *loop)
static TY_IDX field_type (const WN *wn)
TY_IDX WN_object_ty (const WN *wn)
INT32 WN_object_size (const WN *wn)
static BOOL Pragma_is_Parallel_Region (WN_PRAGMA_ID pragma)
static BOOL Pragma_is_Work_Sharing (WN_PRAGMA_ID pragma)
void Add_Pragma_To_MP_Regions (WN_VECTOR *wnv, WN_PRAGMA_ID pragma_id, ST *st, WN_OFFSET ofst, WN_MAP parent_map, BOOL make_compiler_generated)

Function Documentation

static TY_IDX field_type ( const WN wn) [static]

Definition at line 1199 of file wn_util.cxx.

References FLD_get_to_field(), FLD_type(), FLD_HANDLE::Is_Null(), Is_True, WN_field_id(), and WN_ty().

Referenced by parse_kind_selector(), parse_length_selector(), and WN_object_ty().

Here is the call graph for this function:

void WN_COPY_All_Maps ( WN dst,
WN src 
)

Definition at line 661 of file wn_util.cxx.

References wn_map_tab::_is_used, Current_Map_Tab, WN_CopyMap(), and WN_MAP_MAX.

Referenced by WN_COPY_Tree_With_Map().

Here is the call graph for this function:

WN* WN_COPY_Tree ( WN wn)

Definition at line 597 of file wn_util.cxx.

References Is_True, NULL, OPC_BLOCK, OPCODE_operator(), OPERATOR_FIRST, OPERATOR_LAST, WN_COPY_Tree(), WN_CopyNode(), WN_first(), WN_kid(), WN_kid_count(), WN_last(), WN_next(), WN_opcode(), and WN_prev().

Referenced by cleanUpPUInfo(), cwh_addr_adjust_array(), cwh_addr_do_bounds_check(), cwh_addr_extent(), cwh_addr_nonc_recast(), cwh_addr_pstid(), cwh_addr_stid(), cwh_addr_temp_section(), cwh_addr_ubound_from_triplet(), cwh_char_intrin(), cwh_convert_to_ty(), cwh_do_tranformational(), cwh_dope_from_expression(), cwh_dope_store(), cwh_expr_binop_shift(), cwh_expr_compare_char(), cwh_inline_allocate(), cwh_io_conv_array_to_dope(), cwh_io_conv_arrsection_to_dope(), cwh_io_split_io_items(), cwh_io_split_io_statement(), cwh_stk_push_top_item_again(), cwh_stmt_assigned_goto(), cwh_stmt_call_helper(), cwh_stmt_character_icall(), cwh_stmt_computed_goto(), cwh_stmt_insert_conformance_check(), cwh_stmt_select_case_char(), cwh_types_array_temp_TY(), DRA_EC_Array_Portion_Parms(), F90_Size_Walk(), fei_allocate(), fei_arith_goto(), fei_as_ref(), fei_concat(), fei_constant(), fei_doloop(), fei_islg(), fei_logb(), fei_mvbits(), fei_new_select(), fei_new_select_case(), fei_push_arith_con(), fei_set_dv_hdr_fld(), fei_sign_xfer(), fei_stop(), fei_substr(), fei_task_var(), Insert_Call(), MemCtr_Add_Local(), Rewrite_Pragmas_On_Structs(), Rewrite_Structs_In_MPRegion(), WN_COPY_Tree(), WN_Create_Shared_Load(), WN_Create_Shared_Store(), and WN_LOOP_TripCount().

Here is the call graph for this function:

WN* WN_EXTRACT_FromBlock ( WN parent,
WN item 
)

Definition at line 813 of file wn_util.cxx.

References Is_True, NULL, OPC_BLOCK, WN_first(), WN_last(), WN_next(), WN_opcode(), and WN_prev().

Referenced by WN_EXTRACT_ItemsFromBlock().

Here is the call graph for this function:

WN* WN_EXTRACT_ItemsFromBlock ( WN parent,
WN first_item,
WN last_item 
)

Definition at line 846 of file wn_util.cxx.

References Is_True, NULL, OPC_BLOCK, WN_EXTRACT_FromBlock(), WN_first(), WN_last(), WN_next(), WN_opcode(), and WN_prev().

Here is the call graph for this function:

static void WN_FreeStack ( WN_STACK wns) [static]
static WN_STACK* WN_InitStack ( void  ) [static]

-------------------------------------------------------------------

WN utility routines

-------------------------------------------------------------------

Definition at line 66 of file wn_util.cxx.

References Malloc_Mem_Pool, MEM_POOL_Alloc, WN_STACK_size, WN_STACK_sp, and WN_STACK_stack.

Referenced by WN_WALK_SCFIter(), WN_WALK_StmtIter(), and WN_WALK_TreeIter().

static void wn_loop_get_st_ofst ( const WN var,
ST_IDX var_st,
WN_OFFSET var_offset 
) [static]
WN* WN_LOOP_Increment ( const WN loop,
BOOL is_incr 
)

Definition at line 958 of file wn_util.cxx.

References NULL, OPC_DO_LOOP, WN_index, and WN_opcode().

Referenced by WN_LOOP_Increment(), WN_LOOP_LowerBound(), and WN_LOOP_UpperBound().

Here is the call graph for this function:

WN* WN_LOOP_LowerBound ( const WN loop)

Definition at line 977 of file wn_util.cxx.

References NULL, OPR_PSTID, OPR_STID, start, WN_kid0(), wn_loop_get_st_ofst(), WN_LOOP_InductionVariable(), WN_operator(), WN_st_idx(), WN_start, and WN_store_offset().

Referenced by WN_LOOP_TripCount().

Here is the call graph for this function:

static BOOL wn_loop_ref_matches_var ( const WN ref,
ST_IDX  st,
WN_OFFSET  ofst 
) [static]

Definition at line 920 of file wn_util.cxx.

References wn_loop_get_st_ofst().

Referenced by WN_LOOP_Increment(), and WN_LOOP_UpperBound().

Here is the call graph for this function:

static OPCODE wn_loop_reverse_compare ( OPCODE  comparison) [static]

Definition at line 933 of file wn_util.cxx.

References FALSE, FmtAssert, OPCODE_desc(), OPCODE_operator(), OPCODE_rtype(), OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, and OPR_NE.

Referenced by WN_LOOP_UpperBound().

Here is the call graph for this function:

WN* WN_LOOP_UpperBound ( const WN loop,
OPCODE compare 
)
WN* WN_Pop ( WN_STACK wns) [inline]

Definition at line 85 of file wn_util.cxx.

References NULL, WN_STACK_sp, and WN_STACK_stack.

Referenced by WN_WALK_SCFNext(), WN_WALK_StmtNext(), and WN_WALK_TreeNext().

void WN_Push ( WN wn,
WN_STACK wns 
) [inline]
void WN_WALK_Abort ( WN_ITER wni)

Definition at line 332 of file wn_util.cxx.

References FmtAssert, free(), NULL, WN_FreeStack(), and WN_ITER_stack.

Here is the call graph for this function:

Definition at line 144 of file wn_util.cxx.

References FmtAssert, OPCODE_is_scf(), OPERATOR_FIRST, OPERATOR_LAST, wn, WN_InitStack(), WN_ITER_stack, WN_ITER_wn, WN_opcode(), and WN_operator().

Here is the call graph for this function:

Definition at line 279 of file wn_util.cxx.

References free(), NULL, OPCODE_is_scf(), OPR_BLOCK, WN_FreeStack(), WN_ITER_stack, WN_ITER_wn, WN_kid(), WN_kid_count(), WN_last(), WN_opcode(), WN_operator(), WN_Pop(), WN_prev(), and WN_Push().

Here is the call graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines