Classes | Defines | Typedefs | Functions | Variables

controls.cxx File Reference

#include "defs.h"
#include "controls.h"
#include "config.h"
#include "erglob.h"
#include "glob.h"
#include "tracing.h"
#include "targ_ctrl.h"
Include dependency graph for controls.cxx:

Go to the source code of this file.

Classes

struct  str_list
struct  CONTROL_INFO
struct  o_gr_exp
struct  CONTROL_GROUP_INFO
struct  CTRL_VAL_SET

Defines

#define FOR_ALL_CONTROLS(i)   for (i=CONTROL_FIRST; i<CONTROL_LAST; i++)
#define STRLIST_item(x)   (x)->item
#define CI_HAS_AA_VAL   0x0001
#define CI_HAS_ONCE_VAL   0x0002
#define CI_USER_SPECIFIED_IMPL   0x0004
#define CI_USER_SPECIFIED_EXPL   0x0008
#define CI_USER_SPECIFIED   (CI_USER_SPECIFIED_IMPL|CI_USER_SPECIFIED_EXPL)
#define CI_NAMELIST_TYPE   0x0010
#define CI_CAN_CHANGE   0x0020
#define CI_SCOPE   0x0f00
#define CI_SCOPE_LINE   0x0100
#define CI_SCOPE_LOOP   0x0200
#define CI_SCOPE_ROUTINE   0x0300
#define CI_SCOPE_FILE   0x0400
#define CI_SCOPE_COMPILATION   0x0500
#define CI_HAS_CHANGED   0x1000
#define IS_INT_TYPED(ci)
#define IS_NLIST_TYPED(ci)
#define CI_int(ci, f)   (IS_INT_TYPED(ci))->f
#define CI_nlist(ci, f)   ((STR_LIST*)(IS_NLIST_TYPED(ci))->f)
#define Set_CI_int(ci, f, v)   (IS_INT_TYPED(ci))->f=(v)
#define Set_CI_nlist(ci, f, v)   (IS_NLIST_TYPED(ci)->f)=((INTPS)(v))
#define CI_can_change(ci)   ((ci)->flags & CI_CAN_CHANGE)
#define CI_scope(ci)   ((ci)->flags & CI_SCOPE)
#define CI_has_changed(ci)   ((ci)->flags & CI_HAS_CHANGED)
#define Set_CI_has_changed(ci)   ((ci)->flags |= CI_HAS_CHANGED)
#define CI_has_AA_val(ci)   ((ci)->flags & CI_HAS_AA_VAL)
#define Set_CI_has_AA_val(ci)   ((ci)->flags |= CI_HAS_AA_VAL)
#define Reset_CI_has_AA_val(ci)   ((ci)->flags &= ~CI_HAS_AA_VAL)
#define CI_has_once_val(ci)   ((ci)->flags & CI_HAS_ONCE_VAL)
#define Set_CI_has_once_val(ci)   ((ci)->flags |= CI_HAS_ONCE_VAL)
#define Reset_CI_has_once_val(ci)   ((ci)->flags &= ~CI_HAS_ONCE_VAL)
#define CI_user_specified(ci)   ((ci)->flags & CI_USER_SPECIFIED)
#define Set_CI_user_specified(ci)   ((ci)->flags |= CI_USER_SPECIFIED)
#define Reset_CI_user_specified(ci)   ((ci)->flags &= ~CI_USER_SPECIFIED)
#define CI_user_specified_impl(ci)   ((ci)->flags & CI_USER_SPECIFIED_IMPL)
#define Set_CI_user_specified_impl(ci)   ((ci)->flags |= CI_USER_SPECIFIED_IMPL)
#define Reset_CI_user_specified_impl(ci)   ((ci)->flags &= ~CI_USER_SPECIFIED_IMPL)
#define CI_user_specified_expl(ci)   ((ci)->flags & CI_USER_SPECIFIED_EXPL)
#define Set_CI_user_specified_expl(ci)   ((ci)->flags |= CI_USER_SPECIFIED_EXPL)
#define Reset_CI_user_specified_expl(ci)   ((ci)->flags &= ~CI_USER_SPECIFIED_EXPL)
#define CI_is_int_type(ci)   (((ci)->flags & CI_NAMELIST_TYPE) == 0)
#define CI_is_nlist_type(ci)   ((ci)->flags & CI_NAMELIST_TYPE)
#define Report_Error   if (Diag_Controls) ErrMsg
#define N   CI_NAMELIST_TYPE
#define MI   0x7fffffff
#define H   CI_CAN_CHANGE
#define P   CI_SCOPE_LOOP
#define L   CI_SCOPE_LINE
#define R   CI_SCOPE_ROUTINE
#define F   CI_SCOPE_FILE
#define C   CI_SCOPE_COMPILATION
#define CGI_IS_INT_TYPE   0x0001
#define CGI_is_int_type(c)   ((c)->flags & CGI_IS_INT_TYPE != 0)
#define IS_ID_CHAR(c)
#define ERRORS_FOUND   1
#define NO_ERRORS_FOUND   0
#define CI_name(a)   ((a)->name)
#define debugging   FALSE
#define dprintf   if (debugging) printf
#define CI_allowed_vals(a)   CI_nlist(a,min_val)

