Add information about callee-saved registers on Win64
[oota-llvm.git] / tools / llvmc / ConfigLexer.l
index 6633156eb334b68f1b259449b76bbfd25a627948..390045cadbcb37304e4a9c646757d6e6baac7714 100644 (file)
@@ -2,8 +2,8 @@
 // 
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Reid Spencer and is distributed under the 
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 // 
 //===----------------------------------------------------------------------===//
 //
@@ -18,7 +18,6 @@
 %option never-interactive
 %option batch
 %option noyywrap
-%option nodefault
 %option 8bit
 %option outfile="ConfigLexer.cpp"
 %option ecs
@@ -65,7 +64,7 @@ handleSubstitution(llvm::ConfigLexerTokens token) {
   }
   YY_FATAL_ERROR("Substitition tokens not allowed in names" ); 
   return ERRORTOK;
-};
+}
 
 inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) {
   ConfigLexerState.StringVal = yytext;
@@ -79,7 +78,8 @@ inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token)
 ASSEMBLER       assembler|Assembler|ASSEMBLER
 COMMAND         command|Command|COMMAND
 LANG            lang|Lang|LANG
-LINKER         linker|Linker|LINKER
+LIBS            libs|Libs|LIBS
+LINKER          linker|Linker|LINKER
 NAME            name|Name|NAME
 OPT1            opt1|Opt1|OPT1
 OPT2            opt2|Opt2|OPT2
@@ -97,10 +97,10 @@ VERSION         version|Version|VERSION
 
 True            true|True|TRUE|on|On|ON|yes|Yes|YES
 False           false|False|FALSE|off|Off|OFF|no|No|NO
-Bytecode        bc|BC|bytecode|Bytecode|BYTECODE
+Bitcode         bc|BC|bitcode|Bitcode|BITCODE
 Assembly        asm|ASM|assembly|Assembly|ASSEMBLY
 
-BadSubst        \%[^iots][a-zA-Z]\%
+BadSubst        \%[a-zA-Z]*\%
 Comment         \#[^\r\n]*\r?\n
 NewLine         \r?\n
 Eq              \=
@@ -113,7 +113,7 @@ White           [ \t]*
 
 %%
 
-{White}         { /* Ignore whitespace */ }
+{White}         { if (ConfigLexerState.in_value) return SPACE; }
 
 {Comment}       { /* Ignore comments */
                   ConfigLexerState.in_value = false; 
@@ -134,9 +134,12 @@ White           [ \t]*
                   return EQUALS; 
                 }
 
+{Sep}           { return SEPARATOR; }
+
 {VERSION}       { return handleNameContext(VERSION_TOK); }
 
 {LANG}          { return handleNameContext(LANG); }
+{LIBS}          { return handleNameContext(LIBS); }
 {NAME}          { return handleNameContext(NAME); }
 {OPT1}          { return handleNameContext(OPT1); }
 {OPT2}          { return handleNameContext(OPT2); }
@@ -160,10 +163,18 @@ White           [ \t]*
 {LINKER}        { return handleNameContext(LINKER); }
 
 %args%          { return handleSubstitution(ARGS_SUBST); }
+%bindir%        { return handleSubstitution(BINDIR_SUBST); }      
 %defs%          { return handleSubstitution(DEFS_SUBST); }
 %in%            { return handleSubstitution(IN_SUBST); }
 %incls%         { return handleSubstitution(INCLS_SUBST); }
+%libdir%        { return handleSubstitution(LIBDIR_SUBST); }
 %libs%          { return handleSubstitution(LIBS_SUBST); }
+%llvmgccdir%    { return handleSubstitution(LLVMGCCDIR_SUBST); }
+%llvmgccarch%   { return handleSubstitution(LLVMGCCARCH_SUBST); }
+%llvmgcc%       { return handleSubstitution(LLVMGCC_SUBST); }
+%llvmgxx%       { return handleSubstitution(LLVMGXX_SUBST); }
+%llvmcc1%       { return handleSubstitution(LLVMCC1_SUBST); }
+%llvmcc1plus%   { return handleSubstitution(LLVMCC1PLUS_SUBST); }
 %opt%           { return handleSubstitution(OPT_SUBST); }
 %out%           { return handleSubstitution(OUT_SUBST); }
 %stats%         { return handleSubstitution(STATS_SUBST); }
@@ -173,10 +184,9 @@ White           [ \t]*
 %fOpts%         { return handleSubstitution(FOPTS_SUBST); }
 %MOpts%         { return handleSubstitution(MOPTS_SUBST); }
 %WOpts%         { return handleSubstitution(WOPTS_SUBST); }
-{BadSubst}      { YY_FATAL_ERROR("Invalid substitution token"); }
 
 {Assembly}      { return handleValueContext(ASSEMBLY); }
-{Bytecode}      { return handleValueContext(BYTECODE); }
+{Bitcode}       { return handleValueContext(BITCODE); }
 {True}          { return handleValueContext(TRUETOK); }
 {False}         { return handleValueContext(FALSETOK); }
 
@@ -186,8 +196,6 @@ White           [ \t]*
                   --ConfigLexerState.StringVal.end());
                   return STRING;
                 }
-{Sep}           { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext;
-                    return OPTION; } }
-
+{BadSubst}      { YY_FATAL_ERROR("Invalid substitution token"); }
 
 %%