#include <string.h>#include "defs.h"#include "flags.h"#include "erglob.h"#include "tracing.h"#include "config.h"

Go to the source code of this file.
Data Types | |
| union | optval |
| type | odesc_aux |
| type | ogroup_aux |
Defines | |
| #define | ODESC_orig_specified(o) ((o)->aux) |
| #define | ODESC_aux(o) ((ODESC_AUX *)((o)->aux)) |
| #define | Set_ODESC_aux(o, a) (((o)->aux)=(ODESC_AUX *)(a)) |
| #define | ODF_SET_USER 0x01 |
| #define | ODF_SET_INT 0x02 |
| #define | ODF_SET 0x03 |
| #define | ODF_MOD_USER 0x04 |
| #define | ODF_MOD_INT 0x08 |
| #define | ODF_MOD 0x0c |
| #define | ODF_PRINT 0x10 |
| #define | ODF_PRINTED 0x20 |
| #define | ODA_flags(o) ((o)->flags) |
| #define | ODA_specified(o) ((o)->specified) |
| #define | ODESC_specified(o) ODA_specified(ODESC_aux(o)) |
| #define | ODA_primary(o) ((o)->primary) |
| #define | ODESC_primary(o) ODA_primary(ODESC_aux(o)) |
| #define | ODA_orig(o) ((o)->orig) |
| #define | ODA_orig_i(o) ((o)->orig.i) |
| #define | ODA_orig_p(o) ((o)->orig.p) |
| #define | ODA_last(o) ((o)->last) |
| #define | ODA_last_i(o) ((o)->last.i) |
| #define | ODA_last_p(o) ((o)->last.p) |
| #define | ODA_set_user(o) (ODA_flags(o) & ODF_SET_USER) |
| #define | Set_ODA_set_user(o) (ODA_flags(o) |= ODF_SET_USER) |
| #define | Reset_ODA_set_user(o) (ODA_flags(o) &= ~ODF_SET_USER) |
| #define | ODA_set_int(o) (ODA_flags(o) & ODF_SET_INT) |
| #define | Set_ODA_set_int(o) (ODA_flags(o) |= ODF_SET_INT) |
| #define | Reset_ODA_set_int(o) (ODA_flags(o) &= ~ODF_SET_INT) |
| #define | Set_ODA_set(o) (ODA_flags(o) |= ODF_SET) |
| #define | ODA_mod_user(o) (ODA_flags(o) & ODF_MOD_USER) |
| #define | Set_ODA_mod_user(o) (ODA_flags(o) |= ODF_MOD_USER) |
| #define | Reset_ODA_mod_user(o) (ODA_flags(o) &= ~ODF_MOD_USER) |
| #define | ODA_mod_int(o) (ODA_flags(o) & ODF_MOD_INT) |
| #define | Set_ODA_mod_int(o) (ODA_flags(o) |= ODF_MOD_INT) |
| #define | Reset_ODA_mod_int(o) (ODA_flags(o) &= ~ODF_MOD_INT) |
| #define | Set_ODA_mod(o) (ODA_flags(o) |= ODF_MOD) |
| #define | ODA_print(o) (ODA_flags(o) & ODF_PRINT) |
| #define | Set_ODA_print(o) (ODA_flags(o) |= ODF_PRINT) |
| #define | Reset_ODA_print(o) (ODA_flags(o) &= ~ODF_PRINT) |
| #define | ODA_printed(o) (ODA_flags(o) & ODF_PRINTED) |
| #define | Set_ODA_printed(o) (ODA_flags(o) |= ODF_PRINTED) |
| #define | Reset_ODA_printed(o) (ODA_flags(o) &= ~ODF_PRINTED) |
| #define | OGROUP_aux(o) ((OGROUP_AUX *)((o)->aux)) |
| #define | Set_OGROUP_aux(o, a) (((o)->aux)=(OGROUP_AUX *)(a)) |
| #define | OGF_SET 0x01 |
| #define | OGF_INTERNAL 0x02 |
| #define | OGA_flags(o) ((o)->flags) |
| #define | OGA_count(o) ((o)->count) |
| #define | OGA_odesc_aux(o) ((o)->odesc_aux) |
| #define | OGA_set(o) (OGA_flags(o) & OGF_SET) |
| #define | Set_OGA_set(o) (OGA_flags(o) |= OGF_SET) |
| #define | Reset_OGA_set(o) (OGA_flags(o) &= ~OGF_SET) |
| #define | OGA_internal(o) (OGA_flags(o) & OGF_INTERNAL) |
| #define | Set_OGA_internal(o) (OGA_flags(o) |= OGF_INTERNAL) |
| #define | Reset_OGA_internal(o) (OGA_flags(o) &= ~OGF_INTERNAL) |
| #define | individual_option(opt, str) |
Typedefs | |
| typedef union optval | OPTVAL |
| typedef struct odesc_aux | ODESC_AUX |
| typedef struct ogroup_aux | OGROUP_AUX |
Functions/Subroutines | |
| INT64 | Get_Numeric_Flag (char **cp, INT64 min, INT64 max, INT64 def, char *flag) |
| BOOL | Atoi_KMG (const char *s, INT64 *val, BOOL suffix_required) |
| static INT | Copy_option (OPTION_DESC *odesc, char *container, BOOL save) |
| static void | Duplicate_Value (OPTION_DESC *odesc, OPTVAL *container) |
| static void | Initialize_Option_Group (OPTION_GROUP *ogroup) |
| void | Set_Option_Internal (OPTION_GROUP *ogroup, const char *name) |
| void | Initialize_Option_Groups (OPTION_GROUP *ogroups) |
| static void | Update_Scalar_Value (OPTION_DESC *odesc, UINT64 val) |
| static void | Update_Pointer_Value (OPTION_DESC *odesc, void *val) |
| BOOL | Process_Command_Line_Group (char *flag, OPTION_GROUP *opt_groups) |
| static BOOL | Modified_Option (OPTION_DESC *odesc) |
| void | Print_Option_Group (FILE *tf, OPTION_GROUP *og, const char *prefix, BOOL internal, BOOL full, BOOL update) |
| void | Trace_Option_Group (FILE *tf, OPTION_GROUP *og, BOOL full) |
| void | Trace_Command_Line_Group (FILE *tf, OPTION_GROUP *og) |
| void | Print_Option_Groups (FILE *tf, OPTION_GROUP *og, const char *prefix, BOOL internal, BOOL full, BOOL update) |
| void | Trace_Option_Groups (FILE *tf, OPTION_GROUP *og, BOOL full) |
| OPTION_GROUP * | Get_Command_Line_Group (OPTION_GROUP *og, const char *name) |
| void | Save_or_restore_options (char *memory, INT32 size, BOOL save) |
Variables | |
| char * | SBar |
Value:
ODESC_kind(&odesc) = OVK_INT32; \ ODESC_variable(&odesc) = (void *)&opt; \ ODESC_can_change_by_pragma(&odesc) = TRUE; \ incr = Copy_option(&odesc, (char *)(memory+offset), save); \ offset += incr; \ Is_Trace(trace, (TFile, " %s %d: %s (%d bytes)\n", \ save ? "saving" : "restoring", offset, str, incr));
Definition at line 1298 of file flags.c.
Referenced by Save_or_restore_options().
Definition at line 263 of file flags.c.
Referenced by Modified_Option(), and Update_Pointer_Value().
Definition at line 254 of file flags.c.
Referenced by Initialize_Option_Group(), and Process_Command_Line_Group().
Definition at line 228 of file flags.c.
Referenced by Initialize_Option_Group(), Modified_Option(), Print_Option_Group(), Process_Command_Line_Group(), Update_Pointer_Value(), and Update_Scalar_Value().
Definition at line 301 of file flags.c.
Referenced by Initialize_Option_Group(), and Save_or_restore_options().
Definition at line 302 of file flags.c.
Referenced by Initialize_Option_Group(), and Save_or_restore_options().
| #define OGROUP_aux | ( | o | ) | ((OGROUP_AUX *)((o)->aux)) |
Definition at line 288 of file flags.c.
Referenced by Initialize_Option_Group(), Print_Option_Group(), Save_or_restore_options(), and Set_Option_Internal().
Definition at line 277 of file flags.c.
Referenced by Process_Command_Line_Group(), Update_Pointer_Value(), and Update_Scalar_Value().
Definition at line 270 of file flags.c.
Referenced by Process_Command_Line_Group(), Update_Pointer_Value(), and Update_Scalar_Value().
| #define Set_OGROUP_aux | ( | o, | |||
| a | ) | (((o)->aux)=(OGROUP_AUX *)(a)) |
| typedef struct ogroup_aux OGROUP_AUX |
| static INT Copy_option | ( | OPTION_DESC * | odesc, | |
| char * | container, | |||
| BOOL | save | |||
| ) | [static] |
Definition at line 317 of file flags.c.
References BOOL, INT32, INT64, Is_True, ODESC_can_change_by_pragma, ODESC_kind, ODESC_variable, OVK_BOOL, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_NONE, OVK_SELF, OVK_UINT32, OVK_UINT64, UINT32, and UINT64.
Referenced by Save_or_restore_options().
| static void Duplicate_Value | ( | OPTION_DESC * | odesc, | |
| OPTVAL * | container | |||
| ) | [static] |
Definition at line 398 of file flags.c.
References BOOL, optval::i, INT32, INT64, ODESC_kind, ODESC_variable, OVK_BOOL, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_NONE, OVK_SELF, OVK_UINT32, OVK_UINT64, optval::p, UINT32, and UINT64.
Referenced by Initialize_Option_Group().
| OPTION_GROUP* Get_Command_Line_Group | ( | OPTION_GROUP * | og, | |
| const char * | name | |||
| ) |
Definition at line 1284 of file flags.c.
References i, INT32, NULL, OGROUP_name, and strcmp().
Referenced by Preconfigure(), and OPTIONS_STACK::Process_Pragma_Options().
Definition at line 83 of file flags.c.
References BOOL, c, EC_Flag_Digit, EC_Flag_Range, ErrMsg(), FALSE, INT64, negate, TRUE, and val.
Referenced by Get_Trace_Phase_Number(), Process_Cc1_Command_Line(), Process_Command_Line(), Process_Command_Line_Group(), and Process_Trace_Option().
| static void Initialize_Option_Group | ( | OPTION_GROUP * | ogroup | ) | [static] |
Definition at line 450 of file flags.c.
References calloc(), count, Duplicate_Value(), EC_No_Mem, ErrMsg(), i, INT16, NULL, ODA_last, ODA_orig, ODA_primary, ODA_specified, ODESC_aux, ODESC_kind, ODESC_orig_specified, ODESC_specified, ODESC_variable, OGA_count, OGA_odesc_aux, OGROUP_aux, OGROUP_options, OVK_COUNT, OVK_LIST, OVK_NAME, OVK_OLD_COUNT, OVK_SELF, Set_ODESC_aux, and Set_OGROUP_aux.
Referenced by Initialize_Option_Groups().
| void Initialize_Option_Groups | ( | OPTION_GROUP * | ogroups | ) |
Definition at line 583 of file flags.c.
References Initialize_Option_Group(), NULL, OGROUP_name, and OGROUP_options.
Referenced by Preconfigure(), and Process_Command_Line_Group().
| static BOOL Modified_Option | ( | OPTION_DESC * | odesc | ) | [static] |
Definition at line 986 of file flags.c.
References BOOL, cur, INT32, INT64, ODA_last_i, ODA_last_p, ODESC_aux, ODESC_kind, ODESC_variable, OVK_BOOL, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_NONE, OVK_SELF, OVK_UINT32, OVK_UINT64, UINT32, and UINT64.
Referenced by Print_Option_Group().
| void Print_Option_Group | ( | FILE * | tf, | |
| OPTION_GROUP * | og, | |||
| const char * | prefix, | |||
| BOOL | internal, | |||
| BOOL | full, | |||
| BOOL | update | |||
| ) |
Definition at line 1049 of file flags.c.
References BOOL, FALSE, fprintf(), INT32, INT64, Modified_Option(), NULL, ODA_mod_int, ODA_mod_user, ODA_print, ODA_set_int, ODA_set_user, ODESC_aux, ODESC_description, ODESC_kind, ODESC_name, ODESC_primary, ODESC_variable, ODESC_visibility, OGA_internal, OGROUP_aux, OGROUP_description, OGROUP_name, OGROUP_options, OGROUP_separator, OGROUP_valmarker, OLIST_next, OLIST_opt, OLIST_val, OV_INTERNAL, OVK_BOOL, OVK_COUNT, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_OLD_COUNT, OVK_SELF, OVK_UINT32, OVK_UINT64, Reset_ODA_mod_int, Reset_ODA_mod_user, Reset_ODA_print, Reset_ODA_printed, Reset_ODA_set_int, Reset_ODA_set_user, SBar, Set_ODA_print, TRUE, UINT32, and UINT64.
Referenced by Print_Option_Groups(), Trace_Command_Line_Group(), and Trace_Option_Group().
| void Print_Option_Groups | ( | FILE * | tf, | |
| OPTION_GROUP * | og, | |||
| const char * | prefix, | |||
| BOOL | internal, | |||
| BOOL | full, | |||
| BOOL | update | |||
| ) |
Definition at line 1255 of file flags.c.
References NULL, OGROUP_name, and Print_Option_Group().
Referenced by List_Compile_Options(), and Trace_Option_Groups().
| BOOL Process_Command_Line_Group | ( | char * | flag, | |
| OPTION_GROUP * | opt_groups | |||
| ) |
Definition at line 685 of file flags.c.
References BOOL, calloc(), copy, EC_Ambig_In_Grp, EC_Flag_Int_Expected, EC_Inv_Grp_Val, EC_Not_In_Grp, EC_Obsolete_Opt, EC_Replaced_Opt, EC_Unimp_Opt, EC_Unimplemented, ErrMsg(), FALSE, free(), Get_Numeric_Flag(), Initialize_Option_Groups(), INT, INT32, INT32_MAX, INT32_MIN, INT64, Is_True, NULL, ODA_specified, ODESC_abbrev, ODESC_aux, ODESC_def_val, ODESC_kind, ODESC_max_val, ODESC_min_val, ODESC_name, ODESC_variable, OGROUP_name, OGROUP_options, OGROUP_separator, OGROUP_valmarker, OLIST_next, OLIST_opt, OLIST_val, OVK_BOOL, OVK_COUNT, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_NONE, OVK_OBSOLETE, OVK_OLD_COUNT, OVK_REPLACED, OVK_SELF, OVK_UINT32, OVK_UINT64, OVK_UNIMPLEMENTED, Set_ODA_mod, Set_ODA_set, sprintf(), strcasecmp(), strcmp(), strcspn(), strdup, strlen(), strncasecmp(), strncmp(), TRUE, UINT64, Update_Pointer_Value(), Update_Scalar_Value(), and val.
Referenced by Process_Command_Line(), Process_Common_Options(), Process_IPA_Options(), and Process_Option_File().
Definition at line 1316 of file flags.c.
References BOOL, Common_Option_Groups, Copy_option(), count, Get_Trace(), i, individual_option, INT16, INT32, Is_Trace, Is_True, ODESC_can_change_by_pragma, ODESC_name, offset, OGA_count, OGA_odesc_aux, OGROUP_aux, OGROUP_name, OGROUP_options, Opt_Level, TFile, and TP_MISC.
Referenced by OPTIONS_STACK::Pop_Current_Options(), and OPTIONS_STACK::Push_Current_Options().
| void Set_Option_Internal | ( | OPTION_GROUP * | ogroup, | |
| const char * | name | |||
| ) |
Definition at line 545 of file flags.c.
References NULL, o, ODESC_kind, ODESC_name, ODESC_visibility, OGROUP_aux, OGROUP_options, OV_INTERNAL, OVK_COUNT, OVK_OLD_COUNT, Set_OGA_internal, and strcasecmp().
Referenced by Preconfigure().
| void Trace_Command_Line_Group | ( | FILE * | tf, | |
| OPTION_GROUP * | og | |||
| ) |
Definition at line 1240 of file flags.c.
References FALSE, Print_Option_Group(), and TRUE.
Referenced by OPTIONS_STACK::Process_Pragma_Options().
| void Trace_Option_Group | ( | FILE * | tf, | |
| OPTION_GROUP * | og, | |||
| BOOL | full | |||
| ) |
| void Trace_Option_Groups | ( | FILE * | tf, | |
| OPTION_GROUP * | og, | |||
| BOOL | full | |||
| ) |
Definition at line 1267 of file flags.c.
References Print_Option_Groups(), and TRUE.
Referenced by Configure_Source(), and Process_IPA_Options().
| static void Update_Pointer_Value | ( | OPTION_DESC * | odesc, | |
| void * | val | |||
| ) | [static] |
Definition at line 662 of file flags.c.
References ODA_last_p, ODESC_aux, ODESC_variable, Set_ODA_mod, and Set_ODA_set.
Referenced by Process_Command_Line_Group().
| static void Update_Scalar_Value | ( | OPTION_DESC * | odesc, | |
| UINT64 | val | |||
| ) | [static] |
Definition at line 612 of file flags.c.
References BOOL, INT32, INT64, ODA_last_i, ODESC_aux, ODESC_kind, ODESC_variable, OVK_BOOL, OVK_INT32, OVK_INT64, OVK_NONE, OVK_UINT32, OVK_UINT64, Set_ODA_mod, Set_ODA_set, UINT32, and UINT64.
Referenced by Process_Command_Line_Group().
1.5.6