Typedefs

typedef struct str_list STR_LIST
typedef struct o_gr_exp O_GR_EXP

Functions

static STR_LISTmake_nlist (char *name, STR_LIST *next)
static INT store_ctrl (char *, STR_LIST *, INT)
static BOOL is_nlist_typed (char *name)
INT Process_Control_Opt (char *save_a, INT flags)
static BOOL same_name_lists (STR_LIST *a, STR_LIST *b)
static void push_cur_val (CONTROL_INFO *a)
void Init_Controls_Tbl (void)
static void save_ctrl_val_set (CTRL_VAL_SET *s)
static void restore_ctrl_val_set (CTRL_VAL_SET *r)
void Save_Routine_Top_Ctrls (void)
void Restore_Routine_Top_Ctrls (void)
void Restore_Cmd_Line_Ctrls (void)
void Apply_Controls (void)
void Apply_Routine_Scope_Controls (void)
INT32 Get_Int_Ctrl_Val (CONTROL a)
char * Get_Name_Ctrl_Val (CONTROL a)
void Pop_Controls (INT32 level)
void Pop_Once_Line_Controls (void)
INT Process_Pragma (char *x)
void Print_Controls (FILE *fp, char *tag, BOOL def)
void Fix_g_O (void)

Variables

char * ci_int_type_message = "Control %s expects integer values"
char * ci_nlist_type_message = "Control %s expects namelist values"
static BOOL Inside_A_Routine = FALSE
BOOL Diag_On_Pragmas = TRUE
static BOOL Diag_Controls = TRUE
static STR_LIST ccv0 = {"cckr", NULL}
static STR_LIST ccv1 = {"xansi", &ccv0}
static STR_LIST ccv2 = {"cplus", &ccv1}
static STR_LIST ccv = {"ansi", &ccv2}
static STR_LIST icv0 = {"signed", NULL}
static STR_LIST icv = {"unsigned",&icv0}
static STR_LIST ocv0 = {"svr4", NULL}
static STR_LIST ocv = {"svr3", &ocv0}
CONTROL_INFO Aflag_Tbl []
static O_GR_EXP o_group_expansion []
static O_GR_EXP f_group_expansion []
static CONTROL_GROUP_INFO Control_Group_Tbl []
CTRL_VAL_SET routine_top_values
CTRL_VAL_SET cmd_line_values

Define Documentation

#define C   CI_SCOPE_COMPILATION

Definition at line 212 of file controls.cxx.

#define CGI_IS_INT_TYPE   0x0001

Definition at line 338 of file controls.cxx.

#define CGI_is_int_type (   c  )     ((c)->flags & CGI_IS_INT_TYPE != 0)

Definition at line 339 of file controls.cxx.

Referenced by is_nlist_typed(), and store_ctrl().

#define CI_allowed_vals (   a  )     CI_nlist(a,min_val)

Definition at line 785 of file controls.cxx.

Referenced by Init_Controls_Tbl().

#define CI_can_change (   ci  )     ((ci)->flags & CI_CAN_CHANGE)

Definition at line 130 of file controls.cxx.

#define CI_CAN_CHANGE   0x0020

Definition at line 108 of file controls.cxx.

#define CI_HAS_AA_VAL   0x0001

