Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
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 /* has val that can not be changed */
#define CI_HAS_ONCE_VAL
#define CI_USER_SPECIFIED_IMPL
#define CI_USER_SPECIFIED_EXPL
#define CI_USER_SPECIFIED   (CI_USER_SPECIFIED_IMPL|CI_USER_SPECIFIED_EXPL)
#define CI_NAMELIST_TYPE
#define CI_CAN_CHANGE   0x0020 /* Can be respecified in cor */
#define CI_SCOPE   0x0f00 /* Scope of this control. One of: */
#define CI_SCOPE_LINE   0x0100 /* per source line */
#define CI_SCOPE_LOOP   0x0200 /* per loop */
#define CI_SCOPE_ROUTINE   0x0300 /* per routine */
#define CI_SCOPE_FILE   0x0400 /* per source file */
#define CI_SCOPE_COMPILATION   0x0500 /* per compilation */
#define CI_HAS_CHANGED   0x1000 /* Changed by a pragma */
#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 208 of file controls.cxx.

#define CGI_IS_INT_TYPE   0x0001

Definition at line 334 of file controls.cxx.

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

Definition at line 335 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 781 of file controls.cxx.

Referenced by Init_Controls_Tbl().

#define CI_CAN_CHANGE   0x0020 /* Can be respecified in cor */

Definition at line 104 of file controls.cxx.

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

Definition at line 126 of file controls.cxx.

#define CI_HAS_AA_VAL   0x0001 /* has val that can not be changed */

Definition at line 98 of file controls.cxx.

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

Definition at line 132 of file controls.cxx.

Referenced by store_ctrl().

#define CI_HAS_CHANGED   0x1000 /* Changed by a pragma */

Definition at line 111 of file controls.cxx.

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

Definition at line 129 of file controls.cxx.

#define CI_HAS_ONCE_VAL
Value:
0x0002 /* has val that expires in one use.
                                        * Replace by prev_val after one use */

Definition at line 99 of file controls.cxx.

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

Definition at line 136 of file controls.cxx.

Referenced by Pop_Controls().

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

Definition at line 121 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 152 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 153 of file controls.cxx.

Referenced by is_nlist_typed(), and store_ctrl().

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

Definition at line 577 of file controls.cxx.

Referenced by store_ctrl().

Value:
0x0010 /* Control type is namelist
                                        * (as opposed to integer valued) */

Definition at line 103 of file controls.cxx.

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

Definition at line 122 of file controls.cxx.

Referenced by Print_Controls(), and store_ctrl().

#define CI_SCOPE   0x0f00 /* Scope of this control. One of: */

Definition at line 105 of file controls.cxx.

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

Definition at line 127 of file controls.cxx.

Referenced by Pop_Controls(), and store_ctrl().

#define CI_SCOPE_COMPILATION   0x0500 /* per compilation */

Definition at line 110 of file controls.cxx.

#define CI_SCOPE_FILE   0x0400 /* per source file */

Definition at line 109 of file controls.cxx.

Referenced by store_ctrl().

#define CI_SCOPE_LINE   0x0100 /* per source line */

Definition at line 106 of file controls.cxx.

Referenced by Pop_Once_Line_Controls().

#define CI_SCOPE_LOOP   0x0200 /* per loop */

Definition at line 107 of file controls.cxx.

Referenced by store_ctrl().

#define CI_SCOPE_ROUTINE   0x0300 /* per routine */

Definition at line 108 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 140 of file controls.cxx.

Value:
0x0008 /* Explicitly specified by user,
                                        * by -Asched=0, for example */

Definition at line 101 of file controls.cxx.

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

Definition at line 148 of file controls.cxx.

Referenced by store_ctrl().

Value:
0x0004 /* Implicitly specified by user,
                                        * by -O flag, for example */

Definition at line 100 of file controls.cxx.

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

Definition at line 144 of file controls.cxx.

#define debugging   FALSE

Definition at line 579 of file controls.cxx.

Referenced by store_ctrl().

#define dprintf   if (debugging) printf

Definition at line 580 of file controls.cxx.

Referenced by store_ctrl().

#define ERRORS_FOUND   1

Definition at line 381 of file controls.cxx.

Referenced by Process_Control_Opt(), and store_ctrl().

#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 203 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 378 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 116 of file controls.cxx.

#define IS_NLIST_TYPED (   ci)
Value:

Definition at line 118 of file controls.cxx.

#define MI   0x7fffffff

Definition at line 202 of file controls.cxx.

