From 04b92192ec696b834eb4451a6ca9f81ea3bb50ff Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 28 Oct 2004 04:04:38 +0000 Subject: [PATCH] Eliminate the force flag, configuration item, and related support llvm-svn: 17296 --- llvm/tools/llvmc/CompilerDriver.h | 21 ++++++++++----------- llvm/tools/llvmc/ConfigLexer.l | 3 +-- llvm/tools/llvmc/Configuration.cpp | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/llvm/tools/llvmc/CompilerDriver.h b/llvm/tools/llvmc/CompilerDriver.h index 9068c5c589d8..e15bc221da71 100644 --- a/llvm/tools/llvmc/CompilerDriver.h +++ b/llvm/tools/llvmc/CompilerDriver.h @@ -120,17 +120,16 @@ namespace llvm { /// @brief Driver specific flags enum DriverFlags { DRY_RUN_FLAG = 0x0001, ///< Do everything but execute actions - FORCE_FLAG = 0x0002, ///< Force overwrite of output files - VERBOSE_FLAG = 0x0004, ///< Print each action - DEBUG_FLAG = 0x0008, ///< Print debug information - TIME_PASSES_FLAG = 0x0010, ///< Time the passes as they execute - TIME_ACTIONS_FLAG = 0x0020, ///< Time the actions as they execute - SHOW_STATS_FLAG = 0x0040, ///< Show pass statistics - EMIT_NATIVE_FLAG = 0x0080, ///< Emit native code instead of bc - EMIT_RAW_FLAG = 0x0100, ///< Emit raw, unoptimized bytecode - KEEP_TEMPS_FLAG = 0x0200, ///< Don't delete temporary files - STRIP_OUTPUT_FLAG = 0x0400, ///< Strip symbols from linked output - DRIVER_FLAGS_MASK = 0x07FF, ///< Union of the above flags + VERBOSE_FLAG = 0x0002, ///< Print each action + DEBUG_FLAG = 0x0004, ///< Print debug information + TIME_PASSES_FLAG = 0x0008, ///< Time the passes as they execute + TIME_ACTIONS_FLAG = 0x0010, ///< Time the actions as they execute + SHOW_STATS_FLAG = 0x0020, ///< Show pass statistics + EMIT_NATIVE_FLAG = 0x0040, ///< Emit native code instead of bc + EMIT_RAW_FLAG = 0x0080, ///< Emit raw, unoptimized bytecode + KEEP_TEMPS_FLAG = 0x0100, ///< Don't delete temporary files + STRIP_OUTPUT_FLAG = 0x0200, ///< Strip symbols from linked output + DRIVER_FLAGS_MASK = 0x03FF, ///< Union of the above flags }; /// @} diff --git a/llvm/tools/llvmc/ConfigLexer.l b/llvm/tools/llvmc/ConfigLexer.l index cab02a1eec7d..6633156eb334 100644 --- a/llvm/tools/llvmc/ConfigLexer.l +++ b/llvm/tools/llvmc/ConfigLexer.l @@ -134,7 +134,7 @@ White [ \t]* return EQUALS; } -{VERSION} { return handleNameContext(VERSION); } +{VERSION} { return handleNameContext(VERSION_TOK); } {LANG} { return handleNameContext(LANG); } {NAME} { return handleNameContext(NAME); } @@ -161,7 +161,6 @@ White [ \t]* %args% { return handleSubstitution(ARGS_SUBST); } %defs% { return handleSubstitution(DEFS_SUBST); } -%force% { return handleSubstitution(FORCE_SUBST); } %in% { return handleSubstitution(IN_SUBST); } %incls% { return handleSubstitution(INCLS_SUBST); } %libs% { return handleSubstitution(LIBS_SUBST); } diff --git a/llvm/tools/llvmc/Configuration.cpp b/llvm/tools/llvmc/Configuration.cpp index 6b5d33975f2c..6a835e26eb2d 100644 --- a/llvm/tools/llvmc/Configuration.cpp +++ b/llvm/tools/llvmc/Configuration.cpp @@ -71,8 +71,8 @@ namespace { std::ifstream F; }; - cl::opt DumpTokens("dump-tokens", cl::Optional, cl::Hidden, cl::init(false), - cl::desc("Dump lexical tokens (debug use only).")); + cl::opt DumpTokens("dump-tokens", cl::Optional, cl::Hidden, + cl::init(false), cl::desc("Dump lexical tokens (debug use only).")); struct Parser { @@ -157,7 +157,6 @@ namespace { switch (token) { case ARGS_SUBST: optList.push_back("%args%"); break; case DEFS_SUBST: optList.push_back("%defs%"); break; - case FORCE_SUBST: optList.push_back("%force%"); break; case IN_SUBST: optList.push_back("%in%"); break; case INCLS_SUBST: optList.push_back("%incls%"); break; case LIBS_SUBST: optList.push_back("%libs%"); break; @@ -349,8 +348,8 @@ namespace { confDat->Translator.clear(CompilerDriver::OUTPUT_IS_ASM_FLAG); break; default: - error(std::string("Expecting 'command', 'preprocesses', ") + - "'translates' or 'output' but found '" + + error(std::string("Expecting 'command', 'preprocesses', " + "'translates' or 'output' but found '") + ConfigLexerState.StringVal + "' instead"); break; } @@ -381,7 +380,7 @@ namespace { void parseAssignment() { switch (token) { - case VERSION: parseVersion(); break; + case VERSION_TOK: parseVersion(); break; case LANG: parseLang(); break; case PREPROCESSOR: parsePreprocessor(); break; case TRANSLATOR: parseTranslator(); break; @@ -407,14 +406,15 @@ namespace { } }; - void - ParseConfigData(InputProvider& provider, CompilerDriver::ConfigData& confDat) { - Parser p; - p.token = EOFTOK; - p.provider = &provider; - p.confDat = &confDat; - p.parseFile(); +void +ParseConfigData(InputProvider& provider, CompilerDriver::ConfigData& confDat) { + Parser p; + p.token = EOFTOK; + p.provider = &provider; + p.confDat = &confDat; + p.parseFile(); } + } CompilerDriver::ConfigData*