Definition at line 98 of file controls.cxx.

#define CI_has_AA_val (   ci  )     ((ci)->flags & CI_HAS_AA_VAL)

Definition at line 136 of file controls.cxx.

Referenced by store_ctrl().

#define CI_HAS_CHANGED   0x1000

Definition at line 115 of file controls.cxx.

#define CI_has_changed (   ci  )     ((ci)->flags & CI_HAS_CHANGED)

Definition at line 133 of file controls.cxx.

#define CI_HAS_ONCE_VAL   0x0002

Definition at line 99 of file controls.cxx.

#define CI_has_once_val (   ci  )     ((ci)->flags & CI_HAS_ONCE_VAL)

Definition at line 140 of file controls.cxx.

Referenced by Pop_Controls().

#define CI_int (   ci,
  f 
)    (IS_INT_TYPED(ci))->f

Definition at line 125 of file controls.cxx.

Referenced by Get_Int_Ctrl_Val(), and store_ctrl().

#define CI_is_int_type (   ci  )     (((ci)->flags & CI_NAMELIST_TYPE) == 0)

Definition at line 156 of file controls.cxx.

Referenced by Init_Controls_Tbl(), and Print_Controls().

#define CI_is_nlist_type (   ci  )     ((ci)->flags & CI_NAMELIST_TYPE)

Definition at line 157 of file controls.cxx.

Referenced by is_nlist_typed(), and store_ctrl().

#define CI_name (   a  )     ((a)->name)

Definition at line 581 of file controls.cxx.

Referenced by store_ctrl().

#define CI_NAMELIST_TYPE   0x0010

Definition at line 106 of file controls.cxx.

Referenced by Get_Int_Ctrl_Val(), and Get_Name_Ctrl_Val().

#define CI_nlist (   ci,
  f 
)    ((STR_LIST*)(IS_NLIST_TYPED(ci))->f)

Definition at line 126 of file controls.cxx.

Referenced by Get_Name_Ctrl_Val(), Print_Controls(), and store_ctrl().

#define CI_SCOPE   0x0f00

Definition at line 109 of file controls.cxx.

#define CI_scope (   ci  )     ((ci)->flags & CI_SCOPE)

Definition at line 131 of file controls.cxx.

Referenced by Pop_Controls(), and store_ctrl().

#define CI_SCOPE_COMPILATION   0x0500

Definition at line 114 of file controls.cxx.

#define CI_SCOPE_FILE   0x0400

Definition at line 113 of file controls.cxx.

Referenced by store_ctrl().

#define CI_SCOPE_LINE   0x0100

Definition at line 110 of file controls.cxx.

Referenced by Pop_Once_Line_Controls().

#define CI_SCOPE_LOOP   0x0200

Definition at line 111 of file controls.cxx.

Referenced by store_ctrl().

#define CI_SCOPE_ROUTINE   0x0300

Definition at line 112 of file controls.cxx.

Referenced by store_ctrl().

#define CI_user_specified (   ci  )     ((ci)->flags & CI_USER_SPECIFIED)

Definition at line 144 of file controls.cxx.

Referenced by Apply_Controls().

#define CI_USER_SPECIFIED   (CI_USER_SPECIFIED_IMPL|CI_USER_SPECIFIED_EXPL)

Definition at line 105 of file controls.cxx.

#define CI_user_specified_expl (   ci  )     ((ci)->flags & CI_USER_SPECIFIED_EXPL)

Definition at line 152 of file controls.cxx.

Referenced by store_ctrl().

#define CI_USER_SPECIFIED_EXPL   0x0008

Definition at line 103 of file controls.cxx.

#define CI_user_specified_impl (   ci  )     ((ci)->flags & CI_USER_SPECIFIED_IMPL)

Definition at line 148 of file controls.cxx.

#define CI_USER_SPECIFIED_IMPL   0x0004

Definition at line 101 of file controls.cxx.

#define debugging   FALSE

Definition at line 583 of file controls.cxx.

Referenced by store_ctrl().

#define dprintf   if (debugging) printf

Definition at line 584 of file controls.cxx.

Referenced by store_ctrl().

#define ERRORS_FOUND   1

Definition at line 385 of file controls.cxx.

