本文整理汇总了C++中OptionList::add方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionList::add方法的具体用法?C++ OptionList::add怎么用?C++ OptionList::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionList
的用法示例。
在下文中一共展示了OptionList::add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OptionLoop
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);
}
示例2: initialize
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) ;
}
示例3: initialize
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) ;
}
示例4: initialize
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();
}
示例5: initialize
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) ;
}
示例6: OptionInt
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) ;
}
示例7: OptionLoop
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);
}