[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Compiler Compiler.cpp, 1.6, 1.7 Compiler.h, 1.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-03-20 20:30:46
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28479 Modified Files: Compiler.cpp Compiler.h Log Message: VanillaVersion() introduced. Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Compiler.h 18 Mar 2007 21:47:59 -0000 1.7 --- Compiler.h 20 Mar 2007 20:30:28 -0000 1.8 *************** *** 45,52 **** /** Internal usage ! * Speeds up compilerVersion(). */ std::string cacheCompilerVersion; protected: /** Used internally to get information on compiler's binary */ --- 45,57 ---- /** Internal usage ! * Speeds up Version(). */ std::string cacheCompilerVersion; + /** Internal usage + * Speeds up VanillaVersion(). + */ + std::string cacheCompilerVanillaVersion; + protected: /** Used internally to get information on compiler's binary */ *************** *** 74,78 **** * \return std::string containing the version of the compiler * \sa Version() ! * \sa vanillaVersion() */ virtual std::string getCompilerVersion(void) = 0; --- 79,83 ---- * \return std::string containing the version of the compiler * \sa Version() ! * \sa getVanillaVersion() */ virtual std::string getCompilerVersion(void) = 0; *************** *** 83,89 **** * \return 'Simplified' version * \sa Version() */ ! virtual std::string vanillaVersion(void); public: virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject); --- 88,96 ---- * \return 'Simplified' version * \sa Version() */ ! virtual std::string getCompilerVanillaVersion(void) = 0; ! public: + virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject); *************** *** 102,105 **** --- 109,114 ---- virtual std::string Version(void); + virtual std::string VanillaVersion(void); + /** Gets compiler's program (as specified in constructor). \return The compiler program (absolute or relative, depending on method used in instanciation). */ Index: Compiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Compiler.cpp 18 Mar 2007 21:47:59 -0000 1.6 --- Compiler.cpp 20 Mar 2007 20:30:28 -0000 1.7 *************** *** 54,113 **** } ! std::string Compiler::Binary(void) { ! return(compilerBinary); } ! std::string Compiler::vanillaVersion(void) { ! std::string v = Version(); ! std::string tmp; ! std::string r; ! ! unsigned int d0; ! unsigned int d1; ! unsigned int d2; ! ! if (v.find(' ')>0) { ! tmp=cbmSystem->Split(v, ".", 0); ! if (!tmp.empty()) { ! r+=tmp; ! tmp=cbmSystem->Split(v, ".", 1); ! d0=v.find('.', 0); ! if (!tmp.empty()) { ! r+="."; ! r+=tmp; ! d1=v.find('.', d0); ! if (d1-d0>3) ! return("can't find 2d number for version"); ! ! tmp=cbmSystem->Split(v, ".", 2); ! d2=v.find('.', d1); ! if (!tmp.empty()) { ! r+="."; ! r+=tmp; ! d2=v.find('.', d1); ! if (d2-d1>3) ! return("can't find 3rd number for version"); ! } else ! return(r); ! } else { ! return("can't find first number for version"); ! } ! } else { ! return("can't find first number for version"); ! } ! } else { ! return(v); ! } ! return("can't find first number for version"); } CBM::CompilerOptionDescriptions *Compiler::OptionDescriptions(void) { - std::string vanilla = vanillaVersion(); - return(new CBM::CompilerOptionDescriptions(compiler(), ! vanilla)); } --- 54,76 ---- } ! std::string Compiler::VanillaVersion(void) { ! if (cacheCompilerVanillaVersion!="") ! return(cacheCompilerVanillaVersion); ! ! cacheCompilerVanillaVersion=getCompilerVanillaVersion(); ! system->Chomp(cacheCompilerVanillaVersion); ! return(cacheCompilerVanillaVersion); } ! std::string Compiler::Binary(void) { ! return(compilerBinary); } CBM::CompilerOptionDescriptions *Compiler::OptionDescriptions(void) { return(new CBM::CompilerOptionDescriptions(compiler(), ! VanillaVersion())); } |