aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/llvmc/CompilerDriver.h1
-rw-r--r--tools/llvmc/Configuration.cpp13
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/llvmc/CompilerDriver.h b/tools/llvmc/CompilerDriver.h
index 4b825e22ea..e5bf42fda8 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 a381d56e1c..a3c62d6116 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;