blob: e243074ae661f5d89b1f5c3ca194f386cca5c1f2 [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"
Reid Spencere7c3c602006-11-30 06:36:44 +0000374#include <algorithm>
Reid Spencera50d5962006-12-02 04:11:07 +0000375#include <map>
Reid Spencere7c3c602006-11-30 06:36:44 +0000376#include <utility>
377#include <iostream>
378
Reid Spencere77e35e2006-12-01 20:26:20 +0000379#define YYERROR_VERBOSE 1
Reid Spencer96839be2006-11-30 16:50:26 +0000380#define YYINCLUDED_STDLIB_H
Reid Spencere77e35e2006-12-01 20:26:20 +0000381#define YYDEBUG 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000382
383int yylex(); // declaration" of xxx warnings.
384int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000385extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000386
387static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000388static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000389std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000390unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000391static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000392
Reid Spencer71d2ec92006-12-31 06:02:26 +0000393// This bool controls whether attributes are ever added to function declarations
394// definitions and calls.
395static bool AddAttributes = false;
396
Reid Spencerf5626a32007-01-01 01:20:41 +0000397// This bool is used to communicate between the InstVal and Inst rules about
398// whether or not a cast should be deleted. When the flag is set, InstVal has
399// determined that the cast is a candidate. However, it can only be deleted if
400// the value being casted is the same value name as the instruction. The Inst
401// rule makes that comparison if the flag is set and comments out the
402// instruction if they match.
403static bool deleteUselessCastFlag = false;
404static std::string* deleteUselessCastName = 0;
405
Reid Spencera50d5962006-12-02 04:11:07 +0000406typedef std::vector<TypeInfo> TypeVector;
407static TypeVector EnumeratedTypes;
408typedef std::map<std::string,TypeInfo> TypeMap;
409static TypeMap NamedTypes;
Reid Spencerf12ee422006-12-05 19:21:25 +0000410static TypeMap Globals;
Reid Spencera50d5962006-12-02 04:11:07 +0000411
Reid Spencerf8483652006-12-02 15:16:01 +0000412void destroy(ValueList* VL) {
413 while (!VL->empty()) {
414 ValueInfo& VI = VL->back();
415 VI.destroy();
416 VL->pop_back();
417 }
418 delete VL;
419}
420
Reid Spencer96839be2006-11-30 16:50:26 +0000421void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000422 std::ostream &out, bool debug, bool addAttrs)
Reid Spencere7c3c602006-11-30 06:36:44 +0000423{
424 Upgradelineno = 1;
425 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000426 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000427 yydebug = debug;
Reid Spencer71d2ec92006-12-31 06:02:26 +0000428 AddAttributes = addAttrs;
Reid Spencere7c3c602006-11-30 06:36:44 +0000429 O = &out;
430
431 if (yyparse()) {
432 std::cerr << "Parse failed.\n";
433 exit(1);
434 }
435}
436
Reid Spencer52402b02007-01-02 05:45:11 +0000437TypeInfo* ResolveType(TypeInfo*& Ty) {
438 if (Ty->isUnresolved()) {
439 TypeMap::iterator I = NamedTypes.find(Ty->getNewTy());
Reid Spencer78720742006-12-02 20:21:22 +0000440 if (I != NamedTypes.end()) {
Reid Spencer52402b02007-01-02 05:45:11 +0000441 Ty = I->second.clone();
442 return Ty;
Reid Spencer78720742006-12-02 20:21:22 +0000443 } else {
Reid Spencer52402b02007-01-02 05:45:11 +0000444 std::string msg("Cannot resolve type: ");
445 msg += Ty->getNewTy();
Reid Spencera50d5962006-12-02 04:11:07 +0000446 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000447 }
Reid Spencer52402b02007-01-02 05:45:11 +0000448 } else if (Ty->isNumeric()) {
449 unsigned ref = atoi(&((Ty->getNewTy().c_str())[1])); // Skip the '\\'
Reid Spencera50d5962006-12-02 04:11:07 +0000450 if (ref < EnumeratedTypes.size()) {
Reid Spencer52402b02007-01-02 05:45:11 +0000451 Ty = EnumeratedTypes[ref].clone();
452 return Ty;
Reid Spencera50d5962006-12-02 04:11:07 +0000453 } else {
454 std::string msg("Can't resolve type: ");
Reid Spencer52402b02007-01-02 05:45:11 +0000455 msg += Ty->getNewTy();
Reid Spencera50d5962006-12-02 04:11:07 +0000456 yyerror(msg.c_str());
457 }
Reid Spencer280d8012006-12-01 23:40:53 +0000458 }
Reid Spencera50d5962006-12-02 04:11:07 +0000459 // otherwise its already resolved.
Reid Spencer52402b02007-01-02 05:45:11 +0000460 return Ty;
Reid Spencer280d8012006-12-01 23:40:53 +0000461}
462
Reid Spencera50d5962006-12-02 04:11:07 +0000463static const char* getCastOpcode(
Reid Spencer52402b02007-01-02 05:45:11 +0000464 std::string& Source, const TypeInfo* SrcTy, const TypeInfo* DstTy)
Reid Spencera50d5962006-12-02 04:11:07 +0000465{
Reid Spencer52402b02007-01-02 05:45:11 +0000466 unsigned SrcBits = SrcTy->getBitWidth();
467 unsigned DstBits = DstTy->getBitWidth();
Reid Spencere77e35e2006-12-01 20:26:20 +0000468 const char* opcode = "bitcast";
469 // Run through the possibilities ...
Reid Spencer52402b02007-01-02 05:45:11 +0000470 if (DstTy->isIntegral()) { // Casting to integral
471 if (SrcTy->isIntegral()) { // Casting from integral
Reid Spencere77e35e2006-12-01 20:26:20 +0000472 if (DstBits < SrcBits)
473 opcode = "trunc";
474 else if (DstBits > SrcBits) { // its an extension
Reid Spencer52402b02007-01-02 05:45:11 +0000475 if (SrcTy->isSigned())
Reid Spencere77e35e2006-12-01 20:26:20 +0000476 opcode ="sext"; // signed -> SEXT
477 else
478 opcode = "zext"; // unsigned -> ZEXT
479 } else {
480 opcode = "bitcast"; // Same size, No-op cast
481 }
Reid Spencer52402b02007-01-02 05:45:11 +0000482 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
483 if (DstTy->isSigned())
Reid Spencere77e35e2006-12-01 20:26:20 +0000484 opcode = "fptosi"; // FP -> sint
485 else
486 opcode = "fptoui"; // FP -> uint
Reid Spencer52402b02007-01-02 05:45:11 +0000487 } else if (SrcTy->isPacked()) {
488 assert(DstBits == SrcTy->getBitWidth() &&
Reid Spencere77e35e2006-12-01 20:26:20 +0000489 "Casting packed to integer of different width");
490 opcode = "bitcast"; // same size, no-op cast
491 } else {
Reid Spencer52402b02007-01-02 05:45:11 +0000492 assert(SrcTy->isPointer() &&
Reid Spencere77e35e2006-12-01 20:26:20 +0000493 "Casting from a value that is not first-class type");
494 opcode = "ptrtoint"; // ptr -> int
495 }
Reid Spencer52402b02007-01-02 05:45:11 +0000496 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
497 if (SrcTy->isIntegral()) { // Casting from integral
498 if (SrcTy->isSigned())
Reid Spencere77e35e2006-12-01 20:26:20 +0000499 opcode = "sitofp"; // sint -> FP
500 else
501 opcode = "uitofp"; // uint -> FP
Reid Spencer52402b02007-01-02 05:45:11 +0000502 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
Reid Spencere77e35e2006-12-01 20:26:20 +0000503 if (DstBits < SrcBits) {
504 opcode = "fptrunc"; // FP -> smaller FP
505 } else if (DstBits > SrcBits) {
506 opcode = "fpext"; // FP -> larger FP
507 } else {
508 opcode ="bitcast"; // same size, no-op cast
509 }
Reid Spencer52402b02007-01-02 05:45:11 +0000510 } else if (SrcTy->isPacked()) {
511 assert(DstBits == SrcTy->getBitWidth() &&
Reid Spencere77e35e2006-12-01 20:26:20 +0000512 "Casting packed to floating point of different width");
513 opcode = "bitcast"; // same size, no-op cast
514 } else {
515 assert(0 && "Casting pointer or non-first class to float");
516 }
Reid Spencer52402b02007-01-02 05:45:11 +0000517 } else if (DstTy->isPacked()) {
518 if (SrcTy->isPacked()) {
519 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
Reid Spencere77e35e2006-12-01 20:26:20 +0000520 "Casting packed to packed of different widths");
521 opcode = "bitcast"; // packed -> packed
Reid Spencer52402b02007-01-02 05:45:11 +0000522 } else if (DstTy->getBitWidth() == SrcBits) {
Reid Spencere77e35e2006-12-01 20:26:20 +0000523 opcode = "bitcast"; // float/int -> packed
524 } else {
525 assert(!"Illegal cast to packed (wrong type or size)");
526 }
Reid Spencer52402b02007-01-02 05:45:11 +0000527 } else if (DstTy->isPointer()) {
528 if (SrcTy->isPointer()) {
Reid Spencere77e35e2006-12-01 20:26:20 +0000529 opcode = "bitcast"; // ptr -> ptr
Reid Spencer52402b02007-01-02 05:45:11 +0000530 } else if (SrcTy->isIntegral()) {
Reid Spencere77e35e2006-12-01 20:26:20 +0000531 opcode = "inttoptr"; // int -> ptr
532 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000533 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000534 }
535 } else {
536 assert(!"Casting to type that is not first-class");
537 }
538 return opcode;
539}
540
Reid Spencer52402b02007-01-02 05:45:11 +0000541static std::string getCastUpgrade(const std::string& Src, TypeInfo* SrcTy,
542 TypeInfo* DstTy, bool isConst)
Reid Spencera50d5962006-12-02 04:11:07 +0000543{
544 std::string Result;
545 std::string Source = Src;
Reid Spencer52402b02007-01-02 05:45:11 +0000546 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
Reid Spencera50d5962006-12-02 04:11:07 +0000547 // fp -> ptr cast is no longer supported but we must upgrade this
548 // by doing a double cast: fp -> int -> ptr
549 if (isConst)
Reid Spencer71d2ec92006-12-31 06:02:26 +0000550 Source = "i64 fptoui(" + Source + " to i64)";
Reid Spencera50d5962006-12-02 04:11:07 +0000551 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000552 *O << " %cast_upgrade" << unique << " = fptoui " << Source
Reid Spencer71d2ec92006-12-31 06:02:26 +0000553 << " to i64\n";
554 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000555 }
556 // Update the SrcTy for the getCastOpcode call below
Reid Spencer52402b02007-01-02 05:45:11 +0000557 delete SrcTy;
558 SrcTy = new TypeInfo("i64", ULongTy);
559 } else if (DstTy->isBool()) {
560 // cast type %x to bool was previously defined as setne type %x, null
561 // The cast semantic is now to truncate, not compare so we must retain
562 // the original intent by replacing the cast with a setne
563 const char* comparator = SrcTy->isPointer() ? ", null" :
564 (SrcTy->isFloatingPoint() ? ", 0.0" :
565 (SrcTy->isBool() ? ", false" : ", 0"));
566 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
Reid Spencer187ccf82006-12-09 16:57:22 +0000567 if (isConst) {
568 Result = "(" + Source + comparator + ")";
569 Result = compareOp + Result;
570 } else
571 Result = compareOp + Source + comparator;
Reid Spencera50d5962006-12-02 04:11:07 +0000572 return Result; // skip cast processing below
573 }
574 ResolveType(SrcTy);
575 ResolveType(DstTy);
576 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
577 if (isConst)
Reid Spencer52402b02007-01-02 05:45:11 +0000578 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
Reid Spencera50d5962006-12-02 04:11:07 +0000579 else
Reid Spencer52402b02007-01-02 05:45:11 +0000580 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
Reid Spencera50d5962006-12-02 04:11:07 +0000581 return Result;
582}
583
Reid Spencer52402b02007-01-02 05:45:11 +0000584const char* getDivRemOpcode(const std::string& opcode, TypeInfo* TI) {
Reid Spencer78720742006-12-02 20:21:22 +0000585 const char* op = opcode.c_str();
Reid Spencer52402b02007-01-02 05:45:11 +0000586 const TypeInfo* Ty = ResolveType(TI);
587 if (Ty->isPacked())
588 Ty = Ty->getElementType();
Reid Spencer78720742006-12-02 20:21:22 +0000589 if (opcode == "div")
Reid Spencer52402b02007-01-02 05:45:11 +0000590 if (Ty->isFloatingPoint())
Reid Spencer78720742006-12-02 20:21:22 +0000591 op = "fdiv";
Reid Spencer52402b02007-01-02 05:45:11 +0000592 else if (Ty->isUnsigned())
Reid Spencer78720742006-12-02 20:21:22 +0000593 op = "udiv";
Reid Spencer52402b02007-01-02 05:45:11 +0000594 else if (Ty->isSigned())
Reid Spencer78720742006-12-02 20:21:22 +0000595 op = "sdiv";
596 else
597 yyerror("Invalid type for div instruction");
598 else if (opcode == "rem")
Reid Spencer52402b02007-01-02 05:45:11 +0000599 if (Ty->isFloatingPoint())
Reid Spencer78720742006-12-02 20:21:22 +0000600 op = "frem";
Reid Spencer52402b02007-01-02 05:45:11 +0000601 else if (Ty->isUnsigned())
Reid Spencer78720742006-12-02 20:21:22 +0000602 op = "urem";
Reid Spencer52402b02007-01-02 05:45:11 +0000603 else if (Ty->isSigned())
Reid Spencer78720742006-12-02 20:21:22 +0000604 op = "srem";
605 else
606 yyerror("Invalid type for rem instruction");
607 return op;
608}
Reid Spencere7c3c602006-11-30 06:36:44 +0000609
Reid Spencer229e9362006-12-02 22:14:11 +0000610std::string
Reid Spencer52402b02007-01-02 05:45:11 +0000611getCompareOp(const std::string& setcc, const TypeInfo* TI) {
Reid Spencer229e9362006-12-02 22:14:11 +0000612 assert(setcc.length() == 5);
613 char cc1 = setcc[3];
614 char cc2 = setcc[4];
615 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
616 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
617 std::string result("xcmp xxx");
618 result[6] = cc1;
619 result[7] = cc2;
Reid Spencer52402b02007-01-02 05:45:11 +0000620 if (TI->isFloatingPoint()) {
Reid Spencer229e9362006-12-02 22:14:11 +0000621 result[0] = 'f';
Reid Spencere4d87aa2006-12-23 06:05:41 +0000622 result[5] = 'o';
Reid Spencerf0cf1322006-12-07 04:23:03 +0000623 if (cc1 == 'n')
624 result[5] = 'u'; // NE maps to unordered
625 else
626 result[5] = 'o'; // everything else maps to ordered
Reid Spencer52402b02007-01-02 05:45:11 +0000627 } else if (TI->isIntegral() || TI->isPointer()) {
Reid Spencer229e9362006-12-02 22:14:11 +0000628 result[0] = 'i';
629 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
630 result.erase(5,1);
Reid Spencer52402b02007-01-02 05:45:11 +0000631 else if (TI->isSigned())
Reid Spencer229e9362006-12-02 22:14:11 +0000632 result[5] = 's';
Reid Spencer52402b02007-01-02 05:45:11 +0000633 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
Reid Spencer229e9362006-12-02 22:14:11 +0000634 result[5] = 'u';
635 else
636 yyerror("Invalid integral type for setcc");
637 }
638 return result;
639}
640
Reid Spencer52402b02007-01-02 05:45:11 +0000641static TypeInfo* getFunctionReturnType(TypeInfo* PFTy) {
642 ResolveType(PFTy);
643 if (PFTy->isPointer()) {
644 TypeInfo* ElemTy = PFTy->getElementType();
645 ResolveType(ElemTy);
646 if (ElemTy->isFunction())
647 return ElemTy->getResultType()->clone();
648 } else if (PFTy->isFunction()) {
649 return PFTy->getResultType()->clone();
650 }
651 return PFTy->clone();
652}
653
654static TypeInfo* getGEPIndexedType(TypeInfo* PTy, ValueList* idxs) {
655 ResolveType(PTy);
656 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
657 TypeInfo* Result = PTy->getElementType(); // just skip first index
658 ResolveType(Result);
659 for (unsigned i = 1; i < idxs->size(); ++i) {
660 if (Result->isComposite()) {
661 Result = Result->getIndexedType((*idxs)[i]);
662 ResolveType(Result);
663 } else
664 yyerror("Invalid type for index");
665 }
666 return Result->getPointerType();
667}
668
669static std::string makeUniqueName(const std::string *Name, bool isSigned) {
670 const char *suffix = ".u";
671 if (isSigned)
672 suffix = ".s";
673 if ((*Name)[Name->size()-1] == '"') {
674 std::string Result(*Name);
675 Result.insert(Name->size()-1, suffix);
676 return Result;
677 }
678 return *Name + suffix;
679}
680
681// This function handles appending .u or .s to integer value names that
682// were previously unsigned or signed, respectively. This avoids name
683// collisions since the unsigned and signed type planes have collapsed
684// into a single signless type plane.
685static std::string getUniqueName(const std::string *Name, TypeInfo* Ty) {
686 // If its not a symbolic name, don't modify it, probably a constant val.
687 if ((*Name)[0] != '%' && (*Name)[0] != '"')
688 return *Name;
689 // If its a numeric reference, just leave it alone.
690 if (isdigit((*Name)[1]))
691 return *Name;
692
693 // Resolve the type
694 ResolveType(Ty);
695
696 // Default the result to the current name
697 std::string Result = *Name;
698
699 if (Ty->isInteger()) {
700 // If its an integer type, make the name unique
701 Result = makeUniqueName(Name, Ty->isSigned());
702 } else if (Ty->isPointer()) {
703 while (Ty->isPointer())
704 Ty = Ty->getElementType();
705 if (Ty->isInteger())
706 Result = makeUniqueName(Name, Ty->isSigned());
707 }
708 return Result;
709}
710
Reid Spencer229e9362006-12-02 22:14:11 +0000711
Reid Spencere7c3c602006-11-30 06:36:44 +0000712
713/* Enabling traces. */
714#ifndef YYDEBUG
715# define YYDEBUG 0
716#endif
717
718/* Enabling verbose error messages. */
719#ifdef YYERROR_VERBOSE
720# undef YYERROR_VERBOSE
721# define YYERROR_VERBOSE 1
722#else
723# define YYERROR_VERBOSE 0
724#endif
725
726/* Enabling the token table. */
727#ifndef YYTOKEN_TABLE
728# define YYTOKEN_TABLE 0
729#endif
730
731#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer52402b02007-01-02 05:45:11 +0000732#line 357 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +0000733typedef union YYSTYPE {
734 std::string* String;
Reid Spencer52402b02007-01-02 05:45:11 +0000735 TypeInfo* Type;
Reid Spencere77e35e2006-12-01 20:26:20 +0000736 ValueInfo Value;
737 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000738 ValueList* ValList;
Reid Spencer52402b02007-01-02 05:45:11 +0000739 TypeList* TypeVec;
Reid Spencere77e35e2006-12-01 20:26:20 +0000740} YYSTYPE;
741/* Line 196 of yacc.c. */
Reid Spencer52402b02007-01-02 05:45:11 +0000742#line 743 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000743# define yystype YYSTYPE /* obsolescent; will be withdrawn */
744# define YYSTYPE_IS_DECLARED 1
745# define YYSTYPE_IS_TRIVIAL 1
746#endif
747
748
749
750/* Copy the second part of user declarations. */
751
752
753/* Line 219 of yacc.c. */
Reid Spencer52402b02007-01-02 05:45:11 +0000754#line 755 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000755
756#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
757# define YYSIZE_T __SIZE_TYPE__
758#endif
759#if ! defined (YYSIZE_T) && defined (size_t)
760# define YYSIZE_T size_t
761#endif
762#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
763# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
764# define YYSIZE_T size_t
765#endif
766#if ! defined (YYSIZE_T)
767# define YYSIZE_T unsigned int
768#endif
769
770#ifndef YY_
771# if YYENABLE_NLS
772# if ENABLE_NLS
773# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
774# define YY_(msgid) dgettext ("bison-runtime", msgid)
775# endif
776# endif
777# ifndef YY_
778# define YY_(msgid) msgid
779# endif
780#endif
781
782#if ! defined (yyoverflow) || YYERROR_VERBOSE
783
784/* The parser invokes alloca or malloc; define the necessary symbols. */
785
786# ifdef YYSTACK_USE_ALLOCA
787# if YYSTACK_USE_ALLOCA
788# ifdef __GNUC__
789# define YYSTACK_ALLOC __builtin_alloca
790# else
791# define YYSTACK_ALLOC alloca
792# if defined (__STDC__) || defined (__cplusplus)
793# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
794# define YYINCLUDED_STDLIB_H
795# endif
796# endif
797# endif
798# endif
799
800# ifdef YYSTACK_ALLOC
801 /* Pacify GCC's `empty if-body' warning. */
802# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
803# ifndef YYSTACK_ALLOC_MAXIMUM
804 /* The OS might guarantee only one guard page at the bottom of the stack,
805 and a page size can be as small as 4096 bytes. So we cannot safely
806 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
807 to allow for a few compiler-allocated temporary stack slots. */
808# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
809# endif
810# else
811# define YYSTACK_ALLOC YYMALLOC
812# define YYSTACK_FREE YYFREE
813# ifndef YYSTACK_ALLOC_MAXIMUM
814# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
815# endif
816# ifdef __cplusplus
817extern "C" {
818# endif
819# ifndef YYMALLOC
820# define YYMALLOC malloc
821# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
822 && (defined (__STDC__) || defined (__cplusplus)))
823void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
824# endif
825# endif
826# ifndef YYFREE
827# define YYFREE free
828# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
829 && (defined (__STDC__) || defined (__cplusplus)))
830void free (void *); /* INFRINGES ON USER NAME SPACE */
831# endif
832# endif
833# ifdef __cplusplus
834}
835# endif
836# endif
837#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
838
839
840#if (! defined (yyoverflow) \
841 && (! defined (__cplusplus) \
842 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
843
844/* A type that is properly aligned for any stack member. */
845union yyalloc
846{
847 short int yyss;
848 YYSTYPE yyvs;
849 };
850
851/* The size of the maximum gap between one aligned stack and the next. */
852# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
853
854/* The size of an array large to enough to hold all stacks, each with
855 N elements. */
856# define YYSTACK_BYTES(N) \
857 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
858 + YYSTACK_GAP_MAXIMUM)
859
860/* Copy COUNT objects from FROM to TO. The source and destination do
861 not overlap. */
862# ifndef YYCOPY
863# if defined (__GNUC__) && 1 < __GNUC__
864# define YYCOPY(To, From, Count) \
865 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
866# else
867# define YYCOPY(To, From, Count) \
868 do \
869 { \
870 YYSIZE_T yyi; \
871 for (yyi = 0; yyi < (Count); yyi++) \
872 (To)[yyi] = (From)[yyi]; \
873 } \
874 while (0)
875# endif
876# endif
877
878/* Relocate STACK from its old location to the new one. The
879 local variables YYSIZE and YYSTACKSIZE give the old and new number of
880 elements in the stack, and YYPTR gives the new location of the
881 stack. Advance YYPTR to a properly aligned location for the next
882 stack. */
883# define YYSTACK_RELOCATE(Stack) \
884 do \
885 { \
886 YYSIZE_T yynewbytes; \
887 YYCOPY (&yyptr->Stack, Stack, yysize); \
888 Stack = &yyptr->Stack; \
889 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
890 yyptr += yynewbytes / sizeof (*yyptr); \
891 } \
892 while (0)
893
894#endif
895
896#if defined (__STDC__) || defined (__cplusplus)
897 typedef signed char yysigned_char;
898#else
899 typedef short int yysigned_char;
900#endif
901
902/* YYFINAL -- State number of the termination state. */
903#define YYFINAL 4
904/* YYLAST -- Last index in YYTABLE. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000905#define YYLAST 1486
Reid Spencere7c3c602006-11-30 06:36:44 +0000906
907/* YYNTOKENS -- Number of terminals. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000908#define YYNTOKENS 165
Reid Spencere7c3c602006-11-30 06:36:44 +0000909/* YYNNTS -- Number of nonterminals. */
Reid Spencer229e9362006-12-02 22:14:11 +0000910#define YYNNTS 75
Reid Spencere7c3c602006-11-30 06:36:44 +0000911/* YYNRULES -- Number of rules. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000912#define YYNRULES 301
Reid Spencere7c3c602006-11-30 06:36:44 +0000913/* YYNRULES -- Number of states. */
Reid Spencer71d2ec92006-12-31 06:02:26 +0000914#define YYNSTATES 586
Reid Spencere7c3c602006-11-30 06:36:44 +0000915
916/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
917#define YYUNDEFTOK 2
Reid Spencer71d2ec92006-12-31 06:02:26 +0000918#define YYMAXUTOK 405
Reid Spencere7c3c602006-11-30 06:36:44 +0000919
920#define YYTRANSLATE(YYX) \
921 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
922
923/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
924static const unsigned char yytranslate[] =
925{
926 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
927 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
928 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
929 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000930 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000931 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000932 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000933 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
934 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000935 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
Reid Spencere7c3c602006-11-30 06:36:44 +0000936 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
937 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000938 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000939 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
940 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
941 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
942 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
943 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
944 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
945 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
946 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
947 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
948 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
949 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
950 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
951 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
952 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
953 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
954 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
955 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
956 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
957 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
958 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
959 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
960 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
961 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000962 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
Reid Spencer78720742006-12-02 20:21:22 +0000963 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
Reid Spencer229e9362006-12-02 22:14:11 +0000964 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
965 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000966 145, 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +0000967};
968
969#if YYDEBUG
970/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
971 YYRHS. */
972static const unsigned short int yyprhs[] =
973{
974 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
975 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
976 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
977 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000978 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
Reid Spencer229e9362006-12-02 22:14:11 +0000979 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
980 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
Reid Spencer57f28f92006-12-03 07:10:26 +0000981 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
982 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
983 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
984 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
Reid Spencer229e9362006-12-02 22:14:11 +0000985 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
Reid Spencer57f28f92006-12-03 07:10:26 +0000986 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000987 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
988 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
989 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
990 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
991 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
992 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
993 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
994 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
995 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
Reid Spencer71d2ec92006-12-31 06:02:26 +0000996 619, 623, 625, 627, 631, 632, 634, 636, 640, 641,
997 643, 645, 647, 649, 651, 653, 655, 657, 659, 663,
998 665, 671, 673, 675, 677, 679, 682, 685, 687, 690,
999 693, 694, 696, 698, 700, 703, 706, 710, 720, 730,
1000 739, 754, 756, 758, 765, 771, 774, 781, 789, 791,
1001 795, 797, 798, 801, 803, 809, 815, 821, 828, 835,
1002 838, 843, 848, 855, 860, 865, 872, 879, 882, 890,
1003 892, 895, 896, 898, 899, 903, 910, 914, 921, 924,
1004 929, 936
Reid Spencere7c3c602006-11-30 06:36:44 +00001005};
1006
1007/* YYRHS -- A `-1'-separated list of the rules' RHS. */
1008static const short int yyrhs[] =
1009{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001010 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
1011 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1012 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
1013 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
1014 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
1015 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1016 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
1017 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
1018 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
1019 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
1020 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
1021 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
1022 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
1023 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
Reid Spencer57f28f92006-12-03 07:10:26 +00001024 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001025 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
1026 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
1027 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
1028 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
1029 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
1030 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
1031 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
1032 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
Reid Spencer57f28f92006-12-03 07:10:26 +00001033 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
1034 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001035 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
1036 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
1037 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
1038 -1, 161, 193, 162, -1, 161, 162, -1, 159, 161,
1039 193, 162, 160, -1, 159, 161, 162, 160, -1, 192,
1040 163, -1, 192, -1, 193, 152, 192, -1, 193, -1,
1041 193, 152, 40, -1, 40, -1, -1, 190, 156, 197,
1042 158, -1, 190, 156, 158, -1, 190, 164, 30, -1,
1043 190, 159, 197, 160, -1, 190, 161, 197, 162, -1,
1044 190, 161, 162, -1, 190, 22, -1, 190, 23, -1,
1045 190, 222, -1, 190, 196, -1, 190, 24, -1, 175,
1046 167, -1, 176, 18, -1, 4, 25, -1, 4, 26,
1047 -1, 178, 21, -1, 174, 154, 195, 39, 190, 155,
1048 -1, 127, 154, 195, 237, 155, -1, 129, 154, 195,
1049 152, 195, 152, 195, 155, -1, 168, 154, 195, 152,
1050 195, 155, -1, 169, 154, 195, 152, 195, 155, -1,
1051 170, 154, 195, 152, 195, 155, -1, 100, 171, 154,
1052 195, 152, 195, 155, -1, 101, 172, 154, 195, 152,
1053 195, 155, -1, 173, 154, 195, 152, 195, 155, -1,
1054 135, 154, 195, 152, 195, 155, -1, 136, 154, 195,
1055 152, 195, 152, 195, 155, -1, 137, 154, 195, 152,
1056 195, 152, 195, 155, -1, 197, 152, 195, -1, 195,
1057 -1, 35, -1, 36, -1, 200, -1, 200, 217, -1,
1058 200, 219, -1, 200, 63, 62, 203, -1, 200, 31,
1059 -1, 202, -1, 50, -1, 58, -1, 202, 179, 27,
1060 188, -1, 202, 219, -1, 202, 63, 62, 203, -1,
1061 202, 179, 180, 198, 195, 186, -1, 202, 179, 201,
1062 198, 190, 186, -1, 202, 179, 45, 198, 190, 186,
1063 -1, 202, 179, 47, 198, 190, 186, -1, 202, 51,
1064 205, -1, 202, 59, 151, 206, -1, -1, 30, -1,
1065 56, -1, 55, -1, 53, 151, 204, -1, 54, 151,
1066 18, -1, 52, 151, 30, -1, 72, 151, 30, -1,
1067 156, 207, 158, -1, 207, 152, 30, -1, 30, -1,
1068 -1, 28, -1, 30, -1, 208, -1, -1, 190, 209,
1069 -1, 211, 152, 210, -1, 210, -1, 211, -1, 211,
1070 152, 40, -1, 40, -1, -1, 181, 188, 208, 154,
1071 212, 155, 185, 182, -1, 32, -1, 161, -1, 180,
1072 213, 214, -1, 33, -1, 162, -1, 215, 225, 216,
1073 -1, -1, 45, -1, 47, -1, 34, 218, 213, -1,
1074 -1, 64, -1, 17, -1, 18, -1, 21, -1, 25,
1075 -1, 26, -1, 22, -1, 23, -1, 24, -1, 159,
1076 197, 160, -1, 196, -1, 62, 220, 30, 152, 30,
1077 -1, 166, -1, 208, -1, 222, -1, 221, -1, 190,
1078 223, -1, 225, 226, -1, 226, -1, 227, 229, -1,
1079 227, 231, -1, -1, 29, -1, 78, -1, 77, -1,
1080 73, 224, -1, 73, 3, -1, 74, 15, 223, -1,
1081 74, 4, 223, 152, 15, 223, 152, 15, 223, -1,
1082 75, 177, 223, 152, 15, 223, 156, 230, 158, -1,
1083 75, 177, 223, 152, 15, 223, 156, 158, -1, 179,
1084 76, 181, 188, 223, 154, 234, 155, 39, 15, 223,
1085 228, 15, 223, -1, 228, -1, 79, -1, 230, 177,
1086 221, 152, 15, 223, -1, 177, 221, 152, 15, 223,
1087 -1, 179, 236, -1, 190, 156, 223, 152, 223, 158,
1088 -1, 232, 152, 156, 223, 152, 223, 158, -1, 224,
1089 -1, 233, 152, 224, -1, 233, -1, -1, 61, 60,
1090 -1, 60, -1, 168, 190, 223, 152, 223, -1, 169,
1091 190, 223, 152, 223, -1, 170, 190, 223, 152, 223,
1092 -1, 100, 171, 190, 223, 152, 223, -1, 101, 172,
1093 190, 223, 152, 223, -1, 49, 224, -1, 173, 224,
1094 152, 224, -1, 174, 224, 39, 190, -1, 129, 224,
1095 152, 224, 152, 224, -1, 134, 224, 152, 190, -1,
1096 135, 224, 152, 224, -1, 136, 224, 152, 224, 152,
1097 224, -1, 137, 224, 152, 224, 152, 224, -1, 128,
1098 232, -1, 235, 181, 188, 223, 154, 234, 155, -1,
1099 239, -1, 152, 233, -1, -1, 38, -1, -1, 122,
1100 190, 183, -1, 122, 190, 152, 10, 223, 183, -1,
1101 123, 190, 183, -1, 123, 190, 152, 10, 223, 183,
1102 -1, 124, 224, -1, 238, 125, 190, 223, -1, 238,
1103 126, 224, 152, 190, 223, -1, 127, 190, 223, 237,
1104 -1
Reid Spencere7c3c602006-11-30 06:36:44 +00001105};
1106
1107/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1108static const unsigned short int yyrline[] =
1109{
Reid Spencer52402b02007-01-02 05:45:11 +00001110 0, 422, 422, 422, 423, 423, 427, 427, 427, 427,
1111 427, 427, 427, 428, 428, 428, 428, 429, 429, 429,
1112 430, 430, 430, 430, 430, 430, 431, 431, 431, 431,
1113 431, 431, 431, 431, 431, 431, 432, 432, 432, 432,
1114 432, 432, 432, 432, 432, 432, 433, 433, 433, 433,
1115 433, 433, 434, 434, 434, 434, 435, 435, 435, 435,
1116 435, 435, 435, 436, 436, 436, 436, 436, 436, 441,
1117 441, 441, 441, 442, 442, 442, 442, 443, 443, 444,
1118 444, 447, 450, 455, 455, 455, 455, 455, 455, 456,
1119 457, 460, 460, 460, 460, 460, 461, 462, 467, 472,
1120 473, 476, 477, 485, 491, 492, 495, 496, 505, 506,
1121 519, 519, 520, 520, 521, 525, 525, 525, 525, 525,
1122 525, 525, 526, 526, 526, 526, 526, 528, 531, 534,
1123 537, 541, 555, 562, 569, 580, 584, 595, 599, 608,
1124 612, 619, 620, 625, 630, 640, 646, 651, 657, 663,
1125 669, 674, 680, 686, 693, 699, 705, 711, 717, 723,
1126 729, 737, 750, 762, 767, 773, 778, 784, 789, 794,
1127 802, 807, 812, 822, 827, 832, 832, 842, 847, 850,
1128 855, 859, 863, 865, 865, 868, 878, 883, 888, 898,
1129 908, 918, 928, 933, 938, 943, 945, 945, 948, 953,
1130 960, 965, 972, 979, 984, 985, 993, 993, 994, 994,
1131 996, 1005, 1009, 1013, 1016, 1021, 1024, 1027, 1045, 1046,
1132 1049, 1060, 1061, 1063, 1072, 1073, 1074, 1078, 1091, 1092,
1133 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1096, 1097, 1102,
1134 1103, 1112, 1112, 1116, 1121, 1131, 1140, 1143, 1151, 1155,
1135 1160, 1163, 1169, 1169, 1171, 1176, 1181, 1186, 1195, 1203,
1136 1210, 1233, 1238, 1244, 1250, 1258, 1276, 1284, 1293, 1297,
1137 1304, 1305, 1309, 1314, 1317, 1326, 1334, 1343, 1351, 1359,
1138 1364, 1373, 1401, 1407, 1413, 1420, 1426, 1432, 1438, 1456,
1139 1461, 1462, 1466, 1467, 1470, 1478, 1487, 1495, 1504, 1510,
1140 1519, 1528
Reid Spencere7c3c602006-11-30 06:36:44 +00001141};
1142#endif
1143
1144#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1145/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1146 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1147static const char *const yytname[] =
1148{
Reid Spencerf2d55322006-12-01 21:52:30 +00001149 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1150 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1151 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1152 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
Reid Spencere77e35e2006-12-01 20:26:20 +00001153 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
Reid Spencer71d2ec92006-12-31 06:02:26 +00001154 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1155 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1156 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1157 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1158 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1159 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
Reid Spencer78720742006-12-02 20:21:22 +00001160 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1161 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1162 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1163 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
Reid Spencer229e9362006-12-02 22:14:11 +00001164 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1165 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1166 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
Reid Spencer78720742006-12-02 20:21:22 +00001167 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1168 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1169 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1170 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1171 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1172 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
Reid Spencer57f28f92006-12-03 07:10:26 +00001173 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
Reid Spencer229e9362006-12-02 22:14:11 +00001174 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1175 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1176 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1177 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1178 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1179 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1180 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1181 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1182 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1183 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1184 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1185 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1186 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1187 "IndexList", "OptVolatile", "MemoryInst", 0
Reid Spencere7c3c602006-11-30 06:36:44 +00001188};
1189#endif
1190
1191# ifdef YYPRINT
1192/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1193 token YYLEX-NUM. */
1194static const unsigned short int yytoknum[] =
1195{
1196 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1197 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1198 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1199 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1200 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1201 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1202 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1203 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1204 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1205 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1206 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001207 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
Reid Spencer229e9362006-12-02 22:14:11 +00001208 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1209 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1210 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001211 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1212 62, 123, 125, 42, 99
Reid Spencere7c3c602006-11-30 06:36:44 +00001213};
1214# endif
1215
1216/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1217static const unsigned char yyr1[] =
1218{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001219 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1220 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1221 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
Reid Spencer57f28f92006-12-03 07:10:26 +00001222 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001223 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1224 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1225 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1226 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1227 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1228 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1229 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1230 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1231 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1232 192, 192, 192, 192, 192, 192, 192, 192, 192, 193,
1233 193, 194, 194, 194, 194, 195, 195, 195, 195, 195,
1234 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1235 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1236 196, 196, 196, 197, 197, 198, 198, 199, 200, 200,
1237 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1238 202, 202, 202, 202, 202, 203, 204, 204, 205, 205,
1239 205, 205, 206, 207, 207, 207, 208, 208, 209, 209,
1240 210, 211, 211, 212, 212, 212, 212, 213, 214, 214,
1241 215, 216, 216, 217, 218, 218, 218, 219, 220, 220,
1242 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1243 221, 222, 222, 223, 223, 224, 225, 225, 226, 227,
1244 227, 227, 228, 228, 229, 229, 229, 229, 229, 229,
1245 229, 229, 229, 230, 230, 231, 232, 232, 233, 233,
1246 234, 234, 235, 235, 236, 236, 236, 236, 236, 236,
1247 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1248 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1249 239, 239
Reid Spencere7c3c602006-11-30 06:36:44 +00001250};
1251
1252/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1253static const unsigned char yyr2[] =
1254{
1255 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1256 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1257 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1258 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerf7bde222006-12-01 22:26:37 +00001259 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001260 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer229e9362006-12-02 22:14:11 +00001261 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer229e9362006-12-02 22:14:11 +00001262 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer57f28f92006-12-03 07:10:26 +00001263 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1264 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1265 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1266 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1267 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001268 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1269 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1270 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1271 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1272 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1273 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1274 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1275 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1276 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001277 3, 1, 1, 3, 0, 1, 1, 3, 0, 1,
1278 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1279 5, 1, 1, 1, 1, 2, 2, 1, 2, 2,
1280 0, 1, 1, 1, 2, 2, 3, 9, 9, 8,
1281 14, 1, 1, 6, 5, 2, 6, 7, 1, 3,
1282 1, 0, 2, 1, 5, 5, 5, 6, 6, 2,
1283 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1284 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1285 6, 4
Reid Spencere7c3c602006-11-30 06:36:44 +00001286};
1287
1288/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1289 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1290 means the default is an error. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001291static const unsigned short int yydefact[] =
Reid Spencere7c3c602006-11-30 06:36:44 +00001292{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001293 194, 0, 90, 182, 1, 181, 224, 83, 84, 85,
1294 87, 88, 89, 86, 0, 98, 250, 178, 179, 206,
1295 207, 0, 0, 0, 90, 0, 186, 225, 226, 98,
1296 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1297 251, 250, 247, 82, 0, 0, 0, 0, 192, 0,
1298 0, 0, 0, 0, 183, 184, 0, 0, 81, 227,
1299 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1300 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1301 0, 0, 0, 241, 0, 0, 110, 129, 114, 242,
1302 128, 218, 219, 220, 221, 222, 223, 246, 0, 0,
1303 0, 253, 252, 262, 293, 261, 248, 249, 0, 0,
1304 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1305 0, 0, 130, 0, 0, 0, 113, 135, 139, 0,
1306 0, 144, 138, 255, 0, 254, 0, 0, 72, 76,
1307 71, 75, 70, 74, 69, 73, 77, 78, 0, 292,
1308 0, 273, 0, 98, 6, 7, 8, 9, 10, 11,
1309 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1310 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1311 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1312 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1313 65, 66, 67, 0, 0, 0, 0, 0, 98, 265,
1314 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1315 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1316 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1317 0, 0, 0, 0, 134, 216, 143, 141, 0, 230,
1318 231, 232, 235, 236, 237, 233, 234, 228, 0, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001320 0, 239, 244, 243, 245, 0, 256, 0, 279, 272,
1321 0, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1322 35, 0, 50, 51, 36, 37, 38, 39, 40, 41,
1323 42, 43, 44, 45, 46, 47, 48, 49, 0, 101,
1324 101, 298, 0, 0, 287, 0, 0, 0, 0, 0,
1325 0, 0, 0, 0, 0, 0, 0, 0, 0, 202,
1326 0, 190, 191, 158, 159, 4, 5, 156, 157, 160,
1327 151, 152, 155, 0, 0, 0, 0, 154, 153, 188,
1328 189, 112, 112, 137, 0, 140, 215, 209, 212, 213,
1329 0, 0, 131, 229, 0, 0, 0, 0, 0, 0,
1330 0, 0, 174, 0, 0, 0, 0, 0, 0, 0,
1331 0, 0, 0, 0, 0, 294, 0, 296, 291, 0,
Reid Spencer78720742006-12-02 20:21:22 +00001332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001333 0, 0, 0, 0, 203, 0, 0, 108, 106, 146,
1334 0, 0, 150, 0, 147, 132, 133, 136, 208, 210,
1335 0, 104, 142, 0, 0, 0, 291, 0, 0, 0,
1336 0, 0, 238, 0, 0, 0, 0, 0, 0, 0,
1337 0, 0, 0, 0, 0, 0, 0, 301, 0, 0,
1338 0, 283, 284, 0, 0, 0, 0, 0, 280, 281,
1339 0, 299, 0, 103, 109, 107, 145, 148, 149, 214,
1340 211, 105, 99, 0, 0, 0, 0, 0, 0, 0,
1341 0, 173, 0, 0, 0, 0, 0, 0, 0, 271,
1342 0, 0, 101, 102, 101, 268, 290, 0, 0, 0,
1343 0, 0, 274, 275, 276, 271, 0, 0, 217, 240,
1344 0, 0, 162, 0, 0, 0, 0, 0, 0, 0,
1345 0, 0, 0, 0, 270, 0, 277, 278, 0, 295,
1346 297, 0, 0, 0, 282, 285, 286, 0, 300, 100,
1347 0, 0, 0, 170, 0, 0, 164, 165, 166, 169,
1348 161, 0, 259, 0, 0, 0, 269, 266, 0, 288,
1349 167, 168, 0, 0, 0, 257, 0, 258, 0, 0,
1350 267, 163, 171, 172, 0, 0, 0, 0, 0, 0,
1351 264, 0, 0, 263, 0, 260
Reid Spencere7c3c602006-11-30 06:36:44 +00001352};
1353
1354/* YYDEFGOTO[NTERM-NUM]. */
1355static const short int yydefgoto[] =
1356{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001357 -1, 83, 337, 266, 267, 268, 291, 308, 269, 270,
1358 233, 234, 148, 235, 24, 15, 38, 508, 385, 407,
1359 472, 331, 408, 84, 85, 236, 87, 88, 129, 248,
1360 372, 271, 373, 118, 1, 2, 57, 3, 61, 215,
1361 48, 113, 219, 89, 419, 358, 359, 360, 39, 93,
1362 16, 96, 17, 29, 18, 364, 272, 90, 274, 495,
1363 41, 42, 43, 105, 106, 554, 107, 314, 524, 525,
1364 208, 209, 447, 210, 211
Reid Spencere7c3c602006-11-30 06:36:44 +00001365};
1366
1367/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1368 STATE-NUM. */
Reid Spencer71d2ec92006-12-31 06:02:26 +00001369#define YYPACT_NINF -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001370static const short int yypact[] =
1371{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001372 -513, 46, 217, 541, -513, -513, 82, -513, -513, -513,
1373 -513, -513, -513, -513, 16, 111, 25, -513, -513, -513,
1374 -513, 34, -55, 61, 26, -23, -513, -513, -513, 111,
1375 132, 146, -513, -513, -513, -513, -513, -513, 873, -26,
1376 -513, -18, -513, 47, 19, 23, 39, 67, -513, 77,
1377 132, 873, 81, 81, -513, -513, 81, 81, -513, -513,
1378 -513, -513, -513, 86, -513, -513, -513, -513, -513, -513,
1379 -513, -513, -513, -513, -513, -513, -513, -513, -513, 223,
1380 225, -9, 506, -513, 133, 91, -513, -513, -111, -513,
1381 -513, -513, -513, -513, -513, -513, -513, -513, 901, 36,
1382 148, -513, -513, -513, 1336, -513, -513, -513, 219, 76,
1383 229, 222, 224, -513, -513, -513, -513, -513, 933, 933,
1384 963, 933, -513, 98, 100, 614, -513, -513, -111, -104,
1385 104, 216, -513, 86, 1134, -513, 1134, 1134, -513, -513,
1386 -513, -513, -513, -513, -513, -513, -513, -513, 1134, -513,
1387 933, -513, 206, 111, -513, -513, -513, -513, -513, -513,
1388 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1389 -513, -513, -513, -513, 195, 84, 933, 933, 933, 933,
1390 933, 933, -513, -513, -513, -513, 933, 933, 933, 933,
1391 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1392 -513, -513, -513, 933, 933, 933, 933, 933, 111, -513,
1393 11, -513, -513, -513, -513, -513, -513, -513, -513, -93,
1394 115, 115, 121, 166, 250, 169, 251, 191, 253, 193,
1395 254, 252, 257, 220, 256, 260, 1045, 115, 115, 933,
1396 933, 122, -73, 933, -513, 701, -513, 134, 129, -513,
1397 -513, -513, -513, -513, -513, -513, -513, 221, 195, 84,
1398 136, 137, 138, 140, 150, 963, 154, 156, 158, 167,
1399 168, -513, -513, -513, -513, 171, -513, 172, -513, -513,
1400 873, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1401 -513, 933, -513, -513, -513, -513, -513, -513, -513, -513,
1402 -513, -513, -513, -513, -513, -513, -513, -513, 933, 173,
1403 174, -513, 1134, 164, 175, 176, 177, 178, 179, 182,
1404 1134, 1134, 1134, 183, 297, 873, 933, 933, 308, -513,
1405 -8, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1406 -513, -513, -513, 741, 963, 673, 310, -513, -513, -513,
1407 -513, -113, -99, -513, 181, -111, -513, 133, -513, 190,
1408 189, 774, -513, -513, 315, 192, 194, 963, 963, 963,
1409 963, 963, -513, -58, 963, 963, 963, 963, 963, 332,
1410 337, 1134, 1134, 1134, -2, -513, 9, -513, 207, 1134,
1411 204, 933, 933, 933, 933, 933, 211, 212, 213, 933,
1412 933, 1134, 1134, 214, -513, 338, 349, -513, 115, -513,
1413 -61, -57, -513, -70, -513, -513, -513, -513, -513, -513,
1414 833, 333, -513, 231, 963, 963, 207, 235, 236, 237,
1415 238, 963, -513, 240, 241, 242, 243, 334, 1134, 1134,
1416 227, 244, 245, 1134, 353, 1134, 933, -513, 249, 1134,
1417 255, -513, -513, 258, 262, 1134, 1134, 1134, -513, -513,
1418 248, -513, 933, -513, -513, -513, -513, -513, -513, -513,
1419 -513, -513, 317, 346, 263, 264, 265, 963, 963, 963,
1420 963, -513, 963, 963, 963, 963, 933, 266, 247, 933,
1421 1134, 1134, 267, -513, 267, -513, 269, 1134, 270, 933,
1422 933, 933, -513, -513, -513, 933, 1134, 386, -513, -513,
1423 963, 963, -513, 271, 273, 277, 278, 276, 279, 282,
1424 283, 284, 390, 15, 269, 286, -513, -513, 352, -513,
1425 -513, 933, 259, 1134, -513, -513, -513, 289, -513, -513,
1426 292, 294, 963, -513, 963, 963, -513, -513, -513, -513,
1427 -513, 1134, -513, 1223, 27, 367, -513, -513, 274, -513,
1428 -513, -513, 295, 300, 303, -513, 281, -513, 1223, 444,
1429 -513, -513, -513, -513, 445, 312, 1134, 1134, 450, 135,
1430 -513, 1134, 451, -513, 1134, -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001431};
1432
1433/* YYPGOTO[NTERM-NUM]. */
1434static const short int yypgoto[] =
1435{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001436 -513, -513, -513, 364, 365, 368, 215, 218, 370, 372,
1437 -98, -97, -507, -513, 436, 456, -141, -513, -303, 60,
1438 -513, -220, -513, -46, -513, -38, -513, -68, -20, -513,
1439 130, 246, -230, 51, -513, -513, -513, -513, 433, -513,
1440 -513, -513, -513, 1, -513, 64, -513, -513, 457, -513,
1441 -513, -513, -513, -513, 482, -513, -512, -106, -3, -88,
1442 -513, 448, -513, -89, -513, -513, -513, -513, 45, -13,
1443 -513, -513, 69, -513, -513
Reid Spencere7c3c602006-11-30 06:36:44 +00001444};
1445
1446/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1447 positive, shift that token. If negative, reduce the rule which
1448 number is the opposite. If zero, do what YYDEFACT says.
1449 If YYTABLE_NINF, syntax error. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001450#define YYTABLE_NINF -178
Reid Spencere7c3c602006-11-30 06:36:44 +00001451static const short int yytable[] =
1452{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001453 86, 332, 146, 147, 25, 115, 91, 387, 443, 124,
1454 135, 40, 280, 86, 128, 94, 553, 349, 350, 445,
1455 138, 139, 140, 141, 142, 143, 144, 145, 273, 405,
1456 273, 273, 138, 139, 140, 141, 142, 143, 144, 145,
1457 136, 566, 273, -112, 25, 415, 4, 568, 243, 406,
1458 132, 137, 132, 51, 40, 444, 575, 128, 244, 328,
1459 134, 416, 278, 128, 132, 329, 444, 325, 7, 8,
1460 9, 52, 11, 53, 13, 19, 54, 20, 30, 243,
1461 220, 221, 431, 238, 55, 130, 44, 45, 46, 354,
1462 311, 431, 468, 315, 431, 431, 49, 466, 316, 317,
1463 318, 319, 432, 467, 119, 242, 47, 120, 121, 292,
1464 293, 247, 134, 410, 411, 413, 116, 117, 323, 324,
1465 98, 99, 100, 50, 101, 102, 103, 27, 58, 28,
1466 348, 213, 214, 275, 276, 92, 326, 327, 309, 310,
1467 134, 312, 313, 134, 95, 277, 333, 334, 134, 134,
1468 134, 134, 125, 138, 139, 140, 141, 142, 143, 144,
1469 145, 19, 60, 20, 62, 320, 321, 322, 134, 134,
1470 108, 351, 352, 552, 109, 355, 31, 32, 33, 34,
1471 35, 36, 37, -72, -72, 567, -71, -71, 465, 529,
1472 110, 530, 294, 295, 296, 297, 298, 299, 300, 301,
1473 302, 303, 304, 305, 306, 307, 273, 357, -70, -70,
1474 -69, -69, 101, 102, 273, 273, 273, -177, 111, 126,
1475 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1476 74, 75, 76, 112, 381, 77, 78, 335, 336, 403,
1477 -113, 122, 86, 123, 19, 131, 20, 216, 5, 212,
1478 237, 6, 217, 382, 218, 239, 246, 240, 245, 7,
1479 8, 9, 10, 11, 12, 13, 279, 330, -76, -75,
1480 383, -74, -73, -79, 338, 273, 273, 273, -80, 401,
1481 14, 339, 353, 273, 362, 363, 361, 86, 402, 134,
1482 367, 368, 369, 355, 370, 273, 273, 281, 282, 283,
1483 284, 285, 286, 450, 371, 452, 453, 454, 374, 388,
1484 375, 458, 376, 287, 288, 289, 290, 396, 397, 398,
1485 389, 377, 378, 379, 380, 384, 386, 390, 391, 392,
1486 393, 394, 273, 273, 395, 399, 400, 273, 404, 273,
1487 414, 417, 420, 273, 421, 423, 424, 438, 425, 273,
1488 273, 273, 439, 134, 451, 134, 134, 134, 418, 446,
1489 449, 134, 459, 455, 456, 457, 462, 464, 463, 79,
1490 405, 493, 80, 486, 507, 81, 509, 82, 440, 441,
1491 442, 489, 357, 473, 273, 273, 448, 477, 478, 479,
1492 480, 273, 482, 483, 484, 485, 490, 491, 460, 461,
1493 273, 497, 505, 523, 539, 551, 569, 499, 134, 444,
1494 500, 534, 535, 536, 501, 510, 511, 557, 522, 528,
1495 512, 531, 533, 542, 506, 146, 147, 273, 543, 544,
1496 545, 546, 570, 574, 547, 487, 488, 548, 549, 550,
1497 492, 555, 494, 556, 559, 273, 498, 560, 521, 561,
1498 571, 134, 502, 503, 504, 572, 146, 147, 573, 576,
1499 577, 134, 134, 134, 578, 581, 584, 134, 203, 204,
1500 273, 273, 205, 365, 206, 273, 207, 366, 273, 104,
1501 56, 471, 347, 114, 470, 26, 59, 526, 527, 97,
1502 582, 496, 537, 134, 532, 476, 0, 426, 427, 428,
1503 429, 430, 0, 538, 433, 434, 435, 436, 437, 126,
1504 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1505 74, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1506 558, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1507 0, 0, 0, 0, 0, 0, 0, 0, 565, 0,
1508 0, 0, 0, 0, 474, 475, 0, 0, 0, 0,
1509 0, 481, 0, 0, 0, 0, 0, 0, -82, 19,
1510 0, 20, 0, 579, 580, 6, -82, -82, 583, 0,
1511 0, 585, 0, -82, -82, -82, -82, -82, -82, -82,
1512 0, -82, 21, 0, 0, 0, 0, 0, 0, -82,
1513 22, 0, 0, 0, 23, 0, 0, 513, 514, 515,
1514 516, 0, 517, 518, 519, 520, 0, 126, 64, 65,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001515 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001516 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1517 540, 541, 19, 0, 20, 0, 0, 0, 0, 0,
1518 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
1519 0, 0, 80, 0, 0, 81, 0, 82, 127, 0,
1520 0, 0, 562, 0, 563, 564, 126, 222, 223, 224,
1521 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1522 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1523 0, 19, 0, 20, 126, 64, 65, 66, 67, 68,
1524 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1525 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1526 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1527 0, 356, 0, 0, 126, 222, 223, 224, 225, 226,
1528 227, 228, 229, 230, 231, 232, 75, 76, 0, 0,
1529 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1530 80, 20, 0, 81, 0, 82, 241, 126, 64, 65,
1531 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1532 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1533 0, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1534 0, 0, 0, 0, 422, 0, 0, 0, 0, 0,
1535 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1536 0, 0, 81, 0, 82, 412, 126, 64, 65, 66,
1537 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1538 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
1539 81, 19, 82, 20, 0, 0, 0, 0, 0, 0,
1540 0, 0, 0, 469, 0, 0, 63, 64, 65, 66,
1541 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1542 0, 0, 77, 78, 79, 0, 0, 80, 0, 409,
1543 81, 19, 82, 20, 133, 64, 65, 66, 67, 68,
1544 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1545 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1546 80, 20, 0, 81, 0, 82, 126, 64, 65, 66,
1547 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1548 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1549 0, 19, 0, 20, 0, 0, 126, 222, 223, 224,
1550 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1551 0, 0, 77, 78, 0, 0, 79, 0, 0, 80,
1552 0, 19, 81, 20, 82, 0, 0, 0, 0, 0,
Reid Spencer57f28f92006-12-03 07:10:26 +00001553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001555 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1556 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1557 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1558 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
1559 81, 0, 82, 0, 77, 78, 0, 340, 341, 342,
1560 0, 0, 0, 19, 0, 20, 0, 0, 0, 0,
1561 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1562 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1563 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1564 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1565 0, 0, 81, 0, 82, 154, 155, 156, 157, 158,
1566 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1567 169, 170, 171, 172, 173, 258, 259, 0, 0, 0,
1568 0, 249, 250, 77, 78, 251, 252, 253, 254, 255,
1569 256, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1570 0, 0, 260, 0, 261, 182, 183, 184, 185, 0,
1571 262, 263, 264, 190, 191, 192, 193, 194, 195, 196,
1572 197, 198, 199, 200, 201, 202, 257, 0, 0, 0,
1573 0, 343, 0, 0, 344, 0, 345, 0, 0, 346,
1574 0, 0, 0, 0, 154, 155, 156, 157, 158, 159,
1575 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1576 170, 171, 172, 173, 258, 259, 0, 0, 0, 0,
1577 249, 250, 0, 0, 251, 252, 253, 254, 255, 256,
1578 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1579 0, 260, 0, 261, 182, 183, 184, 185, 0, 262,
1580 263, 264, 190, 191, 192, 193, 194, 195, 196, 197,
1581 198, 199, 200, 201, 202, 257, 0, 0, 0, 0,
1582 0, 0, 0, 265, 0, 0, 0, 0, 0, 0,
1583 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
1584 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1585 171, 172, 173, 258, 259, 0, 0, 0, 0, 0,
Reid Spencerf2d55322006-12-01 21:52:30 +00001586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer229e9362006-12-02 22:14:11 +00001587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001588 260, 0, 261, 182, 183, 184, 185, 0, 262, 263,
1589 264, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1590 199, 200, 201, 202, 149, 0, 0, 0, 0, 0,
1591 0, 0, 265, 0, 0, 150, 0, 0, 0, 0,
1592 0, 0, 0, 0, 0, 0, 151, 152, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001594 0, 0, 153, 0, 0, 0, 154, 155, 156, 157,
1595 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
1596 168, 169, 170, 171, 172, 173, 174, 175, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001597 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001598 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
1599 178, 0, 0, 179, 180, 181, 182, 183, 184, 185,
1600 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
1601 196, 197, 198, 199, 200, 201, 202
Reid Spencere7c3c602006-11-30 06:36:44 +00001602};
1603
1604static const short int yycheck[] =
1605{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001606 38, 221, 100, 100, 3, 51, 32, 310, 10, 18,
1607 98, 29, 153, 51, 82, 33, 523, 237, 238, 10,
1608 5, 6, 7, 8, 9, 10, 11, 12, 134, 37,
1609 136, 137, 5, 6, 7, 8, 9, 10, 11, 12,
1610 4, 553, 148, 154, 43, 158, 0, 554, 152, 57,
1611 163, 15, 163, 27, 29, 57, 568, 125, 162, 152,
1612 98, 160, 150, 131, 163, 158, 57, 208, 42, 43,
1613 44, 45, 46, 47, 48, 28, 50, 30, 62, 152,
1614 118, 119, 152, 121, 58, 84, 52, 53, 54, 162,
1615 178, 152, 162, 181, 152, 152, 151, 158, 186, 187,
1616 188, 189, 160, 160, 53, 125, 72, 56, 57, 25,
1617 26, 131, 150, 343, 344, 345, 35, 36, 206, 207,
1618 73, 74, 75, 62, 77, 78, 79, 45, 151, 47,
1619 236, 55, 56, 136, 137, 161, 125, 126, 176, 177,
1620 178, 179, 180, 181, 162, 148, 25, 26, 186, 187,
1621 188, 189, 161, 5, 6, 7, 8, 9, 10, 11,
1622 12, 28, 30, 30, 18, 203, 204, 205, 206, 207,
1623 151, 239, 240, 158, 151, 243, 65, 66, 67, 68,
1624 69, 70, 71, 17, 18, 158, 17, 18, 408, 492,
1625 151, 494, 108, 109, 110, 111, 112, 113, 114, 115,
1626 116, 117, 118, 119, 120, 121, 312, 245, 17, 18,
1627 17, 18, 77, 78, 320, 321, 322, 0, 151, 3,
1628 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1629 14, 15, 16, 156, 280, 19, 20, 17, 18, 327,
1630 154, 18, 280, 18, 28, 154, 30, 18, 31, 30,
1631 120, 34, 30, 291, 30, 157, 40, 157, 154, 42,
1632 43, 44, 45, 46, 47, 48, 60, 152, 18, 18,
1633 308, 18, 18, 21, 18, 381, 382, 383, 21, 325,
1634 63, 21, 160, 389, 155, 64, 152, 325, 326, 327,
1635 154, 154, 154, 361, 154, 401, 402, 102, 103, 104,
1636 105, 106, 107, 391, 154, 393, 394, 395, 154, 312,
1637 154, 399, 154, 118, 119, 120, 121, 320, 321, 322,
1638 156, 154, 154, 152, 152, 152, 152, 152, 152, 152,
1639 152, 152, 438, 439, 152, 152, 39, 443, 30, 445,
1640 30, 160, 152, 449, 155, 30, 154, 15, 154, 455,
1641 456, 457, 15, 391, 392, 393, 394, 395, 357, 152,
1642 156, 399, 400, 152, 152, 152, 152, 18, 30, 153,
1643 37, 18, 156, 39, 57, 159, 30, 161, 381, 382,
1644 383, 154, 420, 152, 490, 491, 389, 152, 152, 152,
1645 152, 497, 152, 152, 152, 152, 152, 152, 401, 402,
1646 506, 152, 154, 156, 18, 15, 39, 152, 446, 57,
1647 152, 499, 500, 501, 152, 152, 152, 158, 152, 152,
1648 155, 152, 152, 152, 462, 523, 523, 533, 155, 152,
1649 152, 155, 158, 152, 155, 438, 439, 155, 155, 155,
1650 443, 155, 445, 531, 155, 551, 449, 155, 486, 155,
1651 155, 489, 455, 456, 457, 155, 554, 554, 155, 15,
1652 15, 499, 500, 501, 152, 15, 15, 505, 104, 104,
1653 576, 577, 104, 258, 104, 581, 104, 259, 584, 43,
1654 24, 421, 236, 50, 420, 3, 29, 490, 491, 41,
1655 579, 446, 505, 531, 497, 426, -1, 367, 368, 369,
1656 370, 371, -1, 506, 374, 375, 376, 377, 378, 3,
Reid Spencer57f28f92006-12-03 07:10:26 +00001657 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1658 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001659 533, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1660 -1, -1, -1, -1, -1, -1, -1, -1, 551, -1,
1661 -1, -1, -1, -1, 424, 425, -1, -1, -1, -1,
1662 -1, 431, -1, -1, -1, -1, -1, -1, 27, 28,
1663 -1, 30, -1, 576, 577, 34, 35, 36, 581, -1,
1664 -1, 584, -1, 42, 43, 44, 45, 46, 47, 48,
1665 -1, 50, 51, -1, -1, -1, -1, -1, -1, 58,
1666 59, -1, -1, -1, 63, -1, -1, 477, 478, 479,
1667 480, -1, 482, 483, 484, 485, -1, 3, 4, 5,
1668 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1669 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1670 510, 511, 28, -1, 30, -1, -1, -1, -1, -1,
1671 -1, -1, -1, -1, -1, -1, -1, -1, -1, 153,
1672 -1, -1, 156, -1, -1, 159, -1, 161, 162, -1,
1673 -1, -1, 542, -1, 544, 545, 3, 4, 5, 6,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001674 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1675 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001676 -1, 28, -1, 30, 3, 4, 5, 6, 7, 8,
1677 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1678 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001679 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001680 -1, 40, -1, -1, 3, 4, 5, 6, 7, 8,
1681 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1682 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
1683 156, 30, -1, 159, -1, 161, 162, 3, 4, 5,
1684 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1685 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
1686 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1687 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
1688 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1689 -1, -1, 159, -1, 161, 162, 3, 4, 5, 6,
1690 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1691 -1, -1, 19, 20, 153, -1, -1, 156, -1, -1,
1692 159, 28, 161, 30, -1, -1, -1, -1, -1, -1,
1693 -1, -1, -1, 40, -1, -1, 3, 4, 5, 6,
1694 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1695 -1, -1, 19, 20, 153, -1, -1, 156, -1, 158,
1696 159, 28, 161, 30, 3, 4, 5, 6, 7, 8,
1697 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1698 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
1699 156, 30, -1, 159, -1, 161, 3, 4, 5, 6,
1700 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1701 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
1702 -1, 28, -1, 30, -1, -1, 3, 4, 5, 6,
1703 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1704 -1, -1, 19, 20, -1, -1, 153, -1, -1, 156,
1705 -1, 28, 159, 30, 161, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001706 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1707 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001708 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1709 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001710 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001711 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
1712 159, -1, 161, -1, 19, 20, -1, 22, 23, 24,
1713 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1714 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1715 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001716 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001717 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
1718 -1, -1, 159, -1, 161, 80, 81, 82, 83, 84,
1719 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1720 95, 96, 97, 98, 99, 100, 101, -1, -1, -1,
1721 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1722 26, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1723 -1, -1, 127, -1, 129, 130, 131, 132, 133, -1,
1724 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1725 145, 146, 147, 148, 149, 150, 62, -1, -1, -1,
1726 -1, 156, -1, -1, 159, -1, 161, -1, -1, 164,
1727 -1, -1, -1, -1, 80, 81, 82, 83, 84, 85,
1728 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1729 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
1730 17, 18, -1, -1, 21, 22, 23, 24, 25, 26,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001731 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001732 -1, 127, -1, 129, 130, 131, 132, 133, -1, 135,
1733 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
1734 146, 147, 148, 149, 150, 62, -1, -1, -1, -1,
1735 -1, -1, -1, 159, -1, -1, -1, -1, -1, -1,
1736 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001737 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001738 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
Reid Spencer6fd36ab2006-12-29 20:35:03 +00001739 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1741 127, -1, 129, 130, 131, 132, 133, -1, 135, 136,
Reid Spencer57f28f92006-12-03 07:10:26 +00001742 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
Reid Spencer71d2ec92006-12-31 06:02:26 +00001743 147, 148, 149, 150, 38, -1, -1, -1, -1, -1,
1744 -1, -1, 159, -1, -1, 49, -1, -1, -1, -1,
1745 -1, -1, -1, -1, -1, -1, 60, 61, -1, -1,
1746 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1747 -1, -1, 76, -1, -1, -1, 80, 81, 82, 83,
1748 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
1749 94, 95, 96, 97, 98, 99, 100, 101, -1, -1,
1750 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1751 -1, -1, -1, -1, -1, -1, -1, -1, 122, 123,
1752 124, -1, -1, 127, 128, 129, 130, 131, 132, 133,
1753 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
1754 144, 145, 146, 147, 148, 149, 150
Reid Spencere7c3c602006-11-30 06:36:44 +00001755};
1756
1757/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1758 symbol of state STATE-NUM. */
1759static const unsigned char yystos[] =
1760{
Reid Spencer71d2ec92006-12-31 06:02:26 +00001761 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
1762 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
1763 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
1764 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
1765 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
1766 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
1767 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
1768 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
1769 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
1770 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
1771 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
1772 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
1773 198, 198, 18, 18, 18, 161, 3, 162, 192, 193,
1774 208, 154, 163, 3, 190, 224, 4, 15, 5, 6,
1775 7, 8, 9, 10, 11, 12, 175, 176, 177, 38,
1776 49, 60, 61, 76, 80, 81, 82, 83, 84, 85,
1777 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1778 96, 97, 98, 99, 100, 101, 122, 123, 124, 127,
1779 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1780 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1781 148, 149, 150, 168, 169, 170, 173, 174, 235, 236,
1782 238, 239, 30, 55, 56, 204, 18, 30, 30, 207,
1783 190, 190, 4, 5, 6, 7, 8, 9, 10, 11,
1784 12, 13, 14, 175, 176, 178, 190, 195, 190, 157,
1785 157, 162, 193, 152, 162, 154, 40, 193, 194, 17,
1786 18, 21, 22, 23, 24, 25, 26, 62, 100, 101,
1787 127, 129, 135, 136, 137, 159, 168, 169, 170, 173,
1788 174, 196, 221, 222, 223, 223, 223, 223, 224, 60,
1789 181, 102, 103, 104, 105, 106, 107, 118, 119, 120,
1790 121, 171, 25, 26, 108, 109, 110, 111, 112, 113,
1791 114, 115, 116, 117, 118, 119, 120, 121, 172, 190,
1792 190, 224, 190, 190, 232, 224, 224, 224, 224, 224,
1793 190, 190, 190, 224, 224, 181, 125, 126, 152, 158,
1794 152, 186, 186, 25, 26, 17, 18, 167, 18, 21,
1795 22, 23, 24, 156, 159, 161, 164, 196, 222, 186,
1796 186, 192, 192, 160, 162, 192, 40, 190, 210, 211,
1797 212, 152, 155, 64, 220, 171, 172, 154, 154, 154,
1798 154, 154, 195, 197, 154, 154, 154, 154, 154, 152,
1799 152, 188, 190, 190, 152, 183, 152, 183, 223, 156,
1800 152, 152, 152, 152, 152, 152, 223, 223, 223, 152,
1801 39, 188, 190, 224, 30, 37, 57, 184, 187, 158,
1802 197, 197, 162, 197, 30, 158, 160, 160, 208, 209,
1803 152, 155, 40, 30, 154, 154, 195, 195, 195, 195,
1804 195, 152, 160, 195, 195, 195, 195, 195, 15, 15,
1805 223, 223, 223, 10, 57, 10, 152, 237, 223, 156,
1806 224, 190, 224, 224, 224, 152, 152, 152, 224, 190,
1807 223, 223, 152, 30, 18, 186, 158, 160, 162, 40,
1808 210, 184, 185, 152, 195, 195, 237, 152, 152, 152,
1809 152, 195, 152, 152, 152, 152, 39, 223, 223, 154,
1810 152, 152, 223, 18, 223, 224, 233, 152, 223, 152,
1811 152, 152, 223, 223, 223, 154, 190, 57, 182, 30,
1812 152, 152, 155, 195, 195, 195, 195, 195, 195, 195,
1813 195, 190, 152, 156, 233, 234, 223, 223, 152, 183,
1814 183, 152, 223, 152, 224, 224, 224, 234, 223, 18,
1815 195, 195, 152, 155, 152, 152, 155, 155, 155, 155,
1816 155, 15, 158, 177, 230, 155, 224, 158, 223, 155,
1817 155, 155, 195, 195, 195, 223, 221, 158, 177, 39,
1818 158, 155, 155, 155, 152, 221, 15, 15, 152, 223,
1819 223, 15, 228, 223, 15, 223
Reid Spencere7c3c602006-11-30 06:36:44 +00001820};
1821
1822#define yyerrok (yyerrstatus = 0)
1823#define yyclearin (yychar = YYEMPTY)
1824#define YYEMPTY (-2)
1825#define YYEOF 0
1826
1827#define YYACCEPT goto yyacceptlab
1828#define YYABORT goto yyabortlab
1829#define YYERROR goto yyerrorlab
1830
1831
1832/* Like YYERROR except do call yyerror. This remains here temporarily
1833 to ease the transition to the new meaning of YYERROR, for GCC.
1834 Once GCC version 2 has supplanted version 1, this can go. */
1835
1836#define YYFAIL goto yyerrlab
1837
1838#define YYRECOVERING() (!!yyerrstatus)
1839
1840#define YYBACKUP(Token, Value) \
1841do \
1842 if (yychar == YYEMPTY && yylen == 1) \
1843 { \
1844 yychar = (Token); \
1845 yylval = (Value); \
1846 yytoken = YYTRANSLATE (yychar); \
1847 YYPOPSTACK; \
1848 goto yybackup; \
1849 } \
1850 else \
1851 { \
1852 yyerror (YY_("syntax error: cannot back up")); \
1853 YYERROR; \
1854 } \
1855while (0)
1856
1857
1858#define YYTERROR 1
1859#define YYERRCODE 256
1860
1861
1862/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1863 If N is 0, then set CURRENT to the empty location which ends
1864 the previous symbol: RHS[0] (always defined). */
1865
1866#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1867#ifndef YYLLOC_DEFAULT
1868# define YYLLOC_DEFAULT(Current, Rhs, N) \
1869 do \
1870 if (N) \
1871 { \
1872 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1873 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1874 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1875 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1876 } \
1877 else \
1878 { \
1879 (Current).first_line = (Current).last_line = \
1880 YYRHSLOC (Rhs, 0).last_line; \
1881 (Current).first_column = (Current).last_column = \
1882 YYRHSLOC (Rhs, 0).last_column; \
1883 } \
1884 while (0)
1885#endif
1886
1887
1888/* YY_LOCATION_PRINT -- Print the location on the stream.
1889 This macro was not mandated originally: define only if we know
1890 we won't break user code: when these are the locations we know. */
1891
1892#ifndef YY_LOCATION_PRINT
1893# if YYLTYPE_IS_TRIVIAL
1894# define YY_LOCATION_PRINT(File, Loc) \
1895 fprintf (File, "%d.%d-%d.%d", \
1896 (Loc).first_line, (Loc).first_column, \
1897 (Loc).last_line, (Loc).last_column)
1898# else
1899# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1900# endif
1901#endif
1902
1903
1904/* YYLEX -- calling `yylex' with the right arguments. */
1905
1906#ifdef YYLEX_PARAM
1907# define YYLEX yylex (YYLEX_PARAM)
1908#else
1909# define YYLEX yylex ()
1910#endif
1911
1912/* Enable debugging if requested. */
1913#if YYDEBUG
1914
1915# ifndef YYFPRINTF
1916# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1917# define YYFPRINTF fprintf
1918# endif
1919
1920# define YYDPRINTF(Args) \
1921do { \
1922 if (yydebug) \
1923 YYFPRINTF Args; \
1924} while (0)
1925
1926# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1927do { \
1928 if (yydebug) \
1929 { \
1930 YYFPRINTF (stderr, "%s ", Title); \
1931 yysymprint (stderr, \
1932 Type, Value); \
1933 YYFPRINTF (stderr, "\n"); \
1934 } \
1935} while (0)
1936
1937/*------------------------------------------------------------------.
1938| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1939| TOP (included). |
1940`------------------------------------------------------------------*/
1941
1942#if defined (__STDC__) || defined (__cplusplus)
1943static void
1944yy_stack_print (short int *bottom, short int *top)
1945#else
1946static void
1947yy_stack_print (bottom, top)
1948 short int *bottom;
1949 short int *top;
1950#endif
1951{
1952 YYFPRINTF (stderr, "Stack now");
1953 for (/* Nothing. */; bottom <= top; ++bottom)
1954 YYFPRINTF (stderr, " %d", *bottom);
1955 YYFPRINTF (stderr, "\n");
1956}
1957
1958# define YY_STACK_PRINT(Bottom, Top) \
1959do { \
1960 if (yydebug) \
1961 yy_stack_print ((Bottom), (Top)); \
1962} while (0)
1963
1964
1965/*------------------------------------------------.
1966| Report that the YYRULE is going to be reduced. |
1967`------------------------------------------------*/
1968
1969#if defined (__STDC__) || defined (__cplusplus)
1970static void
1971yy_reduce_print (int yyrule)
1972#else
1973static void
1974yy_reduce_print (yyrule)
1975 int yyrule;
1976#endif
1977{
1978 int yyi;
1979 unsigned long int yylno = yyrline[yyrule];
1980 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1981 yyrule - 1, yylno);
1982 /* Print the symbols being reduced, and their result. */
1983 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1984 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1985 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1986}
1987
1988# define YY_REDUCE_PRINT(Rule) \
1989do { \
1990 if (yydebug) \
1991 yy_reduce_print (Rule); \
1992} while (0)
1993
1994/* Nonzero means print parse trace. It is left uninitialized so that
1995 multiple parsers can coexist. */
1996int yydebug;
1997#else /* !YYDEBUG */
1998# define YYDPRINTF(Args)
1999# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2000# define YY_STACK_PRINT(Bottom, Top)
2001# define YY_REDUCE_PRINT(Rule)
2002#endif /* !YYDEBUG */
2003
2004
2005/* YYINITDEPTH -- initial size of the parser's stacks. */
2006#ifndef YYINITDEPTH
2007# define YYINITDEPTH 200
2008#endif
2009
2010/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2011 if the built-in stack extension method is used).
2012
2013 Do not make this value too large; the results are undefined if
2014 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2015 evaluated with infinite-precision integer arithmetic. */
2016
2017#ifndef YYMAXDEPTH
2018# define YYMAXDEPTH 10000
2019#endif
2020
2021
2022
2023#if YYERROR_VERBOSE
2024
2025# ifndef yystrlen
2026# if defined (__GLIBC__) && defined (_STRING_H)
2027# define yystrlen strlen
2028# else
2029/* Return the length of YYSTR. */
2030static YYSIZE_T
2031# if defined (__STDC__) || defined (__cplusplus)
2032yystrlen (const char *yystr)
2033# else
2034yystrlen (yystr)
2035 const char *yystr;
2036# endif
2037{
2038 const char *yys = yystr;
2039
2040 while (*yys++ != '\0')
2041 continue;
2042
2043 return yys - yystr - 1;
2044}
2045# endif
2046# endif
2047
2048# ifndef yystpcpy
2049# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2050# define yystpcpy stpcpy
2051# else
2052/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2053 YYDEST. */
2054static char *
2055# if defined (__STDC__) || defined (__cplusplus)
2056yystpcpy (char *yydest, const char *yysrc)
2057# else
2058yystpcpy (yydest, yysrc)
2059 char *yydest;
2060 const char *yysrc;
2061# endif
2062{
2063 char *yyd = yydest;
2064 const char *yys = yysrc;
2065
2066 while ((*yyd++ = *yys++) != '\0')
2067 continue;
2068
2069 return yyd - 1;
2070}
2071# endif
2072# endif
2073
2074# ifndef yytnamerr
2075/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2076 quotes and backslashes, so that it's suitable for yyerror. The
2077 heuristic is that double-quoting is unnecessary unless the string
2078 contains an apostrophe, a comma, or backslash (other than
2079 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2080 null, do not copy; instead, return the length of what the result
2081 would have been. */
2082static YYSIZE_T
2083yytnamerr (char *yyres, const char *yystr)
2084{
2085 if (*yystr == '"')
2086 {
2087 size_t yyn = 0;
2088 char const *yyp = yystr;
2089
2090 for (;;)
2091 switch (*++yyp)
2092 {
2093 case '\'':
2094 case ',':
2095 goto do_not_strip_quotes;
2096
2097 case '\\':
2098 if (*++yyp != '\\')
2099 goto do_not_strip_quotes;
2100 /* Fall through. */
2101 default:
2102 if (yyres)
2103 yyres[yyn] = *yyp;
2104 yyn++;
2105 break;
2106
2107 case '"':
2108 if (yyres)
2109 yyres[yyn] = '\0';
2110 return yyn;
2111 }
2112 do_not_strip_quotes: ;
2113 }
2114
2115 if (! yyres)
2116 return yystrlen (yystr);
2117
2118 return yystpcpy (yyres, yystr) - yyres;
2119}
2120# endif
2121
2122#endif /* YYERROR_VERBOSE */
2123
2124
2125
2126#if YYDEBUG
2127/*--------------------------------.
2128| Print this symbol on YYOUTPUT. |
2129`--------------------------------*/
2130
2131#if defined (__STDC__) || defined (__cplusplus)
2132static void
2133yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2134#else
2135static void
2136yysymprint (yyoutput, yytype, yyvaluep)
2137 FILE *yyoutput;
2138 int yytype;
2139 YYSTYPE *yyvaluep;
2140#endif
2141{
2142 /* Pacify ``unused variable'' warnings. */
2143 (void) yyvaluep;
2144
2145 if (yytype < YYNTOKENS)
2146 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2147 else
2148 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2149
2150
2151# ifdef YYPRINT
2152 if (yytype < YYNTOKENS)
2153 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2154# endif
2155 switch (yytype)
2156 {
2157 default:
2158 break;
2159 }
2160 YYFPRINTF (yyoutput, ")");
2161}
2162
2163#endif /* ! YYDEBUG */
2164/*-----------------------------------------------.
2165| Release the memory associated to this symbol. |
2166`-----------------------------------------------*/
2167
2168#if defined (__STDC__) || defined (__cplusplus)
2169static void
2170yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2171#else
2172static void
2173yydestruct (yymsg, yytype, yyvaluep)
2174 const char *yymsg;
2175 int yytype;
2176 YYSTYPE *yyvaluep;
2177#endif
2178{
2179 /* Pacify ``unused variable'' warnings. */
2180 (void) yyvaluep;
2181
2182 if (!yymsg)
2183 yymsg = "Deleting";
2184 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2185
2186 switch (yytype)
2187 {
2188
2189 default:
2190 break;
2191 }
2192}
2193
2194
2195/* Prevent warnings from -Wmissing-prototypes. */
2196
2197#ifdef YYPARSE_PARAM
2198# if defined (__STDC__) || defined (__cplusplus)
2199int yyparse (void *YYPARSE_PARAM);
2200# else
2201int yyparse ();
2202# endif
2203#else /* ! YYPARSE_PARAM */
2204#if defined (__STDC__) || defined (__cplusplus)
2205int yyparse (void);
2206#else
2207int yyparse ();
2208#endif
2209#endif /* ! YYPARSE_PARAM */
2210
2211
2212
2213/* The look-ahead symbol. */
2214int yychar;
2215
2216/* The semantic value of the look-ahead symbol. */
2217YYSTYPE yylval;
2218
2219/* Number of syntax errors so far. */
2220int yynerrs;
2221
2222
2223
2224/*----------.
2225| yyparse. |
2226`----------*/
2227
2228#ifdef YYPARSE_PARAM
2229# if defined (__STDC__) || defined (__cplusplus)
2230int yyparse (void *YYPARSE_PARAM)
2231# else
2232int yyparse (YYPARSE_PARAM)
2233 void *YYPARSE_PARAM;
2234# endif
2235#else /* ! YYPARSE_PARAM */
2236#if defined (__STDC__) || defined (__cplusplus)
2237int
2238yyparse (void)
2239#else
2240int
2241yyparse ()
2242
2243#endif
2244#endif
2245{
2246
2247 int yystate;
2248 int yyn;
2249 int yyresult;
2250 /* Number of tokens to shift before error messages enabled. */
2251 int yyerrstatus;
2252 /* Look-ahead token as an internal (translated) token number. */
2253 int yytoken = 0;
2254
2255 /* Three stacks and their tools:
2256 `yyss': related to states,
2257 `yyvs': related to semantic values,
2258 `yyls': related to locations.
2259
2260 Refer to the stacks thru separate pointers, to allow yyoverflow
2261 to reallocate them elsewhere. */
2262
2263 /* The state stack. */
2264 short int yyssa[YYINITDEPTH];
2265 short int *yyss = yyssa;
2266 short int *yyssp;
2267
2268 /* The semantic value stack. */
2269 YYSTYPE yyvsa[YYINITDEPTH];
2270 YYSTYPE *yyvs = yyvsa;
2271 YYSTYPE *yyvsp;
2272
2273
2274
2275#define YYPOPSTACK (yyvsp--, yyssp--)
2276
2277 YYSIZE_T yystacksize = YYINITDEPTH;
2278
2279 /* The variables used to return semantic value and location from the
2280 action routines. */
2281 YYSTYPE yyval;
2282
2283
2284 /* When reducing, the number of symbols on the RHS of the reduced
2285 rule. */
2286 int yylen;
2287
2288 YYDPRINTF ((stderr, "Starting parse\n"));
2289
2290 yystate = 0;
2291 yyerrstatus = 0;
2292 yynerrs = 0;
2293 yychar = YYEMPTY; /* Cause a token to be read. */
2294
2295 /* Initialize stack pointers.
2296 Waste one element of value and location stack
2297 so that they stay on the same level as the state stack.
2298 The wasted elements are never initialized. */
2299
2300 yyssp = yyss;
2301 yyvsp = yyvs;
2302
2303 goto yysetstate;
2304
2305/*------------------------------------------------------------.
2306| yynewstate -- Push a new state, which is found in yystate. |
2307`------------------------------------------------------------*/
2308 yynewstate:
2309 /* In all cases, when you get here, the value and location stacks
2310 have just been pushed. so pushing a state here evens the stacks.
2311 */
2312 yyssp++;
2313
2314 yysetstate:
2315 *yyssp = yystate;
2316
2317 if (yyss + yystacksize - 1 <= yyssp)
2318 {
2319 /* Get the current used size of the three stacks, in elements. */
2320 YYSIZE_T yysize = yyssp - yyss + 1;
2321
2322#ifdef yyoverflow
2323 {
2324 /* Give user a chance to reallocate the stack. Use copies of
2325 these so that the &'s don't force the real ones into
2326 memory. */
2327 YYSTYPE *yyvs1 = yyvs;
2328 short int *yyss1 = yyss;
2329
2330
2331 /* Each stack pointer address is followed by the size of the
2332 data in use in that stack, in bytes. This used to be a
2333 conditional around just the two extra args, but that might
2334 be undefined if yyoverflow is a macro. */
2335 yyoverflow (YY_("memory exhausted"),
2336 &yyss1, yysize * sizeof (*yyssp),
2337 &yyvs1, yysize * sizeof (*yyvsp),
2338
2339 &yystacksize);
2340
2341 yyss = yyss1;
2342 yyvs = yyvs1;
2343 }
2344#else /* no yyoverflow */
2345# ifndef YYSTACK_RELOCATE
2346 goto yyexhaustedlab;
2347# else
2348 /* Extend the stack our own way. */
2349 if (YYMAXDEPTH <= yystacksize)
2350 goto yyexhaustedlab;
2351 yystacksize *= 2;
2352 if (YYMAXDEPTH < yystacksize)
2353 yystacksize = YYMAXDEPTH;
2354
2355 {
2356 short int *yyss1 = yyss;
2357 union yyalloc *yyptr =
2358 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2359 if (! yyptr)
2360 goto yyexhaustedlab;
2361 YYSTACK_RELOCATE (yyss);
2362 YYSTACK_RELOCATE (yyvs);
2363
2364# undef YYSTACK_RELOCATE
2365 if (yyss1 != yyssa)
2366 YYSTACK_FREE (yyss1);
2367 }
2368# endif
2369#endif /* no yyoverflow */
2370
2371 yyssp = yyss + yysize - 1;
2372 yyvsp = yyvs + yysize - 1;
2373
2374
2375 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2376 (unsigned long int) yystacksize));
2377
2378 if (yyss + yystacksize - 1 <= yyssp)
2379 YYABORT;
2380 }
2381
2382 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2383
2384 goto yybackup;
2385
2386/*-----------.
2387| yybackup. |
2388`-----------*/
2389yybackup:
2390
2391/* Do appropriate processing given the current state. */
2392/* Read a look-ahead token if we need one and don't already have one. */
2393/* yyresume: */
2394
2395 /* First try to decide what to do without reference to look-ahead token. */
2396
2397 yyn = yypact[yystate];
2398 if (yyn == YYPACT_NINF)
2399 goto yydefault;
2400
2401 /* Not known => get a look-ahead token if don't already have one. */
2402
2403 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2404 if (yychar == YYEMPTY)
2405 {
2406 YYDPRINTF ((stderr, "Reading a token: "));
2407 yychar = YYLEX;
2408 }
2409
2410 if (yychar <= YYEOF)
2411 {
2412 yychar = yytoken = YYEOF;
2413 YYDPRINTF ((stderr, "Now at end of input.\n"));
2414 }
2415 else
2416 {
2417 yytoken = YYTRANSLATE (yychar);
2418 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2419 }
2420
2421 /* If the proper action on seeing token YYTOKEN is to reduce or to
2422 detect an error, take that action. */
2423 yyn += yytoken;
2424 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2425 goto yydefault;
2426 yyn = yytable[yyn];
2427 if (yyn <= 0)
2428 {
2429 if (yyn == 0 || yyn == YYTABLE_NINF)
2430 goto yyerrlab;
2431 yyn = -yyn;
2432 goto yyreduce;
2433 }
2434
2435 if (yyn == YYFINAL)
2436 YYACCEPT;
2437
2438 /* Shift the look-ahead token. */
2439 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2440
2441 /* Discard the token being shifted unless it is eof. */
2442 if (yychar != YYEOF)
2443 yychar = YYEMPTY;
2444
2445 *++yyvsp = yylval;
2446
2447
2448 /* Count tokens shifted since error; after three, turn off error
2449 status. */
2450 if (yyerrstatus)
2451 yyerrstatus--;
2452
2453 yystate = yyn;
2454 goto yynewstate;
2455
2456
2457/*-----------------------------------------------------------.
2458| yydefault -- do the default action for the current state. |
2459`-----------------------------------------------------------*/
2460yydefault:
2461 yyn = yydefact[yystate];
2462 if (yyn == 0)
2463 goto yyerrlab;
2464 goto yyreduce;
2465
2466
2467/*-----------------------------.
2468| yyreduce -- Do a reduction. |
2469`-----------------------------*/
2470yyreduce:
2471 /* yyn is the number of a rule to reduce with. */
2472 yylen = yyr2[yyn];
2473
2474 /* If YYLEN is nonzero, implement the default value of the action:
2475 `$$ = $1'.
2476
2477 Otherwise, the following line sets YYVAL to garbage.
2478 This behavior is undocumented and Bison
2479 users should not rely upon it. Assigning to YYVAL
2480 unconditionally makes the parser a bit smaller, and it avoids a
2481 GCC warning that YYVAL may be used uninitialized. */
2482 yyval = yyvsp[1-yylen];
2483
2484
2485 YY_REDUCE_PRINT (yyn);
2486 switch (yyn)
2487 {
Reid Spencer57f28f92006-12-03 07:10:26 +00002488 case 81:
Reid Spencer52402b02007-01-02 05:45:11 +00002489#line 447 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002490 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002491 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002492 ;}
2493 break;
2494
Reid Spencer57f28f92006-12-03 07:10:26 +00002495 case 82:
Reid Spencer52402b02007-01-02 05:45:11 +00002496#line 450 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002497 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002498 (yyval.String) = new std::string("");
Reid Spencere7c3c602006-11-30 06:36:44 +00002499 ;}
2500 break;
2501
Reid Spencer57f28f92006-12-03 07:10:26 +00002502 case 90:
Reid Spencer52402b02007-01-02 05:45:11 +00002503#line 457 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002504 { (yyval.String) = new std::string(""); ;}
2505 break;
2506
Reid Spencer57f28f92006-12-03 07:10:26 +00002507 case 97:
Reid Spencer52402b02007-01-02 05:45:11 +00002508#line 462 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002509 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002510 *(yyvsp[-1].String) += *(yyvsp[0].String);
2511 delete (yyvsp[0].String);
Reid Spencer16244f42006-12-01 21:10:07 +00002512 (yyval.String) = (yyvsp[-1].String);
2513 ;}
2514 break;
2515
Reid Spencer57f28f92006-12-03 07:10:26 +00002516 case 98:
Reid Spencer52402b02007-01-02 05:45:11 +00002517#line 467 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002518 { (yyval.String) = new std::string(""); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002519 break;
2520
Reid Spencer57f28f92006-12-03 07:10:26 +00002521 case 99:
Reid Spencer52402b02007-01-02 05:45:11 +00002522#line 472 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002523 { (yyval.String) = new std::string(); ;}
2524 break;
2525
Reid Spencer57f28f92006-12-03 07:10:26 +00002526 case 100:
Reid Spencer52402b02007-01-02 05:45:11 +00002527#line 473 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002528 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2529 break;
2530
Reid Spencer57f28f92006-12-03 07:10:26 +00002531 case 101:
Reid Spencer52402b02007-01-02 05:45:11 +00002532#line 476 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002533 { (yyval.String) = new std::string(); ;}
2534 break;
2535
Reid Spencer57f28f92006-12-03 07:10:26 +00002536 case 102:
Reid Spencer52402b02007-01-02 05:45:11 +00002537#line 477 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002538 {
2539 (yyvsp[-1].String)->insert(0, ", ");
Reid Spencerf2d55322006-12-01 21:52:30 +00002540 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2541 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002542 (yyval.String) = (yyvsp[-1].String);
2543 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002544 break;
2545
Reid Spencer57f28f92006-12-03 07:10:26 +00002546 case 103:
Reid Spencer52402b02007-01-02 05:45:11 +00002547#line 485 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002548 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002549 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2550 delete (yyvsp[0].String);
2551 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002552 ;}
2553 break;
2554
Reid Spencer57f28f92006-12-03 07:10:26 +00002555 case 104:
Reid Spencer52402b02007-01-02 05:45:11 +00002556#line 491 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002557 { (yyval.String) = new std::string(); ;}
2558 break;
2559
Reid Spencer57f28f92006-12-03 07:10:26 +00002560 case 106:
Reid Spencer52402b02007-01-02 05:45:11 +00002561#line 495 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002562 { (yyval.String) = new std::string(); ;}
2563 break;
2564
Reid Spencer57f28f92006-12-03 07:10:26 +00002565 case 107:
Reid Spencer52402b02007-01-02 05:45:11 +00002566#line 496 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002567 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002568 (yyvsp[-1].String)->insert(0, ", ");
2569 if (!(yyvsp[0].String)->empty())
2570 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2571 delete (yyvsp[0].String);
2572 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002573 ;}
2574 break;
2575
Reid Spencer57f28f92006-12-03 07:10:26 +00002576 case 109:
Reid Spencer52402b02007-01-02 05:45:11 +00002577#line 506 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002578 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002579 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2580 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002581 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002582 ;}
2583 break;
2584
Reid Spencer57f28f92006-12-03 07:10:26 +00002585 case 127:
Reid Spencer52402b02007-01-02 05:45:11 +00002586#line 528 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002587 {
Reid Spencer52402b02007-01-02 05:45:11 +00002588 (yyval.Type) = new TypeInfo((yyvsp[0].String), OpaqueTy);
Reid Spencera50d5962006-12-02 04:11:07 +00002589 ;}
2590 break;
2591
Reid Spencer57f28f92006-12-03 07:10:26 +00002592 case 128:
Reid Spencer52402b02007-01-02 05:45:11 +00002593#line 531 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002594 {
Reid Spencer52402b02007-01-02 05:45:11 +00002595 (yyval.Type) = new TypeInfo((yyvsp[0].String), UnresolvedTy);
Reid Spencera50d5962006-12-02 04:11:07 +00002596 ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00002597 break;
2598
Reid Spencer57f28f92006-12-03 07:10:26 +00002599 case 129:
Reid Spencer52402b02007-01-02 05:45:11 +00002600#line 534 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002601 {
2602 (yyval.Type) = (yyvsp[0].Type);
2603 ;}
2604 break;
2605
Reid Spencer57f28f92006-12-03 07:10:26 +00002606 case 130:
Reid Spencer52402b02007-01-02 05:45:11 +00002607#line 537 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002608 { // Type UpReference
Reid Spencerf2d55322006-12-01 21:52:30 +00002609 (yyvsp[0].String)->insert(0, "\\");
Reid Spencer52402b02007-01-02 05:45:11 +00002610 (yyval.Type) = new TypeInfo((yyvsp[0].String), NumericTy);
Reid Spencere77e35e2006-12-01 20:26:20 +00002611 ;}
2612 break;
2613
Reid Spencer57f28f92006-12-03 07:10:26 +00002614 case 131:
Reid Spencer52402b02007-01-02 05:45:11 +00002615#line 541 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002616 { // Function derived type?
Reid Spencer52402b02007-01-02 05:45:11 +00002617 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
2618 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
2619 if (i != 0)
2620 newTy += ", ";
2621 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
2622 newTy += "...";
2623 else
2624 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
2625 }
2626 newTy += ")";
2627 (yyval.Type) = new TypeInfo(new std::string(newTy), (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
2628 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere77e35e2006-12-01 20:26:20 +00002629 ;}
2630 break;
2631
Reid Spencer57f28f92006-12-03 07:10:26 +00002632 case 132:
Reid Spencer52402b02007-01-02 05:45:11 +00002633#line 555 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002634 { // Sized array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002635 (yyvsp[-3].String)->insert(0,"[ ");
Reid Spencer52402b02007-01-02 05:45:11 +00002636 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
2637 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
2638 (yyval.Type) = new TypeInfo((yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
2639 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002640 ;}
2641 break;
2642
Reid Spencer57f28f92006-12-03 07:10:26 +00002643 case 133:
Reid Spencer52402b02007-01-02 05:45:11 +00002644#line 562 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002645 { // Packed array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002646 (yyvsp[-3].String)->insert(0,"< ");
Reid Spencer52402b02007-01-02 05:45:11 +00002647 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
2648 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
2649 (yyval.Type) = new TypeInfo((yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
2650 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002651 ;}
2652 break;
2653
Reid Spencer57f28f92006-12-03 07:10:26 +00002654 case 134:
Reid Spencer52402b02007-01-02 05:45:11 +00002655#line 569 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002656 { // Structure type?
Reid Spencer52402b02007-01-02 05:45:11 +00002657 std::string newTy("{");
2658 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
2659 if (i != 0)
2660 newTy += ", ";
2661 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
2662 }
2663 newTy += "}";
2664 (yyval.Type) = new TypeInfo(new std::string(newTy), StructTy, (yyvsp[-1].TypeVec));
2665 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002666 ;}
2667 break;
2668
Reid Spencer57f28f92006-12-03 07:10:26 +00002669 case 135:
Reid Spencer52402b02007-01-02 05:45:11 +00002670#line 580 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002671 { // Empty structure type?
Reid Spencer52402b02007-01-02 05:45:11 +00002672 (yyval.Type) = new TypeInfo(new std::string("{}"), StructTy, new TypeList());
2673 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002674 ;}
2675 break;
2676
Reid Spencer57f28f92006-12-03 07:10:26 +00002677 case 136:
Reid Spencer52402b02007-01-02 05:45:11 +00002678#line 584 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002679 { // Packed Structure type?
Reid Spencer52402b02007-01-02 05:45:11 +00002680 std::string newTy("<{");
2681 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
2682 if (i != 0)
2683 newTy += ", ";
2684 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
2685 }
2686 newTy += "}>";
2687 (yyval.Type) = new TypeInfo(new std::string(newTy), PackedStructTy, (yyvsp[-2].TypeVec));
2688 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002689 ;}
2690 break;
2691
2692 case 137:
Reid Spencer52402b02007-01-02 05:45:11 +00002693#line 595 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002694 { // Empty packed structure type?
Reid Spencer52402b02007-01-02 05:45:11 +00002695 (yyval.Type) = new TypeInfo(new std::string("<{}>"), PackedStructTy, new TypeList());
2696 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002697 ;}
2698 break;
2699
2700 case 138:
Reid Spencer52402b02007-01-02 05:45:11 +00002701#line 599 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002702 { // Pointer type?
Reid Spencer52402b02007-01-02 05:45:11 +00002703 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
2704 EnumeratedTypes.push_back(*(yyval.Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002705 ;}
2706 break;
2707
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002708 case 139:
Reid Spencer52402b02007-01-02 05:45:11 +00002709#line 608 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002710 {
Reid Spencer52402b02007-01-02 05:45:11 +00002711 (yyval.TypeVec) = new TypeList();
2712 (yyval.TypeVec)->push_back((yyvsp[0].Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002713 ;}
2714 break;
2715
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002716 case 140:
Reid Spencer52402b02007-01-02 05:45:11 +00002717#line 612 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002718 {
Reid Spencer52402b02007-01-02 05:45:11 +00002719 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
2720 (yyval.TypeVec)->push_back((yyvsp[0].Type));
Reid Spencere7c3c602006-11-30 06:36:44 +00002721 ;}
2722 break;
2723
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002724 case 142:
Reid Spencer52402b02007-01-02 05:45:11 +00002725#line 620 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002726 {
Reid Spencer52402b02007-01-02 05:45:11 +00002727 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
2728 (yyval.TypeVec)->push_back(new TypeInfo("void",VoidTy));
Reid Spencere77e35e2006-12-01 20:26:20 +00002729 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002730 ;}
2731 break;
2732
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002733 case 143:
Reid Spencer52402b02007-01-02 05:45:11 +00002734#line 625 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002735 {
Reid Spencer52402b02007-01-02 05:45:11 +00002736 (yyval.TypeVec) = new TypeList();
2737 (yyval.TypeVec)->push_back(new TypeInfo("void",VoidTy));
2738 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002739 ;}
2740 break;
2741
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002742 case 144:
Reid Spencer52402b02007-01-02 05:45:11 +00002743#line 630 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002744 {
Reid Spencer52402b02007-01-02 05:45:11 +00002745 (yyval.TypeVec) = new TypeList();
Reid Spencere7c3c602006-11-30 06:36:44 +00002746 ;}
2747 break;
2748
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002749 case 145:
Reid Spencer52402b02007-01-02 05:45:11 +00002750#line 640 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002751 { // Nonempty unsized arr
2752 (yyval.Const).type = (yyvsp[-3].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002753 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
Reid Spencere77e35e2006-12-01 20:26:20 +00002754 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2755 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002756 ;}
2757 break;
2758
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002759 case 146:
Reid Spencer52402b02007-01-02 05:45:11 +00002760#line 646 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002761 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002762 (yyval.Const).type = (yyvsp[-2].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002763 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
Reid Spencere77e35e2006-12-01 20:26:20 +00002764 *(yyval.Const).cnst += "[ ]";
Reid Spencere7c3c602006-11-30 06:36:44 +00002765 ;}
2766 break;
2767
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002768 case 147:
Reid Spencer52402b02007-01-02 05:45:11 +00002769#line 651 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002770 {
2771 (yyval.Const).type = (yyvsp[-2].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002772 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
Reid Spencere77e35e2006-12-01 20:26:20 +00002773 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2774 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002775 ;}
2776 break;
2777
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002778 case 148:
Reid Spencer52402b02007-01-02 05:45:11 +00002779#line 657 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002780 { // Nonempty unsized arr
2781 (yyval.Const).type = (yyvsp[-3].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002782 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
Reid Spencere77e35e2006-12-01 20:26:20 +00002783 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2784 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002785 ;}
2786 break;
2787
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002788 case 149:
Reid Spencer52402b02007-01-02 05:45:11 +00002789#line 663 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002790 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002791 (yyval.Const).type = (yyvsp[-3].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002792 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
Reid Spencere77e35e2006-12-01 20:26:20 +00002793 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2794 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002795 ;}
2796 break;
2797
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002798 case 150:
Reid Spencer52402b02007-01-02 05:45:11 +00002799#line 669 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002800 {
2801 (yyval.Const).type = (yyvsp[-2].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002802 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
Reid Spencer0b7e5072006-12-01 22:42:01 +00002803 *(yyval.Const).cnst += " {}";
Reid Spencere7c3c602006-11-30 06:36:44 +00002804 ;}
2805 break;
2806
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002807 case 151:
Reid Spencer52402b02007-01-02 05:45:11 +00002808#line 674 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002809 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002810 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002811 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencerf2d55322006-12-01 21:52:30 +00002812 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2813 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002814 ;}
2815 break;
2816
Reid Spencer187ccf82006-12-09 16:57:22 +00002817 case 152:
Reid Spencer52402b02007-01-02 05:45:11 +00002818#line 680 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002819 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002820 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002821 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencerf2d55322006-12-01 21:52:30 +00002822 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2823 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002824 ;}
2825 break;
2826
Reid Spencer187ccf82006-12-09 16:57:22 +00002827 case 153:
Reid Spencer52402b02007-01-02 05:45:11 +00002828#line 686 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer187ccf82006-12-09 16:57:22 +00002829 {
Reid Spencer52402b02007-01-02 05:45:11 +00002830 std::string Name = getUniqueName((yyvsp[0].String),(yyvsp[-1].Type));
Reid Spencer187ccf82006-12-09 16:57:22 +00002831 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002832 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
2833 *(yyval.Const).cnst += " " + Name;
Reid Spencer187ccf82006-12-09 16:57:22 +00002834 delete (yyvsp[0].String);
2835 ;}
2836 break;
2837
2838 case 154:
Reid Spencer52402b02007-01-02 05:45:11 +00002839#line 693 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002840 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002841 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002842 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencerf2d55322006-12-01 21:52:30 +00002843 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2844 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002845 ;}
2846 break;
2847
Reid Spencer57f28f92006-12-03 07:10:26 +00002848 case 155:
Reid Spencer52402b02007-01-02 05:45:11 +00002849#line 699 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002850 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002851 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002852 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencerf2d55322006-12-01 21:52:30 +00002853 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2854 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002855 ;}
2856 break;
2857
Reid Spencer57f28f92006-12-03 07:10:26 +00002858 case 156:
Reid Spencer52402b02007-01-02 05:45:11 +00002859#line 705 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002860 { // integral constants
Reid Spencere77e35e2006-12-01 20:26:20 +00002861 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002862 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencerf2d55322006-12-01 21:52:30 +00002863 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2864 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002865 ;}
2866 break;
2867
Reid Spencer57f28f92006-12-03 07:10:26 +00002868 case 157:
Reid Spencer52402b02007-01-02 05:45:11 +00002869#line 711 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002870 { // integral constants
Reid Spencer78720742006-12-02 20:21:22 +00002871 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002872 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencer78720742006-12-02 20:21:22 +00002873 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2874 delete (yyvsp[0].String);
2875 ;}
2876 break;
2877
Reid Spencer57f28f92006-12-03 07:10:26 +00002878 case 158:
Reid Spencer52402b02007-01-02 05:45:11 +00002879#line 717 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002880 { // Boolean constants
Reid Spencer78720742006-12-02 20:21:22 +00002881 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002882 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencer78720742006-12-02 20:21:22 +00002883 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2884 delete (yyvsp[0].String);
2885 ;}
2886 break;
2887
Reid Spencer57f28f92006-12-03 07:10:26 +00002888 case 159:
Reid Spencer52402b02007-01-02 05:45:11 +00002889#line 723 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002890 { // Boolean constants
2891 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002892 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002893 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2894 delete (yyvsp[0].String);
2895 ;}
2896 break;
2897
2898 case 160:
Reid Spencer52402b02007-01-02 05:45:11 +00002899#line 729 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002900 { // Float & Double constants
2901 (yyval.Const).type = (yyvsp[-1].Type);
Reid Spencer52402b02007-01-02 05:45:11 +00002902 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002903 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2904 delete (yyvsp[0].String);
2905 ;}
2906 break;
2907
2908 case 161:
Reid Spencer52402b02007-01-02 05:45:11 +00002909#line 737 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002910 {
Reid Spencer280d8012006-12-01 23:40:53 +00002911 std::string source = *(yyvsp[-3].Const).cnst;
Reid Spencer52402b02007-01-02 05:45:11 +00002912 TypeInfo* DstTy = ResolveType((yyvsp[-1].Type));
Reid Spencer280d8012006-12-01 23:40:53 +00002913 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002914 // Call getCastUpgrade to upgrade the old cast
Reid Spencer52402b02007-01-02 05:45:11 +00002915 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, DstTy, true));
Reid Spencera50d5962006-12-02 04:11:07 +00002916 } else {
2917 // Nothing to upgrade, just create the cast constant expr
2918 (yyval.String) = new std::string(*(yyvsp[-5].String));
Reid Spencer52402b02007-01-02 05:45:11 +00002919 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002920 }
Reid Spencer52402b02007-01-02 05:45:11 +00002921 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); delete (yyvsp[-1].Type);
Reid Spencere7c3c602006-11-30 06:36:44 +00002922 ;}
2923 break;
2924
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002925 case 162:
Reid Spencer52402b02007-01-02 05:45:11 +00002926#line 750 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002927 {
Reid Spencerf8483652006-12-02 15:16:01 +00002928 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2929 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2930 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2931 *(yyvsp[-4].String) += ", " + *VI.val;
2932 VI.destroy();
2933 }
2934 *(yyvsp[-4].String) += ")";
Reid Spencere77e35e2006-12-01 20:26:20 +00002935 (yyval.String) = (yyvsp[-4].String);
2936 (yyvsp[-2].Const).destroy();
Reid Spencerf8483652006-12-02 15:16:01 +00002937 delete (yyvsp[-1].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00002938 ;}
2939 break;
2940
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002941 case 163:
Reid Spencer52402b02007-01-02 05:45:11 +00002942#line 762 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002943 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002944 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2945 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2946 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002947 ;}
2948 break;
2949
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002950 case 164:
Reid Spencer52402b02007-01-02 05:45:11 +00002951#line 767 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002952 {
Reid Spencer78720742006-12-02 20:21:22 +00002953 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
2954 (yyval.String) = new std::string(op);
2955 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2956 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002957 ;}
2958 break;
2959
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002960 case 165:
Reid Spencer52402b02007-01-02 05:45:11 +00002961#line 773 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002962 {
2963 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2964 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2965 (yyval.String) = (yyvsp[-5].String);
2966 ;}
2967 break;
2968
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002969 case 166:
Reid Spencer52402b02007-01-02 05:45:11 +00002970#line 778 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00002971 {
Reid Spencer229e9362006-12-02 22:14:11 +00002972 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
Reid Spencer78720742006-12-02 20:21:22 +00002973 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2974 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2975 (yyval.String) = (yyvsp[-5].String);
2976 ;}
2977 break;
2978
Reid Spencer57f28f92006-12-03 07:10:26 +00002979 case 167:
Reid Spencer52402b02007-01-02 05:45:11 +00002980#line 784 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002981 {
2982 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2983 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2984 (yyval.String) = (yyvsp[-6].String);
2985 ;}
2986 break;
2987
2988 case 168:
Reid Spencer52402b02007-01-02 05:45:11 +00002989#line 789 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00002990 {
2991 *(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2992 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2993 (yyval.String) = (yyvsp[-6].String);
2994 ;}
2995 break;
2996
2997 case 169:
Reid Spencer52402b02007-01-02 05:45:11 +00002998#line 794 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00002999 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003000 const char* shiftop = (yyvsp[-5].String)->c_str();
3001 if (*(yyvsp[-5].String) == "shr")
Reid Spencer52402b02007-01-02 05:45:11 +00003002 shiftop = ((yyvsp[-3].Const).type->isUnsigned()) ? "lshr" : "ashr";
Reid Spencerf7bde222006-12-01 22:26:37 +00003003 (yyval.String) = new std::string(shiftop);
3004 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3005 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003006 ;}
3007 break;
3008
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003009 case 170:
Reid Spencer52402b02007-01-02 05:45:11 +00003010#line 802 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003011 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003012 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3013 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3014 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003015 ;}
3016 break;
3017
Reid Spencer57f28f92006-12-03 07:10:26 +00003018 case 171:
Reid Spencer52402b02007-01-02 05:45:11 +00003019#line 807 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003020 {
3021 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3022 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3023 (yyval.String) = (yyvsp[-7].String);
3024 ;}
3025 break;
3026
3027 case 172:
Reid Spencer52402b02007-01-02 05:45:11 +00003028#line 812 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003029 {
3030 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3031 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3032 (yyval.String) = (yyvsp[-7].String);
3033 ;}
3034 break;
3035
3036 case 173:
Reid Spencer52402b02007-01-02 05:45:11 +00003037#line 822 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003038 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003039 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
3040 (yyvsp[0].Const).destroy();
3041 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003042 ;}
3043 break;
3044
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003045 case 174:
Reid Spencer52402b02007-01-02 05:45:11 +00003046#line 827 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003047 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003048 break;
3049
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003050 case 177:
Reid Spencer52402b02007-01-02 05:45:11 +00003051#line 842 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003052 {
3053;}
3054 break;
3055
Reid Spencer57f28f92006-12-03 07:10:26 +00003056 case 178:
Reid Spencer52402b02007-01-02 05:45:11 +00003057#line 847 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003058 {
Reid Spencerd154b572006-12-01 20:36:40 +00003059 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003060 ;}
3061 break;
3062
Reid Spencer57f28f92006-12-03 07:10:26 +00003063 case 179:
Reid Spencer52402b02007-01-02 05:45:11 +00003064#line 850 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003065 {
3066 *O << *(yyvsp[0].String) << '\n';
3067 delete (yyvsp[0].String);
3068 (yyval.String) = 0;
3069 ;}
3070 break;
3071
3072 case 180:
Reid Spencer52402b02007-01-02 05:45:11 +00003073#line 855 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003074 {
3075 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3076 (yyval.String) = 0;
3077 ;}
3078 break;
3079
3080 case 181:
Reid Spencer52402b02007-01-02 05:45:11 +00003081#line 859 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003082 {
Reid Spencerd154b572006-12-01 20:36:40 +00003083 *O << "implementation\n";
3084 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003085 ;}
3086 break;
3087
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003088 case 182:
Reid Spencer52402b02007-01-02 05:45:11 +00003089#line 863 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00003090 { (yyval.String) = 0; ;}
3091 break;
3092
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003093 case 184:
Reid Spencer52402b02007-01-02 05:45:11 +00003094#line 865 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003095 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3096 break;
3097
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003098 case 185:
Reid Spencer52402b02007-01-02 05:45:11 +00003099#line 868 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003100 {
Reid Spencer52402b02007-01-02 05:45:11 +00003101 EnumeratedTypes.push_back(*(yyvsp[0].Type));
Reid Spencera50d5962006-12-02 04:11:07 +00003102 if (!(yyvsp[-2].String)->empty()) {
Reid Spencer52402b02007-01-02 05:45:11 +00003103 NamedTypes[*(yyvsp[-2].String)] = *(yyvsp[0].Type);
Reid Spencera50d5962006-12-02 04:11:07 +00003104 *O << *(yyvsp[-2].String) << " = ";
3105 }
Reid Spencer52402b02007-01-02 05:45:11 +00003106 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3107 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003108 (yyval.String) = 0;
3109 ;}
3110 break;
3111
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003112 case 186:
Reid Spencer52402b02007-01-02 05:45:11 +00003113#line 878 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003114 { // Function prototypes can be in const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003115 *O << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003116 delete (yyvsp[0].String);
3117 (yyval.String) = 0;
3118 ;}
3119 break;
3120
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003121 case 187:
Reid Spencer52402b02007-01-02 05:45:11 +00003122#line 883 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003123 { // Asm blocks can be in the const pool
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003124 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003125 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3126 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003127 ;}
3128 break;
3129
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003130 case 188:
Reid Spencer52402b02007-01-02 05:45:11 +00003131#line 888 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003132 {
Reid Spencerf12ee422006-12-05 19:21:25 +00003133 if (!(yyvsp[-4].String)->empty()) {
Reid Spencer52402b02007-01-02 05:45:11 +00003134 std::string Name = getUniqueName((yyvsp[-4].String),(yyvsp[-1].Const).type);
3135 *O << Name << " = ";
3136 Globals[Name] = *(yyvsp[-1].Const).type;
Reid Spencerf12ee422006-12-05 19:21:25 +00003137 }
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003138 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
Reid Spencer52402b02007-01-02 05:45:11 +00003139 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003140 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003141 ;}
3142 break;
3143
Reid Spencer57f28f92006-12-03 07:10:26 +00003144 case 189:
Reid Spencer52402b02007-01-02 05:45:11 +00003145#line 898 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003146 {
Reid Spencerf12ee422006-12-05 19:21:25 +00003147 if (!(yyvsp[-4].String)->empty()) {
Reid Spencer52402b02007-01-02 05:45:11 +00003148 std::string Name = getUniqueName((yyvsp[-4].String),(yyvsp[-1].Type));
3149 *O << Name << " = ";
3150 Globals[Name] = *(yyvsp[-1].Type);
Reid Spencerf12ee422006-12-05 19:21:25 +00003151 }
Reid Spencer52402b02007-01-02 05:45:11 +00003152 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3153 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
Reid Spencerfcb5df82006-12-01 22:34:43 +00003154 (yyval.String) = 0;
3155 ;}
3156 break;
3157
Reid Spencer57f28f92006-12-03 07:10:26 +00003158 case 190:
Reid Spencer52402b02007-01-02 05:45:11 +00003159#line 908 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003160 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003161 if (!(yyvsp[-4].String)->empty()) {
Reid Spencer52402b02007-01-02 05:45:11 +00003162 std::string Name = getUniqueName((yyvsp[-4].String),(yyvsp[-1].Type));
3163 *O << Name << " = ";
3164 Globals[Name] = *(yyvsp[-1].Type);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003165 }
Reid Spencer52402b02007-01-02 05:45:11 +00003166 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3167 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003168 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003169 ;}
3170 break;
3171
Reid Spencerf5626a32007-01-01 01:20:41 +00003172 case 191:
Reid Spencer52402b02007-01-02 05:45:11 +00003173#line 918 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf5626a32007-01-01 01:20:41 +00003174 {
3175 if (!(yyvsp[-4].String)->empty()) {
Reid Spencer52402b02007-01-02 05:45:11 +00003176 std::string Name = getUniqueName((yyvsp[-4].String),(yyvsp[-1].Type));
3177 *O << Name << " = ";
3178 Globals[Name] = *(yyvsp[-1].Type);
Reid Spencerf5626a32007-01-01 01:20:41 +00003179 }
Reid Spencer52402b02007-01-02 05:45:11 +00003180 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3181 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
Reid Spencerf5626a32007-01-01 01:20:41 +00003182 (yyval.String) = 0;
3183 ;}
3184 break;
3185
3186 case 192:
Reid Spencer52402b02007-01-02 05:45:11 +00003187#line 928 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003188 {
3189 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3190 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3191 (yyval.String) = 0;
3192 ;}
3193 break;
3194
3195 case 193:
Reid Spencer52402b02007-01-02 05:45:11 +00003196#line 933 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003197 {
3198 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3199 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3200 (yyval.String) = 0;
3201 ;}
3202 break;
3203
3204 case 194:
Reid Spencer52402b02007-01-02 05:45:11 +00003205#line 938 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003206 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003207 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003208 ;}
3209 break;
3210
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003211 case 198:
Reid Spencer52402b02007-01-02 05:45:11 +00003212#line 948 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003213 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003214 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3215 delete (yyvsp[0].String);
3216 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003217 ;}
3218 break;
3219
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003220 case 199:
Reid Spencer52402b02007-01-02 05:45:11 +00003221#line 953 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003222 {
Reid Spencerf2d55322006-12-01 21:52:30 +00003223 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3224 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00003225 SizeOfPointer = 64;
Reid Spencerf2d55322006-12-01 21:52:30 +00003226 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003227 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003228 ;}
3229 break;
3230
Reid Spencer57f28f92006-12-03 07:10:26 +00003231 case 200:
Reid Spencer52402b02007-01-02 05:45:11 +00003232#line 960 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003233 {
3234 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3235 delete (yyvsp[0].String);
3236 (yyval.String) = (yyvsp[-2].String);
3237 ;}
3238 break;
3239
3240 case 201:
Reid Spencer52402b02007-01-02 05:45:11 +00003241#line 965 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003242 {
3243 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3244 delete (yyvsp[0].String);
3245 (yyval.String) = (yyvsp[-2].String);
3246 ;}
3247 break;
3248
3249 case 202:
Reid Spencer52402b02007-01-02 05:45:11 +00003250#line 972 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003251 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003252 (yyvsp[-1].String)->insert(0, "[ ");
3253 *(yyvsp[-1].String) += " ]";
3254 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003255 ;}
3256 break;
3257
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003258 case 203:
Reid Spencer52402b02007-01-02 05:45:11 +00003259#line 979 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003260 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003261 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3262 delete (yyvsp[0].String);
3263 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003264 ;}
3265 break;
3266
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003267 case 205:
Reid Spencer52402b02007-01-02 05:45:11 +00003268#line 985 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003269 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003270 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00003271 ;}
3272 break;
3273
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003274 case 209:
Reid Spencer52402b02007-01-02 05:45:11 +00003275#line 994 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003276 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003277 break;
3278
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003279 case 210:
Reid Spencer52402b02007-01-02 05:45:11 +00003280#line 996 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003281 {
Reid Spencer52402b02007-01-02 05:45:11 +00003282 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3283 if (!(yyvsp[0].String)->empty()) {
3284 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type));
3285 *(yyval.String) += " " + Name;
3286 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003287 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003288;}
3289 break;
3290
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003291 case 211:
Reid Spencer52402b02007-01-02 05:45:11 +00003292#line 1005 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003293 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003294 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3295 delete (yyvsp[0].String);
3296 ;}
3297 break;
3298
Reid Spencer57f28f92006-12-03 07:10:26 +00003299 case 212:
Reid Spencer52402b02007-01-02 05:45:11 +00003300#line 1009 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003301 {
3302 (yyval.String) = (yyvsp[0].String);
3303 ;}
3304 break;
3305
3306 case 213:
Reid Spencer52402b02007-01-02 05:45:11 +00003307#line 1013 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003308 {
3309 (yyval.String) = (yyvsp[0].String);
3310 ;}
3311 break;
3312
3313 case 214:
Reid Spencer52402b02007-01-02 05:45:11 +00003314#line 1016 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003315 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003316 *(yyvsp[-2].String) += ", ...";
3317 (yyval.String) = (yyvsp[-2].String);
3318 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003319 ;}
3320 break;
3321
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003322 case 215:
Reid Spencer52402b02007-01-02 05:45:11 +00003323#line 1021 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003324 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003325 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003326 ;}
3327 break;
3328
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003329 case 216:
Reid Spencer52402b02007-01-02 05:45:11 +00003330#line 1024 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003331 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003332 break;
3333
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003334 case 217:
Reid Spencer52402b02007-01-02 05:45:11 +00003335#line 1027 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003336 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003337 if (!(yyvsp[-7].String)->empty()) {
3338 *(yyvsp[-7].String) += " ";
3339 }
Reid Spencer52402b02007-01-02 05:45:11 +00003340 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
Reid Spencere77e35e2006-12-01 20:26:20 +00003341 if (!(yyvsp[-1].String)->empty()) {
3342 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3343 }
3344 if (!(yyvsp[0].String)->empty()) {
3345 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3346 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003347 delete (yyvsp[-5].String);
3348 delete (yyvsp[-3].String);
3349 delete (yyvsp[-1].String);
3350 delete (yyvsp[0].String);
3351 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003352 ;}
3353 break;
3354
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003355 case 218:
Reid Spencer52402b02007-01-02 05:45:11 +00003356#line 1045 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003357 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003358 break;
3359
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003360 case 219:
Reid Spencer52402b02007-01-02 05:45:11 +00003361#line 1046 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003362 { (yyval.String) = new std::string ("{"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003363 break;
3364
Reid Spencer57f28f92006-12-03 07:10:26 +00003365 case 220:
Reid Spencer52402b02007-01-02 05:45:11 +00003366#line 1049 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003367 {
3368 *O << "define ";
3369 if (!(yyvsp[-2].String)->empty()) {
3370 *O << *(yyvsp[-2].String) << ' ';
3371 }
3372 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3373 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3374 (yyval.String) = 0;
3375 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003376 break;
3377
Reid Spencer57f28f92006-12-03 07:10:26 +00003378 case 221:
Reid Spencer52402b02007-01-02 05:45:11 +00003379#line 1060 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003380 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3381 break;
3382
Reid Spencer71d2ec92006-12-31 06:02:26 +00003383 case 222:
Reid Spencer52402b02007-01-02 05:45:11 +00003384#line 1061 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003385 { (yyval.String) = new std::string("}"); ;}
3386 break;
3387
Reid Spencer71d2ec92006-12-31 06:02:26 +00003388 case 223:
Reid Spencer52402b02007-01-02 05:45:11 +00003389#line 1063 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003390 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003391 if ((yyvsp[-1].String))
3392 *O << *(yyvsp[-1].String);
Reid Spencer71d2ec92006-12-31 06:02:26 +00003393 *O << *(yyvsp[0].String) << "\n\n";
Reid Spencer52402b02007-01-02 05:45:11 +00003394 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
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 224:
Reid Spencer52402b02007-01-02 05:45:11 +00003400#line 1072 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003401 { (yyval.String) = new std::string(); ;}
3402 break;
3403
Reid Spencer71d2ec92006-12-31 06:02:26 +00003404 case 227:
Reid Spencer52402b02007-01-02 05:45:11 +00003405#line 1078 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003406 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003407 if (!(yyvsp[-1].String)->empty())
3408 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3409 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3410 delete (yyvsp[-1].String);
3411 delete (yyvsp[0].String);
3412 (yyval.String) = (yyvsp[-2].String);
3413 ;}
3414 break;
3415
Reid Spencer71d2ec92006-12-31 06:02:26 +00003416 case 228:
Reid Spencer52402b02007-01-02 05:45:11 +00003417#line 1091 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003418 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003419 break;
3420
Reid Spencer71d2ec92006-12-31 06:02:26 +00003421 case 238:
Reid Spencer52402b02007-01-02 05:45:11 +00003422#line 1097 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003423 {
3424 (yyvsp[-1].String)->insert(0, "<");
3425 *(yyvsp[-1].String) += ">";
3426 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003427 ;}
3428 break;
3429
Reid Spencer71d2ec92006-12-31 06:02:26 +00003430 case 240:
Reid Spencer52402b02007-01-02 05:45:11 +00003431#line 1103 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003432 {
3433 if (!(yyvsp[-3].String)->empty()) {
3434 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3435 }
3436 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3437 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3438 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003439 ;}
3440 break;
3441
Reid Spencer71d2ec92006-12-31 06:02:26 +00003442 case 243:
Reid Spencer52402b02007-01-02 05:45:11 +00003443#line 1116 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003444 {
Reid Spencerf459d392006-12-02 16:19:52 +00003445 (yyval.Value).val = (yyvsp[0].String);
3446 (yyval.Value).constant = false;
Reid Spencer52402b02007-01-02 05:45:11 +00003447 (yyval.Value).type = new TypeInfo();
Reid Spencerf459d392006-12-02 16:19:52 +00003448 ;}
3449 break;
3450
Reid Spencer71d2ec92006-12-31 06:02:26 +00003451 case 244:
Reid Spencer52402b02007-01-02 05:45:11 +00003452#line 1121 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003453 {
3454 (yyval.Value).val = (yyvsp[0].String);
3455 (yyval.Value).constant = true;
Reid Spencer52402b02007-01-02 05:45:11 +00003456 (yyval.Value).type = new TypeInfo();
Reid Spencerf459d392006-12-02 16:19:52 +00003457 ;}
3458 break;
3459
Reid Spencer71d2ec92006-12-31 06:02:26 +00003460 case 245:
Reid Spencer52402b02007-01-02 05:45:11 +00003461#line 1131 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf459d392006-12-02 16:19:52 +00003462 {
Reid Spencer52402b02007-01-02 05:45:11 +00003463 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
Reid Spencerf459d392006-12-02 16:19:52 +00003464 (yyval.Value) = (yyvsp[0].Value);
Reid Spencer52402b02007-01-02 05:45:11 +00003465 delete (yyval.Value).val;
3466 delete (yyval.Value).type;
3467 (yyval.Value).val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
Reid Spencere77e35e2006-12-01 20:26:20 +00003468 (yyval.Value).type = (yyvsp[-1].Type);
Reid Spencere77e35e2006-12-01 20:26:20 +00003469 ;}
3470 break;
3471
Reid Spencer71d2ec92006-12-31 06:02:26 +00003472 case 246:
Reid Spencer52402b02007-01-02 05:45:11 +00003473#line 1140 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003474 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003475 (yyval.String) = 0;
3476 ;}
3477 break;
3478
Reid Spencer71d2ec92006-12-31 06:02:26 +00003479 case 247:
Reid Spencer52402b02007-01-02 05:45:11 +00003480#line 1143 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003481 { // Do not allow functions with 0 basic blocks
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 248:
Reid Spencer52402b02007-01-02 05:45:11 +00003487#line 1151 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003488 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003489 (yyval.String) = 0;
3490 ;}
3491 break;
3492
Reid Spencer71d2ec92006-12-31 06:02:26 +00003493 case 249:
Reid Spencer52402b02007-01-02 05:45:11 +00003494#line 1155 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003495 {
3496 *O << " " << *(yyvsp[0].String) << '\n';
Reid Spencere77e35e2006-12-01 20:26:20 +00003497 delete (yyvsp[0].String);
3498 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003499 ;}
3500 break;
3501
Reid Spencer71d2ec92006-12-31 06:02:26 +00003502 case 250:
Reid Spencer52402b02007-01-02 05:45:11 +00003503#line 1160 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003504 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003505 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003506 ;}
3507 break;
3508
Reid Spencer71d2ec92006-12-31 06:02:26 +00003509 case 251:
Reid Spencer52402b02007-01-02 05:45:11 +00003510#line 1163 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003511 {
3512 *O << *(yyvsp[0].String) << '\n';
3513 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003514 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003515 ;}
3516 break;
3517
Reid Spencer71d2ec92006-12-31 06:02:26 +00003518 case 253:
Reid Spencer52402b02007-01-02 05:45:11 +00003519#line 1169 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003520 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3521 break;
3522
Reid Spencer71d2ec92006-12-31 06:02:26 +00003523 case 254:
Reid Spencer52402b02007-01-02 05:45:11 +00003524#line 1171 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003525 { // Return with a result...
3526 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3527 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3528 (yyval.String) = 0;
3529 ;}
3530 break;
3531
Reid Spencer71d2ec92006-12-31 06:02:26 +00003532 case 255:
Reid Spencer52402b02007-01-02 05:45:11 +00003533#line 1176 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003534 { // Return with no result...
Reid Spencer52402b02007-01-02 05:45:11 +00003535 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
3536 delete (yyvsp[-1].String); delete (yyvsp[0].Type);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003537 (yyval.String) = 0;
3538 ;}
3539 break;
3540
Reid Spencer71d2ec92006-12-31 06:02:26 +00003541 case 256:
Reid Spencer52402b02007-01-02 05:45:11 +00003542#line 1181 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003543 { // Unconditional Branch...
Reid Spencer52402b02007-01-02 05:45:11 +00003544 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3545 delete (yyvsp[-2].String); delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003546 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003547 ;}
3548 break;
3549
Reid Spencer71d2ec92006-12-31 06:02:26 +00003550 case 257:
Reid Spencer52402b02007-01-02 05:45:11 +00003551#line 1186 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003552 {
Reid Spencer52402b02007-01-02 05:45:11 +00003553 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3554 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3555 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003556 << *(yyvsp[0].Value).val << '\n';
Reid Spencer52402b02007-01-02 05:45:11 +00003557 delete (yyvsp[-8].String); delete (yyvsp[-7].Type); (yyvsp[-6].Value).destroy(); delete (yyvsp[-4].Type); (yyvsp[-3].Value).destroy();
3558 delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003559 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003560 ;}
3561 break;
3562
Reid Spencer71d2ec92006-12-31 06:02:26 +00003563 case 258:
Reid Spencer52402b02007-01-02 05:45:11 +00003564#line 1195 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003565 {
Reid Spencer52402b02007-01-02 05:45:11 +00003566 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3567 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3568 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3569 delete (yyvsp[-8].String); delete (yyvsp[-7].Type); (yyvsp[-6].Value).destroy(); delete (yyvsp[-4].Type); (yyvsp[-3].Value).destroy();
Reid Spencerf459d392006-12-02 16:19:52 +00003570 delete (yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003571 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003572 ;}
3573 break;
3574
Reid Spencer71d2ec92006-12-31 06:02:26 +00003575 case 259:
Reid Spencer52402b02007-01-02 05:45:11 +00003576#line 1203 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003577 {
Reid Spencer52402b02007-01-02 05:45:11 +00003578 std::string Name = getUniqueName((yyvsp[-5].Value).val, (yyvsp[-6].Type));
3579 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
3580 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value).val << "[]\n";
3581 delete (yyvsp[-7].String); delete (yyvsp[-6].Type); (yyvsp[-5].Value).destroy(); delete (yyvsp[-3].Type); (yyvsp[-2].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003582 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003583 ;}
3584 break;
3585
Reid Spencer71d2ec92006-12-31 06:02:26 +00003586 case 260:
Reid Spencer52402b02007-01-02 05:45:11 +00003587#line 1211 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003588 {
Reid Spencer52402b02007-01-02 05:45:11 +00003589 TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
Reid Spencer16244f42006-12-01 21:10:07 +00003590 *O << " ";
Reid Spencer52402b02007-01-02 05:45:11 +00003591 if (!(yyvsp[-13].String)->empty()) {
3592 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
3593 *O << Name << " = ";
3594 }
3595 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value).val << " (";
Reid Spencerf8483652006-12-02 15:16:01 +00003596 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3597 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
3598 *O << *VI.val;
3599 if (i+1 < (yyvsp[-7].ValList)->size())
3600 *O << ", ";
3601 VI.destroy();
3602 }
Reid Spencer52402b02007-01-02 05:45:11 +00003603 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ' '
3604 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3605 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); delete (yyvsp[-10].Type); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3606 delete (yyvsp[-5].String); delete (yyvsp[-4].Type); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); delete (yyvsp[-1].Type);
Reid Spencerf459d392006-12-02 16:19:52 +00003607 (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003608 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003609 ;}
3610 break;
3611
Reid Spencer71d2ec92006-12-31 06:02:26 +00003612 case 261:
Reid Spencer52402b02007-01-02 05:45:11 +00003613#line 1233 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003614 {
3615 *O << " " << *(yyvsp[0].String) << '\n';
3616 delete (yyvsp[0].String);
3617 (yyval.String) = 0;
3618 ;}
3619 break;
3620
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003621 case 262:
Reid Spencer52402b02007-01-02 05:45:11 +00003622#line 1238 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003623 {
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003624 *O << " " << *(yyvsp[0].String) << '\n';
Reid Spencerfcb5df82006-12-01 22:34:43 +00003625 delete (yyvsp[0].String);
3626 (yyval.String) = 0;
3627 ;}
3628 break;
3629
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003630 case 263:
Reid Spencer52402b02007-01-02 05:45:11 +00003631#line 1244 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003632 {
Reid Spencer52402b02007-01-02 05:45:11 +00003633 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
3634 *(yyvsp[0].Value).val;
3635 delete (yyvsp[-4].Type); delete (yyvsp[-3].String); delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003636 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003637 ;}
3638 break;
3639
Reid Spencer71d2ec92006-12-31 06:02:26 +00003640 case 264:
Reid Spencer52402b02007-01-02 05:45:11 +00003641#line 1250 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003642 {
Reid Spencer52402b02007-01-02 05:45:11 +00003643 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
3644 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value).val;
3645 delete (yyvsp[-4].Type); delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003646 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003647 ;}
3648 break;
3649
Reid Spencer71d2ec92006-12-31 06:02:26 +00003650 case 265:
Reid Spencer52402b02007-01-02 05:45:11 +00003651#line 1258 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003652 {
Reid Spencerf5626a32007-01-01 01:20:41 +00003653 if (!(yyvsp[-1].String)->empty()) {
3654 if (deleteUselessCastFlag && *deleteUselessCastName == *(yyvsp[-1].String)) {
3655 *(yyvsp[-1].String) += " = ";
3656 (yyvsp[-1].String)->insert(0, "; "); // don't actually delete it, just comment it out
3657 delete deleteUselessCastName;
3658 } else {
Reid Spencer52402b02007-01-02 05:45:11 +00003659 // Get a unique name for the name of this value, based on its type.
3660 *(yyvsp[-1].String) = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value).type) + " = ";
Reid Spencerf5626a32007-01-01 01:20:41 +00003661 }
3662 }
Reid Spencer52402b02007-01-02 05:45:11 +00003663 *(yyvsp[-1].String) += *(yyvsp[0].Value).val;
3664 (yyvsp[0].Value).destroy();
Reid Spencerf5626a32007-01-01 01:20:41 +00003665 deleteUselessCastFlag = false;
Reid Spencere77e35e2006-12-01 20:26:20 +00003666 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003667 ;}
3668 break;
3669
Reid Spencer71d2ec92006-12-31 06:02:26 +00003670 case 266:
Reid Spencer52402b02007-01-02 05:45:11 +00003671#line 1276 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003672 { // Used for PHI nodes
Reid Spencer52402b02007-01-02 05:45:11 +00003673 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-5].Type));
3674 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
3675 Name += "," + *(yyvsp[-1].Value).val + "]";
3676 (yyval.Value).val = new std::string(Name);
3677 (yyval.Value).type = (yyvsp[-5].Type);
3678 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003679 ;}
3680 break;
3681
Reid Spencer71d2ec92006-12-31 06:02:26 +00003682 case 267:
Reid Spencer52402b02007-01-02 05:45:11 +00003683#line 1284 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003684 {
Reid Spencer52402b02007-01-02 05:45:11 +00003685 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-6].Value).type);
3686 *(yyvsp[-6].Value).val += ", [" + Name + "," + *(yyvsp[-1].Value).val + "]";
Reid Spencerf459d392006-12-02 16:19:52 +00003687 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
Reid Spencer52402b02007-01-02 05:45:11 +00003688 (yyval.Value) = (yyvsp[-6].Value);
Reid Spencere7c3c602006-11-30 06:36:44 +00003689 ;}
3690 break;
3691
Reid Spencer71d2ec92006-12-31 06:02:26 +00003692 case 268:
Reid Spencer52402b02007-01-02 05:45:11 +00003693#line 1293 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3694 {
Reid Spencerf8483652006-12-02 15:16:01 +00003695 (yyval.ValList) = new ValueList();
3696 (yyval.ValList)->push_back((yyvsp[0].Value));
Reid Spencere7c3c602006-11-30 06:36:44 +00003697 ;}
3698 break;
3699
Reid Spencer71d2ec92006-12-31 06:02:26 +00003700 case 269:
Reid Spencer52402b02007-01-02 05:45:11 +00003701#line 1297 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003702 {
Reid Spencerf8483652006-12-02 15:16:01 +00003703 (yyval.ValList) = (yyvsp[-2].ValList);
Reid Spencer52402b02007-01-02 05:45:11 +00003704 (yyval.ValList)->push_back((yyvsp[0].Value));
Reid Spencerf8483652006-12-02 15:16:01 +00003705 ;}
3706 break;
3707
Reid Spencer71d2ec92006-12-31 06:02:26 +00003708 case 270:
Reid Spencer52402b02007-01-02 05:45:11 +00003709#line 1304 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003710 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3711 break;
3712
Reid Spencer71d2ec92006-12-31 06:02:26 +00003713 case 271:
Reid Spencer52402b02007-01-02 05:45:11 +00003714#line 1305 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003715 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00003716 break;
3717
Reid Spencer71d2ec92006-12-31 06:02:26 +00003718 case 272:
Reid Spencer52402b02007-01-02 05:45:11 +00003719#line 1309 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003720 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003721 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3722 delete (yyvsp[0].String);
3723 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003724 ;}
3725 break;
3726
Reid Spencer71d2ec92006-12-31 06:02:26 +00003727 case 274:
Reid Spencer52402b02007-01-02 05:45:11 +00003728#line 1317 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer78720742006-12-02 20:21:22 +00003729 {
3730 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
Reid Spencer52402b02007-01-02 05:45:11 +00003731 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
3732 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
3733 (yyval.Value).val = new std::string(op);
3734 *(yyval.Value).val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
3735 (yyval.Value).type = (yyvsp[-3].Type);
3736 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencer78720742006-12-02 20:21:22 +00003737 ;}
3738 break;
3739
Reid Spencer71d2ec92006-12-31 06:02:26 +00003740 case 275:
Reid Spencer52402b02007-01-02 05:45:11 +00003741#line 1326 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003742 {
Reid Spencer52402b02007-01-02 05:45:11 +00003743 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
3744 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
3745 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
3746 (yyval.Value).val = (yyvsp[-4].String);
3747 (yyval.Value).type = (yyvsp[-3].Type);
3748 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003749 ;}
3750 break;
3751
Reid Spencer71d2ec92006-12-31 06:02:26 +00003752 case 276:
Reid Spencer52402b02007-01-02 05:45:11 +00003753#line 1334 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003754 {
Reid Spencer52402b02007-01-02 05:45:11 +00003755 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
3756 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
Reid Spencer229e9362006-12-02 22:14:11 +00003757 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
Reid Spencer52402b02007-01-02 05:45:11 +00003758 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
3759 (yyval.Value).val = (yyvsp[-4].String);
3760 (yyval.Value).type = new TypeInfo("bool",BoolTy);
3761 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003762 ;}
3763 break;
3764
Reid Spencer71d2ec92006-12-31 06:02:26 +00003765 case 277:
Reid Spencer52402b02007-01-02 05:45:11 +00003766#line 1343 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003767 {
Reid Spencer52402b02007-01-02 05:45:11 +00003768 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
3769 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
3770 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
3771 (yyval.Value).val = (yyvsp[-5].String);
3772 (yyval.Value).type = new TypeInfo("bool",BoolTy);
Reid Spencer71d2ec92006-12-31 06:02:26 +00003773 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencer71d2ec92006-12-31 06:02:26 +00003774 ;}
3775 break;
3776
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003777 case 278:
Reid Spencer52402b02007-01-02 05:45:11 +00003778#line 1351 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer229e9362006-12-02 22:14:11 +00003779 {
Reid Spencer52402b02007-01-02 05:45:11 +00003780 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
3781 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
3782 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
3783 (yyval.Value).val = (yyvsp[-5].String);
3784 (yyval.Value).type = new TypeInfo("bool",BoolTy);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003785 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencer229e9362006-12-02 22:14:11 +00003786 ;}
3787 break;
3788
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003789 case 279:
Reid Spencer52402b02007-01-02 05:45:11 +00003790#line 1359 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003791 {
Reid Spencer52402b02007-01-02 05:45:11 +00003792 (yyval.Value) = (yyvsp[0].Value);
3793 (yyval.Value).val->insert(0, *(yyvsp[-1].String) + " ");
3794 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003795 ;}
3796 break;
3797
Reid Spencer71d2ec92006-12-31 06:02:26 +00003798 case 280:
Reid Spencer52402b02007-01-02 05:45:11 +00003799#line 1364 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003800 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003801 const char* shiftop = (yyvsp[-3].String)->c_str();
3802 if (*(yyvsp[-3].String) == "shr")
Reid Spencer52402b02007-01-02 05:45:11 +00003803 shiftop = ((yyvsp[-2].Value).type->isUnsigned()) ? "lshr" : "ashr";
3804 (yyval.Value).val = new std::string(shiftop);
3805 *(yyval.Value).val += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3806 (yyval.Value).type = (yyvsp[-2].Value).type;
3807 delete (yyvsp[-3].String); delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003808 ;}
3809 break;
3810
Reid Spencer71d2ec92006-12-31 06:02:26 +00003811 case 281:
Reid Spencer52402b02007-01-02 05:45:11 +00003812#line 1373 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003813 {
Reid Spencer280d8012006-12-01 23:40:53 +00003814 std::string source = *(yyvsp[-2].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003815 TypeInfo* SrcTy = (yyvsp[-2].Value).type;
3816 TypeInfo* DstTy = ResolveType((yyvsp[0].Type));
3817 (yyval.Value).val = new std::string();
Reid Spencer280d8012006-12-01 23:40:53 +00003818 if (*(yyvsp[-3].String) == "cast") {
Reid Spencer52402b02007-01-02 05:45:11 +00003819 *(yyval.Value).val += getCastUpgrade(source, SrcTy, DstTy, false);
Reid Spencera50d5962006-12-02 04:11:07 +00003820 } else {
Reid Spencer52402b02007-01-02 05:45:11 +00003821 *(yyval.Value).val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
Reid Spencer280d8012006-12-01 23:40:53 +00003822 }
Reid Spencer52402b02007-01-02 05:45:11 +00003823 (yyval.Value).type = (yyvsp[0].Type);
Reid Spencerf5626a32007-01-01 01:20:41 +00003824 // Check to see if this is a useless cast of a value to the same name
3825 // and the same type. Such casts will probably cause redefinition errors
3826 // when assembled and perform no code gen action so just remove them.
3827 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
Reid Spencer52402b02007-01-02 05:45:11 +00003828 if ((yyvsp[-2].Value).type->isInteger() && DstTy->isInteger() &&
3829 (yyvsp[-2].Value).type->getBitWidth() == DstTy->getBitWidth()) {
Reid Spencerf5626a32007-01-01 01:20:41 +00003830 deleteUselessCastFlag = true; // Flag the "Inst" rule
3831 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
3832 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
3833 if (pos != std::string::npos) {
3834 // remove the type portion before val
3835 deleteUselessCastName->erase(0, pos);
3836 }
3837 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003838 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
Reid Spencer52402b02007-01-02 05:45:11 +00003839 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003840 ;}
3841 break;
3842
Reid Spencer71d2ec92006-12-31 06:02:26 +00003843 case 282:
Reid Spencer52402b02007-01-02 05:45:11 +00003844#line 1401 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003845 {
Reid Spencer57f28f92006-12-03 07:10:26 +00003846 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003847 (yyval.Value).val = (yyvsp[-5].String);
3848 (yyval.Value).type = (yyvsp[-2].Value).type;
3849 (yyvsp[-4].Value).destroy(); delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
Reid Spencer57f28f92006-12-03 07:10:26 +00003850 ;}
3851 break;
3852
Reid Spencer71d2ec92006-12-31 06:02:26 +00003853 case 283:
Reid Spencer52402b02007-01-02 05:45:11 +00003854#line 1407 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003855 {
Reid Spencer52402b02007-01-02 05:45:11 +00003856 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + (yyvsp[0].Type)->getNewTy();
3857 (yyval.Value).val = (yyvsp[-3].String);
3858 (yyval.Value).type = (yyvsp[0].Type);
3859 (yyvsp[-2].Value).destroy();
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003860 ;}
3861 break;
3862
Reid Spencer71d2ec92006-12-31 06:02:26 +00003863 case 284:
Reid Spencer52402b02007-01-02 05:45:11 +00003864#line 1413 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003865 {
3866 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003867 (yyval.Value).val = (yyvsp[-3].String);
3868 ResolveType((yyvsp[-2].Value).type);
3869 (yyval.Value).type = (yyvsp[-2].Value).type->getElementType()->clone();
3870 delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003871 ;}
3872 break;
3873
Reid Spencer71d2ec92006-12-31 06:02:26 +00003874 case 285:
Reid Spencer52402b02007-01-02 05:45:11 +00003875#line 1420 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003876 {
3877 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003878 (yyval.Value).val = (yyvsp[-5].String);
3879 (yyval.Value).type = (yyvsp[-4].Value).type;
3880 delete (yyvsp[-4].Value).val; (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencer71d2ec92006-12-31 06:02:26 +00003881 ;}
3882 break;
3883
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003884 case 286:
Reid Spencer52402b02007-01-02 05:45:11 +00003885#line 1426 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00003886 {
3887 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003888 (yyval.Value).val = (yyvsp[-5].String);
3889 (yyval.Value).type = (yyvsp[-4].Value).type;
3890 delete (yyvsp[-4].Value).val; (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencer57f28f92006-12-03 07:10:26 +00003891 ;}
3892 break;
3893
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003894 case 287:
Reid Spencer52402b02007-01-02 05:45:11 +00003895#line 1432 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer57f28f92006-12-03 07:10:26 +00003896 {
Reid Spencer52402b02007-01-02 05:45:11 +00003897 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3898 (yyval.Value).val = (yyvsp[-1].String);
3899 (yyval.Value).type = (yyvsp[0].Value).type;
3900 delete (yyvsp[0].Value).val;
Reid Spencere7c3c602006-11-30 06:36:44 +00003901 ;}
3902 break;
3903
Reid Spencer71d2ec92006-12-31 06:02:26 +00003904 case 288:
Reid Spencer52402b02007-01-02 05:45:11 +00003905#line 1438 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003906 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003907 if (!(yyvsp[-5].String)->empty())
3908 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3909 if (!(yyvsp[-6].String)->empty())
3910 *(yyvsp[-6].String) += " ";
Reid Spencer52402b02007-01-02 05:45:11 +00003911 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value).val + "(";
Reid Spencerf8483652006-12-02 15:16:01 +00003912 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3913 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3914 *(yyvsp[-6].String) += *VI.val;
3915 if (i+1 < (yyvsp[-1].ValList)->size())
3916 *(yyvsp[-6].String) += ", ";
3917 VI.destroy();
3918 }
3919 *(yyvsp[-6].String) += ")";
Reid Spencer52402b02007-01-02 05:45:11 +00003920 (yyval.Value).val = (yyvsp[-6].String);
3921 (yyval.Value).type = getFunctionReturnType((yyvsp[-4].Type));
3922 delete (yyvsp[-5].String); delete (yyvsp[-4].Type); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00003923 ;}
3924 break;
3925
Reid Spencer71d2ec92006-12-31 06:02:26 +00003926 case 290:
Reid Spencer52402b02007-01-02 05:45:11 +00003927#line 1461 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003928 { (yyval.ValList) = (yyvsp[0].ValList); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003929 break;
3930
Reid Spencer71d2ec92006-12-31 06:02:26 +00003931 case 291:
Reid Spencer52402b02007-01-02 05:45:11 +00003932#line 1462 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003933 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003934 break;
3935
Reid Spencer71d2ec92006-12-31 06:02:26 +00003936 case 293:
Reid Spencer52402b02007-01-02 05:45:11 +00003937#line 1467 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003938 { (yyval.String) = new std::string(); ;}
3939 break;
3940
Reid Spencer71d2ec92006-12-31 06:02:26 +00003941 case 294:
Reid Spencer52402b02007-01-02 05:45:11 +00003942#line 1470 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003943 {
Reid Spencer52402b02007-01-02 05:45:11 +00003944 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
Reid Spencerf7bde222006-12-01 22:26:37 +00003945 if (!(yyvsp[0].String)->empty())
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003946 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
Reid Spencer52402b02007-01-02 05:45:11 +00003947 (yyval.Value).val = (yyvsp[-2].String);
3948 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
3949 delete (yyvsp[-1].Type); delete (yyvsp[0].String);
Reid Spencerf7bde222006-12-01 22:26:37 +00003950 ;}
3951 break;
3952
Reid Spencer71d2ec92006-12-31 06:02:26 +00003953 case 295:
Reid Spencer52402b02007-01-02 05:45:11 +00003954#line 1478 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer71d2ec92006-12-31 06:02:26 +00003955 {
Reid Spencer52402b02007-01-02 05:45:11 +00003956 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
3957 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
Reid Spencer71d2ec92006-12-31 06:02:26 +00003958 if (!(yyvsp[0].String)->empty())
3959 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencer52402b02007-01-02 05:45:11 +00003960 (yyval.Value).val = (yyvsp[-5].String);
3961 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
3962 delete (yyvsp[-4].Type); delete (yyvsp[-2].Type); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencer71d2ec92006-12-31 06:02:26 +00003963 ;}
3964 break;
3965
Reid Spencer57f28f92006-12-03 07:10:26 +00003966 case 296:
Reid Spencer52402b02007-01-02 05:45:11 +00003967#line 1487 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003968 {
Reid Spencer52402b02007-01-02 05:45:11 +00003969 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003970 if (!(yyvsp[0].String)->empty())
3971 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
Reid Spencer52402b02007-01-02 05:45:11 +00003972 (yyval.Value).val = (yyvsp[-2].String);
3973 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
3974 delete (yyvsp[-1].Type); delete (yyvsp[0].String);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003975 ;}
3976 break;
3977
Reid Spencer71d2ec92006-12-31 06:02:26 +00003978 case 297:
Reid Spencer52402b02007-01-02 05:45:11 +00003979#line 1495 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003980 {
Reid Spencer52402b02007-01-02 05:45:11 +00003981 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
3982 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003983 if (!(yyvsp[0].String)->empty())
3984 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencer52402b02007-01-02 05:45:11 +00003985 (yyval.Value).val = (yyvsp[-5].String);
3986 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
3987 delete (yyvsp[-4].Type); delete (yyvsp[-2].Type); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencer6fd36ab2006-12-29 20:35:03 +00003988 ;}
3989 break;
3990
Reid Spencer71d2ec92006-12-31 06:02:26 +00003991 case 298:
Reid Spencer52402b02007-01-02 05:45:11 +00003992#line 1504 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003993 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003994 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
Reid Spencer52402b02007-01-02 05:45:11 +00003995 (yyval.Value).val = (yyvsp[-1].String);
3996 (yyval.Value).type = new TypeInfo("void", VoidTy);
Reid Spencere77e35e2006-12-01 20:26:20 +00003997 (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003998 ;}
3999 break;
4000
Reid Spencer71d2ec92006-12-31 06:02:26 +00004001 case 299:
Reid Spencer52402b02007-01-02 05:45:11 +00004002#line 1510 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004003 {
Reid Spencer52402b02007-01-02 05:45:11 +00004004 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
Reid Spencere77e35e2006-12-01 20:26:20 +00004005 if (!(yyvsp[-3].String)->empty())
4006 *(yyvsp[-3].String) += " ";
Reid Spencer52402b02007-01-02 05:45:11 +00004007 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4008 (yyval.Value).val = (yyvsp[-3].String);
4009 (yyval.Value).type = (yyvsp[-1].Type)->getElementType()->clone();
4010 delete (yyvsp[-2].String); delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00004011 ;}
4012 break;
4013
Reid Spencer71d2ec92006-12-31 06:02:26 +00004014 case 300:
Reid Spencer52402b02007-01-02 05:45:11 +00004015#line 1519 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004016 {
Reid Spencer52402b02007-01-02 05:45:11 +00004017 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
Reid Spencere77e35e2006-12-01 20:26:20 +00004018 if (!(yyvsp[-5].String)->empty())
4019 *(yyvsp[-5].String) += " ";
Reid Spencer52402b02007-01-02 05:45:11 +00004020 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4021 (yyval.Value).val = (yyvsp[-5].String);
4022 (yyval.Value).type = new TypeInfo("void", VoidTy);
4023 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].Type); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00004024 ;}
4025 break;
4026
Reid Spencer71d2ec92006-12-31 06:02:26 +00004027 case 301:
Reid Spencer52402b02007-01-02 05:45:11 +00004028#line 1528 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004029 {
Reid Spencer52402b02007-01-02 05:45:11 +00004030 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
Reid Spencerf459d392006-12-02 16:19:52 +00004031 // Upgrade the indices
4032 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4033 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
Reid Spencer52402b02007-01-02 05:45:11 +00004034 if (VI.type->isUnsigned() && !VI.isConstant() &&
4035 VI.type->getBitWidth() < 64) {
Reid Spencerf459d392006-12-02 16:19:52 +00004036 std::string* old = VI.val;
4037 *O << " %gep_upgrade" << unique << " = zext " << *old
Reid Spencer71d2ec92006-12-31 06:02:26 +00004038 << " to i64\n";
4039 VI.val = new std::string("i64 %gep_upgrade" + llvm::utostr(unique++));
Reid Spencer52402b02007-01-02 05:45:11 +00004040 VI.type->setOldTy(ULongTy);
Reid Spencerf459d392006-12-02 16:19:52 +00004041 }
4042 }
Reid Spencer52402b02007-01-02 05:45:11 +00004043 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
Reid Spencerf8483652006-12-02 15:16:01 +00004044 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4045 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4046 *(yyvsp[-3].String) += ", " + *VI.val;
Reid Spencerf8483652006-12-02 15:16:01 +00004047 }
Reid Spencer52402b02007-01-02 05:45:11 +00004048 (yyval.Value).val = (yyvsp[-3].String);
4049 (yyval.Value).type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4050 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00004051 ;}
4052 break;
4053
4054
4055 default: break;
4056 }
4057
4058/* Line 1126 of yacc.c. */
Reid Spencer52402b02007-01-02 05:45:11 +00004059#line 4060 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00004060
4061 yyvsp -= yylen;
4062 yyssp -= yylen;
4063
4064
4065 YY_STACK_PRINT (yyss, yyssp);
4066
4067 *++yyvsp = yyval;
4068
4069
4070 /* Now `shift' the result of the reduction. Determine what state
4071 that goes to, based on the state we popped back to and the rule
4072 number reduced by. */
4073
4074 yyn = yyr1[yyn];
4075
4076 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4077 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4078 yystate = yytable[yystate];
4079 else
4080 yystate = yydefgoto[yyn - YYNTOKENS];
4081
4082 goto yynewstate;
4083
4084
4085/*------------------------------------.
4086| yyerrlab -- here on detecting error |
4087`------------------------------------*/
4088yyerrlab:
4089 /* If not already recovering from an error, report this error. */
4090 if (!yyerrstatus)
4091 {
4092 ++yynerrs;
4093#if YYERROR_VERBOSE
4094 yyn = yypact[yystate];
4095
4096 if (YYPACT_NINF < yyn && yyn < YYLAST)
4097 {
4098 int yytype = YYTRANSLATE (yychar);
4099 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4100 YYSIZE_T yysize = yysize0;
4101 YYSIZE_T yysize1;
4102 int yysize_overflow = 0;
4103 char *yymsg = 0;
4104# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4105 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4106 int yyx;
4107
4108#if 0
4109 /* This is so xgettext sees the translatable formats that are
4110 constructed on the fly. */
4111 YY_("syntax error, unexpected %s");
4112 YY_("syntax error, unexpected %s, expecting %s");
4113 YY_("syntax error, unexpected %s, expecting %s or %s");
4114 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4115 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4116#endif
4117 char *yyfmt;
4118 char const *yyf;
4119 static char const yyunexpected[] = "syntax error, unexpected %s";
4120 static char const yyexpecting[] = ", expecting %s";
4121 static char const yyor[] = " or %s";
4122 char yyformat[sizeof yyunexpected
4123 + sizeof yyexpecting - 1
4124 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4125 * (sizeof yyor - 1))];
4126 char const *yyprefix = yyexpecting;
4127
4128 /* Start YYX at -YYN if negative to avoid negative indexes in
4129 YYCHECK. */
4130 int yyxbegin = yyn < 0 ? -yyn : 0;
4131
4132 /* Stay within bounds of both yycheck and yytname. */
4133 int yychecklim = YYLAST - yyn;
4134 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4135 int yycount = 1;
4136
4137 yyarg[0] = yytname[yytype];
4138 yyfmt = yystpcpy (yyformat, yyunexpected);
4139
4140 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4141 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4142 {
4143 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4144 {
4145 yycount = 1;
4146 yysize = yysize0;
4147 yyformat[sizeof yyunexpected - 1] = '\0';
4148 break;
4149 }
4150 yyarg[yycount++] = yytname[yyx];
4151 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4152 yysize_overflow |= yysize1 < yysize;
4153 yysize = yysize1;
4154 yyfmt = yystpcpy (yyfmt, yyprefix);
4155 yyprefix = yyor;
4156 }
4157
4158 yyf = YY_(yyformat);
4159 yysize1 = yysize + yystrlen (yyf);
4160 yysize_overflow |= yysize1 < yysize;
4161 yysize = yysize1;
4162
4163 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4164 yymsg = (char *) YYSTACK_ALLOC (yysize);
4165 if (yymsg)
4166 {
4167 /* Avoid sprintf, as that infringes on the user's name space.
4168 Don't have undefined behavior even if the translation
4169 produced a string with the wrong number of "%s"s. */
4170 char *yyp = yymsg;
4171 int yyi = 0;
4172 while ((*yyp = *yyf))
4173 {
4174 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4175 {
4176 yyp += yytnamerr (yyp, yyarg[yyi++]);
4177 yyf += 2;
4178 }
4179 else
4180 {
4181 yyp++;
4182 yyf++;
4183 }
4184 }
4185 yyerror (yymsg);
4186 YYSTACK_FREE (yymsg);
4187 }
4188 else
4189 {
4190 yyerror (YY_("syntax error"));
4191 goto yyexhaustedlab;
4192 }
4193 }
4194 else
4195#endif /* YYERROR_VERBOSE */
4196 yyerror (YY_("syntax error"));
4197 }
4198
4199
4200
4201 if (yyerrstatus == 3)
4202 {
4203 /* If just tried and failed to reuse look-ahead token after an
4204 error, discard it. */
4205
4206 if (yychar <= YYEOF)
4207 {
4208 /* Return failure if at end of input. */
4209 if (yychar == YYEOF)
4210 YYABORT;
4211 }
4212 else
4213 {
4214 yydestruct ("Error: discarding", yytoken, &yylval);
4215 yychar = YYEMPTY;
4216 }
4217 }
4218
4219 /* Else will try to reuse look-ahead token after shifting the error
4220 token. */
4221 goto yyerrlab1;
4222
4223
4224/*---------------------------------------------------.
4225| yyerrorlab -- error raised explicitly by YYERROR. |
4226`---------------------------------------------------*/
4227yyerrorlab:
4228
4229 /* Pacify compilers like GCC when the user code never invokes
4230 YYERROR and the label yyerrorlab therefore never appears in user
4231 code. */
4232 if (0)
4233 goto yyerrorlab;
4234
4235yyvsp -= yylen;
4236 yyssp -= yylen;
4237 yystate = *yyssp;
4238 goto yyerrlab1;
4239
4240
4241/*-------------------------------------------------------------.
4242| yyerrlab1 -- common code for both syntax error and YYERROR. |
4243`-------------------------------------------------------------*/
4244yyerrlab1:
4245 yyerrstatus = 3; /* Each real token shifted decrements this. */
4246
4247 for (;;)
4248 {
4249 yyn = yypact[yystate];
4250 if (yyn != YYPACT_NINF)
4251 {
4252 yyn += YYTERROR;
4253 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4254 {
4255 yyn = yytable[yyn];
4256 if (0 < yyn)
4257 break;
4258 }
4259 }
4260
4261 /* Pop the current state because it cannot handle the error token. */
4262 if (yyssp == yyss)
4263 YYABORT;
4264
4265
4266 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4267 YYPOPSTACK;
4268 yystate = *yyssp;
4269 YY_STACK_PRINT (yyss, yyssp);
4270 }
4271
4272 if (yyn == YYFINAL)
4273 YYACCEPT;
4274
4275 *++yyvsp = yylval;
4276
4277
4278 /* Shift the error token. */
4279 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4280
4281 yystate = yyn;
4282 goto yynewstate;
4283
4284
4285/*-------------------------------------.
4286| yyacceptlab -- YYACCEPT comes here. |
4287`-------------------------------------*/
4288yyacceptlab:
4289 yyresult = 0;
4290 goto yyreturn;
4291
4292/*-----------------------------------.
4293| yyabortlab -- YYABORT comes here. |
4294`-----------------------------------*/
4295yyabortlab:
4296 yyresult = 1;
4297 goto yyreturn;
4298
4299#ifndef yyoverflow
4300/*-------------------------------------------------.
4301| yyexhaustedlab -- memory exhaustion comes here. |
4302`-------------------------------------------------*/
4303yyexhaustedlab:
4304 yyerror (YY_("memory exhausted"));
4305 yyresult = 2;
4306 /* Fall through. */
4307#endif
4308
4309yyreturn:
4310 if (yychar != YYEOF && yychar != YYEMPTY)
4311 yydestruct ("Cleanup: discarding lookahead",
4312 yytoken, &yylval);
4313 while (yyssp != yyss)
4314 {
4315 yydestruct ("Cleanup: popping",
4316 yystos[*yyssp], yyvsp);
4317 YYPOPSTACK;
4318 }
4319#ifndef yyoverflow
4320 if (yyss != yyssa)
4321 YYSTACK_FREE (yyss);
4322#endif
4323 return yyresult;
4324}
4325
4326
Reid Spencer52402b02007-01-02 05:45:11 +00004327#line 1552 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00004328
4329
4330int yyerror(const char *ErrorMsg) {
4331 std::string where
4332 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4333 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4334 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
4335 if (yychar == YYEMPTY || yychar == 0)
4336 errMsg += "end-of-file.";
4337 else
4338 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
Reid Spencer71d2ec92006-12-31 06:02:26 +00004339 std::cerr << "llvm-upgrade: " << errMsg << '\n';
Reid Spencere7c3c602006-11-30 06:36:44 +00004340 exit(1);
4341}
4342