[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Compiler Compiler.cpp, 1.11, 1.12 Compiler.h,
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-04-16 20:15:47
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17319 Modified Files: Compiler.cpp Compiler.h Log Message: Short-descriptions can be retrieved for a set of options (std::string). Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Compiler.h 12 Apr 2007 19:55:37 -0000 1.11 --- Compiler.h 16 Apr 2007 20:15:44 -0000 1.12 *************** *** 120,124 **** virtual void colDestroy(void); - public: --- 120,123 ---- *************** *** 170,173 **** --- 169,173 ---- virtual std::string analyzeOptions(std::string _options); + virtual std::string shortHelpOptions(std::string _options); virtual int supportedVersionNumber(void); Index: Compiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Compiler.cpp 12 Apr 2007 19:55:37 -0000 1.11 --- Compiler.cpp 16 Apr 2007 20:15:44 -0000 1.12 *************** *** 232,243 **** int lastOk = 0; std::string tmp; while (o!="") { o=cbmSystem->Split(_options, " ", i++); ! if (o=="") ! break; times++; OD=OptionDescriptions(); D=OD->DescriptionLitteral(o); if (!D) { r+="Ignored option "; --- 232,249 ---- int lastOk = 0; std::string tmp; + std::string ck; while (o!="") { o=cbmSystem->Split(_options, " ", i++); ! if (o=="") { ! if ((!times) && (_options!="")) ! o=_options; ! else ! break; ! } times++; OD=OptionDescriptions(); D=OD->DescriptionLitteral(o); + if (!D) { r+="Ignored option "; *************** *** 251,256 **** r+="\n"; } ! if (lastOk) ! if (colOptionHas(D->Id())) { tmp="Option "; tmp+=o; --- 257,266 ---- r+="\n"; } ! if (lastOk) { ! if (D) ! ck=D->Id(); ! else ! ck=o; ! if (colOptionHas(ck)) { tmp="Option "; tmp+=o; *************** *** 259,264 **** r+="\n"; } else { ! colOptions.push_back(D->Id()); } } --- 269,275 ---- r+="\n"; } else { ! colOptions.push_back(ck); } + } } *************** *** 271,274 **** --- 282,319 ---- } + std::string Compiler::shortHelpOptions(std::string _options) + { + int i = 0; + std::string o = "!"; + CompilerOptionDescriptions *OD; + CompilerOptionDescription *D; + std::string r; + int times = 0; + + while (o!="") { + o=cbmSystem->Split(_options, " ", i++); + if (o=="") { + if ((!times) && (_options!="")) + o=_options; + else + break; + } + times++; + OD=OptionDescriptions(); + D=OD->DescriptionLitteral(o); + + r+=o; + r+=" : "; + if (!D) { + r+="not supported by libcompbenchmarks"; + } else { + r+=D->ShortDescription(); + } + r+="\n"; + } + + return(r); + } + void Compiler::supportedVersions(void) { |