#define F   CI_SCOPE_FILE
#define FOR_ALL_CONTROLS (   i  )     for (i=CONTROL_FIRST; i<CONTROL_LAST; i++)

Definition at line 74 of file controls.cxx.

#define H   CI_CAN_CHANGE

Definition at line 207 of file controls.cxx.

#define IS_ID_CHAR (   c  ) 
Value:
(((c)>='0'&&(c)<='9')||((c)=='-')||(nlist_ctrl&&\
        (((c)>='a'&&(c)<='z')||((c)=='_')||((c)>='A'&&(c)<='Z')||((c)=='$'))))

Definition at line 382 of file controls.cxx.

Referenced by Process_Control_Opt().

#define IS_INT_TYPED (   ci  ) 
Value:
(Is_True(((ci)->flags&CI_NAMELIST_TYPE)==0,\
                         (ci_int_type_message, ci->name)),(ci))

Definition at line 120 of file controls.cxx.

#define IS_NLIST_TYPED (   ci  ) 
Value:
(Is_True(((ci)->flags&CI_NAMELIST_TYPE),\
                           (ci_nlist_type_message, ci->name)),(ci))

Definition at line 122 of file controls.cxx.

#define L   CI_SCOPE_LINE
#define MI   0x7fffffff

Definition at line 206 of file controls.cxx.

#define N   CI_NAMELIST_TYPE

Definition at line 205 of file controls.cxx.

#define NO_ERRORS_FOUND   0

Definition at line 386 of file controls.cxx.

#define P   CI_SCOPE_LOOP

Definition at line 208 of file controls.cxx.

#define R   CI_SCOPE_ROUTINE

Definition at line 210 of file controls.cxx.

#define Report_Error   if (Diag_Controls) ErrMsg

Definition at line 185 of file controls.cxx.

Referenced by Apply_Controls(), Process_Control_Opt(), and store_ctrl().

#define Reset_CI_has_AA_val (   ci  )     ((ci)->flags &= ~CI_HAS_AA_VAL)

Definition at line 138 of file controls.cxx.

#define Reset_CI_has_once_val (   ci  )     ((ci)->flags &= ~CI_HAS_ONCE_VAL)

Definition at line 142 of file controls.cxx.

Referenced by Pop_Controls().

#define Reset_CI_user_specified (   ci  )     ((ci)->flags &= ~CI_USER_SPECIFIED)

Definition at line 146 of file controls.cxx.

#define Reset_CI_user_specified_expl (   ci  )     ((ci)->flags &= ~CI_USER_SPECIFIED_EXPL)

Definition at line 154 of file controls.cxx.

#define Reset_CI_user_specified_impl (   ci  )     ((ci)->flags &= ~CI_USER_SPECIFIED_IMPL)

Definition at line 150 of file controls.cxx.

#define Set_CI_has_AA_val (   ci  )     ((ci)->flags |= CI_HAS_AA_VAL)

Definition at line 137 of file controls.cxx.

Referenced by store_ctrl().

#define Set_CI_has_changed (   ci  )     ((ci)->flags |= CI_HAS_CHANGED)

Definition at line 134 of file controls.cxx.

Referenced by store_ctrl().

#define Set_CI_has_once_val (   ci  )     ((ci)->flags |= CI_HAS_ONCE_VAL)

Definition at line 141 of file controls.cxx.

Referenced by push_cur_val().

#define Set_CI_int (   ci,
  f,
  v 
)    (IS_INT_TYPED(ci))->f=(v)

Definition at line 127 of file controls.cxx.

Referenced by Fix_g_O(), and store_ctrl().

#define Set_CI_nlist (   ci,
  f,
  v 
)    (IS_NLIST_TYPED(ci)->f)=((INTPS)(v))

Definition at line 128 of file controls.cxx.

Referenced by Init_Controls_Tbl(), and store_ctrl().

#define Set_CI_user_specified (   ci  )     ((ci)->flags |= CI_USER_SPECIFIED)

Definition at line 145 of file controls.cxx.

#define Set_CI_user_specified_expl (   ci  )     ((ci)->flags |= CI_USER_SPECIFIED_EXPL)

Definition at line 153 of file controls.cxx.

Referenced by store_ctrl().

#define Set_CI_user_specified_impl (   ci  )     ((ci)->flags |= CI_USER_SPECIFIED_IMPL)

