Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#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.
Classes | |
union | optval |
struct | odesc_aux |
struct | 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 /* Set since a user print */ |
#define | ODF_SET_INT 0x02 /* Set since a internal print */ |
#define | ODF_SET 0x03 /* Set (for setting only) */ |
#define | ODF_MOD_USER 0x04 /* Modified since a user print */ |
#define | ODF_MOD_INT 0x08 /* Modified since a internal print */ |
#define | ODF_MOD 0x0c /* Modified (for setting only) */ |
#define | ODF_PRINT 0x10 /* Print (because set/modified) */ |
#define | ODF_PRINTED 0x20 /* Printed (for ODK_LIST options) */ |
#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 /* Something has been set */ |
#define | OGF_INTERNAL 0x02 /* Entire group is internal */ |
#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 | |
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, 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, 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, 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, char *name) |
void | Save_or_restore_options (char *memory, INT32 size, BOOL save) |
Variables | |
char * | SBar |
#define individual_option | ( | opt, | |
str | |||
) |
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 1257 of file flags.c.
Referenced by Save_or_restore_options().
#define ODA_last | ( | o | ) | ((o)->last) |
Definition at line 255 of file flags.c.
Referenced by Initialize_Option_Group().
#define ODA_last_i | ( | o | ) | ((o)->last.i) |
Definition at line 256 of file flags.c.
Referenced by Modified_Option(), and Update_Scalar_Value().
#define ODA_last_p | ( | o | ) | ((o)->last.p) |
Definition at line 257 of file flags.c.
Referenced by Modified_Option(), and Update_Pointer_Value().
#define ODA_mod_int | ( | o | ) | (ODA_flags(o) & ODF_MOD_INT) |
Definition at line 268 of file flags.c.
Referenced by Print_Option_Group().
#define ODA_mod_user | ( | o | ) | (ODA_flags(o) & ODF_MOD_USER) |
Definition at line 265 of file flags.c.
Referenced by Print_Option_Group().
#define ODA_orig | ( | o | ) | ((o)->orig) |
Definition at line 252 of file flags.c.
Referenced by Initialize_Option_Group().
#define ODA_orig_i | ( | o | ) | ((o)->orig.i) |
#define ODA_orig_p | ( | o | ) | ((o)->orig.p) |
#define ODA_primary | ( | o | ) | ((o)->primary) |
Definition at line 250 of file flags.c.
Referenced by Initialize_Option_Group().
Definition at line 272 of file flags.c.
Referenced by Print_Option_Group().
#define ODA_printed | ( | o | ) | (ODA_flags(o) & ODF_PRINTED) |
#define ODA_set_int | ( | o | ) | (ODA_flags(o) & ODF_SET_INT) |
Definition at line 261 of file flags.c.
Referenced by Print_Option_Group().
#define ODA_set_user | ( | o | ) | (ODA_flags(o) & ODF_SET_USER) |
Definition at line 258 of file flags.c.
Referenced by Print_Option_Group().
#define ODA_specified | ( | o | ) | ((o)->specified) |
Definition at line 248 of file flags.c.
Referenced by Initialize_Option_Group(), and Process_Command_Line_Group().
Definition at line 222 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().
#define ODESC_orig_specified | ( | o | ) | ((o)->aux) |
Definition at line 221 of file flags.c.
Referenced by Initialize_Option_Group().
#define ODESC_primary | ( | o | ) | ODA_primary(ODESC_aux(o)) |
Definition at line 251 of file flags.c.
Referenced by Print_Option_Group().
#define ODESC_specified | ( | o | ) | ODA_specified(ODESC_aux(o)) |
Definition at line 249 of file flags.c.
Referenced by Initialize_Option_Group().
#define ODF_MOD_INT 0x08 /* Modified since a internal print */ |
#define ODF_MOD_USER 0x04 /* Modified since a user print */ |
#define ODF_PRINTED 0x20 /* Printed (for ODK_LIST options) */ |
#define ODF_SET_INT 0x02 /* Set since a internal print */ |
#define ODF_SET_USER 0x01 /* Set since a user print */ |
#define OGA_count | ( | o | ) | ((o)->count) |
Definition at line 295 of file flags.c.
Referenced by Initialize_Option_Group(), and Save_or_restore_options().
#define OGA_internal | ( | o | ) | (OGA_flags(o) & OGF_INTERNAL) |
Definition at line 300 of file flags.c.
Referenced by Print_Option_Group().
#define OGA_odesc_aux | ( | o | ) | ((o)->odesc_aux) |
Definition at line 296 of file flags.c.
Referenced by Initialize_Option_Group(), and Save_or_restore_options().
#define OGF_INTERNAL 0x02 /* Entire group is internal */ |
#define OGROUP_aux | ( | o | ) | ((OGROUP_AUX *)((o)->aux)) |
Definition at line 282 of file flags.c.
Referenced by Initialize_Option_Group(), Print_Option_Group(), Save_or_restore_options(), and Set_Option_Internal().
#define Reset_ODA_mod_int | ( | o | ) | (ODA_flags(o) &= ~ODF_MOD_INT) |
Definition at line 270 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_ODA_mod_user | ( | o | ) | (ODA_flags(o) &= ~ODF_MOD_USER) |
Definition at line 267 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_ODA_print | ( | o | ) | (ODA_flags(o) &= ~ODF_PRINT) |
Definition at line 274 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_ODA_printed | ( | o | ) | (ODA_flags(o) &= ~ODF_PRINTED) |
Definition at line 277 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_ODA_set_int | ( | o | ) | (ODA_flags(o) &= ~ODF_SET_INT) |
Definition at line 263 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_ODA_set_user | ( | o | ) | (ODA_flags(o) &= ~ODF_SET_USER) |
Definition at line 260 of file flags.c.
Referenced by Print_Option_Group().
#define Reset_OGA_internal | ( | o | ) | (OGA_flags(o) &= ~OGF_INTERNAL) |
#define Reset_OGA_set | ( | o | ) | (OGA_flags(o) &= ~OGF_SET) |
#define Set_ODA_mod | ( | o | ) | (ODA_flags(o) |= ODF_MOD) |
Definition at line 271 of file flags.c.
Referenced by Process_Command_Line_Group(), Update_Pointer_Value(), and Update_Scalar_Value().
#define Set_ODA_mod_int | ( | o | ) | (ODA_flags(o) |= ODF_MOD_INT) |
#define Set_ODA_mod_user | ( | o | ) | (ODA_flags(o) |= ODF_MOD_USER) |
#define Set_ODA_print | ( | o | ) | (ODA_flags(o) |= ODF_PRINT) |
Definition at line 273 of file flags.c.
Referenced by Print_Option_Group().
#define Set_ODA_printed | ( | o | ) | (ODA_flags(o) |= ODF_PRINTED) |
#define Set_ODA_set | ( | o | ) | (ODA_flags(o) |= ODF_SET) |
Definition at line 264 of file flags.c.
Referenced by Process_Command_Line_Group(), Update_Pointer_Value(), and Update_Scalar_Value().
#define Set_ODA_set_int | ( | o | ) | (ODA_flags(o) |= ODF_SET_INT) |
#define Set_ODA_set_user | ( | o | ) | (ODA_flags(o) |= ODF_SET_USER) |
#define Set_ODESC_aux | ( | o, | |
a | |||
) | (((o)->aux)=(ODESC_AUX *)(a)) |
Definition at line 223 of file flags.c.
Referenced by Initialize_Option_Group().
#define Set_OGA_internal | ( | o | ) | (OGA_flags(o) |= OGF_INTERNAL) |
Definition at line 301 of file flags.c.
Referenced by Set_Option_Internal().
#define Set_OGA_set | ( | o | ) | (OGA_flags(o) |= OGF_SET) |
#define Set_OGROUP_aux | ( | o, | |
a | |||
) | (((o)->aux)=(OGROUP_AUX *)(a)) |
Definition at line 283 of file flags.c.
Referenced by Initialize_Option_Group().
typedef struct ogroup_aux OGROUP_AUX |
static INT Copy_option | ( | OPTION_DESC * | odesc, |
char * | container, | ||
BOOL | save | ||
) | [static] |
Definition at line 311 of file flags.c.
References 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, and OVK_UINT64.
Referenced by Save_or_restore_options().
static void Duplicate_Value | ( | OPTION_DESC * | odesc, |
OPTVAL * | container | ||
) | [static] |
Definition at line 364 of file flags.c.
References optval::i, ODESC_kind, ODESC_variable, OVK_BOOL, OVK_INT32, OVK_INT64, OVK_LIST, OVK_NAME, OVK_NONE, OVK_SELF, OVK_UINT32, OVK_UINT64, and optval::p.
Referenced by Initialize_Option_Group().
OPTION_GROUP* Get_Command_Line_Group | ( | OPTION_GROUP * | og, |
char * | name | ||
) |
Definition at line 1243 of file flags.c.
References NULL, and OGROUP_name.
Referenced by Preconfigure(), and OPTIONS_STACK::Process_Pragma_Options().
INT64 Get_Numeric_Flag | ( | char ** | cp, |
INT64 | min, | ||
INT64 | max, | ||
INT64 | def, | ||
char * | flag | ||
) |
Definition at line 77 of file flags.c.
References c, EC_Flag_Digit, EC_Flag_Range, ErrMsg(), FALSE, TRUE, and val.
Referenced by Get_Trace_Phase_Number(), Process_Command_Line(), Process_Command_Line_Group(), and Process_Trace_Option().
static void Initialize_Option_Group | ( | OPTION_GROUP * | ogroup | ) | [static] |
Definition at line 416 of file flags.c.
References Duplicate_Value(), EC_No_Mem, ErrMsg(), 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 549 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 952 of file flags.c.
References 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, and OVK_UINT64.
Referenced by Print_Option_Group().
void Print_Option_Group | ( | FILE * | tf, |
OPTION_GROUP * | og, | ||
char * | prefix, | ||
BOOL | internal, | ||
BOOL | full, | ||
BOOL | update | ||
) |
Definition at line 1015 of file flags.c.
References FALSE, fprintf(), 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, and TRUE.
Referenced by Print_Option_Groups(), Trace_Command_Line_Group(), and Trace_Option_Group().
void Print_Option_Groups | ( | FILE * | tf, |
OPTION_GROUP * | og, | ||
char * | prefix, | ||
BOOL | internal, | ||
BOOL | full, | ||
BOOL | update | ||
) |
Definition at line 1214 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 651 of file flags.c.
References 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(), Is_True, name, 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, strdup, TRUE, Update_Pointer_Value(), Update_Scalar_Value(), and val.
Referenced by Process_Command_Line(), and Process_Common_Options().
void Save_or_restore_options | ( | char * | memory, |
INT32 | size, | ||
BOOL | save | ||
) |
Definition at line 1275 of file flags.c.
References Common_Option_Groups, Copy_option(), Get_Trace(), individual_option, Is_True, ODESC_can_change_by_pragma, ODESC_name, 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, |
char * | name | ||
) |
Definition at line 511 of file flags.c.
References NULL, ODESC_kind, ODESC_name, ODESC_visibility, OGROUP_aux, OGROUP_options, OV_INTERNAL, OVK_COUNT, OVK_OLD_COUNT, and Set_OGA_internal.
Referenced by Preconfigure().
void Trace_Command_Line_Group | ( | FILE * | tf, |
OPTION_GROUP * | og | ||
) |
Definition at line 1199 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 | ||
) |
Definition at line 1191 of file flags.c.
References Print_Option_Group(), and TRUE.
void Trace_Option_Groups | ( | FILE * | tf, |
OPTION_GROUP * | og, | ||
BOOL | full | ||
) |
Definition at line 1226 of file flags.c.
References Print_Option_Groups(), and TRUE.
Referenced by Configure_Source().
static void Update_Pointer_Value | ( | OPTION_DESC * | odesc, |
void * | val | ||
) | [static] |
Definition at line 628 of file flags.c.
References ODA_last_p, ODESC_aux, ODESC_variable, Set_ODA_mod, Set_ODA_set, and val.
Referenced by Process_Command_Line_Group().
static void Update_Scalar_Value | ( | OPTION_DESC * | odesc, |
UINT64 | val | ||
) | [static] |
Definition at line 578 of file flags.c.
References 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, and val.
Referenced by Process_Command_Line_Group().
char* SBar |
Definition at line 64 of file tracing.c.
Referenced by List_Compile_Options(), and Print_Option_Group().