diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-08-22 18:03:25 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-08-22 18:03:25 +0000 |
commit | f222ee65460d2b592b803357ad2b604671c6abd2 (patch) | |
tree | db9ff4c87f2a0a1c7be01d43d0c9cead214c43a1 /llvm/tools/llvmc/Configuration.cpp | |
parent | 38203721623db4cecce05378658cf96308f22a5d (diff) | |
download | bcm5719-llvm-f222ee65460d2b592b803357ad2b604671c6abd2.tar.gz bcm5719-llvm-f222ee65460d2b592b803357ad2b604671c6abd2.zip |
Provide support for retaining the version number found in a config file.
llvm-svn: 15995
Diffstat (limited to 'llvm/tools/llvmc/Configuration.cpp')
-rw-r--r-- | llvm/tools/llvmc/Configuration.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/Configuration.cpp b/llvm/tools/llvmc/Configuration.cpp index a381d56e1cd..a3c62d6116d 100644 --- a/llvm/tools/llvmc/Configuration.cpp +++ b/llvm/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; |