Definition at line 149 of file controls.cxx.

Referenced by store_ctrl().

#define STRLIST_item (   x  )     (x)->item

Definition at line 81 of file controls.cxx.

Referenced by Get_Name_Ctrl_Val().


Typedef Documentation

typedef struct o_gr_exp O_GR_EXP
typedef struct str_list STR_LIST

Function Documentation

void Apply_Controls ( void   ) 
void Apply_Routine_Scope_Controls ( void   ) 

Definition at line 974 of file controls.cxx.

References Get_Int_Ctrl_Val(), Max_Symbolic_Debug_Mode, SDM_LINE, and Symbolic_Debug_Mode.

Here is the call graph for this function:

void Fix_g_O ( void   ) 

Definition at line 1122 of file controls.cxx.

References Debug_Level, EC_Fix_g_O, ErrMsg(), Opt_Level, and Set_CI_int.

Here is the call graph for this function:

INT32 Get_Int_Ctrl_Val ( CONTROL  a  ) 

Definition at line 991 of file controls.cxx.

References CI_int, CI_NAMELIST_TYPE, Is_True, and name.

Referenced by Apply_Controls(), and Apply_Routine_Scope_Controls().

char* Get_Name_Ctrl_Val ( CONTROL  a  ) 

Definition at line 1001 of file controls.cxx.

References CI_NAMELIST_TYPE, CI_nlist, Is_True, name, and STRLIST_item.

void Init_Controls_Tbl ( void   ) 
static BOOL is_nlist_typed ( char *  name  )  [static]
static STR_LIST* make_nlist ( char *  name,
STR_LIST next 
) [static]

Definition at line 374 of file controls.cxx.

References str_list::item, str_list::next, Src_Alloc, and strcpy.

Referenced by Process_Control_Opt().

void Pop_Controls ( INT32  level  ) 
void Pop_Once_Line_Controls ( void   ) 

Definition at line 1038 of file controls.cxx.

References CI_SCOPE_LINE, and Pop_Controls().

Here is the call graph for this function:

void Print_Controls ( FILE *  fp,
char *  tag,
BOOL  def 
)
INT Process_Control_Opt ( char *  save_a,
INT  flags 
)

Definition at line 434 of file controls.cxx.

References EC_Ctrl_Paren, EC_Ctrl_Syntax, IS_ID_CHAR, is_nlist_typed(), make_nlist(), name, nl, NULL, Report_Error, s, Src_Alloc, store_ctrl(), and strcpy.

Referenced by Process_Pragma(), and store_ctrl().

Here is the call graph for this function:

INT Process_Pragma ( char *  x  ) 

Definition at line 1055 of file controls.cxx.

References HCO_PRAGMA, and Process_Control_Opt().

Here is the call graph for this function:

static void push_cur_val ( CONTROL_INFO a  )  [static]

Definition at line 566 of file controls.cxx.

References CONTROL_INFO::cur_val, CONTROL_INFO::prev_val, and Set_CI_has_once_val.

Referenced by store_ctrl().

void Restore_Cmd_Line_Ctrls ( void   ) 

Definition at line 902 of file controls.cxx.

References fprintf(), Get_Trace(), Print_Controls(), restore_ctrl_val_set(), TFile, TP_MISC, and TRUE.

Here is the call graph for this function:

static void restore_ctrl_val_set ( CTRL_VAL_SET r  )  [static]

Definition at line 865 of file controls.cxx.

References CONTROL_FIRST, and CTRL_VAL_SET::value.

Referenced by Restore_Cmd_Line_Ctrls(), and Restore_Routine_Top_Ctrls().

void Restore_Routine_Top_Ctrls ( void   ) 

Definition at line 888 of file controls.cxx.

References fprintf(), Get_Trace(), Inside_A_Routine, Print_Controls(), restore_ctrl_val_set(), TFile, TP_MISC, and TRUE.

Here is the call graph for this function:

static BOOL same_name_lists ( STR_LIST a,
STR_LIST b 
) [static]

Definition at line 533 of file controls.cxx.

References str_list::item, and str_list::next.

Referenced by store_ctrl().

static void save_ctrl_val_set ( CTRL_VAL_SET s  )  [static]

