blob: 6e5edc3596daa19f24f495843fdd0e644a506d5b [file] [log] [blame]
Reid Spencere7c3c602006-11-30 06:36:44 +00001/* A Bison parser, made by GNU Bison 2.1. */
2
3/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Bison version. */
40#define YYBISON_VERSION "2.1"
41
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
44
45/* Pure parsers. */
46#define YYPURE 0
47
48/* Using locations. */
49#define YYLSP_NEEDED 0
50
51/* Substitute the variable and function names. */
52#define yyparse Upgradeparse
53#define yylex Upgradelex
54#define yyerror Upgradeerror
55#define yylval Upgradelval
56#define yychar Upgradechar
57#define yydebug Upgradedebug
58#define yynerrs Upgradenerrs
59
60
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
Reid Spencerf2d55322006-12-01 21:52:30 +000067 VOID = 258,
68 BOOL = 259,
69 SBYTE = 260,
70 UBYTE = 261,
71 SHORT = 262,
72 USHORT = 263,
73 INT = 264,
74 UINT = 265,
75 LONG = 266,
76 ULONG = 267,
77 FLOAT = 268,
78 DOUBLE = 269,
79 LABEL = 270,
80 OPAQUE = 271,
81 ESINT64VAL = 272,
82 EUINT64VAL = 273,
83 SINTVAL = 274,
84 UINTVAL = 275,
85 FPVAL = 276,
86 NULL_TOK = 277,
87 UNDEF = 278,
88 ZEROINITIALIZER = 279,
89 TRUETOK = 280,
90 FALSETOK = 281,
Reid Spencere77e35e2006-12-01 20:26:20 +000091 TYPE = 282,
92 VAR_ID = 283,
93 LABELSTR = 284,
94 STRINGCONSTANT = 285,
95 IMPLEMENTATION = 286,
96 BEGINTOK = 287,
97 ENDTOK = 288,
98 DECLARE = 289,
Reid Spencer71d2ec92006-12-31 06:02:26 +000099 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
Reid Spencere7c3c602006-11-30 06:36:44 +0000215 };
216#endif
217/* Tokens. */
Reid Spencerf2d55322006-12-01 21:52:30 +0000218#define VOID 258
219#define BOOL 259
220#define SBYTE 260
221#define UBYTE 261
222#define SHORT 262
223#define USHORT 263
224#define INT 264
225#define UINT 265
226#define LONG 266
227#define ULONG 267
228#define FLOAT 268
229#define DOUBLE 269
230#define LABEL 270
231#define OPAQUE 271
232#define ESINT64VAL 272
233#define EUINT64VAL 273
234#define SINTVAL 274
235#define UINTVAL 275
236#define FPVAL 276
237#define NULL_TOK 277
238#define UNDEF 278
239#define ZEROINITIALIZER 279
240#define TRUETOK 280
241#define FALSETOK 281
Reid Spencere77e35e2006-12-01 20:26:20 +0000242#define TYPE 282
243#define VAR_ID 283
244#define LABELSTR 284
245#define STRINGCONSTANT 285
246#define IMPLEMENTATION 286
247#define BEGINTOK 287
248#define ENDTOK 288
249#define DECLARE 289
Reid Spencer71d2ec92006-12-31 06:02:26 +0000250#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
Reid Spencere7c3c602006-11-30 06:36:44 +0000366
367
368
369
370/* Copy the first part of user declarations. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000371#line 14 "/proj/llvm/llvm-3/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 Spencere7c3c602006-11-30 06:36:44 +0000384
385int yylex(); // declaration" of xxx warnings.
386int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000387extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000388
389static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000390static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000391std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000392unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000393static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000394
Reid Spencer71d2ec92006-12-31 06:02:26 +0000395// This bool controls whether attributes are ever added to function declarations
396// definitions and calls.
397static bool AddAttributes = false;
398
Reid Spencerf5626a32007-01-01 01:20:41 +0000399// This bool is used to communicate between the InstVal and Inst rules about
400// whether or not a cast should be deleted. When the flag is set, InstVal has
401// determined that the cast is a candidate. However, it can only be deleted if
402// the value being casted is the same value name as the instruction. The Inst
403// rule makes that comparison if the flag is set and comments out the
404// instruction if they match.
405static bool deleteUselessCastFlag = false;
406static std::string* deleteUselessCastName = 0;
407
Reid Spencera50d5962006-12-02 04:11:07 +0000408typedef std::vector<TypeInfo> TypeVector;
409static TypeVector EnumeratedTypes;
410typedef std::map<std::string,TypeInfo> TypeMap;
411static TypeMap NamedTypes;
Reid Spencerf12ee422006-12-05 19:21:25 +0000412static TypeMap Globals;
Reid Spencera50d5962006-12-02 04:11:07 +0000413
Reid Spencerf8483652006-12-02 15:16:01 +0000414void destroy(ValueList* VL) {
415 while (!VL->empty()) {
416 ValueInfo& VI = VL->back();
417 VI.destroy();
418 VL->pop_back();
419 }
420 delete VL;
421}
422
Reid Spencer96839be2006-11-30 16:50:26 +0000423void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000424 std::ostream &out, bool debug, bool addAttrs)
Reid Spencere7c3c602006-11-30 06:36:44 +0000425{
426 Upgradelineno = 1;
427 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000428 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000429 yydebug = debug;
Reid Spencer71d2ec92006-12-31 06:02:26 +0000430 AddAttributes = addAttrs;
Reid Spencere7c3c602006-11-30 06:36:44 +0000431 O = &out;
432
433 if (yyparse()) {
434 std::cerr << "Parse failed.\n";
435 exit(1);
436 }
437}
438
Reid Spencera50d5962006-12-02 04:11:07 +0000439static void ResolveType(TypeInfo& Ty) {
440 if (Ty.oldTy == UnresolvedTy) {
441 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
Reid Spencer78720742006-12-02 20:21:22 +0000442 if (I != NamedTypes.end()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000443 Ty.oldTy = I->second.oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000444 Ty.elemTy = I->second.elemTy;
445 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000446 std::string msg("Can't resolve type: ");
447 msg += *Ty.newTy;
448 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000449 }
Reid Spencera50d5962006-12-02 04:11:07 +0000450 } else if (Ty.oldTy == NumericTy) {
451 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
452 if (ref < EnumeratedTypes.size()) {
453 Ty.oldTy = EnumeratedTypes[ref].oldTy;
Reid Spencer78720742006-12-02 20:21:22 +0000454 Ty.elemTy = EnumeratedTypes[ref].elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +0000455 } else {
456 std::string msg("Can't resolve type: ");
457 msg += *Ty.newTy;
458 yyerror(msg.c_str());
459 }
Reid Spencer280d8012006-12-01 23:40:53 +0000460 }
Reid Spencera50d5962006-12-02 04:11:07 +0000461 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000462}
463
Reid Spencera50d5962006-12-02 04:11:07 +0000464static const char* getCastOpcode(
465 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
466{
Reid Spencere77e35e2006-12-01 20:26:20 +0000467 unsigned SrcBits = SrcTy.getBitWidth();
468 unsigned DstBits = DstTy.getBitWidth();
469 const char* opcode = "bitcast";
470 // Run through the possibilities ...
471 if (DstTy.isIntegral()) { // Casting to integral
472 if (SrcTy.isIntegral()) { // Casting from integral
473 if (DstBits < SrcBits)
474 opcode = "trunc";
475 else if (DstBits > SrcBits) { // its an extension
476 if (SrcTy.isSigned())
477 opcode ="sext"; // signed -> SEXT
478 else
479 opcode = "zext"; // unsigned -> ZEXT
480 } else {
481 opcode = "bitcast"; // Same size, No-op cast
482 }
483 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
484 if (DstTy.isSigned())
485 opcode = "fptosi"; // FP -> sint
486 else
487 opcode = "fptoui"; // FP -> uint
488 } else if (SrcTy.isPacked()) {
489 assert(DstBits == SrcTy.getBitWidth() &&
490 "Casting packed to integer of different width");
491 opcode = "bitcast"; // same size, no-op cast
492 } else {
493 assert(SrcTy.isPointer() &&
494 "Casting from a value that is not first-class type");
495 opcode = "ptrtoint"; // ptr -> int
496 }
497 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
498 if (SrcTy.isIntegral()) { // Casting from integral
499 if (SrcTy.isSigned())
500 opcode = "sitofp"; // sint -> FP
501 else
502 opcode = "uitofp"; // uint -> FP
503 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
504 if (DstBits < SrcBits) {
505 opcode = "fptrunc"; // FP -> smaller FP
506 } else if (DstBits > SrcBits) {
507 opcode = "fpext"; // FP -> larger FP
508 } else {
509 opcode ="bitcast"; // same size, no-op cast
510 }
511 } else if (SrcTy.isPacked()) {
512 assert(DstBits == SrcTy.getBitWidth() &&
513 "Casting packed to floating point of different width");
514 opcode = "bitcast"; // same size, no-op cast
515 } else {
516 assert(0 && "Casting pointer or non-first class to float");
517 }
518 } else if (DstTy.isPacked()) {
519 if (SrcTy.isPacked()) {
520 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
521 "Casting packed to packed of different widths");
522 opcode = "bitcast"; // packed -> packed
523 } else if (DstTy.getBitWidth() == SrcBits) {
524 opcode = "bitcast"; // float/int -> packed
525 } else {
526 assert(!"Illegal cast to packed (wrong type or size)");
527 }
528 } else if (DstTy.isPointer()) {
529 if (SrcTy.isPointer()) {
530 opcode = "bitcast"; // ptr -> ptr
531 } else if (SrcTy.isIntegral()) {
532 opcode = "inttoptr"; // int -> ptr
533 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000534 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000535 }
536 } else {
537 assert(!"Casting to type that is not first-class");
538 }
539 return opcode;
540}
541
Reid Spencera50d5962006-12-02 04:11:07 +0000542static std::string getCastUpgrade(
543 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
544{
545 std::string Result;
546 std::string Source = Src;
547 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
548 // fp -> ptr cast is no longer supported but we must upgrade this
549 // by doing a double cast: fp -> int -> ptr
550 if (isConst)
Reid Spencer71d2ec92006-12-31 06:02:26 +0000551 Source = "i64 fptoui(" + Source + " to i64)";
Reid Spencera50d5962006-12-02 04:11:07 +0000552 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000553 *O << " %cast_upgrade" << unique << " = fptoui " << Source
Reid Spencer71d2ec92006-12-31 06:02:26 +0000554 << " to i64\n";
555 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000556 }
557 // Update the SrcTy for the getCastOpcode call below
558 SrcTy.destroy();
Reid Spencer71d2ec92006-12-31 06:02:26 +0000559 SrcTy.newTy = new std::string("i64");
Reid Spencera50d5962006-12-02 04:11:07 +0000560 SrcTy.oldTy = ULongTy;
Reid Spencer5fe27e72006-12-09 19:41:25 +0000561 } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
Reid Spencera50d5962006-12-02 04:11:07 +0000562 // cast ptr %x to bool was previously defined as setne ptr %x, null
563 // The ptrtoint semantic is to truncate, not compare so we must retain
564 // the original intent by replace the cast with a setne
565 const char* comparator = SrcTy.isPointer() ? ", null" :
566 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
Reid Spencere4d87aa2006-12-23 06:05:41 +0000567 const char* compareOp = SrcTy.isFloatingPoint() ? "fcmp one " : "icmp ne ";
Reid Spencer187ccf82006-12-09 16:57:22 +0000568 if (isConst) {
569 Result = "(" + Source + comparator + ")";
570 Result = compareOp + Result;
571 } else
572 Result = compareOp + Source + comparator;
Reid Spencera50d5962006-12-02 04:11:07 +0000573 return Result; // skip cast processing below
574 }
575 ResolveType(SrcTy);
576 ResolveType(DstTy);
577 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
578 if (isConst)
579 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
580 else
581 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
582 return Result;
583}
584
Reid Spencer78720742006-12-02 20:21:22 +0000585const char* getDivRemOpcode(const std::string& opcode, const TypeInfo& TI) {
586 const char* op = opcode.c_str();
587 TypeInfo Ty = TI;
588 ResolveType(Ty);
589 if (Ty.isPacked())
590 Ty.oldTy = Ty.getElementType();
591 if (opcode == "div")
592 if (Ty.isFloatingPoint())
593 op = "fdiv";
594 else if (Ty.isUnsigned())
595 op = "udiv";
596 else if (Ty.isSigned())
597 op = "sdiv";
598 else
599 yyerror("Invalid type for div instruction");
600 else if (opcode == "rem")
601 if (Ty.isFloatingPoint())
602 op = "frem";
603 else if (Ty.isUnsigned())
604 op = "urem";
605 else if (Ty.isSigned())
606 op = "srem";
607 else
608 yyerror("Invalid type for rem instruction");
609 return op;
610}
Reid Spencere7c3c602006-11-30 06:36:44 +0000611
Reid Spencer229e9362006-12-02 22:14:11 +0000612std::string
613getCompareOp(const std::string& setcc, const TypeInfo& TI) {
614 assert(setcc.length() == 5);
615 char cc1 = setcc[3];
616 char cc2 = setcc[4];
617 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
618 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
619 std::string result("xcmp xxx");
620 result[6] = cc1;
621 result[7] = cc2;
622 if (TI.isFloatingPoint()) {
623 result[0] = 'f';
Reid Spencere4d87aa2006-12-23 06:05:41 +0000624 result[5] = 'o';
Reid Spencerf0cf1322006-12-07 04:23:03 +0000625 if (cc1 == 'n')
626 result[5] = 'u'; // NE maps to unordered
627 else
628 result[5] = 'o'; // everything else maps to ordered
Reid Spencer229e9362006-12-02 22:14:11 +0000629 } else if (TI.isIntegral() || TI.isPointer()) {
630 result[0] = 'i';
631 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
632 result.erase(5,1);
633 else if (TI.isSigned())
634 result[5] = 's';
Reid Spencer3e5ab8c2006-12-06 06:25:46 +0000635 else if (TI.isUnsigned() || TI.isPointer() || TI.isBool())
Reid Spencer229e9362006-12-02 22:14:11 +0000636 result[5] = 'u';
637 else
638 yyerror("Invalid integral type for setcc");
639 }
640 return result;
641}
642
643
Reid Spencere7c3c602006-11-30 06:36:44 +0000644
645/* Enabling traces. */
646#ifndef YYDEBUG
647# define YYDEBUG 0
648#endif
649
650/* Enabling verbose error messages. */
651#ifdef YYERROR_VERBOSE
652# undef YYERROR_VERBOSE
653# define YYERROR_VERBOSE 1
654#else
655# define YYERROR_VERBOSE 0
656#endif
657
658/* Enabling the token table. */
659#ifndef YYTOKEN_TABLE
660# define YYTOKEN_TABLE 0
661#endif
662
663#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencerf5626a32007-01-01 01:20:41 +0000664#line 289 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +0000665typedef union YYSTYPE {
666 std::string* String;
667 TypeInfo Type;
668 ValueInfo Value;
669 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000670 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000671} YYSTYPE;
672/* Line 196 of yacc.c. */
Reid Spencerf5626a32007-01-01 01:20:41 +0000673#line 674 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000674# define yystype YYSTYPE /* obsolescent; will be withdrawn */
675# define YYSTYPE_IS_DECLARED 1
676# define YYSTYPE_IS_TRIVIAL 1
677#endif
678
679
680
681/* Copy the second part of user declarations. */
682
683
684/* Line 219 of yacc.c. */
Reid Spencerf5626a32007-01-01 01:20:41 +0000685#line 686 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000686
687#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
688# define YYSIZE_T __SIZE_TYPE__
689#endif
690#if ! defined (YYSIZE_T) && defined (size_t)
691# define YYSIZE_T size_t
692#endif
693#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
694# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
695# define YYSIZE_T size_t
696#endif
697#if ! defined (YYSIZE_T)
698# define YYSIZE_T unsigned int
699#endif
700
701#ifndef YY_
702# if YYENABLE_NLS
703# if ENABLE_NLS
704# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
705# define YY_(msgid) dgettext ("bison-runtime", msgid)
706# endif
707# endif
708# ifndef YY_
709# define YY_(msgid) msgid
710# endif
711#endif
712
713#if ! defined (yyoverflow) || YYERROR_VERBOSE
714
715/* The parser invokes alloca or malloc; define the necessary symbols. */
716
717# ifdef YYSTACK_USE_ALLOCA
718# if YYSTACK_USE_ALLOCA
719# ifdef __GNUC__
720# define YYSTACK_ALLOC __builtin_alloca
721# else
722# define YYSTACK_ALLOC alloca
723# if defined (__STDC__) || defined (__cplusplus)
724# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
725# define YYINCLUDED_STDLIB_H
726# endif
727# endif
728# endif
729# endif
730
731# ifdef YYSTACK_ALLOC
732 /* Pacify GCC's `empty if-body' warning. */
733# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
734# ifndef YYSTACK_ALLOC_MAXIMUM
735 /* The OS might guarantee only one guard page at the bottom of the stack,
736 and a page size can be as small as 4096 bytes. So we cannot safely
737 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
738 to allow for a few compiler-allocated temporary stack slots. */
739# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
740# endif
741# else
742# define YYSTACK_ALLOC YYMALLOC
743# define YYSTACK_FREE YYFREE
744# ifndef YYSTACK_ALLOC_MAXIMUM
745# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
746# endif
747# ifdef __cplusplus
748extern "C" {
749# endif
750# ifndef YYMALLOC
751# define YYMALLOC malloc
752# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
753 && (defined (__STDC__) || defined (__cplusplus)))
754void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
755# endif
756# endif
757# ifndef YYFREE
758# define YYFREE free
759# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
760 && (defined (__STDC__) || defined (__cplusplus)))
761void free (void *); /* INFRINGES ON USER NAME SPACE */
762# endif
763# endif
764# ifdef __cplusplus
765}
766# endif
767# endif
768#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
769
770
771#if (! defined (yyoverflow) \
772 && (! defined (__cplusplus) \
773 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
774
775/* A type that is properly aligned for any stack member. */
776union yyalloc
777{
778 short int yyss;
779 YYSTYPE yyvs;
780 };
781
782/* The size of the maximum gap between one aligned stack and the next. */
783# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
784
785/* The size of an array large to enough to hold all stacks, each with
786 N elements. */
787# define YYSTACK_BYTES(N) \
788 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
789 + YYSTACK_GAP_MAXIMUM)
790
791/* Copy COUNT objects from FROM to TO. The source and destination do
792 not overlap. */
793# ifndef YYCOPY
794# if defined (__GNUC__) && 1 < __GNUC__
795# define YYCOPY(To, From, Count) \
796 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
797# else
798# define YYCOPY(To, From, Count) \
799 do \
800 { \
801 YYSIZE_T yyi; \
802 for (yyi = 0; yyi < (Count); yyi++) \
803 (To)[yyi] = (From)[yyi]; \
804 } \
805 while (0)
806# endif
807# endif
808
809/* Relocate STACK from its old location to the new one. The
810 local variables YYSIZE and YYSTACKSIZE give the old and new number of
811 elements in the stack, and YYPTR gives the new location of the
812 stack. Advance YYPTR to a properly aligned location for the next
813 stack. */
814# define YYSTACK_RELOCATE(Stack) \
815 do \
816 { \
817 YYSIZE_T yynewbytes; \
818 YYCOPY (&yyptr->Stack, Stack, yysize); \
819 Stack = &yyptr->Stack; \
820 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
821 yyptr += yynewbytes / sizeof (*yyptr); \
822 } \
823 while (0)
824
825#endif
826
827#if defined (__STDC__) || defined (__cplusplus)
828 typedef signed char yysigned_char;
829#else
830 typedef short int yysigned_char;
831#endif
832
833/* YYFINAL -- State number of the termination state. */
834#define YYFINAL 4
835/* YYLAST -- Last index in YYTABLE. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000836#define YYLAST 1486
Reid Spencere7c3c602006-11-30 06:36:44 +0000837
838/* YYNTOKENS -- Number of terminals. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000839#define YYNTOKENS 165
Reid Spencere7c3c602006-11-30 06:36:44 +0000840/* YYNNTS -- Number of nonterminals. */
Reid Spencer229e9362006-12-02 22:14:11 +0000841#define YYNNTS 75
Reid Spencere7c3c602006-11-30 06:36:44 +0000842/* YYNRULES -- Number of rules. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000843#define YYNRULES 301
Reid Spencere7c3c602006-11-30 06:36:44 +0000844/* YYNRULES -- Number of states. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000845#define YYNSTATES 586
Reid Spencere7c3c602006-11-30 06:36:44 +0000846
847/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
848#define YYUNDEFTOK 2
Reid Spencer71d2ec92006-12-31 06:02:26 +0000849#define YYMAXUTOK 405
Reid Spencere7c3c602006-11-30 06:36:44 +0000850
851#define YYTRANSLATE(YYX) \
852 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
853
854/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
855static const unsigned char yytranslate[] =
856{
857 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
859 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
860 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000861 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000862 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000863 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000864 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
865 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000866 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
Reid Spencere7c3c602006-11-30 06:36:44 +0000867 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000869 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000870 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, 2, 2, 2, 2,
873 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
874 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
876 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
877 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
878 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
879 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
880 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
881 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
882 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
883 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
884 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
885 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
886 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
887 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
888 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
889 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
890 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
891 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
892 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000893 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
Reid Spencer78720742006-12-02 20:21:22 +0000894 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
Reid Spencer229e9362006-12-02 22:14:11 +0000895 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
896 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000897 145, 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +0000898};
899
900#if YYDEBUG
901/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
902 YYRHS. */
903static const unsigned short int yyprhs[] =
904{
905 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
906 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
907 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
908 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000909 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
Reid Spencer229e9362006-12-02 22:14:11 +0000910 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
911 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
Reid Spencer57f28f92006-12-03 07:10:26 +0000912 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
913 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
914 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
915 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
Reid Spencer229e9362006-12-02 22:14:11 +0000916 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
Reid Spencer57f28f92006-12-03 07:10:26 +0000917 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000918 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
919 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
920 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
921 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
922 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
923 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
924 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
925 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
926 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000927 619, 623, 625, 627, 631, 632, 634, 636, 640, 641,
928 643, 645, 647, 649, 651, 653, 655, 657, 659, 663,
929 665, 671, 673, 675, 677, 679, 682, 685, 687, 690,
930 693, 694, 696, 698, 700, 703, 706, 710, 720, 730,
931 739, 754, 756, 758, 765, 771, 774, 781, 789, 791,
932 795, 797, 798, 801, 803, 809, 815, 821, 828, 835,
933 838, 843, 848, 855, 860, 865, 872, 879, 882, 890,
934 892, 895, 896, 898, 899, 903, 910, 914, 921, 924,
935 929, 936
Reid Spencere7c3c602006-11-30 06:36:44 +0000936};
937
938/* YYRHS -- A `-1'-separated list of the rules' RHS. */
939static const short int yyrhs[] =
940{
Reid Spencer71d2ec92006-12-31 06:02:26 +0000941 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
942 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
943 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
944 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
945 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
946 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
947 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
948 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
949 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
950 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
951 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
952 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
953 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
954 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
Reid Spencer57f28f92006-12-03 07:10:26 +0000955 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000956 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
957 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
958 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
959 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
960 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
961 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
962 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
963 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
Reid Spencer57f28f92006-12-03 07:10:26 +0000964 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
965 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000966 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
967 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
968 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
969 -1, 161, 193, 162, -1, 161, 162, -1, 159, 161,
970 193, 162, 160, -1, 159, 161, 162, 160, -1, 192,
971 163, -1, 192, -1, 193, 152, 192, -1, 193, -1,
972 193, 152, 40, -1, 40, -1, -1, 190, 156, 197,
973 158, -1, 190, 156, 158, -1, 190, 164, 30, -1,
974 190, 159, 197, 160, -1, 190, 161, 197, 162, -1,
975 190, 161, 162, -1, 190, 22, -1, 190, 23, -1,
976 190, 222, -1, 190, 196, -1, 190, 24, -1, 175,
977 167, -1, 176, 18, -1, 4, 25, -1, 4, 26,
978 -1, 178, 21, -1, 174, 154, 195, 39, 190, 155,
979 -1, 127, 154, 195, 237, 155, -1, 129, 154, 195,
980 152, 195, 152, 195, 155, -1, 168, 154, 195, 152,
981 195, 155, -1, 169, 154, 195, 152, 195, 155, -1,
982 170, 154, 195, 152, 195, 155, -1, 100, 171, 154,
983 195, 152, 195, 155, -1, 101, 172, 154, 195, 152,
984 195, 155, -1, 173, 154, 195, 152, 195, 155, -1,
985 135, 154, 195, 152, 195, 155, -1, 136, 154, 195,
986 152, 195, 152, 195, 155, -1, 137, 154, 195, 152,
987 195, 152, 195, 155, -1, 197, 152, 195, -1, 195,
988 -1, 35, -1, 36, -1, 200, -1, 200, 217, -1,
989 200, 219, -1, 200, 63, 62, 203, -1, 200, 31,
990 -1, 202, -1, 50, -1, 58, -1, 202, 179, 27,
991 188, -1, 202, 219, -1, 202, 63, 62, 203, -1,
992 202, 179, 180, 198, 195, 186, -1, 202, 179, 201,
993 198, 190, 186, -1, 202, 179, 45, 198, 190, 186,
994 -1, 202, 179, 47, 198, 190, 186, -1, 202, 51,
995 205, -1, 202, 59, 151, 206, -1, -1, 30, -1,
996 56, -1, 55, -1, 53, 151, 204, -1, 54, 151,
997 18, -1, 52, 151, 30, -1, 72, 151, 30, -1,
998 156, 207, 158, -1, 207, 152, 30, -1, 30, -1,
999 -1, 28, -1, 30, -1, 208, -1, -1, 190, 209,
1000 -1, 211, 152, 210, -1, 210, -1, 211, -1, 211,
1001 152, 40, -1, 40, -1, -1, 181, 188, 208, 154,
1002 212, 155, 185, 182, -1, 32, -1, 161, -1, 180,
1003 213, 214, -1, 33, -1, 162, -1, 215, 225, 216,
1004 -1, -1, 45, -1, 47, -1, 34, 218, 213, -1,
1005 -1, 64, -1, 17, -1, 18, -1, 21, -1, 25,
1006 -1, 26, -1, 22, -1, 23, -1, 24, -1, 159,
1007 197, 160, -1, 196, -1, 62, 220, 30, 152, 30,
1008 -1, 166, -1, 208, -1, 222, -1, 221, -1, 190,
1009 223, -1, 225, 226, -1, 226, -1, 227, 229, -1,
1010 227, 231, -1, -1, 29, -1, 78, -1, 77, -1,
1011 73, 224, -1, 73, 3, -1, 74, 15, 223, -1,
1012 74, 4, 223, 152, 15, 223, 152, 15, 223, -1,
1013 75, 177, 223, 152, 15, 223, 156, 230, 158, -1,
1014 75, 177, 223, 152, 15, 223, 156, 158, -1, 179,
1015 76, 181, 188, 223, 154, 234, 155, 39, 15, 223,
1016 228, 15, 223, -1, 228, -1, 79, -1, 230, 177,
1017 221, 152, 15, 223, -1, 177, 221, 152, 15, 223,
1018 -1, 179, 236, -1, 190, 156, 223, 152, 223, 158,
1019 -1, 232, 152, 156, 223, 152, 223, 158, -1, 224,
1020 -1, 233, 152, 224, -1, 233, -1, -1, 61, 60,
1021 -1, 60, -1, 168, 190, 223, 152, 223, -1, 169,
1022 190, 223, 152, 223, -1, 170, 190, 223, 152, 223,
1023 -1, 100, 171, 190, 223, 152, 223, -1, 101, 172,
1024 190, 223, 152, 223, -1, 49, 224, -1, 173, 224,
1025 152, 224, -1, 174, 224, 39, 190, -1, 129, 224,
1026 152, 224, 152, 224, -1, 134, 224, 152, 190, -1,
1027 135, 224, 152, 224, -1, 136, 224, 152, 224, 152,
1028 224, -1, 137, 224, 152, 224, 152, 224, -1, 128,
1029 232, -1, 235, 181, 188, 223, 154, 234, 155, -1,
1030 239, -1, 152, 233, -1, -1, 38, -1, -1, 122,
1031 190, 183, -1, 122, 190, 152, 10, 223, 183, -1,
1032 123, 190, 183, -1, 123, 190, 152, 10, 223, 183,
1033 -1, 124, 224, -1, 238, 125, 190, 223, -1, 238,
1034 126, 224, 152, 190, 223, -1, 127, 190, 223, 237,
1035 -1
Reid Spencere7c3c602006-11-30 06:36:44 +00001036};
1037
1038/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1039static const unsigned short int yyrline[] =
1040{
Reid Spencerf5626a32007-01-01 01:20:41 +00001041 0, 352, 352, 352, 353, 353, 357, 357, 357, 357,
1042 357, 357, 357, 358, 358, 358, 358, 359, 359, 359,
1043 360, 360, 360, 360, 360, 360, 361, 361, 361, 361,
1044 361, 361, 361, 361, 361, 361, 362, 362, 362, 362,
1045 362, 362, 362, 362, 362, 362, 363, 363, 363, 363,
1046 363, 363, 364, 364, 364, 364, 365, 365, 365, 365,
1047 365, 365, 365, 366, 366, 366, 366, 366, 366, 371,
1048 371, 371, 371, 372, 372, 372, 372, 373, 373, 374,
1049 374, 377, 380, 385, 385, 385, 385, 385, 385, 386,
1050 387, 390, 390, 390, 390, 390, 391, 392, 397, 402,
1051 403, 406, 407, 415, 421, 422, 425, 426, 435, 436,
1052 449, 449, 450, 450, 451, 455, 455, 455, 455, 455,
1053 455, 455, 456, 456, 456, 456, 456, 458, 462, 466,
1054 469, 474, 480, 488, 496, 502, 506, 512, 516, 527,
1055 530, 538, 539, 544, 547, 557, 563, 568, 574, 580,
1056 586, 591, 597, 603, 609, 615, 621, 627, 633, 639,
1057 645, 653, 667, 679, 684, 690, 695, 701, 706, 711,
1058 719, 724, 729, 739, 744, 749, 749, 759, 764, 767,
1059 772, 776, 780, 782, 782, 785, 797, 802, 807, 816,
1060 825, 834, 843, 848, 853, 858, 860, 860, 863, 868,
1061 875, 880, 887, 894, 899, 900, 908, 908, 909, 909,
1062 911, 918, 922, 926, 929, 934, 937, 940, 959, 960,
1063 963, 974, 975, 977, 985, 986, 987, 991, 1004, 1005,
1064 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1009, 1010, 1015,
1065 1016, 1025, 1025, 1029, 1035, 1046, 1052, 1055, 1063, 1067,
1066 1072, 1075, 1081, 1081, 1083, 1088, 1093, 1098, 1106, 1113,
1067 1119, 1139, 1144, 1150, 1155, 1163, 1180, 1187, 1195, 1199,
1068 1206, 1207, 1211, 1216, 1219, 1225, 1230, 1236, 1241, 1246,
1069 1251, 1259, 1287, 1292, 1297, 1302, 1307, 1312, 1317, 1334,
1070 1339, 1340, 1344, 1345, 1348, 1355, 1362, 1369, 1376, 1381,
1071 1388, 1395
Reid Spencere7c3c602006-11-30 06:36:44 +00001072};
1073#endif
1074
1075#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1076/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1077 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1078static const char *const yytname[] =
1079{
Reid Spencerf2d55322006-12-01 21:52:30 +00001080 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1081 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1082 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1083 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
Reid Spencere77e35e2006-12-01 20:26:20 +00001084 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
Reid Spencer71d2ec92006-12-31 06:02:26 +00001085 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1086 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1087 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1088 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1089 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1090 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
Reid Spencer78720742006-12-02 20:21:22 +00001091 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1092 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1093 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1094 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
Reid Spencer229e9362006-12-02 22:14:11 +00001095 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1096 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1097 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
Reid Spencer78720742006-12-02 20:21:22 +00001098 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1099 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1100 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1101 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1102 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1103 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
Reid Spencer57f28f92006-12-03 07:10:26 +00001104 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
Reid Spencer229e9362006-12-02 22:14:11 +00001105 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1106 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1107 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1108 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1109 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1110 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1111 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1112 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1113 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1114 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1115 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1116 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1117 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1118 "IndexList", "OptVolatile", "MemoryInst", 0
Reid Spencere7c3c602006-11-30 06:36:44 +00001119};
1120#endif
1121
1122# ifdef YYPRINT
1123/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1124 token YYLEX-NUM. */
1125static const unsigned short int yytoknum[] =
1126{
1127 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1128 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1129 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1130 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1131 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1132 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1133 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1134 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1135 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1136 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1137 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001138 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
Reid Spencer229e9362006-12-02 22:14:11 +00001139 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1140 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1141 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001142 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1143 62, 123, 125, 42, 99
Reid Spencere7c3c602006-11-30 06:36:44 +00001144};
1145# endif
1146
1147/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1148static const unsigned char yyr1[] =
1149{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001150 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1151 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1152 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
Reid Spencer57f28f92006-12-03 07:10:26 +00001153 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001154 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1155 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1156 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1157 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1158 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1159 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1160 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1161 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1162 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1163 192, 192, 192, 192, 192, 192, 192, 192, 192, 193,
1164 193, 194, 194, 194, 194, 195, 195, 195, 195, 195,
1165 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1166 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1167 196, 196, 196, 197, 197, 198, 198, 199, 200, 200,
1168 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1169 202, 202, 202, 202, 202, 203, 204, 204, 205, 205,
1170 205, 205, 206, 207, 207, 207, 208, 208, 209, 209,
1171 210, 211, 211, 212, 212, 212, 212, 213, 214, 214,
1172 215, 216, 216, 217, 218, 218, 218, 219, 220, 220,
1173 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1174 221, 222, 222, 223, 223, 224, 225, 225, 226, 227,
1175 227, 227, 228, 228, 229, 229, 229, 229, 229, 229,
1176 229, 229, 229, 230, 230, 231, 232, 232, 233, 233,
1177 234, 234, 235, 235, 236, 236, 236, 236, 236, 236,
1178 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1179 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1180 239, 239
Reid Spencere7c3c602006-11-30 06:36:44 +00001181};
1182
1183/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1184static const unsigned char yyr2[] =
1185{
1186 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1187 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1188 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1189 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerf7bde222006-12-01 22:26:37 +00001190 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001191 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer229e9362006-12-02 22:14:11 +00001192 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer229e9362006-12-02 22:14:11 +00001193 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer57f28f92006-12-03 07:10:26 +00001194 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1195 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1196 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1197 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1198 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001199 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1200 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1201 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1202 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1203 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1204 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1205 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1206 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1207 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001208 3, 1, 1, 3, 0, 1, 1, 3, 0, 1,
1209 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1210 5, 1, 1, 1, 1, 2, 2, 1, 2, 2,
1211 0, 1, 1, 1, 2, 2, 3, 9, 9, 8,
1212 14, 1, 1, 6, 5, 2, 6, 7, 1, 3,
1213 1, 0, 2, 1, 5, 5, 5, 6, 6, 2,
1214 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1215 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1216 6, 4
Reid Spencere7c3c602006-11-30 06:36:44 +00001217};
1218
1219/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1220 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1221 means the default is an error. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001222static const unsigned short int yydefact[] =
Reid Spencere7c3c602006-11-30 06:36:44 +00001223{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001224 194, 0, 90, 182, 1, 181, 224, 83, 84, 85,
1225 87, 88, 89, 86, 0, 98, 250, 178, 179, 206,
1226 207, 0, 0, 0, 90, 0, 186, 225, 226, 98,
1227 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1228 251, 250, 247, 82, 0, 0, 0, 0, 192, 0,
1229 0, 0, 0, 0, 183, 184, 0, 0, 81, 227,
1230 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1231 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1232 0, 0, 0, 241, 0, 0, 110, 129, 114, 242,
1233 128, 218, 219, 220, 221, 222, 223, 246, 0, 0,
1234 0, 253, 252, 262, 293, 261, 248, 249, 0, 0,
1235 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1236 0, 0, 130, 0, 0, 0, 113, 135, 139, 0,
1237 0, 144, 138, 255, 0, 254, 0, 0, 72, 76,
1238 71, 75, 70, 74, 69, 73, 77, 78, 0, 292,
1239 0, 273, 0, 98, 6, 7, 8, 9, 10, 11,
1240 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1241 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1242 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1243 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1244 65, 66, 67, 0, 0, 0, 0, 0, 98, 265,
1245 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1246 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1247 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1248 0, 0, 0, 0, 134, 216, 143, 141, 0, 230,
1249 231, 232, 235, 236, 237, 233, 234, 228, 0, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001251 0, 239, 244, 243, 245, 0, 256, 0, 279, 272,
1252 0, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1253 35, 0, 50, 51, 36, 37, 38, 39, 40, 41,
1254 42, 43, 44, 45, 46, 47, 48, 49, 0, 101,
1255 101, 298, 0, 0, 287, 0, 0, 0, 0, 0,
1256 0, 0, 0, 0, 0, 0, 0, 0, 0, 202,
1257 0, 190, 191, 158, 159, 4, 5, 156, 157, 160,
1258 151, 152, 155, 0, 0, 0, 0, 154, 153, 188,
1259 189, 112, 112, 137, 0, 140, 215, 209, 212, 213,
1260 0, 0, 131, 229, 0, 0, 0, 0, 0, 0,
1261 0, 0, 174, 0, 0, 0, 0, 0, 0, 0,
1262 0, 0, 0, 0, 0, 294, 0, 296, 291, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001264 0, 0, 0, 0, 203, 0, 0, 108, 106, 146,
1265 0, 0, 150, 0, 147, 132, 133, 136, 208, 210,
1266 0, 104, 142, 0, 0, 0, 291, 0, 0, 0,
1267 0, 0, 238, 0, 0, 0, 0, 0, 0, 0,
1268 0, 0, 0, 0, 0, 0, 0, 301, 0, 0,
1269 0, 283, 284, 0, 0, 0, 0, 0, 280, 281,
1270 0, 299, 0, 103, 109, 107, 145, 148, 149, 214,
1271 211, 105, 99, 0, 0, 0, 0, 0, 0, 0,
1272 0, 173, 0, 0, 0, 0, 0, 0, 0, 271,
1273 0, 0, 101, 102, 101, 268, 290, 0, 0, 0,
1274 0, 0, 274, 275, 276, 271, 0, 0, 217, 240,
1275 0, 0, 162, 0, 0, 0, 0, 0, 0, 0,
1276 0, 0, 0, 0, 270, 0, 277, 278, 0, 295,
1277 297, 0, 0, 0, 282, 285, 286, 0, 300, 100,
1278 0, 0, 0, 170, 0, 0, 164, 165, 166, 169,
1279 161, 0, 259, 0, 0, 0, 269, 266, 0, 288,
1280 167, 168, 0, 0, 0, 257, 0, 258, 0, 0,
1281 267, 163, 171, 172, 0, 0, 0, 0, 0, 0,
1282 264, 0, 0, 263, 0, 260
Reid Spencere7c3c602006-11-30 06:36:44 +00001283};
1284
1285/* YYDEFGOTO[NTERM-NUM]. */
1286static const short int yydefgoto[] =
1287{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001288 -1, 83, 337, 266, 267, 268, 291, 308, 269, 270,
1289 233, 234, 148, 235, 24, 15, 38, 508, 385, 407,
1290 472, 331, 408, 84, 85, 236, 87, 88, 129, 248,
1291 372, 271, 373, 118, 1, 2, 57, 3, 61, 215,
1292 48, 113, 219, 89, 419, 358, 359, 360, 39, 93,
1293 16, 96, 17, 29, 18, 364, 272, 90, 274, 495,
1294 41, 42, 43, 105, 106, 554, 107, 314, 524, 525,
1295 208, 209, 447, 210, 211
Reid Spencere7c3c602006-11-30 06:36:44 +00001296};
1297
1298/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1299 STATE-NUM. */
Reid Spencer71d2ec92006-12-31 06:02:26 +00001300#define YYPACT_NINF -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001301static const short int yypact[] =
1302{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001303 -513, 46, 217, 541, -513, -513, 82, -513, -513, -513,
1304 -513, -513, -513, -513, 16, 111, 25, -513, -513, -513,
1305 -513, 34, -55, 61, 26, -23, -513, -513, -513, 111,
1306 132, 146, -513, -513, -513, -513, -513, -513, 873, -26,
1307 -513, -18, -513, 47, 19, 23, 39, 67, -513, 77,
1308 132, 873, 81, 81, -513, -513, 81, 81, -513, -513,
1309 -513, -513, -513, 86, -513, -513, -513, -513, -513, -513,
1310 -513, -513, -513, -513, -513, -513, -513, -513, -513, 223,
1311 225, -9, 506, -513, 133, 91, -513, -513, -111, -513,
1312 -513, -513, -513, -513, -513, -513, -513, -513, 901, 36,
1313 148, -513, -513, -513, 1336, -513, -513, -513, 219, 76,
1314 229, 222, 224, -513, -513, -513, -513, -513, 933, 933,
1315 963, 933, -513, 98, 100, 614, -513, -513, -111, -104,
1316 104, 216, -513, 86, 1134, -513, 1134, 1134, -513, -513,
1317 -513, -513, -513, -513, -513, -513, -513, -513, 1134, -513,
1318 933, -513, 206, 111, -513, -513, -513, -513, -513, -513,
1319 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1320 -513, -513, -513, -513, 195, 84, 933, 933, 933, 933,
1321 933, 933, -513, -513, -513, -513, 933, 933, 933, 933,
1322 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1323 -513, -513, -513, 933, 933, 933, 933, 933, 111, -513,
1324 11, -513, -513, -513, -513, -513, -513, -513, -513, -93,
1325 115, 115, 121, 166, 250, 169, 251, 191, 253, 193,
1326 254, 252, 257, 220, 256, 260, 1045, 115, 115, 933,
1327 933, 122, -73, 933, -513, 701, -513, 134, 129, -513,
1328 -513, -513, -513, -513, -513, -513, -513, 221, 195, 84,
1329 136, 137, 138, 140, 150, 963, 154, 156, 158, 167,
1330 168, -513, -513, -513, -513, 171, -513, 172, -513, -513,
1331 873, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1332 -513, 933, -513, -513, -513, -513, -513, -513, -513, -513,
1333 -513, -513, -513, -513, -513, -513, -513, -513, 933, 173,
1334 174, -513, 1134, 164, 175, 176, 177, 178, 179, 182,
1335 1134, 1134, 1134, 183, 297, 873, 933, 933, 308, -513,
1336 -8, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1337 -513, -513, -513, 741, 963, 673, 310, -513, -513, -513,
1338 -513, -113, -99, -513, 181, -111, -513, 133, -513, 190,
1339 189, 774, -513, -513, 315, 192, 194, 963, 963, 963,
1340 963, 963, -513, -58, 963, 963, 963, 963, 963, 332,
1341 337, 1134, 1134, 1134, -2, -513, 9, -513, 207, 1134,
1342 204, 933, 933, 933, 933, 933, 211, 212, 213, 933,
1343 933, 1134, 1134, 214, -513, 338, 349, -513, 115, -513,
1344 -61, -57, -513, -70, -513, -513, -513, -513, -513, -513,
1345 833, 333, -513, 231, 963, 963, 207, 235, 236, 237,
1346 238, 963, -513, 240, 241, 242, 243, 334, 1134, 1134,
1347 227, 244, 245, 1134, 353, 1134, 933, -513, 249, 1134,
1348 255, -513, -513, 258, 262, 1134, 1134, 1134, -513, -513,
1349 248, -513, 933, -513, -513, -513, -513, -513, -513, -513,
1350 -513, -513, 317, 346, 263, 264, 265, 963, 963, 963,
1351 963, -513, 963, 963, 963, 963, 933, 266, 247, 933,
1352 1134, 1134, 267, -513, 267, -513, 269, 1134, 270, 933,
1353 933, 933, -513, -513, -513, 933, 1134, 386, -513, -513,
1354 963, 963, -513, 271, 273, 277, 278, 276, 279, 282,
1355 283, 284, 390, 15, 269, 286, -513, -513, 352, -513,
1356 -513, 933, 259, 1134, -513, -513, -513, 289, -513, -513,
1357 292, 294, 963, -513, 963, 963, -513, -513, -513, -513,
1358 -513, 1134, -513, 1223, 27, 367, -513, -513, 274, -513,
1359 -513, -513, 295, 300, 303, -513, 281, -513, 1223, 444,
1360 -513, -513, -513, -513, 445, 312, 1134, 1134, 450, 135,
1361 -513, 1134, 451, -513, 1134, -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001362};
1363
1364/* YYPGOTO[NTERM-NUM]. */
1365static const short int yypgoto[] =
1366{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001367 -513, -513, -513, 364, 365, 368, 215, 218, 370, 372,
1368 -98, -97, -507, -513, 436, 456, -141, -513, -303, 60,
1369 -513, -220, -513, -46, -513, -38, -513, -68, -20, -513,
1370 130, 246, -230, 51, -513, -513, -513, -513, 433, -513,
1371 -513, -513, -513, 1, -513, 64, -513, -513, 457, -513,
1372 -513, -513, -513, -513, 482, -513, -512, -106, -3, -88,
1373 -513, 448, -513, -89, -513, -513, -513, -513, 45, -13,
1374 -513, -513, 69, -513, -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001375};
1376
1377/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1378 positive, shift that token. If negative, reduce the rule which
1379 number is the opposite. If zero, do what YYDEFACT says.
1380 If YYTABLE_NINF, syntax error. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001381#define YYTABLE_NINF -178
Reid Spencere7c3c602006-11-30 06:36:44 +00001382static const short int yytable[] =
1383{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001384 86, 332, 146, 147, 25, 115, 91, 387, 443, 124,
1385 135, 40, 280, 86, 128, 94, 553, 349, 350, 445,
1386 138, 139, 140, 141, 142, 143, 144, 145, 273, 405,
1387 273, 273, 138, 139, 140, 141, 142, 143, 144, 145,
1388 136, 566, 273, -112, 25, 415, 4, 568, 243, 406,
1389 132, 137, 132, 51, 40, 444, 575, 128, 244, 328,
1390 134, 416, 278, 128, 132, 329, 444, 325, 7, 8,
1391 9, 52, 11, 53, 13, 19, 54, 20, 30, 243,
1392 220, 221, 431, 238, 55, 130, 44, 45, 46, 354,
1393 311, 431, 468, 315, 431, 431, 49, 466, 316, 317,
1394 318, 319, 432, 467, 119, 242, 47, 120, 121, 292,
1395 293, 247, 134, 410, 411, 413, 116, 117, 323, 324,
1396 98, 99, 100, 50, 101, 102, 103, 27, 58, 28,
1397 348, 213, 214, 275, 276, 92, 326, 327, 309, 310,
1398 134, 312, 313, 134, 95, 277, 333, 334, 134, 134,
1399 134, 134, 125, 138, 139, 140, 141, 142, 143, 144,
1400 145, 19, 60, 20, 62, 320, 321, 322, 134, 134,
1401 108, 351, 352, 552, 109, 355, 31, 32, 33, 34,
1402 35, 36, 37, -72, -72, 567, -71, -71, 465, 529,
1403 110, 530, 294, 295, 296, 297, 298, 299, 300, 301,
1404 302, 303, 304, 305, 306, 307, 273, 357, -70, -70,
1405 -69, -69, 101, 102, 273, 273, 273, -177, 111, 126,
1406 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1407 74, 75, 76, 112, 381, 77, 78, 335, 336, 403,
1408 -113, 122, 86, 123, 19, 131, 20, 216, 5, 212,
1409 237, 6, 217, 382, 218, 239, 246, 240, 245, 7,
1410 8, 9, 10, 11, 12, 13, 279, 330, -76, -75,
1411 383, -74, -73, -79, 338, 273, 273, 273, -80, 401,
1412 14, 339, 353, 273, 362, 363, 361, 86, 402, 134,
1413 367, 368, 369, 355, 370, 273, 273, 281, 282, 283,
1414 284, 285, 286, 450, 371, 452, 453, 454, 374, 388,
1415 375, 458, 376, 287, 288, 289, 290, 396, 397, 398,
1416 389, 377, 378, 379, 380, 384, 386, 390, 391, 392,
1417 393, 394, 273, 273, 395, 399, 400, 273, 404, 273,
1418 414, 417, 420, 273, 421, 423, 424, 438, 425, 273,
1419 273, 273, 439, 134, 451, 134, 134, 134, 418, 446,
1420 449, 134, 459, 455, 456, 457, 462, 464, 463, 79,
1421 405, 493, 80, 486, 507, 81, 509, 82, 440, 441,
1422 442, 489, 357, 473, 273, 273, 448, 477, 478, 479,
1423 480, 273, 482, 483, 484, 485, 490, 491, 460, 461,
1424 273, 497, 505, 523, 539, 551, 569, 499, 134, 444,
1425 500, 534, 535, 536, 501, 510, 511, 557, 522, 528,
1426 512, 531, 533, 542, 506, 146, 147, 273, 543, 544,
1427 545, 546, 570, 574, 547, 487, 488, 548, 549, 550,
1428 492, 555, 494, 556, 559, 273, 498, 560, 521, 561,
1429 571, 134, 502, 503, 504, 572, 146, 147, 573, 576,
1430 577, 134, 134, 134, 578, 581, 584, 134, 203, 204,
1431 273, 273, 205, 365, 206, 273, 207, 366, 273, 104,
1432 56, 471, 347, 114, 470, 26, 59, 526, 527, 97,
1433 582, 496, 537, 134, 532, 476, 0, 426, 427, 428,
1434 429, 430, 0, 538, 433, 434, 435, 436, 437, 126,
1435 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1436 74, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1437 558, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1438 0, 0, 0, 0, 0, 0, 0, 0, 565, 0,
1439 0, 0, 0, 0, 474, 475, 0, 0, 0, 0,
1440 0, 481, 0, 0, 0, 0, 0, 0, -82, 19,
1441 0, 20, 0, 579, 580, 6, -82, -82, 583, 0,
1442 0, 585, 0, -82, -82, -82, -82, -82, -82, -82,
1443 0, -82, 21, 0, 0, 0, 0, 0, 0, -82,
1444 22, 0, 0, 0, 23, 0, 0, 513, 514, 515,
1445 516, 0, 517, 518, 519, 520, 0, 126, 64, 65,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001446 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001447 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1448 540, 541, 19, 0, 20, 0, 0, 0, 0, 0,
1449 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
1450 0, 0, 80, 0, 0, 81, 0, 82, 127, 0,
1451 0, 0, 562, 0, 563, 564, 126, 222, 223, 224,
1452 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1453 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1454 0, 19, 0, 20, 126, 64, 65, 66, 67, 68,
1455 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1456 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1457 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1458 0, 356, 0, 0, 126, 222, 223, 224, 225, 226,
1459 227, 228, 229, 230, 231, 232, 75, 76, 0, 0,
1460 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1461 80, 20, 0, 81, 0, 82, 241, 126, 64, 65,
1462 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1463 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1464 0, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1465 0, 0, 0, 0, 422, 0, 0, 0, 0, 0,
1466 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1467 0, 0, 81, 0, 82, 412, 126, 64, 65, 66,
1468 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1469 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
1470 81, 19, 82, 20, 0, 0, 0, 0, 0, 0,
1471 0, 0, 0, 469, 0, 0, 63, 64, 65, 66,
1472 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1473 0, 0, 77, 78, 79, 0, 0, 80, 0, 409,
1474 81, 19, 82, 20, 133, 64, 65, 66, 67, 68,
1475 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1476 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1477 80, 20, 0, 81, 0, 82, 126, 64, 65, 66,
1478 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1479 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1480 0, 19, 0, 20, 0, 0, 126, 222, 223, 224,
1481 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1482 0, 0, 77, 78, 0, 0, 79, 0, 0, 80,
1483 0, 19, 81, 20, 82, 0, 0, 0, 0, 0,
Reid Spencer57f28f92006-12-03 07:10:26 +00001484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1485 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001486 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1487 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1489 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
1490 81, 0, 82, 0, 77, 78, 0, 340, 341, 342,
1491 0, 0, 0, 19, 0, 20, 0, 0, 0, 0,
1492 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1493 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1495 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1496 0, 0, 81, 0, 82, 154, 155, 156, 157, 158,
1497 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1498 169, 170, 171, 172, 173, 258, 259, 0, 0, 0,
1499 0, 249, 250, 77, 78, 251, 252, 253, 254, 255,
1500 256, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1501 0, 0, 260, 0, 261, 182, 183, 184, 185, 0,
1502 262, 263, 264, 190, 191, 192, 193, 194, 195, 196,
1503 197, 198, 199, 200, 201, 202, 257, 0, 0, 0,
1504 0, 343, 0, 0, 344, 0, 345, 0, 0, 346,
1505 0, 0, 0, 0, 154, 155, 156, 157, 158, 159,
1506 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1507 170, 171, 172, 173, 258, 259, 0, 0, 0, 0,
1508 249, 250, 0, 0, 251, 252, 253, 254, 255, 256,
1509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1510 0, 260, 0, 261, 182, 183, 184, 185, 0, 262,
1511 263, 264, 190, 191, 192, 193, 194, 195, 196, 197,
1512 198, 199, 200, 201, 202, 257, 0, 0, 0, 0,
1513 0, 0, 0, 265, 0, 0, 0, 0, 0, 0,
1514 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
1515 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1516 171, 172, 173, 258, 259, 0, 0, 0, 0, 0,
Reid Spencerf2d55322006-12-01 21:52:30 +00001517 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001518 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001519 260, 0, 261, 182, 183, 184, 185, 0, 262, 263,
1520 264, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1521 199, 200, 201, 202, 149, 0, 0, 0, 0, 0,
1522 0, 0, 265, 0, 0, 150, 0, 0, 0, 0,
1523 0, 0, 0, 0, 0, 0, 151, 152, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001524 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001525 0, 0, 153, 0, 0, 0, 154, 155, 156, 157,
1526 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
1527 168, 169, 170, 171, 172, 173, 174, 175, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001528 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001529 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
1530 178, 0, 0, 179, 180, 181, 182, 183, 184, 185,
1531 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
1532 196, 197, 198, 199, 200, 201, 202
Reid Spencere7c3c602006-11-30 06:36:44 +00001533};
1534
1535static const short int yycheck[] =
1536{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001537 38, 221, 100, 100, 3, 51, 32, 310, 10, 18,
1538 98, 29, 153, 51, 82, 33, 523, 237, 238, 10,
1539 5, 6, 7, 8, 9, 10, 11, 12, 134, 37,
1540 136, 137, 5, 6, 7, 8, 9, 10, 11, 12,
1541 4, 553, 148, 154, 43, 158, 0, 554, 152, 57,
1542 163, 15, 163, 27, 29, 57, 568, 125, 162, 152,
1543 98, 160, 150, 131, 163, 158, 57, 208, 42, 43,
1544 44, 45, 46, 47, 48, 28, 50, 30, 62, 152,
1545 118, 119, 152, 121, 58, 84, 52, 53, 54, 162,
1546 178, 152, 162, 181, 152, 152, 151, 158, 186, 187,
1547 188, 189, 160, 160, 53, 125, 72, 56, 57, 25,
1548 26, 131, 150, 343, 344, 345, 35, 36, 206, 207,
1549 73, 74, 75, 62, 77, 78, 79, 45, 151, 47,
1550 236, 55, 56, 136, 137, 161, 125, 126, 176, 177,
1551 178, 179, 180, 181, 162, 148, 25, 26, 186, 187,
1552 188, 189, 161, 5, 6, 7, 8, 9, 10, 11,
1553 12, 28, 30, 30, 18, 203, 204, 205, 206, 207,
1554 151, 239, 240, 158, 151, 243, 65, 66, 67, 68,
1555 69, 70, 71, 17, 18, 158, 17, 18, 408, 492,
1556 151, 494, 108, 109, 110, 111, 112, 113, 114, 115,
1557 116, 117, 118, 119, 120, 121, 312, 245, 17, 18,
1558 17, 18, 77, 78, 320, 321, 322, 0, 151, 3,
1559 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1560 14, 15, 16, 156, 280, 19, 20, 17, 18, 327,
1561 154, 18, 280, 18, 28, 154, 30, 18, 31, 30,
1562 120, 34, 30, 291, 30, 157, 40, 157, 154, 42,
1563 43, 44, 45, 46, 47, 48, 60, 152, 18, 18,
1564 308, 18, 18, 21, 18, 381, 382, 383, 21, 325,
1565 63, 21, 160, 389, 155, 64, 152, 325, 326, 327,
1566 154, 154, 154, 361, 154, 401, 402, 102, 103, 104,
1567 105, 106, 107, 391, 154, 393, 394, 395, 154, 312,
1568 154, 399, 154, 118, 119, 120, 121, 320, 321, 322,
1569 156, 154, 154, 152, 152, 152, 152, 152, 152, 152,
1570 152, 152, 438, 439, 152, 152, 39, 443, 30, 445,
1571 30, 160, 152, 449, 155, 30, 154, 15, 154, 455,
1572 456, 457, 15, 391, 392, 393, 394, 395, 357, 152,
1573 156, 399, 400, 152, 152, 152, 152, 18, 30, 153,
1574 37, 18, 156, 39, 57, 159, 30, 161, 381, 382,
1575 383, 154, 420, 152, 490, 491, 389, 152, 152, 152,
1576 152, 497, 152, 152, 152, 152, 152, 152, 401, 402,
1577 506, 152, 154, 156, 18, 15, 39, 152, 446, 57,
1578 152, 499, 500, 501, 152, 152, 152, 158, 152, 152,
1579 155, 152, 152, 152, 462, 523, 523, 533, 155, 152,
1580 152, 155, 158, 152, 155, 438, 439, 155, 155, 155,
1581 443, 155, 445, 531, 155, 551, 449, 155, 486, 155,
1582 155, 489, 455, 456, 457, 155, 554, 554, 155, 15,
1583 15, 499, 500, 501, 152, 15, 15, 505, 104, 104,
1584 576, 577, 104, 258, 104, 581, 104, 259, 584, 43,
1585 24, 421, 236, 50, 420, 3, 29, 490, 491, 41,
1586 579, 446, 505, 531, 497, 426, -1, 367, 368, 369,
1587 370, 371, -1, 506, 374, 375, 376, 377, 378, 3,
Reid Spencer57f28f92006-12-03 07:10:26 +00001588 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1589 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001590 533, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1591 -1, -1, -1, -1, -1, -1, -1, -1, 551, -1,
1592 -1, -1, -1, -1, 424, 425, -1, -1, -1, -1,
1593 -1, 431, -1, -1, -1, -1, -1, -1, 27, 28,
1594 -1, 30, -1, 576, 577, 34, 35, 36, 581, -1,
1595 -1, 584, -1, 42, 43, 44, 45, 46, 47, 48,
1596 -1, 50, 51, -1, -1, -1, -1, -1, -1, 58,
1597 59, -1, -1, -1, 63, -1, -1, 477, 478, 479,
1598 480, -1, 482, 483, 484, 485, -1, 3, 4, 5,
1599 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1600 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1601 510, 511, 28, -1, 30, -1, -1, -1, -1, -1,
1602 -1, -1, -1, -1, -1, -1, -1, -1, -1, 153,
1603 -1, -1, 156, -1, -1, 159, -1, 161, 162, -1,
1604 -1, -1, 542, -1, 544, 545, 3, 4, 5, 6,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001605 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1606 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001607 -1, 28, -1, 30, 3, 4, 5, 6, 7, 8,
1608 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1609 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001610 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001611 -1, 40, -1, -1, 3, 4, 5, 6, 7, 8,
1612 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1613 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
1614 156, 30, -1, 159, -1, 161, 162, 3, 4, 5,
1615 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1616 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1617 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1618 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
1619 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1620 -1, -1, 159, -1, 161, 162, 3, 4, 5, 6,
1621 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1622 -1, -1, 19, 20, 153, -1, -1, 156, -1, -1,
1623 159, 28, 161, 30, -1, -1, -1, -1, -1, -1,
1624 -1, -1, -1, 40, -1, -1, 3, 4, 5, 6,
1625 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1626 -1, -1, 19, 20, 153, -1, -1, 156, -1, 158,
1627 159, 28, 161, 30, 3, 4, 5, 6, 7, 8,
1628 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1629 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
1630 156, 30, -1, 159, -1, 161, 3, 4, 5, 6,
1631 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1632 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1633 -1, 28, -1, 30, -1, -1, 3, 4, 5, 6,
1634 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1635 -1, -1, 19, 20, -1, -1, 153, -1, -1, 156,
1636 -1, 28, 159, 30, 161, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1638 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001639 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1640 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001642 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
1643 159, -1, 161, -1, 19, 20, -1, 22, 23, 24,
1644 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1645 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1646 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001647 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001648 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1649 -1, -1, 159, -1, 161, 80, 81, 82, 83, 84,
1650 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1651 95, 96, 97, 98, 99, 100, 101, -1, -1, -1,
1652 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1653 26, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1654 -1, -1, 127, -1, 129, 130, 131, 132, 133, -1,
1655 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1656 145, 146, 147, 148, 149, 150, 62, -1, -1, -1,
1657 -1, 156, -1, -1, 159, -1, 161, -1, -1, 164,
1658 -1, -1, -1, -1, 80, 81, 82, 83, 84, 85,
1659 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1660 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
1661 17, 18, -1, -1, 21, 22, 23, 24, 25, 26,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001663 -1, 127, -1, 129, 130, 131, 132, 133, -1, 135,
1664 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
1665 146, 147, 148, 149, 150, 62, -1, -1, -1, -1,
1666 -1, -1, -1, 159, -1, -1, -1, -1, -1, -1,
1667 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001668 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001669 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001671 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1672 127, -1, 129, 130, 131, 132, 133, -1, 135, 136,
Reid Spencer57f28f92006-12-03 07:10:26 +00001673 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001674 147, 148, 149, 150, 38, -1, -1, -1, -1, -1,
1675 -1, -1, 159, -1, -1, 49, -1, -1, -1, -1,
1676 -1, -1, -1, -1, -1, -1, 60, 61, -1, -1,
1677 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1678 -1, -1, 76, -1, -1, -1, 80, 81, 82, 83,
1679 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
1680 94, 95, 96, 97, 98, 99, 100, 101, -1, -1,
1681 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1682 -1, -1, -1, -1, -1, -1, -1, -1, 122, 123,
1683 124, -1, -1, 127, 128, 129, 130, 131, 132, 133,
1684 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
1685 144, 145, 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +00001686};
1687
1688/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1689 symbol of state STATE-NUM. */
1690static const unsigned char yystos[] =
1691{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001692 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
1693 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
1694 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
1695 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
1696 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
1697 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
1698 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
1699 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
1700 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
1701 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
1702 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
1703 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
1704 198, 198, 18, 18, 18, 161, 3, 162, 192, 193,
1705 208, 154, 163, 3, 190, 224, 4, 15, 5, 6,
1706 7, 8, 9, 10, 11, 12, 175, 176, 177, 38,
1707 49, 60, 61, 76, 80, 81, 82, 83, 84, 85,
1708 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1709 96, 97, 98, 99, 100, 101, 122, 123, 124, 127,
1710 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1711 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1712 148, 149, 150, 168, 169, 170, 173, 174, 235, 236,
1713 238, 239, 30, 55, 56, 204, 18, 30, 30, 207,
1714 190, 190, 4, 5, 6, 7, 8, 9, 10, 11,
1715 12, 13, 14, 175, 176, 178, 190, 195, 190, 157,
1716 157, 162, 193, 152, 162, 154, 40, 193, 194, 17,
1717 18, 21, 22, 23, 24, 25, 26, 62, 100, 101,
1718 127, 129, 135, 136, 137, 159, 168, 169, 170, 173,
1719 174, 196, 221, 222, 223, 223, 223, 223, 224, 60,
1720 181, 102, 103, 104, 105, 106, 107, 118, 119, 120,
1721 121, 171, 25, 26, 108, 109, 110, 111, 112, 113,
1722 114, 115, 116, 117, 118, 119, 120, 121, 172, 190,
1723 190, 224, 190, 190, 232, 224, 224, 224, 224, 224,
1724 190, 190, 190, 224, 224, 181, 125, 126, 152, 158,
1725 152, 186, 186, 25, 26, 17, 18, 167, 18, 21,
1726 22, 23, 24, 156, 159, 161, 164, 196, 222, 186,
1727 186, 192, 192, 160, 162, 192, 40, 190, 210, 211,
1728 212, 152, 155, 64, 220, 171, 172, 154, 154, 154,
1729 154, 154, 195, 197, 154, 154, 154, 154, 154, 152,
1730 152, 188, 190, 190, 152, 183, 152, 183, 223, 156,
1731 152, 152, 152, 152, 152, 152, 223, 223, 223, 152,
1732 39, 188, 190, 224, 30, 37, 57, 184, 187, 158,
1733 197, 197, 162, 197, 30, 158, 160, 160, 208, 209,
1734 152, 155, 40, 30, 154, 154, 195, 195, 195, 195,
1735 195, 152, 160, 195, 195, 195, 195, 195, 15, 15,
1736 223, 223, 223, 10, 57, 10, 152, 237, 223, 156,
1737 224, 190, 224, 224, 224, 152, 152, 152, 224, 190,
1738 223, 223, 152, 30, 18, 186, 158, 160, 162, 40,
1739 210, 184, 185, 152, 195, 195, 237, 152, 152, 152,
1740 152, 195, 152, 152, 152, 152, 39, 223, 223, 154,
1741 152, 152, 223, 18, 223, 224, 233, 152, 223, 152,
1742 152, 152, 223, 223, 223, 154, 190, 57, 182, 30,
1743 152, 152, 155, 195, 195, 195, 195, 195, 195, 195,
1744 195, 190, 152, 156, 233, 234, 223, 223, 152, 183,
1745 183, 152, 223, 152, 224, 224, 224, 234, 223, 18,
1746 195, 195, 152, 155, 152, 152, 155, 155, 155, 155,
1747 155, 15, 158, 177, 230, 155, 224, 158, 223, 155,
1748 155, 155, 195, 195, 195, 223, 221, 158, 177, 39,
1749 158, 155, 155, 155, 152, 221, 15, 15, 152, 223,
1750 223, 15, 228, 223, 15, 223
Reid Spencere7c3c602006-11-30 06:36:44 +00001751};
1752
1753#define yyerrok (yyerrstatus = 0)
1754#define yyclearin (yychar = YYEMPTY)
1755#define YYEMPTY (-2)
1756#define YYEOF 0
1757
1758#define YYACCEPT goto yyacceptlab
1759#define YYABORT goto yyabortlab
1760#define YYERROR goto yyerrorlab
1761
1762
1763/* Like YYERROR except do call yyerror. This remains here temporarily
1764 to ease the transition to the new meaning of YYERROR, for GCC.
1765 Once GCC version 2 has supplanted version 1, this can go. */
1766
1767#define YYFAIL goto yyerrlab
1768
1769#define YYRECOVERING() (!!yyerrstatus)
1770
1771#define YYBACKUP(Token, Value) \
1772do \
1773 if (yychar == YYEMPTY && yylen == 1) \
1774 { \
1775 yychar = (Token); \
1776 yylval = (Value); \
1777 yytoken = YYTRANSLATE (yychar); \
1778 YYPOPSTACK; \
1779 goto yybackup; \
1780 } \
1781 else \
1782 { \
1783 yyerror (YY_("syntax error: cannot back up")); \
1784 YYERROR; \
1785 } \
1786while (0)
1787
1788
1789#define YYTERROR 1
1790#define YYERRCODE 256
1791
1792
1793/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1794 If N is 0, then set CURRENT to the empty location which ends
1795 the previous symbol: RHS[0] (always defined). */
1796
1797#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1798#ifndef YYLLOC_DEFAULT
1799# define YYLLOC_DEFAULT(Current, Rhs, N) \
1800 do \
1801 if (N) \
1802 { \
1803 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1804 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1805 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1806 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1807 } \
1808 else \
1809 { \
1810 (Current).first_line = (Current).last_line = \
1811 YYRHSLOC (Rhs, 0).last_line; \
1812 (Current).first_column = (Current).last_column = \
1813 YYRHSLOC (Rhs, 0).last_column; \
1814 } \
1815 while (0)
1816#endif
1817
1818
1819/* YY_LOCATION_PRINT -- Print the location on the stream.
1820 This macro was not mandated originally: define only if we know
1821 we won't break user code: when these are the locations we know. */
1822
1823#ifndef YY_LOCATION_PRINT
1824# if YYLTYPE_IS_TRIVIAL
1825# define YY_LOCATION_PRINT(File, Loc) \
1826 fprintf (File, "%d.%d-%d.%d", \
1827 (Loc).first_line, (Loc).first_column, \
1828 (Loc).last_line, (Loc).last_column)
1829# else
1830# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1831# endif
1832#endif
1833
1834
1835/* YYLEX -- calling `yylex' with the right arguments. */
1836
1837#ifdef YYLEX_PARAM
1838# define YYLEX yylex (YYLEX_PARAM)
1839#else
1840# define YYLEX yylex ()
1841#endif
1842
1843/* Enable debugging if requested. */
1844#if YYDEBUG
1845
1846# ifndef YYFPRINTF
1847# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1848# define YYFPRINTF fprintf
1849# endif
1850
1851# define YYDPRINTF(Args) \
1852do { \
1853 if (yydebug) \
1854 YYFPRINTF Args; \
1855} while (0)
1856
1857# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1858do { \
1859 if (yydebug) \
1860 { \
1861 YYFPRINTF (stderr, "%s ", Title); \
1862 yysymprint (stderr, \
1863 Type, Value); \
1864 YYFPRINTF (stderr, "\n"); \
1865 } \
1866} while (0)
1867
1868/*------------------------------------------------------------------.
1869| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1870| TOP (included). |
1871`------------------------------------------------------------------*/
1872
1873#if defined (__STDC__) || defined (__cplusplus)
1874static void
1875yy_stack_print (short int *bottom, short int *top)
1876#else
1877static void
1878yy_stack_print (bottom, top)
1879 short int *bottom;
1880 short int *top;
1881#endif
1882{
1883 YYFPRINTF (stderr, "Stack now");
1884 for (/* Nothing. */; bottom <= top; ++bottom)
1885 YYFPRINTF (stderr, " %d", *bottom);
1886 YYFPRINTF (stderr, "\n");
1887}
1888
1889# define YY_STACK_PRINT(Bottom, Top) \
1890do { \
1891 if (yydebug) \
1892 yy_stack_print ((Bottom), (Top)); \
1893} while (0)
1894
1895
1896/*------------------------------------------------.
1897| Report that the YYRULE is going to be reduced. |
1898`------------------------------------------------*/
1899
1900#if defined (__STDC__) || defined (__cplusplus)
1901static void
1902yy_reduce_print (int yyrule)
1903#else
1904static void
1905yy_reduce_print (yyrule)
1906 int yyrule;
1907#endif
1908{
1909 int yyi;
1910 unsigned long int yylno = yyrline[yyrule];
1911 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1912 yyrule - 1, yylno);
1913 /* Print the symbols being reduced, and their result. */
1914 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1915 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1916 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1917}
1918
1919# define YY_REDUCE_PRINT(Rule) \
1920do { \
1921 if (yydebug) \
1922 yy_reduce_print (Rule); \
1923} while (0)
1924
1925/* Nonzero means print parse trace. It is left uninitialized so that
1926 multiple parsers can coexist. */
1927int yydebug;
1928#else /* !YYDEBUG */
1929# define YYDPRINTF(Args)
1930# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1931# define YY_STACK_PRINT(Bottom, Top)
1932# define YY_REDUCE_PRINT(Rule)
1933#endif /* !YYDEBUG */
1934
1935
1936/* YYINITDEPTH -- initial size of the parser's stacks. */
1937#ifndef YYINITDEPTH
1938# define YYINITDEPTH 200
1939#endif
1940
1941/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1942 if the built-in stack extension method is used).
1943
1944 Do not make this value too large; the results are undefined if
1945 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1946 evaluated with infinite-precision integer arithmetic. */
1947
1948#ifndef YYMAXDEPTH
1949# define YYMAXDEPTH 10000
1950#endif
1951
1952
1953
1954#if YYERROR_VERBOSE
1955
1956# ifndef yystrlen
1957# if defined (__GLIBC__) && defined (_STRING_H)
1958# define yystrlen strlen
1959# else
1960/* Return the length of YYSTR. */
1961static YYSIZE_T
1962# if defined (__STDC__) || defined (__cplusplus)
1963yystrlen (const char *yystr)
1964# else
1965yystrlen (yystr)
1966 const char *yystr;
1967# endif
1968{
1969 const char *yys = yystr;
1970
1971 while (*yys++ != '\0')
1972 continue;
1973
1974 return yys - yystr - 1;
1975}
1976# endif
1977# endif
1978
1979# ifndef yystpcpy
1980# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1981# define yystpcpy stpcpy
1982# else
1983/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1984 YYDEST. */
1985static char *
1986# if defined (__STDC__) || defined (__cplusplus)
1987yystpcpy (char *yydest, const char *yysrc)
1988# else
1989yystpcpy (yydest, yysrc)
1990 char *yydest;
1991 const char *yysrc;
1992# endif
1993{
1994 char *yyd = yydest;
1995 const char *yys = yysrc;
1996
1997 while ((*yyd++ = *yys++) != '\0')
1998 continue;
1999
2000 return yyd - 1;
2001}
2002# endif
2003# endif
2004
2005# ifndef yytnamerr
2006/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2007 quotes and backslashes, so that it's suitable for yyerror. The
2008 heuristic is that double-quoting is unnecessary unless the string
2009 contains an apostrophe, a comma, or backslash (other than
2010 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2011 null, do not copy; instead, return the length of what the result
2012 would have been. */
2013static YYSIZE_T
2014yytnamerr (char *yyres, const char *yystr)
2015{
2016 if (*yystr == '"')
2017 {
2018 size_t yyn = 0;
2019 char const *yyp = yystr;
2020
2021 for (;;)
2022 switch (*++yyp)
2023 {
2024 case '\'':
2025 case ',':
2026 goto do_not_strip_quotes;
2027
2028 case '\\':
2029 if (*++yyp != '\\')
2030 goto do_not_strip_quotes;
2031 /* Fall through. */
2032 default:
2033 if (yyres)
2034 yyres[yyn] = *yyp;
2035 yyn++;
2036 break;
2037
2038 case '"':
2039 if (yyres)
2040 yyres[yyn] = '\0';
2041 return yyn;
2042 }
2043 do_not_strip_quotes: ;
2044 }
2045
2046 if (! yyres)
2047 return yystrlen (yystr);
2048
2049 return yystpcpy (yyres, yystr) - yyres;
2050}
2051# endif
2052
2053#endif /* YYERROR_VERBOSE */
2054
2055
2056
2057#if YYDEBUG
2058/*--------------------------------.
2059| Print this symbol on YYOUTPUT. |
2060`--------------------------------*/
2061
2062#if defined (__STDC__) || defined (__cplusplus)
2063static void
2064yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2065#else
2066static void
2067yysymprint (yyoutput, yytype, yyvaluep)
2068 FILE *yyoutput;
2069 int yytype;
2070 YYSTYPE *yyvaluep;
2071#endif
2072{
2073 /* Pacify ``unused variable'' warnings. */
2074 (void) yyvaluep;
2075
2076 if (yytype < YYNTOKENS)
2077 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2078 else
2079 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2080
2081
2082# ifdef YYPRINT
2083 if (yytype < YYNTOKENS)
2084 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2085# endif
2086 switch (yytype)
2087 {
2088 default:
2089 break;
2090 }
2091 YYFPRINTF (yyoutput, ")");
2092}
2093
2094#endif /* ! YYDEBUG */
2095/*-----------------------------------------------.
2096| Release the memory associated to this symbol. |
2097`-----------------------------------------------*/
2098
2099#if defined (__STDC__) || defined (__cplusplus)
2100static void
2101yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2102#else
2103static void
2104yydestruct (yymsg, yytype, yyvaluep)
2105 const char *yymsg;
2106 int yytype;
2107 YYSTYPE *yyvaluep;
2108#endif
2109{
2110 /* Pacify ``unused variable'' warnings. */
2111 (void) yyvaluep;
2112
2113 if (!yymsg)
2114 yymsg = "Deleting";
2115 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2116
2117 switch (yytype)
2118 {
2119
2120 default:
2121 break;
2122 }
2123}
2124
2125
2126/* Prevent warnings from -Wmissing-prototypes. */
2127
2128#ifdef YYPARSE_PARAM
2129# if defined (__STDC__) || defined (__cplusplus)
2130int yyparse (void *YYPARSE_PARAM);
2131# else
2132int yyparse ();
2133# endif
2134#else /* ! YYPARSE_PARAM */
2135#if defined (__STDC__) || defined (__cplusplus)
2136int yyparse (void);
2137#else
2138int yyparse ();
2139#endif
2140#endif /* ! YYPARSE_PARAM */
2141
2142
2143
2144/* The look-ahead symbol. */
2145int yychar;
2146
2147/* The semantic value of the look-ahead symbol. */
2148YYSTYPE yylval;
2149
2150/* Number of syntax errors so far. */
2151int yynerrs;
2152
2153
2154
2155/*----------.
2156| yyparse. |
2157`----------*/
2158
2159#ifdef YYPARSE_PARAM
2160# if defined (__STDC__) || defined (__cplusplus)
2161int yyparse (void *YYPARSE_PARAM)
2162# else
2163int yyparse (YYPARSE_PARAM)
2164 void *YYPARSE_PARAM;
2165# endif
2166#else /* ! YYPARSE_PARAM */
2167#if defined (__STDC__) || defined (__cplusplus)
2168int
2169yyparse (void)
2170#else
2171int
2172yyparse ()
2173
2174#endif
2175#endif
2176{
2177
2178 int yystate;
2179 int yyn;
2180 int yyresult;
2181 /* Number of tokens to shift before error messages enabled. */
2182 int yyerrstatus;
2183 /* Look-ahead token as an internal (translated) token number. */
2184 int yytoken = 0;
2185
2186 /* Three stacks and their tools:
2187 `yyss': related to states,
2188 `yyvs': related to semantic values,
2189 `yyls': related to locations.
2190
2191 Refer to the stacks thru separate pointers, to allow yyoverflow
2192 to reallocate them elsewhere. */
2193
2194 /* The state stack. */
2195 short int yyssa[YYINITDEPTH];
2196 short int *yyss = yyssa;
2197 short int *yyssp;
2198
2199 /* The semantic value stack. */
2200 YYSTYPE yyvsa[YYINITDEPTH];
2201 YYSTYPE *yyvs = yyvsa;
2202 YYSTYPE *yyvsp;
2203
2204
2205
2206#define YYPOPSTACK (yyvsp--, yyssp--)
2207
2208 YYSIZE_T yystacksize = YYINITDEPTH;
2209
2210 /* The variables used to return semantic value and location from the
2211 action routines. */
2212 YYSTYPE yyval;
2213
2214
2215 /* When reducing, the number of symbols on the RHS of the reduced
2216 rule. */
2217 int yylen;
2218
2219 YYDPRINTF ((stderr, "Starting parse\n"));
2220
2221 yystate = 0;
2222 yyerrstatus = 0;
2223 yynerrs = 0;
2224 yychar = YYEMPTY; /* Cause a token to be read. */
2225
2226 /* Initialize stack pointers.
2227 Waste one element of value and location stack
2228 so that they stay on the same level as the state stack.
2229 The wasted elements are never initialized. */
2230
2231 yyssp = yyss;
2232 yyvsp = yyvs;
2233
2234 goto yysetstate;
2235
2236/*------------------------------------------------------------.
2237| yynewstate -- Push a new state, which is found in yystate. |
2238`------------------------------------------------------------*/
2239 yynewstate:
2240 /* In all cases, when you get here, the value and location stacks
2241 have just been pushed. so pushing a state here evens the stacks.
2242 */
2243 yyssp++;
2244
2245 yysetstate:
2246 *yyssp = yystate;
2247
2248 if (yyss + yystacksize - 1 <= yyssp)
2249 {
2250 /* Get the current used size of the three stacks, in elements. */
2251 YYSIZE_T yysize = yyssp - yyss + 1;
2252
2253#ifdef yyoverflow
2254 {
2255 /* Give user a chance to reallocate the stack. Use copies of
2256 these so that the &'s don't force the real ones into
2257 memory. */
2258 YYSTYPE *yyvs1 = yyvs;
2259 short int *yyss1 = yyss;
2260
2261
2262 /* Each stack pointer address is followed by the size of the
2263 data in use in that stack, in bytes. This used to be a
2264 conditional around just the two extra args, but that might
2265 be undefined if yyoverflow is a macro. */
2266 yyoverflow (YY_("memory exhausted"),
2267 &yyss1, yysize * sizeof (*yyssp),
2268 &yyvs1, yysize * sizeof (*yyvsp),
2269
2270 &yystacksize);
2271
2272 yyss = yyss1;
2273 yyvs = yyvs1;
2274 }
2275#else /* no yyoverflow */
2276# ifndef YYSTACK_RELOCATE
2277 goto yyexhaustedlab;
2278# else
2279 /* Extend the stack our own way. */
2280 if (YYMAXDEPTH <= yystacksize)
2281 goto yyexhaustedlab;
2282 yystacksize *= 2;
2283 if (YYMAXDEPTH < yystacksize)
2284 yystacksize = YYMAXDEPTH;
2285
2286 {
2287 short int *yyss1 = yyss;
2288 union yyalloc *yyptr =
2289 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2290 if (! yyptr)
2291 goto yyexhaustedlab;
2292 YYSTACK_RELOCATE (yyss);
2293 YYSTACK_RELOCATE (yyvs);
2294
2295# undef YYSTACK_RELOCATE
2296 if (yyss1 != yyssa)
2297 YYSTACK_FREE (yyss1);
2298 }
2299# endif
2300#endif /* no yyoverflow */
2301
2302 yyssp = yyss + yysize - 1;
2303 yyvsp = yyvs + yysize - 1;
2304
2305
2306 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2307 (unsigned long int) yystacksize));
2308
2309 if (yyss + yystacksize - 1 <= yyssp)
2310 YYABORT;
2311 }
2312
2313 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2314
2315 goto yybackup;
2316
2317/*-----------.
2318| yybackup. |
2319`-----------*/
2320yybackup:
2321
2322/* Do appropriate processing given the current state. */
2323/* Read a look-ahead token if we need one and don't already have one. */
2324/* yyresume: */
2325
2326 /* First try to decide what to do without reference to look-ahead token. */
2327
2328 yyn = yypact[yystate];
2329 if (yyn == YYPACT_NINF)
2330 goto yydefault;
2331
2332 /* Not known => get a look-ahead token if don't already have one. */
2333
2334 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2335 if (yychar == YYEMPTY)
2336 {
2337 YYDPRINTF ((stderr, "Reading a token: "));
2338 yychar = YYLEX;
2339 }
2340
2341 if (yychar <= YYEOF)
2342 {
2343 yychar = yytoken = YYEOF;
2344 YYDPRINTF ((stderr, "Now at end of input.\n"));
2345 }
2346 else
2347 {
2348 yytoken = YYTRANSLATE (yychar);
2349 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2350 }
2351
2352 /* If the proper action on seeing token YYTOKEN is to reduce or to
2353 detect an error, take that action. */
2354 yyn += yytoken;
2355 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2356 goto yydefault;
2357 yyn = yytable[yyn];
2358 if (yyn <= 0)
2359 {
2360 if (yyn == 0 || yyn == YYTABLE_NINF)
2361 goto yyerrlab;
2362 yyn = -yyn;
2363 goto yyreduce;
2364 }
2365
2366 if (yyn == YYFINAL)
2367 YYACCEPT;
2368
2369 /* Shift the look-ahead token. */
2370 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2371
2372 /* Discard the token being shifted unless it is eof. */
2373 if (yychar != YYEOF)
2374 yychar = YYEMPTY;
2375
2376 *++yyvsp = yylval;
2377
2378
2379 /* Count tokens shifted since error; after three, turn off error
2380 status. */
2381 if (yyerrstatus)
2382 yyerrstatus--;
2383
2384 yystate = yyn;
2385 goto yynewstate;
2386
2387
2388/*-----------------------------------------------------------.
2389| yydefault -- do the default action for the current state. |
2390`-----------------------------------------------------------*/
2391yydefault:
2392 yyn = yydefact[yystate];
2393 if (yyn == 0)
2394 goto yyerrlab;
2395 goto yyreduce;
2396
2397
2398/*-----------------------------.
2399| yyreduce -- Do a reduction. |
2400`-----------------------------*/
2401yyreduce:
2402 /* yyn is the number of a rule to reduce with. */
2403 yylen = yyr2[yyn];
2404
2405 /* If YYLEN is nonzero, implement the default value of the action:
2406 `$$ = $1'.
2407
2408 Otherwise, the following line sets YYVAL to garbage.
2409 This behavior is undocumented and Bison
2410 users should not rely upon it. Assigning to YYVAL
2411 unconditionally makes the parser a bit smaller, and it avoids a
2412 GCC warning that YYVAL may be used uninitialized. */
2413 yyval = yyvsp[1-yylen];
2414
2415
2416 YY_REDUCE_PRINT (yyn);
2417 switch (yyn)
2418 {
Reid Spencer57f28f92006-12-03 07:10:26 +00002419 case 81:
Reid Spencerf5626a32007-01-01 01:20:41 +00002420#line 377 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002421 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002422 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002423 ;}
2424 break;
2425
Reid Spencer57f28f92006-12-03 07:10:26 +00002426 case 82:
Reid Spencerf5626a32007-01-01 01:20:41 +00002427#line 380 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002428 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002429 (yyval.String) = new std::string("");
Reid Spencere7c3c602006-11-30 06:36:44 +00002430 ;}
2431 break;
2432
Reid Spencer57f28f92006-12-03 07:10:26 +00002433 case 90:
Reid Spencerf5626a32007-01-01 01:20:41 +00002434#line 387 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002435 { (yyval.String) = new std::string(""); ;}
2436 break;
2437
Reid Spencer57f28f92006-12-03 07:10:26 +00002438 case 97:
Reid Spencerf5626a32007-01-01 01:20:41 +00002439#line 392 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002440 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002441 *(yyvsp[-1].String) += *(yyvsp[0].String);
2442 delete (yyvsp[0].String);
Reid Spencer16244f42006-12-01 21:10:07 +00002443 (yyval.String) = (yyvsp[-1].String);
2444 ;}
2445 break;
2446
Reid Spencer57f28f92006-12-03 07:10:26 +00002447 case 98:
Reid Spencerf5626a32007-01-01 01:20:41 +00002448#line 397 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002449 { (yyval.String) = new std::string(""); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002450 break;
2451
Reid Spencer57f28f92006-12-03 07:10:26 +00002452 case 99:
Reid Spencerf5626a32007-01-01 01:20:41 +00002453#line 402 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002454 { (yyval.String) = new std::string(); ;}
2455 break;
2456
Reid Spencer57f28f92006-12-03 07:10:26 +00002457 case 100:
Reid Spencerf5626a32007-01-01 01:20:41 +00002458#line 403 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002459 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2460 break;
2461
Reid Spencer57f28f92006-12-03 07:10:26 +00002462 case 101:
Reid Spencerf5626a32007-01-01 01:20:41 +00002463#line 406 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002464 { (yyval.String) = new std::string(); ;}
2465 break;
2466
Reid Spencer57f28f92006-12-03 07:10:26 +00002467 case 102:
Reid Spencerf5626a32007-01-01 01:20:41 +00002468#line 407 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002469 {
2470 (yyvsp[-1].String)->insert(0, ", ");
Reid Spencerf2d55322006-12-01 21:52:30 +00002471 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2472 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002473 (yyval.String) = (yyvsp[-1].String);
2474 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002475 break;
2476
Reid Spencer57f28f92006-12-03 07:10:26 +00002477 case 103:
Reid Spencerf5626a32007-01-01 01:20:41 +00002478#line 415 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002479 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002480 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2481 delete (yyvsp[0].String);
2482 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002483 ;}
2484 break;
2485
Reid Spencer57f28f92006-12-03 07:10:26 +00002486 case 104:
Reid Spencerf5626a32007-01-01 01:20:41 +00002487#line 421 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002488 { (yyval.String) = new std::string(); ;}
2489 break;
2490
Reid Spencer57f28f92006-12-03 07:10:26 +00002491 case 106:
Reid Spencerf5626a32007-01-01 01:20:41 +00002492#line 425 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002493 { (yyval.String) = new std::string(); ;}
2494 break;
2495
Reid Spencer57f28f92006-12-03 07:10:26 +00002496 case 107:
Reid Spencerf5626a32007-01-01 01:20:41 +00002497#line 426 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002498 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002499 (yyvsp[-1].String)->insert(0, ", ");
2500 if (!(yyvsp[0].String)->empty())
2501 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2502 delete (yyvsp[0].String);
2503 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002504 ;}
2505 break;
2506
Reid Spencer57f28f92006-12-03 07:10:26 +00002507 case 109:
Reid Spencerf5626a32007-01-01 01:20:41 +00002508#line 436 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002509 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002510 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2511 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002512 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002513 ;}
2514 break;
2515
Reid Spencer57f28f92006-12-03 07:10:26 +00002516 case 127:
Reid Spencerf5626a32007-01-01 01:20:41 +00002517#line 458 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002518 {
Reid Spencera50d5962006-12-02 04:11:07 +00002519 (yyval.Type).newTy = (yyvsp[0].String);
2520 (yyval.Type).oldTy = OpaqueTy;
2521 ;}
2522 break;
2523
Reid Spencer57f28f92006-12-03 07:10:26 +00002524 case 128:
Reid Spencerf5626a32007-01-01 01:20:41 +00002525#line 462 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002526 {
2527 (yyval.Type).newTy = (yyvsp[0].String);
2528 (yyval.Type).oldTy = UnresolvedTy;
2529 ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00002530 break;
2531
Reid Spencer57f28f92006-12-03 07:10:26 +00002532 case 129:
Reid Spencerf5626a32007-01-01 01:20:41 +00002533#line 466 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002534 {
2535 (yyval.Type) = (yyvsp[0].Type);
2536 ;}
2537 break;
2538
Reid Spencer57f28f92006-12-03 07:10:26 +00002539 case 130:
Reid Spencerf5626a32007-01-01 01:20:41 +00002540#line 469 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002541 { // Type UpReference
Reid Spencerf2d55322006-12-01 21:52:30 +00002542 (yyvsp[0].String)->insert(0, "\\");
2543 (yyval.Type).newTy = (yyvsp[0].String);
Reid Spencera50d5962006-12-02 04:11:07 +00002544 (yyval.Type).oldTy = NumericTy;
Reid Spencere77e35e2006-12-01 20:26:20 +00002545 ;}
2546 break;
2547
Reid Spencer57f28f92006-12-03 07:10:26 +00002548 case 131:
Reid Spencerf5626a32007-01-01 01:20:41 +00002549#line 474 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002550 { // Function derived type?
2551 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2552 delete (yyvsp[-1].String);
2553 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2554 (yyval.Type).oldTy = FunctionTy;
2555 ;}
2556 break;
2557
Reid Spencer57f28f92006-12-03 07:10:26 +00002558 case 132:
Reid Spencerf5626a32007-01-01 01:20:41 +00002559#line 480 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002560 { // Sized array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002561 (yyvsp[-3].String)->insert(0,"[ ");
2562 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
Reid Spencere77e35e2006-12-01 20:26:20 +00002563 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002564 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002565 (yyval.Type).oldTy = ArrayTy;
Reid Spencer78720742006-12-02 20:21:22 +00002566 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002567 ;}
2568 break;
2569
Reid Spencer57f28f92006-12-03 07:10:26 +00002570 case 133:
Reid Spencerf5626a32007-01-01 01:20:41 +00002571#line 488 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002572 { // Packed array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002573 (yyvsp[-3].String)->insert(0,"< ");
2574 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
Reid Spencere77e35e2006-12-01 20:26:20 +00002575 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002576 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002577 (yyval.Type).oldTy = PackedTy;
Reid Spencer78720742006-12-02 20:21:22 +00002578 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002579 ;}
2580 break;
2581
Reid Spencer57f28f92006-12-03 07:10:26 +00002582 case 134:
Reid Spencerf5626a32007-01-01 01:20:41 +00002583#line 496 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002584 { // Structure type?
2585 (yyvsp[-1].String)->insert(0, "{ ");
2586 *(yyvsp[-1].String) += " }";
2587 (yyval.Type).newTy = (yyvsp[-1].String);
2588 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002589 ;}
2590 break;
2591
Reid Spencer57f28f92006-12-03 07:10:26 +00002592 case 135:
Reid Spencerf5626a32007-01-01 01:20:41 +00002593#line 502 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002594 { // Empty structure type?
Reid Spencer0b7e5072006-12-01 22:42:01 +00002595 (yyval.Type).newTy = new std::string("{}");
Reid Spencere77e35e2006-12-01 20:26:20 +00002596 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002597 ;}
2598 break;
2599
Reid Spencer57f28f92006-12-03 07:10:26 +00002600 case 136:
Reid Spencerf5626a32007-01-01 01:20:41 +00002601#line 506 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002602 { // Packed Structure type?
2603 (yyvsp[-2].String)->insert(0, "<{ ");
2604 *(yyvsp[-2].String) += " }>";
2605 (yyval.Type).newTy = (yyvsp[-2].String);
2606 (yyval.Type).oldTy = StructTy;
2607 ;}
2608 break;
2609
2610 case 137:
Reid Spencerf5626a32007-01-01 01:20:41 +00002611#line 512 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002612 { // Empty packed structure type?
2613 (yyval.Type).newTy = new std::string("<{}>");
2614 (yyval.Type).oldTy = StructTy;
2615 ;}
2616 break;
2617
2618 case 138:
Reid Spencerf5626a32007-01-01 01:20:41 +00002619#line 516 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002620 { // Pointer type?
2621 *(yyvsp[-1].Type).newTy += '*';
Reid Spencer78720742006-12-02 20:21:22 +00002622 (yyval.Type).elemTy = (yyvsp[-1].Type).oldTy;
Reid Spencere77e35e2006-12-01 20:26:20 +00002623 (yyvsp[-1].Type).oldTy = PointerTy;
2624 (yyval.Type) = (yyvsp[-1].Type);
Reid Spencere7c3c602006-11-30 06:36:44 +00002625 ;}
2626 break;
2627
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002628 case 139:
Reid Spencerf5626a32007-01-01 01:20:41 +00002629#line 527 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002630 {
2631 (yyval.String) = (yyvsp[0].Type).newTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002632 ;}
2633 break;
2634
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002635 case 140:
Reid Spencerf5626a32007-01-01 01:20:41 +00002636#line 530 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002637 {
2638 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2639 delete (yyvsp[0].Type).newTy;
2640 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002641 ;}
2642 break;
2643
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002644 case 142:
Reid Spencerf5626a32007-01-01 01:20:41 +00002645#line 539 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002646 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002647 *(yyvsp[-2].String) += ", ...";
2648 delete (yyvsp[0].String);
2649 (yyval.String) = (yyvsp[-2].String);
2650 ;}
2651 break;
2652
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002653 case 143:
Reid Spencerf5626a32007-01-01 01:20:41 +00002654#line 544 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002655 {
2656 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002657 ;}
2658 break;
2659
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002660 case 144:
Reid Spencerf5626a32007-01-01 01:20:41 +00002661#line 547 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002662 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002663 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00002664 ;}
2665 break;
2666
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002667 case 145:
Reid Spencerf5626a32007-01-01 01:20:41 +00002668#line 557 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002669 { // Nonempty unsized arr
2670 (yyval.Const).type = (yyvsp[-3].Type);
2671 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2672 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2673 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002674 ;}
2675 break;
2676
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002677 case 146:
Reid Spencerf5626a32007-01-01 01:20:41 +00002678#line 563 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002679 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002680 (yyval.Const).type = (yyvsp[-2].Type);
2681 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2682 *(yyval.Const).cnst += "[ ]";
Reid Spencere7c3c602006-11-30 06:36:44 +00002683 ;}
2684 break;
2685
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002686 case 147:
Reid Spencerf5626a32007-01-01 01:20:41 +00002687#line 568 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002688 {
2689 (yyval.Const).type = (yyvsp[-2].Type);
2690 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2691 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2692 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002693 ;}
2694 break;
2695
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002696 case 148:
Reid Spencerf5626a32007-01-01 01:20:41 +00002697#line 574 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002698 { // Nonempty unsized arr
2699 (yyval.Const).type = (yyvsp[-3].Type);
2700 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2701 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2702 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002703 ;}
2704 break;
2705
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002706 case 149:
Reid Spencerf5626a32007-01-01 01:20:41 +00002707#line 580 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002708 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002709 (yyval.Const).type = (yyvsp[-3].Type);
2710 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2711 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2712 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002713 ;}
2714 break;
2715
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002716 case 150:
Reid Spencerf5626a32007-01-01 01:20:41 +00002717#line 586 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002718 {
2719 (yyval.Const).type = (yyvsp[-2].Type);
2720 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
Reid Spencer0b7e5072006-12-01 22:42:01 +00002721 *(yyval.Const).cnst += " {}";
Reid Spencere7c3c602006-11-30 06:36:44 +00002722 ;}
2723 break;
2724
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002725 case 151:
Reid Spencerf5626a32007-01-01 01:20:41 +00002726#line 591 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002727 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002728 (yyval.Const).type = (yyvsp[-1].Type);
2729 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002730 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2731 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002732 ;}
2733 break;
2734
Reid Spencer187ccf82006-12-09 16:57:22 +00002735 case 152:
Reid Spencerf5626a32007-01-01 01:20:41 +00002736#line 597 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002737 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002738 (yyval.Const).type = (yyvsp[-1].Type);
2739 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002740 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2741 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002742 ;}
2743 break;
2744
Reid Spencer187ccf82006-12-09 16:57:22 +00002745 case 153:
Reid Spencerf5626a32007-01-01 01:20:41 +00002746#line 603 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer187ccf82006-12-09 16:57:22 +00002747 {
2748 (yyval.Const).type = (yyvsp[-1].Type);
2749 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2750 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2751 delete (yyvsp[0].String);
2752 ;}
2753 break;
2754
2755 case 154:
Reid Spencerf5626a32007-01-01 01:20:41 +00002756#line 609 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002757 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002758 (yyval.Const).type = (yyvsp[-1].Type);
2759 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002760 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2761 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002762 ;}
2763 break;
2764
Reid Spencer57f28f92006-12-03 07:10:26 +00002765 case 155:
Reid Spencerf5626a32007-01-01 01:20:41 +00002766#line 615 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002767 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002768 (yyval.Const).type = (yyvsp[-1].Type);
2769 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002770 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2771 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002772 ;}
2773 break;
2774
Reid Spencer57f28f92006-12-03 07:10:26 +00002775 case 156:
Reid Spencerf5626a32007-01-01 01:20:41 +00002776#line 621 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002777 { // integral constants
Reid Spencere77e35e2006-12-01 20:26:20 +00002778 (yyval.Const).type = (yyvsp[-1].Type);
2779 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002780 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2781 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002782 ;}
2783 break;
2784
Reid Spencer57f28f92006-12-03 07:10:26 +00002785 case 157:
Reid Spencerf5626a32007-01-01 01:20:41 +00002786#line 627 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002787 { // integral constants
Reid Spencer78720742006-12-02 20:21:22 +00002788 (yyval.Const).type = (yyvsp[-1].Type);
2789 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2790 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2791 delete (yyvsp[0].String);
2792 ;}
2793 break;
2794
Reid Spencer57f28f92006-12-03 07:10:26 +00002795 case 158:
Reid Spencerf5626a32007-01-01 01:20:41 +00002796#line 633 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002797 { // Boolean constants
Reid Spencer78720742006-12-02 20:21:22 +00002798 (yyval.Const).type = (yyvsp[-1].Type);
2799 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2800 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2801 delete (yyvsp[0].String);
2802 ;}
2803 break;
2804
Reid Spencer57f28f92006-12-03 07:10:26 +00002805 case 159:
Reid Spencerf5626a32007-01-01 01:20:41 +00002806#line 639 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002807 { // Boolean constants
2808 (yyval.Const).type = (yyvsp[-1].Type);
2809 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2810 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2811 delete (yyvsp[0].String);
2812 ;}
2813 break;
2814
2815 case 160:
Reid Spencerf5626a32007-01-01 01:20:41 +00002816#line 645 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002817 { // Float & Double constants
2818 (yyval.Const).type = (yyvsp[-1].Type);
2819 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2820 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2821 delete (yyvsp[0].String);
2822 ;}
2823 break;
2824
2825 case 161:
Reid Spencerf5626a32007-01-01 01:20:41 +00002826#line 653 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002827 {
Reid Spencer280d8012006-12-01 23:40:53 +00002828 std::string source = *(yyvsp[-3].Const).cnst;
Reid Spencera50d5962006-12-02 04:11:07 +00002829 TypeInfo DstTy = (yyvsp[-1].Type);
2830 ResolveType(DstTy);
Reid Spencer280d8012006-12-01 23:40:53 +00002831 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002832 // Call getCastUpgrade to upgrade the old cast
2833 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
2834 } else {
2835 // Nothing to upgrade, just create the cast constant expr
2836 (yyval.String) = new std::string(*(yyvsp[-5].String));
2837 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002838 }
Reid Spencere77e35e2006-12-01 20:26:20 +00002839 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002840 ;}
2841 break;
2842
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002843 case 162:
Reid Spencerf5626a32007-01-01 01:20:41 +00002844#line 667 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002845 {
Reid Spencerf8483652006-12-02 15:16:01 +00002846 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2847 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2848 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2849 *(yyvsp[-4].String) += ", " + *VI.val;
2850 VI.destroy();
2851 }
2852 *(yyvsp[-4].String) += ")";
Reid Spencere77e35e2006-12-01 20:26:20 +00002853 (yyval.String) = (yyvsp[-4].String);
2854 (yyvsp[-2].Const).destroy();
Reid Spencerf8483652006-12-02 15:16:01 +00002855 delete (yyvsp[-1].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00002856 ;}
2857 break;
2858
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002859 case 163:
Reid Spencerf5626a32007-01-01 01:20:41 +00002860#line 679 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002861 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002862 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2863 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2864 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002865 ;}
2866 break;
2867
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002868 case 164:
Reid Spencerf5626a32007-01-01 01:20:41 +00002869#line 684 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002870 {
Reid Spencer78720742006-12-02 20:21:22 +00002871 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2872 (yyval.String) = new std::string(op);
2873 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2874 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002875 ;}
2876 break;
2877
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002878 case 165:
Reid Spencerf5626a32007-01-01 01:20:41 +00002879#line 690 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002880 {
2881 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2882 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2883 (yyval.String) = (yyvsp[-5].String);
2884 ;}
2885 break;
2886
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002887 case 166:
Reid Spencerf5626a32007-01-01 01:20:41 +00002888#line 695 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002889 {
Reid Spencer229e9362006-12-02 22:14:11 +00002890 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
Reid Spencer78720742006-12-02 20:21:22 +00002891 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2892 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2893 (yyval.String) = (yyvsp[-5].String);
2894 ;}
2895 break;
2896
Reid Spencer57f28f92006-12-03 07:10:26 +00002897 case 167:
Reid Spencerf5626a32007-01-01 01:20:41 +00002898#line 701 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002899 {
2900 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2901 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2902 (yyval.String) = (yyvsp[-6].String);
2903 ;}
2904 break;
2905
2906 case 168:
Reid Spencerf5626a32007-01-01 01:20:41 +00002907#line 706 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002908 {
2909 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2910 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2911 (yyval.String) = (yyvsp[-6].String);
2912 ;}
2913 break;
2914
2915 case 169:
Reid Spencerf5626a32007-01-01 01:20:41 +00002916#line 711 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00002917 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002918 const char* shiftop = (yyvsp[-5].String)->c_str();
2919 if (*(yyvsp[-5].String) == "shr")
2920 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2921 (yyval.String) = new std::string(shiftop);
2922 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2923 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002924 ;}
2925 break;
2926
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002927 case 170:
Reid Spencerf5626a32007-01-01 01:20:41 +00002928#line 719 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002929 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002930 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2931 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2932 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002933 ;}
2934 break;
2935
Reid Spencer57f28f92006-12-03 07:10:26 +00002936 case 171:
Reid Spencerf5626a32007-01-01 01:20:41 +00002937#line 724 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002938 {
2939 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2940 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2941 (yyval.String) = (yyvsp[-7].String);
2942 ;}
2943 break;
2944
2945 case 172:
Reid Spencerf5626a32007-01-01 01:20:41 +00002946#line 729 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002947 {
2948 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2949 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2950 (yyval.String) = (yyvsp[-7].String);
2951 ;}
2952 break;
2953
2954 case 173:
Reid Spencerf5626a32007-01-01 01:20:41 +00002955#line 739 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002956 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002957 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2958 (yyvsp[0].Const).destroy();
2959 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002960 ;}
2961 break;
2962
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002963 case 174:
Reid Spencerf5626a32007-01-01 01:20:41 +00002964#line 744 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002965 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002966 break;
2967
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002968 case 177:
Reid Spencerf5626a32007-01-01 01:20:41 +00002969#line 759 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002970 {
2971;}
2972 break;
2973
Reid Spencer57f28f92006-12-03 07:10:26 +00002974 case 178:
Reid Spencerf5626a32007-01-01 01:20:41 +00002975#line 764 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002976 {
Reid Spencerd154b572006-12-01 20:36:40 +00002977 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002978 ;}
2979 break;
2980
Reid Spencer57f28f92006-12-03 07:10:26 +00002981 case 179:
Reid Spencerf5626a32007-01-01 01:20:41 +00002982#line 767 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002983 {
2984 *O << *(yyvsp[0].String) << '\n';
2985 delete (yyvsp[0].String);
2986 (yyval.String) = 0;
2987 ;}
2988 break;
2989
2990 case 180:
Reid Spencerf5626a32007-01-01 01:20:41 +00002991#line 772 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002992 {
2993 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
2994 (yyval.String) = 0;
2995 ;}
2996 break;
2997
2998 case 181:
Reid Spencerf5626a32007-01-01 01:20:41 +00002999#line 776 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003000 {
Reid Spencerd154b572006-12-01 20:36:40 +00003001 *O << "implementation\n";
3002 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003003 ;}
3004 break;
3005
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003006 case 182:
Reid Spencerf5626a32007-01-01 01:20:41 +00003007#line 780 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00003008 { (yyval.String) = 0; ;}
3009 break;
3010
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003011 case 184:
Reid Spencerf5626a32007-01-01 01:20:41 +00003012#line 782 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003013 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3014 break;
3015
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003016 case 185:
Reid Spencerf5626a32007-01-01 01:20:41 +00003017#line 785 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003018 {
Reid Spencera50d5962006-12-02 04:11:07 +00003019 EnumeratedTypes.push_back((yyvsp[0].Type));
3020 if (!(yyvsp[-2].String)->empty()) {
3021 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
3022 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
Reid Spencer78720742006-12-02 20:21:22 +00003023 NamedTypes[*(yyvsp[-2].String)].elemTy = (yyvsp[0].Type).elemTy;
Reid Spencera50d5962006-12-02 04:11:07 +00003024 *O << *(yyvsp[-2].String) << " = ";
3025 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003026 *O << "type " << *(yyvsp[0].Type).newTy << '\n';
Reid Spencera50d5962006-12-02 04:11:07 +00003027 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003028 (yyval.String) = 0;
3029 ;}
3030 break;
3031
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003032 case 186:
Reid Spencerf5626a32007-01-01 01:20:41 +00003033#line 797 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003034 { // Function prototypes can be in const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003035 *O << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003036 delete (yyvsp[0].String);
3037 (yyval.String) = 0;
3038 ;}
3039 break;
3040
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003041 case 187:
Reid Spencerf5626a32007-01-01 01:20:41 +00003042#line 802 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003043 { // Asm blocks can be in the const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003044 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003045 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3046 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003047 ;}
3048 break;
3049
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003050 case 188:
Reid Spencerf5626a32007-01-01 01:20:41 +00003051#line 807 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003052 {
Reid Spencerf12ee422006-12-05 19:21:25 +00003053 if (!(yyvsp[-4].String)->empty()) {
Reid Spencera50d5962006-12-02 04:11:07 +00003054 *O << *(yyvsp[-4].String) << " = ";
Reid Spencerf12ee422006-12-05 19:21:25 +00003055 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Const).type.clone();
3056 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003057 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003058 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
3059 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003060 ;}
3061 break;
3062
Reid Spencer57f28f92006-12-03 07:10:26 +00003063 case 189:
Reid Spencerf5626a32007-01-01 01:20:41 +00003064#line 816 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003065 {
Reid Spencerf12ee422006-12-05 19:21:25 +00003066 if (!(yyvsp[-4].String)->empty()) {
Reid Spencera50d5962006-12-02 04:11:07 +00003067 *O << *(yyvsp[-4].String) << " = ";
Reid Spencerf12ee422006-12-05 19:21:25 +00003068 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
3069 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003070 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
Reid Spencerfcb5df82006-12-01 22:34:43 +00003071 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3072 (yyval.String) = 0;
3073 ;}
3074 break;
3075
Reid Spencer57f28f92006-12-03 07:10:26 +00003076 case 190:
Reid Spencer71d2ec92006-12-31 06:02:26 +00003077#line 825 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003078 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003079 if (!(yyvsp[-4].String)->empty()) {
3080 *O << *(yyvsp[-4].String) << " = ";
3081 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
3082 }
3083 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
3084 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003085 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003086 ;}
3087 break;
3088
Reid Spencerf5626a32007-01-01 01:20:41 +00003089 case 191:
Reid Spencer71d2ec92006-12-31 06:02:26 +00003090#line 834 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf5626a32007-01-01 01:20:41 +00003091 {
3092 if (!(yyvsp[-4].String)->empty()) {
3093 *O << *(yyvsp[-4].String) << " = ";
3094 Globals[*(yyvsp[-4].String)] = (yyvsp[-1].Type).clone();
3095 }
3096 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].String) << '\n';
3097 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3098 (yyval.String) = 0;
3099 ;}
3100 break;
3101
3102 case 192:
3103#line 843 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003104 {
3105 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3106 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3107 (yyval.String) = 0;
3108 ;}
3109 break;
3110
3111 case 193:
Reid Spencerf5626a32007-01-01 01:20:41 +00003112#line 848 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003113 {
3114 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3115 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3116 (yyval.String) = 0;
3117 ;}
3118 break;
3119
3120 case 194:
Reid Spencerf5626a32007-01-01 01:20:41 +00003121#line 853 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003122 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003123 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003124 ;}
3125 break;
3126
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003127 case 198:
Reid Spencerf5626a32007-01-01 01:20:41 +00003128#line 863 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003129 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003130 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3131 delete (yyvsp[0].String);
3132 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003133 ;}
3134 break;
3135
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003136 case 199:
Reid Spencerf5626a32007-01-01 01:20:41 +00003137#line 868 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003138 {
Reid Spencerf2d55322006-12-01 21:52:30 +00003139 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3140 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003141 SizeOfPointer = 64;
Reid Spencerf2d55322006-12-01 21:52:30 +00003142 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003143 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003144 ;}
3145 break;
3146
Reid Spencer57f28f92006-12-03 07:10:26 +00003147 case 200:
Reid Spencerf5626a32007-01-01 01:20:41 +00003148#line 875 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003149 {
3150 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3151 delete (yyvsp[0].String);
3152 (yyval.String) = (yyvsp[-2].String);
3153 ;}
3154 break;
3155
3156 case 201:
Reid Spencerf5626a32007-01-01 01:20:41 +00003157#line 880 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003158 {
3159 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3160 delete (yyvsp[0].String);
3161 (yyval.String) = (yyvsp[-2].String);
3162 ;}
3163 break;
3164
3165 case 202:
Reid Spencerf5626a32007-01-01 01:20:41 +00003166#line 887 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003167 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003168 (yyvsp[-1].String)->insert(0, "[ ");
3169 *(yyvsp[-1].String) += " ]";
3170 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003171 ;}
3172 break;
3173
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003174 case 203:
Reid Spencerf5626a32007-01-01 01:20:41 +00003175#line 894 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003176 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003177 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3178 delete (yyvsp[0].String);
3179 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003180 ;}
3181 break;
3182
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003183 case 205:
Reid Spencerf5626a32007-01-01 01:20:41 +00003184#line 900 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003185 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003186 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00003187 ;}
3188 break;
3189
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003190 case 209:
Reid Spencerf5626a32007-01-01 01:20:41 +00003191#line 909 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003192 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003193 break;
3194
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003195 case 210:
Reid Spencerf5626a32007-01-01 01:20:41 +00003196#line 911 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003197 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003198 (yyval.String) = (yyvsp[-1].Type).newTy;
3199 if (!(yyvsp[0].String)->empty())
3200 *(yyval.String) += " " + *(yyvsp[0].String);
3201 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003202;}
3203 break;
3204
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003205 case 211:
Reid Spencerf5626a32007-01-01 01:20:41 +00003206#line 918 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003207 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003208 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3209 delete (yyvsp[0].String);
3210 ;}
3211 break;
3212
Reid Spencer57f28f92006-12-03 07:10:26 +00003213 case 212:
Reid Spencerf5626a32007-01-01 01:20:41 +00003214#line 922 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003215 {
3216 (yyval.String) = (yyvsp[0].String);
3217 ;}
3218 break;
3219
3220 case 213:
Reid Spencerf5626a32007-01-01 01:20:41 +00003221#line 926 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003222 {
3223 (yyval.String) = (yyvsp[0].String);
3224 ;}
3225 break;
3226
3227 case 214:
Reid Spencerf5626a32007-01-01 01:20:41 +00003228#line 929 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003229 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003230 *(yyvsp[-2].String) += ", ...";
3231 (yyval.String) = (yyvsp[-2].String);
3232 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003233 ;}
3234 break;
3235
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003236 case 215:
Reid Spencerf5626a32007-01-01 01:20:41 +00003237#line 934 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003238 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003239 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003240 ;}
3241 break;
3242
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003243 case 216:
Reid Spencerf5626a32007-01-01 01:20:41 +00003244#line 937 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003245 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003246 break;
3247
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003248 case 217:
Reid Spencerf5626a32007-01-01 01:20:41 +00003249#line 940 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003250 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003251 if (!(yyvsp[-7].String)->empty()) {
3252 *(yyvsp[-7].String) += " ";
3253 }
3254 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3255 if (!(yyvsp[-1].String)->empty()) {
3256 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3257 }
3258 if (!(yyvsp[0].String)->empty()) {
3259 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3260 }
3261 (yyvsp[-6].Type).destroy();
3262 delete (yyvsp[-5].String);
3263 delete (yyvsp[-3].String);
3264 delete (yyvsp[-1].String);
3265 delete (yyvsp[0].String);
3266 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003267 ;}
3268 break;
3269
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003270 case 218:
Reid Spencerf5626a32007-01-01 01:20:41 +00003271#line 959 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003272 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003273 break;
3274
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003275 case 219:
Reid Spencerf5626a32007-01-01 01:20:41 +00003276#line 960 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003277 { (yyval.String) = new std::string ("{"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003278 break;
3279
Reid Spencer57f28f92006-12-03 07:10:26 +00003280 case 220:
Reid Spencerf5626a32007-01-01 01:20:41 +00003281#line 963 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003282 {
3283 *O << "define ";
3284 if (!(yyvsp[-2].String)->empty()) {
3285 *O << *(yyvsp[-2].String) << ' ';
3286 }
3287 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3288 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3289 (yyval.String) = 0;
3290 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003291 break;
3292
Reid Spencer57f28f92006-12-03 07:10:26 +00003293 case 221:
Reid Spencerf5626a32007-01-01 01:20:41 +00003294#line 974 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003295 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3296 break;
3297
Reid Spencer71d2ec92006-12-31 06:02:26 +00003298 case 222:
Reid Spencerf5626a32007-01-01 01:20:41 +00003299#line 975 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003300 { (yyval.String) = new std::string("}"); ;}
3301 break;
3302
Reid Spencer71d2ec92006-12-31 06:02:26 +00003303 case 223:
Reid Spencerf5626a32007-01-01 01:20:41 +00003304#line 977 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003305 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003306 if ((yyvsp[-1].String))
3307 *O << *(yyvsp[-1].String);
Reid Spencer71d2ec92006-12-31 06:02:26 +00003308 *O << *(yyvsp[0].String) << "\n\n";
Reid Spencere77e35e2006-12-01 20:26:20 +00003309 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003310;}
3311 break;
3312
Reid Spencer71d2ec92006-12-31 06:02:26 +00003313 case 224:
Reid Spencerf5626a32007-01-01 01:20:41 +00003314#line 985 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003315 { (yyval.String) = new std::string(); ;}
3316 break;
3317
Reid Spencer71d2ec92006-12-31 06:02:26 +00003318 case 227:
Reid Spencerf5626a32007-01-01 01:20:41 +00003319#line 991 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003320 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003321 if (!(yyvsp[-1].String)->empty())
3322 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3323 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3324 delete (yyvsp[-1].String);
3325 delete (yyvsp[0].String);
3326 (yyval.String) = (yyvsp[-2].String);
3327 ;}
3328 break;
3329
Reid Spencer71d2ec92006-12-31 06:02:26 +00003330 case 228:
Reid Spencerf5626a32007-01-01 01:20:41 +00003331#line 1004 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003332 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003333 break;
3334
Reid Spencer71d2ec92006-12-31 06:02:26 +00003335 case 238:
Reid Spencerf5626a32007-01-01 01:20:41 +00003336#line 1010 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003337 {
3338 (yyvsp[-1].String)->insert(0, "<");
3339 *(yyvsp[-1].String) += ">";
3340 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003341 ;}
3342 break;
3343
Reid Spencer71d2ec92006-12-31 06:02:26 +00003344 case 240:
Reid Spencerf5626a32007-01-01 01:20:41 +00003345#line 1016 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003346 {
3347 if (!(yyvsp[-3].String)->empty()) {
3348 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3349 }
3350 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3351 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3352 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003353 ;}
3354 break;
3355
Reid Spencer71d2ec92006-12-31 06:02:26 +00003356 case 243:
Reid Spencerf5626a32007-01-01 01:20:41 +00003357#line 1029 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003358 {
Reid Spencerf459d392006-12-02 16:19:52 +00003359 (yyval.Value).val = (yyvsp[0].String);
3360 (yyval.Value).constant = false;
3361 (yyval.Value).type.newTy = 0;
3362 (yyval.Value).type.oldTy = UnresolvedTy;
3363 ;}
3364 break;
3365
Reid Spencer71d2ec92006-12-31 06:02:26 +00003366 case 244:
Reid Spencerf5626a32007-01-01 01:20:41 +00003367#line 1035 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003368 {
3369 (yyval.Value).val = (yyvsp[0].String);
3370 (yyval.Value).constant = true;
3371 (yyval.Value).type.newTy = 0;
3372 (yyval.Value).type.oldTy = UnresolvedTy;
3373 ;}
3374 break;
3375
Reid Spencer71d2ec92006-12-31 06:02:26 +00003376 case 245:
Reid Spencerf5626a32007-01-01 01:20:41 +00003377#line 1046 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003378 {
3379 (yyval.Value) = (yyvsp[0].Value);
Reid Spencere77e35e2006-12-01 20:26:20 +00003380 (yyval.Value).type = (yyvsp[-1].Type);
Reid Spencerf459d392006-12-02 16:19:52 +00003381 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
Reid Spencere77e35e2006-12-01 20:26:20 +00003382 ;}
3383 break;
3384
Reid Spencer71d2ec92006-12-31 06:02:26 +00003385 case 246:
Reid Spencerf5626a32007-01-01 01:20:41 +00003386#line 1052 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003387 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003388 (yyval.String) = 0;
3389 ;}
3390 break;
3391
Reid Spencer71d2ec92006-12-31 06:02:26 +00003392 case 247:
Reid Spencerf5626a32007-01-01 01:20:41 +00003393#line 1055 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003394 { // Do not allow functions with 0 basic blocks
Reid Spencere77e35e2006-12-01 20:26:20 +00003395 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003396 ;}
3397 break;
3398
Reid Spencer71d2ec92006-12-31 06:02:26 +00003399 case 248:
Reid Spencerf5626a32007-01-01 01:20:41 +00003400#line 1063 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003401 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003402 (yyval.String) = 0;
3403 ;}
3404 break;
3405
Reid Spencer71d2ec92006-12-31 06:02:26 +00003406 case 249:
Reid Spencerf5626a32007-01-01 01:20:41 +00003407#line 1067 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003408 {
3409 *O << " " << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003410 delete (yyvsp[0].String);
3411 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003412 ;}
3413 break;
3414
Reid Spencer71d2ec92006-12-31 06:02:26 +00003415 case 250:
Reid Spencerf5626a32007-01-01 01:20:41 +00003416#line 1072 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003417 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003418 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003419 ;}
3420 break;
3421
Reid Spencer71d2ec92006-12-31 06:02:26 +00003422 case 251:
Reid Spencerf5626a32007-01-01 01:20:41 +00003423#line 1075 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003424 {
3425 *O << *(yyvsp[0].String) << '\n';
3426 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003427 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003428 ;}
3429 break;
3430
Reid Spencer71d2ec92006-12-31 06:02:26 +00003431 case 253:
Reid Spencerf5626a32007-01-01 01:20:41 +00003432#line 1081 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003433 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3434 break;
3435
Reid Spencer71d2ec92006-12-31 06:02:26 +00003436 case 254:
Reid Spencerf5626a32007-01-01 01:20:41 +00003437#line 1083 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003438 { // Return with a result...
3439 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3440 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3441 (yyval.String) = 0;
3442 ;}
3443 break;
3444
Reid Spencer71d2ec92006-12-31 06:02:26 +00003445 case 255:
Reid Spencerf5626a32007-01-01 01:20:41 +00003446#line 1088 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003447 { // Return with no result...
3448 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Type).newTy << '\n';
3449 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3450 (yyval.String) = 0;
3451 ;}
3452 break;
3453
Reid Spencer71d2ec92006-12-31 06:02:26 +00003454 case 256:
Reid Spencerf5626a32007-01-01 01:20:41 +00003455#line 1093 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003456 { // Unconditional Branch...
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003457 *O << " " << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].Value).val << '\n';
Reid Spencerf459d392006-12-02 16:19:52 +00003458 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003459 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003460 ;}
3461 break;
3462
Reid Spencer71d2ec92006-12-31 06:02:26 +00003463 case 257:
Reid Spencerf5626a32007-01-01 01:20:41 +00003464#line 1098 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003465 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003466 *O << " " << *(yyvsp[-8].String) << ' ' << *(yyvsp[-7].Type).newTy << ' ' << *(yyvsp[-6].Value).val << ", "
3467 << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << ' '
3468 << *(yyvsp[0].Value).val << '\n';
Reid Spencerf459d392006-12-02 16:19:52 +00003469 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3470 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003471 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003472 ;}
3473 break;
3474
Reid Spencer71d2ec92006-12-31 06:02:26 +00003475 case 258:
Reid Spencerf5626a32007-01-01 01:20:41 +00003476#line 1106 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003477 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003478 *O << " " << *(yyvsp[-8].String) << ' ' << *(yyvsp[-7].Type).newTy << ' ' << *(yyvsp[-6].Value).val << ", "
3479 << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
Reid Spencerf459d392006-12-02 16:19:52 +00003480 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3481 delete (yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003482 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003483 ;}
3484 break;
3485
Reid Spencer71d2ec92006-12-31 06:02:26 +00003486 case 259:
Reid Spencerf5626a32007-01-01 01:20:41 +00003487#line 1113 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003488 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003489 *O << " " << *(yyvsp[-7].String) << ' ' << *(yyvsp[-6].Type).newTy << ' ' << *(yyvsp[-5].Value).val << ", "
3490 << *(yyvsp[-3].Type).newTy << ' ' << *(yyvsp[-2].Value).val << "[]\n";
Reid Spencerf459d392006-12-02 16:19:52 +00003491 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003492 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003493 ;}
3494 break;
3495
Reid Spencer71d2ec92006-12-31 06:02:26 +00003496 case 260:
Reid Spencerf5626a32007-01-01 01:20:41 +00003497#line 1120 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003498 {
Reid Spencer16244f42006-12-01 21:10:07 +00003499 *O << " ";
3500 if (!(yyvsp[-13].String)->empty())
Reid Spencera50d5962006-12-02 04:11:07 +00003501 *O << *(yyvsp[-13].String) << " = ";
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003502 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << *(yyvsp[-10].Type).newTy << ' ' << *(yyvsp[-9].Value).val << " (";
Reid Spencerf8483652006-12-02 15:16:01 +00003503 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3504 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
3505 *O << *VI.val;
3506 if (i+1 < (yyvsp[-7].ValList)->size())
3507 *O << ", ";
3508 VI.destroy();
3509 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003510 *O << ") " << *(yyvsp[-5].String) << ' ' << *(yyvsp[-4].Type).newTy << ' ' << *(yyvsp[-3].Value).val << ' '
3511 << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Type).newTy << ' ' << *(yyvsp[0].Value).val << '\n';
Reid Spencerf459d392006-12-02 16:19:52 +00003512 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3513 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3514 (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003515 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003516 ;}
3517 break;
3518
Reid Spencer71d2ec92006-12-31 06:02:26 +00003519 case 261:
Reid Spencerf5626a32007-01-01 01:20:41 +00003520#line 1139 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003521 {
3522 *O << " " << *(yyvsp[0].String) << '\n';
3523 delete (yyvsp[0].String);
3524 (yyval.String) = 0;
3525 ;}
3526 break;
3527
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003528 case 262:
Reid Spencerf5626a32007-01-01 01:20:41 +00003529#line 1144 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003530 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003531 *O << " " << *(yyvsp[0].String) << '\n';
Reid Spencerfcb5df82006-12-01 22:34:43 +00003532 delete (yyvsp[0].String);
3533 (yyval.String) = 0;
3534 ;}
3535 break;
3536
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003537 case 263:
Reid Spencerf5626a32007-01-01 01:20:41 +00003538#line 1150 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003539 {
Reid Spencerf459d392006-12-02 16:19:52 +00003540 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3541 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003542 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003543 ;}
3544 break;
3545
Reid Spencer71d2ec92006-12-31 06:02:26 +00003546 case 264:
Reid Spencerf5626a32007-01-01 01:20:41 +00003547#line 1155 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003548 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003549 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
Reid Spencerf459d392006-12-02 16:19:52 +00003550 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3551 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003552 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003553 ;}
3554 break;
3555
Reid Spencer71d2ec92006-12-31 06:02:26 +00003556 case 265:
Reid Spencerf5626a32007-01-01 01:20:41 +00003557#line 1163 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003558 {
Reid Spencerf5626a32007-01-01 01:20:41 +00003559 if (!(yyvsp[-1].String)->empty()) {
3560 if (deleteUselessCastFlag && *deleteUselessCastName == *(yyvsp[-1].String)) {
3561 *(yyvsp[-1].String) += " = ";
3562 (yyvsp[-1].String)->insert(0, "; "); // don't actually delete it, just comment it out
3563 delete deleteUselessCastName;
3564 } else {
3565 *(yyvsp[-1].String) += " = ";
3566 }
3567 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003568 *(yyvsp[-1].String) += *(yyvsp[0].String);
3569 delete (yyvsp[0].String);
Reid Spencerf5626a32007-01-01 01:20:41 +00003570 deleteUselessCastFlag = false;
Reid Spencere77e35e2006-12-01 20:26:20 +00003571 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003572 ;}
3573 break;
3574
Reid Spencer71d2ec92006-12-31 06:02:26 +00003575 case 266:
Reid Spencerf5626a32007-01-01 01:20:41 +00003576#line 1180 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003577 { // Used for PHI nodes
Reid Spencerf459d392006-12-02 16:19:52 +00003578 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3579 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3580 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3581 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3582 (yyvsp[-3].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003583 ;}
3584 break;
3585
Reid Spencer71d2ec92006-12-31 06:02:26 +00003586 case 267:
Reid Spencerf5626a32007-01-01 01:20:41 +00003587#line 1187 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003588 {
Reid Spencerf459d392006-12-02 16:19:52 +00003589 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3590 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003591 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003592 ;}
3593 break;
3594
Reid Spencer71d2ec92006-12-31 06:02:26 +00003595 case 268:
Reid Spencerf5626a32007-01-01 01:20:41 +00003596#line 1195 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003597 {
3598 (yyval.ValList) = new ValueList();
3599 (yyval.ValList)->push_back((yyvsp[0].Value));
Reid Spencere7c3c602006-11-30 06:36:44 +00003600 ;}
3601 break;
3602
Reid Spencer71d2ec92006-12-31 06:02:26 +00003603 case 269:
Reid Spencerf5626a32007-01-01 01:20:41 +00003604#line 1199 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003605 {
3606 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3607 (yyval.ValList) = (yyvsp[-2].ValList);
3608 ;}
3609 break;
3610
Reid Spencer71d2ec92006-12-31 06:02:26 +00003611 case 270:
Reid Spencerf5626a32007-01-01 01:20:41 +00003612#line 1206 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003613 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3614 break;
3615
Reid Spencer71d2ec92006-12-31 06:02:26 +00003616 case 271:
Reid Spencerf5626a32007-01-01 01:20:41 +00003617#line 1207 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003618 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00003619 break;
3620
Reid Spencer71d2ec92006-12-31 06:02:26 +00003621 case 272:
Reid Spencerf5626a32007-01-01 01:20:41 +00003622#line 1211 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003623 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003624 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3625 delete (yyvsp[0].String);
3626 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003627 ;}
3628 break;
3629
Reid Spencer71d2ec92006-12-31 06:02:26 +00003630 case 274:
Reid Spencerf5626a32007-01-01 01:20:41 +00003631#line 1219 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003632 {
3633 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
3634 (yyval.String) = new std::string(op);
3635 *(yyval.String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3636 delete (yyvsp[-4].String); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3637 ;}
3638 break;
3639
Reid Spencer71d2ec92006-12-31 06:02:26 +00003640 case 275:
Reid Spencerf5626a32007-01-01 01:20:41 +00003641#line 1225 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003642 {
Reid Spencerf459d392006-12-02 16:19:52 +00003643 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3644 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003645 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003646 ;}
3647 break;
3648
Reid Spencer71d2ec92006-12-31 06:02:26 +00003649 case 276:
Reid Spencerf5626a32007-01-01 01:20:41 +00003650#line 1230 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003651 {
Reid Spencer229e9362006-12-02 22:14:11 +00003652 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
Reid Spencerf459d392006-12-02 16:19:52 +00003653 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3654 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003655 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003656 ;}
3657 break;
3658
Reid Spencer71d2ec92006-12-31 06:02:26 +00003659 case 277:
Reid Spencerf5626a32007-01-01 01:20:41 +00003660#line 1236 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003661 {
3662 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + "," + *(yyvsp[0].Value).val;
3663 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3664 (yyval.String) = (yyvsp[-5].String);
3665 ;}
3666 break;
3667
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003668 case 278:
Reid Spencerf5626a32007-01-01 01:20:41 +00003669#line 1241 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer229e9362006-12-02 22:14:11 +00003670 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003671 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + "," + *(yyvsp[0].Value).val;
3672 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3673 (yyval.String) = (yyvsp[-5].String);
Reid Spencer229e9362006-12-02 22:14:11 +00003674 ;}
3675 break;
3676
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003677 case 279:
Reid Spencerf5626a32007-01-01 01:20:41 +00003678#line 1246 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003679 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003680 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3681 (yyvsp[0].Value).destroy();
3682 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003683 ;}
3684 break;
3685
Reid Spencer71d2ec92006-12-31 06:02:26 +00003686 case 280:
Reid Spencerf5626a32007-01-01 01:20:41 +00003687#line 1251 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003688 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003689 const char* shiftop = (yyvsp[-3].String)->c_str();
3690 if (*(yyvsp[-3].String) == "shr")
3691 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3692 (yyval.String) = new std::string(shiftop);
3693 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3694 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003695 ;}
3696 break;
3697
Reid Spencer71d2ec92006-12-31 06:02:26 +00003698 case 281:
Reid Spencerf5626a32007-01-01 01:20:41 +00003699#line 1259 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003700 {
Reid Spencer280d8012006-12-01 23:40:53 +00003701 std::string source = *(yyvsp[-2].Value).val;
Reid Spencera50d5962006-12-02 04:11:07 +00003702 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3703 TypeInfo DstTy = (yyvsp[0].Type);
3704 ResolveType(DstTy);
3705 (yyval.String) = new std::string();
Reid Spencer280d8012006-12-01 23:40:53 +00003706 if (*(yyvsp[-3].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00003707 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
3708 } else {
3709 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003710 }
Reid Spencerf5626a32007-01-01 01:20:41 +00003711 // Check to see if this is a useless cast of a value to the same name
3712 // and the same type. Such casts will probably cause redefinition errors
3713 // when assembled and perform no code gen action so just remove them.
3714 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
3715 if ((yyvsp[-2].Value).type.isInteger() && (yyvsp[0].Type).isInteger() &&
3716 (yyvsp[-2].Value).type.getBitWidth() == (yyvsp[0].Type).getBitWidth()) {
3717 deleteUselessCastFlag = true; // Flag the "Inst" rule
3718 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
3719 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
3720 if (pos != std::string::npos) {
3721 // remove the type portion before val
3722 deleteUselessCastName->erase(0, pos);
3723 }
3724 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003725 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3726 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003727 ;}
3728 break;
3729
Reid Spencer71d2ec92006-12-31 06:02:26 +00003730 case 282:
Reid Spencerf5626a32007-01-01 01:20:41 +00003731#line 1287 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003732 {
Reid Spencer57f28f92006-12-03 07:10:26 +00003733 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3734 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3735 (yyval.String) = (yyvsp[-5].String);
3736 ;}
3737 break;
3738
Reid Spencer71d2ec92006-12-31 06:02:26 +00003739 case 283:
Reid Spencerf5626a32007-01-01 01:20:41 +00003740#line 1292 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003741 {
3742 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3743 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3744 (yyval.String) = (yyvsp[-3].String);
3745 ;}
3746 break;
3747
Reid Spencer71d2ec92006-12-31 06:02:26 +00003748 case 284:
Reid Spencerf5626a32007-01-01 01:20:41 +00003749#line 1297 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003750 {
3751 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3752 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3753 (yyval.String) = (yyvsp[-3].String);
3754 ;}
3755 break;
3756
Reid Spencer71d2ec92006-12-31 06:02:26 +00003757 case 285:
Reid Spencerf5626a32007-01-01 01:20:41 +00003758#line 1302 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003759 {
3760 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3761 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3762 (yyval.String) = (yyvsp[-5].String);
3763 ;}
3764 break;
3765
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003766 case 286:
Reid Spencerf5626a32007-01-01 01:20:41 +00003767#line 1307 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00003768 {
3769 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3770 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3771 (yyval.String) = (yyvsp[-5].String);
3772 ;}
3773 break;
3774
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003775 case 287:
Reid Spencerf5626a32007-01-01 01:20:41 +00003776#line 1312 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00003777 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003778 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3779 delete (yyvsp[0].String);
3780 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003781 ;}
3782 break;
3783
Reid Spencer71d2ec92006-12-31 06:02:26 +00003784 case 288:
Reid Spencerf5626a32007-01-01 01:20:41 +00003785#line 1317 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003786 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003787 if (!(yyvsp[-5].String)->empty())
3788 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3789 if (!(yyvsp[-6].String)->empty())
3790 *(yyvsp[-6].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003791 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
Reid Spencerf8483652006-12-02 15:16:01 +00003792 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3793 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3794 *(yyvsp[-6].String) += *VI.val;
3795 if (i+1 < (yyvsp[-1].ValList)->size())
3796 *(yyvsp[-6].String) += ", ";
3797 VI.destroy();
3798 }
3799 *(yyvsp[-6].String) += ")";
Reid Spencerf459d392006-12-02 16:19:52 +00003800 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003801 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003802 ;}
3803 break;
3804
Reid Spencer71d2ec92006-12-31 06:02:26 +00003805 case 290:
Reid Spencerf5626a32007-01-01 01:20:41 +00003806#line 1339 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003807 { (yyval.ValList) = (yyvsp[0].ValList); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003808 break;
3809
Reid Spencer71d2ec92006-12-31 06:02:26 +00003810 case 291:
Reid Spencerf5626a32007-01-01 01:20:41 +00003811#line 1340 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003812 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003813 break;
3814
Reid Spencer71d2ec92006-12-31 06:02:26 +00003815 case 293:
Reid Spencerf5626a32007-01-01 01:20:41 +00003816#line 1345 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003817 { (yyval.String) = new std::string(); ;}
3818 break;
3819
Reid Spencer71d2ec92006-12-31 06:02:26 +00003820 case 294:
Reid Spencerf5626a32007-01-01 01:20:41 +00003821#line 1348 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003822 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003823 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
Reid Spencerf7bde222006-12-01 22:26:37 +00003824 if (!(yyvsp[0].String)->empty())
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003825 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3826 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3827 (yyval.String) = (yyvsp[-2].String);
Reid Spencerf7bde222006-12-01 22:26:37 +00003828 ;}
3829 break;
3830
Reid Spencer71d2ec92006-12-31 06:02:26 +00003831 case 295:
Reid Spencerf5626a32007-01-01 01:20:41 +00003832#line 1355 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003833 {
3834 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3835 if (!(yyvsp[0].String)->empty())
3836 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3837 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3838 (yyval.String) = (yyvsp[-5].String);
3839 ;}
3840 break;
3841
Reid Spencer57f28f92006-12-03 07:10:26 +00003842 case 296:
Reid Spencerf5626a32007-01-01 01:20:41 +00003843#line 1362 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003844 {
3845 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3846 if (!(yyvsp[0].String)->empty())
3847 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3848 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3849 (yyval.String) = (yyvsp[-2].String);
3850 ;}
3851 break;
3852
Reid Spencer71d2ec92006-12-31 06:02:26 +00003853 case 297:
Reid Spencerf5626a32007-01-01 01:20:41 +00003854#line 1369 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003855 {
3856 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
3857 if (!(yyvsp[0].String)->empty())
3858 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
3859 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
3860 (yyval.String) = (yyvsp[-5].String);
3861 ;}
3862 break;
3863
Reid Spencer71d2ec92006-12-31 06:02:26 +00003864 case 298:
Reid Spencerf5626a32007-01-01 01:20:41 +00003865#line 1376 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003866 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003867 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3868 (yyvsp[0].Value).destroy();
3869 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003870 ;}
3871 break;
3872
Reid Spencer71d2ec92006-12-31 06:02:26 +00003873 case 299:
Reid Spencerf5626a32007-01-01 01:20:41 +00003874#line 1381 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003875 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003876 if (!(yyvsp[-3].String)->empty())
3877 *(yyvsp[-3].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003878 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3879 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003880 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003881 ;}
3882 break;
3883
Reid Spencer71d2ec92006-12-31 06:02:26 +00003884 case 300:
Reid Spencerf5626a32007-01-01 01:20:41 +00003885#line 1388 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003886 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003887 if (!(yyvsp[-5].String)->empty())
3888 *(yyvsp[-5].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003889 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3890 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003891 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003892 ;}
3893 break;
3894
Reid Spencer71d2ec92006-12-31 06:02:26 +00003895 case 301:
Reid Spencerf5626a32007-01-01 01:20:41 +00003896#line 1395 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003897 {
Reid Spencerf459d392006-12-02 16:19:52 +00003898 // Upgrade the indices
3899 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3900 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3901 if (VI.type.isUnsigned() && !VI.isConstant() &&
3902 VI.type.getBitWidth() < 64) {
3903 std::string* old = VI.val;
3904 *O << " %gep_upgrade" << unique << " = zext " << *old
Reid Spencer71d2ec92006-12-31 06:02:26 +00003905 << " to i64\n";
3906 VI.val = new std::string("i64 %gep_upgrade" + llvm::utostr(unique++));
Reid Spencerf459d392006-12-02 16:19:52 +00003907 VI.type.oldTy = ULongTy;
3908 delete old;
3909 }
3910 }
3911 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencerf8483652006-12-02 15:16:01 +00003912 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3913 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3914 *(yyvsp[-3].String) += ", " + *VI.val;
3915 VI.destroy();
3916 }
Reid Spencerf459d392006-12-02 16:19:52 +00003917 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003918 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003919 ;}
3920 break;
3921
3922
3923 default: break;
3924 }
3925
3926/* Line 1126 of yacc.c. */
Reid Spencerf5626a32007-01-01 01:20:41 +00003927#line 3928 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003928
3929 yyvsp -= yylen;
3930 yyssp -= yylen;
3931
3932
3933 YY_STACK_PRINT (yyss, yyssp);
3934
3935 *++yyvsp = yyval;
3936
3937
3938 /* Now `shift' the result of the reduction. Determine what state
3939 that goes to, based on the state we popped back to and the rule
3940 number reduced by. */
3941
3942 yyn = yyr1[yyn];
3943
3944 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3945 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3946 yystate = yytable[yystate];
3947 else
3948 yystate = yydefgoto[yyn - YYNTOKENS];
3949
3950 goto yynewstate;
3951
3952
3953/*------------------------------------.
3954| yyerrlab -- here on detecting error |
3955`------------------------------------*/
3956yyerrlab:
3957 /* If not already recovering from an error, report this error. */
3958 if (!yyerrstatus)
3959 {
3960 ++yynerrs;
3961#if YYERROR_VERBOSE
3962 yyn = yypact[yystate];
3963
3964 if (YYPACT_NINF < yyn && yyn < YYLAST)
3965 {
3966 int yytype = YYTRANSLATE (yychar);
3967 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3968 YYSIZE_T yysize = yysize0;
3969 YYSIZE_T yysize1;
3970 int yysize_overflow = 0;
3971 char *yymsg = 0;
3972# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3973 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3974 int yyx;
3975
3976#if 0
3977 /* This is so xgettext sees the translatable formats that are
3978 constructed on the fly. */
3979 YY_("syntax error, unexpected %s");
3980 YY_("syntax error, unexpected %s, expecting %s");
3981 YY_("syntax error, unexpected %s, expecting %s or %s");
3982 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3983 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3984#endif
3985 char *yyfmt;
3986 char const *yyf;
3987 static char const yyunexpected[] = "syntax error, unexpected %s";
3988 static char const yyexpecting[] = ", expecting %s";
3989 static char const yyor[] = " or %s";
3990 char yyformat[sizeof yyunexpected
3991 + sizeof yyexpecting - 1
3992 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3993 * (sizeof yyor - 1))];
3994 char const *yyprefix = yyexpecting;
3995
3996 /* Start YYX at -YYN if negative to avoid negative indexes in
3997 YYCHECK. */
3998 int yyxbegin = yyn < 0 ? -yyn : 0;
3999
4000 /* Stay within bounds of both yycheck and yytname. */
4001 int yychecklim = YYLAST - yyn;
4002 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4003 int yycount = 1;
4004
4005 yyarg[0] = yytname[yytype];
4006 yyfmt = yystpcpy (yyformat, yyunexpected);
4007
4008 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4009 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4010 {
4011 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4012 {
4013 yycount = 1;
4014 yysize = yysize0;
4015 yyformat[sizeof yyunexpected - 1] = '\0';
4016 break;
4017 }
4018 yyarg[yycount++] = yytname[yyx];
4019 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4020 yysize_overflow |= yysize1 < yysize;
4021 yysize = yysize1;
4022 yyfmt = yystpcpy (yyfmt, yyprefix);
4023 yyprefix = yyor;
4024 }
4025
4026 yyf = YY_(yyformat);
4027 yysize1 = yysize + yystrlen (yyf);
4028 yysize_overflow |= yysize1 < yysize;
4029 yysize = yysize1;
4030
4031 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4032 yymsg = (char *) YYSTACK_ALLOC (yysize);
4033 if (yymsg)
4034 {
4035 /* Avoid sprintf, as that infringes on the user's name space.
4036 Don't have undefined behavior even if the translation
4037 produced a string with the wrong number of "%s"s. */
4038 char *yyp = yymsg;
4039 int yyi = 0;
4040 while ((*yyp = *yyf))
4041 {
4042 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4043 {
4044 yyp += yytnamerr (yyp, yyarg[yyi++]);
4045 yyf += 2;
4046 }
4047 else
4048 {
4049 yyp++;
4050 yyf++;
4051 }
4052 }
4053 yyerror (yymsg);
4054 YYSTACK_FREE (yymsg);
4055 }
4056 else
4057 {
4058 yyerror (YY_("syntax error"));
4059 goto yyexhaustedlab;
4060 }
4061 }
4062 else
4063#endif /* YYERROR_VERBOSE */
4064 yyerror (YY_("syntax error"));
4065 }
4066
4067
4068
4069 if (yyerrstatus == 3)
4070 {
4071 /* If just tried and failed to reuse look-ahead token after an
4072 error, discard it. */
4073
4074 if (yychar <= YYEOF)
4075 {
4076 /* Return failure if at end of input. */
4077 if (yychar == YYEOF)
4078 YYABORT;
4079 }
4080 else
4081 {
4082 yydestruct ("Error: discarding", yytoken, &yylval);
4083 yychar = YYEMPTY;
4084 }
4085 }
4086
4087 /* Else will try to reuse look-ahead token after shifting the error
4088 token. */
4089 goto yyerrlab1;
4090
4091
4092/*---------------------------------------------------.
4093| yyerrorlab -- error raised explicitly by YYERROR. |
4094`---------------------------------------------------*/
4095yyerrorlab:
4096
4097 /* Pacify compilers like GCC when the user code never invokes
4098 YYERROR and the label yyerrorlab therefore never appears in user
4099 code. */
4100 if (0)
4101 goto yyerrorlab;
4102
4103yyvsp -= yylen;
4104 yyssp -= yylen;
4105 yystate = *yyssp;
4106 goto yyerrlab1;
4107
4108
4109/*-------------------------------------------------------------.
4110| yyerrlab1 -- common code for both syntax error and YYERROR. |
4111`-------------------------------------------------------------*/
4112yyerrlab1:
4113 yyerrstatus = 3; /* Each real token shifted decrements this. */
4114
4115 for (;;)
4116 {
4117 yyn = yypact[yystate];
4118 if (yyn != YYPACT_NINF)
4119 {
4120 yyn += YYTERROR;
4121 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4122 {
4123 yyn = yytable[yyn];
4124 if (0 < yyn)
4125 break;
4126 }
4127 }
4128
4129 /* Pop the current state because it cannot handle the error token. */
4130 if (yyssp == yyss)
4131 YYABORT;
4132
4133
4134 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4135 YYPOPSTACK;
4136 yystate = *yyssp;
4137 YY_STACK_PRINT (yyss, yyssp);
4138 }
4139
4140 if (yyn == YYFINAL)
4141 YYACCEPT;
4142
4143 *++yyvsp = yylval;
4144
4145
4146 /* Shift the error token. */
4147 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4148
4149 yystate = yyn;
4150 goto yynewstate;
4151
4152
4153/*-------------------------------------.
4154| yyacceptlab -- YYACCEPT comes here. |
4155`-------------------------------------*/
4156yyacceptlab:
4157 yyresult = 0;
4158 goto yyreturn;
4159
4160/*-----------------------------------.
4161| yyabortlab -- YYABORT comes here. |
4162`-----------------------------------*/
4163yyabortlab:
4164 yyresult = 1;
4165 goto yyreturn;
4166
4167#ifndef yyoverflow
4168/*-------------------------------------------------.
4169| yyexhaustedlab -- memory exhaustion comes here. |
4170`-------------------------------------------------*/
4171yyexhaustedlab:
4172 yyerror (YY_("memory exhausted"));
4173 yyresult = 2;
4174 /* Fall through. */
4175#endif
4176
4177yyreturn:
4178 if (yychar != YYEOF && yychar != YYEMPTY)
4179 yydestruct ("Cleanup: discarding lookahead",
4180 yytoken, &yylval);
4181 while (yyssp != yyss)
4182 {
4183 yydestruct ("Cleanup: popping",
4184 yystos[*yyssp], yyvsp);
4185 YYPOPSTACK;
4186 }
4187#ifndef yyoverflow
4188 if (yyss != yyssa)
4189 YYSTACK_FREE (yyss);
4190#endif
4191 return yyresult;
4192}
4193
4194
Reid Spencerf5626a32007-01-01 01:20:41 +00004195#line 1419 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004196
4197
4198int yyerror(const char *ErrorMsg) {
4199 std::string where
4200 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4201 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4202 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4203 if (yychar == YYEMPTY || yychar == 0)
4204 errMsg += "end-of-file.";
4205 else
4206 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
Reid Spencer71d2ec92006-12-31 06:02:26 +00004207 std::cerr << "llvm-upgrade: " << errMsg << '\n';
Reid Spencere7c3c602006-11-30 06:36:44 +00004208 exit(1);
4209}
4210