1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Allow llvm-upgrade to read from stdin. Configure the lexer for reading

from C++ std::istream.

llvm-svn: 32041
This commit is contained in:
Reid Spencer 2006-11-30 16:50:26 +00:00
parent 662a7c96eb
commit 6ba44b183b
11 changed files with 694 additions and 674 deletions

View File

@ -10,6 +10,7 @@
LEVEL = ../..
TOOLNAME = llvm-upgrade
LINK_COMPONENTS := support system
REQUIRES_EH := 1
include $(LEVEL)/Makefile.common

View File

@ -16,17 +16,17 @@
#define PARSER_INTERNALS_H
#include <string>
#include <istream>
// Global variables exported from the lexer...
extern std::string CurFileName;
extern std::string Textin;
extern int Upgradelineno;
extern std::istream* LexInput;
// functions exported from the lexer
void set_scan_bytes (const char * str, size_t len);
void UpgradeAssembly(const std::string & infile, std::ostream &out);
void UpgradeAssembly(const std::string & infile, std::istream& in, std::ostream &out);
// Globals exported by the parser...
extern char* Upgradetext;

View File

@ -842,16 +842,16 @@ goto find_rule; \
char *yytext;
#line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#define INITIAL 0
/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===//
/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
// 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 implements the flex scanner for LLVM assembly languages files.
// This file implements the flex scanner for LLVM 1.9 assembly languages files.
//
//===----------------------------------------------------------------------===*/
#define YY_NEVER_INTERACTIVE 1
@ -863,16 +863,23 @@ char *yytext;
#include <cctype>
#include <cstdlib>
void set_scan_bytes (const char * str, size_t len) {
Upgrade_scan_bytes (str, len);
}
static void trim(std::string& str) {
size_t startpos = str.find_first_not_of(" \t\n\r",0);
if (startpos != std::string::npos)
str.erase(0,startpos);
}
#define YY_INPUT(buf,result,max_size) \
{ \
if (LexInput->good() && !LexInput->eof()) { \
LexInput->read(buf,max_size); \
result = LexInput->gcount(); \
} else {\
result = YY_NULL; \
} \
}
// Construct a token value for a non-obsolete token
#define RET_TOK(sym) \
Upgradelval = new std::string(yytext); \
@ -896,7 +903,7 @@ static void trim(std::string& str) {
/* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing
* it to deal with 64 bit numbers.
*/
#line 900 "UpgradeLexer.cpp"
#line 907 "UpgradeLexer.cpp"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -1047,10 +1054,10 @@ YY_DECL
register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
#line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 1054 "UpgradeLexer.cpp"
#line 1061 "UpgradeLexer.cpp"
if ( yy_init )
{
@ -1143,571 +1150,571 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
#line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ /* Ignore comments for now */ }
YY_BREAK
case 2:
YY_RULE_SETUP
#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BEGINTOK); }
YY_BREAK
case 3:
YY_RULE_SETUP
#line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ENDTOK); }
YY_BREAK
case 4:
YY_RULE_SETUP
#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRUETOK); }
YY_BREAK
case 5:
YY_RULE_SETUP
#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FALSETOK); }
YY_BREAK
case 6:
YY_RULE_SETUP
#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DECLARE); }
YY_BREAK
case 7:
YY_RULE_SETUP
#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( GLOBAL); }
YY_BREAK
case 8:
YY_RULE_SETUP
#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CONSTANT); }
YY_BREAK
case 9:
YY_RULE_SETUP
#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INTERNAL); }
YY_BREAK
case 10:
YY_RULE_SETUP
#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LINKONCE); }
YY_BREAK
case 11:
YY_RULE_SETUP
#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( WEAK); }
YY_BREAK
case 12:
YY_RULE_SETUP
#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( APPENDING); }
YY_BREAK
case 13:
YY_RULE_SETUP
#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DLLIMPORT); }
YY_BREAK
case 14:
YY_RULE_SETUP
#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DLLEXPORT); }
YY_BREAK
case 15:
YY_RULE_SETUP
#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTERN_WEAK); }
YY_BREAK
case 16:
YY_RULE_SETUP
#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTERNAL); }
YY_BREAK
case 17:
YY_RULE_SETUP
#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( IMPLEMENTATION); }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ZEROINITIALIZER); }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DOTDOTDOT); }
YY_BREAK
case 20:
YY_RULE_SETUP
#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNDEF); }
YY_BREAK
case 21:
YY_RULE_SETUP
#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( NULL_TOK); }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TO); }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TAIL); }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TARGET); }
YY_BREAK
case 25:
YY_RULE_SETUP
#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRIPLE); }
YY_BREAK
case 26:
YY_RULE_SETUP
#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DEPLIBS); }
YY_BREAK
case 27:
YY_RULE_SETUP
#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ENDIAN); }
YY_BREAK
case 28:
YY_RULE_SETUP
#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( POINTERSIZE); }
YY_BREAK
case 29:
YY_RULE_SETUP
#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DATALAYOUT); }
YY_BREAK
case 30:
YY_RULE_SETUP
#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LITTLE); }
YY_BREAK
case 31:
YY_RULE_SETUP
#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BIG); }
YY_BREAK
case 32:
YY_RULE_SETUP
#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VOLATILE); }
YY_BREAK
case 33:
YY_RULE_SETUP
#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ALIGN); }
YY_BREAK
case 34:
YY_RULE_SETUP
#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SECTION); }
YY_BREAK
case 35:
YY_RULE_SETUP
#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MODULE); }
YY_BREAK
case 36:
YY_RULE_SETUP
#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ASM_TOK); }
YY_BREAK
case 37:
YY_RULE_SETUP
#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SIDEEFFECT); }
YY_BREAK
case 38:
YY_RULE_SETUP
#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CC_TOK); }
YY_BREAK
case 39:
YY_RULE_SETUP
#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CCC_TOK); }
YY_BREAK
case 40:
YY_RULE_SETUP
#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CSRETCC_TOK); }
YY_BREAK
case 41:
YY_RULE_SETUP
#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FASTCC_TOK); }
YY_BREAK
case 42:
YY_RULE_SETUP
#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( COLDCC_TOK); }
YY_BREAK
case 43:
YY_RULE_SETUP
#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( X86_STDCALLCC_TOK); }
YY_BREAK
case 44:
YY_RULE_SETUP
#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( X86_FASTCALLCC_TOK); }
YY_BREAK
case 45:
YY_RULE_SETUP
#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VOID); }
YY_BREAK
case 46:
YY_RULE_SETUP
#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BOOL); }
YY_BREAK
case 47:
YY_RULE_SETUP
#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SBYTE); }
YY_BREAK
case 48:
YY_RULE_SETUP
#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UBYTE); }
YY_BREAK
case 49:
YY_RULE_SETUP
#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHORT); }
YY_BREAK
case 50:
YY_RULE_SETUP
#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( USHORT); }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INT); }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UINT); }
YY_BREAK
case 53:
YY_RULE_SETUP
#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LONG); }
YY_BREAK
case 54:
YY_RULE_SETUP
#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ULONG); }
YY_BREAK
case 55:
YY_RULE_SETUP
#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FLOAT); }
YY_BREAK
case 56:
YY_RULE_SETUP
#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DOUBLE); }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABEL); }
YY_BREAK
case 58:
YY_RULE_SETUP
#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TYPE); }
YY_BREAK
case 59:
YY_RULE_SETUP
#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( OPAQUE); }
YY_BREAK
case 60:
YY_RULE_SETUP
#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ADD); }
YY_BREAK
case 61:
YY_RULE_SETUP
#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SUB); }
YY_BREAK
case 62:
YY_RULE_SETUP
#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MUL); }
YY_BREAK
case 63:
YY_RULE_SETUP
#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UDIV); }
YY_BREAK
case 64:
YY_RULE_SETUP
#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UDIV); }
YY_BREAK
case 65:
YY_RULE_SETUP
#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SDIV); }
YY_BREAK
case 66:
YY_RULE_SETUP
#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FDIV); }
YY_BREAK
case 67:
YY_RULE_SETUP
#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UREM); }
YY_BREAK
case 68:
YY_RULE_SETUP
#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UREM); }
YY_BREAK
case 69:
YY_RULE_SETUP
#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SREM); }
YY_BREAK
case 70:
YY_RULE_SETUP
#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FREM); }
YY_BREAK
case 71:
YY_RULE_SETUP
#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( AND); }
YY_BREAK
case 72:
YY_RULE_SETUP
#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( OR); }
YY_BREAK
case 73:
YY_RULE_SETUP
#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( XOR); }
YY_BREAK
case 74:
YY_RULE_SETUP
#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETNE); }
YY_BREAK
case 75:
YY_RULE_SETUP
#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETEQ); }
YY_BREAK
case 76:
YY_RULE_SETUP
#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETLT); }
YY_BREAK
case 77:
YY_RULE_SETUP
#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETGT); }
YY_BREAK
case 78:
YY_RULE_SETUP
#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETLE); }
YY_BREAK
case 79:
YY_RULE_SETUP
#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETGE); }
YY_BREAK
case 80:
YY_RULE_SETUP
#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( PHI_TOK); }
YY_BREAK
case 81:
YY_RULE_SETUP
#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CALL); }
YY_BREAK
case 82:
YY_RULE_SETUP
#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRUNC); }
YY_BREAK
case 83:
YY_RULE_SETUP
#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SELECT); }
YY_BREAK
case 84:
YY_RULE_SETUP
#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHL); }
YY_BREAK
case 85:
YY_RULE_SETUP
#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LSHR); }
YY_BREAK
case 86:
YY_RULE_SETUP
#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ASHR); }
YY_BREAK
case 87:
YY_RULE_SETUP
#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VAARG); }
YY_BREAK
case 88:
YY_RULE_SETUP
#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( RET); }
YY_BREAK
case 89:
YY_RULE_SETUP
#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BR); }
YY_BREAK
case 90:
YY_RULE_SETUP
#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SWITCH); }
YY_BREAK
case 91:
YY_RULE_SETUP
#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INVOKE); }
YY_BREAK
case 92:
YY_RULE_SETUP
#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNWIND); }
YY_BREAK
case 93:
YY_RULE_SETUP
#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNREACHABLE); }
YY_BREAK
case 94:
YY_RULE_SETUP
#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MALLOC); }
YY_BREAK
case 95:
YY_RULE_SETUP
#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ALLOCA); }
YY_BREAK
case 96:
YY_RULE_SETUP
#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FREE); }
YY_BREAK
case 97:
YY_RULE_SETUP
#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LOAD); }
YY_BREAK
case 98:
YY_RULE_SETUP
#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( STORE); }
YY_BREAK
case 99:
YY_RULE_SETUP
#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( GETELEMENTPTR); }
YY_BREAK
case 100:
YY_RULE_SETUP
#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTRACTELEMENT); }
YY_BREAK
case 101:
YY_RULE_SETUP
#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INSERTELEMENT); }
YY_BREAK
case 102:
YY_RULE_SETUP
#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHUFFLEVECTOR); }
YY_BREAK
case 103:
YY_RULE_SETUP
#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VAR_ID); }
YY_BREAK
case 104:
YY_RULE_SETUP
#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABELSTR); }
YY_BREAK
case 105:
YY_RULE_SETUP
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABELSTR); }
YY_BREAK
case 106:
YY_RULE_SETUP
#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( STRINGCONSTANT ); }
YY_BREAK
case 107:
YY_RULE_SETUP
#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EUINT64VAL ); }
YY_BREAK
case 108:
YY_RULE_SETUP
#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ESINT64VAL ); }
YY_BREAK
case 109:
YY_RULE_SETUP
#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); }
YY_BREAK
case 110:
YY_RULE_SETUP
#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UINTVAL); }
YY_BREAK
case 111:
YY_RULE_SETUP
#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SINTVAL); }
YY_BREAK
case 112:
YY_RULE_SETUP
#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FPVAL); }
YY_BREAK
case 113:
YY_RULE_SETUP
#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FPVAL); }
YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{
/* Make sure to free the internal buffers for flex when we are
* done reading our input!
@ -1718,20 +1725,20 @@ case YY_STATE_EOF(INITIAL):
YY_BREAK
case 114:
YY_RULE_SETUP
#line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ /* Ignore whitespace */ }
YY_BREAK
case 115:
YY_RULE_SETUP
#line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ return yytext[0]; }
YY_BREAK
case 116:
YY_RULE_SETUP
#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1735 "UpgradeLexer.cpp"
#line 1742 "UpgradeLexer.cpp"
case YY_END_OF_BUFFER:
{
@ -2609,5 +2616,5 @@ int main()
return 0;
}
#endif
#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"

View File

@ -842,16 +842,16 @@ goto find_rule; \
char *yytext;
#line 1 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#define INITIAL 0
/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===//
/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
// 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 implements the flex scanner for LLVM assembly languages files.
// This file implements the flex scanner for LLVM 1.9 assembly languages files.
//
//===----------------------------------------------------------------------===*/
#define YY_NEVER_INTERACTIVE 1
@ -863,16 +863,23 @@ char *yytext;
#include <cctype>
#include <cstdlib>
void set_scan_bytes (const char * str, size_t len) {
Upgrade_scan_bytes (str, len);
}
static void trim(std::string& str) {
size_t startpos = str.find_first_not_of(" \t\n\r",0);
if (startpos != std::string::npos)
str.erase(0,startpos);
}
#define YY_INPUT(buf,result,max_size) \
{ \
if (LexInput->good() && !LexInput->eof()) { \
LexInput->read(buf,max_size); \
result = LexInput->gcount(); \
} else {\
result = YY_NULL; \
} \
}
// Construct a token value for a non-obsolete token
#define RET_TOK(sym) \
Upgradelval = new std::string(yytext); \
@ -896,7 +903,7 @@ static void trim(std::string& str) {
/* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing
* it to deal with 64 bit numbers.
*/
#line 900 "UpgradeLexer.cpp"
#line 907 "UpgradeLexer.cpp"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -1047,10 +1054,10 @@ YY_DECL
register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
#line 94 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 1054 "UpgradeLexer.cpp"
#line 1061 "UpgradeLexer.cpp"
if ( yy_init )
{
@ -1143,571 +1150,571 @@ do_action: /* This label is used only to access EOF actions. */
{ /* beginning of action switch */
case 1:
YY_RULE_SETUP
#line 96 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ /* Ignore comments for now */ }
YY_BREAK
case 2:
YY_RULE_SETUP
#line 98 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BEGINTOK); }
YY_BREAK
case 3:
YY_RULE_SETUP
#line 99 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ENDTOK); }
YY_BREAK
case 4:
YY_RULE_SETUP
#line 100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRUETOK); }
YY_BREAK
case 5:
YY_RULE_SETUP
#line 101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FALSETOK); }
YY_BREAK
case 6:
YY_RULE_SETUP
#line 102 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DECLARE); }
YY_BREAK
case 7:
YY_RULE_SETUP
#line 103 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( GLOBAL); }
YY_BREAK
case 8:
YY_RULE_SETUP
#line 104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CONSTANT); }
YY_BREAK
case 9:
YY_RULE_SETUP
#line 105 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INTERNAL); }
YY_BREAK
case 10:
YY_RULE_SETUP
#line 106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LINKONCE); }
YY_BREAK
case 11:
YY_RULE_SETUP
#line 107 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( WEAK); }
YY_BREAK
case 12:
YY_RULE_SETUP
#line 108 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( APPENDING); }
YY_BREAK
case 13:
YY_RULE_SETUP
#line 109 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DLLIMPORT); }
YY_BREAK
case 14:
YY_RULE_SETUP
#line 110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DLLEXPORT); }
YY_BREAK
case 15:
YY_RULE_SETUP
#line 111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTERN_WEAK); }
YY_BREAK
case 16:
YY_RULE_SETUP
#line 112 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTERNAL); }
YY_BREAK
case 17:
YY_RULE_SETUP
#line 113 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( IMPLEMENTATION); }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 114 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ZEROINITIALIZER); }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DOTDOTDOT); }
YY_BREAK
case 20:
YY_RULE_SETUP
#line 116 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNDEF); }
YY_BREAK
case 21:
YY_RULE_SETUP
#line 117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( NULL_TOK); }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 118 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TO); }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TAIL); }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 120 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TARGET); }
YY_BREAK
case 25:
YY_RULE_SETUP
#line 121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRIPLE); }
YY_BREAK
case 26:
YY_RULE_SETUP
#line 122 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DEPLIBS); }
YY_BREAK
case 27:
YY_RULE_SETUP
#line 123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ENDIAN); }
YY_BREAK
case 28:
YY_RULE_SETUP
#line 124 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( POINTERSIZE); }
YY_BREAK
case 29:
YY_RULE_SETUP
#line 125 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DATALAYOUT); }
YY_BREAK
case 30:
YY_RULE_SETUP
#line 126 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LITTLE); }
YY_BREAK
case 31:
YY_RULE_SETUP
#line 127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BIG); }
YY_BREAK
case 32:
YY_RULE_SETUP
#line 128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VOLATILE); }
YY_BREAK
case 33:
YY_RULE_SETUP
#line 129 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ALIGN); }
YY_BREAK
case 34:
YY_RULE_SETUP
#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SECTION); }
YY_BREAK
case 35:
YY_RULE_SETUP
#line 131 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MODULE); }
YY_BREAK
case 36:
YY_RULE_SETUP
#line 132 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ASM_TOK); }
YY_BREAK
case 37:
YY_RULE_SETUP
#line 133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SIDEEFFECT); }
YY_BREAK
case 38:
YY_RULE_SETUP
#line 135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CC_TOK); }
YY_BREAK
case 39:
YY_RULE_SETUP
#line 136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CCC_TOK); }
YY_BREAK
case 40:
YY_RULE_SETUP
#line 137 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CSRETCC_TOK); }
YY_BREAK
case 41:
YY_RULE_SETUP
#line 138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FASTCC_TOK); }
YY_BREAK
case 42:
YY_RULE_SETUP
#line 139 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( COLDCC_TOK); }
YY_BREAK
case 43:
YY_RULE_SETUP
#line 140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( X86_STDCALLCC_TOK); }
YY_BREAK
case 44:
YY_RULE_SETUP
#line 141 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( X86_FASTCALLCC_TOK); }
YY_BREAK
case 45:
YY_RULE_SETUP
#line 143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VOID); }
YY_BREAK
case 46:
YY_RULE_SETUP
#line 144 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BOOL); }
YY_BREAK
case 47:
YY_RULE_SETUP
#line 145 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SBYTE); }
YY_BREAK
case 48:
YY_RULE_SETUP
#line 146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UBYTE); }
YY_BREAK
case 49:
YY_RULE_SETUP
#line 147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHORT); }
YY_BREAK
case 50:
YY_RULE_SETUP
#line 148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( USHORT); }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 149 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INT); }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 150 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UINT); }
YY_BREAK
case 53:
YY_RULE_SETUP
#line 151 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LONG); }
YY_BREAK
case 54:
YY_RULE_SETUP
#line 152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ULONG); }
YY_BREAK
case 55:
YY_RULE_SETUP
#line 153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FLOAT); }
YY_BREAK
case 56:
YY_RULE_SETUP
#line 154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( DOUBLE); }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABEL); }
YY_BREAK
case 58:
YY_RULE_SETUP
#line 156 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TYPE); }
YY_BREAK
case 59:
YY_RULE_SETUP
#line 157 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( OPAQUE); }
YY_BREAK
case 60:
YY_RULE_SETUP
#line 159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ADD); }
YY_BREAK
case 61:
YY_RULE_SETUP
#line 160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SUB); }
YY_BREAK
case 62:
YY_RULE_SETUP
#line 161 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MUL); }
YY_BREAK
case 63:
YY_RULE_SETUP
#line 162 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UDIV); }
YY_BREAK
case 64:
YY_RULE_SETUP
#line 163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UDIV); }
YY_BREAK
case 65:
YY_RULE_SETUP
#line 164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SDIV); }
YY_BREAK
case 66:
YY_RULE_SETUP
#line 165 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FDIV); }
YY_BREAK
case 67:
YY_RULE_SETUP
#line 166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UREM); }
YY_BREAK
case 68:
YY_RULE_SETUP
#line 167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UREM); }
YY_BREAK
case 69:
YY_RULE_SETUP
#line 168 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SREM); }
YY_BREAK
case 70:
YY_RULE_SETUP
#line 169 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FREM); }
YY_BREAK
case 71:
YY_RULE_SETUP
#line 170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( AND); }
YY_BREAK
case 72:
YY_RULE_SETUP
#line 171 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( OR); }
YY_BREAK
case 73:
YY_RULE_SETUP
#line 172 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 179 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( XOR); }
YY_BREAK
case 74:
YY_RULE_SETUP
#line 173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETNE); }
YY_BREAK
case 75:
YY_RULE_SETUP
#line 174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETEQ); }
YY_BREAK
case 76:
YY_RULE_SETUP
#line 175 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETLT); }
YY_BREAK
case 77:
YY_RULE_SETUP
#line 176 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETGT); }
YY_BREAK
case 78:
YY_RULE_SETUP
#line 177 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETLE); }
YY_BREAK
case 79:
YY_RULE_SETUP
#line 178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SETGE); }
YY_BREAK
case 80:
YY_RULE_SETUP
#line 180 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( PHI_TOK); }
YY_BREAK
case 81:
YY_RULE_SETUP
#line 181 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( CALL); }
YY_BREAK
case 82:
YY_RULE_SETUP
#line 182 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( TRUNC); }
YY_BREAK
case 83:
YY_RULE_SETUP
#line 183 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SELECT); }
YY_BREAK
case 84:
YY_RULE_SETUP
#line 184 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHL); }
YY_BREAK
case 85:
YY_RULE_SETUP
#line 185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LSHR); }
YY_BREAK
case 86:
YY_RULE_SETUP
#line 186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ASHR); }
YY_BREAK
case 87:
YY_RULE_SETUP
#line 187 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VAARG); }
YY_BREAK
case 88:
YY_RULE_SETUP
#line 188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( RET); }
YY_BREAK
case 89:
YY_RULE_SETUP
#line 189 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( BR); }
YY_BREAK
case 90:
YY_RULE_SETUP
#line 190 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SWITCH); }
YY_BREAK
case 91:
YY_RULE_SETUP
#line 191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INVOKE); }
YY_BREAK
case 92:
YY_RULE_SETUP
#line 192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNWIND); }
YY_BREAK
case 93:
YY_RULE_SETUP
#line 193 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UNREACHABLE); }
YY_BREAK
case 94:
YY_RULE_SETUP
#line 195 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( MALLOC); }
YY_BREAK
case 95:
YY_RULE_SETUP
#line 196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ALLOCA); }
YY_BREAK
case 96:
YY_RULE_SETUP
#line 197 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FREE); }
YY_BREAK
case 97:
YY_RULE_SETUP
#line 198 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LOAD); }
YY_BREAK
case 98:
YY_RULE_SETUP
#line 199 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 206 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( STORE); }
YY_BREAK
case 99:
YY_RULE_SETUP
#line 200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( GETELEMENTPTR); }
YY_BREAK
case 100:
YY_RULE_SETUP
#line 202 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EXTRACTELEMENT); }
YY_BREAK
case 101:
YY_RULE_SETUP
#line 203 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( INSERTELEMENT); }
YY_BREAK
case 102:
YY_RULE_SETUP
#line 204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SHUFFLEVECTOR); }
YY_BREAK
case 103:
YY_RULE_SETUP
#line 207 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( VAR_ID); }
YY_BREAK
case 104:
YY_RULE_SETUP
#line 208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABELSTR); }
YY_BREAK
case 105:
YY_RULE_SETUP
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( LABELSTR); }
YY_BREAK
case 106:
YY_RULE_SETUP
#line 210 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( STRINGCONSTANT ); }
YY_BREAK
case 107:
YY_RULE_SETUP
#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( EUINT64VAL ); }
YY_BREAK
case 108:
YY_RULE_SETUP
#line 212 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 219 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( ESINT64VAL ); }
YY_BREAK
case 109:
YY_RULE_SETUP
#line 213 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( yytext[0] == 's' ? ESINT64VAL : EUINT64VAL ); }
YY_BREAK
case 110:
YY_RULE_SETUP
#line 214 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 221 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( UINTVAL); }
YY_BREAK
case 111:
YY_RULE_SETUP
#line 215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( SINTVAL); }
YY_BREAK
case 112:
YY_RULE_SETUP
#line 216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FPVAL); }
YY_BREAK
case 113:
YY_RULE_SETUP
#line 217 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 224 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ RET_TOK( FPVAL); }
YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 225 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{
/* Make sure to free the internal buffers for flex when we are
* done reading our input!
@ -1718,20 +1725,20 @@ case YY_STATE_EOF(INITIAL):
YY_BREAK
case 114:
YY_RULE_SETUP
#line 226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ /* Ignore whitespace */ }
YY_BREAK
case 115:
YY_RULE_SETUP
#line 227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
{ return yytext[0]; }
YY_BREAK
case 116:
YY_RULE_SETUP
#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1735 "UpgradeLexer.cpp"
#line 1742 "UpgradeLexer.cpp"
case YY_END_OF_BUFFER:
{
@ -2609,5 +2616,5 @@ int main()
return 0;
}
#endif
#line 229 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"
#line 236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeLexer.l"

View File

@ -32,16 +32,23 @@
#include <cctype>
#include <cstdlib>
void set_scan_bytes (const char * str, size_t len) {
Upgrade_scan_bytes (str, len);
}
static void trim(std::string& str) {
size_t startpos = str.find_first_not_of(" \t\n\r",0);
if (startpos != std::string::npos)
str.erase(0,startpos);
}
#define YY_INPUT(buf,result,max_size) \
{ \
if (LexInput->good() && !LexInput->eof()) { \
LexInput->read(buf,max_size); \
result = LexInput->gcount(); \
} else {\
result = YY_NULL; \
} \
}
// Construct a token value for a non-obsolete token
#define RET_TOK(sym) \
Upgradelval = new std::string(yytext); \

View File

@ -1,13 +1,13 @@
/*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===//
/*===-- UpgradeLexer.l - Scanner for 1.9 assembly files --------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
// 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 implements the flex scanner for LLVM assembly languages files.
// This file implements the flex scanner for LLVM 1.9 assembly languages files.
//
//===----------------------------------------------------------------------===*/
@ -32,16 +32,23 @@
#include <cctype>
#include <cstdlib>
void set_scan_bytes (const char * str, size_t len) {
Upgrade_scan_bytes (str, len);
}
static void trim(std::string& str) {
size_t startpos = str.find_first_not_of(" \t\n\r",0);
if (startpos != std::string::npos)
str.erase(0,startpos);
}
#define YY_INPUT(buf,result,max_size) \
{ \
if (LexInput->good() && !LexInput->eof()) { \
LexInput->read(buf,max_size); \
result = LexInput->gcount(); \
} else {\
result = YY_NULL; \
} \
}
// Construct a token value for a non-obsolete token
#define RET_TOK(sym) \
Upgradelval = new std::string(yytext); \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,12 +17,12 @@
#include "ParserInternals.h"
#include <llvm/ADT/StringExtras.h>
#include <llvm/System/MappedFile.h>
#include <algorithm>
#include <list>
#include <utility>
#include <iostream>
#define YYINCLUDED_STDLIB_H
int yylex(); // declaration" of xxx warnings.
int yyparse();
@ -31,19 +31,14 @@ static std::string CurFilename;
static std::ostream *O = 0;
void UpgradeAssembly(const std::string &infile, std::ostream &out)
std::istream* LexInput = 0;
void UpgradeAssembly(const std::string &infile, std::istream& in,
std::ostream &out)
{
Upgradelineno = 1;
CurFilename = infile;
llvm::sys::Path p(infile);
llvm::sys::MappedFile mf;
mf.open(p);
mf.map();
const char* base = mf.charBase();
size_t sz = mf.size();
set_scan_bytes(base, sz);
LexInput = &in;
O = &out;
if (yyparse()) {

View File

@ -1,4 +1,4 @@
//===-- upgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===//
//===-- UpgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
// This file implements the bison parser for LLVM assembly language upgrade.
// This file implements the bison parser for LLVM 1.9 assembly language.
//
//===----------------------------------------------------------------------===//
@ -17,12 +17,12 @@
#include "ParserInternals.h"
#include <llvm/ADT/StringExtras.h>
#include <llvm/System/MappedFile.h>
#include <algorithm>
#include <list>
#include <utility>
#include <iostream>
#define YYINCLUDED_STDLIB_H
int yylex(); // declaration" of xxx warnings.
int yyparse();
@ -31,19 +31,14 @@ static std::string CurFilename;
static std::ostream *O = 0;
void UpgradeAssembly(const std::string &infile, std::ostream &out)
std::istream* LexInput = 0;
void UpgradeAssembly(const std::string &infile, std::istream& in,
std::ostream &out)
{
Upgradelineno = 1;
CurFilename = infile;
llvm::sys::Path p(infile);
llvm::sys::MappedFile mf;
mf.open(p);
mf.map();
const char* base = mf.charBase();
size_t sz = mf.size();
set_scan_bytes(base, sz);
LexInput = &in;
O = &out;
if (yyparse()) {

View File

@ -34,7 +34,7 @@ InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"),
cl::value_desc("filename"));
cl::value_desc("filename"), cl::init("-"));
static cl::opt<bool>
Force("f", cl::desc("Overwrite output files"));
@ -45,6 +45,7 @@ int main(int argc, char **argv) {
int exitCode = 0;
std::ostream *Out = 0;
std::istream *In = 0;
try {
if (OutputFilename != "") { // Specified an output filename?
if (OutputFilename != "-") { // Not stdout?
@ -84,25 +85,35 @@ int main(int argc, char **argv) {
}
Out = new std::ofstream(OutputFilename.c_str(), std::ios::out |
std::ios::trunc | std::ios::binary);
std::ios::trunc);
// Make sure that the Out file gets unlinked from the disk if we get a
// SIGINT
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
}
}
if (InputFilename == "-") {
In = &std::cin;
InputFilename = "<stdin>";
} else {
In = new std::ifstream(InputFilename.c_str());
}
if (!Out->good()) {
llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
return 1;
}
UpgradeAssembly(InputFilename, *Out);
if (!In->good()) {
llvm_cerr << argv[0] << ": error opening " << InputFilename << "!\n";
return 1;
}
UpgradeAssembly(InputFilename, *In, *Out);
/*
} catch (const std::string& caught_message) {
llvm_cerr << argv[0] << ": " << caught_message << "\n";
exitCode = 1;
*/
} catch (...) {
llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
exitCode = 1;