blob: 323672383940a7336d8844ea5cb22f2fb7e83a30 [file] [log] [blame]
Reid Spencere7c3c602006-11-30 06:36:44 +00001/* 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/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Bison version. */
40#define YYBISON_VERSION "2.1"
41
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
44
45/* Pure parsers. */
46#define YYPURE 0
47
48/* Using locations. */
49#define YYLSP_NEEDED 0
50
51/* Substitute the variable and function names. */
52#define yyparse Upgradeparse
53#define yylex Upgradelex
54#define yyerror Upgradeerror
55#define yylval Upgradelval
56#define yychar Upgradechar
57#define yydebug Upgradedebug
58#define yynerrs Upgradenerrs
59
60
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
Reid Spencerf2d55322006-12-01 21:52:30 +000067 VOID = 258,
68 BOOL = 259,
69 SBYTE = 260,
70 UBYTE = 261,
71 SHORT = 262,
72 USHORT = 263,
73 INT = 264,
74 UINT = 265,
75 LONG = 266,
76 ULONG = 267,
77 FLOAT = 268,
78 DOUBLE = 269,
79 LABEL = 270,
80 OPAQUE = 271,
81 ESINT64VAL = 272,
82 EUINT64VAL = 273,
83 SINTVAL = 274,
84 UINTVAL = 275,
85 FPVAL = 276,
86 NULL_TOK = 277,
87 UNDEF = 278,
88 ZEROINITIALIZER = 279,
89 TRUETOK = 280,
90 FALSETOK = 281,
Reid Spencere77e35e2006-12-01 20:26:20 +000091 TYPE = 282,
92 VAR_ID = 283,
93 LABELSTR = 284,
94 STRINGCONSTANT = 285,
95 IMPLEMENTATION = 286,
96 BEGINTOK = 287,
97 ENDTOK = 288,
98 DECLARE = 289,
99 GLOBAL = 290,
100 CONSTANT = 291,
101 SECTION = 292,
102 VOLATILE = 293,
103 TO = 294,
104 DOTDOTDOT = 295,
105 CONST = 296,
106 INTERNAL = 297,
107 LINKONCE = 298,
108 WEAK = 299,
Reid Spencere7c3c602006-11-30 06:36:44 +0000109 DLLIMPORT = 300,
110 DLLEXPORT = 301,
111 EXTERN_WEAK = 302,
Reid Spencere77e35e2006-12-01 20:26:20 +0000112 APPENDING = 303,
Reid Spencere7c3c602006-11-30 06:36:44 +0000113 NOT = 304,
114 EXTERNAL = 305,
115 TARGET = 306,
116 TRIPLE = 307,
117 ENDIAN = 308,
118 POINTERSIZE = 309,
119 LITTLE = 310,
120 BIG = 311,
121 ALIGN = 312,
Reid Spencer78720742006-12-02 20:21:22 +0000122 UNINITIALIZED = 313,
123 DEPLIBS = 314,
124 CALL = 315,
125 TAIL = 316,
126 ASM_TOK = 317,
127 MODULE = 318,
128 SIDEEFFECT = 319,
129 CC_TOK = 320,
130 CCC_TOK = 321,
131 CSRETCC_TOK = 322,
132 FASTCC_TOK = 323,
133 COLDCC_TOK = 324,
134 X86_STDCALLCC_TOK = 325,
135 X86_FASTCALLCC_TOK = 326,
136 DATALAYOUT = 327,
137 RET = 328,
138 BR = 329,
139 SWITCH = 330,
140 INVOKE = 331,
141 EXCEPT = 332,
142 UNWIND = 333,
143 UNREACHABLE = 334,
144 ADD = 335,
145 SUB = 336,
146 MUL = 337,
147 DIV = 338,
148 UDIV = 339,
149 SDIV = 340,
150 FDIV = 341,
151 REM = 342,
152 UREM = 343,
153 SREM = 344,
154 FREM = 345,
155 AND = 346,
156 OR = 347,
157 XOR = 348,
158 SETLE = 349,
159 SETGE = 350,
160 SETLT = 351,
161 SETGT = 352,
162 SETEQ = 353,
163 SETNE = 354,
Reid Spencer229e9362006-12-02 22:14:11 +0000164 ICMP = 355,
165 FCMP = 356,
166 EQ = 357,
167 NE = 358,
168 SLT = 359,
169 SGT = 360,
170 SLE = 361,
171 SGE = 362,
172 OEQ = 363,
173 ONE = 364,
174 OLT = 365,
175 OGT = 366,
176 OLE = 367,
177 OGE = 368,
178 ORD = 369,
179 UNO = 370,
180 UEQ = 371,
181 UNE = 372,
182 ULT = 373,
183 UGT = 374,
184 ULE = 375,
185 UGE = 376,
186 MALLOC = 377,
187 ALLOCA = 378,
188 FREE = 379,
189 LOAD = 380,
190 STORE = 381,
191 GETELEMENTPTR = 382,
192 PHI_TOK = 383,
193 SELECT = 384,
194 SHL = 385,
195 SHR = 386,
196 ASHR = 387,
197 LSHR = 388,
198 VAARG = 389,
199 EXTRACTELEMENT = 390,
200 INSERTELEMENT = 391,
201 SHUFFLEVECTOR = 392,
202 CAST = 393,
203 TRUNC = 394,
204 ZEXT = 395,
205 SEXT = 396,
206 FPTRUNC = 397,
207 FPEXT = 398,
208 FPTOUI = 399,
209 FPTOSI = 400,
210 UITOFP = 401,
211 SITOFP = 402,
212 PTRTOINT = 403,
213 INTTOPTR = 404,
214 BITCAST = 405
Reid Spencere7c3c602006-11-30 06:36:44 +0000215 };
216#endif
217/* Tokens. */
Reid Spencerf2d55322006-12-01 21:52:30 +0000218#define VOID 258
219#define BOOL 259
220#define SBYTE 260
221#define UBYTE 261
222#define SHORT 262
223#define USHORT 263
224#define INT 264
225#define UINT 265
226#define LONG 266
227#define ULONG 267
228#define FLOAT 268
229#define DOUBLE 269
230#define LABEL 270
231#define OPAQUE 271
232#define ESINT64VAL 272
233#define EUINT64VAL 273
234#define SINTVAL 274
235#define UINTVAL 275
236#define FPVAL 276
237#define NULL_TOK 277
238#define UNDEF 278
239#define ZEROINITIALIZER 279
240#define TRUETOK 280
241#define FALSETOK 281
Reid Spencere77e35e2006-12-01 20:26:20 +0000242#define TYPE 282
243#define VAR_ID 283
244#define LABELSTR 284
245#define STRINGCONSTANT 285
246#define IMPLEMENTATION 286
247#define BEGINTOK 287
248#define ENDTOK 288
249#define DECLARE 289
250#define GLOBAL 290
251#define CONSTANT 291
252#define SECTION 292
253#define VOLATILE 293
254#define TO 294
255#define DOTDOTDOT 295
256#define CONST 296
257#define INTERNAL 297
258#define LINKONCE 298
259#define WEAK 299
Reid Spencere7c3c602006-11-30 06:36:44 +0000260#define DLLIMPORT 300
261#define DLLEXPORT 301
262#define EXTERN_WEAK 302
Reid Spencere77e35e2006-12-01 20:26:20 +0000263#define APPENDING 303
Reid Spencere7c3c602006-11-30 06:36:44 +0000264#define NOT 304
265#define EXTERNAL 305
266#define TARGET 306
267#define TRIPLE 307
268#define ENDIAN 308
269#define POINTERSIZE 309
270#define LITTLE 310
271#define BIG 311
272#define ALIGN 312
Reid Spencer78720742006-12-02 20:21:22 +0000273#define UNINITIALIZED 313
274#define DEPLIBS 314
275#define CALL 315
276#define TAIL 316
277#define ASM_TOK 317
278#define MODULE 318
279#define SIDEEFFECT 319
280#define CC_TOK 320
281#define CCC_TOK 321
282#define CSRETCC_TOK 322
283#define FASTCC_TOK 323
284#define COLDCC_TOK 324
285#define X86_STDCALLCC_TOK 325
286#define X86_FASTCALLCC_TOK 326
287#define DATALAYOUT 327
288#define RET 328
289#define BR 329
290#define SWITCH 330
291#define INVOKE 331
292#define EXCEPT 332
293#define UNWIND 333
294#define UNREACHABLE 334
295#define ADD 335
296#define SUB 336
297#define MUL 337
298#define DIV 338
299#define UDIV 339
300#define SDIV 340
301#define FDIV 341
302#define REM 342
303#define UREM 343
304#define SREM 344
305#define FREM 345
306#define AND 346
307#define OR 347
308#define XOR 348
309#define SETLE 349
310#define SETGE 350
311#define SETLT 351
312#define SETGT 352
313#define SETEQ 353
314#define SETNE 354
Reid Spencer229e9362006-12-02 22:14:11 +0000315#define ICMP 355
316#define FCMP 356
317#define EQ 357
318#define NE 358
319#define SLT 359
320#define SGT 360
321#define SLE 361
322#define SGE 362
323#define OEQ 363
324#define ONE 364
325#define OLT 365
326#define OGT 366
327#define OLE 367
328#define OGE 368
329#define ORD 369
330#define UNO 370
331#define UEQ 371
332#define UNE 372
333#define ULT 373
334#define UGT 374
335#define ULE 375
336#define UGE 376
337#define MALLOC 377
338#define ALLOCA 378
339#define FREE 379
340#define LOAD 380
341#define STORE 381
342#define GETELEMENTPTR 382
343#define PHI_TOK 383
344#define SELECT 384
345#define SHL 385
346#define SHR 386
347#define ASHR 387
348#define LSHR 388
349#define VAARG 389
350#define EXTRACTELEMENT 390
351#define INSERTELEMENT 391
352#define SHUFFLEVECTOR 392
353#define CAST 393
354#define TRUNC 394
355#define ZEXT 395
356#define SEXT 396
357#define FPTRUNC 397
358#define FPEXT 398
359#define FPTOUI 399
360#define FPTOSI 400
361#define UITOFP 401
362#define SITOFP 402
363#define PTRTOINT 403
364#define INTTOPTR 404
365#define BITCAST 405
Reid Spencere7c3c602006-11-30 06:36:44 +0000366
367
368
369
370/* Copy the first part of user declarations. */
371#line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
372
Reid Spencere7c3c602006-11-30 06:36:44 +0000373#include "ParserInternals.h"
374#include <llvm/ADT/StringExtras.h>
Reid Spencere7c3c602006-11-30 06:36:44 +0000375#include <algorithm>
Reid Spencera50d5962006-12-02 04:11:07 +0000376#include <map>
Reid Spencere7c3c602006-11-30 06:36:44 +0000377#include <utility>
378#include <iostream>
Reid Spencerbec0b592006-12-03 03:16:48 +0000379#include <cassert>
Reid Spencere7c3c602006-11-30 06:36:44 +0000380
Reid Spencere77e35e2006-12-01 20:26:20 +0000381#define YYERROR_VERBOSE 1
Reid Spencer96839be2006-11-30 16:50:26 +0000382#define YYINCLUDED_STDLIB_H
Reid Spencere77e35e2006-12-01 20:26:20 +0000383#define YYDEBUG 1
Reid Spencerbec0b592006-12-03 03:16:48 +0000384#define UPGRADE_SETCOND_OPS 0
Reid Spencere7c3c602006-11-30 06:36:44 +0000385
386int yylex(); // declaration" of xxx warnings.
387int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000388extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000389
390static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000391static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000392std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000393unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000394static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000395
Reid Spencera50d5962006-12-02 04:11:07 +0000396typedef std::vector<TypeInfo> TypeVector;
397static TypeVector EnumeratedTypes;
398typedef std::map<std::string,TypeInfo> TypeMap;
399static TypeMap NamedTypes;
400
Reid Spencerf8483652006-12-02 15:16:01 +0000401void destroy(ValueList* VL) {
402 while (!VL->empty()) {
403 ValueInfo& VI = VL->back();
404 VI.destroy();
405 VL->pop_back();
406 }
407 delete VL;
408}
409
Reid Spencer96839be2006-11-30 16:50:26 +0000410void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencere77e35e2006-12-01 20:26:20 +0000411 std::ostream &out, bool debug)
Reid Spencere7c3c602006-11-30 06:36:44 +0000412{
413 Upgradelineno = 1;
414 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000415 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000416 yydebug = debug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000417 O = &out;
418
419 if (yyparse()) {
420 std::cerr << "Parse failed.\n";
421 exit(1);
422 }
423}
424
Reid Spencera50d5962006-12-02 04:11:07 +0000425static void ResolveType(TypeInfo& Ty) {
426 if (Ty.oldTy == UnresolvedTy) {
427 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
Reid Spencer78720742006-12-02 20:21:22 +0000428 if (I != NamedTypes.end()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000429 Ty.oldTy = I->second.oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000430 Ty.elemTy = I->second.elemTy;
431 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000432 std::string msg("Can't resolve type: ");
433 msg += *Ty.newTy;
434 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000435 }
Reid Spencera50d5962006-12-02 04:11:07 +0000436 } else if (Ty.oldTy == NumericTy) {
437 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
438 if (ref < EnumeratedTypes.size()) {
439 Ty.oldTy = EnumeratedTypes[ref].oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000440 Ty.elemTy = EnumeratedTypes[ref].elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +0000441 } else {
442 std::string msg("Can't resolve type: ");
443 msg += *Ty.newTy;
444 yyerror(msg.c_str());
445 }
Reid Spencer280d8012006-12-01 23:40:53 +0000446 }
Reid Spencera50d5962006-12-02 04:11:07 +0000447 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000448}
449
Reid Spencera50d5962006-12-02 04:11:07 +0000450static const char* getCastOpcode(
451 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
452{
Reid Spencere77e35e2006-12-01 20:26:20 +0000453 unsigned SrcBits = SrcTy.getBitWidth();
454 unsigned DstBits = DstTy.getBitWidth();
455 const char* opcode = "bitcast";
456 // Run through the possibilities ...
457 if (DstTy.isIntegral()) { // Casting to integral
458 if (SrcTy.isIntegral()) { // Casting from integral
459 if (DstBits < SrcBits)
460 opcode = "trunc";
461 else if (DstBits > SrcBits) { // its an extension
462 if (SrcTy.isSigned())
463 opcode ="sext"; // signed -> SEXT
464 else
465 opcode = "zext"; // unsigned -> ZEXT
466 } else {
467 opcode = "bitcast"; // Same size, No-op cast
468 }
469 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
470 if (DstTy.isSigned())
471 opcode = "fptosi"; // FP -> sint
472 else
473 opcode = "fptoui"; // FP -> uint
474 } else if (SrcTy.isPacked()) {
475 assert(DstBits == SrcTy.getBitWidth() &&
476 "Casting packed to integer of different width");
477 opcode = "bitcast"; // same size, no-op cast
478 } else {
479 assert(SrcTy.isPointer() &&
480 "Casting from a value that is not first-class type");
481 opcode = "ptrtoint"; // ptr -> int
482 }
483 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
484 if (SrcTy.isIntegral()) { // Casting from integral
485 if (SrcTy.isSigned())
486 opcode = "sitofp"; // sint -> FP
487 else
488 opcode = "uitofp"; // uint -> FP
489 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
490 if (DstBits < SrcBits) {
491 opcode = "fptrunc"; // FP -> smaller FP
492 } else if (DstBits > SrcBits) {
493 opcode = "fpext"; // FP -> larger FP
494 } else {
495 opcode ="bitcast"; // same size, no-op cast
496 }
497 } else if (SrcTy.isPacked()) {
498 assert(DstBits == SrcTy.getBitWidth() &&
499 "Casting packed to floating point of different width");
500 opcode = "bitcast"; // same size, no-op cast
501 } else {
502 assert(0 && "Casting pointer or non-first class to float");
503 }
504 } else if (DstTy.isPacked()) {
505 if (SrcTy.isPacked()) {
506 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
507 "Casting packed to packed of different widths");
508 opcode = "bitcast"; // packed -> packed
509 } else if (DstTy.getBitWidth() == SrcBits) {
510 opcode = "bitcast"; // float/int -> packed
511 } else {
512 assert(!"Illegal cast to packed (wrong type or size)");
513 }
514 } else if (DstTy.isPointer()) {
515 if (SrcTy.isPointer()) {
516 opcode = "bitcast"; // ptr -> ptr
517 } else if (SrcTy.isIntegral()) {
518 opcode = "inttoptr"; // int -> ptr
519 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000520 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000521 }
522 } else {
523 assert(!"Casting to type that is not first-class");
524 }
525 return opcode;
526}
527
Reid Spencera50d5962006-12-02 04:11:07 +0000528static std::string getCastUpgrade(
529 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
530{
531 std::string Result;
532 std::string Source = Src;
533 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
534 // fp -> ptr cast is no longer supported but we must upgrade this
535 // by doing a double cast: fp -> int -> ptr
536 if (isConst)
537 Source = "ulong fptoui(" + Source + " to ulong)";
538 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000539 *O << " %cast_upgrade" << unique << " = fptoui " << Source
540 << " to ulong\n";
541 Source = "ulong %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000542 }
543 // Update the SrcTy for the getCastOpcode call below
544 SrcTy.destroy();
545 SrcTy.newTy = new std::string("ulong");
546 SrcTy.oldTy = ULongTy;
547 } else if (DstTy.oldTy == BoolTy) {
548 // cast ptr %x to bool was previously defined as setne ptr %x, null
549 // The ptrtoint semantic is to truncate, not compare so we must retain
550 // the original intent by replace the cast with a setne
551 const char* comparator = SrcTy.isPointer() ? ", null" :
552 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
553 if (isConst)
554 Result = "setne (" + Source + comparator + ")";
555 else
556 Result = "setne " + Source + comparator;
557 return Result; // skip cast processing below
558 }
559 ResolveType(SrcTy);
560 ResolveType(DstTy);
561 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
562 if (isConst)
563 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
564 else
565 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
566 return Result;
567}
568
Reid Spencer78720742006-12-02 20:21:22 +0000569const char* getDivRemOpcode(const std::string& opcode, const TypeInfo& TI) {
570 const char* op = opcode.c_str();
571 TypeInfo Ty = TI;
572 ResolveType(Ty);
573 if (Ty.isPacked())
574 Ty.oldTy = Ty.getElementType();
575 if (opcode == "div")
576 if (Ty.isFloatingPoint())
577 op = "fdiv";
578 else if (Ty.isUnsigned())
579 op = "udiv";
580 else if (Ty.isSigned())
581 op = "sdiv";
582 else
583 yyerror("Invalid type for div instruction");
584 else if (opcode == "rem")
585 if (Ty.isFloatingPoint())
586 op = "frem";
587 else if (Ty.isUnsigned())
588 op = "urem";
589 else if (Ty.isSigned())
590 op = "srem";
591 else
592 yyerror("Invalid type for rem instruction");
593 return op;
594}
Reid Spencere7c3c602006-11-30 06:36:44 +0000595
Reid Spencer229e9362006-12-02 22:14:11 +0000596std::string
597getCompareOp(const std::string& setcc, const TypeInfo& TI) {
598 assert(setcc.length() == 5);
599 char cc1 = setcc[3];
600 char cc2 = setcc[4];
601 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
602 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
603 std::string result("xcmp xxx");
604 result[6] = cc1;
605 result[7] = cc2;
606 if (TI.isFloatingPoint()) {
607 result[0] = 'f';
608 result[5] = 'o'; // FIXME: Always map to ordered comparison ?
609 } else if (TI.isIntegral() || TI.isPointer()) {
610 result[0] = 'i';
611 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
612 result.erase(5,1);
613 else if (TI.isSigned())
614 result[5] = 's';
615 else if (TI.isUnsigned() || TI.isPointer())
616 result[5] = 'u';
617 else
618 yyerror("Invalid integral type for setcc");
619 }
620 return result;
621}
622
623
Reid Spencere7c3c602006-11-30 06:36:44 +0000624
625/* Enabling traces. */
626#ifndef YYDEBUG
627# define YYDEBUG 0
628#endif
629
630/* Enabling verbose error messages. */
631#ifdef YYERROR_VERBOSE
632# undef YYERROR_VERBOSE
633# define YYERROR_VERBOSE 1
634#else
635# define YYERROR_VERBOSE 0
636#endif
637
638/* Enabling the token table. */
639#ifndef YYTOKEN_TABLE
640# define YYTOKEN_TABLE 0
641#endif
642
643#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencerbec0b592006-12-03 03:16:48 +0000644#line 269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +0000645typedef union YYSTYPE {
646 std::string* String;
647 TypeInfo Type;
648 ValueInfo Value;
649 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000650 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000651} YYSTYPE;
652/* Line 196 of yacc.c. */
Reid Spencerbec0b592006-12-03 03:16:48 +0000653#line 654 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000654# define yystype YYSTYPE /* obsolescent; will be withdrawn */
655# define YYSTYPE_IS_DECLARED 1
656# define YYSTYPE_IS_TRIVIAL 1
657#endif
658
659
660
661/* Copy the second part of user declarations. */
662
663
664/* Line 219 of yacc.c. */
Reid Spencerbec0b592006-12-03 03:16:48 +0000665#line 666 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000666
667#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
668# define YYSIZE_T __SIZE_TYPE__
669#endif
670#if ! defined (YYSIZE_T) && defined (size_t)
671# define YYSIZE_T size_t
672#endif
673#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
674# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
675# define YYSIZE_T size_t
676#endif
677#if ! defined (YYSIZE_T)
678# define YYSIZE_T unsigned int
679#endif
680
681#ifndef YY_
682# if YYENABLE_NLS
683# if ENABLE_NLS
684# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
685# define YY_(msgid) dgettext ("bison-runtime", msgid)
686# endif
687# endif
688# ifndef YY_
689# define YY_(msgid) msgid
690# endif
691#endif
692
693#if ! defined (yyoverflow) || YYERROR_VERBOSE
694
695/* The parser invokes alloca or malloc; define the necessary symbols. */
696
697# ifdef YYSTACK_USE_ALLOCA
698# if YYSTACK_USE_ALLOCA
699# ifdef __GNUC__
700# define YYSTACK_ALLOC __builtin_alloca
701# else
702# define YYSTACK_ALLOC alloca
703# if defined (__STDC__) || defined (__cplusplus)
704# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
705# define YYINCLUDED_STDLIB_H
706# endif
707# endif
708# endif
709# endif
710
711# ifdef YYSTACK_ALLOC
712 /* Pacify GCC's `empty if-body' warning. */
713# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
714# ifndef YYSTACK_ALLOC_MAXIMUM
715 /* The OS might guarantee only one guard page at the bottom of the stack,
716 and a page size can be as small as 4096 bytes. So we cannot safely
717 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
718 to allow for a few compiler-allocated temporary stack slots. */
719# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
720# endif
721# else
722# define YYSTACK_ALLOC YYMALLOC
723# define YYSTACK_FREE YYFREE
724# ifndef YYSTACK_ALLOC_MAXIMUM
725# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
726# endif
727# ifdef __cplusplus
728extern "C" {
729# endif
730# ifndef YYMALLOC
731# define YYMALLOC malloc
732# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
733 && (defined (__STDC__) || defined (__cplusplus)))
734void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
735# endif
736# endif
737# ifndef YYFREE
738# define YYFREE free
739# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
740 && (defined (__STDC__) || defined (__cplusplus)))
741void free (void *); /* INFRINGES ON USER NAME SPACE */
742# endif
743# endif
744# ifdef __cplusplus
745}
746# endif
747# endif
748#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
749
750
751#if (! defined (yyoverflow) \
752 && (! defined (__cplusplus) \
753 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
754
755/* A type that is properly aligned for any stack member. */
756union yyalloc
757{
758 short int yyss;
759 YYSTYPE yyvs;
760 };
761
762/* The size of the maximum gap between one aligned stack and the next. */
763# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
764
765/* The size of an array large to enough to hold all stacks, each with
766 N elements. */
767# define YYSTACK_BYTES(N) \
768 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
769 + YYSTACK_GAP_MAXIMUM)
770
771/* Copy COUNT objects from FROM to TO. The source and destination do
772 not overlap. */
773# ifndef YYCOPY
774# if defined (__GNUC__) && 1 < __GNUC__
775# define YYCOPY(To, From, Count) \
776 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
777# else
778# define YYCOPY(To, From, Count) \
779 do \
780 { \
781 YYSIZE_T yyi; \
782 for (yyi = 0; yyi < (Count); yyi++) \
783 (To)[yyi] = (From)[yyi]; \
784 } \
785 while (0)
786# endif
787# endif
788
789/* Relocate STACK from its old location to the new one. The
790 local variables YYSIZE and YYSTACKSIZE give the old and new number of
791 elements in the stack, and YYPTR gives the new location of the
792 stack. Advance YYPTR to a properly aligned location for the next
793 stack. */
794# define YYSTACK_RELOCATE(Stack) \
795 do \
796 { \
797 YYSIZE_T yynewbytes; \
798 YYCOPY (&yyptr->Stack, Stack, yysize); \
799 Stack = &yyptr->Stack; \
800 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
801 yyptr += yynewbytes / sizeof (*yyptr); \
802 } \
803 while (0)
804
805#endif
806
807#if defined (__STDC__) || defined (__cplusplus)
808 typedef signed char yysigned_char;
809#else
810 typedef short int yysigned_char;
811#endif
812
813/* YYFINAL -- State number of the termination state. */
814#define YYFINAL 4
815/* YYLAST -- Last index in YYTABLE. */
Reid Spencer229e9362006-12-02 22:14:11 +0000816#define YYLAST 1464
Reid Spencere7c3c602006-11-30 06:36:44 +0000817
818/* YYNTOKENS -- Number of terminals. */
Reid Spencer229e9362006-12-02 22:14:11 +0000819#define YYNTOKENS 165
Reid Spencere7c3c602006-11-30 06:36:44 +0000820/* YYNNTS -- Number of nonterminals. */
Reid Spencer229e9362006-12-02 22:14:11 +0000821#define YYNNTS 75
Reid Spencere7c3c602006-11-30 06:36:44 +0000822/* YYNRULES -- Number of rules. */
Reid Spencer229e9362006-12-02 22:14:11 +0000823#define YYNRULES 293
Reid Spencere7c3c602006-11-30 06:36:44 +0000824/* YYNRULES -- Number of states. */
Reid Spencer229e9362006-12-02 22:14:11 +0000825#define YYNSTATES 564
Reid Spencere7c3c602006-11-30 06:36:44 +0000826
827/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
828#define YYUNDEFTOK 2
Reid Spencer229e9362006-12-02 22:14:11 +0000829#define YYMAXUTOK 405
Reid Spencere7c3c602006-11-30 06:36:44 +0000830
831#define YYTRANSLATE(YYX) \
832 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
833
834/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
835static const unsigned char yytranslate[] =
836{
837 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
838 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
839 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
840 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer229e9362006-12-02 22:14:11 +0000841 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000842 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer229e9362006-12-02 22:14:11 +0000843 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000844 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
845 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer229e9362006-12-02 22:14:11 +0000846 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
Reid Spencere7c3c602006-11-30 06:36:44 +0000847 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
848 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer229e9362006-12-02 22:14:11 +0000849 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000850 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
851 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
852 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
853 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
854 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
855 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
856 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
857 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
859 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
860 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
861 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
862 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
863 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
864 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
865 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
866 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
867 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
868 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
869 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
870 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
871 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
872 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000873 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
Reid Spencer78720742006-12-02 20:21:22 +0000874 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
Reid Spencer229e9362006-12-02 22:14:11 +0000875 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
876 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
877 145, 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +0000878};
879
880#if YYDEBUG
881/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
882 YYRHS. */
883static const unsigned short int yyprhs[] =
884{
885 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
886 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
887 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
888 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000889 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
Reid Spencer229e9362006-12-02 22:14:11 +0000890 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
891 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
892 139, 141, 143, 145, 147, 149, 151, 153, 156, 157,
893 159, 161, 163, 165, 167, 169, 171, 172, 174, 176,
894 178, 180, 182, 184, 187, 188, 189, 192, 193, 197,
895 200, 201, 203, 204, 208, 210, 213, 215, 217, 219,
896 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
897 241, 243, 245, 247, 249, 251, 253, 256, 261, 267,
898 273, 277, 280, 283, 285, 289, 291, 295, 297, 298,
899 303, 307, 311, 316, 321, 325, 328, 331, 334, 337,
900 340, 343, 346, 349, 352, 355, 362, 368, 377, 384,
901 391, 398, 406, 413, 420, 429, 438, 442, 444, 446,
902 448, 450, 453, 456, 461, 464, 466, 468, 470, 475,
903 478, 483, 490, 497, 504, 511, 515, 520, 521, 523,
904 525, 527, 531, 535, 539, 543, 547, 551, 553, 554,
905 556, 558, 560, 561, 564, 568, 570, 572, 576, 578,
906 579, 588, 590, 592, 596, 598, 600, 604, 605, 607,
907 609, 613, 614, 616, 618, 620, 622, 624, 626, 628,
908 630, 632, 636, 638, 644, 646, 648, 650, 652, 655,
909 658, 660, 663, 666, 667, 669, 671, 673, 676, 679,
910 683, 693, 703, 712, 727, 729, 731, 738, 744, 747,
911 754, 762, 764, 768, 770, 771, 774, 776, 782, 788,
912 794, 802, 805, 810, 815, 822, 827, 832, 839, 846,
913 849, 857, 859, 862, 863, 865, 866, 870, 877, 881,
914 888, 891, 896, 903
Reid Spencere7c3c602006-11-30 06:36:44 +0000915};
916
917/* YYRHS -- A `-1'-separated list of the rules' RHS. */
918static const short int yyrhs[] =
919{
Reid Spencer229e9362006-12-02 22:14:11 +0000920 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
Reid Spencer78720742006-12-02 20:21:22 +0000921 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
922 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
923 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
924 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
Reid Spencer229e9362006-12-02 22:14:11 +0000925 -1, 100, -1, 101, -1, 102, -1, 103, -1, 104,
926 -1, 105, -1, 106, -1, 107, -1, 118, -1, 119,
927 -1, 120, -1, 121, -1, 108, -1, 109, -1, 110,
928 -1, 111, -1, 112, -1, 113, -1, 114, -1, 115,
929 -1, 116, -1, 117, -1, 130, -1, 131, -1, 132,
930 -1, 133, -1, 139, -1, 140, -1, 141, -1, 142,
931 -1, 143, -1, 144, -1, 145, -1, 146, -1, 147,
932 -1, 148, -1, 149, -1, 150, -1, 138, -1, 11,
933 -1, 9, -1, 7, -1, 5, -1, 12, -1, 10,
934 -1, 8, -1, 6, -1, 175, -1, 176, -1, 13,
935 -1, 14, -1, 208, 151, -1, -1, 42, -1, 43,
936 -1, 44, -1, 48, -1, 45, -1, 46, -1, 47,
937 -1, -1, 66, -1, 67, -1, 68, -1, 69, -1,
938 70, -1, 71, -1, 65, 18, -1, -1, -1, 57,
939 18, -1, -1, 152, 57, 18, -1, 37, 30, -1,
940 -1, 184, -1, -1, 152, 187, 186, -1, 184, -1,
941 57, 18, -1, 190, -1, 3, -1, 192, -1, 3,
942 -1, 192, -1, 4, -1, 5, -1, 6, -1, 7,
943 -1, 8, -1, 9, -1, 10, -1, 11, -1, 12,
944 -1, 13, -1, 14, -1, 15, -1, 16, -1, 222,
945 -1, 191, -1, 153, 18, -1, 189, 154, 194, 155,
946 -1, 156, 18, 157, 192, 158, -1, 159, 18, 157,
947 192, 160, -1, 161, 193, 162, -1, 161, 162, -1,
948 192, 163, -1, 192, -1, 193, 152, 192, -1, 193,
949 -1, 193, 152, 40, -1, 40, -1, -1, 190, 156,
950 197, 158, -1, 190, 156, 158, -1, 190, 164, 30,
951 -1, 190, 159, 197, 160, -1, 190, 161, 197, 162,
952 -1, 190, 161, 162, -1, 190, 22, -1, 190, 23,
953 -1, 190, 222, -1, 190, 196, -1, 190, 24, -1,
954 175, 167, -1, 176, 18, -1, 4, 25, -1, 4,
955 26, -1, 178, 21, -1, 174, 154, 195, 39, 190,
956 155, -1, 127, 154, 195, 237, 155, -1, 129, 154,
957 195, 152, 195, 152, 195, 155, -1, 168, 154, 195,
958 152, 195, 155, -1, 169, 154, 195, 152, 195, 155,
959 -1, 170, 154, 195, 152, 195, 155, -1, 171, 172,
960 154, 195, 152, 195, 155, -1, 173, 154, 195, 152,
961 195, 155, -1, 135, 154, 195, 152, 195, 155, -1,
962 136, 154, 195, 152, 195, 152, 195, 155, -1, 137,
963 154, 195, 152, 195, 152, 195, 155, -1, 197, 152,
964 195, -1, 195, -1, 35, -1, 36, -1, 200, -1,
965 200, 217, -1, 200, 219, -1, 200, 63, 62, 203,
966 -1, 200, 31, -1, 202, -1, 50, -1, 58, -1,
967 202, 179, 27, 188, -1, 202, 219, -1, 202, 63,
968 62, 203, -1, 202, 179, 180, 198, 195, 186, -1,
969 202, 179, 201, 198, 190, 186, -1, 202, 179, 45,
970 198, 190, 186, -1, 202, 179, 47, 198, 190, 186,
971 -1, 202, 51, 205, -1, 202, 59, 151, 206, -1,
972 -1, 30, -1, 56, -1, 55, -1, 53, 151, 204,
973 -1, 54, 151, 18, -1, 52, 151, 30, -1, 72,
974 151, 30, -1, 156, 207, 158, -1, 207, 152, 30,
975 -1, 30, -1, -1, 28, -1, 30, -1, 208, -1,
976 -1, 190, 209, -1, 211, 152, 210, -1, 210, -1,
977 211, -1, 211, 152, 40, -1, 40, -1, -1, 181,
978 188, 208, 154, 212, 155, 185, 182, -1, 32, -1,
979 161, -1, 180, 213, 214, -1, 33, -1, 162, -1,
980 215, 225, 216, -1, -1, 45, -1, 47, -1, 34,
981 218, 213, -1, -1, 64, -1, 17, -1, 18, -1,
982 21, -1, 25, -1, 26, -1, 22, -1, 23, -1,
983 24, -1, 159, 197, 160, -1, 196, -1, 62, 220,
984 30, 152, 30, -1, 166, -1, 208, -1, 222, -1,
985 221, -1, 190, 223, -1, 225, 226, -1, 226, -1,
986 227, 229, -1, 227, 231, -1, -1, 29, -1, 78,
987 -1, 77, -1, 73, 224, -1, 73, 3, -1, 74,
988 15, 223, -1, 74, 4, 223, 152, 15, 223, 152,
989 15, 223, -1, 75, 177, 223, 152, 15, 223, 156,
990 230, 158, -1, 75, 177, 223, 152, 15, 223, 156,
991 158, -1, 179, 76, 181, 188, 223, 154, 234, 155,
992 39, 15, 223, 228, 15, 223, -1, 228, -1, 79,
993 -1, 230, 177, 221, 152, 15, 223, -1, 177, 221,
994 152, 15, 223, -1, 179, 236, -1, 190, 156, 223,
995 152, 223, 158, -1, 232, 152, 156, 223, 152, 223,
996 158, -1, 224, -1, 233, 152, 224, -1, 233, -1,
997 -1, 61, 60, -1, 60, -1, 168, 190, 223, 152,
998 223, -1, 169, 190, 223, 152, 223, -1, 170, 190,
999 223, 152, 223, -1, 171, 172, 190, 223, 152, 223,
1000 155, -1, 49, 224, -1, 173, 224, 152, 224, -1,
1001 174, 224, 39, 190, -1, 129, 224, 152, 224, 152,
1002 224, -1, 134, 224, 152, 190, -1, 135, 224, 152,
1003 224, -1, 136, 224, 152, 224, 152, 224, -1, 137,
1004 224, 152, 224, 152, 224, -1, 128, 232, -1, 235,
1005 181, 188, 223, 154, 234, 155, -1, 239, -1, 152,
1006 233, -1, -1, 38, -1, -1, 122, 190, 183, -1,
1007 122, 190, 152, 10, 223, 183, -1, 123, 190, 183,
1008 -1, 123, 190, 152, 10, 223, 183, -1, 124, 224,
1009 -1, 238, 125, 190, 223, -1, 238, 126, 224, 152,
1010 190, 223, -1, 127, 190, 223, 237, -1
Reid Spencere7c3c602006-11-30 06:36:44 +00001011};
1012
1013/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1014static const unsigned short int yyrline[] =
1015{
Reid Spencerbec0b592006-12-03 03:16:48 +00001016 0, 332, 332, 332, 333, 333, 337, 337, 337, 337,
1017 337, 337, 337, 338, 338, 338, 338, 339, 339, 339,
1018 340, 340, 340, 340, 340, 340, 341, 341, 342, 342,
Reid Spencer229e9362006-12-02 22:14:11 +00001019 342, 342, 342, 342, 342, 342, 342, 342, 343, 343,
Reid Spencerbec0b592006-12-03 03:16:48 +00001020 343, 343, 343, 343, 343, 343, 343, 343, 344, 344,
1021 344, 344, 345, 345, 345, 345, 345, 345, 345, 346,
1022 346, 346, 346, 346, 346, 351, 351, 351, 351, 352,
1023 352, 352, 352, 353, 353, 354, 354, 357, 360, 365,
1024 365, 365, 365, 365, 365, 366, 367, 370, 370, 370,
1025 370, 370, 371, 372, 377, 382, 383, 386, 387, 395,
1026 401, 402, 405, 406, 415, 416, 429, 429, 430, 430,
1027 431, 435, 435, 435, 435, 435, 435, 435, 436, 436,
1028 436, 436, 436, 438, 442, 446, 449, 454, 460, 468,
1029 476, 482, 486, 497, 500, 508, 509, 514, 517, 527,
1030 533, 538, 544, 550, 556, 561, 567, 573, 579, 585,
1031 591, 597, 603, 609, 615, 623, 637, 649, 654, 660,
1032 665, 673, 678, 686, 691, 696, 706, 711, 716, 716,
1033 726, 731, 734, 739, 743, 747, 749, 749, 752, 764,
1034 769, 774, 781, 788, 795, 802, 807, 812, 817, 819,
1035 819, 822, 827, 834, 839, 846, 853, 858, 859, 867,
1036 867, 868, 868, 870, 877, 881, 885, 888, 893, 896,
1037 898, 918, 919, 921, 930, 931, 933, 941, 942, 943,
1038 947, 960, 961, 964, 964, 964, 964, 964, 964, 964,
1039 965, 966, 971, 972, 981, 981, 985, 991, 1002, 1008,
1040 1011, 1019, 1023, 1028, 1031, 1037, 1037, 1039, 1044, 1049,
1041 1054, 1062, 1069, 1075, 1095, 1100, 1106, 1111, 1119, 1128,
1042 1135, 1143, 1147, 1154, 1155, 1159, 1164, 1167, 1173, 1178,
1043 1186, 1191, 1196, 1204, 1218, 1223, 1228, 1233, 1238, 1243,
1044 1248, 1265, 1270, 1271, 1275, 1276, 1279, 1286, 1293, 1300,
1045 1307, 1312, 1319, 1326
Reid Spencere7c3c602006-11-30 06:36:44 +00001046};
1047#endif
1048
1049#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1050/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1051 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1052static const char *const yytname[] =
1053{
Reid Spencerf2d55322006-12-01 21:52:30 +00001054 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1055 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1056 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1057 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
Reid Spencere77e35e2006-12-01 20:26:20 +00001058 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1059 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1060 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1061 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1062 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
Reid Spencer78720742006-12-02 20:21:22 +00001063 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1064 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1065 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1066 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1067 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1068 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
Reid Spencer229e9362006-12-02 22:14:11 +00001069 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1070 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1071 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
Reid Spencer78720742006-12-02 20:21:22 +00001072 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1073 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1074 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1075 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1076 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1077 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
Reid Spencer229e9362006-12-02 22:14:11 +00001078 "LogicalOps", "SetCondOps", "CompareOps", "Predicates", "ShiftOps",
1079 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1080 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1081 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1082 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1083 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1084 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1085 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1086 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1087 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1088 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1089 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1090 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1091 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1092 "IndexList", "OptVolatile", "MemoryInst", 0
Reid Spencere7c3c602006-11-30 06:36:44 +00001093};
1094#endif
1095
1096# ifdef YYPRINT
1097/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1098 token YYLEX-NUM. */
1099static const unsigned short int yytoknum[] =
1100{
1101 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1102 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1103 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1104 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1105 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1106 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1107 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1108 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1109 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1110 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1111 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001112 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
Reid Spencer229e9362006-12-02 22:14:11 +00001113 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1114 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1115 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1116 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1117 62, 123, 125, 42, 99
Reid Spencere7c3c602006-11-30 06:36:44 +00001118};
1119# endif
1120
1121/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1122static const unsigned char yyr1[] =
1123{
Reid Spencer229e9362006-12-02 22:14:11 +00001124 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1125 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1126 170, 170, 170, 170, 170, 170, 171, 171, 172, 172,
1127 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1128 172, 172, 172, 172, 172, 172, 172, 172, 173, 173,
1129 173, 173, 174, 174, 174, 174, 174, 174, 174, 174,
1130 174, 174, 174, 174, 174, 175, 175, 175, 175, 176,
1131 176, 176, 176, 177, 177, 178, 178, 179, 179, 180,
1132 180, 180, 180, 180, 180, 180, 180, 181, 181, 181,
1133 181, 181, 181, 181, 181, 182, 182, 183, 183, 184,
1134 185, 185, 186, 186, 187, 187, 188, 188, 189, 189,
1135 190, 191, 191, 191, 191, 191, 191, 191, 191, 191,
1136 191, 191, 191, 192, 192, 192, 192, 192, 192, 192,
1137 192, 192, 192, 193, 193, 194, 194, 194, 194, 195,
1138 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1139 195, 195, 195, 195, 195, 196, 196, 196, 196, 196,
1140 196, 196, 196, 196, 196, 196, 197, 197, 198, 198,
1141 199, 200, 200, 200, 200, 200, 201, 201, 202, 202,
1142 202, 202, 202, 202, 202, 202, 202, 202, 203, 204,
1143 204, 205, 205, 205, 205, 206, 207, 207, 207, 208,
1144 208, 209, 209, 210, 211, 211, 212, 212, 212, 212,
1145 213, 214, 214, 215, 216, 216, 217, 218, 218, 218,
1146 219, 220, 220, 221, 221, 221, 221, 221, 221, 221,
1147 221, 221, 221, 221, 222, 222, 223, 223, 224, 225,
1148 225, 226, 227, 227, 227, 228, 228, 229, 229, 229,
1149 229, 229, 229, 229, 229, 229, 230, 230, 231, 232,
1150 232, 233, 233, 234, 234, 235, 235, 236, 236, 236,
1151 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1152 236, 236, 237, 237, 238, 238, 239, 239, 239, 239,
1153 239, 239, 239, 239
Reid Spencere7c3c602006-11-30 06:36:44 +00001154};
1155
1156/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1157static const unsigned char yyr2[] =
1158{
1159 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1160 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1161 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1162 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerf7bde222006-12-01 22:26:37 +00001163 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001164 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer229e9362006-12-02 22:14:11 +00001165 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1166 1, 1, 1, 1, 1, 1, 1, 2, 0, 1,
1167 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
1168 1, 1, 1, 2, 0, 0, 2, 0, 3, 2,
1169 0, 1, 0, 3, 1, 2, 1, 1, 1, 1,
1170 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1171 1, 1, 1, 1, 1, 1, 2, 4, 5, 5,
1172 3, 2, 2, 1, 3, 1, 3, 1, 0, 4,
1173 3, 3, 4, 4, 3, 2, 2, 2, 2, 2,
1174 2, 2, 2, 2, 2, 6, 5, 8, 6, 6,
1175 6, 7, 6, 6, 8, 8, 3, 1, 1, 1,
1176 1, 2, 2, 4, 2, 1, 1, 1, 4, 2,
1177 4, 6, 6, 6, 6, 3, 4, 0, 1, 1,
1178 1, 3, 3, 3, 3, 3, 3, 1, 0, 1,
1179 1, 1, 0, 2, 3, 1, 1, 3, 1, 0,
1180 8, 1, 1, 3, 1, 1, 3, 0, 1, 1,
1181 3, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1182 1, 3, 1, 5, 1, 1, 1, 1, 2, 2,
1183 1, 2, 2, 0, 1, 1, 1, 2, 2, 3,
1184 9, 9, 8, 14, 1, 1, 6, 5, 2, 6,
1185 7, 1, 3, 1, 0, 2, 1, 5, 5, 5,
1186 7, 2, 4, 4, 6, 4, 4, 6, 6, 2,
1187 7, 1, 2, 0, 1, 0, 3, 6, 3, 6,
1188 2, 4, 6, 4
Reid Spencere7c3c602006-11-30 06:36:44 +00001189};
1190
1191/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1192 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1193 means the default is an error. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001194static const unsigned short int yydefact[] =
Reid Spencere7c3c602006-11-30 06:36:44 +00001195{
Reid Spencer229e9362006-12-02 22:14:11 +00001196 187, 0, 86, 175, 1, 174, 217, 79, 80, 81,
1197 83, 84, 85, 82, 0, 94, 243, 171, 172, 199,
1198 200, 0, 0, 0, 86, 0, 179, 218, 219, 94,
1199 0, 0, 87, 88, 89, 90, 91, 92, 0, 0,
1200 244, 243, 240, 78, 0, 0, 0, 0, 185, 0,
1201 0, 0, 0, 0, 176, 177, 0, 0, 77, 220,
1202 188, 173, 93, 107, 111, 112, 113, 114, 115, 116,
1203 117, 118, 119, 120, 121, 122, 123, 2, 3, 0,
1204 0, 0, 0, 234, 0, 0, 106, 125, 110, 235,
1205 124, 211, 212, 213, 214, 215, 216, 239, 0, 0,
1206 0, 246, 245, 255, 285, 254, 241, 242, 0, 0,
1207 0, 0, 198, 186, 180, 178, 168, 169, 0, 0,
1208 0, 0, 126, 0, 0, 109, 131, 133, 0, 0,
1209 138, 132, 248, 0, 247, 0, 0, 68, 72, 67,
1210 71, 66, 70, 65, 69, 73, 74, 0, 284, 0,
1211 266, 0, 94, 6, 7, 8, 9, 10, 11, 12,
Reid Spencer78720742006-12-02 20:21:22 +00001212 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
Reid Spencer229e9362006-12-02 22:14:11 +00001213 23, 24, 25, 26, 27, 0, 0, 0, 0, 0,
1214 0, 48, 49, 50, 51, 0, 0, 0, 0, 64,
1215 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1216 62, 63, 0, 0, 0, 0, 0, 0, 94, 258,
1217 0, 281, 193, 190, 189, 191, 192, 194, 197, 0,
1218 102, 102, 111, 112, 113, 114, 115, 116, 117, 118,
1219 119, 120, 121, 0, 0, 0, 0, 102, 102, 0,
1220 0, 0, 130, 209, 137, 135, 0, 223, 224, 225,
1221 228, 229, 230, 226, 227, 221, 0, 0, 0, 0,
1222 0, 0, 0, 0, 0, 0, 0, 0, 232, 237,
1223 236, 238, 0, 249, 0, 271, 265, 0, 97, 97,
1224 290, 0, 0, 279, 0, 0, 0, 0, 0, 0,
1225 0, 0, 28, 29, 30, 31, 32, 33, 38, 39,
1226 40, 41, 42, 43, 44, 45, 46, 47, 34, 35,
1227 36, 37, 0, 0, 0, 0, 0, 0, 0, 195,
1228 0, 183, 184, 152, 153, 4, 5, 150, 151, 154,
1229 145, 146, 149, 0, 0, 0, 0, 148, 147, 181,
1230 182, 108, 108, 134, 208, 202, 205, 206, 0, 0,
1231 127, 222, 0, 0, 0, 0, 0, 0, 167, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001232 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001233 286, 0, 288, 283, 0, 0, 0, 0, 0, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001235 196, 0, 0, 104, 102, 140, 0, 0, 144, 0,
1236 141, 128, 129, 201, 203, 0, 100, 136, 0, 283,
1237 0, 0, 0, 0, 0, 231, 0, 0, 0, 0,
1238 0, 0, 0, 0, 0, 0, 0, 0, 0, 293,
1239 0, 0, 0, 275, 276, 0, 0, 0, 0, 0,
1240 0, 272, 273, 0, 291, 0, 99, 105, 103, 139,
1241 142, 143, 207, 204, 101, 95, 0, 0, 0, 0,
1242 0, 0, 166, 0, 0, 0, 0, 0, 0, 0,
1243 0, 264, 97, 98, 97, 261, 282, 0, 0, 0,
1244 0, 0, 267, 268, 269, 0, 264, 0, 0, 210,
1245 233, 156, 0, 0, 0, 0, 0, 0, 0, 0,
1246 0, 0, 0, 0, 263, 0, 0, 287, 289, 0,
1247 0, 0, 274, 277, 278, 0, 0, 292, 96, 0,
1248 163, 0, 0, 158, 159, 160, 0, 162, 155, 0,
1249 252, 0, 0, 0, 262, 259, 0, 270, 280, 0,
1250 0, 0, 161, 250, 0, 251, 0, 0, 260, 157,
1251 164, 165, 0, 0, 0, 0, 0, 0, 257, 0,
1252 0, 256, 0, 253
Reid Spencere7c3c602006-11-30 06:36:44 +00001253};
1254
1255/* YYDEFGOTO[NTERM-NUM]. */
1256static const short int yydefgoto[] =
1257{
Reid Spencer229e9362006-12-02 22:14:11 +00001258 -1, 83, 327, 262, 263, 264, 265, 312, 266, 267,
1259 233, 234, 147, 235, 24, 15, 38, 489, 370, 393,
1260 455, 321, 394, 84, 85, 236, 87, 88, 128, 246,
1261 358, 268, 359, 118, 1, 2, 57, 3, 61, 215,
1262 48, 113, 219, 89, 404, 346, 347, 348, 39, 93,
1263 16, 96, 17, 29, 18, 352, 269, 90, 271, 475,
1264 41, 42, 43, 105, 106, 532, 107, 283, 504, 505,
1265 208, 209, 429, 210, 211
Reid Spencere7c3c602006-11-30 06:36:44 +00001266};
1267
1268/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1269 STATE-NUM. */
Reid Spencer229e9362006-12-02 22:14:11 +00001270#define YYPACT_NINF -507
Reid Spencere7c3c602006-11-30 06:36:44 +00001271static const short int yypact[] =
1272{
Reid Spencer229e9362006-12-02 22:14:11 +00001273 -507, 31, 62, 973, -507, -507, -18, -507, -507, -507,
1274 -507, -507, -507, -507, -3, 124, 43, -507, -507, -507,
1275 -507, -33, -60, 25, 177, -37, -507, -507, -507, 124,
1276 102, 128, -507, -507, -507, -507, -507, -507, 800, -25,
1277 -507, -17, -507, 49, 12, 16, 26, 29, -507, 28,
1278 102, 800, 7, 7, -507, -507, 7, 7, -507, -507,
1279 -507, -507, -507, 42, -507, -507, -507, -507, -507, -507,
1280 -507, -507, -507, -507, -507, -507, -507, -507, -507, 163,
1281 164, 165, 469, -507, 27, 47, -507, -507, -109, -507,
1282 -507, -507, -507, -507, -507, -507, -507, -507, 837, 20,
1283 146, -507, -507, -507, 1314, -507, -507, -507, 155, 19,
1284 179, 172, 173, -507, -507, -507, -507, -507, 882, 882,
1285 921, 882, -507, 50, 51, -507, -507, -109, -126, 52,
1286 564, -507, 42, 1112, -507, 1112, 1112, -507, -507, -507,
1287 -507, -507, -507, -507, -507, -507, -507, 1112, -507, 882,
1288 -507, 149, 124, -507, -507, -507, -507, -507, -507, -507,
1289 -507, -507, -507, -507, -507, -507, -507, -507, -507, -507,
1290 -507, -507, -507, -507, -507, 882, 882, 882, 882, 882,
1291 882, -507, -507, -507, -507, 882, 882, 882, 882, -507,
1292 -507, -507, -507, -507, -507, -507, -507, -507, -507, -507,
1293 -507, -507, 882, 882, 882, 860, 882, 882, 124, -507,
1294 -5, -507, -507, -507, -507, -507, -507, -507, -507, -64,
1295 58, 58, 77, 117, 193, 126, 194, 142, 195, 144,
1296 198, 197, 207, 153, 213, 211, 964, 58, 58, 882,
1297 882, 882, -507, 640, -507, 81, 82, -507, -507, -507,
1298 -507, -507, -507, -507, -507, 170, 84, 86, 87, 88,
1299 89, 921, 90, 91, 92, 860, 93, 94, -507, -507,
1300 -507, -507, 97, -507, 104, -507, -507, 800, 105, 109,
1301 -507, 1112, 80, 112, 114, 115, 118, 120, 121, 1112,
1302 1112, 1112, -507, -507, -507, -507, -507, -507, -507, -507,
1303 -507, -507, -507, -507, -507, -507, -507, -507, -507, -507,
1304 -507, -507, 882, 123, 230, 800, 882, 882, 220, -507,
1305 -23, -507, -507, -507, -507, -507, -507, -507, -507, -507,
1306 -507, -507, -507, 678, 921, 516, 246, -507, -507, -507,
1307 -507, -73, -48, -109, -507, 27, -507, 131, 125, 723,
1308 -507, -507, 256, 921, 921, 921, 921, 921, -507, -76,
1309 921, 921, 921, 133, 921, 921, 274, 278, 1112, -1,
1310 -507, 1, -507, 143, 1112, 138, 882, 882, 882, 882,
1311 882, 147, 148, 150, 1112, 882, 882, 1112, 1112, 151,
1312 -507, 266, 280, -507, 58, -507, -57, -74, -507, -124,
1313 -507, -507, -507, -507, -507, 762, 264, -507, 152, 143,
1314 154, 156, 157, 158, 921, -507, 159, 161, 162, 921,
1315 166, 268, 1112, 1112, 167, 1112, 287, 1112, 882, -507,
1316 171, 1112, 174, -507, -507, 175, 178, 1112, 1112, 1112,
1317 180, -507, -507, 183, -507, 882, -507, -507, -507, -507,
1318 -507, -507, -507, -507, -507, 258, 286, 176, 921, 921,
1319 921, 921, -507, 921, 921, 921, 181, 921, 882, 192,
1320 169, 882, 199, -507, 199, -507, 200, 1112, 201, 882,
1321 882, 882, -507, -507, -507, 1112, 882, 1112, 311, -507,
1322 -507, -507, 202, 190, 203, 212, 191, 216, 217, 921,
1323 218, 221, 334, 41, 200, 222, 293, -507, -507, 882,
1324 208, 1112, -507, -507, -507, 223, 224, -507, -507, 921,
1325 -507, 921, 921, -507, -507, -507, 225, -507, -507, 1112,
1326 -507, 1201, 59, 336, -507, -507, 227, -507, -507, 226,
1327 228, 231, -507, -507, 235, -507, 1201, 373, -507, -507,
1328 -507, -507, 374, 242, 1112, 1112, 380, 98, -507, 1112,
1329 381, -507, 1112, -507
Reid Spencere7c3c602006-11-30 06:36:44 +00001330};
1331
1332/* YYPGOTO[NTERM-NUM]. */
1333static const short int yypgoto[] =
1334{
Reid Spencer229e9362006-12-02 22:14:11 +00001335 -507, -507, -507, 294, 295, 296, 297, 137, 299, 300,
1336 -98, -97, -495, -507, 366, 386, -135, -507, -274, 5,
1337 -507, -215, -507, -47, -507, -38, -507, -67, 282, -507,
1338 -102, 182, -204, 60, -507, -507, -507, -507, 363, -507,
1339 -507, -507, -507, -2, -507, 9, -507, -507, 387, -507,
1340 -507, -507, -507, -507, 412, -507, -506, -103, 79, -88,
1341 -507, 382, -507, -133, -507, -507, -507, -507, -6, -61,
1342 -507, -507, 18, -507, -507
Reid Spencere7c3c602006-11-30 06:36:44 +00001343};
1344
1345/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1346 positive, shift that token. If negative, reduce the rule which
1347 number is the opposite. If zero, do what YYDEFACT says.
1348 If YYTABLE_NINF, syntax error. */
Reid Spencer229e9362006-12-02 22:14:11 +00001349#define YYTABLE_NINF -171
Reid Spencere7c3c602006-11-30 06:36:44 +00001350static const short int yytable[] =
1351{
Reid Spencer229e9362006-12-02 22:14:11 +00001352 86, 25, 145, 146, 115, 372, 322, 91, 531, 425,
1353 134, 427, 40, 86, 391, 127, 94, 277, 237, 44,
1354 45, 46, 339, 340, 135, 544, 241, 27, 414, 28,
1355 270, 4, 270, 270, 392, 136, 242, 546, 451, 47,
1356 553, 25, 116, 117, 270, -108, 137, 138, 139, 140,
1357 141, 142, 143, 144, 131, 19, 426, 20, 426, 30,
1358 133, 275, -170, 127, 137, 138, 139, 140, 141, 142,
1359 143, 144, 40, 315, 213, 214, 414, 19, 414, 20,
1360 220, 221, 129, 238, 415, 401, 450, 50, 318, 280,
1361 131, 49, 284, 5, 319, 414, 6, 285, 286, 287,
1362 288, 449, 323, 324, 7, 8, 9, 10, 11, 12,
1363 13, 133, 402, 119, 58, 131, 120, 121, 313, 314,
1364 316, 317, 98, 99, 100, 14, 101, 102, 103, 396,
1365 397, 399, 60, 338, -68, -68, 92, 278, 279, 133,
1366 281, 282, 133, -67, -67, 95, 62, 133, 133, 133,
1367 133, 137, 138, 139, 140, 141, 142, 143, 144, -66,
1368 -66, -65, -65, 108, 289, 290, 291, 109, 133, 133,
1369 325, 326, 341, 342, 343, 101, 102, 110, 270, 448,
1370 111, 122, 123, 124, 112, 212, 270, 270, 270, 31,
1371 32, 33, 34, 35, 36, 37, -109, 216, 507, 530,
1372 508, 130, 217, 218, 51, 345, 243, 239, 240, 276,
1373 320, -72, -71, -70, 272, 273, -69, 545, -75, 7,
1374 8, 9, 52, 11, 53, 13, 274, 54, -76, 389,
1375 368, 328, 329, 349, 351, 55, 374, 350, 353, 86,
1376 354, 355, 356, 357, 360, 361, 362, 364, 365, 366,
1377 390, 409, 410, 411, 412, 413, 367, 369, 416, 417,
1378 418, 371, 420, 421, 375, 270, 376, 377, 387, 386,
1379 378, 270, 379, 380, 384, 385, 400, 86, 388, 133,
1380 406, 270, 343, 405, 270, 270, 408, 419, 432, 422,
1381 434, 435, 436, 423, 431, 428, 446, 441, 447, 437,
1382 438, 391, 439, 445, 456, 473, 458, 468, 459, 460,
1383 461, 463, 462, 464, 465, 488, 490, 466, 467, 270,
1384 270, 471, 270, 477, 270, 503, 479, 480, 270, 518,
1385 481, 491, 485, 499, 270, 270, 270, 486, 133, 433,
1386 133, 133, 133, 403, 502, 520, 523, 133, 442, 529,
1387 426, 506, 509, 511, 519, 521, 492, 493, 494, 495,
1388 373, 496, 497, 498, 522, 500, 535, 345, 381, 382,
1389 383, 524, 525, 527, 270, 547, 528, 533, 537, 538,
1390 542, 549, 270, 550, 270, 548, 551, 552, 554, 555,
1391 133, 512, 513, 514, 556, 559, 562, 526, 202, 203,
1392 204, 205, 363, 206, 207, 145, 146, 487, 270, 104,
1393 56, 454, 245, 114, 453, 26, 59, 539, 337, 540,
1394 541, 534, 476, 97, 560, 516, 270, 457, 0, 0,
1395 501, 0, 0, 133, 145, 146, 0, 0, 0, 0,
1396 0, 133, 133, 133, 0, 0, 0, 424, 133, 0,
1397 0, 270, 270, 430, 0, 0, 270, 0, 0, 270,
1398 0, 0, 0, 440, 0, 0, 443, 444, 0, 0,
1399 0, 133, 125, 64, 65, 66, 67, 68, 69, 70,
1400 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1401 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1402 0, 469, 470, 0, 472, 0, 474, 0, 0, 0,
1403 478, 0, 0, 0, 0, 0, 482, 483, 484, 125,
1404 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
1405 232, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1406 0, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1407 0, 0, 0, 0, 0, 0, 510, 0, 0, 0,
1408 0, 0, 0, 0, 515, 0, 517, 125, 64, 65,
1409 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1410 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1411 536, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1412 0, 0, 0, 0, 244, 0, 0, 0, 543, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001414 0, 0, 79, 0, 0, 80, 0, 0, 81, 0,
1415 82, 126, 0, 557, 558, 0, 0, 0, 561, 0,
1416 0, 563, 0, 125, 64, 65, 66, 67, 68, 69,
1417 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
1418 78, 0, 0, 0, 0, 0, 0, 0, 19, 79,
1419 20, 0, 80, 0, 0, 81, 0, 82, 398, 0,
1420 344, 125, 222, 223, 224, 225, 226, 227, 228, 229,
1421 230, 231, 232, 75, 76, 0, 0, 77, 78, 0,
1422 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
1423 0, 0, 0, 0, 0, 0, 0, 79, 0, 0,
1424 80, 0, 0, 81, 0, 82, 125, 64, 65, 66,
Reid Spencer78720742006-12-02 20:21:22 +00001425 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1426 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1427 0, 19, 0, 20, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001428 0, 0, 0, 407, 0, 125, 64, 65, 66, 67,
Reid Spencer78720742006-12-02 20:21:22 +00001429 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001430 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001431 19, 0, 20, 79, 0, 0, 80, 0, 0, 81,
1432 0, 82, 452, 63, 64, 65, 66, 67, 68, 69,
1433 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
1434 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1435 20, 79, 0, 0, 80, 0, 395, 81, 0, 82,
1436 132, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1437 73, 74, 75, 76, 0, 0, 77, 78, 0, 0,
1438 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
1439 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1440 0, 0, 81, 0, 82, 125, 64, 65, 66, 67,
1441 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
1442 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
1443 19, 0, 20, 0, 0, 79, 0, 0, 80, 0,
1444 0, 81, 0, 82, 125, 222, 223, 224, 225, 226,
1445 227, 228, 229, 230, 231, 232, 75, 76, 0, 0,
1446 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1447 0, 20, 0, 79, 0, 0, 80, 0, 0, 81,
1448 0, 82, 292, 293, 294, 295, 296, 297, 298, 299,
1449 300, 301, 302, 303, 304, 305, 306, 307, 308, 309,
1450 310, 311, 0, 77, 78, 0, 330, 331, 332, 0,
1451 79, 0, 19, 80, 20, 0, 81, 0, 82, 0,
1452 -78, 19, 0, 20, 0, 0, 0, 6, -78, -78,
1453 0, 0, 0, 0, 0, -78, -78, -78, -78, -78,
1454 -78, -78, 0, -78, 21, 0, 0, 0, 0, 0,
1455 0, -78, 22, 0, 0, 79, 23, 0, 80, 0,
1456 0, 81, 0, 82, 153, 154, 155, 156, 157, 158,
1457 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1458 169, 170, 171, 172, 173, 174, 0, 0, 0, 0,
1459 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001460 81, 0, 82, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001461 0, 256, 0, 257, 181, 182, 183, 184, 0, 258,
1462 259, 260, 189, 190, 191, 192, 193, 194, 195, 196,
1463 197, 198, 199, 200, 201, 0, 0, 0, 0, 0,
1464 333, 0, 0, 334, 0, 335, 0, 0, 336, 247,
1465 248, 77, 78, 249, 250, 251, 252, 253, 254, 0,
1466 19, 0, 20, 0, 0, 0, 0, 0, 0, 0,
Reid Spencerf2d55322006-12-01 21:52:30 +00001467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001468 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1469 0, 0, 0, 0, 255, 0, 0, 0, 0, 0,
1470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1471 0, 0, 153, 154, 155, 156, 157, 158, 159, 160,
Reid Spencer78720742006-12-02 20:21:22 +00001472 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
Reid Spencer229e9362006-12-02 22:14:11 +00001473 171, 172, 173, 174, 0, 0, 0, 0, 247, 248,
1474 0, 0, 249, 250, 251, 252, 253, 254, 0, 0,
1475 0, 0, 0, 0, 0, 0, 0, 0, 0, 256,
1476 0, 257, 181, 182, 183, 184, 0, 258, 259, 260,
Reid Spencer78720742006-12-02 20:21:22 +00001477 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
Reid Spencer229e9362006-12-02 22:14:11 +00001478 199, 200, 201, 255, 0, 0, 0, 0, 0, 0,
1479 0, 261, 0, 0, 0, 0, 0, 0, 0, 0,
1480 0, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1481 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
1482 172, 173, 174, 0, 0, 0, 0, 0, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001484 0, 0, 0, 0, 0, 0, 0, 0, 256, 0,
1485 257, 181, 182, 183, 184, 0, 258, 259, 260, 189,
1486 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
1487 200, 201, 148, 0, 0, 0, 0, 0, 0, 0,
1488 261, 0, 0, 149, 0, 0, 0, 0, 0, 0,
1489 0, 0, 0, 0, 150, 151, 0, 0, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001490 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001491 152, 0, 0, 0, 153, 154, 155, 156, 157, 158,
1492 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1493 169, 170, 171, 172, 173, 174, 0, 0, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001495 0, 0, 0, 0, 0, 0, 175, 176, 177, 0,
1496 0, 178, 179, 180, 181, 182, 183, 184, 185, 186,
1497 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
1498 197, 198, 199, 200, 201
Reid Spencere7c3c602006-11-30 06:36:44 +00001499};
1500
1501static const short int yycheck[] =
1502{
Reid Spencer229e9362006-12-02 22:14:11 +00001503 38, 3, 100, 100, 51, 279, 221, 32, 503, 10,
1504 98, 10, 29, 51, 37, 82, 33, 152, 120, 52,
1505 53, 54, 237, 238, 4, 531, 152, 45, 152, 47,
1506 133, 0, 135, 136, 57, 15, 162, 532, 162, 72,
1507 546, 43, 35, 36, 147, 154, 5, 6, 7, 8,
1508 9, 10, 11, 12, 163, 28, 57, 30, 57, 62,
1509 98, 149, 0, 130, 5, 6, 7, 8, 9, 10,
1510 11, 12, 29, 208, 55, 56, 152, 28, 152, 30,
1511 118, 119, 84, 121, 160, 158, 160, 62, 152, 177,
1512 163, 151, 180, 31, 158, 152, 34, 185, 186, 187,
1513 188, 158, 25, 26, 42, 43, 44, 45, 46, 47,
1514 48, 149, 160, 53, 151, 163, 56, 57, 206, 207,
1515 125, 126, 73, 74, 75, 63, 77, 78, 79, 333,
1516 334, 335, 30, 236, 17, 18, 161, 175, 176, 177,
1517 178, 179, 180, 17, 18, 162, 18, 185, 186, 187,
1518 188, 5, 6, 7, 8, 9, 10, 11, 12, 17,
1519 18, 17, 18, 151, 202, 203, 204, 151, 206, 207,
1520 17, 18, 239, 240, 241, 77, 78, 151, 281, 394,
1521 151, 18, 18, 18, 156, 30, 289, 290, 291, 65,
1522 66, 67, 68, 69, 70, 71, 154, 18, 472, 158,
1523 474, 154, 30, 30, 27, 243, 154, 157, 157, 60,
1524 152, 18, 18, 18, 135, 136, 18, 158, 21, 42,
1525 43, 44, 45, 46, 47, 48, 147, 50, 21, 317,
1526 277, 18, 21, 152, 64, 58, 156, 155, 154, 277,
1527 154, 154, 154, 154, 154, 154, 154, 154, 154, 152,
1528 30, 353, 354, 355, 356, 357, 152, 152, 360, 361,
1529 362, 152, 364, 365, 152, 368, 152, 152, 315, 39,
1530 152, 374, 152, 152, 312, 152, 30, 315, 316, 317,
1531 155, 384, 349, 152, 387, 388, 30, 154, 376, 15,
1532 378, 379, 380, 15, 156, 152, 30, 385, 18, 152,
1533 152, 37, 152, 152, 152, 18, 152, 39, 152, 152,
1534 152, 152, 414, 152, 152, 57, 30, 419, 152, 422,
1535 423, 154, 425, 152, 427, 156, 152, 152, 431, 18,
1536 152, 155, 152, 152, 437, 438, 439, 154, 376, 377,
1537 378, 379, 380, 345, 152, 155, 155, 385, 386, 15,
1538 57, 152, 152, 152, 152, 152, 458, 459, 460, 461,
1539 281, 463, 464, 465, 152, 467, 158, 405, 289, 290,
1540 291, 155, 155, 155, 477, 39, 155, 155, 155, 155,
1541 155, 155, 485, 155, 487, 158, 155, 152, 15, 15,
1542 428, 479, 480, 481, 152, 15, 15, 499, 104, 104,
1543 104, 104, 265, 104, 104, 503, 503, 445, 511, 43,
1544 24, 406, 130, 50, 405, 3, 29, 519, 236, 521,
1545 522, 509, 428, 41, 557, 486, 529, 409, -1, -1,
1546 468, -1, -1, 471, 532, 532, -1, -1, -1, -1,
1547 -1, 479, 480, 481, -1, -1, -1, 368, 486, -1,
1548 -1, 554, 555, 374, -1, -1, 559, -1, -1, 562,
1549 -1, -1, -1, 384, -1, -1, 387, 388, -1, -1,
1550 -1, 509, 3, 4, 5, 6, 7, 8, 9, 10,
1551 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1552 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1553 -1, 422, 423, -1, 425, -1, 427, -1, -1, -1,
1554 431, -1, -1, -1, -1, -1, 437, 438, 439, 3,
1555 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1556 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1557 -1, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1558 -1, -1, -1, -1, -1, -1, 477, -1, -1, -1,
1559 -1, -1, -1, -1, 485, -1, 487, 3, 4, 5,
1560 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1561 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1562 511, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1563 -1, -1, -1, -1, 40, -1, -1, -1, 529, -1,
Reid Spencer78720742006-12-02 20:21:22 +00001564 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001565 -1, -1, 153, -1, -1, 156, -1, -1, 159, -1,
1566 161, 162, -1, 554, 555, -1, -1, -1, 559, -1,
1567 -1, 562, -1, 3, 4, 5, 6, 7, 8, 9,
1568 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1569 20, -1, -1, -1, -1, -1, -1, -1, 28, 153,
1570 30, -1, 156, -1, -1, 159, -1, 161, 162, -1,
1571 40, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1572 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1573 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
1574 -1, -1, -1, -1, -1, -1, -1, 153, -1, -1,
1575 156, -1, -1, 159, -1, 161, 3, 4, 5, 6,
Reid Spencer78720742006-12-02 20:21:22 +00001576 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1577 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1578 -1, 28, -1, 30, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001579 -1, -1, -1, 40, -1, 3, 4, 5, 6, 7,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001580 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1581 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001582 28, -1, 30, 153, -1, -1, 156, -1, -1, 159,
1583 -1, 161, 40, 3, 4, 5, 6, 7, 8, 9,
1584 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1585 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
1586 30, 153, -1, -1, 156, -1, 158, 159, -1, 161,
1587 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1588 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
1589 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
1590 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1591 -1, -1, 159, -1, 161, 3, 4, 5, 6, 7,
1592 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1593 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1594 28, -1, 30, -1, -1, 153, -1, -1, 156, -1,
1595 -1, 159, -1, 161, 3, 4, 5, 6, 7, 8,
1596 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1597 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
1598 -1, 30, -1, 153, -1, -1, 156, -1, -1, 159,
1599 -1, 161, 102, 103, 104, 105, 106, 107, 108, 109,
1600 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
1601 120, 121, -1, 19, 20, -1, 22, 23, 24, -1,
1602 153, -1, 28, 156, 30, -1, 159, -1, 161, -1,
1603 27, 28, -1, 30, -1, -1, -1, 34, 35, 36,
1604 -1, -1, -1, -1, -1, 42, 43, 44, 45, 46,
1605 47, 48, -1, 50, 51, -1, -1, -1, -1, -1,
1606 -1, 58, 59, -1, -1, 153, 63, -1, 156, -1,
1607 -1, 159, -1, 161, 80, 81, 82, 83, 84, 85,
1608 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1609 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
1610 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
1611 159, -1, 161, -1, -1, -1, -1, -1, -1, -1,
1612 -1, 127, -1, 129, 130, 131, 132, 133, -1, 135,
1613 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
1614 146, 147, 148, 149, 150, -1, -1, -1, -1, -1,
1615 156, -1, -1, 159, -1, 161, -1, -1, 164, 17,
1616 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
1617 28, -1, 30, -1, -1, -1, -1, -1, -1, -1,
Reid Spencerf2d55322006-12-01 21:52:30 +00001618 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001619 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1620 -1, -1, -1, -1, 62, -1, -1, -1, -1, -1,
1621 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1622 -1, -1, 80, 81, 82, 83, 84, 85, 86, 87,
Reid Spencer78720742006-12-02 20:21:22 +00001623 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
Reid Spencer229e9362006-12-02 22:14:11 +00001624 98, 99, 100, 101, -1, -1, -1, -1, 17, 18,
1625 -1, -1, 21, 22, 23, 24, 25, 26, -1, -1,
1626 -1, -1, -1, -1, -1, -1, -1, -1, -1, 127,
1627 -1, 129, 130, 131, 132, 133, -1, 135, 136, 137,
1628 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1629 148, 149, 150, 62, -1, -1, -1, -1, -1, -1,
1630 -1, 159, -1, -1, -1, -1, -1, -1, -1, -1,
1631 -1, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1632 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1633 99, 100, 101, -1, -1, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001635 -1, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1636 129, 130, 131, 132, 133, -1, 135, 136, 137, 138,
1637 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1638 149, 150, 38, -1, -1, -1, -1, -1, -1, -1,
1639 159, -1, -1, 49, -1, -1, -1, -1, -1, -1,
1640 -1, -1, -1, -1, 60, 61, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001642 76, -1, -1, -1, 80, 81, 82, 83, 84, 85,
1643 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1644 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001645 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer229e9362006-12-02 22:14:11 +00001646 -1, -1, -1, -1, -1, -1, 122, 123, 124, -1,
1647 -1, 127, 128, 129, 130, 131, 132, 133, 134, 135,
1648 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
1649 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +00001650};
1651
1652/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1653 symbol of state STATE-NUM. */
1654static const unsigned char yystos[] =
1655{
Reid Spencer229e9362006-12-02 22:14:11 +00001656 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
1657 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
1658 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
1659 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
1660 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
1661 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
1662 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
1663 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
1664 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
1665 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
1666 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
1667 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
1668 198, 198, 18, 18, 18, 3, 162, 192, 193, 208,
1669 154, 163, 3, 190, 224, 4, 15, 5, 6, 7,
1670 8, 9, 10, 11, 12, 175, 176, 177, 38, 49,
Reid Spencer78720742006-12-02 20:21:22 +00001671 60, 61, 76, 80, 81, 82, 83, 84, 85, 86,
1672 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
Reid Spencer229e9362006-12-02 22:14:11 +00001673 97, 98, 99, 100, 101, 122, 123, 124, 127, 128,
1674 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
1675 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1676 149, 150, 168, 169, 170, 171, 173, 174, 235, 236,
1677 238, 239, 30, 55, 56, 204, 18, 30, 30, 207,
1678 190, 190, 4, 5, 6, 7, 8, 9, 10, 11,
1679 12, 13, 14, 175, 176, 178, 190, 195, 190, 157,
1680 157, 152, 162, 154, 40, 193, 194, 17, 18, 21,
1681 22, 23, 24, 25, 26, 62, 127, 129, 135, 136,
1682 137, 159, 168, 169, 170, 171, 173, 174, 196, 221,
1683 222, 223, 223, 223, 223, 224, 60, 181, 190, 190,
1684 224, 190, 190, 232, 224, 224, 224, 224, 224, 190,
1685 190, 190, 102, 103, 104, 105, 106, 107, 108, 109,
1686 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
1687 120, 121, 172, 224, 224, 181, 125, 126, 152, 158,
1688 152, 186, 186, 25, 26, 17, 18, 167, 18, 21,
1689 22, 23, 24, 156, 159, 161, 164, 196, 222, 186,
1690 186, 192, 192, 192, 40, 190, 210, 211, 212, 152,
1691 155, 64, 220, 154, 154, 154, 154, 154, 195, 197,
1692 154, 154, 154, 172, 154, 154, 152, 152, 188, 152,
1693 183, 152, 183, 223, 156, 152, 152, 152, 152, 152,
1694 152, 223, 223, 223, 190, 152, 39, 188, 190, 224,
1695 30, 37, 57, 184, 187, 158, 197, 197, 162, 197,
1696 30, 158, 160, 208, 209, 152, 155, 40, 30, 195,
1697 195, 195, 195, 195, 152, 160, 195, 195, 195, 154,
1698 195, 195, 15, 15, 223, 10, 57, 10, 152, 237,
1699 223, 156, 224, 190, 224, 224, 224, 152, 152, 152,
1700 223, 224, 190, 223, 223, 152, 30, 18, 186, 158,
1701 160, 162, 40, 210, 184, 185, 152, 237, 152, 152,
1702 152, 152, 195, 152, 152, 152, 195, 152, 39, 223,
1703 223, 154, 223, 18, 223, 224, 233, 152, 223, 152,
1704 152, 152, 223, 223, 223, 152, 154, 190, 57, 182,
1705 30, 155, 195, 195, 195, 195, 195, 195, 195, 152,
1706 195, 190, 152, 156, 233, 234, 152, 183, 183, 152,
1707 223, 152, 224, 224, 224, 223, 234, 223, 18, 152,
1708 155, 152, 152, 155, 155, 155, 195, 155, 155, 15,
1709 158, 177, 230, 155, 224, 158, 223, 155, 155, 195,
1710 195, 195, 155, 223, 221, 158, 177, 39, 158, 155,
1711 155, 155, 152, 221, 15, 15, 152, 223, 223, 15,
1712 228, 223, 15, 223
Reid Spencere7c3c602006-11-30 06:36:44 +00001713};
1714
1715#define yyerrok (yyerrstatus = 0)
1716#define yyclearin (yychar = YYEMPTY)
1717#define YYEMPTY (-2)
1718#define YYEOF 0
1719
1720#define YYACCEPT goto yyacceptlab
1721#define YYABORT goto yyabortlab
1722#define YYERROR goto yyerrorlab
1723
1724
1725/* Like YYERROR except do call yyerror. This remains here temporarily
1726 to ease the transition to the new meaning of YYERROR, for GCC.
1727 Once GCC version 2 has supplanted version 1, this can go. */
1728
1729#define YYFAIL goto yyerrlab
1730
1731#define YYRECOVERING() (!!yyerrstatus)
1732
1733#define YYBACKUP(Token, Value) \
1734do \
1735 if (yychar == YYEMPTY && yylen == 1) \
1736 { \
1737 yychar = (Token); \
1738 yylval = (Value); \
1739 yytoken = YYTRANSLATE (yychar); \
1740 YYPOPSTACK; \
1741 goto yybackup; \
1742 } \
1743 else \
1744 { \
1745 yyerror (YY_("syntax error: cannot back up")); \
1746 YYERROR; \
1747 } \
1748while (0)
1749
1750
1751#define YYTERROR 1
1752#define YYERRCODE 256
1753
1754
1755/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1756 If N is 0, then set CURRENT to the empty location which ends
1757 the previous symbol: RHS[0] (always defined). */
1758
1759#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1760#ifndef YYLLOC_DEFAULT
1761# define YYLLOC_DEFAULT(Current, Rhs, N) \
1762 do \
1763 if (N) \
1764 { \
1765 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1766 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1767 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1768 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1769 } \
1770 else \
1771 { \
1772 (Current).first_line = (Current).last_line = \
1773 YYRHSLOC (Rhs, 0).last_line; \
1774 (Current).first_column = (Current).last_column = \
1775 YYRHSLOC (Rhs, 0).last_column; \
1776 } \
1777 while (0)
1778#endif
1779
1780
1781/* YY_LOCATION_PRINT -- Print the location on the stream.
1782 This macro was not mandated originally: define only if we know
1783 we won't break user code: when these are the locations we know. */
1784
1785#ifndef YY_LOCATION_PRINT
1786# if YYLTYPE_IS_TRIVIAL
1787# define YY_LOCATION_PRINT(File, Loc) \
1788 fprintf (File, "%d.%d-%d.%d", \
1789 (Loc).first_line, (Loc).first_column, \
1790 (Loc).last_line, (Loc).last_column)
1791# else
1792# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1793# endif
1794#endif
1795
1796
1797/* YYLEX -- calling `yylex' with the right arguments. */
1798
1799#ifdef YYLEX_PARAM
1800# define YYLEX yylex (YYLEX_PARAM)
1801#else
1802# define YYLEX yylex ()
1803#endif
1804
1805/* Enable debugging if requested. */
1806#if YYDEBUG
1807
1808# ifndef YYFPRINTF
1809# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1810# define YYFPRINTF fprintf
1811# endif
1812
1813# define YYDPRINTF(Args) \
1814do { \
1815 if (yydebug) \
1816 YYFPRINTF Args; \
1817} while (0)
1818
1819# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1820do { \
1821 if (yydebug) \
1822 { \
1823 YYFPRINTF (stderr, "%s ", Title); \
1824 yysymprint (stderr, \
1825 Type, Value); \
1826 YYFPRINTF (stderr, "\n"); \
1827 } \
1828} while (0)
1829
1830/*------------------------------------------------------------------.
1831| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1832| TOP (included). |
1833`------------------------------------------------------------------*/
1834
1835#if defined (__STDC__) || defined (__cplusplus)
1836static void
1837yy_stack_print (short int *bottom, short int *top)
1838#else
1839static void
1840yy_stack_print (bottom, top)
1841 short int *bottom;
1842 short int *top;
1843#endif
1844{
1845 YYFPRINTF (stderr, "Stack now");
1846 for (/* Nothing. */; bottom <= top; ++bottom)
1847 YYFPRINTF (stderr, " %d", *bottom);
1848 YYFPRINTF (stderr, "\n");
1849}
1850
1851# define YY_STACK_PRINT(Bottom, Top) \
1852do { \
1853 if (yydebug) \
1854 yy_stack_print ((Bottom), (Top)); \
1855} while (0)
1856
1857
1858/*------------------------------------------------.
1859| Report that the YYRULE is going to be reduced. |
1860`------------------------------------------------*/
1861
1862#if defined (__STDC__) || defined (__cplusplus)
1863static void
1864yy_reduce_print (int yyrule)
1865#else
1866static void
1867yy_reduce_print (yyrule)
1868 int yyrule;
1869#endif
1870{
1871 int yyi;
1872 unsigned long int yylno = yyrline[yyrule];
1873 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1874 yyrule - 1, yylno);
1875 /* Print the symbols being reduced, and their result. */
1876 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1877 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1878 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1879}
1880
1881# define YY_REDUCE_PRINT(Rule) \
1882do { \
1883 if (yydebug) \
1884 yy_reduce_print (Rule); \
1885} while (0)
1886
1887/* Nonzero means print parse trace. It is left uninitialized so that
1888 multiple parsers can coexist. */
1889int yydebug;
1890#else /* !YYDEBUG */
1891# define YYDPRINTF(Args)
1892# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1893# define YY_STACK_PRINT(Bottom, Top)
1894# define YY_REDUCE_PRINT(Rule)
1895#endif /* !YYDEBUG */
1896
1897
1898/* YYINITDEPTH -- initial size of the parser's stacks. */
1899#ifndef YYINITDEPTH
1900# define YYINITDEPTH 200
1901#endif
1902
1903/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1904 if the built-in stack extension method is used).
1905
1906 Do not make this value too large; the results are undefined if
1907 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1908 evaluated with infinite-precision integer arithmetic. */
1909
1910#ifndef YYMAXDEPTH
1911# define YYMAXDEPTH 10000
1912#endif
1913
1914
1915
1916#if YYERROR_VERBOSE
1917
1918# ifndef yystrlen
1919# if defined (__GLIBC__) && defined (_STRING_H)
1920# define yystrlen strlen
1921# else
1922/* Return the length of YYSTR. */
1923static YYSIZE_T
1924# if defined (__STDC__) || defined (__cplusplus)
1925yystrlen (const char *yystr)
1926# else
1927yystrlen (yystr)
1928 const char *yystr;
1929# endif
1930{
1931 const char *yys = yystr;
1932
1933 while (*yys++ != '\0')
1934 continue;
1935
1936 return yys - yystr - 1;
1937}
1938# endif
1939# endif
1940
1941# ifndef yystpcpy
1942# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1943# define yystpcpy stpcpy
1944# else
1945/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1946 YYDEST. */
1947static char *
1948# if defined (__STDC__) || defined (__cplusplus)
1949yystpcpy (char *yydest, const char *yysrc)
1950# else
1951yystpcpy (yydest, yysrc)
1952 char *yydest;
1953 const char *yysrc;
1954# endif
1955{
1956 char *yyd = yydest;
1957 const char *yys = yysrc;
1958
1959 while ((*yyd++ = *yys++) != '\0')
1960 continue;
1961
1962 return yyd - 1;
1963}
1964# endif
1965# endif
1966
1967# ifndef yytnamerr
1968/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1969 quotes and backslashes, so that it's suitable for yyerror. The
1970 heuristic is that double-quoting is unnecessary unless the string
1971 contains an apostrophe, a comma, or backslash (other than
1972 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1973 null, do not copy; instead, return the length of what the result
1974 would have been. */
1975static YYSIZE_T
1976yytnamerr (char *yyres, const char *yystr)
1977{
1978 if (*yystr == '"')
1979 {
1980 size_t yyn = 0;
1981 char const *yyp = yystr;
1982
1983 for (;;)
1984 switch (*++yyp)
1985 {
1986 case '\'':
1987 case ',':
1988 goto do_not_strip_quotes;
1989
1990 case '\\':
1991 if (*++yyp != '\\')
1992 goto do_not_strip_quotes;
1993 /* Fall through. */
1994 default:
1995 if (yyres)
1996 yyres[yyn] = *yyp;
1997 yyn++;
1998 break;
1999
2000 case '"':
2001 if (yyres)
2002 yyres[yyn] = '\0';
2003 return yyn;
2004 }
2005 do_not_strip_quotes: ;
2006 }
2007
2008 if (! yyres)
2009 return yystrlen (yystr);
2010
2011 return yystpcpy (yyres, yystr) - yyres;
2012}
2013# endif
2014
2015#endif /* YYERROR_VERBOSE */
2016
2017
2018
2019#if YYDEBUG
2020/*--------------------------------.
2021| Print this symbol on YYOUTPUT. |
2022`--------------------------------*/
2023
2024#if defined (__STDC__) || defined (__cplusplus)
2025static void
2026yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2027#else
2028static void
2029yysymprint (yyoutput, yytype, yyvaluep)
2030 FILE *yyoutput;
2031 int yytype;
2032 YYSTYPE *yyvaluep;
2033#endif
2034{
2035 /* Pacify ``unused variable'' warnings. */
2036 (void) yyvaluep;
2037
2038 if (yytype < YYNTOKENS)
2039 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2040 else
2041 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2042
2043
2044# ifdef YYPRINT
2045 if (yytype < YYNTOKENS)
2046 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2047# endif
2048 switch (yytype)
2049 {
2050 default:
2051 break;
2052 }
2053 YYFPRINTF (yyoutput, ")");
2054}
2055
2056#endif /* ! YYDEBUG */
2057/*-----------------------------------------------.
2058| Release the memory associated to this symbol. |
2059`-----------------------------------------------*/
2060
2061#if defined (__STDC__) || defined (__cplusplus)
2062static void
2063yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2064#else
2065static void
2066yydestruct (yymsg, yytype, yyvaluep)
2067 const char *yymsg;
2068 int yytype;
2069 YYSTYPE *yyvaluep;
2070#endif
2071{
2072 /* Pacify ``unused variable'' warnings. */
2073 (void) yyvaluep;
2074
2075 if (!yymsg)
2076 yymsg = "Deleting";
2077 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2078
2079 switch (yytype)
2080 {
2081
2082 default:
2083 break;
2084 }
2085}
2086
2087
2088/* Prevent warnings from -Wmissing-prototypes. */
2089
2090#ifdef YYPARSE_PARAM
2091# if defined (__STDC__) || defined (__cplusplus)
2092int yyparse (void *YYPARSE_PARAM);
2093# else
2094int yyparse ();
2095# endif
2096#else /* ! YYPARSE_PARAM */
2097#if defined (__STDC__) || defined (__cplusplus)
2098int yyparse (void);
2099#else
2100int yyparse ();
2101#endif
2102#endif /* ! YYPARSE_PARAM */
2103
2104
2105
2106/* The look-ahead symbol. */
2107int yychar;
2108
2109/* The semantic value of the look-ahead symbol. */
2110YYSTYPE yylval;
2111
2112/* Number of syntax errors so far. */
2113int yynerrs;
2114
2115
2116
2117/*----------.
2118| yyparse. |
2119`----------*/
2120
2121#ifdef YYPARSE_PARAM
2122# if defined (__STDC__) || defined (__cplusplus)
2123int yyparse (void *YYPARSE_PARAM)
2124# else
2125int yyparse (YYPARSE_PARAM)
2126 void *YYPARSE_PARAM;
2127# endif
2128#else /* ! YYPARSE_PARAM */
2129#if defined (__STDC__) || defined (__cplusplus)
2130int
2131yyparse (void)
2132#else
2133int
2134yyparse ()
2135
2136#endif
2137#endif
2138{
2139
2140 int yystate;
2141 int yyn;
2142 int yyresult;
2143 /* Number of tokens to shift before error messages enabled. */
2144 int yyerrstatus;
2145 /* Look-ahead token as an internal (translated) token number. */
2146 int yytoken = 0;
2147
2148 /* Three stacks and their tools:
2149 `yyss': related to states,
2150 `yyvs': related to semantic values,
2151 `yyls': related to locations.
2152
2153 Refer to the stacks thru separate pointers, to allow yyoverflow
2154 to reallocate them elsewhere. */
2155
2156 /* The state stack. */
2157 short int yyssa[YYINITDEPTH];
2158 short int *yyss = yyssa;
2159 short int *yyssp;
2160
2161 /* The semantic value stack. */
2162 YYSTYPE yyvsa[YYINITDEPTH];
2163 YYSTYPE *yyvs = yyvsa;
2164 YYSTYPE *yyvsp;
2165
2166
2167
2168#define YYPOPSTACK (yyvsp--, yyssp--)
2169
2170 YYSIZE_T yystacksize = YYINITDEPTH;
2171
2172 /* The variables used to return semantic value and location from the
2173 action routines. */
2174 YYSTYPE yyval;
2175
2176
2177 /* When reducing, the number of symbols on the RHS of the reduced
2178 rule. */
2179 int yylen;
2180
2181 YYDPRINTF ((stderr, "Starting parse\n"));
2182
2183 yystate = 0;
2184 yyerrstatus = 0;
2185 yynerrs = 0;
2186 yychar = YYEMPTY; /* Cause a token to be read. */
2187
2188 /* Initialize stack pointers.
2189 Waste one element of value and location stack
2190 so that they stay on the same level as the state stack.
2191 The wasted elements are never initialized. */
2192
2193 yyssp = yyss;
2194 yyvsp = yyvs;
2195
2196 goto yysetstate;
2197
2198/*------------------------------------------------------------.
2199| yynewstate -- Push a new state, which is found in yystate. |
2200`------------------------------------------------------------*/
2201 yynewstate:
2202 /* In all cases, when you get here, the value and location stacks
2203 have just been pushed. so pushing a state here evens the stacks.
2204 */
2205 yyssp++;
2206
2207 yysetstate:
2208 *yyssp = yystate;
2209
2210 if (yyss + yystacksize - 1 <= yyssp)
2211 {
2212 /* Get the current used size of the three stacks, in elements. */
2213 YYSIZE_T yysize = yyssp - yyss + 1;
2214
2215#ifdef yyoverflow
2216 {
2217 /* Give user a chance to reallocate the stack. Use copies of
2218 these so that the &'s don't force the real ones into
2219 memory. */
2220 YYSTYPE *yyvs1 = yyvs;
2221 short int *yyss1 = yyss;
2222
2223
2224 /* Each stack pointer address is followed by the size of the
2225 data in use in that stack, in bytes. This used to be a
2226 conditional around just the two extra args, but that might
2227 be undefined if yyoverflow is a macro. */
2228 yyoverflow (YY_("memory exhausted"),
2229 &yyss1, yysize * sizeof (*yyssp),
2230 &yyvs1, yysize * sizeof (*yyvsp),
2231
2232 &yystacksize);
2233
2234 yyss = yyss1;
2235 yyvs = yyvs1;
2236 }
2237#else /* no yyoverflow */
2238# ifndef YYSTACK_RELOCATE
2239 goto yyexhaustedlab;
2240# else
2241 /* Extend the stack our own way. */
2242 if (YYMAXDEPTH <= yystacksize)
2243 goto yyexhaustedlab;
2244 yystacksize *= 2;
2245 if (YYMAXDEPTH < yystacksize)
2246 yystacksize = YYMAXDEPTH;
2247
2248 {
2249 short int *yyss1 = yyss;
2250 union yyalloc *yyptr =
2251 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2252 if (! yyptr)
2253 goto yyexhaustedlab;
2254 YYSTACK_RELOCATE (yyss);
2255 YYSTACK_RELOCATE (yyvs);
2256
2257# undef YYSTACK_RELOCATE
2258 if (yyss1 != yyssa)
2259 YYSTACK_FREE (yyss1);
2260 }
2261# endif
2262#endif /* no yyoverflow */
2263
2264 yyssp = yyss + yysize - 1;
2265 yyvsp = yyvs + yysize - 1;
2266
2267
2268 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2269 (unsigned long int) yystacksize));
2270
2271 if (yyss + yystacksize - 1 <= yyssp)
2272 YYABORT;
2273 }
2274
2275 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2276
2277 goto yybackup;
2278
2279/*-----------.
2280| yybackup. |
2281`-----------*/
2282yybackup:
2283
2284/* Do appropriate processing given the current state. */
2285/* Read a look-ahead token if we need one and don't already have one. */
2286/* yyresume: */
2287
2288 /* First try to decide what to do without reference to look-ahead token. */
2289
2290 yyn = yypact[yystate];
2291 if (yyn == YYPACT_NINF)
2292 goto yydefault;
2293
2294 /* Not known => get a look-ahead token if don't already have one. */
2295
2296 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2297 if (yychar == YYEMPTY)
2298 {
2299 YYDPRINTF ((stderr, "Reading a token: "));
2300 yychar = YYLEX;
2301 }
2302
2303 if (yychar <= YYEOF)
2304 {
2305 yychar = yytoken = YYEOF;
2306 YYDPRINTF ((stderr, "Now at end of input.\n"));
2307 }
2308 else
2309 {
2310 yytoken = YYTRANSLATE (yychar);
2311 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2312 }
2313
2314 /* If the proper action on seeing token YYTOKEN is to reduce or to
2315 detect an error, take that action. */
2316 yyn += yytoken;
2317 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2318 goto yydefault;
2319 yyn = yytable[yyn];
2320 if (yyn <= 0)
2321 {
2322 if (yyn == 0 || yyn == YYTABLE_NINF)
2323 goto yyerrlab;
2324 yyn = -yyn;
2325 goto yyreduce;
2326 }
2327
2328 if (yyn == YYFINAL)
2329 YYACCEPT;
2330
2331 /* Shift the look-ahead token. */
2332 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2333
2334 /* Discard the token being shifted unless it is eof. */
2335 if (yychar != YYEOF)
2336 yychar = YYEMPTY;
2337
2338 *++yyvsp = yylval;
2339
2340
2341 /* Count tokens shifted since error; after three, turn off error
2342 status. */
2343 if (yyerrstatus)
2344 yyerrstatus--;
2345
2346 yystate = yyn;
2347 goto yynewstate;
2348
2349
2350/*-----------------------------------------------------------.
2351| yydefault -- do the default action for the current state. |
2352`-----------------------------------------------------------*/
2353yydefault:
2354 yyn = yydefact[yystate];
2355 if (yyn == 0)
2356 goto yyerrlab;
2357 goto yyreduce;
2358
2359
2360/*-----------------------------.
2361| yyreduce -- Do a reduction. |
2362`-----------------------------*/
2363yyreduce:
2364 /* yyn is the number of a rule to reduce with. */
2365 yylen = yyr2[yyn];
2366
2367 /* If YYLEN is nonzero, implement the default value of the action:
2368 `$$ = $1'.
2369
2370 Otherwise, the following line sets YYVAL to garbage.
2371 This behavior is undocumented and Bison
2372 users should not rely upon it. Assigning to YYVAL
2373 unconditionally makes the parser a bit smaller, and it avoids a
2374 GCC warning that YYVAL may be used uninitialized. */
2375 yyval = yyvsp[1-yylen];
2376
2377
2378 YY_REDUCE_PRINT (yyn);
2379 switch (yyn)
2380 {
Reid Spencer229e9362006-12-02 22:14:11 +00002381 case 77:
Reid Spencerbec0b592006-12-03 03:16:48 +00002382#line 357 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002383 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002384 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002385 ;}
2386 break;
2387
Reid Spencer229e9362006-12-02 22:14:11 +00002388 case 78:
Reid Spencerbec0b592006-12-03 03:16:48 +00002389#line 360 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002390 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002391 (yyval.String) = new std::string("");
Reid Spencere7c3c602006-11-30 06:36:44 +00002392 ;}
2393 break;
2394
Reid Spencer229e9362006-12-02 22:14:11 +00002395 case 86:
Reid Spencerbec0b592006-12-03 03:16:48 +00002396#line 367 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002397 { (yyval.String) = new std::string(""); ;}
2398 break;
2399
Reid Spencer229e9362006-12-02 22:14:11 +00002400 case 93:
Reid Spencerbec0b592006-12-03 03:16:48 +00002401#line 372 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002402 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002403 *(yyvsp[-1].String) += *(yyvsp[0].String);
2404 delete (yyvsp[0].String);
Reid Spencer16244f42006-12-01 21:10:07 +00002405 (yyval.String) = (yyvsp[-1].String);
2406 ;}
2407 break;
2408
Reid Spencer229e9362006-12-02 22:14:11 +00002409 case 94:
Reid Spencerbec0b592006-12-03 03:16:48 +00002410#line 377 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002411 { (yyval.String) = new std::string(""); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002412 break;
2413
Reid Spencer229e9362006-12-02 22:14:11 +00002414 case 95:
Reid Spencerbec0b592006-12-03 03:16:48 +00002415#line 382 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002416 { (yyval.String) = new std::string(); ;}
2417 break;
2418
Reid Spencer229e9362006-12-02 22:14:11 +00002419 case 96:
Reid Spencerbec0b592006-12-03 03:16:48 +00002420#line 383 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002421 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2422 break;
2423
Reid Spencer229e9362006-12-02 22:14:11 +00002424 case 97:
Reid Spencerbec0b592006-12-03 03:16:48 +00002425#line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002426 { (yyval.String) = new std::string(); ;}
2427 break;
2428
Reid Spencer229e9362006-12-02 22:14:11 +00002429 case 98:
Reid Spencerbec0b592006-12-03 03:16:48 +00002430#line 387 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002431 {
2432 (yyvsp[-1].String)->insert(0, ", ");
Reid Spencerf2d55322006-12-01 21:52:30 +00002433 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2434 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002435 (yyval.String) = (yyvsp[-1].String);
2436 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002437 break;
2438
Reid Spencer229e9362006-12-02 22:14:11 +00002439 case 99:
Reid Spencerbec0b592006-12-03 03:16:48 +00002440#line 395 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002441 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002442 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2443 delete (yyvsp[0].String);
2444 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002445 ;}
2446 break;
2447
Reid Spencer229e9362006-12-02 22:14:11 +00002448 case 100:
Reid Spencerbec0b592006-12-03 03:16:48 +00002449#line 401 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002450 { (yyval.String) = new std::string(); ;}
2451 break;
2452
Reid Spencer229e9362006-12-02 22:14:11 +00002453 case 102:
Reid Spencerbec0b592006-12-03 03:16:48 +00002454#line 405 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002455 { (yyval.String) = new std::string(); ;}
2456 break;
2457
Reid Spencer229e9362006-12-02 22:14:11 +00002458 case 103:
Reid Spencerbec0b592006-12-03 03:16:48 +00002459#line 406 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002460 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002461 (yyvsp[-1].String)->insert(0, ", ");
2462 if (!(yyvsp[0].String)->empty())
2463 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2464 delete (yyvsp[0].String);
2465 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002466 ;}
2467 break;
2468
Reid Spencer229e9362006-12-02 22:14:11 +00002469 case 105:
Reid Spencerbec0b592006-12-03 03:16:48 +00002470#line 416 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002471 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002472 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2473 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002474 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002475 ;}
2476 break;
2477
Reid Spencer229e9362006-12-02 22:14:11 +00002478 case 123:
Reid Spencerbec0b592006-12-03 03:16:48 +00002479#line 438 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002480 {
Reid Spencera50d5962006-12-02 04:11:07 +00002481 (yyval.Type).newTy = (yyvsp[0].String);
2482 (yyval.Type).oldTy = OpaqueTy;
2483 ;}
2484 break;
2485
Reid Spencer229e9362006-12-02 22:14:11 +00002486 case 124:
Reid Spencerbec0b592006-12-03 03:16:48 +00002487#line 442 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002488 {
2489 (yyval.Type).newTy = (yyvsp[0].String);
2490 (yyval.Type).oldTy = UnresolvedTy;
2491 ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00002492 break;
2493
Reid Spencer229e9362006-12-02 22:14:11 +00002494 case 125:
Reid Spencerbec0b592006-12-03 03:16:48 +00002495#line 446 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002496 {
2497 (yyval.Type) = (yyvsp[0].Type);
2498 ;}
2499 break;
2500
Reid Spencer229e9362006-12-02 22:14:11 +00002501 case 126:
Reid Spencerbec0b592006-12-03 03:16:48 +00002502#line 449 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002503 { // Type UpReference
Reid Spencerf2d55322006-12-01 21:52:30 +00002504 (yyvsp[0].String)->insert(0, "\\");
2505 (yyval.Type).newTy = (yyvsp[0].String);
Reid Spencera50d5962006-12-02 04:11:07 +00002506 (yyval.Type).oldTy = NumericTy;
Reid Spencere77e35e2006-12-01 20:26:20 +00002507 ;}
2508 break;
2509
Reid Spencer229e9362006-12-02 22:14:11 +00002510 case 127:
Reid Spencerbec0b592006-12-03 03:16:48 +00002511#line 454 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002512 { // Function derived type?
2513 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2514 delete (yyvsp[-1].String);
2515 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2516 (yyval.Type).oldTy = FunctionTy;
2517 ;}
2518 break;
2519
Reid Spencer229e9362006-12-02 22:14:11 +00002520 case 128:
Reid Spencerbec0b592006-12-03 03:16:48 +00002521#line 460 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002522 { // Sized array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002523 (yyvsp[-3].String)->insert(0,"[ ");
2524 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
Reid Spencere77e35e2006-12-01 20:26:20 +00002525 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002526 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002527 (yyval.Type).oldTy = ArrayTy;
Reid Spencer78720742006-12-02 20:21:22 +00002528 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002529 ;}
2530 break;
2531
Reid Spencer229e9362006-12-02 22:14:11 +00002532 case 129:
Reid Spencerbec0b592006-12-03 03:16:48 +00002533#line 468 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002534 { // Packed array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002535 (yyvsp[-3].String)->insert(0,"< ");
2536 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
Reid Spencere77e35e2006-12-01 20:26:20 +00002537 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002538 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002539 (yyval.Type).oldTy = PackedTy;
Reid Spencer78720742006-12-02 20:21:22 +00002540 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002541 ;}
2542 break;
2543
Reid Spencer229e9362006-12-02 22:14:11 +00002544 case 130:
Reid Spencerbec0b592006-12-03 03:16:48 +00002545#line 476 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002546 { // Structure type?
2547 (yyvsp[-1].String)->insert(0, "{ ");
2548 *(yyvsp[-1].String) += " }";
2549 (yyval.Type).newTy = (yyvsp[-1].String);
2550 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002551 ;}
2552 break;
2553
Reid Spencer229e9362006-12-02 22:14:11 +00002554 case 131:
Reid Spencerbec0b592006-12-03 03:16:48 +00002555#line 482 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002556 { // Empty structure type?
Reid Spencer0b7e5072006-12-01 22:42:01 +00002557 (yyval.Type).newTy = new std::string("{}");
Reid Spencere77e35e2006-12-01 20:26:20 +00002558 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002559 ;}
2560 break;
2561
Reid Spencer229e9362006-12-02 22:14:11 +00002562 case 132:
Reid Spencerbec0b592006-12-03 03:16:48 +00002563#line 486 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002564 { // Pointer type?
2565 *(yyvsp[-1].Type).newTy += '*';
Reid Spencer78720742006-12-02 20:21:22 +00002566 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere77e35e2006-12-01 20:26:20 +00002567 (yyvsp[-1].Type).oldTy = PointerTy;
2568 (yyval.Type) = (yyvsp[-1].Type);
Reid Spencere7c3c602006-11-30 06:36:44 +00002569 ;}
2570 break;
2571
Reid Spencer229e9362006-12-02 22:14:11 +00002572 case 133:
Reid Spencerbec0b592006-12-03 03:16:48 +00002573#line 497 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002574 {
2575 (yyval.String) = (yyvsp[0].Type).newTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002576 ;}
2577 break;
2578
Reid Spencer229e9362006-12-02 22:14:11 +00002579 case 134:
Reid Spencerbec0b592006-12-03 03:16:48 +00002580#line 500 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002581 {
2582 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2583 delete (yyvsp[0].Type).newTy;
2584 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002585 ;}
2586 break;
2587
Reid Spencer229e9362006-12-02 22:14:11 +00002588 case 136:
Reid Spencerbec0b592006-12-03 03:16:48 +00002589#line 509 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002590 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002591 *(yyvsp[-2].String) += ", ...";
2592 delete (yyvsp[0].String);
2593 (yyval.String) = (yyvsp[-2].String);
2594 ;}
2595 break;
2596
Reid Spencer229e9362006-12-02 22:14:11 +00002597 case 137:
Reid Spencerbec0b592006-12-03 03:16:48 +00002598#line 514 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002599 {
2600 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002601 ;}
2602 break;
2603
Reid Spencer229e9362006-12-02 22:14:11 +00002604 case 138:
Reid Spencerbec0b592006-12-03 03:16:48 +00002605#line 517 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002606 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002607 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00002608 ;}
2609 break;
2610
Reid Spencer229e9362006-12-02 22:14:11 +00002611 case 139:
Reid Spencerbec0b592006-12-03 03:16:48 +00002612#line 527 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002613 { // Nonempty unsized arr
2614 (yyval.Const).type = (yyvsp[-3].Type);
2615 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2616 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2617 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002618 ;}
2619 break;
2620
Reid Spencer229e9362006-12-02 22:14:11 +00002621 case 140:
Reid Spencerbec0b592006-12-03 03:16:48 +00002622#line 533 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002623 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002624 (yyval.Const).type = (yyvsp[-2].Type);
2625 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2626 *(yyval.Const).cnst += "[ ]";
Reid Spencere7c3c602006-11-30 06:36:44 +00002627 ;}
2628 break;
2629
Reid Spencer229e9362006-12-02 22:14:11 +00002630 case 141:
Reid Spencerbec0b592006-12-03 03:16:48 +00002631#line 538 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002632 {
2633 (yyval.Const).type = (yyvsp[-2].Type);
2634 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2635 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2636 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002637 ;}
2638 break;
2639
Reid Spencer229e9362006-12-02 22:14:11 +00002640 case 142:
Reid Spencerbec0b592006-12-03 03:16:48 +00002641#line 544 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002642 { // Nonempty unsized arr
2643 (yyval.Const).type = (yyvsp[-3].Type);
2644 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2645 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2646 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002647 ;}
2648 break;
2649
Reid Spencer229e9362006-12-02 22:14:11 +00002650 case 143:
Reid Spencerbec0b592006-12-03 03:16:48 +00002651#line 550 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002652 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002653 (yyval.Const).type = (yyvsp[-3].Type);
2654 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2655 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2656 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002657 ;}
2658 break;
2659
Reid Spencer229e9362006-12-02 22:14:11 +00002660 case 144:
Reid Spencerbec0b592006-12-03 03:16:48 +00002661#line 556 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002662 {
2663 (yyval.Const).type = (yyvsp[-2].Type);
2664 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
Reid Spencer0b7e5072006-12-01 22:42:01 +00002665 *(yyval.Const).cnst += " {}";
Reid Spencere7c3c602006-11-30 06:36:44 +00002666 ;}
2667 break;
2668
Reid Spencer229e9362006-12-02 22:14:11 +00002669 case 145:
Reid Spencerbec0b592006-12-03 03:16:48 +00002670#line 561 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002671 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002672 (yyval.Const).type = (yyvsp[-1].Type);
2673 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002674 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2675 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002676 ;}
2677 break;
2678
Reid Spencer229e9362006-12-02 22:14:11 +00002679 case 146:
Reid Spencerbec0b592006-12-03 03:16:48 +00002680#line 567 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002681 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002682 (yyval.Const).type = (yyvsp[-1].Type);
2683 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2684 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2685 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002686 ;}
2687 break;
2688
Reid Spencer229e9362006-12-02 22:14:11 +00002689 case 147:
Reid Spencerbec0b592006-12-03 03:16:48 +00002690#line 573 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002691 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002692 (yyval.Const).type = (yyvsp[-1].Type);
2693 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002694 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2695 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002696 ;}
2697 break;
2698
Reid Spencer229e9362006-12-02 22:14:11 +00002699 case 148:
Reid Spencerbec0b592006-12-03 03:16:48 +00002700#line 579 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002701 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002702 (yyval.Const).type = (yyvsp[-1].Type);
2703 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002704 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2705 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002706 ;}
2707 break;
2708
Reid Spencer229e9362006-12-02 22:14:11 +00002709 case 149:
Reid Spencerbec0b592006-12-03 03:16:48 +00002710#line 585 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002711 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002712 (yyval.Const).type = (yyvsp[-1].Type);
2713 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002714 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2715 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002716 ;}
2717 break;
2718
Reid Spencer229e9362006-12-02 22:14:11 +00002719 case 150:
Reid Spencerbec0b592006-12-03 03:16:48 +00002720#line 591 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002721 { // integral constants
Reid Spencere77e35e2006-12-01 20:26:20 +00002722 (yyval.Const).type = (yyvsp[-1].Type);
2723 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002724 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2725 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002726 ;}
2727 break;
2728
Reid Spencer229e9362006-12-02 22:14:11 +00002729 case 151:
Reid Spencerbec0b592006-12-03 03:16:48 +00002730#line 597 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002731 { // integral constants
Reid Spencere77e35e2006-12-01 20:26:20 +00002732 (yyval.Const).type = (yyvsp[-1].Type);
2733 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002734 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2735 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002736 ;}
2737 break;
2738
Reid Spencer229e9362006-12-02 22:14:11 +00002739 case 152:
Reid Spencerbec0b592006-12-03 03:16:48 +00002740#line 603 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002741 { // Boolean constants
Reid Spencere77e35e2006-12-01 20:26:20 +00002742 (yyval.Const).type = (yyvsp[-1].Type);
2743 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002744 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2745 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002746 ;}
2747 break;
2748
Reid Spencer229e9362006-12-02 22:14:11 +00002749 case 153:
Reid Spencerbec0b592006-12-03 03:16:48 +00002750#line 609 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002751 { // Boolean constants
2752 (yyval.Const).type = (yyvsp[-1].Type);
2753 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2754 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2755 delete (yyvsp[0].String);
2756 ;}
2757 break;
2758
Reid Spencer229e9362006-12-02 22:14:11 +00002759 case 154:
Reid Spencerbec0b592006-12-03 03:16:48 +00002760#line 615 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002761 { // Float & Double constants
2762 (yyval.Const).type = (yyvsp[-1].Type);
2763 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2764 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2765 delete (yyvsp[0].String);
2766 ;}
2767 break;
2768
Reid Spencer229e9362006-12-02 22:14:11 +00002769 case 155:
Reid Spencerbec0b592006-12-03 03:16:48 +00002770#line 623 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002771 {
Reid Spencer280d8012006-12-01 23:40:53 +00002772 std::string source = *(yyvsp[-3].Const).cnst;
Reid Spencera50d5962006-12-02 04:11:07 +00002773 TypeInfo DstTy = (yyvsp[-1].Type);
2774 ResolveType(DstTy);
Reid Spencer280d8012006-12-01 23:40:53 +00002775 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002776 // Call getCastUpgrade to upgrade the old cast
2777 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
2778 } else {
2779 // Nothing to upgrade, just create the cast constant expr
2780 (yyval.String) = new std::string(*(yyvsp[-5].String));
2781 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002782 }
Reid Spencere77e35e2006-12-01 20:26:20 +00002783 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002784 ;}
2785 break;
2786
Reid Spencer229e9362006-12-02 22:14:11 +00002787 case 156:
Reid Spencerbec0b592006-12-03 03:16:48 +00002788#line 637 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002789 {
Reid Spencerf8483652006-12-02 15:16:01 +00002790 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2791 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2792 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2793 *(yyvsp[-4].String) += ", " + *VI.val;
2794 VI.destroy();
2795 }
2796 *(yyvsp[-4].String) += ")";
Reid Spencere77e35e2006-12-01 20:26:20 +00002797 (yyval.String) = (yyvsp[-4].String);
2798 (yyvsp[-2].Const).destroy();
Reid Spencerf8483652006-12-02 15:16:01 +00002799 delete (yyvsp[-1].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00002800 ;}
2801 break;
2802
Reid Spencer229e9362006-12-02 22:14:11 +00002803 case 157:
Reid Spencerbec0b592006-12-03 03:16:48 +00002804#line 649 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002805 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002806 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2807 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2808 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002809 ;}
2810 break;
2811
Reid Spencer229e9362006-12-02 22:14:11 +00002812 case 158:
Reid Spencerbec0b592006-12-03 03:16:48 +00002813#line 654 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002814 {
Reid Spencer78720742006-12-02 20:21:22 +00002815 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2816 (yyval.String) = new std::string(op);
2817 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2818 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002819 ;}
2820 break;
2821
Reid Spencer229e9362006-12-02 22:14:11 +00002822 case 159:
Reid Spencerbec0b592006-12-03 03:16:48 +00002823#line 660 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002824 {
2825 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2826 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2827 (yyval.String) = (yyvsp[-5].String);
2828 ;}
2829 break;
2830
Reid Spencer229e9362006-12-02 22:14:11 +00002831 case 160:
Reid Spencerbec0b592006-12-03 03:16:48 +00002832#line 665 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002833 {
Reid Spencer229e9362006-12-02 22:14:11 +00002834#if UPGRADE_SETCOND_OPS
2835 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2836#endif
Reid Spencer78720742006-12-02 20:21:22 +00002837 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2838 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2839 (yyval.String) = (yyvsp[-5].String);
2840 ;}
2841 break;
2842
Reid Spencer229e9362006-12-02 22:14:11 +00002843 case 161:
Reid Spencerbec0b592006-12-03 03:16:48 +00002844#line 673 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer229e9362006-12-02 22:14:11 +00002845 {
2846 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2847 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2848 (yyval.String) = (yyvsp[-6].String);
2849 ;}
2850 break;
2851
2852 case 162:
Reid Spencerbec0b592006-12-03 03:16:48 +00002853#line 678 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002854 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002855 const char* shiftop = (yyvsp[-5].String)->c_str();
2856 if (*(yyvsp[-5].String) == "shr")
2857 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2858 (yyval.String) = new std::string(shiftop);
2859 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2860 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002861 ;}
2862 break;
2863
Reid Spencer229e9362006-12-02 22:14:11 +00002864 case 163:
Reid Spencerbec0b592006-12-03 03:16:48 +00002865#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002866 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002867 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2868 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2869 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002870 ;}
2871 break;
2872
Reid Spencer229e9362006-12-02 22:14:11 +00002873 case 164:
Reid Spencerbec0b592006-12-03 03:16:48 +00002874#line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002875 {
2876 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2877 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2878 (yyval.String) = (yyvsp[-7].String);
2879 ;}
2880 break;
2881
Reid Spencer229e9362006-12-02 22:14:11 +00002882 case 165:
Reid Spencerbec0b592006-12-03 03:16:48 +00002883#line 696 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002884 {
2885 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2886 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2887 (yyval.String) = (yyvsp[-7].String);
2888 ;}
2889 break;
2890
Reid Spencer229e9362006-12-02 22:14:11 +00002891 case 166:
Reid Spencerbec0b592006-12-03 03:16:48 +00002892#line 706 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002893 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002894 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2895 (yyvsp[0].Const).destroy();
2896 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002897 ;}
2898 break;
2899
Reid Spencer229e9362006-12-02 22:14:11 +00002900 case 167:
Reid Spencerbec0b592006-12-03 03:16:48 +00002901#line 711 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002902 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002903 break;
2904
Reid Spencer229e9362006-12-02 22:14:11 +00002905 case 170:
Reid Spencerbec0b592006-12-03 03:16:48 +00002906#line 726 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002907 {
2908;}
2909 break;
2910
Reid Spencer229e9362006-12-02 22:14:11 +00002911 case 171:
Reid Spencerbec0b592006-12-03 03:16:48 +00002912#line 731 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002913 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002914 (yyval.String) = 0;
2915 ;}
2916 break;
2917
Reid Spencer229e9362006-12-02 22:14:11 +00002918 case 172:
Reid Spencerbec0b592006-12-03 03:16:48 +00002919#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002920 {
2921 *O << *(yyvsp[0].String) << "\n";
2922 delete (yyvsp[0].String);
2923 (yyval.String) = 0;
2924 ;}
2925 break;
2926
Reid Spencer229e9362006-12-02 22:14:11 +00002927 case 173:
Reid Spencerbec0b592006-12-03 03:16:48 +00002928#line 739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002929 {
2930 *O << "module asm " << " " << *(yyvsp[0].String) << "\n";
Reid Spencerd154b572006-12-01 20:36:40 +00002931 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002932 ;}
2933 break;
2934
Reid Spencer229e9362006-12-02 22:14:11 +00002935 case 174:
Reid Spencerbec0b592006-12-03 03:16:48 +00002936#line 743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002937 {
Reid Spencerd154b572006-12-01 20:36:40 +00002938 *O << "implementation\n";
2939 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002940 ;}
2941 break;
2942
Reid Spencer229e9362006-12-02 22:14:11 +00002943 case 175:
Reid Spencerbec0b592006-12-03 03:16:48 +00002944#line 747 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002945 { (yyval.String) = 0; ;}
2946 break;
2947
Reid Spencer229e9362006-12-02 22:14:11 +00002948 case 177:
Reid Spencerbec0b592006-12-03 03:16:48 +00002949#line 749 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002950 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
2951 break;
2952
Reid Spencer229e9362006-12-02 22:14:11 +00002953 case 178:
Reid Spencerbec0b592006-12-03 03:16:48 +00002954#line 752 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002955 {
Reid Spencera50d5962006-12-02 04:11:07 +00002956 EnumeratedTypes.push_back((yyvsp[0].Type));
2957 if (!(yyvsp[-2].String)->empty()) {
2958 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
2959 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
Reid Spencer78720742006-12-02 20:21:22 +00002960 NamedTypes[*(yyvsp[-2].String)].elemTy = (yyvsp[0].Type).elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +00002961 *O << *(yyvsp[-2].String) << " = ";
2962 }
2963 *O << "type " << *(yyvsp[0].Type).newTy << "\n";
2964 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00002965 (yyval.String) = 0;
2966 ;}
2967 break;
2968
Reid Spencer229e9362006-12-02 22:14:11 +00002969 case 179:
Reid Spencerbec0b592006-12-03 03:16:48 +00002970#line 764 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002971 { // Function prototypes can be in const pool
2972 *O << *(yyvsp[0].String) << "\n";
2973 delete (yyvsp[0].String);
2974 (yyval.String) = 0;
2975 ;}
2976 break;
2977
Reid Spencer229e9362006-12-02 22:14:11 +00002978 case 180:
Reid Spencerbec0b592006-12-03 03:16:48 +00002979#line 769 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002980 { // Asm blocks can be in the const pool
2981 *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
2982 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
2983 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002984 ;}
2985 break;
2986
Reid Spencer229e9362006-12-02 22:14:11 +00002987 case 181:
Reid Spencerbec0b592006-12-03 03:16:48 +00002988#line 774 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002989 {
Reid Spencera50d5962006-12-02 04:11:07 +00002990 if (!(yyvsp[-4].String)->empty())
2991 *O << *(yyvsp[-4].String) << " = ";
2992 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Const).cnst << " " << *(yyvsp[0].String) << "\n";
Reid Spencere77e35e2006-12-01 20:26:20 +00002993 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
2994 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002995 ;}
2996 break;
2997
Reid Spencer229e9362006-12-02 22:14:11 +00002998 case 182:
Reid Spencerbec0b592006-12-03 03:16:48 +00002999#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003000 {
Reid Spencera50d5962006-12-02 04:11:07 +00003001 if (!(yyvsp[-4].String)->empty())
3002 *O << *(yyvsp[-4].String) << " = ";
3003 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencere77e35e2006-12-01 20:26:20 +00003004 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3005 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003006 ;}
3007 break;
3008
Reid Spencer229e9362006-12-02 22:14:11 +00003009 case 183:
Reid Spencerbec0b592006-12-03 03:16:48 +00003010#line 788 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003011 {
Reid Spencera50d5962006-12-02 04:11:07 +00003012 if (!(yyvsp[-4].String)->empty())
3013 *O << *(yyvsp[-4].String) << " = ";
3014 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencerf7bde222006-12-01 22:26:37 +00003015 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3016 (yyval.String) = 0;
3017 ;}
3018 break;
3019
Reid Spencer229e9362006-12-02 22:14:11 +00003020 case 184:
Reid Spencerbec0b592006-12-03 03:16:48 +00003021#line 795 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003022 {
Reid Spencera50d5962006-12-02 04:11:07 +00003023 if (!(yyvsp[-4].String)->empty())
3024 *O << *(yyvsp[-4].String) << " = ";
3025 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencerfcb5df82006-12-01 22:34:43 +00003026 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3027 (yyval.String) = 0;
3028 ;}
3029 break;
3030
Reid Spencer229e9362006-12-02 22:14:11 +00003031 case 185:
Reid Spencerbec0b592006-12-03 03:16:48 +00003032#line 802 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003033 {
3034 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3035 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3036 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003037 ;}
3038 break;
3039
Reid Spencer229e9362006-12-02 22:14:11 +00003040 case 186:
Reid Spencerbec0b592006-12-03 03:16:48 +00003041#line 807 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003042 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003043 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << "\n";
3044 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3045 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003046 ;}
3047 break;
3048
Reid Spencer229e9362006-12-02 22:14:11 +00003049 case 187:
Reid Spencerbec0b592006-12-03 03:16:48 +00003050#line 812 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003051 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003052 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003053 ;}
3054 break;
3055
Reid Spencer229e9362006-12-02 22:14:11 +00003056 case 191:
Reid Spencerbec0b592006-12-03 03:16:48 +00003057#line 822 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003058 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003059 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3060 delete (yyvsp[0].String);
3061 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003062 ;}
3063 break;
3064
Reid Spencer229e9362006-12-02 22:14:11 +00003065 case 192:
Reid Spencerbec0b592006-12-03 03:16:48 +00003066#line 827 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003067 {
Reid Spencerf2d55322006-12-01 21:52:30 +00003068 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3069 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003070 SizeOfPointer = 64;
Reid Spencerf2d55322006-12-01 21:52:30 +00003071 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003072 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003073 ;}
3074 break;
3075
Reid Spencer229e9362006-12-02 22:14:11 +00003076 case 193:
Reid Spencerbec0b592006-12-03 03:16:48 +00003077#line 834 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00003078 {
3079 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3080 delete (yyvsp[0].String);
3081 (yyval.String) = (yyvsp[-2].String);
3082 ;}
3083 break;
3084
Reid Spencer229e9362006-12-02 22:14:11 +00003085 case 194:
Reid Spencerbec0b592006-12-03 03:16:48 +00003086#line 839 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003087 {
3088 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3089 delete (yyvsp[0].String);
3090 (yyval.String) = (yyvsp[-2].String);
3091 ;}
3092 break;
3093
Reid Spencer229e9362006-12-02 22:14:11 +00003094 case 195:
Reid Spencerbec0b592006-12-03 03:16:48 +00003095#line 846 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003096 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003097 (yyvsp[-1].String)->insert(0, "[ ");
3098 *(yyvsp[-1].String) += " ]";
3099 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003100 ;}
3101 break;
3102
Reid Spencer229e9362006-12-02 22:14:11 +00003103 case 196:
Reid Spencerbec0b592006-12-03 03:16:48 +00003104#line 853 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003105 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003106 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3107 delete (yyvsp[0].String);
3108 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003109 ;}
3110 break;
3111
Reid Spencer229e9362006-12-02 22:14:11 +00003112 case 198:
Reid Spencerbec0b592006-12-03 03:16:48 +00003113#line 859 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003114 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003115 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00003116 ;}
3117 break;
3118
Reid Spencer229e9362006-12-02 22:14:11 +00003119 case 202:
Reid Spencerbec0b592006-12-03 03:16:48 +00003120#line 868 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003121 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003122 break;
3123
Reid Spencer229e9362006-12-02 22:14:11 +00003124 case 203:
Reid Spencerbec0b592006-12-03 03:16:48 +00003125#line 870 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003126 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003127 (yyval.String) = (yyvsp[-1].Type).newTy;
3128 if (!(yyvsp[0].String)->empty())
3129 *(yyval.String) += " " + *(yyvsp[0].String);
3130 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003131;}
3132 break;
3133
Reid Spencer229e9362006-12-02 22:14:11 +00003134 case 204:
Reid Spencerbec0b592006-12-03 03:16:48 +00003135#line 877 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003136 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003137 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3138 delete (yyvsp[0].String);
3139 ;}
3140 break;
3141
Reid Spencer229e9362006-12-02 22:14:11 +00003142 case 205:
Reid Spencerbec0b592006-12-03 03:16:48 +00003143#line 881 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003144 {
3145 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003146 ;}
3147 break;
3148
Reid Spencer229e9362006-12-02 22:14:11 +00003149 case 206:
Reid Spencerbec0b592006-12-03 03:16:48 +00003150#line 885 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003151 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003152 (yyval.String) = (yyvsp[0].String);
3153 ;}
3154 break;
3155
Reid Spencer229e9362006-12-02 22:14:11 +00003156 case 207:
Reid Spencerbec0b592006-12-03 03:16:48 +00003157#line 888 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003158 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003159 *(yyvsp[-2].String) += ", ...";
3160 (yyval.String) = (yyvsp[-2].String);
3161 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003162 ;}
3163 break;
3164
Reid Spencer229e9362006-12-02 22:14:11 +00003165 case 208:
Reid Spencerbec0b592006-12-03 03:16:48 +00003166#line 893 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003167 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003168 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003169 ;}
3170 break;
3171
Reid Spencer229e9362006-12-02 22:14:11 +00003172 case 209:
Reid Spencerbec0b592006-12-03 03:16:48 +00003173#line 896 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003174 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003175 break;
3176
Reid Spencer229e9362006-12-02 22:14:11 +00003177 case 210:
Reid Spencerbec0b592006-12-03 03:16:48 +00003178#line 899 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003179 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003180 if (!(yyvsp[-7].String)->empty()) {
3181 *(yyvsp[-7].String) += " ";
3182 }
3183 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3184 if (!(yyvsp[-1].String)->empty()) {
3185 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3186 }
3187 if (!(yyvsp[0].String)->empty()) {
3188 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3189 }
3190 (yyvsp[-6].Type).destroy();
3191 delete (yyvsp[-5].String);
3192 delete (yyvsp[-3].String);
3193 delete (yyvsp[-1].String);
3194 delete (yyvsp[0].String);
3195 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003196 ;}
3197 break;
3198
Reid Spencer229e9362006-12-02 22:14:11 +00003199 case 211:
Reid Spencerbec0b592006-12-03 03:16:48 +00003200#line 918 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003201 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003202 break;
3203
Reid Spencer229e9362006-12-02 22:14:11 +00003204 case 212:
Reid Spencerbec0b592006-12-03 03:16:48 +00003205#line 919 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003206 { (yyval.String) = new std::string ("{"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003207 break;
3208
Reid Spencer229e9362006-12-02 22:14:11 +00003209 case 213:
Reid Spencerbec0b592006-12-03 03:16:48 +00003210#line 921 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003211 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003212 if (!(yyvsp[-2].String)->empty()) {
3213 *O << *(yyvsp[-2].String) << " ";
3214 }
3215 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3216 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3217 (yyval.String) = 0;
3218;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003219 break;
3220
Reid Spencer229e9362006-12-02 22:14:11 +00003221 case 214:
Reid Spencerbec0b592006-12-03 03:16:48 +00003222#line 930 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003223 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003224 break;
3225
Reid Spencer229e9362006-12-02 22:14:11 +00003226 case 215:
Reid Spencerbec0b592006-12-03 03:16:48 +00003227#line 931 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003228 { (yyval.String) = new std::string("}"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003229 break;
3230
Reid Spencer229e9362006-12-02 22:14:11 +00003231 case 216:
Reid Spencerbec0b592006-12-03 03:16:48 +00003232#line 933 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003233 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003234 if ((yyvsp[-1].String))
3235 *O << *(yyvsp[-1].String);
3236 *O << '\n' << *(yyvsp[0].String) << "\n";
3237 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003238;}
3239 break;
3240
Reid Spencer229e9362006-12-02 22:14:11 +00003241 case 217:
Reid Spencerbec0b592006-12-03 03:16:48 +00003242#line 941 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003243 { (yyval.String) = new std::string(); ;}
3244 break;
3245
Reid Spencer229e9362006-12-02 22:14:11 +00003246 case 220:
Reid Spencerbec0b592006-12-03 03:16:48 +00003247#line 947 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003248 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003249 if (!(yyvsp[-1].String)->empty())
3250 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3251 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3252 delete (yyvsp[-1].String);
3253 delete (yyvsp[0].String);
3254 (yyval.String) = (yyvsp[-2].String);
3255 ;}
3256 break;
3257
Reid Spencer229e9362006-12-02 22:14:11 +00003258 case 221:
Reid Spencerbec0b592006-12-03 03:16:48 +00003259#line 960 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003260 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003261 break;
3262
Reid Spencer229e9362006-12-02 22:14:11 +00003263 case 231:
Reid Spencerbec0b592006-12-03 03:16:48 +00003264#line 966 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003265 {
3266 (yyvsp[-1].String)->insert(0, "<");
3267 *(yyvsp[-1].String) += ">";
3268 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003269 ;}
3270 break;
3271
Reid Spencer229e9362006-12-02 22:14:11 +00003272 case 233:
Reid Spencerbec0b592006-12-03 03:16:48 +00003273#line 972 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003274 {
3275 if (!(yyvsp[-3].String)->empty()) {
3276 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3277 }
3278 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3279 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3280 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003281 ;}
3282 break;
3283
Reid Spencer229e9362006-12-02 22:14:11 +00003284 case 236:
Reid Spencerbec0b592006-12-03 03:16:48 +00003285#line 985 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003286 {
Reid Spencerf459d392006-12-02 16:19:52 +00003287 (yyval.Value).val = (yyvsp[0].String);
3288 (yyval.Value).constant = false;
3289 (yyval.Value).type.newTy = 0;
3290 (yyval.Value).type.oldTy = UnresolvedTy;
3291 ;}
3292 break;
3293
Reid Spencer229e9362006-12-02 22:14:11 +00003294 case 237:
Reid Spencerbec0b592006-12-03 03:16:48 +00003295#line 991 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003296 {
3297 (yyval.Value).val = (yyvsp[0].String);
3298 (yyval.Value).constant = true;
3299 (yyval.Value).type.newTy = 0;
3300 (yyval.Value).type.oldTy = UnresolvedTy;
3301 ;}
3302 break;
3303
Reid Spencer229e9362006-12-02 22:14:11 +00003304 case 238:
Reid Spencerbec0b592006-12-03 03:16:48 +00003305#line 1002 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003306 {
3307 (yyval.Value) = (yyvsp[0].Value);
Reid Spencere77e35e2006-12-01 20:26:20 +00003308 (yyval.Value).type = (yyvsp[-1].Type);
Reid Spencerf459d392006-12-02 16:19:52 +00003309 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
Reid Spencere77e35e2006-12-01 20:26:20 +00003310 ;}
3311 break;
3312
Reid Spencer229e9362006-12-02 22:14:11 +00003313 case 239:
Reid Spencerbec0b592006-12-03 03:16:48 +00003314#line 1008 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003315 {
Reid Spencerf2d55322006-12-01 21:52:30 +00003316 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003317 ;}
3318 break;
3319
Reid Spencer229e9362006-12-02 22:14:11 +00003320 case 240:
Reid Spencerbec0b592006-12-03 03:16:48 +00003321#line 1011 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003322 { // Do not allow functions with 0 basic blocks
Reid Spencerf2d55322006-12-01 21:52:30 +00003323 (yyval.String) = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +00003324 ;}
3325 break;
3326
Reid Spencer229e9362006-12-02 22:14:11 +00003327 case 241:
Reid Spencerbec0b592006-12-03 03:16:48 +00003328#line 1019 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003329 {
3330 (yyval.String) = 0;
3331 ;}
3332 break;
3333
Reid Spencer229e9362006-12-02 22:14:11 +00003334 case 242:
Reid Spencerbec0b592006-12-03 03:16:48 +00003335#line 1023 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003336 {
3337 *O << " " << *(yyvsp[0].String) << "\n";
3338 delete (yyvsp[0].String);
3339 (yyval.String) = 0;
3340 ;}
3341 break;
3342
Reid Spencer229e9362006-12-02 22:14:11 +00003343 case 243:
Reid Spencerbec0b592006-12-03 03:16:48 +00003344#line 1028 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003345 {
3346 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003347 ;}
3348 break;
3349
Reid Spencer229e9362006-12-02 22:14:11 +00003350 case 244:
Reid Spencerbec0b592006-12-03 03:16:48 +00003351#line 1031 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003352 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003353 *O << *(yyvsp[0].String) << "\n";
3354 delete (yyvsp[0].String);
3355 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003356 ;}
3357 break;
3358
Reid Spencer229e9362006-12-02 22:14:11 +00003359 case 246:
Reid Spencerbec0b592006-12-03 03:16:48 +00003360#line 1037 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003361 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3362 break;
3363
Reid Spencer229e9362006-12-02 22:14:11 +00003364 case 247:
Reid Spencerbec0b592006-12-03 03:16:48 +00003365#line 1039 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003366 { // Return with a result...
3367 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Value).val << "\n";
3368 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3369 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003370 ;}
3371 break;
3372
Reid Spencer229e9362006-12-02 22:14:11 +00003373 case 248:
Reid Spencerbec0b592006-12-03 03:16:48 +00003374#line 1044 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003375 { // Return with no result...
3376 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n";
3377 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3378 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003379 ;}
3380 break;
3381
Reid Spencer229e9362006-12-02 22:14:11 +00003382 case 249:
Reid Spencerbec0b592006-12-03 03:16:48 +00003383#line 1049 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003384 { // Unconditional Branch...
Reid Spencerf459d392006-12-02 16:19:52 +00003385 *O << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3386 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003387 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003388 ;}
3389 break;
3390
Reid Spencer229e9362006-12-02 22:14:11 +00003391 case 250:
Reid Spencerbec0b592006-12-03 03:16:48 +00003392#line 1054 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003393 {
Reid Spencerf459d392006-12-02 16:19:52 +00003394 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3395 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << " "
3396 << *(yyvsp[0].Value).val << "\n";
3397 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3398 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003399 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003400 ;}
3401 break;
3402
Reid Spencer229e9362006-12-02 22:14:11 +00003403 case 251:
Reid Spencerbec0b592006-12-03 03:16:48 +00003404#line 1062 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003405 {
Reid Spencerf459d392006-12-02 16:19:52 +00003406 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3407 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3408 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3409 delete (yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003410 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003411 ;}
3412 break;
3413
Reid Spencer229e9362006-12-02 22:14:11 +00003414 case 252:
Reid Spencerbec0b592006-12-03 03:16:48 +00003415#line 1069 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003416 {
Reid Spencerf459d392006-12-02 16:19:52 +00003417 *O << " " << *(yyvsp[-7].String) << " " << *(yyvsp[-6].Type).newTy << " " << *(yyvsp[-5].Value).val << ", "
3418 << *(yyvsp[-3].Type).newTy << " " << *(yyvsp[-2].Value).val << "[]\n";
3419 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003420 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003421 ;}
3422 break;
3423
Reid Spencer229e9362006-12-02 22:14:11 +00003424 case 253:
Reid Spencerbec0b592006-12-03 03:16:48 +00003425#line 1076 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003426 {
Reid Spencer16244f42006-12-01 21:10:07 +00003427 *O << " ";
3428 if (!(yyvsp[-13].String)->empty())
Reid Spencera50d5962006-12-02 04:11:07 +00003429 *O << *(yyvsp[-13].String) << " = ";
Reid Spencerf459d392006-12-02 16:19:52 +00003430 *O << *(yyvsp[-12].String) << " " << *(yyvsp[-11].String) << " " << *(yyvsp[-10].Type).newTy << " " << *(yyvsp[-9].Value).val << " (";
Reid Spencerf8483652006-12-02 15:16:01 +00003431 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3432 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
3433 *O << *VI.val;
3434 if (i+1 < (yyvsp[-7].ValList)->size())
3435 *O << ", ";
3436 VI.destroy();
3437 }
Reid Spencerf459d392006-12-02 16:19:52 +00003438 *O << ") " << *(yyvsp[-5].String) << " " << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " "
3439 << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3440 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3441 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3442 (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003443 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003444 ;}
3445 break;
3446
Reid Spencer229e9362006-12-02 22:14:11 +00003447 case 254:
Reid Spencerbec0b592006-12-03 03:16:48 +00003448#line 1095 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003449 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003450 *O << " " << *(yyvsp[0].String) << "\n";
3451 delete (yyvsp[0].String);
3452 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003453 ;}
3454 break;
3455
Reid Spencer229e9362006-12-02 22:14:11 +00003456 case 255:
Reid Spencerbec0b592006-12-03 03:16:48 +00003457#line 1100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003458 {
Reid Spencerfcb5df82006-12-01 22:34:43 +00003459 *O << " " << *(yyvsp[0].String) << "\n";
3460 delete (yyvsp[0].String);
3461 (yyval.String) = 0;
3462 ;}
3463 break;
3464
Reid Spencer229e9362006-12-02 22:14:11 +00003465 case 256:
Reid Spencerbec0b592006-12-03 03:16:48 +00003466#line 1106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003467 {
Reid Spencerf459d392006-12-02 16:19:52 +00003468 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3469 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003470 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003471 ;}
3472 break;
3473
Reid Spencer229e9362006-12-02 22:14:11 +00003474 case 257:
Reid Spencerbec0b592006-12-03 03:16:48 +00003475#line 1111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003476 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003477 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
Reid Spencerf459d392006-12-02 16:19:52 +00003478 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3479 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003480 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003481 ;}
3482 break;
3483
Reid Spencer229e9362006-12-02 22:14:11 +00003484 case 258:
Reid Spencerbec0b592006-12-03 03:16:48 +00003485#line 1119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003486 {
Reid Spencera50d5962006-12-02 04:11:07 +00003487 if (!(yyvsp[-1].String)->empty())
3488 *(yyvsp[-1].String) += " = ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003489 *(yyvsp[-1].String) += *(yyvsp[0].String);
3490 delete (yyvsp[0].String);
3491 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003492 ;}
3493 break;
3494
Reid Spencer229e9362006-12-02 22:14:11 +00003495 case 259:
Reid Spencerbec0b592006-12-03 03:16:48 +00003496#line 1128 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003497 { // Used for PHI nodes
Reid Spencerf459d392006-12-02 16:19:52 +00003498 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3499 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3500 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3501 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3502 (yyvsp[-3].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003503 ;}
3504 break;
3505
Reid Spencer229e9362006-12-02 22:14:11 +00003506 case 260:
Reid Spencerbec0b592006-12-03 03:16:48 +00003507#line 1135 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003508 {
Reid Spencerf459d392006-12-02 16:19:52 +00003509 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3510 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003511 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003512 ;}
3513 break;
3514
Reid Spencer229e9362006-12-02 22:14:11 +00003515 case 261:
Reid Spencerbec0b592006-12-03 03:16:48 +00003516#line 1143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003517 {
3518 (yyval.ValList) = new ValueList();
3519 (yyval.ValList)->push_back((yyvsp[0].Value));
Reid Spencere7c3c602006-11-30 06:36:44 +00003520 ;}
3521 break;
3522
Reid Spencer229e9362006-12-02 22:14:11 +00003523 case 262:
Reid Spencerbec0b592006-12-03 03:16:48 +00003524#line 1147 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003525 {
3526 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3527 (yyval.ValList) = (yyvsp[-2].ValList);
3528 ;}
3529 break;
3530
Reid Spencer229e9362006-12-02 22:14:11 +00003531 case 263:
Reid Spencerbec0b592006-12-03 03:16:48 +00003532#line 1154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003533 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3534 break;
3535
Reid Spencer229e9362006-12-02 22:14:11 +00003536 case 264:
Reid Spencerbec0b592006-12-03 03:16:48 +00003537#line 1155 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003538 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00003539 break;
3540
Reid Spencer229e9362006-12-02 22:14:11 +00003541 case 265:
Reid Spencerbec0b592006-12-03 03:16:48 +00003542#line 1159 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003543 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003544 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3545 delete (yyvsp[0].String);
3546 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003547 ;}
3548 break;
3549
Reid Spencer229e9362006-12-02 22:14:11 +00003550 case 267:
Reid Spencerbec0b592006-12-03 03:16:48 +00003551#line 1167 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003552 {
3553 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
3554 (yyval.String) = new std::string(op);
3555 *(yyval.String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3556 delete (yyvsp[-4].String); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3557 ;}
3558 break;
3559
Reid Spencer229e9362006-12-02 22:14:11 +00003560 case 268:
Reid Spencerbec0b592006-12-03 03:16:48 +00003561#line 1173 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003562 {
Reid Spencerf459d392006-12-02 16:19:52 +00003563 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3564 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003565 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003566 ;}
3567 break;
3568
Reid Spencer229e9362006-12-02 22:14:11 +00003569 case 269:
Reid Spencerbec0b592006-12-03 03:16:48 +00003570#line 1178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003571 {
Reid Spencer229e9362006-12-02 22:14:11 +00003572#if UPGRADE_SETCOND_OPS
3573 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
3574#endif
Reid Spencerf459d392006-12-02 16:19:52 +00003575 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3576 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003577 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003578 ;}
3579 break;
3580
Reid Spencer229e9362006-12-02 22:14:11 +00003581 case 270:
Reid Spencerbec0b592006-12-03 03:16:48 +00003582#line 1186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer229e9362006-12-02 22:14:11 +00003583 {
3584 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " " + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + ")";
3585 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3586 (yyval.String) = (yyvsp[-6].String);
3587 ;}
3588 break;
3589
3590 case 271:
Reid Spencerbec0b592006-12-03 03:16:48 +00003591#line 1191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003592 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003593 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3594 (yyvsp[0].Value).destroy();
3595 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003596 ;}
3597 break;
3598
Reid Spencer229e9362006-12-02 22:14:11 +00003599 case 272:
Reid Spencerbec0b592006-12-03 03:16:48 +00003600#line 1196 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003601 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003602 const char* shiftop = (yyvsp[-3].String)->c_str();
3603 if (*(yyvsp[-3].String) == "shr")
3604 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3605 (yyval.String) = new std::string(shiftop);
3606 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3607 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003608 ;}
3609 break;
3610
Reid Spencer229e9362006-12-02 22:14:11 +00003611 case 273:
Reid Spencerbec0b592006-12-03 03:16:48 +00003612#line 1204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003613 {
Reid Spencer280d8012006-12-01 23:40:53 +00003614 std::string source = *(yyvsp[-2].Value).val;
Reid Spencera50d5962006-12-02 04:11:07 +00003615 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3616 TypeInfo DstTy = (yyvsp[0].Type);
3617 ResolveType(DstTy);
3618 (yyval.String) = new std::string();
Reid Spencer280d8012006-12-01 23:40:53 +00003619 if (*(yyvsp[-3].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00003620 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
3621 } else {
3622 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003623 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003624 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3625 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003626 ;}
3627 break;
3628
Reid Spencer229e9362006-12-02 22:14:11 +00003629 case 274:
Reid Spencerbec0b592006-12-03 03:16:48 +00003630#line 1218 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003631 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003632 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3633 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3634 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003635 ;}
3636 break;
3637
Reid Spencer229e9362006-12-02 22:14:11 +00003638 case 275:
Reid Spencerbec0b592006-12-03 03:16:48 +00003639#line 1223 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003640 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003641 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3642 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3643 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003644 ;}
3645 break;
3646
Reid Spencer229e9362006-12-02 22:14:11 +00003647 case 276:
Reid Spencerbec0b592006-12-03 03:16:48 +00003648#line 1228 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003649 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003650 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3651 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3652 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003653 ;}
3654 break;
3655
Reid Spencer229e9362006-12-02 22:14:11 +00003656 case 277:
Reid Spencerbec0b592006-12-03 03:16:48 +00003657#line 1233 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003658 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003659 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3660 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3661 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003662 ;}
3663 break;
3664
Reid Spencer229e9362006-12-02 22:14:11 +00003665 case 278:
Reid Spencerbec0b592006-12-03 03:16:48 +00003666#line 1238 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003667 {
3668 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3669 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3670 (yyval.String) = (yyvsp[-5].String);
3671 ;}
3672 break;
3673
Reid Spencer229e9362006-12-02 22:14:11 +00003674 case 279:
Reid Spencerbec0b592006-12-03 03:16:48 +00003675#line 1243 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003676 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003677 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3678 delete (yyvsp[0].String);
3679 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003680 ;}
3681 break;
3682
Reid Spencer229e9362006-12-02 22:14:11 +00003683 case 280:
Reid Spencerbec0b592006-12-03 03:16:48 +00003684#line 1248 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003685 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003686 if (!(yyvsp[-5].String)->empty())
3687 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3688 if (!(yyvsp[-6].String)->empty())
3689 *(yyvsp[-6].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003690 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
Reid Spencerf8483652006-12-02 15:16:01 +00003691 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3692 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3693 *(yyvsp[-6].String) += *VI.val;
3694 if (i+1 < (yyvsp[-1].ValList)->size())
3695 *(yyvsp[-6].String) += ", ";
3696 VI.destroy();
3697 }
3698 *(yyvsp[-6].String) += ")";
Reid Spencerf459d392006-12-02 16:19:52 +00003699 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003700 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003701 ;}
3702 break;
3703
Reid Spencer229e9362006-12-02 22:14:11 +00003704 case 282:
Reid Spencerbec0b592006-12-03 03:16:48 +00003705#line 1270 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003706 { (yyval.ValList) = (yyvsp[0].ValList); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003707 break;
3708
Reid Spencer229e9362006-12-02 22:14:11 +00003709 case 283:
Reid Spencerbec0b592006-12-03 03:16:48 +00003710#line 1271 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003711 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003712 break;
3713
Reid Spencer229e9362006-12-02 22:14:11 +00003714 case 285:
Reid Spencerbec0b592006-12-03 03:16:48 +00003715#line 1276 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003716 { (yyval.String) = new std::string(); ;}
3717 break;
3718
Reid Spencer229e9362006-12-02 22:14:11 +00003719 case 286:
Reid Spencerbec0b592006-12-03 03:16:48 +00003720#line 1279 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003721 {
3722 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3723 if (!(yyvsp[0].String)->empty())
3724 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3725 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3726 (yyval.String) = (yyvsp[-2].String);
3727 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003728 break;
3729
Reid Spencer229e9362006-12-02 22:14:11 +00003730 case 287:
Reid Spencerbec0b592006-12-03 03:16:48 +00003731#line 1286 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003732 {
Reid Spencerf459d392006-12-02 16:19:52 +00003733 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencere77e35e2006-12-01 20:26:20 +00003734 if (!(yyvsp[0].String)->empty())
3735 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencerf459d392006-12-02 16:19:52 +00003736 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003737 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003738 ;}
3739 break;
3740
Reid Spencer229e9362006-12-02 22:14:11 +00003741 case 288:
Reid Spencerbec0b592006-12-03 03:16:48 +00003742#line 1293 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003743 {
3744 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3745 if (!(yyvsp[0].String)->empty())
3746 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3747 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3748 (yyval.String) = (yyvsp[-2].String);
3749 ;}
3750 break;
3751
Reid Spencer229e9362006-12-02 22:14:11 +00003752 case 289:
Reid Spencerbec0b592006-12-03 03:16:48 +00003753#line 1300 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003754 {
Reid Spencerf459d392006-12-02 16:19:52 +00003755 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencerf7bde222006-12-01 22:26:37 +00003756 if (!(yyvsp[0].String)->empty())
3757 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencerf459d392006-12-02 16:19:52 +00003758 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencerf7bde222006-12-01 22:26:37 +00003759 (yyval.String) = (yyvsp[-5].String);
3760 ;}
3761 break;
3762
Reid Spencer229e9362006-12-02 22:14:11 +00003763 case 290:
Reid Spencerbec0b592006-12-03 03:16:48 +00003764#line 1307 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003765 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003766 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3767 (yyvsp[0].Value).destroy();
3768 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003769 ;}
3770 break;
3771
Reid Spencer229e9362006-12-02 22:14:11 +00003772 case 291:
Reid Spencerbec0b592006-12-03 03:16:48 +00003773#line 1312 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003774 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003775 if (!(yyvsp[-3].String)->empty())
3776 *(yyvsp[-3].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003777 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3778 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003779 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003780 ;}
3781 break;
3782
Reid Spencer229e9362006-12-02 22:14:11 +00003783 case 292:
Reid Spencerbec0b592006-12-03 03:16:48 +00003784#line 1319 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003785 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003786 if (!(yyvsp[-5].String)->empty())
3787 *(yyvsp[-5].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003788 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3789 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003790 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003791 ;}
3792 break;
3793
Reid Spencer229e9362006-12-02 22:14:11 +00003794 case 293:
Reid Spencerbec0b592006-12-03 03:16:48 +00003795#line 1326 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003796 {
Reid Spencerf459d392006-12-02 16:19:52 +00003797 // Upgrade the indices
3798 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3799 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3800 if (VI.type.isUnsigned() && !VI.isConstant() &&
3801 VI.type.getBitWidth() < 64) {
3802 std::string* old = VI.val;
3803 *O << " %gep_upgrade" << unique << " = zext " << *old
3804 << " to ulong\n";
3805 VI.val = new std::string("ulong %gep_upgrade" + llvm::utostr(unique++));
3806 VI.type.oldTy = ULongTy;
3807 delete old;
3808 }
3809 }
3810 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencerf8483652006-12-02 15:16:01 +00003811 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3812 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3813 *(yyvsp[-3].String) += ", " + *VI.val;
3814 VI.destroy();
3815 }
Reid Spencerf459d392006-12-02 16:19:52 +00003816 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003817 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003818 ;}
3819 break;
3820
3821
3822 default: break;
3823 }
3824
3825/* Line 1126 of yacc.c. */
Reid Spencerbec0b592006-12-03 03:16:48 +00003826#line 3827 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003827
3828 yyvsp -= yylen;
3829 yyssp -= yylen;
3830
3831
3832 YY_STACK_PRINT (yyss, yyssp);
3833
3834 *++yyvsp = yyval;
3835
3836
3837 /* Now `shift' the result of the reduction. Determine what state
3838 that goes to, based on the state we popped back to and the rule
3839 number reduced by. */
3840
3841 yyn = yyr1[yyn];
3842
3843 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3844 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3845 yystate = yytable[yystate];
3846 else
3847 yystate = yydefgoto[yyn - YYNTOKENS];
3848
3849 goto yynewstate;
3850
3851
3852/*------------------------------------.
3853| yyerrlab -- here on detecting error |
3854`------------------------------------*/
3855yyerrlab:
3856 /* If not already recovering from an error, report this error. */
3857 if (!yyerrstatus)
3858 {
3859 ++yynerrs;
3860#if YYERROR_VERBOSE
3861 yyn = yypact[yystate];
3862
3863 if (YYPACT_NINF < yyn && yyn < YYLAST)
3864 {
3865 int yytype = YYTRANSLATE (yychar);
3866 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3867 YYSIZE_T yysize = yysize0;
3868 YYSIZE_T yysize1;
3869 int yysize_overflow = 0;
3870 char *yymsg = 0;
3871# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3872 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3873 int yyx;
3874
3875#if 0
3876 /* This is so xgettext sees the translatable formats that are
3877 constructed on the fly. */
3878 YY_("syntax error, unexpected %s");
3879 YY_("syntax error, unexpected %s, expecting %s");
3880 YY_("syntax error, unexpected %s, expecting %s or %s");
3881 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3882 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3883#endif
3884 char *yyfmt;
3885 char const *yyf;
3886 static char const yyunexpected[] = "syntax error, unexpected %s";
3887 static char const yyexpecting[] = ", expecting %s";
3888 static char const yyor[] = " or %s";
3889 char yyformat[sizeof yyunexpected
3890 + sizeof yyexpecting - 1
3891 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3892 * (sizeof yyor - 1))];
3893 char const *yyprefix = yyexpecting;
3894
3895 /* Start YYX at -YYN if negative to avoid negative indexes in
3896 YYCHECK. */
3897 int yyxbegin = yyn < 0 ? -yyn : 0;
3898
3899 /* Stay within bounds of both yycheck and yytname. */
3900 int yychecklim = YYLAST - yyn;
3901 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3902 int yycount = 1;
3903
3904 yyarg[0] = yytname[yytype];
3905 yyfmt = yystpcpy (yyformat, yyunexpected);
3906
3907 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3908 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3909 {
3910 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3911 {
3912 yycount = 1;
3913 yysize = yysize0;
3914 yyformat[sizeof yyunexpected - 1] = '\0';
3915 break;
3916 }
3917 yyarg[yycount++] = yytname[yyx];
3918 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3919 yysize_overflow |= yysize1 < yysize;
3920 yysize = yysize1;
3921 yyfmt = yystpcpy (yyfmt, yyprefix);
3922 yyprefix = yyor;
3923 }
3924
3925 yyf = YY_(yyformat);
3926 yysize1 = yysize + yystrlen (yyf);
3927 yysize_overflow |= yysize1 < yysize;
3928 yysize = yysize1;
3929
3930 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
3931 yymsg = (char *) YYSTACK_ALLOC (yysize);
3932 if (yymsg)
3933 {
3934 /* Avoid sprintf, as that infringes on the user's name space.
3935 Don't have undefined behavior even if the translation
3936 produced a string with the wrong number of "%s"s. */
3937 char *yyp = yymsg;
3938 int yyi = 0;
3939 while ((*yyp = *yyf))
3940 {
3941 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3942 {
3943 yyp += yytnamerr (yyp, yyarg[yyi++]);
3944 yyf += 2;
3945 }
3946 else
3947 {
3948 yyp++;
3949 yyf++;
3950 }
3951 }
3952 yyerror (yymsg);
3953 YYSTACK_FREE (yymsg);
3954 }
3955 else
3956 {
3957 yyerror (YY_("syntax error"));
3958 goto yyexhaustedlab;
3959 }
3960 }
3961 else
3962#endif /* YYERROR_VERBOSE */
3963 yyerror (YY_("syntax error"));
3964 }
3965
3966
3967
3968 if (yyerrstatus == 3)
3969 {
3970 /* If just tried and failed to reuse look-ahead token after an
3971 error, discard it. */
3972
3973 if (yychar <= YYEOF)
3974 {
3975 /* Return failure if at end of input. */
3976 if (yychar == YYEOF)
3977 YYABORT;
3978 }
3979 else
3980 {
3981 yydestruct ("Error: discarding", yytoken, &yylval);
3982 yychar = YYEMPTY;
3983 }
3984 }
3985
3986 /* Else will try to reuse look-ahead token after shifting the error
3987 token. */
3988 goto yyerrlab1;
3989
3990
3991/*---------------------------------------------------.
3992| yyerrorlab -- error raised explicitly by YYERROR. |
3993`---------------------------------------------------*/
3994yyerrorlab:
3995
3996 /* Pacify compilers like GCC when the user code never invokes
3997 YYERROR and the label yyerrorlab therefore never appears in user
3998 code. */
3999 if (0)
4000 goto yyerrorlab;
4001
4002yyvsp -= yylen;
4003 yyssp -= yylen;
4004 yystate = *yyssp;
4005 goto yyerrlab1;
4006
4007
4008/*-------------------------------------------------------------.
4009| yyerrlab1 -- common code for both syntax error and YYERROR. |
4010`-------------------------------------------------------------*/
4011yyerrlab1:
4012 yyerrstatus = 3; /* Each real token shifted decrements this. */
4013
4014 for (;;)
4015 {
4016 yyn = yypact[yystate];
4017 if (yyn != YYPACT_NINF)
4018 {
4019 yyn += YYTERROR;
4020 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4021 {
4022 yyn = yytable[yyn];
4023 if (0 < yyn)
4024 break;
4025 }
4026 }
4027
4028 /* Pop the current state because it cannot handle the error token. */
4029 if (yyssp == yyss)
4030 YYABORT;
4031
4032
4033 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4034 YYPOPSTACK;
4035 yystate = *yyssp;
4036 YY_STACK_PRINT (yyss, yyssp);
4037 }
4038
4039 if (yyn == YYFINAL)
4040 YYACCEPT;
4041
4042 *++yyvsp = yylval;
4043
4044
4045 /* Shift the error token. */
4046 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4047
4048 yystate = yyn;
4049 goto yynewstate;
4050
4051
4052/*-------------------------------------.
4053| yyacceptlab -- YYACCEPT comes here. |
4054`-------------------------------------*/
4055yyacceptlab:
4056 yyresult = 0;
4057 goto yyreturn;
4058
4059/*-----------------------------------.
4060| yyabortlab -- YYABORT comes here. |
4061`-----------------------------------*/
4062yyabortlab:
4063 yyresult = 1;
4064 goto yyreturn;
4065
4066#ifndef yyoverflow
4067/*-------------------------------------------------.
4068| yyexhaustedlab -- memory exhaustion comes here. |
4069`-------------------------------------------------*/
4070yyexhaustedlab:
4071 yyerror (YY_("memory exhausted"));
4072 yyresult = 2;
4073 /* Fall through. */
4074#endif
4075
4076yyreturn:
4077 if (yychar != YYEOF && yychar != YYEMPTY)
4078 yydestruct ("Cleanup: discarding lookahead",
4079 yytoken, &yylval);
4080 while (yyssp != yyss)
4081 {
4082 yydestruct ("Cleanup: popping",
4083 yystos[*yyssp], yyvsp);
4084 YYPOPSTACK;
4085 }
4086#ifndef yyoverflow
4087 if (yyss != yyssa)
4088 YYSTACK_FREE (yyss);
4089#endif
4090 return yyresult;
4091}
4092
4093
Reid Spencerbec0b592006-12-03 03:16:48 +00004094#line 1350 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004095
4096
4097int yyerror(const char *ErrorMsg) {
4098 std::string where
4099 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4100 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4101 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4102 if (yychar == YYEMPTY || yychar == 0)
4103 errMsg += "end-of-file.";
4104 else
4105 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4106 std::cerr << errMsg << '\n';
4107 exit(1);
4108}
4109