blob: 9057eb6e1df72afd25d85b96f876cd87909ca82f [file] [log] [blame]
Jim Laskey2792cfb2006-12-06 11:03:10 +00001/* A Bison parser, made by GNU Bison 2.1. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002
Jim Laskey2792cfb2006-12-06 11:03:10 +00003/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Reid Spencere7c3c602006-11-30 06:36:44 +00005
Jim Laskey2792cfb2006-12-06 11:03:10 +00006 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.
Reid Spencere7c3c602006-11-30 06:36:44 +000010
Jim Laskey2792cfb2006-12-06 11:03:10 +000011 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. */
Reid Spencere7c3c602006-11-30 06:36:44 +000052#define yyparse Upgradeparse
Jim Laskey2792cfb2006-12-06 11:03:10 +000053#define yylex Upgradelex
Reid Spencere7c3c602006-11-30 06:36:44 +000054#define yyerror Upgradeerror
Jim Laskey2792cfb2006-12-06 11:03:10 +000055#define yylval Upgradelval
56#define yychar Upgradechar
Reid Spencere7c3c602006-11-30 06:36:44 +000057#define yydebug Upgradedebug
58#define yynerrs Upgradenerrs
59
Jim Laskey2792cfb2006-12-06 11:03:10 +000060
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 {
67 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,
91 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,
109 DLLIMPORT = 300,
110 DLLEXPORT = 301,
111 EXTERN_WEAK = 302,
112 APPENDING = 303,
113 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,
122 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,
164 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
215 };
216#endif
217/* Tokens. */
218#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
242#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
260#define DLLIMPORT 300
261#define DLLEXPORT 301
262#define EXTERN_WEAK 302
263#define APPENDING 303
264#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
273#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
315#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
366
367
368
369
370/* Copy the first part of user declarations. */
Reid Spencerf0cf1322006-12-07 04:23:03 +0000371#line 14 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +0000372
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 Spencer996fb282006-12-06 06:30:15 +0000384#define UPGRADE_SETCOND_OPS 0
Reid Spencerf0cf1322006-12-07 04:23:03 +0000385#define GENERATE_FCMP_INSTS 0
Reid Spencere7c3c602006-11-30 06:36:44 +0000386
387int yylex(); // declaration" of xxx warnings.
388int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000389extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000390
391static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000392static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000393std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000394unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000395static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000396
Reid Spencera50d5962006-12-02 04:11:07 +0000397typedef std::vector<TypeInfo> TypeVector;
398static TypeVector EnumeratedTypes;
399typedef std::map<std::string,TypeInfo> TypeMap;
400static TypeMap NamedTypes;
Reid Spencerf12ee422006-12-05 19:21:25 +0000401static TypeMap Globals;
Reid Spencera50d5962006-12-02 04:11:07 +0000402
Reid Spencerf8483652006-12-02 15:16:01 +0000403void destroy(ValueList* VL) {
404 while (!VL->empty()) {
405 ValueInfo& VI = VL->back();
406 VI.destroy();
407 VL->pop_back();
408 }
409 delete VL;
410}
411
Reid Spencer96839be2006-11-30 16:50:26 +0000412void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencere77e35e2006-12-01 20:26:20 +0000413 std::ostream &out, bool debug)
Reid Spencere7c3c602006-11-30 06:36:44 +0000414{
415 Upgradelineno = 1;
416 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000417 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000418 yydebug = debug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000419 O = &out;
420
421 if (yyparse()) {
422 std::cerr << "Parse failed.\n";
423 exit(1);
424 }
425}
426
Reid Spencera50d5962006-12-02 04:11:07 +0000427static void ResolveType(TypeInfo& Ty) {
428 if (Ty.oldTy == UnresolvedTy) {
429 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
Reid Spencer78720742006-12-02 20:21:22 +0000430 if (I != NamedTypes.end()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000431 Ty.oldTy = I->second.oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000432 Ty.elemTy = I->second.elemTy;
433 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000434 std::string msg("Can't resolve type: ");
435 msg += *Ty.newTy;
436 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000437 }
Reid Spencera50d5962006-12-02 04:11:07 +0000438 } else if (Ty.oldTy == NumericTy) {
439 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
440 if (ref < EnumeratedTypes.size()) {
441 Ty.oldTy = EnumeratedTypes[ref].oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000442 Ty.elemTy = EnumeratedTypes[ref].elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +0000443 } else {
444 std::string msg("Can't resolve type: ");
445 msg += *Ty.newTy;
446 yyerror(msg.c_str());
447 }
Reid Spencer280d8012006-12-01 23:40:53 +0000448 }
Reid Spencera50d5962006-12-02 04:11:07 +0000449 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000450}
451
Reid Spencera50d5962006-12-02 04:11:07 +0000452static const char* getCastOpcode(
453 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
454{
Reid Spencere77e35e2006-12-01 20:26:20 +0000455 unsigned SrcBits = SrcTy.getBitWidth();
456 unsigned DstBits = DstTy.getBitWidth();
457 const char* opcode = "bitcast";
458 // Run through the possibilities ...
459 if (DstTy.isIntegral()) { // Casting to integral
460 if (SrcTy.isIntegral()) { // Casting from integral
461 if (DstBits < SrcBits)
462 opcode = "trunc";
463 else if (DstBits > SrcBits) { // its an extension
464 if (SrcTy.isSigned())
465 opcode ="sext"; // signed -> SEXT
466 else
467 opcode = "zext"; // unsigned -> ZEXT
468 } else {
469 opcode = "bitcast"; // Same size, No-op cast
470 }
471 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
472 if (DstTy.isSigned())
473 opcode = "fptosi"; // FP -> sint
474 else
475 opcode = "fptoui"; // FP -> uint
476 } else if (SrcTy.isPacked()) {
477 assert(DstBits == SrcTy.getBitWidth() &&
478 "Casting packed to integer of different width");
479 opcode = "bitcast"; // same size, no-op cast
480 } else {
481 assert(SrcTy.isPointer() &&
482 "Casting from a value that is not first-class type");
483 opcode = "ptrtoint"; // ptr -> int
484 }
485 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
486 if (SrcTy.isIntegral()) { // Casting from integral
487 if (SrcTy.isSigned())
488 opcode = "sitofp"; // sint -> FP
489 else
490 opcode = "uitofp"; // uint -> FP
491 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
492 if (DstBits < SrcBits) {
493 opcode = "fptrunc"; // FP -> smaller FP
494 } else if (DstBits > SrcBits) {
495 opcode = "fpext"; // FP -> larger FP
496 } else {
497 opcode ="bitcast"; // same size, no-op cast
498 }
499 } else if (SrcTy.isPacked()) {
500 assert(DstBits == SrcTy.getBitWidth() &&
501 "Casting packed to floating point of different width");
502 opcode = "bitcast"; // same size, no-op cast
503 } else {
504 assert(0 && "Casting pointer or non-first class to float");
505 }
506 } else if (DstTy.isPacked()) {
507 if (SrcTy.isPacked()) {
508 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
509 "Casting packed to packed of different widths");
510 opcode = "bitcast"; // packed -> packed
511 } else if (DstTy.getBitWidth() == SrcBits) {
512 opcode = "bitcast"; // float/int -> packed
513 } else {
514 assert(!"Illegal cast to packed (wrong type or size)");
515 }
516 } else if (DstTy.isPointer()) {
517 if (SrcTy.isPointer()) {
518 opcode = "bitcast"; // ptr -> ptr
519 } else if (SrcTy.isIntegral()) {
520 opcode = "inttoptr"; // int -> ptr
521 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000522 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000523 }
524 } else {
525 assert(!"Casting to type that is not first-class");
526 }
527 return opcode;
528}
529
Reid Spencera50d5962006-12-02 04:11:07 +0000530static std::string getCastUpgrade(
531 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
532{
533 std::string Result;
534 std::string Source = Src;
535 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
536 // fp -> ptr cast is no longer supported but we must upgrade this
537 // by doing a double cast: fp -> int -> ptr
538 if (isConst)
539 Source = "ulong fptoui(" + Source + " to ulong)";
540 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000541 *O << " %cast_upgrade" << unique << " = fptoui " << Source
542 << " to ulong\n";
543 Source = "ulong %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000544 }
545 // Update the SrcTy for the getCastOpcode call below
546 SrcTy.destroy();
547 SrcTy.newTy = new std::string("ulong");
548 SrcTy.oldTy = ULongTy;
549 } else if (DstTy.oldTy == BoolTy) {
550 // cast ptr %x to bool was previously defined as setne ptr %x, null
551 // The ptrtoint semantic is to truncate, not compare so we must retain
552 // the original intent by replace the cast with a setne
553 const char* comparator = SrcTy.isPointer() ? ", null" :
554 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
555 if (isConst)
556 Result = "setne (" + Source + comparator + ")";
557 else
558 Result = "setne " + Source + comparator;
559 return Result; // skip cast processing below
560 }
561 ResolveType(SrcTy);
562 ResolveType(DstTy);
563 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
564 if (isConst)
565 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
566 else
567 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
568 return Result;
569}
570
Reid Spencer78720742006-12-02 20:21:22 +0000571const char* getDivRemOpcode(const std::string& opcode, const TypeInfo& TI) {
572 const char* op = opcode.c_str();
573 TypeInfo Ty = TI;
574 ResolveType(Ty);
575 if (Ty.isPacked())
576 Ty.oldTy = Ty.getElementType();
577 if (opcode == "div")
578 if (Ty.isFloatingPoint())
579 op = "fdiv";
580 else if (Ty.isUnsigned())
581 op = "udiv";
582 else if (Ty.isSigned())
583 op = "sdiv";
584 else
585 yyerror("Invalid type for div instruction");
586 else if (opcode == "rem")
587 if (Ty.isFloatingPoint())
588 op = "frem";
589 else if (Ty.isUnsigned())
590 op = "urem";
591 else if (Ty.isSigned())
592 op = "srem";
593 else
594 yyerror("Invalid type for rem instruction");
595 return op;
596}
Reid Spencere7c3c602006-11-30 06:36:44 +0000597
Reid Spencer229e9362006-12-02 22:14:11 +0000598std::string
599getCompareOp(const std::string& setcc, const TypeInfo& TI) {
600 assert(setcc.length() == 5);
601 char cc1 = setcc[3];
602 char cc2 = setcc[4];
603 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
604 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
605 std::string result("xcmp xxx");
606 result[6] = cc1;
607 result[7] = cc2;
608 if (TI.isFloatingPoint()) {
Reid Spencerf0cf1322006-12-07 04:23:03 +0000609#if GENERATE_FCMP_INSTS
Reid Spencer229e9362006-12-02 22:14:11 +0000610 result[0] = 'f';
611 result[5] = 'o'; // FIXME: Always map to ordered comparison ?
Reid Spencerf0cf1322006-12-07 04:23:03 +0000612 if (cc1 == 'n')
613 result[5] = 'u'; // NE maps to unordered
614 else
615 result[5] = 'o'; // everything else maps to ordered
616#else
617 result = setcc;
618#endif
Reid Spencer229e9362006-12-02 22:14:11 +0000619 } else if (TI.isIntegral() || TI.isPointer()) {
620 result[0] = 'i';
621 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
622 result.erase(5,1);
623 else if (TI.isSigned())
624 result[5] = 's';
Reid Spencer3e5ab8c2006-12-06 06:25:46 +0000625 else if (TI.isUnsigned() || TI.isPointer() || TI.isBool())
Reid Spencer229e9362006-12-02 22:14:11 +0000626 result[5] = 'u';
627 else
628 yyerror("Invalid integral type for setcc");
629 }
630 return result;
631}
632
633
Jim Laskey2792cfb2006-12-06 11:03:10 +0000634
635/* Enabling traces. */
636#ifndef YYDEBUG
637# define YYDEBUG 0
638#endif
639
640/* Enabling verbose error messages. */
641#ifdef YYERROR_VERBOSE
642# undef YYERROR_VERBOSE
643# define YYERROR_VERBOSE 1
644#else
645# define YYERROR_VERBOSE 0
646#endif
647
648/* Enabling the token table. */
649#ifndef YYTOKEN_TABLE
650# define YYTOKEN_TABLE 0
651#endif
652
653#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencerf0cf1322006-12-07 04:23:03 +0000654#line 279 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000655typedef union YYSTYPE {
Reid Spencere77e35e2006-12-01 20:26:20 +0000656 std::string* String;
657 TypeInfo Type;
658 ValueInfo Value;
659 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000660 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000661} YYSTYPE;
Jim Laskey2792cfb2006-12-06 11:03:10 +0000662/* Line 196 of yacc.c. */
Reid Spencerf0cf1322006-12-07 04:23:03 +0000663#line 664 "UpgradeParser.tab.c"
Jim Laskey2792cfb2006-12-06 11:03:10 +0000664# define yystype YYSTYPE /* obsolescent; will be withdrawn */
665# define YYSTYPE_IS_DECLARED 1
666# define YYSTYPE_IS_TRIVIAL 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000667#endif
668
669
670
Jim Laskey2792cfb2006-12-06 11:03:10 +0000671/* Copy the second part of user declarations. */
Reid Spencere7c3c602006-11-30 06:36:44 +0000672
673
Jim Laskey2792cfb2006-12-06 11:03:10 +0000674/* Line 219 of yacc.c. */
Reid Spencerf0cf1322006-12-07 04:23:03 +0000675#line 676 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000676
Jim Laskey2792cfb2006-12-06 11:03:10 +0000677#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
678# define YYSIZE_T __SIZE_TYPE__
679#endif
680#if ! defined (YYSIZE_T) && defined (size_t)
681# define YYSIZE_T size_t
682#endif
683#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
684# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
685# define YYSIZE_T size_t
686#endif
687#if ! defined (YYSIZE_T)
688# define YYSIZE_T unsigned int
689#endif
Reid Spencere7c3c602006-11-30 06:36:44 +0000690
Jim Laskey2792cfb2006-12-06 11:03:10 +0000691#ifndef YY_
692# if YYENABLE_NLS
693# if ENABLE_NLS
694# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
695# define YY_(msgid) dgettext ("bison-runtime", msgid)
696# endif
697# endif
698# ifndef YY_
699# define YY_(msgid) msgid
700# endif
701#endif
702
703#if ! defined (yyoverflow) || YYERROR_VERBOSE
704
705/* The parser invokes alloca or malloc; define the necessary symbols. */
706
707# ifdef YYSTACK_USE_ALLOCA
708# if YYSTACK_USE_ALLOCA
709# ifdef __GNUC__
710# define YYSTACK_ALLOC __builtin_alloca
711# else
712# define YYSTACK_ALLOC alloca
713# if defined (__STDC__) || defined (__cplusplus)
714# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
715# define YYINCLUDED_STDLIB_H
716# endif
717# endif
718# endif
719# endif
720
721# ifdef YYSTACK_ALLOC
722 /* Pacify GCC's `empty if-body' warning. */
723# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
724# ifndef YYSTACK_ALLOC_MAXIMUM
725 /* The OS might guarantee only one guard page at the bottom of the stack,
726 and a page size can be as small as 4096 bytes. So we cannot safely
727 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
728 to allow for a few compiler-allocated temporary stack slots. */
729# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
730# endif
731# else
732# define YYSTACK_ALLOC YYMALLOC
733# define YYSTACK_FREE YYFREE
734# ifndef YYSTACK_ALLOC_MAXIMUM
735# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
736# endif
737# ifdef __cplusplus
738extern "C" {
739# endif
740# ifndef YYMALLOC
741# define YYMALLOC malloc
742# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
743 && (defined (__STDC__) || defined (__cplusplus)))
744void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
745# endif
746# endif
747# ifndef YYFREE
748# define YYFREE free
749# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
750 && (defined (__STDC__) || defined (__cplusplus)))
751void free (void *); /* INFRINGES ON USER NAME SPACE */
752# endif
753# endif
754# ifdef __cplusplus
755}
756# endif
757# endif
758#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
759
760
761#if (! defined (yyoverflow) \
762 && (! defined (__cplusplus) \
763 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
764
765/* A type that is properly aligned for any stack member. */
766union yyalloc
767{
768 short int yyss;
769 YYSTYPE yyvs;
770 };
771
772/* The size of the maximum gap between one aligned stack and the next. */
773# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
774
775/* The size of an array large to enough to hold all stacks, each with
776 N elements. */
777# define YYSTACK_BYTES(N) \
778 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
779 + YYSTACK_GAP_MAXIMUM)
780
781/* Copy COUNT objects from FROM to TO. The source and destination do
782 not overlap. */
783# ifndef YYCOPY
784# if defined (__GNUC__) && 1 < __GNUC__
785# define YYCOPY(To, From, Count) \
786 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
787# else
788# define YYCOPY(To, From, Count) \
789 do \
790 { \
791 YYSIZE_T yyi; \
792 for (yyi = 0; yyi < (Count); yyi++) \
793 (To)[yyi] = (From)[yyi]; \
794 } \
795 while (0)
796# endif
797# endif
798
799/* Relocate STACK from its old location to the new one. The
800 local variables YYSIZE and YYSTACKSIZE give the old and new number of
801 elements in the stack, and YYPTR gives the new location of the
802 stack. Advance YYPTR to a properly aligned location for the next
803 stack. */
804# define YYSTACK_RELOCATE(Stack) \
805 do \
806 { \
807 YYSIZE_T yynewbytes; \
808 YYCOPY (&yyptr->Stack, Stack, yysize); \
809 Stack = &yyptr->Stack; \
810 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
811 yyptr += yynewbytes / sizeof (*yyptr); \
812 } \
813 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +0000814
815#endif
816
Jim Laskey2792cfb2006-12-06 11:03:10 +0000817#if defined (__STDC__) || defined (__cplusplus)
818 typedef signed char yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000819#else
Jim Laskey2792cfb2006-12-06 11:03:10 +0000820 typedef short int yysigned_char;
Reid Spencere7c3c602006-11-30 06:36:44 +0000821#endif
822
Jim Laskey2792cfb2006-12-06 11:03:10 +0000823/* YYFINAL -- State number of the termination state. */
824#define YYFINAL 4
825/* YYLAST -- Last index in YYTABLE. */
826#define YYLAST 1483
827
828/* YYNTOKENS -- Number of terminals. */
829#define YYNTOKENS 165
830/* YYNNTS -- Number of nonterminals. */
831#define YYNNTS 75
832/* YYNRULES -- Number of rules. */
833#define YYNRULES 299
834/* YYNRULES -- Number of states. */
835#define YYNSTATES 582
836
837/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
838#define YYUNDEFTOK 2
839#define YYMAXUTOK 405
840
841#define YYTRANSLATE(YYX) \
842 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
843
844/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
845static const unsigned char yytranslate[] =
846{
847 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
848 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
849 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
850 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
851 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
852 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
853 159, 151, 160, 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, 156, 153, 158, 2, 2, 2, 2, 2, 164,
857 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
859 157, 2, 2, 161, 2, 162, 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, 2, 2, 2, 2,
863 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
864 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
865 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
866 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
867 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
869 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
870 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
871 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
872 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
873 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
874 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
875 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
876 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
877 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
878 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
879 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
880 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
881 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
882 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
883 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
884 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
885 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
886 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
887 145, 146, 147, 148, 149, 150
888};
889
890#if YYDEBUG
891/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
892 YYRHS. */
893static const unsigned short int yyprhs[] =
894{
895 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
896 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
897 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
898 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
899 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
900 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
901 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
902 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
903 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
904 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
905 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
906 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
907 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
908 261, 264, 269, 275, 281, 285, 288, 291, 293, 297,
909 299, 303, 305, 306, 311, 315, 319, 324, 329, 333,
910 336, 339, 342, 345, 348, 351, 354, 357, 360, 363,
911 370, 376, 385, 392, 399, 406, 414, 422, 429, 436,
912 445, 454, 458, 460, 462, 464, 466, 469, 472, 477,
913 480, 482, 484, 486, 491, 494, 499, 506, 513, 520,
914 527, 531, 536, 537, 539, 541, 543, 547, 551, 555,
915 559, 563, 567, 569, 570, 572, 574, 576, 577, 580,
916 584, 586, 588, 592, 594, 595, 604, 606, 608, 612,
917 614, 616, 620, 621, 623, 625, 629, 630, 632, 634,
918 636, 638, 640, 642, 644, 646, 648, 652, 654, 660,
919 662, 664, 666, 668, 671, 674, 676, 679, 682, 683,
920 685, 687, 689, 692, 695, 699, 709, 719, 728, 743,
921 745, 747, 754, 760, 763, 770, 778, 780, 784, 786,
922 787, 790, 792, 798, 804, 810, 818, 826, 829, 834,
923 839, 846, 851, 856, 863, 870, 873, 881, 883, 886,
924 887, 889, 890, 894, 901, 905, 912, 915, 920, 927
925};
926
927/* YYRHS -- A `-1'-separated list of the rules' RHS. */
928static const short int yyrhs[] =
929{
930 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
931 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
932 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
933 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
934 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
935 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
936 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
937 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
938 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
939 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
940 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
941 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
942 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
943 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
944 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
945 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
946 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
947 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
948 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
949 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
950 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
951 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
952 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
953 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
954 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
955 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
956 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
957 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
958 -1, 161, 193, 162, -1, 161, 162, -1, 192, 163,
959 -1, 192, -1, 193, 152, 192, -1, 193, -1, 193,
960 152, 40, -1, 40, -1, -1, 190, 156, 197, 158,
961 -1, 190, 156, 158, -1, 190, 164, 30, -1, 190,
962 159, 197, 160, -1, 190, 161, 197, 162, -1, 190,
963 161, 162, -1, 190, 22, -1, 190, 23, -1, 190,
964 222, -1, 190, 196, -1, 190, 24, -1, 175, 167,
965 -1, 176, 18, -1, 4, 25, -1, 4, 26, -1,
966 178, 21, -1, 174, 154, 195, 39, 190, 155, -1,
967 127, 154, 195, 237, 155, -1, 129, 154, 195, 152,
968 195, 152, 195, 155, -1, 168, 154, 195, 152, 195,
969 155, -1, 169, 154, 195, 152, 195, 155, -1, 170,
970 154, 195, 152, 195, 155, -1, 100, 171, 154, 195,
971 152, 195, 155, -1, 101, 172, 154, 195, 152, 195,
972 155, -1, 173, 154, 195, 152, 195, 155, -1, 135,
973 154, 195, 152, 195, 155, -1, 136, 154, 195, 152,
974 195, 152, 195, 155, -1, 137, 154, 195, 152, 195,
975 152, 195, 155, -1, 197, 152, 195, -1, 195, -1,
976 35, -1, 36, -1, 200, -1, 200, 217, -1, 200,
977 219, -1, 200, 63, 62, 203, -1, 200, 31, -1,
978 202, -1, 50, -1, 58, -1, 202, 179, 27, 188,
979 -1, 202, 219, -1, 202, 63, 62, 203, -1, 202,
980 179, 180, 198, 195, 186, -1, 202, 179, 201, 198,
981 190, 186, -1, 202, 179, 45, 198, 190, 186, -1,
982 202, 179, 47, 198, 190, 186, -1, 202, 51, 205,
983 -1, 202, 59, 151, 206, -1, -1, 30, -1, 56,
984 -1, 55, -1, 53, 151, 204, -1, 54, 151, 18,
985 -1, 52, 151, 30, -1, 72, 151, 30, -1, 156,
986 207, 158, -1, 207, 152, 30, -1, 30, -1, -1,
987 28, -1, 30, -1, 208, -1, -1, 190, 209, -1,
988 211, 152, 210, -1, 210, -1, 211, -1, 211, 152,
989 40, -1, 40, -1, -1, 181, 188, 208, 154, 212,
990 155, 185, 182, -1, 32, -1, 161, -1, 180, 213,
991 214, -1, 33, -1, 162, -1, 215, 225, 216, -1,
992 -1, 45, -1, 47, -1, 34, 218, 213, -1, -1,
993 64, -1, 17, -1, 18, -1, 21, -1, 25, -1,
994 26, -1, 22, -1, 23, -1, 24, -1, 159, 197,
995 160, -1, 196, -1, 62, 220, 30, 152, 30, -1,
996 166, -1, 208, -1, 222, -1, 221, -1, 190, 223,
997 -1, 225, 226, -1, 226, -1, 227, 229, -1, 227,
998 231, -1, -1, 29, -1, 78, -1, 77, -1, 73,
999 224, -1, 73, 3, -1, 74, 15, 223, -1, 74,
1000 4, 223, 152, 15, 223, 152, 15, 223, -1, 75,
1001 177, 223, 152, 15, 223, 156, 230, 158, -1, 75,
1002 177, 223, 152, 15, 223, 156, 158, -1, 179, 76,
1003 181, 188, 223, 154, 234, 155, 39, 15, 223, 228,
1004 15, 223, -1, 228, -1, 79, -1, 230, 177, 221,
1005 152, 15, 223, -1, 177, 221, 152, 15, 223, -1,
1006 179, 236, -1, 190, 156, 223, 152, 223, 158, -1,
1007 232, 152, 156, 223, 152, 223, 158, -1, 224, -1,
1008 233, 152, 224, -1, 233, -1, -1, 61, 60, -1,
1009 60, -1, 168, 190, 223, 152, 223, -1, 169, 190,
1010 223, 152, 223, -1, 170, 190, 223, 152, 223, -1,
1011 100, 171, 190, 223, 152, 223, 155, -1, 101, 172,
1012 190, 223, 152, 223, 155, -1, 49, 224, -1, 173,
1013 224, 152, 224, -1, 174, 224, 39, 190, -1, 129,
1014 224, 152, 224, 152, 224, -1, 134, 224, 152, 190,
1015 -1, 135, 224, 152, 224, -1, 136, 224, 152, 224,
1016 152, 224, -1, 137, 224, 152, 224, 152, 224, -1,
1017 128, 232, -1, 235, 181, 188, 223, 154, 234, 155,
1018 -1, 239, -1, 152, 233, -1, -1, 38, -1, -1,
1019 122, 190, 183, -1, 122, 190, 152, 10, 223, 183,
1020 -1, 123, 190, 183, -1, 123, 190, 152, 10, 223,
1021 183, -1, 124, 224, -1, 238, 125, 190, 223, -1,
1022 238, 126, 224, 152, 190, 223, -1, 127, 190, 223,
1023 237, -1
1024};
1025
1026/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1027static const unsigned short int yyrline[] =
1028{
Reid Spencerf0cf1322006-12-07 04:23:03 +00001029 0, 342, 342, 342, 343, 343, 347, 347, 347, 347,
1030 347, 347, 347, 348, 348, 348, 348, 349, 349, 349,
1031 350, 350, 350, 350, 350, 350, 351, 351, 351, 351,
1032 351, 351, 351, 351, 351, 351, 352, 352, 352, 352,
1033 352, 352, 352, 352, 352, 352, 353, 353, 353, 353,
1034 353, 353, 354, 354, 354, 354, 355, 355, 355, 355,
1035 355, 355, 355, 356, 356, 356, 356, 356, 356, 361,
1036 361, 361, 361, 362, 362, 362, 362, 363, 363, 364,
1037 364, 367, 370, 375, 375, 375, 375, 375, 375, 376,
1038 377, 380, 380, 380, 380, 380, 381, 382, 387, 392,
1039 393, 396, 397, 405, 411, 412, 415, 416, 425, 426,
1040 439, 439, 440, 440, 441, 445, 445, 445, 445, 445,
1041 445, 445, 446, 446, 446, 446, 446, 448, 452, 456,
1042 459, 464, 470, 478, 486, 492, 496, 507, 510, 518,
1043 519, 524, 527, 537, 543, 548, 554, 560, 566, 571,
1044 577, 583, 589, 595, 601, 607, 613, 619, 625, 633,
1045 647, 659, 664, 670, 675, 683, 688, 693, 701, 706,
1046 711, 721, 726, 731, 731, 741, 746, 749, 754, 758,
1047 762, 764, 764, 767, 779, 784, 789, 798, 807, 816,
1048 825, 830, 835, 840, 842, 842, 845, 850, 857, 862,
1049 869, 876, 881, 882, 890, 890, 891, 891, 893, 900,
1050 904, 908, 911, 916, 919, 921, 941, 942, 944, 953,
1051 954, 956, 964, 965, 966, 970, 983, 984, 987, 987,
1052 987, 987, 987, 987, 987, 988, 989, 994, 995, 1004,
1053 1004, 1008, 1014, 1025, 1031, 1034, 1042, 1046, 1051, 1054,
1054 1060, 1060, 1062, 1067, 1072, 1077, 1085, 1092, 1098, 1118,
1055 1123, 1129, 1134, 1142, 1151, 1158, 1166, 1170, 1177, 1178,
1056 1182, 1187, 1190, 1196, 1201, 1209, 1214, 1219, 1224, 1232,
1057 1246, 1251, 1256, 1261, 1266, 1271, 1276, 1293, 1298, 1299,
1058 1303, 1304, 1307, 1314, 1321, 1328, 1335, 1340, 1347, 1354
Jim Laskey2792cfb2006-12-06 11:03:10 +00001059};
1060#endif
1061
1062#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1063/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1064 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1065static const char *const yytname[] =
1066{
1067 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1068 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1069 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1070 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1071 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1072 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1073 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1074 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1075 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1076 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1077 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1078 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1079 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1080 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1081 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1082 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1083 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1084 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1085 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1086 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1087 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1088 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1089 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1090 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1091 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1092 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1093 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1094 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1095 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1096 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1097 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1098 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1099 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1100 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1101 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1102 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1103 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1104 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1105 "IndexList", "OptVolatile", "MemoryInst", 0
1106};
1107#endif
1108
1109# ifdef YYPRINT
1110/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1111 token YYLEX-NUM. */
1112static const unsigned short int yytoknum[] =
1113{
1114 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1115 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1116 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1117 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1118 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1119 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1120 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1121 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1122 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1123 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1124 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1125 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1126 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1127 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1128 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1129 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1130 62, 123, 125, 42, 99
1131};
1132# endif
1133
1134/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1135static const unsigned char yyr1[] =
1136{
1137 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1138 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1139 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1140 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
1141 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1142 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1143 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1144 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1145 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1146 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1147 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1148 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1149 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1150 192, 192, 192, 192, 192, 192, 192, 193, 193, 194,
1151 194, 194, 194, 195, 195, 195, 195, 195, 195, 195,
1152 195, 195, 195, 195, 195, 195, 195, 195, 195, 196,
1153 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1154 196, 197, 197, 198, 198, 199, 200, 200, 200, 200,
1155 200, 201, 201, 202, 202, 202, 202, 202, 202, 202,
1156 202, 202, 202, 203, 204, 204, 205, 205, 205, 205,
1157 206, 207, 207, 207, 208, 208, 209, 209, 210, 211,
1158 211, 212, 212, 212, 212, 213, 214, 214, 215, 216,
1159 216, 217, 218, 218, 218, 219, 220, 220, 221, 221,
1160 221, 221, 221, 221, 221, 221, 221, 221, 221, 222,
1161 222, 223, 223, 224, 225, 225, 226, 227, 227, 227,
1162 228, 228, 229, 229, 229, 229, 229, 229, 229, 229,
1163 229, 230, 230, 231, 232, 232, 233, 233, 234, 234,
1164 235, 235, 236, 236, 236, 236, 236, 236, 236, 236,
1165 236, 236, 236, 236, 236, 236, 236, 236, 237, 237,
1166 238, 238, 239, 239, 239, 239, 239, 239, 239, 239
1167};
1168
1169/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1170static const unsigned char yyr2[] =
1171{
1172 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1173 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1174 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1175 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1176 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1177 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1178 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1179 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1180 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1181 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1182 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1183 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1184 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1185 2, 4, 5, 5, 3, 2, 2, 1, 3, 1,
1186 3, 1, 0, 4, 3, 3, 4, 4, 3, 2,
1187 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
1188 5, 8, 6, 6, 6, 7, 7, 6, 6, 8,
1189 8, 3, 1, 1, 1, 1, 2, 2, 4, 2,
1190 1, 1, 1, 4, 2, 4, 6, 6, 6, 6,
1191 3, 4, 0, 1, 1, 1, 3, 3, 3, 3,
1192 3, 3, 1, 0, 1, 1, 1, 0, 2, 3,
1193 1, 1, 3, 1, 0, 8, 1, 1, 3, 1,
1194 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
1195 1, 1, 1, 1, 1, 1, 3, 1, 5, 1,
1196 1, 1, 1, 2, 2, 1, 2, 2, 0, 1,
1197 1, 1, 2, 2, 3, 9, 9, 8, 14, 1,
1198 1, 6, 5, 2, 6, 7, 1, 3, 1, 0,
1199 2, 1, 5, 5, 5, 7, 7, 2, 4, 4,
1200 6, 4, 4, 6, 6, 2, 7, 1, 2, 0,
1201 1, 0, 3, 6, 3, 6, 2, 4, 6, 4
1202};
1203
1204/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1205 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1206 means the default is an error. */
1207static const unsigned short int yydefact[] =
1208{
1209 192, 0, 90, 180, 1, 179, 222, 83, 84, 85,
1210 87, 88, 89, 86, 0, 98, 248, 176, 177, 204,
1211 205, 0, 0, 0, 90, 0, 184, 223, 224, 98,
1212 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1213 249, 248, 245, 82, 0, 0, 0, 0, 190, 0,
1214 0, 0, 0, 0, 181, 182, 0, 0, 81, 225,
1215 193, 178, 97, 111, 115, 116, 117, 118, 119, 120,
1216 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1217 0, 0, 0, 239, 0, 0, 110, 129, 114, 240,
1218 128, 216, 217, 218, 219, 220, 221, 244, 0, 0,
1219 0, 251, 250, 260, 291, 259, 246, 247, 0, 0,
1220 0, 0, 203, 191, 185, 183, 173, 174, 0, 0,
1221 0, 0, 130, 0, 0, 113, 135, 137, 0, 0,
1222 142, 136, 253, 0, 252, 0, 0, 72, 76, 71,
1223 75, 70, 74, 69, 73, 77, 78, 0, 290, 0,
1224 271, 0, 98, 6, 7, 8, 9, 10, 11, 12,
1225 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1226 23, 24, 25, 0, 0, 0, 0, 0, 0, 0,
1227 0, 52, 53, 54, 55, 0, 0, 0, 0, 68,
1228 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1229 66, 67, 0, 0, 0, 0, 0, 98, 263, 0,
1230 287, 198, 195, 194, 196, 197, 199, 202, 0, 106,
1231 106, 115, 116, 117, 118, 119, 120, 121, 122, 123,
1232 124, 125, 0, 0, 0, 0, 106, 106, 0, 0,
1233 0, 134, 214, 141, 139, 0, 228, 229, 230, 233,
1234 234, 235, 231, 232, 226, 0, 0, 0, 0, 0,
1235 0, 0, 0, 0, 0, 0, 0, 0, 237, 242,
1236 241, 243, 0, 254, 0, 277, 270, 0, 26, 27,
1237 28, 29, 30, 31, 32, 33, 34, 35, 0, 50,
1238 51, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1239 45, 46, 47, 48, 49, 0, 101, 101, 296, 0,
1240 0, 285, 0, 0, 0, 0, 0, 0, 0, 0,
1241 0, 0, 0, 0, 0, 0, 200, 0, 188, 189,
1242 156, 157, 4, 5, 154, 155, 158, 149, 150, 153,
1243 0, 0, 0, 0, 152, 151, 186, 187, 112, 112,
1244 138, 213, 207, 210, 211, 0, 0, 131, 227, 0,
1245 0, 0, 0, 0, 0, 0, 0, 172, 0, 0,
1246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1247 292, 0, 294, 289, 0, 0, 0, 0, 0, 0,
1248 0, 0, 0, 0, 0, 0, 0, 0, 0, 201,
1249 0, 0, 108, 106, 144, 0, 0, 148, 0, 145,
1250 132, 133, 206, 208, 0, 104, 140, 0, 0, 0,
1251 289, 0, 0, 0, 0, 0, 236, 0, 0, 0,
1252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1253 0, 299, 0, 0, 0, 281, 282, 0, 0, 0,
1254 0, 0, 278, 279, 0, 297, 0, 103, 109, 107,
1255 143, 146, 147, 212, 209, 105, 99, 0, 0, 0,
1256 0, 0, 0, 0, 0, 171, 0, 0, 0, 0,
1257 0, 0, 0, 269, 0, 0, 101, 102, 101, 266,
1258 288, 0, 0, 0, 0, 0, 272, 273, 274, 269,
1259 0, 0, 215, 238, 0, 0, 160, 0, 0, 0,
1260 0, 0, 0, 0, 0, 0, 0, 0, 268, 0,
1261 0, 0, 0, 293, 295, 0, 0, 0, 280, 283,
1262 284, 0, 298, 100, 0, 0, 0, 168, 0, 0,
1263 162, 163, 164, 167, 159, 0, 257, 0, 0, 0,
1264 275, 276, 267, 264, 0, 286, 165, 166, 0, 0,
1265 0, 255, 0, 256, 0, 0, 265, 161, 169, 170,
1266 0, 0, 0, 0, 0, 0, 262, 0, 0, 261,
1267 0, 258
1268};
1269
1270/* YYDEFGOTO[NTERM-NUM]. */
1271static const short int yydefgoto[] =
1272{
1273 -1, 83, 334, 263, 264, 265, 288, 305, 266, 267,
1274 232, 233, 147, 234, 24, 15, 38, 502, 380, 402,
1275 466, 328, 403, 84, 85, 235, 87, 88, 128, 245,
1276 367, 268, 368, 118, 1, 2, 57, 3, 61, 214,
1277 48, 113, 218, 89, 413, 353, 354, 355, 39, 93,
1278 16, 96, 17, 29, 18, 359, 269, 90, 271, 489,
1279 41, 42, 43, 105, 106, 548, 107, 311, 518, 519,
1280 207, 208, 441, 209, 210
1281};
1282
1283/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1284 STATE-NUM. */
1285#define YYPACT_NINF -501
1286static const short int yypact[] =
1287{
1288 -501, 82, 9, 975, -501, -501, 72, -501, -501, -501,
1289 -501, -501, -501, -501, 29, 34, 94, -501, -501, -501,
1290 -501, -28, -42, 66, 127, 25, -501, -501, -501, 34,
1291 122, 199, -501, -501, -501, -501, -501, -501, 839, -17,
1292 -501, -19, -501, 47, 67, 68, 69, 75, -501, 71,
1293 122, 839, 11, 11, -501, -501, 11, 11, -501, -501,
1294 -501, -501, -501, 76, -501, -501, -501, -501, -501, -501,
1295 -501, -501, -501, -501, -501, -501, -501, -501, -501, 207,
1296 210, 211, 518, -501, 123, 77, -501, -501, -84, -501,
1297 -501, -501, -501, -501, -501, -501, -501, -501, 876, 8,
1298 253, -501, -501, -501, 1333, -501, -501, -501, 203, 80,
1299 217, 206, 208, -501, -501, -501, -501, -501, 922, 922,
1300 960, 922, -501, 83, 84, -501, -501, -84, -134, 88,
1301 604, -501, 76, 1131, -501, 1131, 1131, -501, -501, -501,
1302 -501, -501, -501, -501, -501, -501, -501, 1131, -501, 922,
1303 -501, 177, 34, -501, -501, -501, -501, -501, -501, -501,
1304 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1305 -501, -501, -501, 103, 81, 922, 922, 922, 922, 922,
1306 922, -501, -501, -501, -501, 922, 922, 922, 922, -501,
1307 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1308 -501, -501, 922, 922, 922, 922, 922, 34, -501, 20,
1309 -501, -501, -501, -501, -501, -501, -501, -501, -44, 91,
1310 91, 130, 143, 226, 145, 227, 161, 230, 163, 231,
1311 232, 233, 165, 234, 245, 1042, 91, 91, 922, 922,
1312 922, -501, 679, -501, 99, 113, -501, -501, -501, -501,
1313 -501, -501, -501, -501, 205, 103, 81, 119, 120, 125,
1314 128, 129, 960, 133, 134, 135, 139, 140, -501, -501,
1315 -501, -501, 124, -501, 149, -501, -501, 839, -501, -501,
1316 -501, -501, -501, -501, -501, -501, -501, -501, 922, -501,
1317 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1318 -501, -501, -501, -501, -501, 922, 150, 151, -501, 1131,
1319 136, 153, 154, 155, 156, 157, 158, 1131, 1131, 1131,
1320 159, 241, 839, 922, 922, 251, -501, -18, -501, -501,
1321 -501, -501, -501, -501, -501, -501, -501, -501, -501, -501,
1322 717, 960, 549, 265, -501, -501, -501, -501, -69, -50,
1323 -84, -501, 123, -501, 160, 142, 763, -501, -501, 283,
1324 164, 166, 960, 960, 960, 960, 960, -501, -110, 960,
1325 960, 960, 960, 960, 302, 304, 1131, 1131, 1131, 1,
1326 -501, 12, -501, 169, 1131, 167, 922, 922, 922, 922,
1327 922, 172, 173, 176, 922, 922, 1131, 1131, 178, -501,
1328 299, 314, -501, 91, -501, -40, -68, -501, -74, -501,
1329 -501, -501, -501, -501, 801, 301, -501, 184, 960, 960,
1330 169, 187, 188, 189, 190, 960, -501, 194, 195, 201,
1331 209, 316, 1131, 1131, 204, 212, 213, 1131, 341, 1131,
1332 922, -501, 214, 1131, 215, -501, -501, 216, 220, 1131,
1333 1131, 1131, -501, -501, 219, -501, 922, -501, -501, -501,
1334 -501, -501, -501, -501, -501, -501, 303, 332, 222, 228,
1335 229, 960, 960, 960, 960, -501, 960, 960, 960, 960,
1336 922, 238, 235, 922, 1131, 1131, 240, -501, 240, -501,
1337 243, 1131, 244, 922, 922, 922, -501, -501, -501, 922,
1338 1131, 345, -501, -501, 960, 960, -501, 246, 242, 247,
1339 248, 252, 254, 255, 256, 257, 354, 26, 243, 258,
1340 259, 260, 325, -501, -501, 922, 225, 1131, -501, -501,
1341 -501, 261, -501, -501, 262, 269, 960, -501, 960, 960,
1342 -501, -501, -501, -501, -501, 1131, -501, 1220, 56, 347,
1343 -501, -501, -501, -501, 250, -501, -501, -501, 270, 271,
1344 272, -501, 249, -501, 1220, 378, -501, -501, -501, -501,
1345 391, 276, 1131, 1131, 415, 138, -501, 1131, 416, -501,
1346 1131, -501
1347};
1348
1349/* YYPGOTO[NTERM-NUM]. */
1350static const short int yypgoto[] =
1351{
1352 -501, -501, -501, 328, 329, 330, 181, 185, 333, 336,
1353 -98, -97, -500, -501, 400, 420, -136, -501, -300, 31,
1354 -501, -216, -501, -45, -501, -38, -501, -81, 317, -501,
1355 126, 218, -208, 74, -501, -501, -501, -501, 398, -501,
1356 -501, -501, -501, 2, -501, 35, -501, -501, 423, -501,
1357 -501, -501, -501, -501, 451, -501, -471, -106, -62, -90,
1358 -501, 417, -501, -116, -501, -501, -501, -501, 22, -39,
1359 -501, -501, 43, -501, -501
1360};
1361
1362/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1363 positive, shift that token. If negative, reduce the rule which
1364 number is the opposite. If zero, do what YYDEFACT says.
1365 If YYTABLE_NINF, syntax error. */
1366#define YYTABLE_NINF -176
1367static const short int yytable[] =
1368{
1369 86, 127, 145, 146, 329, 25, 115, 382, 134, -175,
1370 40, 437, 135, 86, 94, 91, 277, 547, 240, 400,
1371 346, 347, 439, 136, 44, 45, 46, 270, 241, 270,
1372 270, 137, 138, 139, 140, 141, 142, 143, 144, 401,
1373 5, 270, 425, 6, 47, 25, 116, 117, 564, 127,
1374 426, 7, 8, 9, 10, 11, 12, 13, 438, 275,
1375 133, 137, 138, 139, 140, 141, 142, 143, 144, 438,
1376 -112, 322, 14, 272, 273, 19, 562, 20, 425, 131,
1377 219, 220, 4, 237, 425, 274, 129, 308, 462, 410,
1378 312, 30, 461, 571, 131, 313, 314, 315, 316, 31,
1379 32, 33, 34, 35, 36, 37, 289, 290, 325, 49,
1380 411, 133, 425, 131, 326, 320, 321, 27, 460, 28,
1381 98, 99, 100, 40, 101, 102, 103, 119, 50, 345,
1382 120, 121, 405, 406, 408, 212, 213, 306, 307, 133,
1383 309, 310, 133, 95, 92, 323, 324, 133, 133, 133,
1384 133, 19, 60, 20, 51, 330, 331, 348, 349, 350,
1385 -72, -72, -71, -71, 317, 318, 319, 133, 133, 7,
1386 8, 9, 52, 11, 53, 13, 58, 54, -70, -70,
1387 -69, -69, 332, 333, 546, 55, 523, 459, 524, 291,
1388 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
1389 302, 303, 304, 270, 352, 278, 279, 280, 281, 282,
1390 283, 270, 270, 270, 563, 101, 102, 62, 108, 109,
1391 110, 284, 285, 286, 287, 122, 111, 112, 123, 124,
1392 -113, 130, 376, 211, 398, 215, 216, 276, 217, 86,
1393 238, 239, 242, 327, -76, -75, 236, 383, -74, -73,
1394 377, 356, 335, -79, -80, 391, 392, 393, 137, 138,
1395 139, 140, 141, 142, 143, 144, 336, 378, 357, 358,
1396 270, 270, 270, 362, 363, 350, 374, 396, 270, 364,
1397 395, 399, 365, 366, 86, 397, 133, 369, 370, 371,
1398 270, 270, 384, 372, 373, 409, 444, 415, 446, 447,
1399 448, 375, 379, 381, 452, 385, 386, 387, 388, 389,
1400 390, 394, 414, 417, 434, 435, 436, 432, 418, 433,
1401 419, 440, 442, 443, 449, 450, 270, 270, 451, 457,
1402 456, 270, 458, 270, 454, 455, 467, 270, 400, 471,
1403 472, 473, 474, 270, 270, 270, 476, 477, 133, 445,
1404 133, 133, 133, 478, 412, 480, 133, 453, 483, 487,
1405 501, 479, 503, 533, 484, 485, 491, 493, 494, 545,
1406 481, 482, 495, 499, 504, 486, 352, 488, 270, 270,
1407 505, 492, 438, 553, 506, 270, 565, 496, 497, 498,
1408 516, 517, 522, 572, 270, 525, 527, 537, 536, 538,
1409 539, 570, 133, 528, 529, 530, 573, 540, 566, 541,
1410 542, 543, 544, 549, 550, 551, 555, 556, 500, 145,
1411 146, 270, 520, 521, 557, 567, 568, 569, 574, 526,
1412 577, 580, 202, 203, 204, 552, 360, 205, 532, 270,
1413 206, 361, 515, 104, 56, 133, 465, 244, 114, 464,
1414 145, 146, 59, 344, 26, 133, 133, 133, 97, 578,
1415 531, 133, 490, 470, 0, 554, 270, 270, 0, 0,
1416 0, 270, 0, 0, 270, 0, 0, 0, 0, 0,
1417 0, 0, 0, 561, 0, 0, 0, 133, 420, 421,
1418 422, 423, 424, 0, 0, 427, 428, 429, 430, 431,
1419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1420 575, 576, 0, 0, 0, 579, 0, 0, 581, 0,
1421 0, 125, 64, 65, 66, 67, 68, 69, 70, 71,
1422 72, 73, 74, 75, 76, 0, 0, 77, 78, 0,
1423 0, 0, 0, 0, 468, 469, 19, 0, 20, 0,
1424 0, 475, 125, 221, 222, 223, 224, 225, 226, 227,
1425 228, 229, 230, 231, 75, 76, 0, 0, 77, 78,
1426 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1428 0, 0, 0, 0, 0, 0, 0, 507, 508, 509,
1429 510, 0, 511, 512, 513, 514, 0, 125, 64, 65,
1430 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1431 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1432 534, 535, 19, 0, 20, 0, 0, 0, 0, 0,
1433 0, 0, 0, 0, 243, 0, 0, 0, 0, 0,
1434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1435 0, 0, 558, 0, 559, 560, 0, 0, 0, 0,
1436 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
1437 126, 0, 125, 64, 65, 66, 67, 68, 69, 70,
1438 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1439 0, 0, 79, 0, 0, 80, 0, 19, 81, 20,
1440 82, 407, 0, 0, 0, 0, 0, 0, 0, 351,
1441 125, 221, 222, 223, 224, 225, 226, 227, 228, 229,
1442 230, 231, 75, 76, 0, 0, 77, 78, 0, 0,
1443 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
1444 0, 0, 0, 0, 0, 0, 0, 79, 0, 0,
1445 80, 0, 0, 81, 0, 82, 125, 64, 65, 66,
1446 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1447 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1448 0, 19, 0, 20, 0, 0, 0, 0, 0, 0,
1449 0, 0, 0, 416, 125, 64, 65, 66, 67, 68,
1450 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1451 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1452 0, 20, 79, 0, 0, 80, 0, 0, 81, 0,
1453 82, 463, 63, 64, 65, 66, 67, 68, 69, 70,
1454 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1455 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1456 79, 0, 0, 80, 0, 404, 81, 0, 82, 132,
1457 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1458 74, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1459 0, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1460 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1461 0, 0, 81, 0, 82, 125, 64, 65, 66, 67,
1462 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
1463 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
1464 19, 0, 20, 0, 79, 0, 0, 80, 0, 0,
1465 81, 0, 82, 125, 221, 222, 223, 224, 225, 226,
1466 227, 228, 229, 230, 231, 75, 76, 0, 0, 77,
1467 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1468 20, 0, 79, 0, 0, 80, 0, 0, 81, 0,
1469 82, 0, -82, 19, 0, 20, 0, 0, 0, 6,
1470 -82, -82, 0, 0, 0, 0, 0, -82, -82, -82,
1471 -82, -82, -82, -82, 0, -82, 21, 0, 0, 79,
1472 0, 0, 80, -82, 22, 81, 0, 82, 23, 0,
1473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1475 0, 77, 78, 0, 337, 338, 339, 0, 0, 0,
1476 19, 0, 20, 0, 0, 79, 0, 0, 80, 0,
1477 0, 81, 0, 82, 0, 0, 0, 0, 0, 0,
1478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1480 0, 0, 0, 79, 0, 0, 80, 0, 0, 81,
1481 0, 82, 153, 154, 155, 156, 157, 158, 159, 160,
1482 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1483 171, 172, 255, 256, 0, 0, 0, 0, 246, 247,
1484 77, 78, 248, 249, 250, 251, 252, 253, 0, 19,
1485 0, 20, 0, 0, 0, 0, 0, 0, 0, 257,
1486 0, 258, 181, 182, 183, 184, 0, 259, 260, 261,
1487 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1488 199, 200, 201, 254, 0, 0, 0, 0, 340, 0,
1489 0, 341, 0, 342, 0, 0, 343, 0, 0, 0,
1490 0, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1491 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
1492 172, 255, 256, 0, 0, 0, 0, 246, 247, 0,
1493 0, 248, 249, 250, 251, 252, 253, 0, 0, 0,
1494 0, 0, 0, 0, 0, 0, 0, 0, 257, 0,
1495 258, 181, 182, 183, 184, 0, 259, 260, 261, 189,
1496 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
1497 200, 201, 254, 0, 0, 0, 0, 0, 0, 0,
1498 262, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1499 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
1500 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
1501 255, 256, 0, 0, 0, 0, 0, 0, 0, 0,
1502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1503 0, 0, 0, 0, 0, 0, 0, 257, 0, 258,
1504 181, 182, 183, 184, 0, 259, 260, 261, 189, 190,
1505 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
1506 201, 148, 0, 0, 0, 0, 0, 0, 0, 262,
1507 0, 0, 149, 0, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 150, 151, 0, 0, 0, 0, 0,
1509 0, 0, 0, 0, 0, 0, 0, 0, 0, 152,
1510 0, 0, 0, 153, 154, 155, 156, 157, 158, 159,
1511 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1512 170, 171, 172, 173, 174, 0, 0, 0, 0, 0,
1513 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1514 0, 0, 0, 0, 0, 175, 176, 177, 0, 0,
1515 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1516 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1517 198, 199, 200, 201
1518};
1519
1520static const short int yycheck[] =
1521{
1522 38, 82, 100, 100, 220, 3, 51, 307, 98, 0,
1523 29, 10, 4, 51, 33, 32, 152, 517, 152, 37,
1524 236, 237, 10, 15, 52, 53, 54, 133, 162, 135,
1525 136, 5, 6, 7, 8, 9, 10, 11, 12, 57,
1526 31, 147, 152, 34, 72, 43, 35, 36, 548, 130,
1527 160, 42, 43, 44, 45, 46, 47, 48, 57, 149,
1528 98, 5, 6, 7, 8, 9, 10, 11, 12, 57,
1529 154, 207, 63, 135, 136, 28, 547, 30, 152, 163,
1530 118, 119, 0, 121, 152, 147, 84, 177, 162, 158,
1531 180, 62, 160, 564, 163, 185, 186, 187, 188, 65,
1532 66, 67, 68, 69, 70, 71, 25, 26, 152, 151,
1533 160, 149, 152, 163, 158, 205, 206, 45, 158, 47,
1534 73, 74, 75, 29, 77, 78, 79, 53, 62, 235,
1535 56, 57, 340, 341, 342, 55, 56, 175, 176, 177,
1536 178, 179, 180, 162, 161, 125, 126, 185, 186, 187,
1537 188, 28, 30, 30, 27, 25, 26, 238, 239, 240,
1538 17, 18, 17, 18, 202, 203, 204, 205, 206, 42,
1539 43, 44, 45, 46, 47, 48, 151, 50, 17, 18,
1540 17, 18, 17, 18, 158, 58, 486, 403, 488, 108,
1541 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1542 119, 120, 121, 309, 242, 102, 103, 104, 105, 106,
1543 107, 317, 318, 319, 158, 77, 78, 18, 151, 151,
1544 151, 118, 119, 120, 121, 18, 151, 156, 18, 18,
1545 154, 154, 277, 30, 324, 18, 30, 60, 30, 277,
1546 157, 157, 154, 152, 18, 18, 120, 309, 18, 18,
1547 288, 152, 18, 21, 21, 317, 318, 319, 5, 6,
1548 7, 8, 9, 10, 11, 12, 21, 305, 155, 64,
1549 376, 377, 378, 154, 154, 356, 152, 322, 384, 154,
1550 39, 30, 154, 154, 322, 323, 324, 154, 154, 154,
1551 396, 397, 156, 154, 154, 30, 386, 155, 388, 389,
1552 390, 152, 152, 152, 394, 152, 152, 152, 152, 152,
1553 152, 152, 152, 30, 376, 377, 378, 15, 154, 15,
1554 154, 152, 384, 156, 152, 152, 432, 433, 152, 30,
1555 152, 437, 18, 439, 396, 397, 152, 443, 37, 152,
1556 152, 152, 152, 449, 450, 451, 152, 152, 386, 387,
1557 388, 389, 390, 152, 352, 39, 394, 395, 154, 18,
1558 57, 152, 30, 18, 152, 152, 152, 152, 152, 15,
1559 432, 433, 152, 154, 152, 437, 414, 439, 484, 485,
1560 152, 443, 57, 158, 155, 491, 39, 449, 450, 451,
1561 152, 156, 152, 15, 500, 152, 152, 155, 152, 152,
1562 152, 152, 440, 493, 494, 495, 15, 155, 158, 155,
1563 155, 155, 155, 155, 155, 155, 155, 155, 456, 517,
1564 517, 527, 484, 485, 155, 155, 155, 155, 152, 491,
1565 15, 15, 104, 104, 104, 525, 255, 104, 500, 545,
1566 104, 256, 480, 43, 24, 483, 415, 130, 50, 414,
1567 548, 548, 29, 235, 3, 493, 494, 495, 41, 575,
1568 499, 499, 440, 420, -1, 527, 572, 573, -1, -1,
1569 -1, 577, -1, -1, 580, -1, -1, -1, -1, -1,
1570 -1, -1, -1, 545, -1, -1, -1, 525, 362, 363,
1571 364, 365, 366, -1, -1, 369, 370, 371, 372, 373,
1572 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1573 572, 573, -1, -1, -1, 577, -1, -1, 580, -1,
1574 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1575 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1576 -1, -1, -1, -1, 418, 419, 28, -1, 30, -1,
1577 -1, 425, 3, 4, 5, 6, 7, 8, 9, 10,
1578 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1579 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1580 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1581 -1, -1, -1, -1, -1, -1, -1, 471, 472, 473,
1582 474, -1, 476, 477, 478, 479, -1, 3, 4, 5,
1583 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1584 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1585 504, 505, 28, -1, 30, -1, -1, -1, -1, -1,
1586 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
1587 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1588 -1, -1, 536, -1, 538, 539, -1, -1, -1, -1,
1589 -1, 153, -1, -1, 156, -1, -1, 159, -1, 161,
1590 162, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1591 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1592 -1, -1, 153, -1, -1, 156, -1, 28, 159, 30,
1593 161, 162, -1, -1, -1, -1, -1, -1, -1, 40,
1594 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1595 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
1596 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
1597 -1, -1, -1, -1, -1, -1, -1, 153, -1, -1,
1598 156, -1, -1, 159, -1, 161, 3, 4, 5, 6,
1599 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1600 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1601 -1, 28, -1, 30, -1, -1, -1, -1, -1, -1,
1602 -1, -1, -1, 40, 3, 4, 5, 6, 7, 8,
1603 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1604 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
1605 -1, 30, 153, -1, -1, 156, -1, -1, 159, -1,
1606 161, 40, 3, 4, 5, 6, 7, 8, 9, 10,
1607 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
1608 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1609 153, -1, -1, 156, -1, 158, 159, -1, 161, 3,
1610 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1611 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1612 -1, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1613 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1614 -1, -1, 159, -1, 161, 3, 4, 5, 6, 7,
1615 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1616 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1617 28, -1, 30, -1, 153, -1, -1, 156, -1, -1,
1618 159, -1, 161, 3, 4, 5, 6, 7, 8, 9,
1619 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1620 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
1621 30, -1, 153, -1, -1, 156, -1, -1, 159, -1,
1622 161, -1, 27, 28, -1, 30, -1, -1, -1, 34,
1623 35, 36, -1, -1, -1, -1, -1, 42, 43, 44,
1624 45, 46, 47, 48, -1, 50, 51, -1, -1, 153,
1625 -1, -1, 156, 58, 59, 159, -1, 161, 63, -1,
1626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1628 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
1629 28, -1, 30, -1, -1, 153, -1, -1, 156, -1,
1630 -1, 159, -1, 161, -1, -1, -1, -1, -1, -1,
1631 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1632 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1633 -1, -1, -1, 153, -1, -1, 156, -1, -1, 159,
1634 -1, 161, 80, 81, 82, 83, 84, 85, 86, 87,
1635 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
1636 98, 99, 100, 101, -1, -1, -1, -1, 17, 18,
1637 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
1638 -1, 30, -1, -1, -1, -1, -1, -1, -1, 127,
1639 -1, 129, 130, 131, 132, 133, -1, 135, 136, 137,
1640 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1641 148, 149, 150, 62, -1, -1, -1, -1, 156, -1,
1642 -1, 159, -1, 161, -1, -1, 164, -1, -1, -1,
1643 -1, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1644 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1645 99, 100, 101, -1, -1, -1, -1, 17, 18, -1,
1646 -1, 21, 22, 23, 24, 25, 26, -1, -1, -1,
1647 -1, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1648 129, 130, 131, 132, 133, -1, 135, 136, 137, 138,
1649 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1650 149, 150, 62, -1, -1, -1, -1, -1, -1, -1,
1651 159, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1652 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1653 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
1654 100, 101, -1, -1, -1, -1, -1, -1, -1, -1,
1655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1656 -1, -1, -1, -1, -1, -1, -1, 127, -1, 129,
1657 130, 131, 132, 133, -1, 135, 136, 137, 138, 139,
1658 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
1659 150, 38, -1, -1, -1, -1, -1, -1, -1, 159,
1660 -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
1661 -1, -1, -1, 60, 61, -1, -1, -1, -1, -1,
1662 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
1663 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
1664 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1665 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
1666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1667 -1, -1, -1, -1, -1, 122, 123, 124, -1, -1,
1668 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
1669 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
1670 147, 148, 149, 150
1671};
1672
1673/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1674 symbol of state STATE-NUM. */
1675static const unsigned char yystos[] =
1676{
1677 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
1678 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
1679 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
1680 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
1681 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
1682 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
1683 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
1684 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
1685 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
1686 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
1687 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
1688 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
1689 198, 198, 18, 18, 18, 3, 162, 192, 193, 208,
1690 154, 163, 3, 190, 224, 4, 15, 5, 6, 7,
1691 8, 9, 10, 11, 12, 175, 176, 177, 38, 49,
1692 60, 61, 76, 80, 81, 82, 83, 84, 85, 86,
1693 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1694 97, 98, 99, 100, 101, 122, 123, 124, 127, 128,
1695 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
1696 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1697 149, 150, 168, 169, 170, 173, 174, 235, 236, 238,
1698 239, 30, 55, 56, 204, 18, 30, 30, 207, 190,
1699 190, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1700 13, 14, 175, 176, 178, 190, 195, 190, 157, 157,
1701 152, 162, 154, 40, 193, 194, 17, 18, 21, 22,
1702 23, 24, 25, 26, 62, 100, 101, 127, 129, 135,
1703 136, 137, 159, 168, 169, 170, 173, 174, 196, 221,
1704 222, 223, 223, 223, 223, 224, 60, 181, 102, 103,
1705 104, 105, 106, 107, 118, 119, 120, 121, 171, 25,
1706 26, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1707 117, 118, 119, 120, 121, 172, 190, 190, 224, 190,
1708 190, 232, 224, 224, 224, 224, 224, 190, 190, 190,
1709 224, 224, 181, 125, 126, 152, 158, 152, 186, 186,
1710 25, 26, 17, 18, 167, 18, 21, 22, 23, 24,
1711 156, 159, 161, 164, 196, 222, 186, 186, 192, 192,
1712 192, 40, 190, 210, 211, 212, 152, 155, 64, 220,
1713 171, 172, 154, 154, 154, 154, 154, 195, 197, 154,
1714 154, 154, 154, 154, 152, 152, 188, 190, 190, 152,
1715 183, 152, 183, 223, 156, 152, 152, 152, 152, 152,
1716 152, 223, 223, 223, 152, 39, 188, 190, 224, 30,
1717 37, 57, 184, 187, 158, 197, 197, 162, 197, 30,
1718 158, 160, 208, 209, 152, 155, 40, 30, 154, 154,
1719 195, 195, 195, 195, 195, 152, 160, 195, 195, 195,
1720 195, 195, 15, 15, 223, 223, 223, 10, 57, 10,
1721 152, 237, 223, 156, 224, 190, 224, 224, 224, 152,
1722 152, 152, 224, 190, 223, 223, 152, 30, 18, 186,
1723 158, 160, 162, 40, 210, 184, 185, 152, 195, 195,
1724 237, 152, 152, 152, 152, 195, 152, 152, 152, 152,
1725 39, 223, 223, 154, 152, 152, 223, 18, 223, 224,
1726 233, 152, 223, 152, 152, 152, 223, 223, 223, 154,
1727 190, 57, 182, 30, 152, 152, 155, 195, 195, 195,
1728 195, 195, 195, 195, 195, 190, 152, 156, 233, 234,
1729 223, 223, 152, 183, 183, 152, 223, 152, 224, 224,
1730 224, 234, 223, 18, 195, 195, 152, 155, 152, 152,
1731 155, 155, 155, 155, 155, 15, 158, 177, 230, 155,
1732 155, 155, 224, 158, 223, 155, 155, 155, 195, 195,
1733 195, 223, 221, 158, 177, 39, 158, 155, 155, 155,
1734 152, 221, 15, 15, 152, 223, 223, 15, 228, 223,
1735 15, 223
1736};
Reid Spencere7c3c602006-11-30 06:36:44 +00001737
1738#define yyerrok (yyerrstatus = 0)
1739#define yyclearin (yychar = YYEMPTY)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001740#define YYEMPTY (-2)
Reid Spencere7c3c602006-11-30 06:36:44 +00001741#define YYEOF 0
Jim Laskey2792cfb2006-12-06 11:03:10 +00001742
Reid Spencere7c3c602006-11-30 06:36:44 +00001743#define YYACCEPT goto yyacceptlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001744#define YYABORT goto yyabortlab
1745#define YYERROR goto yyerrorlab
1746
1747
1748/* Like YYERROR except do call yyerror. This remains here temporarily
1749 to ease the transition to the new meaning of YYERROR, for GCC.
Reid Spencere7c3c602006-11-30 06:36:44 +00001750 Once GCC version 2 has supplanted version 1, this can go. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00001751
Reid Spencere7c3c602006-11-30 06:36:44 +00001752#define YYFAIL goto yyerrlab
Jim Laskey2792cfb2006-12-06 11:03:10 +00001753
Reid Spencere7c3c602006-11-30 06:36:44 +00001754#define YYRECOVERING() (!!yyerrstatus)
Jim Laskey2792cfb2006-12-06 11:03:10 +00001755
1756#define YYBACKUP(Token, Value) \
Reid Spencere7c3c602006-11-30 06:36:44 +00001757do \
1758 if (yychar == YYEMPTY && yylen == 1) \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001759 { \
1760 yychar = (Token); \
1761 yylval = (Value); \
1762 yytoken = YYTRANSLATE (yychar); \
Reid Spencere7c3c602006-11-30 06:36:44 +00001763 YYPOPSTACK; \
1764 goto yybackup; \
1765 } \
1766 else \
Jim Laskey2792cfb2006-12-06 11:03:10 +00001767 { \
1768 yyerror (YY_("syntax error: cannot back up")); \
1769 YYERROR; \
1770 } \
Reid Spencere7c3c602006-11-30 06:36:44 +00001771while (0)
1772
Jim Laskey2792cfb2006-12-06 11:03:10 +00001773
Reid Spencere7c3c602006-11-30 06:36:44 +00001774#define YYTERROR 1
1775#define YYERRCODE 256
1776
Jim Laskey2792cfb2006-12-06 11:03:10 +00001777
1778/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1779 If N is 0, then set CURRENT to the empty location which ends
1780 the previous symbol: RHS[0] (always defined). */
1781
1782#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1783#ifndef YYLLOC_DEFAULT
1784# define YYLLOC_DEFAULT(Current, Rhs, N) \
1785 do \
1786 if (N) \
1787 { \
1788 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1789 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1790 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1791 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1792 } \
1793 else \
1794 { \
1795 (Current).first_line = (Current).last_line = \
1796 YYRHSLOC (Rhs, 0).last_line; \
1797 (Current).first_column = (Current).last_column = \
1798 YYRHSLOC (Rhs, 0).last_column; \
1799 } \
1800 while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001801#endif
1802
Jim Laskey2792cfb2006-12-06 11:03:10 +00001803
1804/* YY_LOCATION_PRINT -- Print the location on the stream.
1805 This macro was not mandated originally: define only if we know
1806 we won't break user code: when these are the locations we know. */
1807
1808#ifndef YY_LOCATION_PRINT
1809# if YYLTYPE_IS_TRIVIAL
1810# define YY_LOCATION_PRINT(File, Loc) \
1811 fprintf (File, "%d.%d-%d.%d", \
1812 (Loc).first_line, (Loc).first_column, \
1813 (Loc).last_line, (Loc).last_column)
1814# else
1815# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1816# endif
1817#endif
1818
1819
1820/* YYLEX -- calling `yylex' with the right arguments. */
1821
Reid Spencere7c3c602006-11-30 06:36:44 +00001822#ifdef YYLEX_PARAM
Jim Laskey2792cfb2006-12-06 11:03:10 +00001823# define YYLEX yylex (YYLEX_PARAM)
Reid Spencere7c3c602006-11-30 06:36:44 +00001824#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001825# define YYLEX yylex ()
Jim Laskey98ba5882006-12-06 10:57:33 +00001826#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001827
1828/* Enable debugging if requested. */
1829#if YYDEBUG
1830
1831# ifndef YYFPRINTF
1832# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1833# define YYFPRINTF fprintf
1834# endif
1835
1836# define YYDPRINTF(Args) \
1837do { \
1838 if (yydebug) \
1839 YYFPRINTF Args; \
1840} while (0)
1841
1842# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1843do { \
1844 if (yydebug) \
1845 { \
1846 YYFPRINTF (stderr, "%s ", Title); \
1847 yysymprint (stderr, \
1848 Type, Value); \
1849 YYFPRINTF (stderr, "\n"); \
1850 } \
1851} while (0)
1852
1853/*------------------------------------------------------------------.
1854| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1855| TOP (included). |
1856`------------------------------------------------------------------*/
1857
1858#if defined (__STDC__) || defined (__cplusplus)
1859static void
1860yy_stack_print (short int *bottom, short int *top)
Jim Laskey98ba5882006-12-06 10:57:33 +00001861#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00001862static void
1863yy_stack_print (bottom, top)
1864 short int *bottom;
1865 short int *top;
Jim Laskey98ba5882006-12-06 10:57:33 +00001866#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001867{
1868 YYFPRINTF (stderr, "Stack now");
1869 for (/* Nothing. */; bottom <= top; ++bottom)
1870 YYFPRINTF (stderr, " %d", *bottom);
1871 YYFPRINTF (stderr, "\n");
1872}
1873
1874# define YY_STACK_PRINT(Bottom, Top) \
1875do { \
1876 if (yydebug) \
1877 yy_stack_print ((Bottom), (Top)); \
1878} while (0)
1879
1880
1881/*------------------------------------------------.
1882| Report that the YYRULE is going to be reduced. |
1883`------------------------------------------------*/
1884
1885#if defined (__STDC__) || defined (__cplusplus)
1886static void
1887yy_reduce_print (int yyrule)
1888#else
1889static void
1890yy_reduce_print (yyrule)
1891 int yyrule;
Reid Spencere7c3c602006-11-30 06:36:44 +00001892#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001893{
1894 int yyi;
1895 unsigned long int yylno = yyrline[yyrule];
1896 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1897 yyrule - 1, yylno);
1898 /* Print the symbols being reduced, and their result. */
1899 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1900 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1901 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1902}
Reid Spencere7c3c602006-11-30 06:36:44 +00001903
Jim Laskey2792cfb2006-12-06 11:03:10 +00001904# define YY_REDUCE_PRINT(Rule) \
1905do { \
1906 if (yydebug) \
1907 yy_reduce_print (Rule); \
1908} while (0)
Reid Spencere7c3c602006-11-30 06:36:44 +00001909
Jim Laskey2792cfb2006-12-06 11:03:10 +00001910/* Nonzero means print parse trace. It is left uninitialized so that
1911 multiple parsers can coexist. */
1912int yydebug;
1913#else /* !YYDEBUG */
1914# define YYDPRINTF(Args)
1915# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1916# define YY_STACK_PRINT(Bottom, Top)
1917# define YY_REDUCE_PRINT(Rule)
1918#endif /* !YYDEBUG */
Reid Spencere7c3c602006-11-30 06:36:44 +00001919
Reid Spencere7c3c602006-11-30 06:36:44 +00001920
Jim Laskey2792cfb2006-12-06 11:03:10 +00001921/* YYINITDEPTH -- initial size of the parser's stacks. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001922#ifndef YYINITDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001923# define YYINITDEPTH 200
Reid Spencere7c3c602006-11-30 06:36:44 +00001924#endif
1925
Jim Laskey2792cfb2006-12-06 11:03:10 +00001926/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1927 if the built-in stack extension method is used).
Reid Spencere7c3c602006-11-30 06:36:44 +00001928
Jim Laskey2792cfb2006-12-06 11:03:10 +00001929 Do not make this value too large; the results are undefined if
1930 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1931 evaluated with infinite-precision integer arithmetic. */
Reid Spencere7c3c602006-11-30 06:36:44 +00001932
1933#ifndef YYMAXDEPTH
Jim Laskey2792cfb2006-12-06 11:03:10 +00001934# define YYMAXDEPTH 10000
Reid Spencere7c3c602006-11-30 06:36:44 +00001935#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00001936
Reid Spencere7c3c602006-11-30 06:36:44 +00001937
1938
Jim Laskey2792cfb2006-12-06 11:03:10 +00001939#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00001940
Jim Laskey2792cfb2006-12-06 11:03:10 +00001941# ifndef yystrlen
1942# if defined (__GLIBC__) && defined (_STRING_H)
1943# define yystrlen strlen
1944# else
1945/* Return the length of YYSTR. */
1946static YYSIZE_T
1947# if defined (__STDC__) || defined (__cplusplus)
1948yystrlen (const char *yystr)
1949# else
1950yystrlen (yystr)
1951 const char *yystr;
1952# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001953{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001954 const char *yys = yystr;
Jim Laskey98ba5882006-12-06 10:57:33 +00001955
Jim Laskey2792cfb2006-12-06 11:03:10 +00001956 while (*yys++ != '\0')
1957 continue;
1958
1959 return yys - yystr - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00001960}
Jim Laskey2792cfb2006-12-06 11:03:10 +00001961# endif
1962# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001963
Jim Laskey2792cfb2006-12-06 11:03:10 +00001964# ifndef yystpcpy
1965# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1966# define yystpcpy stpcpy
1967# else
1968/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1969 YYDEST. */
1970static char *
1971# if defined (__STDC__) || defined (__cplusplus)
1972yystpcpy (char *yydest, const char *yysrc)
1973# else
1974yystpcpy (yydest, yysrc)
1975 char *yydest;
1976 const char *yysrc;
1977# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001978{
Jim Laskey2792cfb2006-12-06 11:03:10 +00001979 char *yyd = yydest;
1980 const char *yys = yysrc;
Jim Laskey98ba5882006-12-06 10:57:33 +00001981
Jim Laskey2792cfb2006-12-06 11:03:10 +00001982 while ((*yyd++ = *yys++) != '\0')
1983 continue;
1984
1985 return yyd - 1;
Jim Laskey98ba5882006-12-06 10:57:33 +00001986}
Jim Laskey2792cfb2006-12-06 11:03:10 +00001987# endif
1988# endif
Jim Laskey98ba5882006-12-06 10:57:33 +00001989
Jim Laskey2792cfb2006-12-06 11:03:10 +00001990# ifndef yytnamerr
1991/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1992 quotes and backslashes, so that it's suitable for yyerror. The
1993 heuristic is that double-quoting is unnecessary unless the string
1994 contains an apostrophe, a comma, or backslash (other than
1995 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1996 null, do not copy; instead, return the length of what the result
1997 would have been. */
1998static YYSIZE_T
1999yytnamerr (char *yyres, const char *yystr)
2000{
2001 if (*yystr == '"')
2002 {
2003 size_t yyn = 0;
2004 char const *yyp = yystr;
2005
2006 for (;;)
2007 switch (*++yyp)
2008 {
2009 case '\'':
2010 case ',':
2011 goto do_not_strip_quotes;
2012
2013 case '\\':
2014 if (*++yyp != '\\')
2015 goto do_not_strip_quotes;
2016 /* Fall through. */
2017 default:
2018 if (yyres)
2019 yyres[yyn] = *yyp;
2020 yyn++;
2021 break;
2022
2023 case '"':
2024 if (yyres)
2025 yyres[yyn] = '\0';
2026 return yyn;
2027 }
2028 do_not_strip_quotes: ;
2029 }
2030
2031 if (! yyres)
2032 return yystrlen (yystr);
2033
2034 return yystpcpy (yyres, yystr) - yyres;
2035}
2036# endif
2037
2038#endif /* YYERROR_VERBOSE */
2039
Reid Spencere7c3c602006-11-30 06:36:44 +00002040
2041
Jim Laskey2792cfb2006-12-06 11:03:10 +00002042#if YYDEBUG
2043/*--------------------------------.
2044| Print this symbol on YYOUTPUT. |
2045`--------------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002046
Jim Laskey2792cfb2006-12-06 11:03:10 +00002047#if defined (__STDC__) || defined (__cplusplus)
2048static void
2049yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
Jim Laskey98ba5882006-12-06 10:57:33 +00002050#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002051static void
2052yysymprint (yyoutput, yytype, yyvaluep)
2053 FILE *yyoutput;
2054 int yytype;
2055 YYSTYPE *yyvaluep;
2056#endif
2057{
2058 /* Pacify ``unused variable'' warnings. */
2059 (void) yyvaluep;
2060
2061 if (yytype < YYNTOKENS)
2062 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2063 else
2064 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2065
2066
2067# ifdef YYPRINT
2068 if (yytype < YYNTOKENS)
2069 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2070# endif
2071 switch (yytype)
2072 {
2073 default:
2074 break;
2075 }
2076 YYFPRINTF (yyoutput, ")");
2077}
2078
2079#endif /* ! YYDEBUG */
2080/*-----------------------------------------------.
2081| Release the memory associated to this symbol. |
2082`-----------------------------------------------*/
2083
2084#if defined (__STDC__) || defined (__cplusplus)
2085static void
2086yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2087#else
2088static void
2089yydestruct (yymsg, yytype, yyvaluep)
2090 const char *yymsg;
2091 int yytype;
2092 YYSTYPE *yyvaluep;
2093#endif
2094{
2095 /* Pacify ``unused variable'' warnings. */
2096 (void) yyvaluep;
2097
2098 if (!yymsg)
2099 yymsg = "Deleting";
2100 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2101
2102 switch (yytype)
2103 {
2104
2105 default:
2106 break;
2107 }
2108}
2109
2110
2111/* Prevent warnings from -Wmissing-prototypes. */
2112
2113#ifdef YYPARSE_PARAM
2114# if defined (__STDC__) || defined (__cplusplus)
2115int yyparse (void *YYPARSE_PARAM);
2116# else
2117int yyparse ();
2118# endif
2119#else /* ! YYPARSE_PARAM */
2120#if defined (__STDC__) || defined (__cplusplus)
Reid Spencere7c3c602006-11-30 06:36:44 +00002121int yyparse (void);
Jim Laskey98ba5882006-12-06 10:57:33 +00002122#else
Jim Laskey2792cfb2006-12-06 11:03:10 +00002123int yyparse ();
2124#endif
2125#endif /* ! YYPARSE_PARAM */
2126
2127
2128
2129/* The look-ahead symbol. */
2130int yychar;
2131
2132/* The semantic value of the look-ahead symbol. */
2133YYSTYPE yylval;
2134
2135/* Number of syntax errors so far. */
2136int yynerrs;
2137
2138
2139
2140/*----------.
2141| yyparse. |
2142`----------*/
2143
2144#ifdef YYPARSE_PARAM
2145# if defined (__STDC__) || defined (__cplusplus)
2146int yyparse (void *YYPARSE_PARAM)
2147# else
2148int yyparse (YYPARSE_PARAM)
2149 void *YYPARSE_PARAM;
2150# endif
2151#else /* ! YYPARSE_PARAM */
2152#if defined (__STDC__) || defined (__cplusplus)
2153int
2154yyparse (void)
2155#else
2156int
2157yyparse ()
2158
2159#endif
2160#endif
2161{
2162
2163 int yystate;
2164 int yyn;
2165 int yyresult;
2166 /* Number of tokens to shift before error messages enabled. */
2167 int yyerrstatus;
2168 /* Look-ahead token as an internal (translated) token number. */
2169 int yytoken = 0;
2170
2171 /* Three stacks and their tools:
2172 `yyss': related to states,
2173 `yyvs': related to semantic values,
2174 `yyls': related to locations.
2175
2176 Refer to the stacks thru separate pointers, to allow yyoverflow
2177 to reallocate them elsewhere. */
2178
2179 /* The state stack. */
2180 short int yyssa[YYINITDEPTH];
2181 short int *yyss = yyssa;
2182 short int *yyssp;
2183
2184 /* The semantic value stack. */
2185 YYSTYPE yyvsa[YYINITDEPTH];
2186 YYSTYPE *yyvs = yyvsa;
2187 YYSTYPE *yyvsp;
2188
2189
2190
Reid Spencere7c3c602006-11-30 06:36:44 +00002191#define YYPOPSTACK (yyvsp--, yyssp--)
2192
Jim Laskey2792cfb2006-12-06 11:03:10 +00002193 YYSIZE_T yystacksize = YYINITDEPTH;
Reid Spencere7c3c602006-11-30 06:36:44 +00002194
Jim Laskey2792cfb2006-12-06 11:03:10 +00002195 /* The variables used to return semantic value and location from the
2196 action routines. */
2197 YYSTYPE yyval;
Reid Spencere7c3c602006-11-30 06:36:44 +00002198
2199
Jim Laskey2792cfb2006-12-06 11:03:10 +00002200 /* When reducing, the number of symbols on the RHS of the reduced
2201 rule. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002202 int yylen;
2203
Jim Laskey2792cfb2006-12-06 11:03:10 +00002204 YYDPRINTF ((stderr, "Starting parse\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002205
2206 yystate = 0;
2207 yyerrstatus = 0;
2208 yynerrs = 0;
2209 yychar = YYEMPTY; /* Cause a token to be read. */
2210
2211 /* Initialize stack pointers.
2212 Waste one element of value and location stack
2213 so that they stay on the same level as the state stack.
2214 The wasted elements are never initialized. */
2215
Jim Laskey2792cfb2006-12-06 11:03:10 +00002216 yyssp = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002217 yyvsp = yyvs;
2218
Jim Laskey2792cfb2006-12-06 11:03:10 +00002219 goto yysetstate;
Reid Spencere7c3c602006-11-30 06:36:44 +00002220
Jim Laskey2792cfb2006-12-06 11:03:10 +00002221/*------------------------------------------------------------.
2222| yynewstate -- Push a new state, which is found in yystate. |
2223`------------------------------------------------------------*/
2224 yynewstate:
2225 /* In all cases, when you get here, the value and location stacks
2226 have just been pushed. so pushing a state here evens the stacks.
2227 */
2228 yyssp++;
Reid Spencere7c3c602006-11-30 06:36:44 +00002229
Jim Laskey2792cfb2006-12-06 11:03:10 +00002230 yysetstate:
2231 *yyssp = yystate;
2232
2233 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002234 {
2235 /* Get the current used size of the three stacks, in elements. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002236 YYSIZE_T yysize = yyssp - yyss + 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002237
2238#ifdef yyoverflow
Jim Laskey2792cfb2006-12-06 11:03:10 +00002239 {
2240 /* Give user a chance to reallocate the stack. Use copies of
2241 these so that the &'s don't force the real ones into
2242 memory. */
2243 YYSTYPE *yyvs1 = yyvs;
2244 short int *yyss1 = yyss;
Reid Spencere7c3c602006-11-30 06:36:44 +00002245
Jim Laskey2792cfb2006-12-06 11:03:10 +00002246
2247 /* Each stack pointer address is followed by the size of the
2248 data in use in that stack, in bytes. This used to be a
2249 conditional around just the two extra args, but that might
2250 be undefined if yyoverflow is a macro. */
2251 yyoverflow (YY_("memory exhausted"),
2252 &yyss1, yysize * sizeof (*yyssp),
2253 &yyvs1, yysize * sizeof (*yyvsp),
2254
2255 &yystacksize);
2256
2257 yyss = yyss1;
2258 yyvs = yyvs1;
2259 }
Reid Spencere7c3c602006-11-30 06:36:44 +00002260#else /* no yyoverflow */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002261# ifndef YYSTACK_RELOCATE
2262 goto yyexhaustedlab;
2263# else
Reid Spencere7c3c602006-11-30 06:36:44 +00002264 /* Extend the stack our own way. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002265 if (YYMAXDEPTH <= yystacksize)
2266 goto yyexhaustedlab;
Reid Spencere7c3c602006-11-30 06:36:44 +00002267 yystacksize *= 2;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002268 if (YYMAXDEPTH < yystacksize)
Reid Spencere7c3c602006-11-30 06:36:44 +00002269 yystacksize = YYMAXDEPTH;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002270
2271 {
2272 short int *yyss1 = yyss;
2273 union yyalloc *yyptr =
2274 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2275 if (! yyptr)
2276 goto yyexhaustedlab;
2277 YYSTACK_RELOCATE (yyss);
2278 YYSTACK_RELOCATE (yyvs);
2279
2280# undef YYSTACK_RELOCATE
2281 if (yyss1 != yyssa)
2282 YYSTACK_FREE (yyss1);
2283 }
2284# endif
Reid Spencere7c3c602006-11-30 06:36:44 +00002285#endif /* no yyoverflow */
2286
Jim Laskey2792cfb2006-12-06 11:03:10 +00002287 yyssp = yyss + yysize - 1;
2288 yyvsp = yyvs + yysize - 1;
Reid Spencere7c3c602006-11-30 06:36:44 +00002289
2290
Jim Laskey2792cfb2006-12-06 11:03:10 +00002291 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2292 (unsigned long int) yystacksize));
2293
2294 if (yyss + yystacksize - 1 <= yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00002295 YYABORT;
2296 }
2297
Jim Laskey2792cfb2006-12-06 11:03:10 +00002298 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Reid Spencere7c3c602006-11-30 06:36:44 +00002299
2300 goto yybackup;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002301
2302/*-----------.
2303| yybackup. |
2304`-----------*/
2305yybackup:
Reid Spencere7c3c602006-11-30 06:36:44 +00002306
2307/* Do appropriate processing given the current state. */
Jim Laskey2792cfb2006-12-06 11:03:10 +00002308/* Read a look-ahead token if we need one and don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002309/* yyresume: */
2310
Jim Laskey2792cfb2006-12-06 11:03:10 +00002311 /* First try to decide what to do without reference to look-ahead token. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002312
2313 yyn = yypact[yystate];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002314 if (yyn == YYPACT_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002315 goto yydefault;
2316
Jim Laskey2792cfb2006-12-06 11:03:10 +00002317 /* Not known => get a look-ahead token if don't already have one. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002318
Jim Laskey2792cfb2006-12-06 11:03:10 +00002319 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002320 if (yychar == YYEMPTY)
2321 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002322 YYDPRINTF ((stderr, "Reading a token: "));
Reid Spencere7c3c602006-11-30 06:36:44 +00002323 yychar = YYLEX;
2324 }
2325
Jim Laskey2792cfb2006-12-06 11:03:10 +00002326 if (yychar <= YYEOF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002327 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002328 yychar = yytoken = YYEOF;
2329 YYDPRINTF ((stderr, "Now at end of input.\n"));
Reid Spencere7c3c602006-11-30 06:36:44 +00002330 }
2331 else
2332 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002333 yytoken = YYTRANSLATE (yychar);
2334 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002335 }
2336
Jim Laskey2792cfb2006-12-06 11:03:10 +00002337 /* If the proper action on seeing token YYTOKEN is to reduce or to
2338 detect an error, take that action. */
2339 yyn += yytoken;
2340 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Reid Spencere7c3c602006-11-30 06:36:44 +00002341 goto yydefault;
2342 yyn = yytable[yyn];
Jim Laskey2792cfb2006-12-06 11:03:10 +00002343 if (yyn <= 0)
Reid Spencere7c3c602006-11-30 06:36:44 +00002344 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002345 if (yyn == 0 || yyn == YYTABLE_NINF)
Reid Spencere7c3c602006-11-30 06:36:44 +00002346 goto yyerrlab;
2347 yyn = -yyn;
2348 goto yyreduce;
2349 }
2350
2351 if (yyn == YYFINAL)
2352 YYACCEPT;
2353
Jim Laskey2792cfb2006-12-06 11:03:10 +00002354 /* Shift the look-ahead token. */
2355 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Reid Spencere7c3c602006-11-30 06:36:44 +00002356
2357 /* Discard the token being shifted unless it is eof. */
2358 if (yychar != YYEOF)
2359 yychar = YYEMPTY;
2360
2361 *++yyvsp = yylval;
2362
Jim Laskey2792cfb2006-12-06 11:03:10 +00002363
2364 /* Count tokens shifted since error; after three, turn off error
2365 status. */
2366 if (yyerrstatus)
2367 yyerrstatus--;
Reid Spencere7c3c602006-11-30 06:36:44 +00002368
2369 yystate = yyn;
2370 goto yynewstate;
2371
Jim Laskey98ba5882006-12-06 10:57:33 +00002372
Jim Laskey2792cfb2006-12-06 11:03:10 +00002373/*-----------------------------------------------------------.
2374| yydefault -- do the default action for the current state. |
2375`-----------------------------------------------------------*/
2376yydefault:
Reid Spencere7c3c602006-11-30 06:36:44 +00002377 yyn = yydefact[yystate];
2378 if (yyn == 0)
2379 goto yyerrlab;
Jim Laskey2792cfb2006-12-06 11:03:10 +00002380 goto yyreduce;
Reid Spencere7c3c602006-11-30 06:36:44 +00002381
Jim Laskey2792cfb2006-12-06 11:03:10 +00002382
2383/*-----------------------------.
2384| yyreduce -- Do a reduction. |
2385`-----------------------------*/
Reid Spencere7c3c602006-11-30 06:36:44 +00002386yyreduce:
Jim Laskey2792cfb2006-12-06 11:03:10 +00002387 /* yyn is the number of a rule to reduce with. */
Reid Spencere7c3c602006-11-30 06:36:44 +00002388 yylen = yyr2[yyn];
2389
Jim Laskey2792cfb2006-12-06 11:03:10 +00002390 /* If YYLEN is nonzero, implement the default value of the action:
2391 `$$ = $1'.
2392
2393 Otherwise, the following line sets YYVAL to garbage.
2394 This behavior is undocumented and Bison
2395 users should not rely upon it. Assigning to YYVAL
2396 unconditionally makes the parser a bit smaller, and it avoids a
2397 GCC warning that YYVAL may be used uninitialized. */
2398 yyval = yyvsp[1-yylen];
2399
2400
2401 YY_REDUCE_PRINT (yyn);
2402 switch (yyn)
Reid Spencere7c3c602006-11-30 06:36:44 +00002403 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00002404 case 81:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002405#line 367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002406 {
2407 (yyval.String) = (yyvsp[-1].String);
2408 ;}
2409 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002410
Jim Laskey2792cfb2006-12-06 11:03:10 +00002411 case 82:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002412#line 370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002413 {
2414 (yyval.String) = new std::string("");
2415 ;}
2416 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002417
Jim Laskey2792cfb2006-12-06 11:03:10 +00002418 case 90:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002419#line 377 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002420 { (yyval.String) = new std::string(""); ;}
2421 break;
Reid Spencere77e35e2006-12-01 20:26:20 +00002422
Jim Laskey2792cfb2006-12-06 11:03:10 +00002423 case 97:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002424#line 382 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002425 {
2426 *(yyvsp[-1].String) += *(yyvsp[0].String);
2427 delete (yyvsp[0].String);
2428 (yyval.String) = (yyvsp[-1].String);
2429 ;}
2430 break;
Reid Spencer16244f42006-12-01 21:10:07 +00002431
Jim Laskey2792cfb2006-12-06 11:03:10 +00002432 case 98:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002433#line 387 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002434 { (yyval.String) = new std::string(""); ;}
2435 break;
Reid Spencere7c3c602006-11-30 06:36:44 +00002436
Jim Laskey2792cfb2006-12-06 11:03:10 +00002437 case 99:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002438#line 392 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002439 { (yyval.String) = new std::string(); ;}
2440 break;
2441
2442 case 100:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002443#line 393 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002444 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2445 break;
2446
2447 case 101:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002448#line 396 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002449 { (yyval.String) = new std::string(); ;}
2450 break;
2451
2452 case 102:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002453#line 397 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002454 {
2455 (yyvsp[-1].String)->insert(0, ", ");
2456 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2457 delete (yyvsp[0].String);
2458 (yyval.String) = (yyvsp[-1].String);
2459 ;}
2460 break;
2461
2462 case 103:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002463#line 405 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002464 {
2465 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2466 delete (yyvsp[0].String);
2467 (yyval.String) = (yyvsp[-1].String);
2468 ;}
2469 break;
2470
2471 case 104:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002472#line 411 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002473 { (yyval.String) = new std::string(); ;}
2474 break;
2475
2476 case 106:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002477#line 415 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002478 { (yyval.String) = new std::string(); ;}
2479 break;
2480
2481 case 107:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002482#line 416 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002483 {
2484 (yyvsp[-1].String)->insert(0, ", ");
2485 if (!(yyvsp[0].String)->empty())
2486 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2487 delete (yyvsp[0].String);
2488 (yyval.String) = (yyvsp[-1].String);
2489 ;}
2490 break;
2491
2492 case 109:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002493#line 426 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002494 {
2495 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2496 delete (yyvsp[0].String);
2497 (yyval.String) = (yyvsp[-1].String);
2498 ;}
2499 break;
2500
2501 case 127:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002502#line 448 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002503 {
2504 (yyval.Type).newTy = (yyvsp[0].String);
2505 (yyval.Type).oldTy = OpaqueTy;
2506 ;}
2507 break;
2508
2509 case 128:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002510#line 452 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002511 {
2512 (yyval.Type).newTy = (yyvsp[0].String);
2513 (yyval.Type).oldTy = UnresolvedTy;
2514 ;}
2515 break;
2516
2517 case 129:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002518#line 456 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002519 {
2520 (yyval.Type) = (yyvsp[0].Type);
2521 ;}
2522 break;
2523
2524 case 130:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002525#line 459 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002526 { // Type UpReference
2527 (yyvsp[0].String)->insert(0, "\\");
2528 (yyval.Type).newTy = (yyvsp[0].String);
2529 (yyval.Type).oldTy = NumericTy;
2530 ;}
2531 break;
2532
2533 case 131:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002534#line 464 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002535 { // Function derived type?
2536 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2537 delete (yyvsp[-1].String);
2538 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2539 (yyval.Type).oldTy = FunctionTy;
2540 ;}
2541 break;
2542
2543 case 132:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002544#line 470 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002545 { // Sized array type?
2546 (yyvsp[-3].String)->insert(0,"[ ");
2547 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
2548 delete (yyvsp[-1].Type).newTy;
2549 (yyval.Type).newTy = (yyvsp[-3].String);
2550 (yyval.Type).oldTy = ArrayTy;
2551 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2552 ;}
2553 break;
2554
2555 case 133:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002556#line 478 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002557 { // Packed array type?
2558 (yyvsp[-3].String)->insert(0,"< ");
2559 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
2560 delete (yyvsp[-1].Type).newTy;
2561 (yyval.Type).newTy = (yyvsp[-3].String);
2562 (yyval.Type).oldTy = PackedTy;
2563 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2564 ;}
2565 break;
2566
2567 case 134:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002568#line 486 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002569 { // Structure type?
2570 (yyvsp[-1].String)->insert(0, "{ ");
2571 *(yyvsp[-1].String) += " }";
2572 (yyval.Type).newTy = (yyvsp[-1].String);
2573 (yyval.Type).oldTy = StructTy;
2574 ;}
2575 break;
2576
2577 case 135:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002578#line 492 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002579 { // Empty structure type?
2580 (yyval.Type).newTy = new std::string("{}");
2581 (yyval.Type).oldTy = StructTy;
2582 ;}
2583 break;
2584
2585 case 136:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002586#line 496 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002587 { // Pointer type?
2588 *(yyvsp[-1].Type).newTy += '*';
2589 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
2590 (yyvsp[-1].Type).oldTy = PointerTy;
2591 (yyval.Type) = (yyvsp[-1].Type);
2592 ;}
2593 break;
2594
2595 case 137:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002596#line 507 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002597 {
2598 (yyval.String) = (yyvsp[0].Type).newTy;
2599 ;}
2600 break;
2601
2602 case 138:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002603#line 510 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002604 {
2605 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2606 delete (yyvsp[0].Type).newTy;
2607 (yyval.String) = (yyvsp[-2].String);
2608 ;}
2609 break;
2610
2611 case 140:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002612#line 519 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002613 {
2614 *(yyvsp[-2].String) += ", ...";
2615 delete (yyvsp[0].String);
2616 (yyval.String) = (yyvsp[-2].String);
2617 ;}
2618 break;
2619
2620 case 141:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002621#line 524 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002622 {
2623 (yyval.String) = (yyvsp[0].String);
2624 ;}
2625 break;
2626
2627 case 142:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002628#line 527 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002629 {
2630 (yyval.String) = new std::string();
2631 ;}
2632 break;
2633
2634 case 143:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002635#line 537 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002636 { // Nonempty unsized arr
2637 (yyval.Const).type = (yyvsp[-3].Type);
2638 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2639 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2640 delete (yyvsp[-1].String);
2641 ;}
2642 break;
2643
2644 case 144:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002645#line 543 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002646 {
2647 (yyval.Const).type = (yyvsp[-2].Type);
2648 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2649 *(yyval.Const).cnst += "[ ]";
2650 ;}
2651 break;
2652
2653 case 145:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002654#line 548 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002655 {
2656 (yyval.Const).type = (yyvsp[-2].Type);
2657 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2658 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2659 delete (yyvsp[0].String);
2660 ;}
2661 break;
2662
2663 case 146:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002664#line 554 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002665 { // Nonempty unsized arr
2666 (yyval.Const).type = (yyvsp[-3].Type);
2667 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2668 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2669 delete (yyvsp[-1].String);
2670 ;}
2671 break;
2672
2673 case 147:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002674#line 560 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002675 {
2676 (yyval.Const).type = (yyvsp[-3].Type);
2677 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2678 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2679 delete (yyvsp[-1].String);
2680 ;}
2681 break;
2682
2683 case 148:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002684#line 566 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002685 {
2686 (yyval.Const).type = (yyvsp[-2].Type);
2687 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2688 *(yyval.Const).cnst += " {}";
2689 ;}
2690 break;
2691
2692 case 149:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002693#line 571 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002694 {
2695 (yyval.Const).type = (yyvsp[-1].Type);
2696 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2697 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2698 delete (yyvsp[0].String);
2699 ;}
2700 break;
2701
2702 case 150:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002703#line 577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002704 {
2705 (yyval.Const).type = (yyvsp[-1].Type);
2706 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2707 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2708 delete (yyvsp[0].String);
2709 ;}
2710 break;
2711
2712 case 151:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002713#line 583 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002714 {
2715 (yyval.Const).type = (yyvsp[-1].Type);
2716 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2717 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2718 delete (yyvsp[0].String);
2719 ;}
2720 break;
2721
2722 case 152:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002723#line 589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002724 {
2725 (yyval.Const).type = (yyvsp[-1].Type);
2726 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2727 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2728 delete (yyvsp[0].String);
2729 ;}
2730 break;
2731
2732 case 153:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002733#line 595 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002734 {
2735 (yyval.Const).type = (yyvsp[-1].Type);
2736 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2737 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2738 delete (yyvsp[0].String);
2739 ;}
2740 break;
2741
2742 case 154:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002743#line 601 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002744 { // integral constants
2745 (yyval.Const).type = (yyvsp[-1].Type);
2746 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2747 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2748 delete (yyvsp[0].String);
2749 ;}
2750 break;
2751
2752 case 155:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002753#line 607 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002754 { // integral constants
2755 (yyval.Const).type = (yyvsp[-1].Type);
2756 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2757 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2758 delete (yyvsp[0].String);
2759 ;}
2760 break;
2761
2762 case 156:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002763#line 613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002764 { // Boolean constants
2765 (yyval.Const).type = (yyvsp[-1].Type);
2766 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2767 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2768 delete (yyvsp[0].String);
2769 ;}
2770 break;
2771
2772 case 157:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002773#line 619 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002774 { // Boolean constants
2775 (yyval.Const).type = (yyvsp[-1].Type);
2776 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2777 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2778 delete (yyvsp[0].String);
2779 ;}
2780 break;
2781
2782 case 158:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002783#line 625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002784 { // Float & Double constants
2785 (yyval.Const).type = (yyvsp[-1].Type);
2786 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2787 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2788 delete (yyvsp[0].String);
2789 ;}
2790 break;
2791
2792 case 159:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002793#line 633 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002794 {
2795 std::string source = *(yyvsp[-3].Const).cnst;
2796 TypeInfo DstTy = (yyvsp[-1].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00002797 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00002798 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002799 // Call getCastUpgrade to upgrade the old cast
Jim Laskey2792cfb2006-12-06 11:03:10 +00002800 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
Reid Spencera50d5962006-12-02 04:11:07 +00002801 } else {
2802 // Nothing to upgrade, just create the cast constant expr
Jim Laskey2792cfb2006-12-06 11:03:10 +00002803 (yyval.String) = new std::string(*(yyvsp[-5].String));
2804 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002805 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002806 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
2807 ;}
2808 break;
2809
2810 case 160:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002811#line 647 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002812 {
2813 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2814 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2815 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2816 *(yyvsp[-4].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00002817 VI.destroy();
2818 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002819 *(yyvsp[-4].String) += ")";
2820 (yyval.String) = (yyvsp[-4].String);
2821 (yyvsp[-2].Const).destroy();
2822 delete (yyvsp[-1].ValList);
2823 ;}
2824 break;
2825
2826 case 161:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002827#line 659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002828 {
2829 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2830 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2831 (yyval.String) = (yyvsp[-7].String);
2832 ;}
2833 break;
2834
2835 case 162:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002836#line 664 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002837 {
2838 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2839 (yyval.String) = new std::string(op);
2840 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2841 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2842 ;}
2843 break;
2844
2845 case 163:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002846#line 670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002847 {
2848 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2849 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2850 (yyval.String) = (yyvsp[-5].String);
2851 ;}
2852 break;
2853
2854 case 164:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002855#line 675 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002856 {
Reid Spencer229e9362006-12-02 22:14:11 +00002857#if UPGRADE_SETCOND_OPS
Jim Laskey2792cfb2006-12-06 11:03:10 +00002858 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
Reid Spencer229e9362006-12-02 22:14:11 +00002859#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00002860 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2861 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2862 (yyval.String) = (yyvsp[-5].String);
2863 ;}
2864 break;
2865
2866 case 165:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002867#line 683 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002868 {
2869 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2870 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2871 (yyval.String) = (yyvsp[-6].String);
2872 ;}
2873 break;
2874
2875 case 166:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002876#line 688 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002877 {
2878 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2879 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2880 (yyval.String) = (yyvsp[-6].String);
2881 ;}
2882 break;
2883
2884 case 167:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002885#line 693 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002886 {
2887 const char* shiftop = (yyvsp[-5].String)->c_str();
2888 if (*(yyvsp[-5].String) == "shr")
2889 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2890 (yyval.String) = new std::string(shiftop);
2891 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2892 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2893 ;}
2894 break;
2895
2896 case 168:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002897#line 701 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002898 {
2899 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2900 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2901 (yyval.String) = (yyvsp[-5].String);
2902 ;}
2903 break;
2904
2905 case 169:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002906#line 706 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002907 {
2908 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2909 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2910 (yyval.String) = (yyvsp[-7].String);
2911 ;}
2912 break;
2913
2914 case 170:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002915#line 711 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002916 {
2917 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2918 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2919 (yyval.String) = (yyvsp[-7].String);
2920 ;}
2921 break;
2922
2923 case 171:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002924#line 721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002925 {
2926 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2927 (yyvsp[0].Const).destroy();
2928 (yyval.String) = (yyvsp[-2].String);
2929 ;}
2930 break;
2931
2932 case 172:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002933#line 726 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002934 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
2935 break;
2936
2937 case 175:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002938#line 741 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002939 {
2940;}
2941 break;
2942
2943 case 176:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002944#line 746 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002945 {
2946 (yyval.String) = 0;
2947 ;}
2948 break;
2949
2950 case 177:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002951#line 749 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002952 {
2953 *O << *(yyvsp[0].String) << "\n";
2954 delete (yyvsp[0].String);
2955 (yyval.String) = 0;
2956 ;}
2957 break;
2958
2959 case 178:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002960#line 754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002961 {
2962 *O << "module asm " << " " << *(yyvsp[0].String) << "\n";
2963 (yyval.String) = 0;
2964 ;}
2965 break;
2966
2967 case 179:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002968#line 758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002969 {
Reid Spencerd154b572006-12-01 20:36:40 +00002970 *O << "implementation\n";
Jim Laskey2792cfb2006-12-06 11:03:10 +00002971 (yyval.String) = 0;
2972 ;}
2973 break;
2974
2975 case 180:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002976#line 762 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002977 { (yyval.String) = 0; ;}
2978 break;
2979
2980 case 182:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002981#line 764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002982 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
2983 break;
2984
2985 case 183:
Reid Spencerf0cf1322006-12-07 04:23:03 +00002986#line 767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00002987 {
2988 EnumeratedTypes.push_back((yyvsp[0].Type));
2989 if (!(yyvsp[-2].String)->empty()) {
2990 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
2991 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
2992 NamedTypes[*(yyvsp[-2].String)].elemTy = (yyvsp[0].Type).elemTy;
2993 *O << *(yyvsp[-2].String) << " = ";
Reid Spencera50d5962006-12-02 04:11:07 +00002994 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00002995 *O << "type " << *(yyvsp[0].Type).newTy << "\n";
2996 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
2997 (yyval.String) = 0;
2998 ;}
2999 break;
3000
3001 case 184:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003002#line 779 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003003 { // Function prototypes can be in const pool
3004 *O << *(yyvsp[0].String) << "\n";
3005 delete (yyvsp[0].String);
3006 (yyval.String) = 0;
3007 ;}
3008 break;
3009
3010 case 185:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003011#line 784 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003012 { // Asm blocks can be in the const pool
3013 *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3014 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3015 (yyval.String) = 0;
3016 ;}
3017 break;
3018
3019 case 186:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003020#line 789 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003021 {
3022 if (!(yyvsp[-4].String)->empty()) {
3023 *O << *(yyvsp[-4].String) << " = ";
3024 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Const).type.clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003025 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003026 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Const).cnst << " " << *(yyvsp[0].String) << "\n";
3027 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
3028 (yyval.String) = 0;
3029 ;}
3030 break;
3031
3032 case 187:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003033#line 798 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003034 {
3035 if (!(yyvsp[-4].String)->empty()) {
3036 *O << *(yyvsp[-4].String) << " = ";
3037 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003038 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003039 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3040 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3041 (yyval.String) = 0;
3042 ;}
3043 break;
3044
3045 case 188:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003046#line 807 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003047 {
3048 if (!(yyvsp[-4].String)->empty()) {
3049 *O << *(yyvsp[-4].String) << " = ";
3050 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003051 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003052 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3053 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3054 (yyval.String) = 0;
3055 ;}
3056 break;
3057
3058 case 189:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003059#line 816 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003060 {
3061 if (!(yyvsp[-4].String)->empty()) {
3062 *O << *(yyvsp[-4].String) << " = ";
3063 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
Reid Spencerf12ee422006-12-05 19:21:25 +00003064 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003065 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
3066 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3067 (yyval.String) = 0;
3068 ;}
3069 break;
3070
3071 case 190:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003072#line 825 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003073 {
3074 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3075 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3076 (yyval.String) = 0;
3077 ;}
3078 break;
3079
3080 case 191:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003081#line 830 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003082 {
3083 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << "\n";
3084 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3085 (yyval.String) = 0;
3086 ;}
3087 break;
3088
3089 case 192:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003090#line 835 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003091 {
3092 (yyval.String) = 0;
3093 ;}
3094 break;
3095
3096 case 196:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003097#line 845 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003098 {
3099 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3100 delete (yyvsp[0].String);
3101 (yyval.String) = (yyvsp[-2].String);
3102 ;}
3103 break;
3104
3105 case 197:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003106#line 850 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003107 {
3108 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3109 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003110 SizeOfPointer = 64;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003111 delete (yyvsp[0].String);
3112 (yyval.String) = (yyvsp[-2].String);
3113 ;}
3114 break;
3115
3116 case 198:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003117#line 857 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003118 {
3119 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3120 delete (yyvsp[0].String);
3121 (yyval.String) = (yyvsp[-2].String);
3122 ;}
3123 break;
3124
3125 case 199:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003126#line 862 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003127 {
3128 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3129 delete (yyvsp[0].String);
3130 (yyval.String) = (yyvsp[-2].String);
3131 ;}
3132 break;
3133
3134 case 200:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003135#line 869 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003136 {
3137 (yyvsp[-1].String)->insert(0, "[ ");
3138 *(yyvsp[-1].String) += " ]";
3139 (yyval.String) = (yyvsp[-1].String);
3140 ;}
3141 break;
3142
3143 case 201:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003144#line 876 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003145 {
3146 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3147 delete (yyvsp[0].String);
3148 (yyval.String) = (yyvsp[-2].String);
3149 ;}
3150 break;
3151
3152 case 203:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003153#line 882 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003154 {
3155 (yyval.String) = new std::string();
3156 ;}
3157 break;
3158
3159 case 207:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003160#line 891 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003161 { (yyval.String) = new std::string(); ;}
3162 break;
3163
3164 case 208:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003165#line 893 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003166 {
3167 (yyval.String) = (yyvsp[-1].Type).newTy;
3168 if (!(yyvsp[0].String)->empty())
3169 *(yyval.String) += " " + *(yyvsp[0].String);
3170 delete (yyvsp[0].String);
3171;}
3172 break;
3173
3174 case 209:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003175#line 900 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003176 {
3177 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3178 delete (yyvsp[0].String);
3179 ;}
3180 break;
3181
3182 case 210:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003183#line 904 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003184 {
3185 (yyval.String) = (yyvsp[0].String);
3186 ;}
3187 break;
3188
3189 case 211:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003190#line 908 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003191 {
3192 (yyval.String) = (yyvsp[0].String);
3193 ;}
3194 break;
3195
3196 case 212:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003197#line 911 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003198 {
3199 *(yyvsp[-2].String) += ", ...";
3200 (yyval.String) = (yyvsp[-2].String);
3201 delete (yyvsp[0].String);
3202 ;}
3203 break;
3204
3205 case 213:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003206#line 916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003207 {
3208 (yyval.String) = (yyvsp[0].String);
3209 ;}
3210 break;
3211
3212 case 214:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003213#line 919 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003214 { (yyval.String) = new std::string(); ;}
3215 break;
3216
3217 case 215:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003218#line 922 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003219 {
3220 if (!(yyvsp[-7].String)->empty()) {
3221 *(yyvsp[-7].String) += " ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003222 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003223 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3224 if (!(yyvsp[-1].String)->empty()) {
3225 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003226 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003227 if (!(yyvsp[0].String)->empty()) {
3228 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003229 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003230 (yyvsp[-6].Type).destroy();
3231 delete (yyvsp[-5].String);
3232 delete (yyvsp[-3].String);
3233 delete (yyvsp[-1].String);
3234 delete (yyvsp[0].String);
3235 (yyval.String) = (yyvsp[-7].String);
3236 ;}
3237 break;
3238
3239 case 216:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003240#line 941 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003241 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3242 break;
3243
3244 case 217:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003245#line 942 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003246 { (yyval.String) = new std::string ("{"); ;}
3247 break;
3248
3249 case 218:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003250#line 944 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003251 {
3252 if (!(yyvsp[-2].String)->empty()) {
3253 *O << *(yyvsp[-2].String) << " ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003254 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003255 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3256 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3257 (yyval.String) = 0;
3258;}
3259 break;
3260
3261 case 219:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003262#line 953 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003263 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3264 break;
3265
3266 case 220:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003267#line 954 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003268 { (yyval.String) = new std::string("}"); ;}
3269 break;
3270
3271 case 221:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003272#line 956 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003273 {
3274 if ((yyvsp[-1].String))
3275 *O << *(yyvsp[-1].String);
3276 *O << '\n' << *(yyvsp[0].String) << "\n";
3277 (yyval.String) = 0;
3278;}
3279 break;
3280
3281 case 222:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003282#line 964 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003283 { (yyval.String) = new std::string(); ;}
3284 break;
3285
3286 case 225:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003287#line 970 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003288 {
3289 if (!(yyvsp[-1].String)->empty())
3290 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3291 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3292 delete (yyvsp[-1].String);
3293 delete (yyvsp[0].String);
3294 (yyval.String) = (yyvsp[-2].String);
3295 ;}
3296 break;
3297
3298 case 226:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003299#line 983 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003300 { (yyval.String) = new std::string(); ;}
3301 break;
3302
3303 case 236:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003304#line 989 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003305 {
3306 (yyvsp[-1].String)->insert(0, "<");
3307 *(yyvsp[-1].String) += ">";
3308 (yyval.String) = (yyvsp[-1].String);
3309 ;}
3310 break;
3311
3312 case 238:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003313#line 995 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003314 {
3315 if (!(yyvsp[-3].String)->empty()) {
3316 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003317 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003318 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3319 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3320 (yyval.String) = (yyvsp[-4].String);
3321 ;}
3322 break;
3323
3324 case 241:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003325#line 1008 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003326 {
3327 (yyval.Value).val = (yyvsp[0].String);
3328 (yyval.Value).constant = false;
3329 (yyval.Value).type.newTy = 0;
3330 (yyval.Value).type.oldTy = UnresolvedTy;
3331 ;}
3332 break;
3333
3334 case 242:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003335#line 1014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003336 {
3337 (yyval.Value).val = (yyvsp[0].String);
3338 (yyval.Value).constant = true;
3339 (yyval.Value).type.newTy = 0;
3340 (yyval.Value).type.oldTy = UnresolvedTy;
3341 ;}
3342 break;
3343
3344 case 243:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003345#line 1025 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003346 {
3347 (yyval.Value) = (yyvsp[0].Value);
3348 (yyval.Value).type = (yyvsp[-1].Type);
3349 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
3350 ;}
3351 break;
3352
3353 case 244:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003354#line 1031 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003355 {
3356 (yyval.String) = 0;
3357 ;}
3358 break;
3359
3360 case 245:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003361#line 1034 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003362 { // Do not allow functions with 0 basic blocks
3363 (yyval.String) = 0;
3364 ;}
3365 break;
3366
3367 case 246:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003368#line 1042 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003369 {
3370 (yyval.String) = 0;
3371 ;}
3372 break;
3373
3374 case 247:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003375#line 1046 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003376 {
3377 *O << " " << *(yyvsp[0].String) << "\n";
3378 delete (yyvsp[0].String);
3379 (yyval.String) = 0;
3380 ;}
3381 break;
3382
3383 case 248:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003384#line 1051 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003385 {
3386 (yyval.String) = 0;
3387 ;}
3388 break;
3389
3390 case 249:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003391#line 1054 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003392 {
3393 *O << *(yyvsp[0].String) << "\n";
3394 delete (yyvsp[0].String);
3395 (yyval.String) = 0;
3396 ;}
3397 break;
3398
3399 case 251:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003400#line 1060 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003401 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3402 break;
3403
3404 case 252:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003405#line 1062 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003406 { // Return with a result...
3407 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Value).val << "\n";
3408 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3409 (yyval.String) = 0;
3410 ;}
3411 break;
3412
3413 case 253:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003414#line 1067 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003415 { // Return with no result...
3416 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n";
3417 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3418 (yyval.String) = 0;
3419 ;}
3420 break;
3421
3422 case 254:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003423#line 1072 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003424 { // Unconditional Branch...
3425 *O << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3426 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3427 (yyval.String) = 0;
3428 ;}
3429 break;
3430
3431 case 255:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003432#line 1077 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003433 {
3434 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3435 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << " "
3436 << *(yyvsp[0].Value).val << "\n";
3437 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3438 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3439 (yyval.String) = 0;
3440 ;}
3441 break;
3442
3443 case 256:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003444#line 1085 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003445 {
3446 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3447 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3448 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3449 delete (yyvsp[-1].String);
3450 (yyval.String) = 0;
3451 ;}
3452 break;
3453
3454 case 257:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003455#line 1092 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003456 {
3457 *O << " " << *(yyvsp[-7].String) << " " << *(yyvsp[-6].Type).newTy << " " << *(yyvsp[-5].Value).val << ", "
3458 << *(yyvsp[-3].Type).newTy << " " << *(yyvsp[-2].Value).val << "[]\n";
3459 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
3460 (yyval.String) = 0;
3461 ;}
3462 break;
3463
3464 case 258:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003465#line 1099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003466 {
Reid Spencer16244f42006-12-01 21:10:07 +00003467 *O << " ";
Jim Laskey2792cfb2006-12-06 11:03:10 +00003468 if (!(yyvsp[-13].String)->empty())
3469 *O << *(yyvsp[-13].String) << " = ";
3470 *O << *(yyvsp[-12].String) << " " << *(yyvsp[-11].String) << " " << *(yyvsp[-10].Type).newTy << " " << *(yyvsp[-9].Value).val << " (";
3471 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3472 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
Reid Spencerf8483652006-12-02 15:16:01 +00003473 *O << *VI.val;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003474 if (i+1 < (yyvsp[-7].ValList)->size())
Reid Spencerf8483652006-12-02 15:16:01 +00003475 *O << ", ";
3476 VI.destroy();
3477 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003478 *O << ") " << *(yyvsp[-5].String) << " " << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " "
3479 << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3480 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3481 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3482 (yyvsp[0].Value).destroy();
3483 (yyval.String) = 0;
3484 ;}
3485 break;
3486
3487 case 259:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003488#line 1118 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003489 {
3490 *O << " " << *(yyvsp[0].String) << "\n";
3491 delete (yyvsp[0].String);
3492 (yyval.String) = 0;
3493 ;}
3494 break;
3495
3496 case 260:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003497#line 1123 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003498 {
3499 *O << " " << *(yyvsp[0].String) << "\n";
3500 delete (yyvsp[0].String);
3501 (yyval.String) = 0;
3502 ;}
3503 break;
3504
3505 case 261:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003506#line 1129 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003507 {
3508 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3509 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3510 (yyval.String) = (yyvsp[-5].String);
3511 ;}
3512 break;
3513
3514 case 262:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003515#line 1134 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003516 {
3517 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
3518 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3519 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3520 (yyval.String) = (yyvsp[-3].String);
3521 ;}
3522 break;
3523
3524 case 263:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003525#line 1142 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003526 {
3527 if (!(yyvsp[-1].String)->empty())
3528 *(yyvsp[-1].String) += " = ";
3529 *(yyvsp[-1].String) += *(yyvsp[0].String);
3530 delete (yyvsp[0].String);
3531 (yyval.String) = (yyvsp[-1].String);
3532 ;}
3533 break;
3534
3535 case 264:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003536#line 1151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003537 { // Used for PHI nodes
3538 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3539 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3540 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3541 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3542 (yyvsp[-3].Value).destroy();
3543 ;}
3544 break;
3545
3546 case 265:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003547#line 1158 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003548 {
3549 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3550 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3551 (yyval.String) = (yyvsp[-6].String);
3552 ;}
3553 break;
3554
3555 case 266:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003556#line 1166 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003557 {
3558 (yyval.ValList) = new ValueList();
3559 (yyval.ValList)->push_back((yyvsp[0].Value));
3560 ;}
3561 break;
3562
3563 case 267:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003564#line 1170 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003565 {
3566 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3567 (yyval.ValList) = (yyvsp[-2].ValList);
3568 ;}
3569 break;
3570
3571 case 268:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003572#line 1177 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003573 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3574 break;
3575
3576 case 269:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003577#line 1178 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003578 { (yyval.ValList) = new ValueList(); ;}
3579 break;
3580
3581 case 270:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003582#line 1182 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003583 {
3584 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3585 delete (yyvsp[0].String);
3586 (yyval.String) = (yyvsp[-1].String);
3587 ;}
3588 break;
3589
3590 case 272:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003591#line 1190 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003592 {
3593 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
3594 (yyval.String) = new std::string(op);
3595 *(yyval.String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3596 delete (yyvsp[-4].String); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3597 ;}
3598 break;
3599
3600 case 273:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003601#line 1196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003602 {
3603 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3604 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3605 (yyval.String) = (yyvsp[-4].String);
3606 ;}
3607 break;
3608
3609 case 274:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003610#line 1201 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003611 {
Reid Spencer229e9362006-12-02 22:14:11 +00003612#if UPGRADE_SETCOND_OPS
Jim Laskey2792cfb2006-12-06 11:03:10 +00003613 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
Reid Spencer229e9362006-12-02 22:14:11 +00003614#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00003615 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3616 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3617 (yyval.String) = (yyvsp[-4].String);
3618 ;}
3619 break;
3620
3621 case 275:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003622#line 1209 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003623 {
3624 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " " + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + ")";
3625 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3626 (yyval.String) = (yyvsp[-6].String);
3627 ;}
3628 break;
3629
3630 case 276:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003631#line 1214 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003632 {
3633 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " " + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + ")";
3634 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
3635 (yyval.String) = (yyvsp[-6].String);
3636 ;}
3637 break;
3638
3639 case 277:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003640#line 1219 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003641 {
3642 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3643 (yyvsp[0].Value).destroy();
3644 (yyval.String) = (yyvsp[-1].String);
3645 ;}
3646 break;
3647
3648 case 278:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003649#line 1224 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003650 {
3651 const char* shiftop = (yyvsp[-3].String)->c_str();
3652 if (*(yyvsp[-3].String) == "shr")
3653 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3654 (yyval.String) = new std::string(shiftop);
3655 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3656 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3657 ;}
3658 break;
3659
3660 case 279:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003661#line 1232 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003662 {
3663 std::string source = *(yyvsp[-2].Value).val;
3664 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3665 TypeInfo DstTy = (yyvsp[0].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00003666 ResolveType(DstTy);
Jim Laskey2792cfb2006-12-06 11:03:10 +00003667 (yyval.String) = new std::string();
3668 if (*(yyvsp[-3].String) == "cast") {
3669 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
Reid Spencera50d5962006-12-02 04:11:07 +00003670 } else {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003671 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003672 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003673 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3674 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3675 ;}
3676 break;
3677
3678 case 280:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003679#line 1246 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003680 {
3681 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3682 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3683 (yyval.String) = (yyvsp[-5].String);
3684 ;}
3685 break;
3686
3687 case 281:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003688#line 1251 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003689 {
3690 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3691 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3692 (yyval.String) = (yyvsp[-3].String);
3693 ;}
3694 break;
3695
3696 case 282:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003697#line 1256 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003698 {
3699 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3700 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3701 (yyval.String) = (yyvsp[-3].String);
3702 ;}
3703 break;
3704
3705 case 283:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003706#line 1261 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003707 {
3708 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3709 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3710 (yyval.String) = (yyvsp[-5].String);
3711 ;}
3712 break;
3713
3714 case 284:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003715#line 1266 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003716 {
3717 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3718 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3719 (yyval.String) = (yyvsp[-5].String);
3720 ;}
3721 break;
3722
3723 case 285:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003724#line 1271 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003725 {
3726 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3727 delete (yyvsp[0].String);
3728 (yyval.String) = (yyvsp[-1].String);
3729 ;}
3730 break;
3731
3732 case 286:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003733#line 1276 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003734 {
3735 if (!(yyvsp[-5].String)->empty())
3736 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3737 if (!(yyvsp[-6].String)->empty())
3738 *(yyvsp[-6].String) += " ";
3739 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
3740 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3741 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3742 *(yyvsp[-6].String) += *VI.val;
3743 if (i+1 < (yyvsp[-1].ValList)->size())
3744 *(yyvsp[-6].String) += ", ";
Reid Spencerf8483652006-12-02 15:16:01 +00003745 VI.destroy();
3746 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003747 *(yyvsp[-6].String) += ")";
3748 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
3749 (yyval.String) = (yyvsp[-6].String);
3750 ;}
3751 break;
3752
3753 case 288:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003754#line 1298 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003755 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3756 break;
3757
3758 case 289:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003759#line 1299 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003760 { (yyval.ValList) = new ValueList(); ;}
3761 break;
3762
3763 case 291:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003764#line 1304 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003765 { (yyval.String) = new std::string(); ;}
3766 break;
3767
3768 case 292:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003769#line 1307 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003770 {
3771 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3772 if (!(yyvsp[0].String)->empty())
3773 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3774 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3775 (yyval.String) = (yyvsp[-2].String);
3776 ;}
3777 break;
3778
3779 case 293:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003780#line 1314 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003781 {
3782 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3783 if (!(yyvsp[0].String)->empty())
3784 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3785 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3786 (yyval.String) = (yyvsp[-5].String);
3787 ;}
3788 break;
3789
3790 case 294:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003791#line 1321 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003792 {
3793 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3794 if (!(yyvsp[0].String)->empty())
3795 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3796 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3797 (yyval.String) = (yyvsp[-2].String);
3798 ;}
3799 break;
3800
3801 case 295:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003802#line 1328 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003803 {
3804 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3805 if (!(yyvsp[0].String)->empty())
3806 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3807 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3808 (yyval.String) = (yyvsp[-5].String);
3809 ;}
3810 break;
3811
3812 case 296:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003813#line 1335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003814 {
3815 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3816 (yyvsp[0].Value).destroy();
3817 (yyval.String) = (yyvsp[-1].String);
3818 ;}
3819 break;
3820
3821 case 297:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003822#line 1340 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003823 {
3824 if (!(yyvsp[-3].String)->empty())
3825 *(yyvsp[-3].String) += " ";
3826 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3827 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3828 (yyval.String) = (yyvsp[-3].String);
3829 ;}
3830 break;
3831
3832 case 298:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003833#line 1347 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003834 {
3835 if (!(yyvsp[-5].String)->empty())
3836 *(yyvsp[-5].String) += " ";
3837 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3838 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
3839 (yyval.String) = (yyvsp[-5].String);
3840 ;}
3841 break;
3842
3843 case 299:
Reid Spencerf0cf1322006-12-07 04:23:03 +00003844#line 1354 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Jim Laskey2792cfb2006-12-06 11:03:10 +00003845 {
Reid Spencerf459d392006-12-02 16:19:52 +00003846 // Upgrade the indices
Jim Laskey2792cfb2006-12-06 11:03:10 +00003847 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3848 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
Reid Spencerf459d392006-12-02 16:19:52 +00003849 if (VI.type.isUnsigned() && !VI.isConstant() &&
3850 VI.type.getBitWidth() < 64) {
3851 std::string* old = VI.val;
3852 *O << " %gep_upgrade" << unique << " = zext " << *old
3853 << " to ulong\n";
3854 VI.val = new std::string("ulong %gep_upgrade" + llvm::utostr(unique++));
3855 VI.type.oldTy = ULongTy;
3856 delete old;
3857 }
3858 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003859 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3860 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3861 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3862 *(yyvsp[-3].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00003863 VI.destroy();
3864 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00003865 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
3866 (yyval.String) = (yyvsp[-3].String);
3867 ;}
3868 break;
3869
3870
3871 default: break;
3872 }
3873
3874/* Line 1126 of yacc.c. */
Reid Spencerf0cf1322006-12-07 04:23:03 +00003875#line 3876 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003876
3877 yyvsp -= yylen;
3878 yyssp -= yylen;
3879
Jim Laskey2792cfb2006-12-06 11:03:10 +00003880
3881 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00003882
3883 *++yyvsp = yyval;
3884
3885
Jim Laskey2792cfb2006-12-06 11:03:10 +00003886 /* Now `shift' the result of the reduction. Determine what state
3887 that goes to, based on the state we popped back to and the rule
3888 number reduced by. */
Reid Spencere7c3c602006-11-30 06:36:44 +00003889
3890 yyn = yyr1[yyn];
3891
Jim Laskey2792cfb2006-12-06 11:03:10 +00003892 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3893 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Reid Spencere7c3c602006-11-30 06:36:44 +00003894 yystate = yytable[yystate];
3895 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00003896 yystate = yydefgoto[yyn - YYNTOKENS];
Reid Spencere7c3c602006-11-30 06:36:44 +00003897
3898 goto yynewstate;
3899
3900
Jim Laskey2792cfb2006-12-06 11:03:10 +00003901/*------------------------------------.
3902| yyerrlab -- here on detecting error |
3903`------------------------------------*/
3904yyerrlab:
3905 /* If not already recovering from an error, report this error. */
3906 if (!yyerrstatus)
Reid Spencere7c3c602006-11-30 06:36:44 +00003907 {
3908 ++yynerrs;
Jim Laskey2792cfb2006-12-06 11:03:10 +00003909#if YYERROR_VERBOSE
Reid Spencere7c3c602006-11-30 06:36:44 +00003910 yyn = yypact[yystate];
3911
Jim Laskey2792cfb2006-12-06 11:03:10 +00003912 if (YYPACT_NINF < yyn && yyn < YYLAST)
Reid Spencere7c3c602006-11-30 06:36:44 +00003913 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003914 int yytype = YYTRANSLATE (yychar);
3915 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3916 YYSIZE_T yysize = yysize0;
3917 YYSIZE_T yysize1;
3918 int yysize_overflow = 0;
3919 char *yymsg = 0;
3920# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3921 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3922 int yyx;
Reid Spencere7c3c602006-11-30 06:36:44 +00003923
Jim Laskey2792cfb2006-12-06 11:03:10 +00003924#if 0
3925 /* This is so xgettext sees the translatable formats that are
3926 constructed on the fly. */
3927 YY_("syntax error, unexpected %s");
3928 YY_("syntax error, unexpected %s, expecting %s");
3929 YY_("syntax error, unexpected %s, expecting %s or %s");
3930 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3931 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3932#endif
3933 char *yyfmt;
3934 char const *yyf;
3935 static char const yyunexpected[] = "syntax error, unexpected %s";
3936 static char const yyexpecting[] = ", expecting %s";
3937 static char const yyor[] = " or %s";
3938 char yyformat[sizeof yyunexpected
3939 + sizeof yyexpecting - 1
3940 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3941 * (sizeof yyor - 1))];
3942 char const *yyprefix = yyexpecting;
3943
3944 /* Start YYX at -YYN if negative to avoid negative indexes in
3945 YYCHECK. */
3946 int yyxbegin = yyn < 0 ? -yyn : 0;
3947
3948 /* Stay within bounds of both yycheck and yytname. */
3949 int yychecklim = YYLAST - yyn;
3950 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3951 int yycount = 1;
3952
3953 yyarg[0] = yytname[yytype];
3954 yyfmt = yystpcpy (yyformat, yyunexpected);
3955
3956 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3957 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3958 {
3959 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3960 {
3961 yycount = 1;
3962 yysize = yysize0;
3963 yyformat[sizeof yyunexpected - 1] = '\0';
3964 break;
3965 }
3966 yyarg[yycount++] = yytname[yyx];
3967 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3968 yysize_overflow |= yysize1 < yysize;
3969 yysize = yysize1;
3970 yyfmt = yystpcpy (yyfmt, yyprefix);
3971 yyprefix = yyor;
3972 }
3973
3974 yyf = YY_(yyformat);
3975 yysize1 = yysize + yystrlen (yyf);
3976 yysize_overflow |= yysize1 < yysize;
3977 yysize = yysize1;
3978
3979 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
3980 yymsg = (char *) YYSTACK_ALLOC (yysize);
3981 if (yymsg)
Reid Spencere7c3c602006-11-30 06:36:44 +00003982 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003983 /* Avoid sprintf, as that infringes on the user's name space.
3984 Don't have undefined behavior even if the translation
3985 produced a string with the wrong number of "%s"s. */
3986 char *yyp = yymsg;
3987 int yyi = 0;
3988 while ((*yyp = *yyf))
Reid Spencere7c3c602006-11-30 06:36:44 +00003989 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00003990 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3991 {
3992 yyp += yytnamerr (yyp, yyarg[yyi++]);
3993 yyf += 2;
3994 }
3995 else
3996 {
3997 yyp++;
3998 yyf++;
3999 }
Reid Spencere7c3c602006-11-30 06:36:44 +00004000 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00004001 yyerror (yymsg);
4002 YYSTACK_FREE (yymsg);
Reid Spencere7c3c602006-11-30 06:36:44 +00004003 }
4004 else
Jim Laskey2792cfb2006-12-06 11:03:10 +00004005 {
4006 yyerror (YY_("syntax error"));
4007 goto yyexhaustedlab;
4008 }
Reid Spencere7c3c602006-11-30 06:36:44 +00004009 }
4010 else
4011#endif /* YYERROR_VERBOSE */
Jim Laskey2792cfb2006-12-06 11:03:10 +00004012 yyerror (YY_("syntax error"));
Reid Spencere7c3c602006-11-30 06:36:44 +00004013 }
4014
Jim Laskey2792cfb2006-12-06 11:03:10 +00004015
Reid Spencere7c3c602006-11-30 06:36:44 +00004016
4017 if (yyerrstatus == 3)
4018 {
Jim Laskey2792cfb2006-12-06 11:03:10 +00004019 /* If just tried and failed to reuse look-ahead token after an
4020 error, discard it. */
Reid Spencere7c3c602006-11-30 06:36:44 +00004021
Jim Laskey2792cfb2006-12-06 11:03:10 +00004022 if (yychar <= YYEOF)
4023 {
4024 /* Return failure if at end of input. */
4025 if (yychar == YYEOF)
4026 YYABORT;
4027 }
4028 else
4029 {
4030 yydestruct ("Error: discarding", yytoken, &yylval);
4031 yychar = YYEMPTY;
4032 }
4033 }
4034
4035 /* Else will try to reuse look-ahead token after shifting the error
4036 token. */
4037 goto yyerrlab1;
4038
4039
4040/*---------------------------------------------------.
4041| yyerrorlab -- error raised explicitly by YYERROR. |
4042`---------------------------------------------------*/
4043yyerrorlab:
4044
4045 /* Pacify compilers like GCC when the user code never invokes
4046 YYERROR and the label yyerrorlab therefore never appears in user
4047 code. */
4048 if (0)
4049 goto yyerrorlab;
4050
4051yyvsp -= yylen;
4052 yyssp -= yylen;
4053 yystate = *yyssp;
4054 goto yyerrlab1;
4055
4056
4057/*-------------------------------------------------------------.
4058| yyerrlab1 -- common code for both syntax error and YYERROR. |
4059`-------------------------------------------------------------*/
4060yyerrlab1:
4061 yyerrstatus = 3; /* Each real token shifted decrements this. */
4062
4063 for (;;)
4064 {
4065 yyn = yypact[yystate];
4066 if (yyn != YYPACT_NINF)
4067 {
4068 yyn += YYTERROR;
4069 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4070 {
4071 yyn = yytable[yyn];
4072 if (0 < yyn)
4073 break;
4074 }
4075 }
4076
4077 /* Pop the current state because it cannot handle the error token. */
4078 if (yyssp == yyss)
Reid Spencere7c3c602006-11-30 06:36:44 +00004079 YYABORT;
4080
4081
Jim Laskey2792cfb2006-12-06 11:03:10 +00004082 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4083 YYPOPSTACK;
4084 yystate = *yyssp;
4085 YY_STACK_PRINT (yyss, yyssp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004086 }
4087
4088 if (yyn == YYFINAL)
4089 YYACCEPT;
4090
4091 *++yyvsp = yylval;
Jim Laskey2792cfb2006-12-06 11:03:10 +00004092
4093
4094 /* Shift the error token. */
4095 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
Reid Spencere7c3c602006-11-30 06:36:44 +00004096
4097 yystate = yyn;
4098 goto yynewstate;
4099
Jim Laskey98ba5882006-12-06 10:57:33 +00004100
Jim Laskey2792cfb2006-12-06 11:03:10 +00004101/*-------------------------------------.
4102| yyacceptlab -- YYACCEPT comes here. |
4103`-------------------------------------*/
4104yyacceptlab:
4105 yyresult = 0;
4106 goto yyreturn;
4107
4108/*-----------------------------------.
4109| yyabortlab -- YYABORT comes here. |
4110`-----------------------------------*/
4111yyabortlab:
4112 yyresult = 1;
4113 goto yyreturn;
4114
4115#ifndef yyoverflow
4116/*-------------------------------------------------.
4117| yyexhaustedlab -- memory exhaustion comes here. |
4118`-------------------------------------------------*/
4119yyexhaustedlab:
4120 yyerror (YY_("memory exhausted"));
4121 yyresult = 2;
4122 /* Fall through. */
Jim Laskey98ba5882006-12-06 10:57:33 +00004123#endif
Jim Laskey2792cfb2006-12-06 11:03:10 +00004124
4125yyreturn:
4126 if (yychar != YYEOF && yychar != YYEMPTY)
4127 yydestruct ("Cleanup: discarding lookahead",
4128 yytoken, &yylval);
4129 while (yyssp != yyss)
4130 {
4131 yydestruct ("Cleanup: popping",
4132 yystos[*yyssp], yyvsp);
4133 YYPOPSTACK;
Jim Laskey98ba5882006-12-06 10:57:33 +00004134 }
Jim Laskey2792cfb2006-12-06 11:03:10 +00004135#ifndef yyoverflow
4136 if (yyss != yyssa)
4137 YYSTACK_FREE (yyss);
4138#endif
4139 return yyresult;
Reid Spencere7c3c602006-11-30 06:36:44 +00004140}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004141
4142
Reid Spencerf0cf1322006-12-07 04:23:03 +00004143#line 1378 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004144
4145
4146int yyerror(const char *ErrorMsg) {
4147 std::string where
4148 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4149 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4150 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4151 if (yychar == YYEMPTY || yychar == 0)
4152 errMsg += "end-of-file.";
4153 else
4154 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4155 std::cerr << errMsg << '\n';
4156 exit(1);
4157}
Jim Laskey2792cfb2006-12-06 11:03:10 +00004158