Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include "whirl2c_common.h"
#include "PUinfo.h"
#include "tcon2c.h"
#include "st2c.h"
#include "ty2c.h"
#include "init2c.h"
#include "unparse_target.h"
Go to the source code of this file.
#define COMMON_BLOCK_HASH_TABLE_SIZE 373 |
Definition at line 184 of file st2c.cxx.
Referenced by ST2C_Define_Common_Blocks(), ST2C_finalize(), ST2C_Find_Common_Block(), and ST2C_Get_Common_Block().
#define COMMON_BLOCK_hash_value | ( | cb | ) | (cb)->hash_value |
Definition at line 177 of file st2c.cxx.
Referenced by ST2C_Find_Common_Block(), and ST2C_Get_Common_Block().
#define COMMON_BLOCK_initialized | ( | cb | ) | (cb)->initialized |
Definition at line 179 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), ST2C_Get_Common_Block(), and ST2C_Get_Common_Ty2c_List().
#define COMMON_BLOCK_initializer | ( | cb | ) | (cb)->initializer |
Definition at line 178 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), ST2C_Get_Common_Block(), and ST2C_Get_Common_Ty2c_List().
#define COMMON_BLOCK_last_variation | ( | cb | ) | (cb)->last_variation |
Definition at line 181 of file st2c.cxx.
Referenced by ST2C_Get_Common_Block(), and ST2C_Get_Common_Ty2c_List().
#define COMMON_BLOCK_MEMBER_NAME | ( | num | ) | Concat2_Strings("u", Number_as_String(num, "%lld")) |
Definition at line 149 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block().
#define COMMON_BLOCK_name | ( | cb | ) | (cb)->name |
Definition at line 176 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), ST2C_finalize(), ST2C_Find_Common_Block(), ST2C_Get_Common_Block(), and ST2C_Get_Common_Block_Name().
#define COMMON_BLOCK_next | ( | cb | ) | (cb)->next |
Definition at line 182 of file st2c.cxx.
Referenced by ST2C_Define_Common_Blocks(), ST2C_finalize(), ST2C_Find_Common_Block(), and ST2C_Get_Common_Block().
#define COMMON_BLOCK_variations | ( | cb | ) | (cb)->variations |
Definition at line 180 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), ST2C_Get_Common_Block(), and ST2C_Get_Common_Ty2c_List().
#define ST2C_COMPATIBLE_COMMON_BLOCK_TYPES | ( | ty1, | |
ty2 | |||
) | Stab_Identical_Types(ty1, ty2, FALSE, TRUE, FALSE) |
Definition at line 89 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_BLOCK_element | ( | tb, | |
n | |||
) | &(tb)->element[n] |
Definition at line 195 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_BLOCK_next | ( | tb | ) | (tb)->next |
Definition at line 196 of file st2c.cxx.
Referenced by ST2C_finalize(), and ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_BLOCK_SIZE 16 |
Definition at line 188 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_common_ty | ( | l | ) | ((l)->common_ty) |
Definition at line 162 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_next | ( | l | ) | ((l)->next) |
Definition at line 163 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), and ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_symtab_id | ( | l | ) | ((l)->symtab_id) |
Definition at line 160 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
#define TY2C_LIST_tokens | ( | l | ) | ((l)->tokens) |
Definition at line 161 of file st2c.cxx.
Referenced by ST2C_Define_A_Common_Block(), and ST2C_Get_Common_Ty2c_List().
typedef struct Common_Block COMMON_BLOCK |
typedef void(* ST2C_HANDLER_FUNC)(TOKEN_BUFFER, const ST *, CONTEXT) |
typedef struct Ty2c_List_Block TY2C_LIST_BLOCK |
static BOOL In_Visible_Symtab | ( | SYMTAB_IDX | symtab, |
SYMTAB_IDX | id | ||
) | [static] |
static void ST2C_basic_decl | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 494 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Token_String(), CLASS_FUNC, Compile_Upc, CONTEXT_set_incomplete_ty2c, EXPORT_LOCAL, Unparse_Target::Func_Return_Type(), KIND_FUNCTION, KIND_STRUCT, New_Token_Buffer(), Prepend_Token_String(), PU_is_inline_function(), Pu_Table, SCLASS_CPLINIT, SCLASS_DISTR_ARRAY, SCLASS_EH_REGION, SCLASS_EH_REGION_SUPP, SCLASS_EXTERN, SCLASS_FSTATIC, SCLASS_PSTATIC, SCLASS_TEXT, ST_class(), ST_export(), ST_pu(), ST_pu_type(), ST_sclass(), ST_sym_class(), ST_type(), Stab_No_Linkage(), TY2C_translate(), TY_kind(), W2CF_Symtab_Nameof_St(), and W2X_Unparse_Target.
Referenced by ST2C_decl_const(), ST2C_decl_func(), and ST2C_decl_var().
static void ST2C_decl_const | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 632 of file st2c.cxx.
References Append_Token_Special(), CLASS_CONST, Is_True, ST2C_basic_decl(), ST_sym_class(), STC_val(), and TCON2C_translate().
static void ST2C_decl_error | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 579 of file st2c.cxx.
References FALSE, Is_True, and ST_sym_class().
static void ST2C_decl_func | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 621 of file st2c.cxx.
References CLASS_FUNC, Is_True, ST2C_basic_decl(), and ST_sym_class().
void ST2C_decl_translate | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) |
Definition at line 756 of file st2c.cxx.
References ST2C_Decl_Handle, and ST_sym_class().
Referenced by ST2C_func_header(), ST2C_weakext_translate(), WN2C_Append_Symtab_Consts(), WN2C_Append_Symtab_Vars(), WN2C_Declare_Return_Parameter(), and WN2C_translate_purple_main().
static void ST2C_decl_var | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 587 of file st2c.cxx.
References Append_Token_Special(), CLASS_VAR, CONTEXT_set_unqualified_ty2c, Find_INITO_For_Symbol(), INITO2C_translate(), Is_True, SCLASS_AUTO, SCLASS_FORMAL_REF, ST2C_basic_decl(), ST2C_formal_ref_decl(), ST_is_initialized(), ST_sclass(), ST_sym_class(), and Stab_No_Linkage().
void ST2C_Declare_Tempvar | ( | TY_IDX | ty, |
UINT | idx | ||
) |
Definition at line 926 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Indented_Newline(), Append_Token_Special(), Append_Token_String(), CONTEXT_reset, CONTEXT_set_unqualified_ty2c, Current_Indentation(), New_Token_Buffer(), PUinfo_local_decls, PUinfo_local_decls_indent, Set_Current_Indentation(), TY2C_translate(), and W2CF_Symtab_Nameof_Tempvar().
Referenced by WN2C_Append_Assignment(), WN2C_complex(), WN2C_const(), WN2C_Function_Call_Lhs(), WN2C_lda(), WN2C_ldid(), WN2C_mstore(), and WN2C_rcomma().
static void ST2C_Define_A_Common_Block | ( | TOKEN_BUFFER | tokens, |
COMMON_BLOCK * | common, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 369 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Token_Special(), COMMON_BLOCK_initialized, COMMON_BLOCK_initializer, COMMON_BLOCK_MEMBER_NAME, COMMON_BLOCK_name, COMMON_BLOCK_variations, New_Token_Buffer(), NULL, Prepend_And_Reclaim_Token_List(), TY2C_LIST_next, TY2C_LIST_tokens, and WHIRL2C_make_valid_c_name().
Referenced by ST2C_Define_Common_Blocks().
void ST2C_Define_Common_Blocks | ( | TOKEN_BUFFER | tokens, |
CONTEXT | context | ||
) |
Definition at line 977 of file st2c.cxx.
References Append_Indented_Newline(), COMMON_BLOCK_HASH_TABLE_SIZE, COMMON_BLOCK_next, NULL, and ST2C_Define_A_Common_Block().
Referenced by W2C_Outfile_Fini().
static void ST2C_Define_Preg | ( | const char * | name, |
TY_IDX | ty, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 549 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Indented_Newline(), Append_Token_Special(), Append_Token_String(), Current_Indentation(), New_Token_Buffer(), Prepend_Token_String(), PUinfo_local_decls, PUinfo_local_decls_indent, Set_Current_Indentation(), and TY2C_translate().
Referenced by ST2C_Use_Preg().
void ST2C_finalize | ( | void | ) |
Definition at line 719 of file st2c.cxx.
References COMMON_BLOCK_HASH_TABLE_SIZE, COMMON_BLOCK_name, COMMON_BLOCK_next, FREE, NULL, ST2C_Ty2c_List_Blocks, and TY2C_LIST_BLOCK_next.
Referenced by W2C_Fini().
static COMMON_BLOCK* ST2C_Find_Common_Block | ( | const char * | name, |
UINT64 | hash_value | ||
) | [static] |
Definition at line 213 of file st2c.cxx.
References COMMON_BLOCK_HASH_TABLE_SIZE, COMMON_BLOCK_hash_value, COMMON_BLOCK_name, COMMON_BLOCK_next, Is_True, Name_Hash_Idx(), and NULL.
Referenced by ST2C_Get_Common_Block().
static void ST2C_formal_ref_decl | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 478 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Token_String(), Is_True, New_Token_Buffer(), SCLASS_FORMAL_REF, ST_sclass(), ST_type(), Stab_Pointer_To(), TY2C_translate(), and W2CF_Symtab_Nameof_St().
Referenced by ST2C_decl_var().
void ST2C_func_header | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
ST ** | params, | ||
CONTEXT | context | ||
) |
Definition at line 793 of file st2c.cxx.
References Append_And_Reclaim_Token_List(), Append_Indented_Newline(), Append_Token_Special(), Append_Token_String(), Compile_Upc, CONTEXT_set_incomplete_ty2c, Decrement_Indentation(), FALSE, Unparse_Target::Func_Return_Type(), Increment_Indentation(), Is_True, New_Token_Buffer(), NULL, Prepend_Token_String(), PU_is_inline_function(), PU_is_mainpu(), Pu_Table, PUINFO_RETURN_TO_PARAM, SCLASS_EXTERN, SCLASS_FSTATIC, SCLASS_TEXT, Set_ST_type(), ST2C_decl_translate(), ST_pu(), ST_pu_type(), ST_sclass(), ST_type(), TY2C_translate(), TY_has_prototype(), TY_IDX_ZERO, TY_Is_Function(), TY_is_varargs(), TY_parms(), TYLIST_next(), Tylist_Table, W2CF_Symtab_Nameof_St(), and W2X_Unparse_Target.
Referenced by WN2C_func_entry().
static COMMON_BLOCK* ST2C_Get_Common_Block | ( | const char * | name, |
UINT64 | hash_value | ||
) | [static] |
Definition at line 235 of file st2c.cxx.
References COMMON_BLOCK_HASH_TABLE_SIZE, COMMON_BLOCK_hash_value, COMMON_BLOCK_initialized, COMMON_BLOCK_initializer, COMMON_BLOCK_last_variation, COMMON_BLOCK_name, COMMON_BLOCK_next, COMMON_BLOCK_variations, Name_Hash_Idx(), NULL, ST2C_Find_Common_Block(), strcpy, and TYPE_ALLOC_N.
Referenced by ST2C_Get_Common_Block_Name(), and ST2C_New_Common_Block().
static const char* ST2C_Get_Common_Block_Name | ( | const ST * | st | ) | [static] |
Definition at line 439 of file st2c.cxx.
References COMMON_BLOCK_name, CURRENT_SYMTAB, Get_Hash_Value_For_Name(), ST2C_Get_Common_Block(), ST2C_Get_Common_Ty2c_List(), ST_name(), ST_type(), and WHIRL2C_make_valid_c_name().
Referenced by ST2C_use_var().
static TY2C_LIST* ST2C_Get_Common_Ty2c_List | ( | COMMON_BLOCK * | common, |
mUINT32 | symtab_id, | ||
const ST * | common_st, | ||
TY_IDX | ty | ||
) | [static] |
Definition at line 264 of file st2c.cxx.
References Append_Token_Special(), Append_Token_String(), COMMON_BLOCK_initialized, COMMON_BLOCK_initializer, COMMON_BLOCK_last_variation, COMMON_BLOCK_variations, Current_Indentation(), CURRENT_SYMTAB, Find_INITO_For_Symbol(), In_Visible_Symtab(), Increment_Indentation(), INIT_CONTEXT, INITO2C_translate(), Is_True, New_Token_Buffer(), NULL, pshared_ptr_idx, Reset_TY_is_translated_to_c(), Set_Current_Indentation(), Set_TY_is_translated_to_c(), shared_ptr_idx, ST2C_COMPATIBLE_COMMON_BLOCK_TYPES, ST2C_Free_Ty2c_Lists, ST2C_Ty2c_List_Blocks, ST_is_initialized(), ST_name(), TY2C_LIST_BLOCK_element, TY2C_LIST_BLOCK_next, TY2C_LIST_BLOCK_SIZE, TY2C_LIST_common_ty, TY2C_LIST_next, TY2C_LIST_symtab_id, TY2C_LIST_tokens, TY2C_translate(), TY_name_idx(), Ty_Table, and TYPE_ALLOC_N.
Referenced by ST2C_Get_Common_Block_Name(), and ST2C_New_Common_Block().
static void ST2C_ignore | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
void ST2C_initialize | ( | CONTEXT | context | ) |
Definition at line 712 of file st2c.cxx.
Referenced by W2C_Init().
void ST2C_New_Common_Block | ( | const ST * | st | ) |
Definition at line 951 of file st2c.cxx.
References CURRENT_SYMTAB, Get_Hash_Value_For_Name(), Is_True, name, Set_TY_is_translated_to_c(), ST2C_Get_Common_Block(), ST2C_Get_Common_Ty2c_List(), ST_name(), ST_type(), and Stab_Is_Common_Block().
Referenced by WN2C_block().
static void ST2C_use_const | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 699 of file st2c.cxx.
References Append_Token_String(), CLASS_CONST, Is_True, ST_sym_class(), and W2CF_Symtab_Nameof_St().
static void ST2C_use_error | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 654 of file st2c.cxx.
References FALSE, Is_True, and ST_sym_class().
static void ST2C_use_func | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 689 of file st2c.cxx.
References Append_Token_String(), CLASS_FUNC, Is_True, Set_BE_ST_w2fc_referenced(), ST_sym_class(), Stab_External_Def_Linkage(), and W2CF_Symtab_Nameof_St().
void ST2C_Use_Preg | ( | TOKEN_BUFFER | tokens, |
TY_IDX | preg_ty, | ||
PREG_IDX | preg_idx, | ||
CONTEXT | context | ||
) |
Definition at line 902 of file st2c.cxx.
References Append_Token_String(), PUinfo_Is_Preg_Declared(), PUinfo_Preg_Type(), PUinfo_Set_Preg_Declared(), ST2C_Define_Preg(), and W2CF_Symtab_Nameof_Preg().
Referenced by Append_A_Clause_Symbol(), Append_Implicit_Locals(), Append_Nest_Clauses(), WN2C_Append_Preg(), WN2C_Function_Call_Lhs(), WN2C_Function_Return_Value(), WN2C_Load_Return_Reg(), and WN2C_Store_Return_Reg().
void ST2C_use_translate | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) |
Definition at line 786 of file st2c.cxx.
References ST2C_Use_Handle, and ST_sym_class().
Referenced by INITV2C_symoff(), ST2C_weakext_translate(), WN2C_call(), WN2C_Callsite_Directives(), WN2C_func_entry(), WN2C_lvalue_st(), and WN2C_process_pragma().
static void ST2C_use_var | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) | [static] |
Definition at line 662 of file st2c.cxx.
References Append_Token_String(), CLASS_VAR, Compile_Upc, Is_True, SCLASS_DGLOBAL, Set_BE_ST_w2fc_referenced(), ST2C_Get_Common_Block_Name(), ST_sclass(), ST_sym_class(), Stab_External_Def_Linkage(), Stab_Is_Common_Block(), and W2CF_Symtab_Nameof_St().
void ST2C_weakext_translate | ( | TOKEN_BUFFER | tokens, |
const ST * | st, | ||
CONTEXT | context | ||
) |
Definition at line 763 of file st2c.cxx.
References Append_Indented_Newline(), Append_Token_Special(), Append_Token_String(), CLASS_BLOCK, Has_Base_Block(), Is_True, ST2C_decl_translate(), ST2C_use_translate(), ST_base(), ST_is_weak_symbol(), ST_strong(), and ST_sym_class().
Referenced by WN2C_Append_Symtab_Vars().
const ST2C_HANDLER_FUNC ST2C_Decl_Handle[CLASS_COUNT] [static] |
{ &ST2C_ignore, &ST2C_decl_var, &ST2C_decl_func, &ST2C_decl_const, &ST2C_decl_error, &ST2C_decl_error, &ST2C_decl_error }
Definition at line 114 of file st2c.cxx.
Referenced by ST2C_decl_translate().
TY2C_LIST* ST2C_Free_Ty2c_Lists = NULL [static] |
Definition at line 199 of file st2c.cxx.
Referenced by ST2C_Get_Common_Ty2c_List().
TY2C_LIST_BLOCK* ST2C_Ty2c_List_Blocks = NULL [static] |
Definition at line 198 of file st2c.cxx.
Referenced by ST2C_finalize(), and ST2C_Get_Common_Ty2c_List().
const ST2C_HANDLER_FUNC ST2C_Use_Handle[CLASS_COUNT] [static] |
{ &ST2C_ignore, &ST2C_use_var, &ST2C_use_func, &ST2C_use_const, &ST2C_use_error, &ST2C_decl_error, &ST2C_decl_error }
Definition at line 125 of file st2c.cxx.
Referenced by ST2C_use_translate().