Polaris: switches_util.cc File Reference

switches_util.cc File Reference

Go to the source code of this file.

Functions

int getopt (int argc, char *const *argv, const char *optstring)
int p_getsubopt (char **optionp, const char *const *tokens, char **valuep)
int switch_value (char const *switch_name)
 < int getopt(int argc, char **argv, char *optstring);
void define_switch (char const *switch_name, int switch_value)
void adjust_switch_value (char const *switch_name, int new_value)
int parse_switches (int argc, char *argv[], char const *version, char **intrin_file_name)
 parse_switches - parse the polaris command line
int read_switch_file (const char *file_name)
int read_switches ()
void dump_switches (ostream &o)

Variables

Database< String, IntElemswitches
char polarisOutputFileName [PATH_MAX]


Function Documentation

int getopt int  argc,
char *const *  argv,
const char *  optstring
 

Referenced by parse_switches().

int p_getsubopt char **  optionp,
const char *const *  tokens,
char **  valuep
 

... find the end of the option and the equal sign if possible.

... if we have an '=' sign then record the argument and ... null terminate the token.

Definition at line 24 of file switches_util.cc.

References eq().

Referenced by parse_switches().

int switch_value char const *  switch_name  ) 
 

< int getopt(int argc, char **argv, char *optstring);

Definition at line 69 of file switches_util.cc.

References ProtoDatabase< S, T >::find_ref(), switches, and IntElem::value().

Referenced by _is_expr_evenly_divisible(), _iterate_to_fixed_point_phase(), _make_nonlocals_modified_at_calls(), _read_simplify_opts(), _update_succ_edges(), build_CD(), build_pidom(), ProgramUnit::burst_header(), cleanup_program(), collect_ar_statistics(), convert_case(), StmtList::create_directives(), define_switch(), do_wide_output(), Dominator_S(), expr_type(), Directive::generate_csrd_privaterefs_directive(), Directive::generate_csrd_readonlyrefs_directive(), Directive::generate_csrd_sharedrefs_directive(), Directive::generate_omp_directive(), Directive::generate_omp_do_directive(), InlineObject::inline_expand(), is_evenly_divisible(), main(), MakeGSA(), output_size(), Program::print(), print_stmt_list(), propagate_constants_pu(), propagate_outermost_DOs(), RangeComparator::RangeComparator(), Program::read(), restructure(), substitute_parameters_pu(), translate_special_name(), wide_space(), SymbolAccessRef::write(), SymbolAccess::write(), Program::write(), and CommonBlockDict::write().

void define_switch char const *  switch_name,
int  switch_value
 

Definition at line 83 of file switches_util.cc.

References Database< S, T >::ins(), switch_value(), and switches.

Referenced by main(), and read_switch_file().

void adjust_switch_value char const *  switch_name,
int  new_value
 

Definition at line 93 of file switches_util.cc.

References ProtoDatabase< S, T >::find_ref(), switches, and IntElem::value().

Referenced by parse_switches().

int parse_switches int  argc,
char *  argv[],
char const *  version,
char **  intrin_file_name
 

parse_switches - parse the polaris command line

supported options: -s <switch-name>=<value> Assign the given switch the given value -f <switch-file-name> Use the given switch file for switch values -v Report the current Polaris version -i <intrinsic-def-filename> Use the given file to define intrinsics (over-rides the use of the default dummy_pgm.f)

... read the POLARIS_SWITCHES database.

... Do the command line parsing.

Definition at line 108 of file switches_util.cc.

References adjust_switch_value(), BaseMapRoot::entries(), getopt(), p_getsubopt(), polarisOutputFileName, read_switch_file(), read_switches(), and switches.

Referenced by main().

int read_switch_file const char *  file_name  ) 
 

... Ignore comment and empty lines

... Ignore whitespace lines

Definition at line 207 of file switches_util.cc.

References define_switch().

Referenced by parse_switches(), and read_switches().

int read_switches  ) 
 

Definition at line 243 of file switches_util.cc.

References read_switch_file().

Referenced by external_interface_init(), main(), and parse_switches().

void dump_switches ostream &  o  ) 
 

o << " " << form("%16s", (const char *)*id) << form("%3d", val->value());

Definition at line 262 of file switches_util.cc.

References ProtoDatabase< S, T >::find_ref(), TypedBaseMap< S, T >::first_ref(), id(), TypedBaseMap< S, T >::successor_ref(), switches, and IntElem::value().

Referenced by Program::print(), and Program::write().


Variable Documentation

Database<String, IntElem> switches
 

Definition at line 16 of file switches_util.cc.

Referenced by adjust_switch_value(), define_switch(), dump_switches(), parse_switches(), and switch_value().

char polarisOutputFileName[PATH_MAX]
 

Definition at line 17 of file switches_util.cc.

Referenced by parse_switches().

 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:31 2005