OpenADFortTk (basic)
src/lib/support/Open64IRInterface/wn_attr.h File Reference
#include "Open64BasicTypes.h"
Include dependency graph for wn_attr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define IS_IO_NULL_OPR(wn)   ((WN_operator(wn) == OPR_INTCONST) && (WN_const_val(wn) == 0))
#define WN_IOITEM(x)   ((IOITEM) WN_io_item(x))
#define WN_IOSTMT(x)   ((IOSTATEMENT) WN_io_statement(x))
#define IS_IO_ITEM_IOU(item)   (WN_IOITEM(item) >= IOU_NONE && WN_IOITEM(item) <= IOU_INTERNAL)
#define IS_IO_ITEM_IOF(item)   ((WN_IOITEM(item) >= IOF_NONE && WN_IOITEM(item) <= IOF_CR_FMTSRC_DOPE))
#define IS_IO_ITEM_IOC(item)   (WN_IOITEM(item) >= IOC_ACCESS && WN_IOITEM(item) <= IOC_ERRFLAG)
#define IS_IO_ITEM_IOL(item)
#define INTR_is_adrtmp(intrn)
#define INTR_is_valtmp(intrn)
#define WN_Skip_Parm(arg)   ((arg)!=NULL && WN_operator(arg) == OPR_PARM? WN_kid0(arg) : arg)

Functions

TY_IDX WN_Tree_Type (const WN *wn)
TY_IDX Get_Field_Type (TY_IDX base, int field_id)
TY_IDX WN_GetRefObjType (const WN *wn)
TY_IDX WN_GetBaseObjType (const WN *wn)
TY_IDX WN_GetExprType (const WN *wn)
TY_IDX WN_Call_Type (const WN *wn)
TY_IDX WN_Call_Return_Type (const WN *wn)
INT WN_Call_First_Arg_Idx (const WN *wn)
INT WN_Call_Last_Arg_Idx (const WN *wn)
const char * WN_intrinsic_name (INTRINSIC intr_opc)
TY_IDX WN_intrinsic_return_ty (const WN *call)
BOOL WN_intrinsic_return_to_param (TY_IDX return_ty)
WN * WN_Get_PtrAdd_Intconst (WN *wn0, WN *wn1, TY_IDX pointed_ty)

Define Documentation

#define INTR_is_adrtmp (   intrn)
Value:
((intrn) == INTRN_U4I1ADRTMP || \
    (intrn) == INTRN_U4I2ADRTMP || \
    (intrn) == INTRN_U4I4ADRTMP || \
    (intrn) == INTRN_U4I8ADRTMP || \
    (intrn) == INTRN_U4F4ADRTMP || \
    (intrn) == INTRN_U4F8ADRTMP || \
    (intrn) == INTRN_U4FQADRTMP || \
    (intrn) == INTRN_U4C4ADRTMP || \
    (intrn) == INTRN_U4C8ADRTMP || \
    (intrn) == INTRN_U4CQADRTMP || \
    (intrn) == INTRN_U4VADRTMP  || \
    (intrn) == INTRN_U8I1ADRTMP || \
    (intrn) == INTRN_U8I2ADRTMP || \
    (intrn) == INTRN_U8I4ADRTMP || \
    (intrn) == INTRN_U8I8ADRTMP || \
    (intrn) == INTRN_U8F4ADRTMP || \
    (intrn) == INTRN_U8F8ADRTMP || \
    (intrn) == INTRN_U8FQADRTMP || \
    (intrn) == INTRN_U8C4ADRTMP || \
    (intrn) == INTRN_U8C8ADRTMP || \
    (intrn) == INTRN_U8CQADRTMP || \
    (intrn) == INTRN_U8VADRTMP)

an ADRTMP intrinsic opcode.

Definition at line 34 of file wn_attr.h.

Referenced by whirl2xaif::WN2F_String_Argument(), WN_GetExprType(), and WN_Tree_Type().

#define INTR_is_valtmp (   intrn)
Value:
((intrn) == INTRN_I4VALTMP || \
    (intrn) == INTRN_I8VALTMP || \
    (intrn) == INTRN_F4VALTMP || \
    (intrn) == INTRN_F8VALTMP || \
    (intrn) == INTRN_FQVALTMP || \
    (intrn) == INTRN_C4VALTMP || \
    (intrn) == INTRN_C8VALTMP || \
    (intrn) == INTRN_CQVALTMP)

a VALTMP intrinsic opcode

Definition at line 61 of file wn_attr.h.

Referenced by whirl2xaif::WN2F_String_Argument(), WN_GetExprType(), WN_Tree_Type(), and whirl2xaif::xlate_CALL().

#define IS_IO_ITEM_IOC (   item)    (WN_IOITEM(item) >= IOC_ACCESS && WN_IOITEM(item) <= IOC_ERRFLAG)

Definition at line 25 of file wn_attr.h.

Referenced by WN2F_ios_decode(), WN2F_ios_encode(), and whirl2xaif::xlate_IO_ITEM().

#define IS_IO_ITEM_IOF (   item)    ((WN_IOITEM(item) >= IOF_NONE && WN_IOITEM(item) <= IOF_CR_FMTSRC_DOPE))

Definition at line 23 of file wn_attr.h.

Referenced by WN2F_ios_read(), and whirl2xaif::xlate_IO_ITEM().

#define IS_IO_ITEM_IOL (   item)
Value:
((WN_IOITEM(item) >= IOL_ARRAY && WN_IOITEM(item) <= IOL_VAR) || \
    (WN_IOITEM(item) == IOL_DOPE))

Definition at line 27 of file wn_attr.h.

Referenced by xaif2whirl::XlateStmt::patchWN_IO_cray(), WN2F_ios_cr(), WN2F_ios_read(), WN2F_ios_rewrite(), WN2F_ios_write(), and whirl2xaif::xlate_IO_ITEM().

#define IS_IO_ITEM_IOU (   item)    (WN_IOITEM(item) >= IOU_NONE && WN_IOITEM(item) <= IOU_INTERNAL)
#define IS_IO_NULL_OPR (   wn)    ((WN_operator(wn) == OPR_INTCONST) && (WN_const_val(wn) == 0))

Access-macros and access-functions for obtaining attributes of WN trees for general use in translating WN to another language form (e.g. to C or Fortran). For the most part, this module supplements common/com/wn_core.h.

Definition at line 16 of file wn_attr.h.

Referenced by xlate_IO_ITEM_format().

#define WN_Skip_Parm (   arg)    ((arg)!=NULL && WN_operator(arg) == OPR_PARM? WN_kid0(arg) : arg)

Definition at line 71 of file wn_attr.h.

Referenced by whirl2xaif::WN2F_String_Argument().


Function Documentation

TY_IDX Get_Field_Type ( TY_IDX  base,
int  field_id 
)

Definition at line 318 of file wn_attr.cpp.

References ASSERT_FATAL, DIAG_A_STRING, and TY_Is_Structured().

Referenced by WN_get_tld_type(), WN_GetExprType(), and WN_Tree_Type().

Here is the call graph for this function:

INT WN_Call_First_Arg_Idx ( const WN *  wn)

Definition at line 612 of file wn_attr.cpp.

References Func_Return_Character(), Func_Return_To_Param(), WN_Call_Return_Type(), WN_Call_Type(), and WN_intrinsic_return_to_param().

Referenced by whirl2xaif::xlate_CALL().

Here is the call graph for this function:

INT WN_Call_Last_Arg_Idx ( const WN *  wn)

Definition at line 630 of file wn_attr.cpp.

Referenced by whirl2xaif::xlate_CALL().

TY_IDX WN_Call_Type ( const WN *  wn)

Definition at line 507 of file wn_attr.cpp.

References ASSERT_FATAL, and DIAG_A_STRING.

Referenced by WN_Call_First_Arg_Idx(), and WN_Call_Return_Type().

WN* WN_Get_PtrAdd_Intconst ( WN *  wn0,
WN *  wn1,
TY_IDX  pointed_ty 
)

Given the two operands of an ADD expression, see if this can be considered a pointer addition, and if it is return a pointer to an INTCONST that can be normalized w.r.t. the size of the pointed_ty; if the pointed_ty has size 1, then just return the integral expression operand when this should be considered a pointer addition; otherwise return NULL when this should not be considered a pointer addition.

Definition at line 759 of file wn_attr.cpp.

References TY_Is_Pointer(), and WN_Tree_Type().

Referenced by WN_Tree_Type().

Here is the call graph for this function:

TY_IDX WN_GetExprType ( const WN *  wn)

For expression sub trees get the type This is being introduced as a last resort to get around the inscrutable paths taken by WN_[Tree_|GetRefObj|GetBaseObj]Type

Definition at line 850 of file wn_attr.cpp.

References ASSERT_FATAL, DIAG_A_STRING, Get_Field_Type(), INTR_is_adrtmp, INTR_is_valtmp, Stab_Array_Of(), Stab_Get_Mload_Ty(), Stab_Pointer_To(), TY_Is_Array(), TY_Is_Pointer(), TY_Is_Structured(), WN_Call_Return_Type(), WN_Cvtl_Ty(), WN_get_tld_type(), WN_GetExprType(), WN_GetRefObjType(), WN_intrinsic_return_ty(), and WN_Tree_Type().

Referenced by WN2F_Intr_Funcall(), WN_Call_Return_Type(), WN_GetExprType(), whirl2xaif::xlate_BinaryOp(), and whirl2xaif::xlate_CALL().

Here is the call graph for this function:

const char* WN_intrinsic_name ( INTRINSIC  intr_opc)

The name of the function or macro representing the intrinsic. Special handling is needed when the name is NULL.

Definition at line 649 of file wn_attr.cpp.

References INTRN_high_level_name.

Referenced by Open64IRInterface::findBaseSymbol(), and IntrinsicInfo::intrinsicBaseName().

BOOL WN_intrinsic_return_to_param ( TY_IDX  return_ty)

TRUE when the given return type is returned through the first parameter; FALSE when returning through pregs.

Definition at line 750 of file wn_attr.cpp.

Referenced by WN_Call_First_Arg_Idx().

TY_IDX WN_intrinsic_return_ty ( const WN *  call)

Map the intrinsic code to a return type. If no return type is known, then use the result type of the OPCODE as the return type.

Definition at line 666 of file wn_attr.cpp.

References ASSERT_FATAL, DIAG_A_STRING, Stab_Mtype_To_Ty(), Stab_Pointer_To(), and WN_Tree_Type().

Referenced by WN_Call_Return_Type(), WN_GetExprType(), and WN_Tree_Type().

Here is the call graph for this function:

TY_IDX WN_Tree_Type ( const WN *  wn)

The TY_IDX denoting the type of a WN expression. For typeless WNs (e.g. statements), the TY will be "void" in C terminology. Similarly, there may be expression we cannot sensibly type, e.g. for MLOADs, in which case we return an inaccurate type. For MLOADs we return the type of a field at the given offset and of the given size, provided the size is known statically; otherwise we return the base-type. Returns a TY_IDX that as closely as possible represents the type of the given subexpression (wn). Supports calls (both as statements and expressions). Also supports stores, returning the type of the referenced object (possibly dereferencing a pointer type). Note: TY_is_logical() will only hold true when the TY is resolved from a WN_ty or ST_ty attribute, not when it is resolved from an MTYPE. Note: Pointer types may be created as a result of a call to this routine.

Definition at line 65 of file wn_attr.cpp.

References ASSERT_FATAL, DIAG_A_STRING, Get_Field_Type(), INTR_is_adrtmp, INTR_is_valtmp, Stab_Array_Of(), Stab_Get_Mload_Ty(), Stab_Pointer_To(), TY_Is_Array(), TY_Is_Pointer(), TY_Is_Structured(), WN_Call_Return_Type(), WN_Cvtl_Ty(), WN_Get_PtrAdd_Intconst(), WN_get_tld_type(), WN_GetRefObjType(), WN_intrinsic_return_ty(), and WN_Tree_Type().

Referenced by xaif2whirl::XlateStmt::createAssignment(), xaif2whirl::CreateCallToIntrin(), xaif2whirl::CreateIfCondition(), xaif2whirl::AdjustFunctions::forSubTree(), xaif2whirl::XlateExpression::getRType(), xaif2whirl::XlateExpression::getRTypeFromOpands(), whirl2xaif::IsActiveStmt(), IsVarRefTranslatableToXAIF(), whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_cvtl(), whirl2xaif::WN2F_Get_Substring_Info(), WN2F_Intr_Funcall(), WN2F_ios_definefile(), whirl2xaif::WN2F_mload(), whirl2xaif::WN2F_mstore(), whirl2xaif::WN2F_pstore(), whirl2xaif::WN2F_String_Argument(), WN_Get_PtrAdd_Intconst(), WN_get_tld_type(), WN_GetBaseObjType(), WN_GetExprType(), WN_intrinsic_return_ty(), WN_Tree_Type(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_CALL(), xaif2whirl::XlateExpression::xlate_ExprOpUsingIntrinsicTable(), xlate_IO_ITEM_control(), whirl2xaif::xlate_ScalarizedRefTab(), whirl2xaif::xlate_STRCTFLD(), xaif2whirl::XlateStmt::xlate_SubroutineCall(), and whirl2xaif::xlate_UnaryOp().

Here is the call graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines