osprey/be/whirl2c/w2c_driver.cxx File Reference

#include <sys/elf_whirl.h>
#include <time.h>
#include "whirl2c_common.h"
#include "config_clist.h"
#include "config_list.h"
#include "w2cf_parentize.h"
#include "file_util.h"
#include "flags.h"
#include "timing.h"
#include "wn_lower.h"
#include "PUinfo.h"
#include "ty2c.h"
#include "st2c.h"
#include "tcon2c.h"
#include "wn2c.h"
#include "w2c_driver.h"

Include dependency graph for w2c_driver.cxx:

Go to the source code of this file.

Defines

#define W2C_Extension(i)
#define W2C_MAX_SKIP_ITEMS   128
#define MAX_FNAME_LENGTH   256-7
#define MAX_ANL_FNAME_LENGTH   256-5

Functions/Subroutines

static void Process_Filename_Options (const char *src_filename, const char *irb_filename)
static FILEOpen_Read_File (const char *filename)
static FILEOpen_Append_File (const char *filename)
static FILEOpen_Create_File (const char *filename)
static void Close_File (const char *filename, FILE *afile)
static void Open_W2c_Output_File (W2C_FILE_KIND kind)
static void Close_W2c_Output_File (W2C_FILE_KIND kind)
static void Begin_New_Locations_File (void)
static void End_Locations_File (void)
static void Continue_Locations_File (void)
static void Move_Locations_To_Anl_File (const char *loc_fname)
static void W2C_Undo_Whirl_Side_Effects (void)
static void W2C_Enter_Global_Symbols (void)
static BOOL Check_Outfile_Initialized (const char *caller_name)
static BOOL Check_Initialized (const char *caller_name)
static BOOL Check_PU_Pushed (const char *caller_name)
BOOL W2C_Should_Emit_Nested_PUs (void)
void W2C_Process_Command_Line (INT phase_argc, const char *const phase_argv[], INT argc, const char *const argv[])
void W2C_Init (void)
void W2C_Push_PU (const WN *pu, WN *body_part_of_interest)
void W2C_Pop_PU (void)
void W2C_Mark_Loads (void)
void W2C_Nomark_Loads (void)
void W2C_Set_Prompf_Emission (const WN_MAP *construct_map)
void W2C_Set_Frequency_Map (WN_MAP frequency_map)
const char * W2C_Get_Transformed_Src_Path (void)
void W2C_Set_Purple_Emission (void)
void W2C_Reset_Purple_Emission (void)
void W2C_def_TY (FILE *outfile, TY_IDX ty)
void W2C_Translate_Global_Types (FILE *outfile)
void W2C_Translate_Global_Defs (FILE *outfile)
const char * W2C_Object_Name (const ST *func_st)
void W2C_Translate_Stid_Lhs (char *strbuf, UINT bufsize, const ST *stid_st, STAB_OFFSET stid_ofst, TY_IDX stid_ty, TYPE_ID stid_mtype)
void W2C_Translate_Istore_Lhs (char *strbuf, UINT bufsize, const WN *lhs, STAB_OFFSET istore_ofst, TY_IDX istore_ty_idx, TYPE_ID istore_mtype)
void W2C_Translate_Wn (FILE *outfile, const WN *wn)
void W2C_Translate_Wn_Str (char *strbuf, UINT bufsize, const WN *wn)
void W2C_Translate_Purple_Main (FILE *outfile, const WN *pu, const char *region_name)
void W2C_Fini (void)
void W2C_Outfile_Init (BOOL emit_global_decls)
void W2C_Outfile_Translate_Pu (WN *pu, BOOL emit_global_decls)
void W2C_Outfile_Fini (BOOL emit_global_decls)
void W2C_Cleanup (void)

Variables

static const char * W2C_File_Extension [W2C_NUM_FILES]
static const char * W2C_Cite_Extension [W2C_NUM_FILES]
static const char * W2C_Prompf_Extension [W2C_NUM_FILES]
static W2CF_SKIP_ITEM Skip [W2C_MAX_SKIP_ITEMS+1]
static INT Next_Skip_Item = 0
static BOOL W2C_Outfile_Initialized = FALSE
static BOOL W2C_Initialized = FALSE
static CONTEXT Global_Context = INIT_CONTEXT
static const char * W2C_Progname = ""
static const char * W2C_File_Name [W2C_NUM_FILES]
static BOOL File_Is_Created [W2C_NUM_FILES]
static MEM_POOL W2C_Parent_Pool
FILEW2C_File [W2C_NUM_FILES] = {NULL, NULL, NULL, NULL}
BOOL W2C_Enabled = TRUE
BOOL W2C_Verbose = TRUE
BOOL W2C_No_Pragmas = FALSE
BOOL W2C_Emit_Adims = FALSE
BOOL W2C_Emit_Prefetch = FALSE
BOOL W2C_Emit_All_Regions = TRUE
BOOL W2C_Emit_Linedirs = FALSE
BOOL W2C_Emit_Nested_PUs = FALSE
BOOL W2C_Emit_Frequency = FALSE
BOOL W2C_Emit_Cgtag = FALSE
BOOL W2C_Lower_Fortran = FALSE
BOOL W2C_Emit_Omp = FALSE
INT32 W2C_Line_Length = 0
BOOL W2C_Only_Mark_Loads = FALSE
BOOL W2C_Purple_Emission = FALSE
BOOL W2C_Prompf_Emission = FALSE
const WN_MAPW2C_Construct_Map = NULL
WN_MAP W2C_Frequency_Map = WN_MAP_UNDEFINED
BOOL W2C_Cplus_Initializer = FALSE


Define Documentation

#define MAX_ANL_FNAME_LENGTH   256-5

#define MAX_FNAME_LENGTH   256-7

#define W2C_Extension ( i   ) 

#define W2C_MAX_SKIP_ITEMS   128

Definition at line 133 of file w2c_driver.cxx.

Referenced by W2C_Push_PU().


Function Documentation

static void Begin_New_Locations_File ( void   )  [static]

static BOOL Check_Initialized ( const char *  caller_name  )  [static]

static BOOL Check_Outfile_Initialized ( const char *  caller_name  )  [static]

static BOOL Check_PU_Pushed ( const char *  caller_name  )  [static]

static void Close_File ( const char *  filename,
FILE afile 
) [static]

static void Close_W2c_Output_File ( W2C_FILE_KIND  kind  )  [static]

Definition at line 374 of file w2c_driver.cxx.

References Close_File(), NULL, W2C_File, and W2C_File_Name.

Referenced by End_Locations_File(), W2C_Cleanup(), and W2C_Outfile_Fini().

static void Continue_Locations_File ( void   )  [static]

static void End_Locations_File ( void   )  [static]

static void Move_Locations_To_Anl_File ( const char *  loc_fname  )  [static]

static FILE* Open_Append_File ( const char *  filename  )  [static]

Definition at line 312 of file w2c_driver.cxx.

References EC_IR_Open, ErrMsg(), errno, f, fopen, and NULL.

Referenced by Move_Locations_To_Anl_File(), Open_W2c_Output_File(), and Open_W2f_Output_File().

static FILE* Open_Create_File ( const char *  filename  )  [static]

Definition at line 327 of file w2c_driver.cxx.

References EC_IR_Open, ErrMsg(), errno, f, fopen, and NULL.

Referenced by Open_W2c_Output_File(), and Open_W2f_Output_File().

static FILE* Open_Read_File ( const char *  filename  )  [static]

Definition at line 297 of file w2c_driver.cxx.

References EC_IR_Open, ErrMsg(), errno, f, fopen, and NULL.

Referenced by Move_Locations_To_Anl_File().

static void Open_W2c_Output_File ( W2C_FILE_KIND  kind  )  [static]

static void Process_Filename_Options ( const char *  src_filename,
const char *  irb_filename 
) [static]

void W2C_Cleanup ( void   ) 

Definition at line 1290 of file w2c_driver.cxx.

void W2C_def_TY ( FILE outfile,
TY_IDX  ty 
)

static void W2C_Enter_Global_Symbols ( void   )  [static]

void W2C_Fini ( void   ) 

const char* W2C_Get_Transformed_Src_Path ( void   ) 

Definition at line 813 of file w2c_driver.cxx.

References W2C_DOTC_FILE, and W2C_File_Name.

Referenced by Anl_Init().

void W2C_Init ( void   ) 

void W2C_Mark_Loads ( void   ) 

Definition at line 784 of file w2c_driver.cxx.

References TRUE, and W2C_Only_Mark_Loads.

void W2C_Nomark_Loads ( void   ) 

Definition at line 791 of file w2c_driver.cxx.

References FALSE, and W2C_Only_Mark_Loads.

const char* W2C_Object_Name ( const ST func_st  ) 

void W2C_Outfile_Fini ( BOOL  emit_global_decls  ) 

void W2C_Outfile_Init ( BOOL  emit_global_decls  ) 

void W2C_Outfile_Translate_Pu ( WN pu,
BOOL  emit_global_decls 
)

void W2C_Pop_PU ( void   ) 

Definition at line 747 of file w2c_driver.cxx.

void W2C_Process_Command_Line ( INT  phase_argc,
const char *const   phase_argv[],
INT  argc,
const char *const   argv[] 
)

void W2C_Push_PU ( const WN pu,
WN body_part_of_interest 
)

Definition at line 715 of file w2c_driver.cxx.

void W2C_Reset_Purple_Emission ( void   ) 

Definition at line 827 of file w2c_driver.cxx.

References FALSE, and W2C_Purple_Emission.

void W2C_Set_Frequency_Map ( WN_MAP  frequency_map  ) 

Definition at line 806 of file w2c_driver.cxx.

References W2C_Frequency_Map.

Referenced by Post_LNO_Processing().

void W2C_Set_Prompf_Emission ( const WN_MAP construct_map  ) 

Definition at line 798 of file w2c_driver.cxx.

References TRUE, W2C_Construct_Map, and W2C_Prompf_Emission.

Referenced by load_components().

void W2C_Set_Purple_Emission ( void   ) 

Definition at line 820 of file w2c_driver.cxx.

References TRUE, and W2C_Purple_Emission.

BOOL W2C_Should_Emit_Nested_PUs ( void   ) 

Definition at line 625 of file w2c_driver.cxx.

References W2C_Emit_Nested_PUs.

Referenced by Post_LNO_Processing(), and Prompf_Emit_Whirl_to_Source().

void W2C_Translate_Global_Defs ( FILE outfile  ) 

void W2C_Translate_Global_Types ( FILE outfile  ) 

void W2C_Translate_Istore_Lhs ( char *  strbuf,
UINT  bufsize,
const WN lhs,
STAB_OFFSET  istore_ofst,
TY_IDX  istore_ty_idx,
TYPE_ID  istore_mtype 
)

void W2C_Translate_Purple_Main ( FILE outfile,
const WN pu,
const char *  region_name 
)

void W2C_Translate_Stid_Lhs ( char *  strbuf,
UINT  bufsize,
const ST stid_st,
STAB_OFFSET  stid_ofst,
TY_IDX  stid_ty,
TYPE_ID  stid_mtype 
)

void W2C_Translate_Wn ( FILE outfile,
const WN wn 
)

Definition at line 938 of file w2c_driver.cxx.

void W2C_Translate_Wn_Str ( char *  strbuf,
UINT  bufsize,
const WN wn 
)

static void W2C_Undo_Whirl_Side_Effects ( void   )  [static]


Variable Documentation

BOOL File_Is_Created[W2C_NUM_FILES] [static]

Initial value:

 
                                          {FALSE, FALSE, FALSE, FALSE}

Definition at line 145 of file w2c_driver.cxx.

Referenced by Open_W2c_Output_File(), Open_W2f_Output_File(), W2C_Fini(), and W2F_Fini().

CONTEXT Global_Context = INIT_CONTEXT [static]

Definition at line 141 of file w2c_driver.cxx.

INT Next_Skip_Item = 0 [static]

Definition at line 135 of file w2c_driver.cxx.

Referenced by W2C_Pop_PU(), W2C_Push_PU(), W2F_Pop_PU(), and W2F_Push_PU().

W2CF_SKIP_ITEM Skip[W2C_MAX_SKIP_ITEMS+1] [static]

Definition at line 134 of file w2c_driver.cxx.

Referenced by WN_TREE_ITER< PRE_ORDER, WHIRL >::Delete().

const char* W2C_Cite_Extension[W2C_NUM_FILES] [static]

Initial value:

 
{
   ".c",          
   "-after-lno.h",  
   "-after-lno.c",  
   ".loc"         
}

Definition at line 108 of file w2c_driver.cxx.

const WN_MAP* W2C_Construct_Map = NULL

Definition at line 171 of file w2c_driver.cxx.

Referenced by W2C_Enter_Global_Symbols(), W2C_Fini(), and WN2C_block().

Definition at line 156 of file w2c_driver.cxx.

Referenced by W2C_Fini(), W2C_Process_Command_Line(), and WN2C_region().

Definition at line 160 of file w2c_driver.cxx.

Referenced by W2C_Process_Command_Line(), and WN2C_do_loop().

Definition at line 157 of file w2c_driver.cxx.

Referenced by W2C_Fini(), W2C_Process_Command_Line(), and WN2C_Stmt_Newline().

BOOL W2C_Emit_Omp = FALSE

Definition at line 162 of file w2c_driver.cxx.

Referenced by W2C_Process_Command_Line(), and WN2C_is_omp().

BOOL W2C_Enabled = TRUE

Definition at line 151 of file w2c_driver.cxx.

Referenced by W2C_Fini(), and W2C_Process_Command_Line().

FILE* W2C_File[W2C_NUM_FILES] = {NULL, NULL, NULL, NULL}

const char* W2C_File_Extension[W2C_NUM_FILES] [static]

Initial value:

 
{
   ".c",       
   ".w2c.h",   
   ".w2c.c",   
   ".w2c.loc"  
}

Definition at line 99 of file w2c_driver.cxx.

const char* W2C_File_Name[W2C_NUM_FILES] [static]

WN_MAP W2C_Frequency_Map = WN_MAP_UNDEFINED

Definition at line 170 of file w2c_driver.cxx.

Referenced by W2C_Pop_PU(), W2C_Set_Frequency_Map(), and WN2C_Translate_Stmt_Sequence().

BOOL W2C_Initialized = FALSE [static]

Definition at line 140 of file w2c_driver.cxx.

Referenced by Check_Initialized(), W2C_Fini(), W2C_Init(), and W2C_Outfile_Init().

Definition at line 163 of file w2c_driver.cxx.

Referenced by W2C_Fini(), W2C_Init(), and W2C_Process_Command_Line().

BOOL W2C_Outfile_Initialized = FALSE [static]

Definition at line 147 of file w2c_driver.cxx.

const char* W2C_Progname = "" [static]

Definition at line 142 of file w2c_driver.cxx.

Referenced by W2C_Fini(), W2C_Outfile_Init(), and W2C_Process_Command_Line().

const char* W2C_Prompf_Extension[W2C_NUM_FILES] [static]

Initial value:

 
{
   ".c",   
   ".mh",  
   ".m",   
   ".anl_srcpos" 
}

Definition at line 117 of file w2c_driver.cxx.

BOOL W2C_Verbose = TRUE

Definition at line 152 of file w2c_driver.cxx.

Referenced by W2C_Fini(), W2C_Outfile_Init(), and W2C_Process_Command_Line().


Generated on Wed Apr 8 14:36:52 2009 for Open64 by  doxygen 1.5.6