Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
st2c.cxx File Reference
#include "whirl2c_common.h"
#include "PUinfo.h"
#include "tcon2c.h"
#include "st2c.h"
#include "ty2c.h"
#include "init2c.h"
#include "unparse_target.h"
Include dependency graph for st2c.cxx:

Go to the source code of this file.

Classes

struct  Ty2c_List
struct  Common_Block
struct  Ty2c_List_Block

Defines

#define ST2C_COMPATIBLE_COMMON_BLOCK_TYPES(ty1, ty2)   Stab_Identical_Types(ty1, ty2, FALSE, TRUE, FALSE)
#define COMMON_BLOCK_MEMBER_NAME(num)   Concat2_Strings("u", Number_as_String(num, "%lld"))
#define TY2C_LIST_symtab_id(l)   ((l)->symtab_id)
#define TY2C_LIST_tokens(l)   ((l)->tokens)
#define TY2C_LIST_common_ty(l)   ((l)->common_ty)
#define TY2C_LIST_next(l)   ((l)->next)
#define COMMON_BLOCK_name(cb)   (cb)->name
#define COMMON_BLOCK_hash_value(cb)   (cb)->hash_value
#define COMMON_BLOCK_initializer(cb)   (cb)->initializer
#define COMMON_BLOCK_initialized(cb)   (cb)->initialized
#define COMMON_BLOCK_variations(cb)   (cb)->variations
#define COMMON_BLOCK_last_variation(cb)   (cb)->last_variation
#define COMMON_BLOCK_next(cb)   (cb)->next
#define COMMON_BLOCK_HASH_TABLE_SIZE   373
#define TY2C_LIST_BLOCK_SIZE   16
#define TY2C_LIST_BLOCK_element(tb, n)   &(tb)->element[n]
#define TY2C_LIST_BLOCK_next(tb)   (tb)->next

Typedefs

typedef void(* ST2C_HANDLER_FUNC )(TOKEN_BUFFER, const ST *, CONTEXT)
typedef struct Ty2c_List TY2C_LIST
typedef struct Common_Block COMMON_BLOCK
typedef struct Ty2c_List_Block TY2C_LIST_BLOCK

Functions

static void ST2C_ignore (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_decl_error (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_decl_var (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_decl_func (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_decl_const (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_use_error (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_use_var (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_use_func (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_use_const (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static BOOL In_Visible_Symtab (SYMTAB_IDX symtab, SYMTAB_IDX id)
static COMMON_BLOCKST2C_Find_Common_Block (const char *name, UINT64 hash_value)
static COMMON_BLOCKST2C_Get_Common_Block (const char *name, UINT64 hash_value)
static TY2C_LISTST2C_Get_Common_Ty2c_List (COMMON_BLOCK *common, mUINT32 symtab_id, const ST *common_st, TY_IDX ty)
static void ST2C_Define_A_Common_Block (TOKEN_BUFFER tokens, COMMON_BLOCK *common, CONTEXT context)
static const char * ST2C_Get_Common_Block_Name (const ST *st)
static void ST2C_formal_ref_decl (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_basic_decl (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
static void ST2C_Define_Preg (const char *name, TY_IDX ty, CONTEXT context)
void ST2C_initialize (CONTEXT context)
void ST2C_finalize (void)
void ST2C_decl_translate (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
void ST2C_weakext_translate (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
void ST2C_use_translate (TOKEN_BUFFER tokens, const ST *st, CONTEXT context)
void ST2C_func_header (TOKEN_BUFFER tokens, const ST *st, ST **params, CONTEXT context)
void ST2C_Use_Preg (TOKEN_BUFFER tokens, TY_IDX preg_ty, PREG_IDX preg_idx, CONTEXT context)
void ST2C_Declare_Tempvar (TY_IDX ty, UINT idx)
void ST2C_New_Common_Block (const ST *st)
void ST2C_Define_Common_Blocks (TOKEN_BUFFER tokens, CONTEXT context)

Variables

static const ST2C_HANDLER_FUNC ST2C_Decl_Handle [CLASS_COUNT]
static const ST2C_HANDLER_FUNC ST2C_Use_Handle [CLASS_COUNT]
static COMMON_BLOCKCommon_Block_Hash_Tbl [COMMON_BLOCK_HASH_TABLE_SIZE]
static TY2C_LIST_BLOCKST2C_Ty2c_List_Blocks = NULL
static TY2C_LISTST2C_Free_Ty2c_Lists = NULL

Define Documentation

#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
#define COMMON_BLOCK_initializer (   cb)    (cb)->initializer
#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_next (   cb)    (cb)->next
#define COMMON_BLOCK_variations (   cb)    (cb)->variations
#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,
 
)    &(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 Documentation

typedef struct Common_Block COMMON_BLOCK

Definition at line 165 of file st2c.cxx.

Definition at line 112 of file st2c.cxx.

typedef struct Ty2c_List TY2C_LIST

Definition at line 152 of file st2c.cxx.

Definition at line 189 of file st2c.cxx.


Function Documentation

static BOOL In_Visible_Symtab ( SYMTAB_IDX  symtab,
SYMTAB_IDX  id 
) [static]

Definition at line 203 of file st2c.cxx.

References tab.

Referenced by ST2C_Get_Common_Ty2c_List().

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

void ST2C_decl_translate ( TOKEN_BUFFER  tokens,
const ST st,
CONTEXT  context 
)
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().

Here is the call graph for this function:

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

Here is the call graph for this function:

static void ST2C_formal_ref_decl ( TOKEN_BUFFER  tokens,
const ST st,
CONTEXT  context 
) [static]
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().

Here is the call graph for this function:

static void ST2C_ignore ( TOKEN_BUFFER  tokens,
const ST st,
CONTEXT  context 
) [static]

Definition at line 572 of file st2c.cxx.

void ST2C_initialize ( CONTEXT  context)

Definition at line 712 of file st2c.cxx.

Referenced by W2C_Init().

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:


Variable Documentation

Initial value:

Definition at line 114 of file st2c.cxx.

Referenced by ST2C_decl_translate().

Definition at line 199 of file st2c.cxx.

Referenced by ST2C_Get_Common_Ty2c_List().

Definition at line 198 of file st2c.cxx.

Referenced by ST2C_finalize(), and ST2C_Get_Common_Ty2c_List().

Initial value:

Definition at line 125 of file st2c.cxx.

Referenced by ST2C_use_translate().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines