Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 1 | /* A Bison parser, made by GNU Bison 2.3. */ |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 2 | |
Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 3 | /* Skeleton interface for Bison's Yacc-like parsers in C |
| 4 | |
| 5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
| 6 | Free Software Foundation, Inc. |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 7 | |
| 8 | This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2, or (at your option) |
| 11 | any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; if not, write to the Free Software |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 | Boston, MA 02110-1301, USA. */ |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 22 | |
Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 23 | /* As a special exception, you may create a larger work that contains |
| 24 | part or all of the Bison parser skeleton and distribute that work |
| 25 | under terms of your choice, so long as that work isn't itself a |
| 26 | parser generator using the skeleton or a modified version thereof |
| 27 | as a parser skeleton. Alternatively, if you modify or redistribute |
| 28 | the parser skeleton itself, you may (at your option) remove this |
| 29 | special exception, which will cause the skeleton and the resulting |
| 30 | Bison output files to be licensed under the GNU General Public |
| 31 | License without this special exception. |
| 32 | |
| 33 | This special exception was added by the Free Software Foundation in |
| 34 | version 2.2 of Bison. */ |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 35 | |
| 36 | /* Tokens. */ |
| 37 | #ifndef YYTOKENTYPE |
| 38 | # define YYTOKENTYPE |
| 39 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
| 40 | know about them. */ |
| 41 | enum yytokentype { |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 42 | ESINT64VAL = 258, |
| 43 | EUINT64VAL = 259, |
| 44 | SINTVAL = 260, |
| 45 | UINTVAL = 261, |
| 46 | FPVAL = 262, |
| 47 | VOID = 263, |
| 48 | BOOL = 264, |
| 49 | SBYTE = 265, |
| 50 | UBYTE = 266, |
| 51 | SHORT = 267, |
| 52 | USHORT = 268, |
| 53 | INT = 269, |
| 54 | UINT = 270, |
| 55 | LONG = 271, |
| 56 | ULONG = 272, |
| 57 | FLOAT = 273, |
| 58 | DOUBLE = 274, |
| 59 | TYPE = 275, |
| 60 | LABEL = 276, |
| 61 | VAR_ID = 277, |
| 62 | LABELSTR = 278, |
| 63 | STRINGCONSTANT = 279, |
| 64 | IMPLEMENTATION = 280, |
| 65 | ZEROINITIALIZER = 281, |
| 66 | TRUETOK = 282, |
| 67 | FALSETOK = 283, |
| 68 | BEGINTOK = 284, |
| 69 | ENDTOK = 285, |
| 70 | DECLARE = 286, |
| 71 | GLOBAL = 287, |
| 72 | CONSTANT = 288, |
| 73 | SECTION = 289, |
| 74 | VOLATILE = 290, |
| 75 | TO = 291, |
| 76 | DOTDOTDOT = 292, |
| 77 | NULL_TOK = 293, |
| 78 | UNDEF = 294, |
| 79 | CONST = 295, |
| 80 | INTERNAL = 296, |
| 81 | LINKONCE = 297, |
| 82 | WEAK = 298, |
| 83 | APPENDING = 299, |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 84 | DLLIMPORT = 300, |
| 85 | DLLEXPORT = 301, |
| 86 | EXTERN_WEAK = 302, |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 87 | OPAQUE = 303, |
| 88 | NOT = 304, |
| 89 | EXTERNAL = 305, |
| 90 | TARGET = 306, |
| 91 | TRIPLE = 307, |
| 92 | ENDIAN = 308, |
| 93 | POINTERSIZE = 309, |
| 94 | LITTLE = 310, |
| 95 | BIG = 311, |
| 96 | ALIGN = 312, |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 97 | DEPLIBS = 313, |
| 98 | CALL = 314, |
| 99 | TAIL = 315, |
| 100 | ASM_TOK = 316, |
| 101 | MODULE = 317, |
| 102 | SIDEEFFECT = 318, |
| 103 | CC_TOK = 319, |
| 104 | CCC_TOK = 320, |
| 105 | CSRETCC_TOK = 321, |
| 106 | FASTCC_TOK = 322, |
| 107 | COLDCC_TOK = 323, |
| 108 | X86_STDCALLCC_TOK = 324, |
| 109 | X86_FASTCALLCC_TOK = 325, |
| 110 | DATALAYOUT = 326, |
| 111 | RET = 327, |
| 112 | BR = 328, |
| 113 | SWITCH = 329, |
| 114 | INVOKE = 330, |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 115 | UNREACHABLE = 331, |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 116 | UNWIND = 332, |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 117 | EXCEPT = 333, |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 118 | ADD = 334, |
| 119 | SUB = 335, |
| 120 | MUL = 336, |
| 121 | DIV = 337, |
| 122 | UDIV = 338, |
| 123 | SDIV = 339, |
| 124 | FDIV = 340, |
| 125 | REM = 341, |
| 126 | UREM = 342, |
| 127 | SREM = 343, |
| 128 | FREM = 344, |
| 129 | AND = 345, |
| 130 | OR = 346, |
| 131 | XOR = 347, |
| 132 | SETLE = 348, |
| 133 | SETGE = 349, |
| 134 | SETLT = 350, |
| 135 | SETGT = 351, |
| 136 | SETEQ = 352, |
| 137 | SETNE = 353, |
| 138 | ICMP = 354, |
| 139 | FCMP = 355, |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 140 | MALLOC = 356, |
| 141 | ALLOCA = 357, |
| 142 | FREE = 358, |
| 143 | LOAD = 359, |
| 144 | STORE = 360, |
| 145 | GETELEMENTPTR = 361, |
| 146 | PHI_TOK = 362, |
| 147 | SELECT = 363, |
| 148 | SHL = 364, |
| 149 | SHR = 365, |
| 150 | ASHR = 366, |
| 151 | LSHR = 367, |
| 152 | VAARG = 368, |
| 153 | EXTRACTELEMENT = 369, |
| 154 | INSERTELEMENT = 370, |
| 155 | SHUFFLEVECTOR = 371, |
| 156 | VAARG_old = 372, |
| 157 | VANEXT_old = 373, |
| 158 | EQ = 374, |
| 159 | NE = 375, |
| 160 | SLT = 376, |
| 161 | SGT = 377, |
| 162 | SLE = 378, |
| 163 | SGE = 379, |
| 164 | ULT = 380, |
| 165 | UGT = 381, |
| 166 | ULE = 382, |
| 167 | UGE = 383, |
| 168 | OEQ = 384, |
| 169 | ONE = 385, |
| 170 | OLT = 386, |
| 171 | OGT = 387, |
| 172 | OLE = 388, |
| 173 | OGE = 389, |
| 174 | ORD = 390, |
| 175 | UNO = 391, |
| 176 | UEQ = 392, |
| 177 | UNE = 393, |
| 178 | CAST = 394, |
| 179 | TRUNC = 395, |
| 180 | ZEXT = 396, |
| 181 | SEXT = 397, |
| 182 | FPTRUNC = 398, |
| 183 | FPEXT = 399, |
| 184 | FPTOUI = 400, |
| 185 | FPTOSI = 401, |
| 186 | UITOFP = 402, |
| 187 | SITOFP = 403, |
| 188 | PTRTOINT = 404, |
| 189 | INTTOPTR = 405, |
| 190 | BITCAST = 406 |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 191 | }; |
| 192 | #endif |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 193 | /* Tokens. */ |
| 194 | #define ESINT64VAL 258 |
| 195 | #define EUINT64VAL 259 |
| 196 | #define SINTVAL 260 |
| 197 | #define UINTVAL 261 |
| 198 | #define FPVAL 262 |
| 199 | #define VOID 263 |
| 200 | #define BOOL 264 |
| 201 | #define SBYTE 265 |
| 202 | #define UBYTE 266 |
| 203 | #define SHORT 267 |
| 204 | #define USHORT 268 |
| 205 | #define INT 269 |
| 206 | #define UINT 270 |
| 207 | #define LONG 271 |
| 208 | #define ULONG 272 |
| 209 | #define FLOAT 273 |
| 210 | #define DOUBLE 274 |
| 211 | #define TYPE 275 |
| 212 | #define LABEL 276 |
| 213 | #define VAR_ID 277 |
| 214 | #define LABELSTR 278 |
| 215 | #define STRINGCONSTANT 279 |
| 216 | #define IMPLEMENTATION 280 |
| 217 | #define ZEROINITIALIZER 281 |
| 218 | #define TRUETOK 282 |
| 219 | #define FALSETOK 283 |
| 220 | #define BEGINTOK 284 |
| 221 | #define ENDTOK 285 |
| 222 | #define DECLARE 286 |
| 223 | #define GLOBAL 287 |
| 224 | #define CONSTANT 288 |
| 225 | #define SECTION 289 |
| 226 | #define VOLATILE 290 |
| 227 | #define TO 291 |
| 228 | #define DOTDOTDOT 292 |
| 229 | #define NULL_TOK 293 |
| 230 | #define UNDEF 294 |
| 231 | #define CONST 295 |
| 232 | #define INTERNAL 296 |
| 233 | #define LINKONCE 297 |
| 234 | #define WEAK 298 |
| 235 | #define APPENDING 299 |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 236 | #define DLLIMPORT 300 |
| 237 | #define DLLEXPORT 301 |
| 238 | #define EXTERN_WEAK 302 |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 239 | #define OPAQUE 303 |
| 240 | #define NOT 304 |
| 241 | #define EXTERNAL 305 |
| 242 | #define TARGET 306 |
| 243 | #define TRIPLE 307 |
| 244 | #define ENDIAN 308 |
| 245 | #define POINTERSIZE 309 |
| 246 | #define LITTLE 310 |
| 247 | #define BIG 311 |
| 248 | #define ALIGN 312 |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 249 | #define DEPLIBS 313 |
| 250 | #define CALL 314 |
| 251 | #define TAIL 315 |
| 252 | #define ASM_TOK 316 |
| 253 | #define MODULE 317 |
| 254 | #define SIDEEFFECT 318 |
| 255 | #define CC_TOK 319 |
| 256 | #define CCC_TOK 320 |
| 257 | #define CSRETCC_TOK 321 |
| 258 | #define FASTCC_TOK 322 |
| 259 | #define COLDCC_TOK 323 |
| 260 | #define X86_STDCALLCC_TOK 324 |
| 261 | #define X86_FASTCALLCC_TOK 325 |
| 262 | #define DATALAYOUT 326 |
| 263 | #define RET 327 |
| 264 | #define BR 328 |
| 265 | #define SWITCH 329 |
| 266 | #define INVOKE 330 |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 267 | #define UNREACHABLE 331 |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 268 | #define UNWIND 332 |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 269 | #define EXCEPT 333 |
Reid Spencer | c4d9625 | 2007-01-13 00:03:30 +0000 | [diff] [blame] | 270 | #define ADD 334 |
| 271 | #define SUB 335 |
| 272 | #define MUL 336 |
| 273 | #define DIV 337 |
| 274 | #define UDIV 338 |
| 275 | #define SDIV 339 |
| 276 | #define FDIV 340 |
| 277 | #define REM 341 |
| 278 | #define UREM 342 |
| 279 | #define SREM 343 |
| 280 | #define FREM 344 |
| 281 | #define AND 345 |
| 282 | #define OR 346 |
| 283 | #define XOR 347 |
| 284 | #define SETLE 348 |
| 285 | #define SETGE 349 |
| 286 | #define SETLT 350 |
| 287 | #define SETGT 351 |
| 288 | #define SETEQ 352 |
| 289 | #define SETNE 353 |
| 290 | #define ICMP 354 |
| 291 | #define FCMP 355 |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 292 | #define MALLOC 356 |
| 293 | #define ALLOCA 357 |
| 294 | #define FREE 358 |
| 295 | #define LOAD 359 |
| 296 | #define STORE 360 |
| 297 | #define GETELEMENTPTR 361 |
| 298 | #define PHI_TOK 362 |
| 299 | #define SELECT 363 |
| 300 | #define SHL 364 |
| 301 | #define SHR 365 |
| 302 | #define ASHR 366 |
| 303 | #define LSHR 367 |
| 304 | #define VAARG 368 |
| 305 | #define EXTRACTELEMENT 369 |
| 306 | #define INSERTELEMENT 370 |
| 307 | #define SHUFFLEVECTOR 371 |
| 308 | #define VAARG_old 372 |
| 309 | #define VANEXT_old 373 |
| 310 | #define EQ 374 |
| 311 | #define NE 375 |
| 312 | #define SLT 376 |
| 313 | #define SGT 377 |
| 314 | #define SLE 378 |
| 315 | #define SGE 379 |
| 316 | #define ULT 380 |
| 317 | #define UGT 381 |
| 318 | #define ULE 382 |
| 319 | #define UGE 383 |
| 320 | #define OEQ 384 |
| 321 | #define ONE 385 |
| 322 | #define OLT 386 |
| 323 | #define OGT 387 |
| 324 | #define OLE 388 |
| 325 | #define OGE 389 |
| 326 | #define ORD 390 |
| 327 | #define UNO 391 |
| 328 | #define UEQ 392 |
| 329 | #define UNE 393 |
| 330 | #define CAST 394 |
| 331 | #define TRUNC 395 |
| 332 | #define ZEXT 396 |
| 333 | #define SEXT 397 |
| 334 | #define FPTRUNC 398 |
| 335 | #define FPEXT 399 |
| 336 | #define FPTOUI 400 |
| 337 | #define FPTOSI 401 |
| 338 | #define UITOFP 402 |
| 339 | #define SITOFP 403 |
| 340 | #define PTRTOINT 404 |
| 341 | #define INTTOPTR 405 |
| 342 | #define BITCAST 406 |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 343 | |
| 344 | |
| 345 | |
| 346 | |
Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 347 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
| 348 | typedef union YYSTYPE |
Anton Korobeynikov | ce13b85 | 2007-01-28 15:25:24 +0000 | [diff] [blame] | 349 | #line 1391 "/home/asl/proj/llvm/src/tools/llvm-upgrade/UpgradeParser.y" |
Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 350 | { |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 351 | llvm::Module *ModuleVal; |
| 352 | llvm::Function *FunctionVal; |
| 353 | std::pair<llvm::PATypeInfo, char*> *ArgVal; |
| 354 | llvm::BasicBlock *BasicBlockVal; |
| 355 | llvm::TerminatorInst *TermInstVal; |
| 356 | llvm::InstrInfo InstVal; |
| 357 | llvm::ConstInfo ConstVal; |
| 358 | llvm::ValueInfo ValueVal; |
| 359 | llvm::PATypeInfo TypeVal; |
| 360 | llvm::TypeInfo PrimType; |
| 361 | llvm::PHIListInfo PHIList; |
| 362 | std::list<llvm::PATypeInfo> *TypeList; |
| 363 | std::vector<llvm::ValueInfo> *ValueList; |
| 364 | std::vector<llvm::ConstInfo> *ConstVector; |
| 365 | |
| 366 | |
| 367 | std::vector<std::pair<llvm::PATypeInfo,char*> > *ArgList; |
| 368 | // Represent the RHS of PHI node |
| 369 | std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable; |
| 370 | |
| 371 | llvm::GlobalValue::LinkageTypes Linkage; |
| 372 | int64_t SInt64Val; |
| 373 | uint64_t UInt64Val; |
| 374 | int SIntVal; |
| 375 | unsigned UIntVal; |
| 376 | double FPVal; |
| 377 | bool BoolVal; |
| 378 | |
| 379 | char *StrVal; // This memory is strdup'd! |
| 380 | llvm::ValID ValIDVal; // strdup'd memory maybe! |
| 381 | |
| 382 | llvm::BinaryOps BinaryOpVal; |
| 383 | llvm::TermOps TermOpVal; |
| 384 | llvm::MemoryOps MemOpVal; |
| 385 | llvm::OtherOps OtherOpVal; |
| 386 | llvm::CastOps CastOpVal; |
| 387 | llvm::ICmpInst::Predicate IPred; |
| 388 | llvm::FCmpInst::Predicate FPred; |
| 389 | llvm::Module::Endianness Endianness; |
Anton Korobeynikov | 9adeaa2 | 2007-01-28 13:37:39 +0000 | [diff] [blame] | 390 | } |
| 391 | /* Line 1489 of yacc.c. */ |
| 392 | #line 393 "UpgradeParser.tab.h" |
| 393 | YYSTYPE; |
Reid Spencer | 950bf60 | 2007-01-26 08:19:09 +0000 | [diff] [blame] | 394 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
| 395 | # define YYSTYPE_IS_DECLARED 1 |
| 396 | # define YYSTYPE_IS_TRIVIAL 1 |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 397 | #endif |
Reid Spencer | e7c3c60 | 2006-11-30 06:36:44 +0000 | [diff] [blame] | 398 | |
| 399 | extern YYSTYPE Upgradelval; |
Reid Spencer | 319a730 | 2007-01-05 17:20:02 +0000 | [diff] [blame] | 400 | |