Definition at line 857 of file controls.cxx.

References CONTROL_FIRST, CONTROL_INFO::cur_val, and CTRL_VAL_SET::value.

Referenced by Apply_Controls(), and Save_Routine_Top_Ctrls().

void Save_Routine_Top_Ctrls ( void   ) 

Definition at line 874 of file controls.cxx.

References fprintf(), Get_Trace(), Inside_A_Routine, Print_Controls(), save_ctrl_val_set(), TFile, TP_MISC, and TRUE.

Here is the call graph for this function:

static INT store_ctrl ( char *  name,
STR_LIST name_list,
INT  flags 
) [static]

Variable Documentation

Definition at line 214 of file controls.cxx.

STR_LIST ccv = {"ansi", &ccv2} [static]

Definition at line 197 of file controls.cxx.

STR_LIST ccv0 = {"cckr", NULL} [static]

Definition at line 194 of file controls.cxx.

STR_LIST ccv1 = {"xansi", &ccv0} [static]

Definition at line 195 of file controls.cxx.

STR_LIST ccv2 = {"cplus", &ccv1} [static]

Definition at line 196 of file controls.cxx.

char* ci_int_type_message = "Control %s expects integer values"

Definition at line 117 of file controls.cxx.

char* ci_nlist_type_message = "Control %s expects namelist values"

Definition at line 118 of file controls.cxx.

Definition at line 854 of file controls.cxx.

Initial value:
 {
  {"OPT",  CGI_IS_INT_TYPE,     2, 0, 3, o_group_expansion},
  {"FORT", 0,                   8, 0, 0, f_group_expansion},
  { NULL,  0,                   0, 0, 0, 0,            }
}

Definition at line 368 of file controls.cxx.

BOOL Diag_Controls = TRUE [static]

Definition at line 184 of file controls.cxx.

Referenced by Apply_Controls().

Definition at line 177 of file controls.cxx.

Referenced by Apply_Controls().

Initial value:
 {
 {"classic", "fcols=72,ftab=0,fblank=1" },
 {"svs72"  , "fcols=72,ftab=0,fblank=0" },
 {"svs120" , "fcols=120,ftab=0,fblank=1" },
 {"normal" , "fcols=72,ftab=1,fblank=0" },
 {"vax72"  , "fcols=72,ftab=1,fblank=1" },
 {"vax132" , "fcols=132,ftab=1,fblank=1" },
 {"mips72" , "fcols=72,ftab=2,fblank=0" },
 {"unix72" , "fcols=72,ftab=2,fblank=1" },
 {"unix"   , "fcols=0,ftab=2,fblank=1" }
}

Definition at line 356 of file controls.cxx.

STR_LIST icv = {"unsigned",&icv0} [static]

Definition at line 200 of file controls.cxx.

STR_LIST icv0 = {"signed", NULL} [static]

Definition at line 199 of file controls.cxx.

BOOL Inside_A_Routine = FALSE [static]

Definition at line 163 of file controls.cxx.

Referenced by Restore_Routine_Top_Ctrls(), Save_Routine_Top_Ctrls(), and store_ctrl().

Initial value:
 {
   { "no-opt",
          "callmod=0,constp=0,copyp=0,domain=1,flow=0,fcm=0,"
          "alias=0,mopt=0,reg=0,sched=0,unroll=0,whole=0" },
   { "local-opt",
          "callmod=0,constp=0,copyp=0,domain=1,flow=0,fcm=0,"
          "alias=1,mopt=1,reg=0,sched=0,unroll=0,whole=0" },
   { "global-opt",
          "callmod=1,constp=2,copyp=2,domain=1,flow=1,fcm=1,"
          "alias=3,mopt=3,reg=1,sched=1,unroll=0,whole=0" },
   { "swp-opt",
          "callmod=1,constp=2,copyp=2,domain=1,flow=1,fcm=1,"
          "alias=3,mopt=3,reg=1,sched=1,unroll=0,whole=0" },
}

Definition at line 341 of file controls.cxx.

STR_LIST ocv = {"svr3", &ocv0} [static]

Definition at line 203 of file controls.cxx.

STR_LIST ocv0 = {"svr4", NULL} [static]

Definition at line 202 of file controls.cxx.

Definition at line 847 of file controls.cxx.