From: Reid Spencer Date: Sun, 22 Aug 2004 18:03:25 +0000 (+0000) Subject: Provide support for retaining the version number found in a config file. X-Git-Tag: android-x86-6.0-r1~1003^2~53155 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=59a745a26f035f4d3ca51b362ae72880d361429b;p=android-x86%2Fexternal-llvm.git Provide support for retaining the version number found in a config file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15995 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvmc/CompilerDriver.h b/tools/llvmc/CompilerDriver.h index 4b825e22eab..e5bf42fda8f 100644 --- a/tools/llvmc/CompilerDriver.h +++ b/tools/llvmc/CompilerDriver.h @@ -89,6 +89,7 @@ namespace llvm { struct ConfigData { ConfigData(); + std::string version; ///< The version number. std::string langName; ///< The name of the source language StringTable opts; ///< The o10n options for each level Action PreProcessor; ///< PreProcessor command line diff --git a/tools/llvmc/Configuration.cpp b/tools/llvmc/Configuration.cpp index a381d56e1cd..a3c62d6116d 100644 --- a/tools/llvmc/Configuration.cpp +++ b/tools/llvmc/Configuration.cpp @@ -181,6 +181,18 @@ namespace { error("Expecting '='"); } + void parseVersion() { + if (next() == EQUALS) { + while (next_is_real()) { + if (token == STRING || token == OPTION) + confDat->version = ConfigLexerState.StringVal; + else + error("Expecting a version string"); + } + } else + error("Expecting '='"); + } + void parseLang() { switch (next() ) { case NAME: @@ -357,6 +369,7 @@ namespace { void parseAssignment() { switch (token) { + case VERSION: parseVersion(); break; case LANG: parseLang(); break; case PREPROCESSOR: parsePreprocessor(); break; case TRANSLATOR: parseTranslator(); break;