PIPS
options.c File Reference
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "constants.h"
#include "misc.h"
#include "arithmetique.h"
#include "boolean.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "properties.h"
#include "hyperplane.h"
+ Include dependency graph for options.c:

Go to the source code of this file.

Functions

int set_hyperplane_parameters (int argc, argv)
 package hyperplane More...
 

Function Documentation

◆ set_hyperplane_parameters()

int set_hyperplane_parameters ( int  argc,
argv   
)

package hyperplane

Yi-qing Yang, June 1990 analyzes command line options and returns the index of the first argument in argv[]

get Pips default properties

set semantics default properties

check and set execution parameters; should be done with pips_flag_get() from the parameters package to avoid inconsistencies

let's take care of that later

implied flags, non resettable

set_bool_property(ONE_TRIP_DO, truth);

this implies flow sensitivity, i.e. convex hull computation; non resettable

debug level cannot be inversed, but can be zeroed

a 0 debug level is equivalent to no debug a negative debug level is meaningless

set/reset truth

two parameters at least are needed

Definition at line 54 of file options.c.

57 {
58  int errflg = 0;
59  char * options = HYPERPLANE_OPTIONS;
60  bool truth = true;
61  char c;
62  extern char * optarg;
63  extern int optind;
64 
65  /* get Pips default properties */
67 
68  /* set semantics default properties */
71 
72  /* check and set execution parameters; should be done with
73  pips_flag_get() from the parameters package to avoid inconsistencies */
74  while((c=getopt(argc,argv,options))!=-1) {
75  switch(c) {
76  case '-':
77  /* let's take care of that later */
78  ;
79  case 'O':
81  break;
82  case 't':
84  break;
85  case 'c':
87  break;
88  case 'i':
90  break;
91  case 'f':
93  break;
94  case 'e':
96  if(truth) {
97  /* implied flags, non resettable */
100  }
101  break;
102  case 'o':
103  /* set_bool_property(ONE_TRIP_DO, truth); */
104  break;
105  case 'd':
107  if(truth)
108  /* this implies flow sensitivity, i.e. convex hull
109  computation; non resettable */
111  break;
112  case 'D':
113  if(!truth)
114  /* debug level cannot be inversed, but can be zeroed */
116  else {
117  int semantics_debug_level = atoi(optarg);
118  /* a 0 debug level is equivalent to no debug
119  a negative debug level is meaningless */
120  if(semantics_debug_level<=0) errflg++;
122  semantics_debug_level);
123  }
124  break;
125  case '?':
126  default:
127  errflg++;
128  }
129  /* set/reset truth */
130  truth = (c != '-');
131  }
132 
133  /* two parameters at least are needed */
134  if (argc - optind < 2 || errflg != 0)
135  user_error("semantics_main",
136  "usage: %s [-tcife[D nn]] program module [module ...]\n",
137  argv[0]);
138 
139 
140  /*
141  (void) fprintf(stderr,"semantics_main semantics_debug_level = %d\n",
142  semantics_debug_level);
143  (void) fprintf(stderr,"semantics_main argc = %d, optind=%d \n",
144  argc, optind);
145  */
146 
147  return optind;
148 }
#define HYPERPLANE_OPTIONS
package hyperplane
#define user_error(fn,...)
Definition: misc-local.h:265
#define PRETTYPRINT_TRANSFORMER
#define SEMANTICS_FIX_POINT
#define pips_flag_p(p)
for upwards compatibility with Francois's modified version
#define SEMANTICS_FLOW_SENSITIVE
#define SEMANTICS_DEBUG_LEVEL
#define SEMANTICS_STDOUT
#define SEMANTICS_INTERPROCEDURAL
#define PRETTYPRINT_EXECUTION_CONTEXT
#define SEMANTICS_INEQUALITY_INVARIANT
void set_bool_property(const char *, bool)
void set_int_property(const char *, int)
int optind
char * optarg

References HYPERPLANE_OPTIONS, optarg, optind, pips_flag_p, PRETTYPRINT_EXECUTION_CONTEXT, PRETTYPRINT_TRANSFORMER, SEMANTICS_DEBUG_LEVEL, SEMANTICS_FIX_POINT, SEMANTICS_FLOW_SENSITIVE, SEMANTICS_INEQUALITY_INVARIANT, SEMANTICS_INTERPROCEDURAL, SEMANTICS_STDOUT, set_bool_property(), set_int_property(), and user_error.

+ Here is the call graph for this function: