Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <ctype.h>
#include <alloca.h>
#include <set>
#include <vector>
#include <string>
#include "whirl2f_common.h"
#include "PUinfo.h"
#include "tcon2f.h"
#include "wn2f.h"
#include "ty2f.h"
#include "st2f.h"
#include "init2f.h"
#include "cxx_memory.h"
#include "be_symtab.h"
#include "unparse_target.h"
#include "ty_ftn.h"
Go to the source code of this file.
typedef void(* ST2F_HANDLER_FUNC)(TOKEN_BUFFER, ST *) |
Definition at line 739 of file st2f.cxx.
References OPR_LDA, OPR_LDID, WN_kid(), WN_kid_count(), WN_opc_operator, and WN_st_idx().
Referenced by GetStSet().
Definition at line 754 of file st2f.cxx.
References collectst(), NULL, OPR_STID, ST_name(), ST_ptr(), WN_first(), WN_kid(), WN_next(), WN_operator(), and WN_st().
Referenced by ReorderParms().
bool haveCommonBlockName | ( | ST * | st | ) |
Definition at line 548 of file st2f.cxx.
References NULL, and ST_name().
Referenced by ST2F_use_var(), and WN2F_Exit_PU_Block().
void ReorderParms | ( | ST ** | parms, |
INT32 | num_params | ||
) |
Definition at line 771 of file st2f.cxx.
References ARB_const_lbnd(), ARB_const_ubnd(), ARB_dimension(), ARB_empty_lbnd(), ARB_empty_ubnd(), ARB_lbnd_var(), ARB_ubnd_var(), GetStSet(), KIND_ARRAY, KIND_POINTER, ST::st_idx, ST_is_temp_var(), St_Table, ST_type(), TY_arb(), TY_is_character(), TY_is_f90_deferred_shape(), TY_kind(), TY_pointed(), and Ty_Table.
Referenced by ST2F_func_header(), and WN2F_interface_blk().
static void ST2F_decl_const | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 526 of file st2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_SYMCLASS, FALSE, and ST_sym_class().
static void ST2F_decl_error | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 197 of file st2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_SYMCLASS, FALSE, and ST_sym_class().
static void ST2F_decl_func | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 484 of file st2f.cxx.
References Append_Token_String(), ASSERT_DBG_FATAL, CLASS_FUNC, DIAG_W2F_UNEXPECTED_SYMCLASS, EXPORT_LOCAL_INTERNAL, Unparse_Target::Func_Return_Type(), return(), SCLASS_EXTERN, ST2F_Declare_Return_Type(), ST_export(), ST_name(), ST_pu_type(), ST_sclass(), ST_sym_class(), W2CF_Symtab_Nameof_St(), and W2X_Unparse_Target.
static void ST2F_decl_parameter | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 438 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), New_Token_Buffer(), NULL, ST_base(), ST_is_private(), ST_name(), ST_type(), STC_val(), TCON2F_translate(), TY2F_Prepend_Structures(), TY2F_translate(), TY2F_Translate_Purple_Array(), TY_Is_Array(), TY_is_logical(), Use_Purple_Array_Bnds_Placeholder, and W2CF_Symtab_Nameof_St().
void ST2F_decl_translate | ( | TOKEN_BUFFER | tokens, |
const ST * | st | ||
) |
Definition at line 733 of file st2f.cxx.
References ST2F_Decl_Handler, and ST_sym_class().
Referenced by write_st::operator()(), WN2F_emit_commons::operator()(), ST2F_func_header(), W2F_def_ST(), WN2F_Append_Symtab_Consts(), WN2F_interface_blk(), and WN2F_translate_purple_main().
static void ST2F_decl_type | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 413 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), ASSERT_DBG_FATAL, CLASS_TYPE, Current_scope, DIAG_W2F_DECLARE_RETURN_PARAM, DIAG_W2F_UNEXPECTED_SYMCLASS, GLOBAL_SYMTAB, New_Token_Buffer(), PUINFO_RETURN_PARAM, PUINFO_RETURN_TO_PARAM, ST_sym_class(), ST_type(), TY2F_Prepend_Structures(), TY2F_translate(), TY2F_Translate_Purple_Array(), TY_Is_Array(), Use_Purple_Array_Bnds_Placeholder, and W2CF_Symtab_Nameof_St().
static void ST2F_decl_var | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 205 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), ASSERT_DBG_FATAL, CLASS_VAR, Concat3_Strings(), Current_scope, Data_Stmt_Tokens, DIAG_W2F_DECLARE_RETURN_PARAM, DIAG_W2F_UNEXPECTED_SYMCLASS, DIAG_W2F_UNEXPECTED_TYPE_KIND, FALSE, Find_INITO_For_Symbol(), GLOBAL_SYMTAB, INITO2F_translate(), KIND_FUNCTION, New_Token_Buffer(), NULL, PARAMETER2F_translate(), Prepend_Token_String(), PUINFO_RETURN_PARAM, PUINFO_RETURN_TO_PARAM, SCLASS_EXTERN, SCLASS_FORMAL, SCLASS_FSTATIC, SCLASS_PSTATIC, ST2F_Declare_Return_Type(), ST2F_Is_Dummy_Procedure(), ST_base(), ST_is_allocatable(), ST_is_f90_target(), ST_is_initialized(), ST_is_my_pointer(), ST_is_parameter(), ST_is_private(), ST_is_return_var(), ST_is_value_parm(), ST_name(), ST_sclass(), ST_sym_class(), ST_type(), Stab_Array_Of(), Stab_Is_Common_Block(), Stab_Is_Equivalence_Block(), Stab_No_Linkage(), TRUE, TY2F_Prepend_Structures(), TY2F_translate(), TY2F_Translate_Common(), TY2F_Translate_Equivalence(), TY2F_Translate_Purple_Array(), TY_IDX_ZERO, TY_Is_Array(), TY_is_f90_pointer(), TY_Is_Pointer(), TY_kind(), TY_pointed(), TY_ptr_as_array(), Ty_Table, TY_tylist(), Tylist_Table, TYLIST_type(), Use_Purple_Array_Bnds_Placeholder, and W2CF_Symtab_Nameof_St().
static void ST2F_Declare_Return_Type | ( | TOKEN_BUFFER | tokens, |
TY_IDX | return_ty, | ||
const char * | name | ||
) | [static] |
Definition at line 1252 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_String(), KIND_VOID, New_Token_Buffer(), NULL, Stab_Mtype_To_Ty(), TY2F_Prepend_Structures(), TY2F_translate(), TY_Is_Pointer(), TY_kind(), and TY_mtype().
Referenced by ST2F_decl_func(), and ST2F_decl_var().
void ST2F_Declare_Tempvar | ( | TY_IDX | ty, |
UINT | idx | ||
) |
Definition at line 1201 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_String(), Current_Indentation(), Current_scope, New_Token_Buffer(), NULL, Pointer_Mtype, PU_is_nested_func(), Pu_Table, PUinfo_local_decls, PUinfo_local_decls_indent, Scope_tab, Set_Current_Indentation(), ST_is_in_module(), ST_pu(), Stab_Mtype_To_Ty(), TY2F_translate(), TY_Is_Pointer(), and W2CF_Symtab_Nameof_Tempvar().
Referenced by INIT2F_Implied_DoLoop(), WN2F_do_while(), WN2F_Function_Call_Lhs(), WN2F_pstid(), and WN2F_stid().
static void ST2F_Define_Preg | ( | const char * | name, |
TY_IDX | ty | ||
) | [static] |
Definition at line 173 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_String(), Current_Indentation(), New_Token_Buffer(), NULL, PUinfo_local_decls, PUinfo_local_decls_indent, Set_Current_Indentation(), and TY2F_translate().
Referenced by ST2F_Use_Preg().
void ST2F_deref_translate | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) |
Definition at line 716 of file st2f.cxx.
References Append_Token_String(), ASSERT_DBG_FATAL, CLASS_VAR, DIAG_W2F_UNEXPECTED_SYMCLASS, Set_BE_ST_w2fc_referenced(), ST_sym_class(), ST_type(), Stab_Is_Based_At_Common_Or_Equivalence(), TY_Is_Pointer(), and W2CF_Symtab_Nameof_St_Pointee().
Referenced by WN2F_Offset_Symref().
void ST2F_finalize | ( | ) |
Definition at line 704 of file st2f.cxx.
Referenced by W2F_Fini().
void ST2F_func_header | ( | TOKEN_BUFFER | tokens, |
ST * | st, | ||
ST ** | params, | ||
INT32 | num_params, | ||
BOOL | is_altentry | ||
) |
Definition at line 895 of file st2f.cxx.
References Append_And_Reclaim_Token_List(), Append_F77_Indented_Newline(), Append_Token_Special(), Append_Token_String(), ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_SYMBOL, FALSE, Unparse_Target::Func_Return_Type(), Get_Current_PU(), KIND_ARRAY, KIND_FUNCTION, KIND_VOID, MTYPE_B, New_Token_Buffer(), NULL, OPR_USE, Prepend_Token_String(), PU_Body, PU_is_mainpu(), PU_is_nested_func(), PU_recursive(), Pu_Table, ReorderParms(), ST2F_decl_translate(), ST2F_FIRST_PARAM_IDX, ST_is_block_data(), ST_is_in_module(), ST_is_intent_in_argument(), ST_is_intent_out_argument(), ST_is_optional_argument(), ST_is_return_var(), ST_is_value_parm(), ST_pu(), ST_pu_type(), Stab_Mtype_To_Ty(), STAB_PARAM_HAS_IMPLICIT_LENGTH(), TRUE, TY2F_translate(), TY_AR_etype(), TY_is_character(), TY_Is_Pointer(), TY_kind(), TY_mtype(), W2CF_Symtab_Nameof_St(), W2X_Unparse_Target, wn, WN_first(), WN_kid(), WN_kid_count(), WN_next(), WN_operator(), WN_rtype(), and WN_st().
Referenced by WN2F_Entry_Point().
static void ST2F_ignore | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
void ST2F_initialize | ( | ) |
Definition at line 697 of file st2f.cxx.
Referenced by W2F_Init().
static BOOL ST2F_Is_Dummy_Procedure | ( | ST * | st | ) | [static] |
Definition at line 1233 of file st2f.cxx.
References dummy, FALSE, KIND_FUNCTION, KIND_POINTER, SCLASS_FORMAL, ST_is_value_parm(), ST_sclass(), ST_type(), TRUE, TY_kind(), and TY_pointed().
Referenced by ST2F_decl_var().
void ST2F_output_keyword | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) |
Definition at line 1279 of file st2f.cxx.
References Append_Token_String(), STC_val(), Targ_String_Address(), and Targ_String_Length().
Referenced by WN2F_call(), and WN2F_parm().
static void ST2F_use_block | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 679 of file st2f.cxx.
References Append_Token_String(), ASSERT_DBG_FATAL, CLASS_BLOCK, DIAG_W2F_UNEXPECTED_SYMCLASS, ST_name(), and ST_sym_class().
static void ST2F_use_const | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 654 of file st2f.cxx.
References ASSERT_DBG_FATAL, CLASS_CONST, DIAG_W2F_UNEXPECTED_SYMCLASS, MTYPE_STR, ST_sym_class(), ST_type(), STC_val(), TCON2F_hollerith(), TCON2F_translate(), TY_align(), TY_is_logical(), TY_mtype(), and Ty_Table.
static void ST2F_use_error | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 541 of file st2f.cxx.
References ASSERT_DBG_FATAL, DIAG_W2F_UNEXPECTED_SYMCLASS, FALSE, and ST_sym_class().
static void ST2F_use_func | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 643 of file st2f.cxx.
References Append_Token_String(), ASSERT_DBG_FATAL, CLASS_FUNC, DIAG_W2F_UNEXPECTED_SYMCLASS, Set_BE_ST_w2fc_referenced(), ST_sym_class(), and W2CF_Symtab_Nameof_St().
void ST2F_Use_Preg | ( | TOKEN_BUFFER | tokens, |
TY_IDX | preg_ty, | ||
PREG_IDX | preg_idx | ||
) |
Definition at line 1178 of file st2f.cxx.
References Append_Token_String(), PUinfo_Is_Preg_Declared(), PUinfo_Preg_Type(), PUinfo_Set_Preg_Declared(), ST2F_Define_Preg(), and W2CF_Symtab_Nameof_Preg().
Referenced by Append_A_Clause_Symbol(), Append_Implicit_Locals(), Append_Nest_Clauses(), W2F_Translate_Stid_Lhs(), WN2F_Function_Call_Lhs(), WN2F_ldid(), WN2F_Load_Return_Reg(), WN2F_pstid(), WN2F_return(), and WN2F_stid().
void ST2F_use_translate | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) |
Definition at line 710 of file st2f.cxx.
References ST2F_Use_Handler, and ST_sym_class().
Referenced by WN2F_Block(), WN2F_call(), WN2F_Callsite_Directives(), WN2F_casegoto(), WN2F_Function_Call_Lhs(), WN2F_Offset_Symref(), WN2F_process_pragma(), and WN2F_return().
static void ST2F_use_var | ( | TOKEN_BUFFER | tokens, |
ST * | st | ||
) | [static] |
Definition at line 564 of file st2f.cxx.
References Append_Token_Special(), Append_Token_String(), ASSERT_DBG_FATAL, CLASS_VAR, Concat3_Strings(), DIAG_W2F_UNEXPECTED_SYMCLASS, haveCommonBlockName(), INIT_WN2F_CONTEXT, KIND_SCALAR, PUINFO_FUNC_NAME, PUINFO_RETURN_PARAM, PUINFO_RETURN_TO_PARAM, PUINFO_RETURN_TY, SCLASS_EXTERN, Set_BE_ST_w2fc_referenced(), ST_base(), ST_is_return_var(), ST_is_temp_var(), ST_keep_name_w2f(), ST_name(), ST_ofst(), ST_sclass(), ST_sym_class(), ST_type(), Stab_Is_Based_At_Common_Or_Equivalence(), Stab_Pointer_To(), TY_kind(), TY_name(), W2CF_Symtab_Nameof_St(), WHIRL2F_make_valid_name(), WN2F_F90_pu, and WN2F_Offset_Symref().
Definition at line 137 of file st2f.cxx.
Referenced by TY2C_prototype_params().
Definition at line 94 of file wn2f.cxx.
Referenced by ST2F_func_header(), and TY2F_Append_Array_Bnd_Ph().
const ST2F_HANDLER_FUNC ST2F_Decl_Handler[CLASS_COUNT] [static] |
{ &ST2F_ignore, &ST2F_decl_var, &ST2F_decl_func, &ST2F_decl_const, &ST2F_decl_error, &ST2F_decl_error, &ST2F_decl_error, &ST2F_decl_error, &ST2F_decl_type, &ST2F_decl_parameter, }
Definition at line 144 of file st2f.cxx.
Referenced by ST2F_decl_translate().
const ST2F_HANDLER_FUNC ST2F_Use_Handler[CLASS_COUNT] [static] |
{ &ST2F_ignore, &ST2F_use_var, &ST2F_use_func, &ST2F_use_const, &ST2F_use_error, &ST2F_use_block, &ST2F_use_error }
Definition at line 158 of file st2f.cxx.
Referenced by ST2F_use_translate().
Definition at line 70 of file ty2f.cxx.
Referenced by ST2F_decl_parameter(), ST2F_decl_type(), ST2F_decl_var(), and WN2F_translate_purple_main().