Esempio n. 1
0
void
Ex3SuifPass::initialize()
{
    PipelinablePass::initialize();

    OptionList *l;

    // Create grammar for parsing the command line.  This must occur
    // after the parent class's initialize routine has been executed.
    _command_line->set_description("cookbook example #3");

    // Collect optional flags.
    OptionSelection *flags = new OptionSelection(false);

    // -reserve_reg
    l = new OptionList;
    l->add(new OptionLiteral("-reserve_reg"));
    l->add(new OptionString("reg", &reserved_reg_name));
    l->set_description("specifies name of register to reserve");
    flags->add(l);

    // Accept tagged options in any order.
    _command_line->add(new OptionLoop(flags));

    // zero or more file names
    file_names = new OptionString("file name");
    OptionLoop *files =
	new OptionLoop(file_names,
		       "names of optional input and/or output files");
    _command_line->add(files);
}
void RemoveModulePass::initialize()
{
    PipelinablePass::initialize() ;
    _command_line->set_description("Remove a module from the repository") ;
    OptionString* name = new OptionString("Module Name", &moduleName) ;
    OptionString* directory = new OptionString("Local Directory",
            &localDirectory) ;
    OptionList* args = new OptionList() ;
    args->add(name) ;
    args->add(directory) ;
    _command_line->add(args) ;
}
Esempio n. 3
0
void MarkRedundantPass::initialize()
{
  PipelinablePass::initialize() ;
  _command_line->set_description("Marks labels as redundant") ;
  OptionString* optionRedundantLabel = new OptionString("Redundant Label",
							&redundantLabel) ;
  OptionInt* doubleOption = new OptionInt("DoubleOrTriple", &doubleOrTriple) ;
  OptionList* arguments = new OptionList() ;
  arguments->add(optionRedundantLabel) ;
  arguments->add(doubleOption) ;
  _command_line->add(arguments) ;
}
Esempio n. 4
0
  virtual void initialize() {
    Pass::initialize();

    _def_flag_argument = new OptionLiteral("-D", &def, true);
    _def_opts_argument = new OptionMultiString("definition", &_d_opts);
    _def_list_argument = new OptionList();
    _def_list_argument->add(_def_flag_argument);
    _def_list_argument->add(_def_opts_argument);
    _def_loop_argument = new OptionLoop(_def_list_argument, true);

    _def_selector = new OptionSelection(true);
    _def_selector->add(_def_loop_argument);
    _command_line->add(_def_selector);

    _incl_flag_argument = new OptionLiteral("-I", &incl, true);
    _incl_opts_argument = new OptionMultiString("include", &_i_opts);
    _incl_list_argument = new OptionList();
    _incl_list_argument->add(_incl_flag_argument);
    _incl_list_argument->add(_incl_opts_argument);
    _incl_loop_argument = new OptionLoop(_incl_list_argument, true);

    _incl_selector = new OptionSelection(true);
    _incl_selector->add(_incl_loop_argument);
    _command_line->add(_incl_selector);
    
    _debug_argument = new OptionLiteral("-d", &debug_it, true);
    _debug_selector = new OptionSelection(true);
    _debug_selector-> add( _debug_argument );
    _command_line-> add(_debug_selector);

#ifndef MSVC
    _macro_file_name = get_default_file_name("suif/suif2b/basesuif/s2c/c_text.mac");
#else
    _macro_file_name = get_default_file_name("suif\\suif2b\\basesuif\\s2c\\c_text.mac");
#endif

    _output_file_name_argument = new OptionString( "output-file" );
    _command_line-> add( _output_file_name_argument );
    _macro_file_name_argument = new OptionString( "macro-file",&_macro_file_name );
    _option_selector = new OptionSelection(true);
    _option_selector-> add( _macro_file_name_argument );
    _command_line-> add(_option_selector);
    
    _command_line-> set_description("Outputs C form of a SUIF tree." );
    // SuifEnv *s = get_suif_env();

  }
Esempio n. 5
0
void ExportPass::initialize()
{
  PipelinablePass::initialize() ;
  _command_line->set_description("Add either a system or a module to the repository from the current suif file") ;
  OptionString* directory = new OptionString("Local Dir", &localDirectory) ;
  OptionList* args = new OptionList() ;
  args->add(directory) ;
  _command_line->add(args) ;
}
void SolveFeedbackVariablesPass3::initialize()
{
  PipelinablePass::initialize() ;
  _command_line->set_description("Solves feedback variables") ;
  OptionInt* optionIsSystolic = new OptionInt("IsSystolic", &isSystolic) ;
  OptionList* feedbackArguments = new OptionList() ;
  feedbackArguments->add(optionIsSystolic) ;
  _command_line->add(feedbackArguments) ;
}
Esempio n. 7
0
void
M2aSuifPass::initialize()
{
    OptionList *l;
    OptionLiteral *f;

    PipelinablePass::initialize();

    // Create parse tree for parsing the command line.  This must occur
    // after the parent class's initialize routine has been executed.
    _command_line->set_description(
	"translate Machine-SUIF file to assembly language");

    // Collect optional flags.
    OptionSelection *flags = new OptionSelection(false);

    // -debug level
    l = new OptionList;
    l->add(new OptionLiteral("-debug"));
    l->add(new OptionInt("level", &debuglvl));
    l->set_description("set verbosity level for debugging messages");
    flags->add(l);

    // -all_notes -- print all instruction notes
    f = new OptionLiteral("-all_notes", &m2a.print_all_notes, true);
    f->set_description("force all instruction notes to appear in output");
    flags->add(f);
    
    // -noprint note -- do not print this note
    l = new OptionList;
    l->add(new OptionLiteral("-noprint"));
    nonprinting_notes_option = new OptionString("annotation key");
    l->add(nonprinting_notes_option);
    l->set_description("suppress annotations with given key");
    flags->add(l);

    // -G max -- max byte size of datum in $gp area
    l = new OptionList;
    l->add(new OptionLiteral("-G"));
    l->add(new OptionInt("max", &m2a.Gnum));
    l->set_description("set max byte size of a datum in the $gp area");
    flags->add(l);

    // -stabs -- print with stabs information
    f = new OptionLiteral("-stabs", &m2a.want_stabs, true);
    f->set_description("add stabs debugging information to output");
    flags->add(f);

    // accept flags in any order
    _command_line->add(new OptionLoop(flags));

    // zero or more file names
    file_names_option = new OptionString("file name");
    OptionLoop *files =
	new OptionLoop(file_names_option,
		       "names of optional input and/or output files");
    _command_line->add(files);
}