GCC Middle and Back End API Reference
lto-wrapper.c File Reference

Enumerations

enum  lto_mode_d {
  LTO_MODE_NONE, LTO_MODE_LTO, LTO_MODE_WHOPR, LTO_MODE_NONE,
  LTO_MODE_LTO, LTO_MODE_WHOPR
}

Functions

static void maybe_unlink_file (const char *)
static void lto_wrapper_cleanup ()
static void fatal_signal ()
static void __attribute__ ((format(printf, 1, 2)))
static struct pex_obj * collect_execute ()
static int collect_wait ()
static void maybe_unlink_file ()
static void fork_execute ()
static void get_options_from_collect_gcc_options (const char *collect_gcc, const char *collect_gcc_options, unsigned int lang_mask, struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count)
static void append_option (struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count, struct cl_decoded_option *option)
static void merge_and_complain (struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count, struct cl_decoded_option *fdecoded_options, unsigned int fdecoded_options_count)
static void run_gcc ()
int main ()

Variables

int debug
int verbose
static enum lto_mode_d lto_mode = LTO_MODE_NONE
static char * ltrans_output_file
static char * flto_out
static char * args_name
static unsigned int nr
static char ** input_names
static char ** output_names
static char * makefile

Enumeration Type Documentation

enum lto_mode_d
Enumerator:
LTO_MODE_NONE 
LTO_MODE_LTO 
LTO_MODE_WHOPR 
LTO_MODE_NONE 
LTO_MODE_LTO 
LTO_MODE_WHOPR 

Function Documentation

static void __attribute__ ( (format(printf, 1, 2))  )
static
Just die. CMSGID is the error message.  
Die when sys call fails. CMSGID is the error message.   

References lto_wrapper_cleanup().

static void append_option ( struct cl_decoded_option **  decoded_options,
unsigned int *  decoded_options_count,
struct cl_decoded_option option 
)
static
Append OPTION to the options array DECODED_OPTIONS with size
   DECODED_OPTIONS_COUNT.   

References memcpy().

Referenced by merge_and_complain().

static struct pex_obj* collect_execute ( )
staticread
Execute a program, and wait for the reply. ARGV are the arguments. The
   last one must be NULL.  

References errno, fatal(), and verbose.

static int collect_wait ( )
static
Wait for a process to finish, and exit if a nonzero status is found.
   PROG is the program name. PEX is the process we should wait for.  

References fatal(), and strsignal().

static void fatal_signal ( )
static

References lto_wrapper_cleanup().

Referenced by main().

static void fork_execute ( )
static
Execute program ARGV[0] with arguments ARGV. Wait for it to finish.   

References args_name, collect_execute(), collect_wait(), fatal(), free(), and maybe_unlink_file().

Referenced by run_gcc().

static void get_options_from_collect_gcc_options ( const char *  collect_gcc,
const char *  collect_gcc_options,
unsigned int  lang_mask,
struct cl_decoded_option **  decoded_options,
unsigned int *  decoded_options_count 
)
static
Create decoded options from the COLLECT_GCC and COLLECT_GCC_OPTIONS
   environment according to LANG_MASK.   

References decode_cmdline_options_to_array(), fatal(), and obstack.

Referenced by run_gcc().

static void lto_wrapper_cleanup ( )
static
static void maybe_unlink_file ( const char *  )
static
static void maybe_unlink_file ( )
static
Unlink a temporary LTRANS file unless requested otherwise.   

References debug, and errno.

static void merge_and_complain ( struct cl_decoded_option **  decoded_options,
unsigned int *  decoded_options_count,
struct cl_decoded_option fdecoded_options,
unsigned int  fdecoded_options_count 
)
static
Try to merge and complain about options FDECODED_OPTIONS when applied
   ontop of DECODED_OPTIONS.   

References append_option(), cl_options, fatal(), cl_option::flags, cl_decoded_option::opt_index, and cl_decoded_option::orig_option_with_args_text.

Referenced by run_gcc().


Variable Documentation

char* args_name
static
int debug
End of lto-streamer.h copy.   
char* flto_out
static

Referenced by lto_wrapper_cleanup(), and run_gcc().

char** input_names
static

Referenced by lto_wrapper_cleanup(), and run_gcc().

enum lto_mode_d lto_mode = LTO_MODE_NONE
static
Current LTO mode.   

Referenced by run_gcc().

char* ltrans_output_file
static

Referenced by lto_wrapper_cleanup(), and run_gcc().

char* makefile
static

Referenced by lto_wrapper_cleanup(), and run_gcc().

char** output_names
static

Referenced by lto_wrapper_cleanup(), and run_gcc().

int verbose

Referenced by collect_execute(), print_exp(), and run_gcc().