GCC Middle and Back End API Reference
opts-global.c File Reference
#include "langhooks.h"
Include dependency graph for opts-global.c:

Typedefs

typedef const char * const_char_p

Functions

static char * write_langs ()
static void complain_wrong_lang (const struct cl_decoded_option *decoded, unsigned int lang_mask)
static void postpone_unknown_option_warning ()
void print_ignored_options ()
static bool unknown_option_callback ()
static bool lang_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostic_context *dc)
static void add_input_filename ()
static void read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded_options, unsigned int decoded_options_count, location_t loc, unsigned int lang_mask, const struct cl_option_handlers *handlers, diagnostic_context *dc)
static void dump_remap_tree_vectorizer_verbose ()
void init_options_once ()
void decode_cmdline_options_to_array_default_mask (unsigned int argc, const char **argv, struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count)
void set_default_handlers ()
void decode_options (struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded_options, unsigned int decoded_options_count, location_t loc, diagnostic_context *dc)
void handle_common_deferred_options ()

Variables

static vec< const_char_pignored_options
const char ** in_fnames
unsigned num_in_fnames
static unsigned int initial_lang_mask

Typedef Documentation

typedef const char* const_char_p
@verbatim Command line option handling.  Code involving global state that

should not be shared with the driver. Copyright (C) 2002-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.


Function Documentation

static void add_input_filename ( )
static
Handle FILENAME from the command line.   

References in_fnames, and num_in_fnames.

Referenced by read_cmdline_options().

static void complain_wrong_lang ( const struct cl_decoded_option decoded,
unsigned int  lang_mask 
)
static
void decode_cmdline_options_to_array_default_mask ( unsigned int  argc,
const char **  argv,
struct cl_decoded_option **  decoded_options,
unsigned int *  decoded_options_count 
)
Decode command-line options to an array, like
   decode_cmdline_options_to_array and with the same arguments but
   using the default lang_mask.   

References decode_cmdline_options_to_array(), and initial_lang_mask.

Referenced by toplev_main().

void decode_options ( struct gcc_options *  opts,
struct gcc_options *  opts_set,
struct cl_decoded_option decoded_options,
unsigned int  decoded_options_count,
location_t  loc,
diagnostic_context dc 
)
Parse command line options and set default flag values.  Do minimal
   options processing.  The decoded options are in *DECODED_OPTIONS
   and *DECODED_OPTIONS_COUNT; settings go in OPTS, OPTS_SET and DC;
   the options are located at LOC.   

References default_options_optimization(), finish_options(), initial_lang_mask, read_cmdline_options(), and set_default_handlers().

Referenced by toplev_main().

static void dump_remap_tree_vectorizer_verbose ( )
static
Handle -ftree-vectorizer-verbose=ARG by remapping it to -fopt-info.
   It remaps the old verbosity values as following:

   REPORT_NONE ==> No dump is output
   REPORT_VECTORIZED_LOCATIONS ==> "-optimized"
   REPORT_UNVECTORIZED_LOCATIONS ==> "-missed"

   Any higher verbosity levels get mapped to "-all" flags.   

References opt_info_switch_p().

Referenced by handle_common_deferred_options().

void init_options_once ( void  )
Initialize global options-related settings at start-up.   

References global_dc, initial_lang_mask, lang_hooks::initialize_diagnostics, and lang_hooks::option_lang_mask.

Referenced by toplev_main().

static bool lang_handle_option ( struct gcc_options *  opts,
struct gcc_options *  opts_set,
const struct cl_decoded_option decoded,
unsigned int  lang_mask,
int  kind,
location_t  loc,
const struct cl_option_handlers handlers,
diagnostic_context dc 
)
static
Handle a front-end option; arguments and return value as for
   handle_option.   

References cl_decoded_option::arg, cl_decoded_option::canonical_option_num_elements, global_dc, lang_hooks::handle_option, cl_decoded_option::opt_index, and cl_decoded_option::value.

Referenced by set_default_handlers().

static void postpone_unknown_option_warning ( )
static
Buffer the unknown option described by the string OPT.  Currently,
   we only complain about unknown -Wno-* options if they may have
   prevented a diagnostic. Otherwise, we just ignore them.  Note that
   if we do complain, it is only as a warning, not an error; passing
   the compiler an unrecognised -Wno-* option should never change
   whether the compilation succeeds or fails.   

Referenced by unknown_option_callback().

void print_ignored_options ( void  )
Produce a warning for each option previously buffered.   

References warning_at().

Referenced by toplev_main().

static void read_cmdline_options ( struct gcc_options *  opts,
struct gcc_options *  opts_set,
struct cl_decoded_option decoded_options,
unsigned int  decoded_options_count,
location_t  loc,
unsigned int  lang_mask,
const struct cl_option_handlers handlers,
diagnostic_context dc 
)
static
Handle the vector of command line options (located at LOC), storing
   the results of processing DECODED_OPTIONS and DECODED_OPTIONS_COUNT
   in OPTS and OPTS_SET and using DC for diagnostic state.  LANG_MASK
   contains has a single bit set representing the current language.
   HANDLERS describes what functions to call for the options.   

References add_input_filename(), cl_decoded_option::arg, base_of_path(), and read_cmdline_option().

Referenced by decode_options().

static bool unknown_option_callback ( )
static
Handle an unknown option DECODED, returning true if an error should
   be given.   

References cl_decoded_option::arg, cl_decoded_option::errors, and postpone_unknown_option_warning().

Referenced by set_default_handlers().

static char* write_langs ( )
static
Return a malloced slash-separated list of languages in MASK.   

References lang_names, len, and strlen().

Referenced by complain_wrong_lang().


Variable Documentation

vec<const_char_p> ignored_options
static
const char** in_fnames
Input file names.   

Referenced by add_input_filename().

unsigned int initial_lang_mask
static
Language mask determined at initialization.   

Referenced by decode_cmdline_options_to_array_default_mask(), decode_options(), init_options_once(), and set_default_handlers().

unsigned num_in_fnames
The count of input filenames.   

Referenced by add_input_filename().