#define N   CI_NAMELIST_TYPE

Definition at line 201 of file controls.cxx.

#define NO_ERRORS_FOUND   0

Definition at line 382 of file controls.cxx.

Referenced by Process_Control_Opt(), and store_ctrl().

#define P   CI_SCOPE_LOOP

Definition at line 204 of file controls.cxx.

#define R   CI_SCOPE_ROUTINE

Definition at line 206 of file controls.cxx.

Definition at line 181 of file controls.cxx.

Referenced by Process_Control_Opt(), and store_ctrl().

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

Definition at line 134 of file controls.cxx.

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

Definition at line 138 of file controls.cxx.

Referenced by Pop_Controls().

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

Definition at line 142 of file controls.cxx.

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

Definition at line 150 of file controls.cxx.

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

Definition at line 146 of file controls.cxx.

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

Definition at line 133 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 130 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 137 of file controls.cxx.

Referenced by push_cur_val().

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

Definition at line 123 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 124 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 141 of file controls.cxx.

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

Definition at line 149 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 145 of file controls.cxx.

Referenced by store_ctrl().

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

Definition at line 81 of file controls.cxx.


Typedef Documentation

typedef struct o_gr_exp O_GR_EXP
typedef struct str_list STR_LIST

Function Documentation

void Apply_Controls ( void  )

Definition at line 911 of file controls.cxx.

Definition at line 970 of file controls.cxx.

References Get_Int_Ctrl_Val(), Max_Symbolic_Debug_Mode, SDM_GEN_FP, SDM_LINE, SDM_NONE, SDM_SYMBOL, SDM_USE_FP, and Symbolic_Debug_Mode.

Here is the call graph for this function:

void Fix_g_O ( void  )

Definition at line 1118 of file controls.cxx.

Definition at line 987 of file controls.cxx.

Referenced by Apply_Routine_Scope_Controls().

char* Get_Name_Ctrl_Val ( CONTROL  a)

Definition at line 997 of file controls.cxx.

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

Definition at line 370 of file controls.cxx.

Referenced by Process_Control_Opt().

void Pop_Once_Line_Controls ( void  )

Definition at line 1034 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 
)

Definition at line 1092 of file controls.cxx.

References CI_is_int_type, CI_nlist, CONTROL_FIRST, CONTROL_LAST, CONTROL_INFO::cur_val, CONTROL_INFO::first_def, fprintf(), str_list::item, CONTROL_INFO::name, str_list::next, and s.

Referenced by Init_Controls_Tbl().

Here is the call graph for this function:

INT Process_Control_Opt ( char *  save_a,
INT  flags 
)

Definition at line 430 of file controls.cxx.

References EC_Ctrl_Paren, EC_Ctrl_Syntax, ERRORS_FOUND, IS_ID_CHAR, is_nlist_typed(), make_nlist(), name, nl, NO_ERRORS_FOUND, 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 1051 of file controls.cxx.

References HCO_ONCE, 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 562 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 898 of file controls.cxx.

static void restore_ctrl_val_set ( CTRL_VAL_SET r) [static]

Definition at line 861 of file controls.cxx.

void Restore_Routine_Top_Ctrls ( void  )

Definition at line 884 of file controls.cxx.

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

Definition at line 529 of file controls.cxx.

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

Referenced by store_ctrl().

static void save_ctrl_val_set ( CTRL_VAL_SET s) [static]

Definition at line 853 of file controls.cxx.

References CONTROL_FIRST.

void Save_Routine_Top_Ctrls ( void  )

Definition at line 870 of file controls.cxx.


Variable Documentation

Definition at line 210 of file controls.cxx.

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

Definition at line 193 of file controls.cxx.

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

Definition at line 190 of file controls.cxx.

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

Definition at line 191 of file controls.cxx.

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

Definition at line 192 of file controls.cxx.

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

Definition at line 113 of file controls.cxx.

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

Definition at line 114 of file controls.cxx.

Definition at line 850 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 364 of file controls.cxx.

BOOL Diag_Controls = TRUE [static]

Definition at line 180 of file controls.cxx.

Definition at line 173 of file controls.cxx.

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 352 of file controls.cxx.

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

Definition at line 196 of file controls.cxx.

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

Definition at line 195 of file controls.cxx.

Definition at line 159 of file controls.cxx.

Referenced by 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 337 of file controls.cxx.

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

Definition at line 199 of file controls.cxx.

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

Definition at line 198 of file controls.cxx.

Definition at line 843 of file controls.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines