OpenADFortTk (basic)
src/lib/support/Open64IRInterface/wn_attr.cpp File Reference
#include "Open64BasicTypes.h"
#include <sstream>
#include "stab_attr.h"
#include "wn_attr.h"
#include "IFDiagnostics.h"
#include "IntrinsicInfo.h"
Include dependency graph for wn_attr.cpp:

Go to the source code of this file.

Defines

#define INTRN_high_level_name   INTRN_specific_name

Functions

static TY_IDX WN_get_tld_type (const WN *wn)
static TY_IDX WN_Cvtl_Ty (const WN *wn)
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_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)
TY_IDX WN_GetExprType (const WN *wn)

Variables

static const MTYPE WN_Cvtl_Mtype [2][9]

Define Documentation

#define INTRN_high_level_name   INTRN_specific_name

INTRN_c_name() is only implemented when defined(BUILD_WHIRL2C), while we must use INTRN_specific_name() when defined(BUILD_WHIRL2F). To abstract away from this, we define the macro INTRN_high_level_name. NOT TRUE anymore, but keep this cause I'm not sure which they really want.

Definition at line 20 of file wn_attr.cpp.

Referenced by WN_intrinsic_name().


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().

static TY_IDX WN_Cvtl_Ty ( const WN *  wn) [static]

Definition at line 50 of file wn_attr.cpp.

References Stab_Mtype_To_Ty(), and WN_Cvtl_Mtype.

Referenced by WN_GetExprType(), and WN_Tree_Type().

Here is the call graph for this function:

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:

static TY_IDX WN_get_tld_type ( const WN *  wn) [static]

Definition at line 813 of file wn_attr.cpp.

References Get_Field_Type(), and WN_Tree_Type().

Referenced by WN_GetExprType(), and 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:


Variable Documentation

const MTYPE WN_Cvtl_Mtype[2][9] [static]
Initial value:
{
 {MTYPE_UNKNOWN,      
  MTYPE_U1,           
  MTYPE_U2,           
  MTYPE_UNKNOWN,      
  MTYPE_U4,           
  MTYPE_UNKNOWN,      
  MTYPE_UNKNOWN,      
  MTYPE_UNKNOWN,      
  MTYPE_U8},          
 
 {MTYPE_UNKNOWN,      
  MTYPE_I1,           
  MTYPE_I2,           
  MTYPE_UNKNOWN,      
  MTYPE_I4,           
  MTYPE_UNKNOWN,      
  MTYPE_UNKNOWN,      
  MTYPE_UNKNOWN,      
  MTYPE_I8}           
}

Definition at line 26 of file wn_attr.cpp.

Referenced by WN_Cvtl_Ty().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines