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