Thread: [Compbench-devel] CompBenchmarks++/libcompbenchmarks/Compiler Compiler.h, 1.14, 1.15 Compiler-Optio
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-09-06 16:56:02
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2053 Modified Files: Compiler.h Compiler-OptionSet.h Log Message: For SF's TID #141819 : improving Doxygen documentation. Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Compiler.h 4 Sep 2007 19:45:50 -0000 1.14 --- Compiler.h 6 Sep 2007 16:51:27 -0000 1.15 *************** *** 29,37 **** ! typedef struct CompilerOptionLogicVar { ! std::string id; ! std::string value; ! std::string lastWriter; }; --- 29,49 ---- ! /** Internal compiler variable. ! * ! * Such a variable is used to store a id/value pair and associate it to ! * a writer. Both id and writer can be a compiler option identifier (eg. ! * maybe O2 for -O2 GCC's option. ! * ! * A list of CompilerOptionLogicVar is used to represents an option ! * evaluation context, for instance to warn about incompatible options. ! * ! * \sa CBM::Compiler::colVariables ! * \sa CBM::CompilerDescriptions ! */ typedef struct CompilerOptionLogicVar { ! std::string id; /*!< Variable's identifier */ ! std::string value; /*!< Variable's value */ ! std::string lastWriter; /*!< Object identifier (or variable's) that has ! * modified current variable last time */ }; *************** *** 43,71 **** { private: ! /** Internal usage * Speeds up compilerName(). */ std::string cacheCompilerName; ! /** Internal usage * Speeds up Version(). */ std::string cacheCompilerVersion; ! /** Internal usage ! * Speeds up VanillaVersion(). */ std::string cacheCompilerVanillaVersion; ! /** Internal usage * Cache used to get supported compilers version (e.g. 2.95.x, 4.1.x an so * on, for GCC). */ std::vector<std::string> supportedVersionDirectories; int supportedVersionInitialized; std::vector<CompilerOptionLogicVar*> colVariables; std::vector<std::string> colOptions; CBM_COD *cacheOptionDescriptions; --- 55,119 ---- { private: ! /** Compiler name ! * ! * Cached string. ! * * Speeds up compilerName(). + * \sa compilerName(); */ std::string cacheCompilerName; ! /** Complete compiler's version. ! * * Speeds up Version(). + * \sa CompilerVersion() + * \sa VanillaVersion() */ std::string cacheCompilerVersion; ! /** Short compiler's version. ! * ! * e.g., simple string like 3.3.0. ! * ! * Speeds up VanillaVersion() ! * ! * \sa VanillaVersion() ! * \sa CompilerVersion() */ std::string cacheCompilerVanillaVersion; ! /** List of supported versions for current compiler (familly) ! * * Cache used to get supported compilers version (e.g. 2.95.x, 4.1.x an so * on, for GCC). */ std::vector<std::string> supportedVersionDirectories; + + /** Initialization flag for version cache + * + * Set to 1 if the version related variables has been cached, + * 0 otherwise. + * + * \sa VanillaVersion() + * \sa CompilerVersion() + */ int supportedVersionInitialized; + /** Internal variables to analyze options. + * + * \sa analyzeOptions() + */ std::vector<CompilerOptionLogicVar*> colVariables; + + /** Internal variables to analyze options. + * + * Keep used options. + * + * \sa analyzeOptions() + */ std::vector<std::string> colOptions; + /** Options' descriptions. + */ CBM_COD *cacheOptionDescriptions; *************** *** 75,116 **** /** Initialised by constructor. ! \sa Compiler() */ std::string compilerBinary; ! /** Constructor ! \param _system the System to use internaly. ! \param _compilerBinary absolute or relative path to the compiler program */ Compiler(class System *_system, std::string _compilerBinary); ! /** Gets compiler's name * \return std::string containing the name of the compiler * \sa getCompilerName() */ virtual std::string getCompilerName(void) = 0; ! /** Gets compiler's version * \return std::string containing the version of the compiler * \sa Version() ! * \sa getVanillaVersion() */ virtual std::string getCompilerVersion(void) = 0; ! /** Gets vanilla version * Removes extra characters from getCompilerVersion() and just keeps ! * something like <M>.<m>.<p> or <M>.<m> * \return 'Simplified' version * \sa Version() */ virtual std::string getCompilerVanillaVersion(void) = 0; ! virtual void supportedVersionAddUnique(std::string _version); virtual void supportedVersions(std::string baseDir); ! /** Detects supported versions * Uses XML file and KB directories to initialize supportedVersions */ virtual void supportedVersions(void); virtual void colDestroy(void); --- 123,197 ---- /** Initialised by constructor. ! * ! * \sa Compiler() */ std::string compilerBinary; ! /** Constructor. ! * ! * \param _system the System to use internaly. ! * \param _compilerBinary absolute or relative path to the compiler program */ Compiler(class System *_system, std::string _compilerBinary); ! /** Gets compiler's name. ! * * \return std::string containing the name of the compiler * \sa getCompilerName() */ virtual std::string getCompilerName(void) = 0; ! /** Gets compiler's version. ! * * \return std::string containing the version of the compiler * \sa Version() ! * \sa VanillaVersion() ! * \sa getCompilerVersion() */ virtual std::string getCompilerVersion(void) = 0; ! /** Gets vanilla version. ! * * Removes extra characters from getCompilerVersion() and just keeps ! * something like Major.minor.patch or Major.minor * \return 'Simplified' version + * + * \sa VanillaVersion() + * \sa getVanillaVersion() * \sa Version() */ virtual std::string getCompilerVanillaVersion(void) = 0; ! /** Updates supported versions. ! * ! * Add a new supported version to supportedVersionDirectories. Do nothing ! * if the given version was known. ! * ! * \param _version Vanilla version supported. ! * ! * \sa supportedVersionDirectories */ virtual void supportedVersionAddUnique(std::string _version); + /** Initialize supported versions. + * + * Uses supportedVersionAddUnique() to feed supportedVersionDirectories + * list with compiler's versions that have specific directories containing + * XML option descriptions. Directories have same name as vanilla version, + * and this is only done for compiler of the same familly as the + * current compiler's familly. + * + * \param baseDir Base directory where to look for. + * + * \sa supportedVersionAddUnique() */ virtual void supportedVersions(std::string baseDir); ! /** Detects supported versions. ! * * Uses XML file and KB directories to initialize supportedVersions */ virtual void supportedVersions(void); + /** Destroy internal variables. + * + * \sa colVariables + * \sa colOptions + */ virtual void colDestroy(void); *************** *** 118,153 **** /** Internal compiler id. ! \return std::string like 'gcc' or 'g++'. ! */ virtual std::string compiler(void) = 0; /** Gets compiler's name. Do not overload. ! \sa getCompilerName() ! \return The compiler name. */ virtual std::string Name(void); ! /** Gets compiler's version. Do not overload. ! \sa getCompilerVersion() ! \return The compiler version. */ 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). */ virtual std::string Binary(void); /** Gets compiler's language. ! \return C or C++. */ virtual std::string Language(void) = 0; /** Virtual destructor */ ! virtual std::string relativeDescriptionDirectory(void); ! /** Return (supported) option descriptions ! \return Option descriptions */ virtual CBM_COD *OptionDescriptions(void); virtual CompilerOptionLogicVar* colVarGet(std::string _id); --- 199,256 ---- /** Internal compiler id. ! * ! * \return std::string like 'gcc' or 'g++'. ! */ virtual std::string compiler(void) = 0; + /** Gets compiler's name. Do not overload. ! * ! * \sa getCompilerName() ! * \return The compiler name. */ virtual std::string Name(void); ! /** Gets compiler's full version string. Do not overload. ! * ! * \sa getCompilerVersion() ! * \return The compiler version. */ virtual std::string Version(void); + /** Gets compiler's short version. Do not overload. + * + * \sa getCompilerVersion() + * \return The compiler vanilla version. */ 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). */ virtual std::string Binary(void); /** Gets compiler's language. ! * ! * \return C or C++ (as this time) */ virtual std::string Language(void) = 0; /** Virtual destructor */ ! /** Get closest option descriptions' directory. ! * ! * This method tries to get the closest relevant match for the current vanilla ! * version of the used compiler. ! * ! * \return Directory (absolute path) ! */ virtual std::string relativeDescriptionDirectory(void); ! /** Return (supported) option descriptions. ! * ! * \return Option descriptions */ virtual CBM_COD *OptionDescriptions(void); + /** Get value of an internal variable + * + * \param _id Variable's identifier + * \return Variable's structure pointer + */ virtual CompilerOptionLogicVar* colVarGet(std::string _id); Index: Compiler-OptionSet.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-OptionSet.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Compiler-OptionSet.h 4 Sep 2007 20:02:55 -0000 1.3 --- Compiler-OptionSet.h 6 Sep 2007 16:51:27 -0000 1.4 *************** *** 50,54 **** /** Retrives identifer. ! * \param Internal instance's identifier */ virtual std::string Id(void); --- 50,55 ---- /** Retrives identifer. ! * ! * \return Internal instance's identifier */ virtual std::string Id(void); |