blob: 2e776cf434dd5969804ecb8825385357c024e7f9 [file] [log] [blame]
Reid Spencere7c3c602006-11-30 06:36:44 +00001/* A Bison parser, made by GNU Bison 2.1. */
2
3/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Bison version. */
40#define YYBISON_VERSION "2.1"
41
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
44
45/* Pure parsers. */
46#define YYPURE 0
47
48/* Using locations. */
49#define YYLSP_NEEDED 0
50
51/* Substitute the variable and function names. */
52#define yyparse Upgradeparse
53#define yylex Upgradelex
54#define yyerror Upgradeerror
55#define yylval Upgradelval
56#define yychar Upgradechar
57#define yydebug Upgradedebug
58#define yynerrs Upgradenerrs
59
60
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
Reid Spencerf2d55322006-12-01 21:52:30 +000067 VOID = 258,
68 BOOL = 259,
69 SBYTE = 260,
70 UBYTE = 261,
71 SHORT = 262,
72 USHORT = 263,
73 INT = 264,
74 UINT = 265,
75 LONG = 266,
76 ULONG = 267,
77 FLOAT = 268,
78 DOUBLE = 269,
79 LABEL = 270,
80 OPAQUE = 271,
81 ESINT64VAL = 272,
82 EUINT64VAL = 273,
83 SINTVAL = 274,
84 UINTVAL = 275,
85 FPVAL = 276,
86 NULL_TOK = 277,
87 UNDEF = 278,
88 ZEROINITIALIZER = 279,
89 TRUETOK = 280,
90 FALSETOK = 281,
Reid Spencere77e35e2006-12-01 20:26:20 +000091 TYPE = 282,
92 VAR_ID = 283,
93 LABELSTR = 284,
94 STRINGCONSTANT = 285,
95 IMPLEMENTATION = 286,
96 BEGINTOK = 287,
97 ENDTOK = 288,
98 DECLARE = 289,
99 GLOBAL = 290,
100 CONSTANT = 291,
101 SECTION = 292,
102 VOLATILE = 293,
103 TO = 294,
104 DOTDOTDOT = 295,
105 CONST = 296,
106 INTERNAL = 297,
107 LINKONCE = 298,
108 WEAK = 299,
Reid Spencere7c3c602006-11-30 06:36:44 +0000109 DLLIMPORT = 300,
110 DLLEXPORT = 301,
111 EXTERN_WEAK = 302,
Reid Spencere77e35e2006-12-01 20:26:20 +0000112 APPENDING = 303,
Reid Spencere7c3c602006-11-30 06:36:44 +0000113 NOT = 304,
114 EXTERNAL = 305,
115 TARGET = 306,
116 TRIPLE = 307,
117 ENDIAN = 308,
118 POINTERSIZE = 309,
119 LITTLE = 310,
120 BIG = 311,
121 ALIGN = 312,
122 DEPLIBS = 313,
123 CALL = 314,
124 TAIL = 315,
125 ASM_TOK = 316,
126 MODULE = 317,
127 SIDEEFFECT = 318,
128 CC_TOK = 319,
129 CCC_TOK = 320,
130 CSRETCC_TOK = 321,
131 FASTCC_TOK = 322,
132 COLDCC_TOK = 323,
133 X86_STDCALLCC_TOK = 324,
134 X86_FASTCALLCC_TOK = 325,
135 DATALAYOUT = 326,
136 RET = 327,
137 BR = 328,
138 SWITCH = 329,
139 INVOKE = 330,
140 UNWIND = 331,
141 UNREACHABLE = 332,
142 ADD = 333,
143 SUB = 334,
144 MUL = 335,
145 UDIV = 336,
146 SDIV = 337,
147 FDIV = 338,
148 UREM = 339,
149 SREM = 340,
150 FREM = 341,
151 AND = 342,
152 OR = 343,
153 XOR = 344,
154 SETLE = 345,
155 SETGE = 346,
156 SETLT = 347,
157 SETGT = 348,
158 SETEQ = 349,
159 SETNE = 350,
160 MALLOC = 351,
161 ALLOCA = 352,
162 FREE = 353,
163 LOAD = 354,
164 STORE = 355,
165 GETELEMENTPTR = 356,
Reid Spencere77e35e2006-12-01 20:26:20 +0000166 PHI_TOK = 357,
167 SELECT = 358,
168 SHL = 359,
Reid Spencerf7bde222006-12-01 22:26:37 +0000169 SHR = 360,
Reid Spencere77e35e2006-12-01 20:26:20 +0000170 ASHR = 361,
Reid Spencerf7bde222006-12-01 22:26:37 +0000171 LSHR = 362,
172 VAARG = 363,
173 EXTRACTELEMENT = 364,
174 INSERTELEMENT = 365,
175 SHUFFLEVECTOR = 366,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000176 CAST = 367,
177 TRUNC = 368,
178 ZEXT = 369,
179 SEXT = 370,
180 FPTRUNC = 371,
181 FPEXT = 372,
182 FPTOUI = 373,
183 FPTOSI = 374,
184 UITOFP = 375,
185 SITOFP = 376,
186 PTRTOINT = 377,
187 INTTOPTR = 378,
188 BITCAST = 379
Reid Spencere7c3c602006-11-30 06:36:44 +0000189 };
190#endif
191/* Tokens. */
Reid Spencerf2d55322006-12-01 21:52:30 +0000192#define VOID 258
193#define BOOL 259
194#define SBYTE 260
195#define UBYTE 261
196#define SHORT 262
197#define USHORT 263
198#define INT 264
199#define UINT 265
200#define LONG 266
201#define ULONG 267
202#define FLOAT 268
203#define DOUBLE 269
204#define LABEL 270
205#define OPAQUE 271
206#define ESINT64VAL 272
207#define EUINT64VAL 273
208#define SINTVAL 274
209#define UINTVAL 275
210#define FPVAL 276
211#define NULL_TOK 277
212#define UNDEF 278
213#define ZEROINITIALIZER 279
214#define TRUETOK 280
215#define FALSETOK 281
Reid Spencere77e35e2006-12-01 20:26:20 +0000216#define TYPE 282
217#define VAR_ID 283
218#define LABELSTR 284
219#define STRINGCONSTANT 285
220#define IMPLEMENTATION 286
221#define BEGINTOK 287
222#define ENDTOK 288
223#define DECLARE 289
224#define GLOBAL 290
225#define CONSTANT 291
226#define SECTION 292
227#define VOLATILE 293
228#define TO 294
229#define DOTDOTDOT 295
230#define CONST 296
231#define INTERNAL 297
232#define LINKONCE 298
233#define WEAK 299
Reid Spencere7c3c602006-11-30 06:36:44 +0000234#define DLLIMPORT 300
235#define DLLEXPORT 301
236#define EXTERN_WEAK 302
Reid Spencere77e35e2006-12-01 20:26:20 +0000237#define APPENDING 303
Reid Spencere7c3c602006-11-30 06:36:44 +0000238#define NOT 304
239#define EXTERNAL 305
240#define TARGET 306
241#define TRIPLE 307
242#define ENDIAN 308
243#define POINTERSIZE 309
244#define LITTLE 310
245#define BIG 311
246#define ALIGN 312
247#define DEPLIBS 313
248#define CALL 314
249#define TAIL 315
250#define ASM_TOK 316
251#define MODULE 317
252#define SIDEEFFECT 318
253#define CC_TOK 319
254#define CCC_TOK 320
255#define CSRETCC_TOK 321
256#define FASTCC_TOK 322
257#define COLDCC_TOK 323
258#define X86_STDCALLCC_TOK 324
259#define X86_FASTCALLCC_TOK 325
260#define DATALAYOUT 326
261#define RET 327
262#define BR 328
263#define SWITCH 329
264#define INVOKE 330
265#define UNWIND 331
266#define UNREACHABLE 332
267#define ADD 333
268#define SUB 334
269#define MUL 335
270#define UDIV 336
271#define SDIV 337
272#define FDIV 338
273#define UREM 339
274#define SREM 340
275#define FREM 341
276#define AND 342
277#define OR 343
278#define XOR 344
279#define SETLE 345
280#define SETGE 346
281#define SETLT 347
282#define SETGT 348
283#define SETEQ 349
284#define SETNE 350
285#define MALLOC 351
286#define ALLOCA 352
287#define FREE 353
288#define LOAD 354
289#define STORE 355
290#define GETELEMENTPTR 356
Reid Spencere77e35e2006-12-01 20:26:20 +0000291#define PHI_TOK 357
292#define SELECT 358
293#define SHL 359
Reid Spencerf7bde222006-12-01 22:26:37 +0000294#define SHR 360
Reid Spencere77e35e2006-12-01 20:26:20 +0000295#define ASHR 361
Reid Spencerf7bde222006-12-01 22:26:37 +0000296#define LSHR 362
297#define VAARG 363
298#define EXTRACTELEMENT 364
299#define INSERTELEMENT 365
300#define SHUFFLEVECTOR 366
301#define CAST 367
Reid Spencerfcb5df82006-12-01 22:34:43 +0000302#define TRUNC 368
303#define ZEXT 369
304#define SEXT 370
305#define FPTRUNC 371
306#define FPEXT 372
307#define FPTOUI 373
308#define FPTOSI 374
309#define UITOFP 375
310#define SITOFP 376
311#define PTRTOINT 377
312#define INTTOPTR 378
313#define BITCAST 379
Reid Spencere7c3c602006-11-30 06:36:44 +0000314
315
316
317
318/* Copy the first part of user declarations. */
319#line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
320
Reid Spencere7c3c602006-11-30 06:36:44 +0000321#include "ParserInternals.h"
322#include <llvm/ADT/StringExtras.h>
Reid Spencere7c3c602006-11-30 06:36:44 +0000323#include <algorithm>
Reid Spencera50d5962006-12-02 04:11:07 +0000324#include <map>
Reid Spencere7c3c602006-11-30 06:36:44 +0000325#include <utility>
326#include <iostream>
327
Reid Spencere77e35e2006-12-01 20:26:20 +0000328#define YYERROR_VERBOSE 1
Reid Spencer96839be2006-11-30 16:50:26 +0000329#define YYINCLUDED_STDLIB_H
Reid Spencere77e35e2006-12-01 20:26:20 +0000330#define YYDEBUG 1
Reid Spencere7c3c602006-11-30 06:36:44 +0000331
332int yylex(); // declaration" of xxx warnings.
333int yyparse();
Reid Spencere77e35e2006-12-01 20:26:20 +0000334extern int yydebug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000335
336static std::string CurFilename;
Reid Spencere7c3c602006-11-30 06:36:44 +0000337static std::ostream *O = 0;
Reid Spencer96839be2006-11-30 16:50:26 +0000338std::istream* LexInput = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +0000339unsigned SizeOfPointer = 32;
Reid Spencerf459d392006-12-02 16:19:52 +0000340static uint64_t unique = 1;
Reid Spencer96839be2006-11-30 16:50:26 +0000341
Reid Spencera50d5962006-12-02 04:11:07 +0000342typedef std::vector<TypeInfo> TypeVector;
343static TypeVector EnumeratedTypes;
344typedef std::map<std::string,TypeInfo> TypeMap;
345static TypeMap NamedTypes;
346
Reid Spencerf8483652006-12-02 15:16:01 +0000347void destroy(ValueList* VL) {
348 while (!VL->empty()) {
349 ValueInfo& VI = VL->back();
350 VI.destroy();
351 VL->pop_back();
352 }
353 delete VL;
354}
355
Reid Spencer96839be2006-11-30 16:50:26 +0000356void UpgradeAssembly(const std::string &infile, std::istream& in,
Reid Spencere77e35e2006-12-01 20:26:20 +0000357 std::ostream &out, bool debug)
Reid Spencere7c3c602006-11-30 06:36:44 +0000358{
359 Upgradelineno = 1;
360 CurFilename = infile;
Reid Spencer96839be2006-11-30 16:50:26 +0000361 LexInput = &in;
Reid Spencere77e35e2006-12-01 20:26:20 +0000362 yydebug = debug;
Reid Spencere7c3c602006-11-30 06:36:44 +0000363 O = &out;
364
365 if (yyparse()) {
366 std::cerr << "Parse failed.\n";
367 exit(1);
368 }
369}
370
Reid Spencera50d5962006-12-02 04:11:07 +0000371static void ResolveType(TypeInfo& Ty) {
372 if (Ty.oldTy == UnresolvedTy) {
373 TypeMap::iterator I = NamedTypes.find(*Ty.newTy);
374 if (I != NamedTypes.end())
375 Ty.oldTy = I->second.oldTy;
Reid Spencer280d8012006-12-01 23:40:53 +0000376 else {
Reid Spencera50d5962006-12-02 04:11:07 +0000377 std::string msg("Can't resolve type: ");
378 msg += *Ty.newTy;
379 yyerror(msg.c_str());
Reid Spencer280d8012006-12-01 23:40:53 +0000380 }
Reid Spencera50d5962006-12-02 04:11:07 +0000381 } else if (Ty.oldTy == NumericTy) {
382 unsigned ref = atoi(&((Ty.newTy->c_str())[1])); // Skip the '\\'
383 if (ref < EnumeratedTypes.size()) {
384 Ty.oldTy = EnumeratedTypes[ref].oldTy;
385 } else {
386 std::string msg("Can't resolve type: ");
387 msg += *Ty.newTy;
388 yyerror(msg.c_str());
389 }
Reid Spencer280d8012006-12-01 23:40:53 +0000390 }
Reid Spencera50d5962006-12-02 04:11:07 +0000391 // otherwise its already resolved.
Reid Spencer280d8012006-12-01 23:40:53 +0000392}
393
Reid Spencera50d5962006-12-02 04:11:07 +0000394static const char* getCastOpcode(
395 std::string& Source, const TypeInfo& SrcTy, const TypeInfo& DstTy)
396{
Reid Spencere77e35e2006-12-01 20:26:20 +0000397 unsigned SrcBits = SrcTy.getBitWidth();
398 unsigned DstBits = DstTy.getBitWidth();
399 const char* opcode = "bitcast";
400 // Run through the possibilities ...
401 if (DstTy.isIntegral()) { // Casting to integral
402 if (SrcTy.isIntegral()) { // Casting from integral
403 if (DstBits < SrcBits)
404 opcode = "trunc";
405 else if (DstBits > SrcBits) { // its an extension
406 if (SrcTy.isSigned())
407 opcode ="sext"; // signed -> SEXT
408 else
409 opcode = "zext"; // unsigned -> ZEXT
410 } else {
411 opcode = "bitcast"; // Same size, No-op cast
412 }
413 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
414 if (DstTy.isSigned())
415 opcode = "fptosi"; // FP -> sint
416 else
417 opcode = "fptoui"; // FP -> uint
418 } else if (SrcTy.isPacked()) {
419 assert(DstBits == SrcTy.getBitWidth() &&
420 "Casting packed to integer of different width");
421 opcode = "bitcast"; // same size, no-op cast
422 } else {
423 assert(SrcTy.isPointer() &&
424 "Casting from a value that is not first-class type");
425 opcode = "ptrtoint"; // ptr -> int
426 }
427 } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
428 if (SrcTy.isIntegral()) { // Casting from integral
429 if (SrcTy.isSigned())
430 opcode = "sitofp"; // sint -> FP
431 else
432 opcode = "uitofp"; // uint -> FP
433 } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
434 if (DstBits < SrcBits) {
435 opcode = "fptrunc"; // FP -> smaller FP
436 } else if (DstBits > SrcBits) {
437 opcode = "fpext"; // FP -> larger FP
438 } else {
439 opcode ="bitcast"; // same size, no-op cast
440 }
441 } else if (SrcTy.isPacked()) {
442 assert(DstBits == SrcTy.getBitWidth() &&
443 "Casting packed to floating point of different width");
444 opcode = "bitcast"; // same size, no-op cast
445 } else {
446 assert(0 && "Casting pointer or non-first class to float");
447 }
448 } else if (DstTy.isPacked()) {
449 if (SrcTy.isPacked()) {
450 assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
451 "Casting packed to packed of different widths");
452 opcode = "bitcast"; // packed -> packed
453 } else if (DstTy.getBitWidth() == SrcBits) {
454 opcode = "bitcast"; // float/int -> packed
455 } else {
456 assert(!"Illegal cast to packed (wrong type or size)");
457 }
458 } else if (DstTy.isPointer()) {
459 if (SrcTy.isPointer()) {
460 opcode = "bitcast"; // ptr -> ptr
461 } else if (SrcTy.isIntegral()) {
462 opcode = "inttoptr"; // int -> ptr
463 } else {
Reid Spencera50d5962006-12-02 04:11:07 +0000464 assert(!"Casting invalid type to pointer");
Reid Spencere77e35e2006-12-01 20:26:20 +0000465 }
466 } else {
467 assert(!"Casting to type that is not first-class");
468 }
469 return opcode;
470}
471
Reid Spencera50d5962006-12-02 04:11:07 +0000472static std::string getCastUpgrade(
473 const std::string& Src, TypeInfo& SrcTy, TypeInfo& DstTy, bool isConst)
474{
475 std::string Result;
476 std::string Source = Src;
477 if (SrcTy.isFloatingPoint() && DstTy.isPointer()) {
478 // fp -> ptr cast is no longer supported but we must upgrade this
479 // by doing a double cast: fp -> int -> ptr
480 if (isConst)
481 Source = "ulong fptoui(" + Source + " to ulong)";
482 else {
Reid Spencerf459d392006-12-02 16:19:52 +0000483 *O << " %cast_upgrade" << unique << " = fptoui " << Source
484 << " to ulong\n";
485 Source = "ulong %cast_upgrade" + llvm::utostr(unique);
Reid Spencera50d5962006-12-02 04:11:07 +0000486 }
487 // Update the SrcTy for the getCastOpcode call below
488 SrcTy.destroy();
489 SrcTy.newTy = new std::string("ulong");
490 SrcTy.oldTy = ULongTy;
491 } else if (DstTy.oldTy == BoolTy) {
492 // cast ptr %x to bool was previously defined as setne ptr %x, null
493 // The ptrtoint semantic is to truncate, not compare so we must retain
494 // the original intent by replace the cast with a setne
495 const char* comparator = SrcTy.isPointer() ? ", null" :
496 (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0");
497 if (isConst)
498 Result = "setne (" + Source + comparator + ")";
499 else
500 Result = "setne " + Source + comparator;
501 return Result; // skip cast processing below
502 }
503 ResolveType(SrcTy);
504 ResolveType(DstTy);
505 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
506 if (isConst)
507 Result += Opcode + "( " + Source + " to " + *DstTy.newTy + ")";
508 else
509 Result += Opcode + " " + Source + " to " + *DstTy.newTy;
510 return Result;
511}
512
Reid Spencere7c3c602006-11-30 06:36:44 +0000513
514
515/* Enabling traces. */
516#ifndef YYDEBUG
517# define YYDEBUG 0
518#endif
519
520/* Enabling verbose error messages. */
521#ifdef YYERROR_VERBOSE
522# undef YYERROR_VERBOSE
523# define YYERROR_VERBOSE 1
524#else
525# define YYERROR_VERBOSE 0
526#endif
527
528/* Enabling the token table. */
529#ifndef YYTOKEN_TABLE
530# define YYTOKEN_TABLE 0
531#endif
532
533#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencerf459d392006-12-02 16:19:52 +0000534#line 211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +0000535typedef union YYSTYPE {
536 std::string* String;
537 TypeInfo Type;
538 ValueInfo Value;
539 ConstInfo Const;
Reid Spencerf8483652006-12-02 15:16:01 +0000540 ValueList* ValList;
Reid Spencere77e35e2006-12-01 20:26:20 +0000541} YYSTYPE;
542/* Line 196 of yacc.c. */
Reid Spencerf459d392006-12-02 16:19:52 +0000543#line 544 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000544# define yystype YYSTYPE /* obsolescent; will be withdrawn */
545# define YYSTYPE_IS_DECLARED 1
546# define YYSTYPE_IS_TRIVIAL 1
547#endif
548
549
550
551/* Copy the second part of user declarations. */
552
553
554/* Line 219 of yacc.c. */
Reid Spencerf459d392006-12-02 16:19:52 +0000555#line 556 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +0000556
557#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
558# define YYSIZE_T __SIZE_TYPE__
559#endif
560#if ! defined (YYSIZE_T) && defined (size_t)
561# define YYSIZE_T size_t
562#endif
563#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
564# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
565# define YYSIZE_T size_t
566#endif
567#if ! defined (YYSIZE_T)
568# define YYSIZE_T unsigned int
569#endif
570
571#ifndef YY_
572# if YYENABLE_NLS
573# if ENABLE_NLS
574# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
575# define YY_(msgid) dgettext ("bison-runtime", msgid)
576# endif
577# endif
578# ifndef YY_
579# define YY_(msgid) msgid
580# endif
581#endif
582
583#if ! defined (yyoverflow) || YYERROR_VERBOSE
584
585/* The parser invokes alloca or malloc; define the necessary symbols. */
586
587# ifdef YYSTACK_USE_ALLOCA
588# if YYSTACK_USE_ALLOCA
589# ifdef __GNUC__
590# define YYSTACK_ALLOC __builtin_alloca
591# else
592# define YYSTACK_ALLOC alloca
593# if defined (__STDC__) || defined (__cplusplus)
594# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
595# define YYINCLUDED_STDLIB_H
596# endif
597# endif
598# endif
599# endif
600
601# ifdef YYSTACK_ALLOC
602 /* Pacify GCC's `empty if-body' warning. */
603# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
604# ifndef YYSTACK_ALLOC_MAXIMUM
605 /* The OS might guarantee only one guard page at the bottom of the stack,
606 and a page size can be as small as 4096 bytes. So we cannot safely
607 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
608 to allow for a few compiler-allocated temporary stack slots. */
609# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
610# endif
611# else
612# define YYSTACK_ALLOC YYMALLOC
613# define YYSTACK_FREE YYFREE
614# ifndef YYSTACK_ALLOC_MAXIMUM
615# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
616# endif
617# ifdef __cplusplus
618extern "C" {
619# endif
620# ifndef YYMALLOC
621# define YYMALLOC malloc
622# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
623 && (defined (__STDC__) || defined (__cplusplus)))
624void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
625# endif
626# endif
627# ifndef YYFREE
628# define YYFREE free
629# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
630 && (defined (__STDC__) || defined (__cplusplus)))
631void free (void *); /* INFRINGES ON USER NAME SPACE */
632# endif
633# endif
634# ifdef __cplusplus
635}
636# endif
637# endif
638#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
639
640
641#if (! defined (yyoverflow) \
642 && (! defined (__cplusplus) \
643 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
644
645/* A type that is properly aligned for any stack member. */
646union yyalloc
647{
648 short int yyss;
649 YYSTYPE yyvs;
650 };
651
652/* The size of the maximum gap between one aligned stack and the next. */
653# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
654
655/* The size of an array large to enough to hold all stacks, each with
656 N elements. */
657# define YYSTACK_BYTES(N) \
658 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
659 + YYSTACK_GAP_MAXIMUM)
660
661/* Copy COUNT objects from FROM to TO. The source and destination do
662 not overlap. */
663# ifndef YYCOPY
664# if defined (__GNUC__) && 1 < __GNUC__
665# define YYCOPY(To, From, Count) \
666 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
667# else
668# define YYCOPY(To, From, Count) \
669 do \
670 { \
671 YYSIZE_T yyi; \
672 for (yyi = 0; yyi < (Count); yyi++) \
673 (To)[yyi] = (From)[yyi]; \
674 } \
675 while (0)
676# endif
677# endif
678
679/* Relocate STACK from its old location to the new one. The
680 local variables YYSIZE and YYSTACKSIZE give the old and new number of
681 elements in the stack, and YYPTR gives the new location of the
682 stack. Advance YYPTR to a properly aligned location for the next
683 stack. */
684# define YYSTACK_RELOCATE(Stack) \
685 do \
686 { \
687 YYSIZE_T yynewbytes; \
688 YYCOPY (&yyptr->Stack, Stack, yysize); \
689 Stack = &yyptr->Stack; \
690 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
691 yyptr += yynewbytes / sizeof (*yyptr); \
692 } \
693 while (0)
694
695#endif
696
697#if defined (__STDC__) || defined (__cplusplus)
698 typedef signed char yysigned_char;
699#else
700 typedef short int yysigned_char;
701#endif
702
703/* YYFINAL -- State number of the termination state. */
704#define YYFINAL 4
705/* YYLAST -- Last index in YYTABLE. */
Reid Spencerfcb5df82006-12-01 22:34:43 +0000706#define YYLAST 1335
Reid Spencere7c3c602006-11-30 06:36:44 +0000707
708/* YYNTOKENS -- Number of terminals. */
Reid Spencerfcb5df82006-12-01 22:34:43 +0000709#define YYNTOKENS 139
Reid Spencere7c3c602006-11-30 06:36:44 +0000710/* YYNNTS -- Number of nonterminals. */
Reid Spencerfcb5df82006-12-01 22:34:43 +0000711#define YYNNTS 71
Reid Spencere7c3c602006-11-30 06:36:44 +0000712/* YYNRULES -- Number of rules. */
Reid Spencerfcb5df82006-12-01 22:34:43 +0000713#define YYNRULES 263
Reid Spencere7c3c602006-11-30 06:36:44 +0000714/* YYNRULES -- Number of states. */
Reid Spencerfcb5df82006-12-01 22:34:43 +0000715#define YYNSTATES 522
Reid Spencere7c3c602006-11-30 06:36:44 +0000716
717/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
718#define YYUNDEFTOK 2
Reid Spencerfcb5df82006-12-01 22:34:43 +0000719#define YYMAXUTOK 379
Reid Spencere7c3c602006-11-30 06:36:44 +0000720
721#define YYTRANSLATE(YYX) \
722 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
723
724/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
725static const unsigned char yytranslate[] =
726{
727 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000731 128, 129, 137, 2, 126, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000733 133, 125, 134, 2, 2, 2, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000736 2, 130, 127, 132, 2, 2, 2, 2, 2, 138,
Reid Spencere7c3c602006-11-30 06:36:44 +0000737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000739 131, 2, 2, 135, 2, 136, 2, 2, 2, 2,
Reid Spencere7c3c602006-11-30 06:36:44 +0000740 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
753 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
754 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
755 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
756 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
757 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
758 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
759 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
760 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
761 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
762 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000763 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
764 115, 116, 117, 118, 119, 120, 121, 122, 123, 124
Reid Spencere7c3c602006-11-30 06:36:44 +0000765};
766
767#if YYDEBUG
768/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
769 YYRHS. */
770static const unsigned short int yyprhs[] =
771{
772 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
773 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
774 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
775 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000776 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
777 99, 101, 103, 105, 108, 109, 111, 113, 115, 117,
778 119, 121, 123, 124, 126, 128, 130, 132, 134, 136,
779 139, 140, 141, 144, 145, 149, 152, 153, 155, 156,
780 160, 162, 165, 167, 169, 171, 173, 175, 177, 179,
781 181, 183, 185, 187, 189, 191, 193, 195, 197, 199,
782 201, 203, 205, 208, 213, 219, 225, 229, 232, 235,
783 237, 241, 243, 247, 249, 250, 255, 259, 263, 268,
784 273, 277, 280, 283, 286, 289, 292, 295, 298, 301,
785 304, 307, 314, 320, 329, 336, 343, 350, 357, 364,
786 373, 382, 386, 388, 390, 392, 394, 397, 400, 405,
787 408, 410, 415, 418, 423, 430, 437, 444, 451, 455,
788 460, 461, 463, 465, 467, 471, 475, 479, 483, 487,
789 491, 493, 494, 496, 498, 500, 501, 504, 508, 510,
790 512, 516, 518, 519, 528, 530, 532, 536, 538, 540,
791 544, 545, 547, 549, 553, 554, 556, 558, 560, 562,
792 564, 566, 568, 570, 572, 576, 578, 584, 586, 588,
793 590, 592, 595, 598, 600, 603, 606, 607, 609, 612,
794 615, 619, 629, 639, 648, 663, 665, 667, 674, 680,
795 683, 690, 698, 700, 704, 706, 707, 710, 712, 718,
796 724, 730, 733, 738, 743, 750, 755, 760, 767, 774,
797 777, 785, 787, 790, 791, 793, 794, 798, 805, 809,
798 816, 819, 824, 831
Reid Spencere7c3c602006-11-30 06:36:44 +0000799};
800
801/* YYRHS -- A `-1'-separated list of the rules' RHS. */
802static const short int yyrhs[] =
803{
Reid Spencerfcb5df82006-12-01 22:34:43 +0000804 171, 0, -1, 19, -1, 20, -1, 17, -1, 18,
Reid Spencere7c3c602006-11-30 06:36:44 +0000805 -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
806 -1, 83, -1, 84, -1, 85, -1, 86, -1, 87,
807 -1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
Reid Spencere77e35e2006-12-01 20:26:20 +0000808 -1, 93, -1, 94, -1, 95, -1, 104, -1, 105,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000809 -1, 106, -1, 107, -1, 113, -1, 114, -1, 115,
810 -1, 116, -1, 117, -1, 118, -1, 119, -1, 120,
811 -1, 121, -1, 122, -1, 123, -1, 124, -1, 112,
812 -1, 11, -1, 9, -1, 7, -1, 5, -1, 12,
813 -1, 10, -1, 8, -1, 6, -1, 147, -1, 148,
814 -1, 13, -1, 14, -1, 179, 125, -1, -1, 42,
815 -1, 43, -1, 44, -1, 48, -1, 45, -1, 46,
816 -1, 47, -1, -1, 65, -1, 66, -1, 67, -1,
817 68, -1, 69, -1, 70, -1, 64, 18, -1, -1,
818 -1, 57, 18, -1, -1, 126, 57, 18, -1, 37,
819 30, -1, -1, 156, -1, -1, 126, 159, 158, -1,
820 156, -1, 57, 18, -1, 162, -1, 3, -1, 164,
821 -1, 3, -1, 164, -1, 4, -1, 5, -1, 6,
822 -1, 7, -1, 8, -1, 9, -1, 10, -1, 11,
823 -1, 12, -1, 13, -1, 14, -1, 15, -1, 16,
Reid Spencera50d5962006-12-02 04:11:07 +0000824 -1, 193, -1, 163, -1, 127, 18, -1, 161, 128,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000825 166, 129, -1, 130, 18, 131, 164, 132, -1, 133,
826 18, 131, 164, 134, -1, 135, 165, 136, -1, 135,
827 136, -1, 164, 137, -1, 164, -1, 165, 126, 164,
828 -1, 165, -1, 165, 126, 40, -1, 40, -1, -1,
829 162, 130, 169, 132, -1, 162, 130, 132, -1, 162,
830 138, 30, -1, 162, 133, 169, 134, -1, 162, 135,
831 169, 136, -1, 162, 135, 136, -1, 162, 22, -1,
832 162, 23, -1, 162, 193, -1, 162, 168, -1, 162,
833 24, -1, 147, 141, -1, 148, 18, -1, 4, 25,
834 -1, 4, 26, -1, 150, 21, -1, 146, 128, 167,
835 39, 162, 129, -1, 101, 128, 167, 207, 129, -1,
836 103, 128, 167, 126, 167, 126, 167, 129, -1, 142,
837 128, 167, 126, 167, 129, -1, 143, 128, 167, 126,
838 167, 129, -1, 144, 128, 167, 126, 167, 129, -1,
839 145, 128, 167, 126, 167, 129, -1, 109, 128, 167,
840 126, 167, 129, -1, 110, 128, 167, 126, 167, 126,
841 167, 129, -1, 111, 128, 167, 126, 167, 126, 167,
842 129, -1, 169, 126, 167, -1, 167, -1, 35, -1,
843 36, -1, 172, -1, 172, 188, -1, 172, 190, -1,
844 172, 62, 61, 174, -1, 172, 31, -1, 173, -1,
845 173, 151, 27, 160, -1, 173, 190, -1, 173, 62,
846 61, 174, -1, 173, 151, 152, 170, 167, 158, -1,
847 173, 151, 50, 170, 162, 158, -1, 173, 151, 45,
848 170, 162, 158, -1, 173, 151, 47, 170, 162, 158,
849 -1, 173, 51, 176, -1, 173, 58, 125, 177, -1,
850 -1, 30, -1, 56, -1, 55, -1, 53, 125, 175,
851 -1, 54, 125, 18, -1, 52, 125, 30, -1, 71,
852 125, 30, -1, 130, 178, 132, -1, 178, 126, 30,
853 -1, 30, -1, -1, 28, -1, 30, -1, 179, -1,
854 -1, 162, 180, -1, 182, 126, 181, -1, 181, -1,
855 182, -1, 182, 126, 40, -1, 40, -1, -1, 153,
856 160, 179, 128, 183, 129, 157, 154, -1, 32, -1,
857 135, -1, 152, 184, 185, -1, 33, -1, 136, -1,
858 186, 196, 187, -1, -1, 45, -1, 47, -1, 34,
859 189, 184, -1, -1, 63, -1, 17, -1, 18, -1,
860 21, -1, 25, -1, 26, -1, 22, -1, 23, -1,
861 24, -1, 133, 169, 134, -1, 168, -1, 61, 191,
862 30, 126, 30, -1, 140, -1, 179, -1, 193, -1,
863 192, -1, 162, 194, -1, 196, 197, -1, 197, -1,
864 198, 199, -1, 198, 201, -1, -1, 29, -1, 72,
865 195, -1, 72, 3, -1, 73, 15, 194, -1, 73,
866 4, 194, 126, 15, 194, 126, 15, 194, -1, 74,
867 149, 194, 126, 15, 194, 130, 200, 132, -1, 74,
868 149, 194, 126, 15, 194, 130, 132, -1, 151, 75,
869 153, 160, 194, 128, 204, 129, 39, 15, 194, 76,
870 15, 194, -1, 76, -1, 77, -1, 200, 149, 192,
871 126, 15, 194, -1, 149, 192, 126, 15, 194, -1,
872 151, 206, -1, 162, 130, 194, 126, 194, 132, -1,
873 202, 126, 130, 194, 126, 194, 132, -1, 195, -1,
874 203, 126, 195, -1, 203, -1, -1, 60, 59, -1,
875 59, -1, 142, 162, 194, 126, 194, -1, 143, 162,
876 194, 126, 194, -1, 144, 162, 194, 126, 194, -1,
877 49, 195, -1, 145, 195, 126, 195, -1, 146, 195,
878 39, 162, -1, 103, 195, 126, 195, 126, 195, -1,
879 108, 195, 126, 162, -1, 109, 195, 126, 195, -1,
880 110, 195, 126, 195, 126, 195, -1, 111, 195, 126,
881 195, 126, 195, -1, 102, 202, -1, 205, 153, 160,
882 194, 128, 204, 129, -1, 209, -1, 126, 203, -1,
883 -1, 38, -1, -1, 96, 162, 155, -1, 96, 162,
884 126, 10, 194, 155, -1, 97, 162, 155, -1, 97,
885 162, 126, 10, 194, 155, -1, 98, 195, -1, 208,
886 99, 162, 194, -1, 208, 100, 195, 126, 162, 194,
887 -1, 101, 162, 194, 207, -1
Reid Spencere7c3c602006-11-30 06:36:44 +0000888};
889
890/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
891static const unsigned short int yyrline[] =
892{
Reid Spencerf459d392006-12-02 16:19:52 +0000893 0, 271, 271, 271, 272, 272, 276, 276, 276, 276,
894 276, 276, 276, 276, 276, 277, 277, 277, 278, 278,
895 278, 278, 278, 278, 279, 279, 279, 279, 280, 280,
896 280, 280, 280, 280, 280, 281, 281, 281, 281, 281,
897 281, 286, 286, 286, 286, 287, 287, 287, 287, 288,
898 288, 289, 289, 292, 295, 300, 300, 300, 300, 300,
899 300, 301, 302, 305, 305, 305, 305, 305, 306, 307,
900 312, 317, 318, 321, 322, 330, 336, 337, 340, 341,
901 350, 351, 364, 364, 365, 365, 366, 370, 370, 370,
902 370, 370, 370, 370, 371, 371, 371, 371, 371, 373,
903 377, 381, 386, 391, 397, 404, 411, 417, 421, 431,
904 434, 442, 443, 448, 451, 461, 467, 472, 478, 484,
905 490, 495, 501, 507, 513, 519, 525, 531, 537, 543,
906 549, 557, 571, 583, 588, 593, 598, 603, 611, 616,
907 621, 631, 636, 641, 641, 651, 656, 659, 664, 668,
908 672, 675, 686, 691, 696, 703, 710, 717, 724, 729,
909 734, 739, 741, 741, 744, 749, 756, 761, 768, 775,
910 780, 781, 789, 789, 790, 790, 792, 799, 803, 807,
911 810, 815, 818, 820, 840, 843, 847, 856, 857, 859,
912 867, 868, 869, 873, 886, 887, 890, 890, 890, 890,
913 890, 890, 890, 891, 892, 897, 898, 907, 907, 911,
914 917, 928, 934, 937, 945, 949, 954, 957, 963, 968,
915 973, 978, 986, 993, 999, 1019, 1024, 1030, 1035, 1043,
916 1052, 1059, 1067, 1071, 1078, 1079, 1083, 1088, 1091, 1096,
917 1101, 1106, 1111, 1119, 1133, 1138, 1143, 1148, 1153, 1158,
918 1163, 1180, 1185, 1186, 1190, 1191, 1194, 1201, 1208, 1215,
919 1222, 1227, 1234, 1241
Reid Spencere7c3c602006-11-30 06:36:44 +0000920};
921#endif
922
923#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
924/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
925 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
926static const char *const yytname[] =
927{
Reid Spencerf2d55322006-12-01 21:52:30 +0000928 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
929 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
930 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
931 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
Reid Spencere77e35e2006-12-01 20:26:20 +0000932 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
933 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
934 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
935 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
936 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
937 "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK",
938 "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK", "COLDCC_TOK",
939 "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "RET", "BR",
940 "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV",
941 "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SETLE",
942 "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", "ALLOCA", "FREE",
Reid Spencerf7bde222006-12-01 22:26:37 +0000943 "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR",
944 "ASHR", "LSHR", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT",
Reid Spencerfcb5df82006-12-01 22:34:43 +0000945 "SHUFFLEVECTOR", "CAST", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT",
946 "FPTOUI", "FPTOSI", "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR",
947 "BITCAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'",
948 "'<'", "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "IntVal",
949 "EInt64Val", "ArithmeticOps", "LogicalOps", "SetCondOps", "ShiftOps",
950 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
Reid Spencerf7bde222006-12-01 22:26:37 +0000951 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
952 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
953 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
954 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
955 "Module", "DefinitionList", "ConstPool", "AsmBlock", "BigOrLittle",
956 "TargetDefinition", "LibrariesDefinition", "LibList", "Name", "OptName",
957 "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
958 "FunctionHeader", "END", "Function", "FnDeclareLinkage", "FunctionProto",
959 "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef",
960 "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList",
961 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ValueRefList",
962 "ValueRefListE", "OptTailCall", "InstVal", "IndexList", "OptVolatile",
963 "MemoryInst", 0
Reid Spencere7c3c602006-11-30 06:36:44 +0000964};
965#endif
966
967# ifdef YYPRINT
968/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
969 token YYLEX-NUM. */
970static const unsigned short int yytoknum[] =
971{
972 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
973 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
974 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
975 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
976 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
977 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
978 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
979 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
980 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
981 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
982 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Reid Spencerfcb5df82006-12-01 22:34:43 +0000983 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
984 375, 376, 377, 378, 379, 61, 44, 92, 40, 41,
985 91, 120, 93, 60, 62, 123, 125, 42, 99
Reid Spencere7c3c602006-11-30 06:36:44 +0000986};
987# endif
988
989/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
990static const unsigned char yyr1[] =
991{
Reid Spencerfcb5df82006-12-01 22:34:43 +0000992 0, 139, 140, 140, 141, 141, 142, 142, 142, 142,
993 142, 142, 142, 142, 142, 143, 143, 143, 144, 144,
994 144, 144, 144, 144, 145, 145, 145, 145, 146, 146,
995 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
996 146, 147, 147, 147, 147, 148, 148, 148, 148, 149,
997 149, 150, 150, 151, 151, 152, 152, 152, 152, 152,
998 152, 152, 152, 153, 153, 153, 153, 153, 153, 153,
999 153, 154, 154, 155, 155, 156, 157, 157, 158, 158,
1000 159, 159, 160, 160, 161, 161, 162, 163, 163, 163,
1001 163, 163, 163, 163, 163, 163, 163, 163, 163, 164,
1002 164, 164, 164, 164, 164, 164, 164, 164, 164, 165,
1003 165, 166, 166, 166, 166, 167, 167, 167, 167, 167,
1004 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
1005 167, 168, 168, 168, 168, 168, 168, 168, 168, 168,
1006 168, 169, 169, 170, 170, 171, 172, 172, 172, 172,
1007 172, 173, 173, 173, 173, 173, 173, 173, 173, 173,
1008 173, 174, 175, 175, 176, 176, 176, 176, 177, 178,
1009 178, 178, 179, 179, 180, 180, 181, 182, 182, 183,
1010 183, 183, 183, 184, 185, 185, 186, 187, 187, 188,
1011 189, 189, 189, 190, 191, 191, 192, 192, 192, 192,
1012 192, 192, 192, 192, 192, 192, 192, 193, 193, 194,
1013 194, 195, 196, 196, 197, 198, 198, 198, 199, 199,
1014 199, 199, 199, 199, 199, 199, 199, 200, 200, 201,
1015 202, 202, 203, 203, 204, 204, 205, 205, 206, 206,
1016 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
1017 206, 206, 207, 207, 208, 208, 209, 209, 209, 209,
1018 209, 209, 209, 209
Reid Spencere7c3c602006-11-30 06:36:44 +00001019};
1020
1021/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1022static const unsigned char yyr2[] =
1023{
1024 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1025 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1026 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1027 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerf7bde222006-12-01 22:26:37 +00001028 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001029 1, 1, 1, 2, 0, 1, 1, 1, 1, 1,
1030 1, 1, 0, 1, 1, 1, 1, 1, 1, 2,
1031 0, 0, 2, 0, 3, 2, 0, 1, 0, 3,
1032 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1033 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1034 1, 1, 2, 4, 5, 5, 3, 2, 2, 1,
1035 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1036 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1037 2, 6, 5, 8, 6, 6, 6, 6, 6, 8,
1038 8, 3, 1, 1, 1, 1, 2, 2, 4, 2,
1039 1, 4, 2, 4, 6, 6, 6, 6, 3, 4,
1040 0, 1, 1, 1, 3, 3, 3, 3, 3, 3,
1041 1, 0, 1, 1, 1, 0, 2, 3, 1, 1,
1042 3, 1, 0, 8, 1, 1, 3, 1, 1, 3,
1043 0, 1, 1, 3, 0, 1, 1, 1, 1, 1,
1044 1, 1, 1, 1, 3, 1, 5, 1, 1, 1,
1045 1, 2, 2, 1, 2, 2, 0, 1, 2, 2,
1046 3, 9, 9, 8, 14, 1, 1, 6, 5, 2,
1047 6, 7, 1, 3, 1, 0, 2, 1, 5, 5,
1048 5, 2, 4, 4, 6, 4, 4, 6, 6, 2,
1049 7, 1, 2, 0, 1, 0, 3, 6, 3, 6,
1050 2, 4, 6, 4
Reid Spencere7c3c602006-11-30 06:36:44 +00001051};
1052
1053/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1054 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1055 means the default is an error. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001056static const unsigned short int yydefact[] =
Reid Spencere7c3c602006-11-30 06:36:44 +00001057{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001058 160, 0, 62, 150, 1, 149, 190, 55, 56, 57,
1059 59, 60, 61, 58, 0, 70, 216, 146, 147, 172,
1060 173, 0, 0, 0, 62, 0, 152, 191, 192, 70,
1061 0, 0, 63, 64, 65, 66, 67, 68, 0, 0,
1062 217, 216, 213, 54, 0, 0, 0, 0, 158, 0,
1063 0, 0, 0, 0, 0, 0, 53, 193, 161, 148,
1064 69, 83, 87, 88, 89, 90, 91, 92, 93, 94,
1065 95, 96, 97, 98, 99, 2, 3, 0, 0, 0,
Reid Spencera50d5962006-12-02 04:11:07 +00001066 0, 207, 0, 0, 82, 101, 86, 208, 100, 184,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001067 185, 186, 187, 188, 189, 212, 0, 0, 0, 225,
1068 226, 255, 214, 215, 0, 0, 0, 0, 171, 159,
1069 153, 151, 143, 144, 0, 0, 0, 0, 102, 0,
1070 0, 85, 107, 109, 0, 0, 114, 108, 219, 0,
1071 218, 0, 0, 44, 48, 43, 47, 42, 46, 41,
1072 45, 49, 50, 0, 254, 0, 237, 0, 70, 6,
Reid Spencer16244f42006-12-01 21:10:07 +00001073 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1074 17, 18, 19, 20, 21, 22, 23, 0, 0, 0,
Reid Spencerf7bde222006-12-01 22:26:37 +00001075 0, 0, 0, 24, 25, 26, 27, 0, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001076 0, 40, 28, 29, 30, 31, 32, 33, 34, 35,
1077 36, 37, 38, 39, 0, 0, 0, 0, 0, 70,
1078 229, 0, 251, 166, 163, 162, 164, 165, 167, 170,
1079 0, 78, 78, 78, 87, 88, 89, 90, 91, 92,
1080 93, 94, 95, 96, 97, 0, 0, 0, 0, 78,
1081 0, 0, 0, 106, 182, 113, 111, 0, 196, 197,
1082 198, 201, 202, 203, 199, 200, 194, 0, 0, 0,
1083 0, 0, 0, 0, 0, 0, 0, 0, 205, 210,
1084 209, 211, 0, 220, 0, 241, 236, 0, 73, 73,
1085 260, 0, 0, 249, 0, 0, 0, 0, 0, 0,
1086 0, 0, 0, 0, 0, 0, 0, 0, 168, 0,
1087 156, 157, 155, 128, 129, 4, 5, 126, 127, 130,
1088 121, 122, 125, 0, 0, 0, 0, 124, 123, 154,
1089 84, 84, 110, 181, 175, 178, 179, 0, 0, 103,
1090 195, 0, 0, 0, 0, 0, 0, 142, 0, 0,
1091 0, 0, 0, 0, 0, 0, 0, 0, 256, 0,
1092 258, 253, 0, 0, 0, 0, 0, 0, 0, 0,
1093 0, 0, 0, 0, 0, 0, 0, 169, 0, 0,
1094 80, 78, 116, 0, 0, 120, 0, 117, 104, 105,
1095 174, 176, 0, 76, 112, 0, 253, 0, 0, 0,
1096 0, 0, 204, 0, 0, 0, 0, 0, 0, 0,
1097 0, 0, 0, 0, 0, 263, 0, 0, 0, 245,
1098 246, 0, 0, 0, 0, 0, 242, 243, 0, 261,
1099 0, 75, 81, 79, 115, 118, 119, 180, 177, 77,
1100 71, 0, 0, 0, 0, 0, 0, 141, 0, 0,
1101 0, 0, 0, 0, 0, 235, 73, 74, 73, 232,
1102 252, 0, 0, 0, 0, 0, 238, 239, 240, 235,
1103 0, 0, 183, 206, 132, 0, 0, 0, 0, 0,
1104 0, 0, 0, 0, 0, 0, 234, 0, 0, 257,
1105 259, 0, 0, 0, 244, 247, 248, 0, 262, 72,
1106 0, 138, 0, 0, 134, 135, 136, 137, 131, 0,
1107 223, 0, 0, 0, 233, 230, 0, 250, 0, 0,
1108 0, 221, 0, 222, 0, 0, 231, 133, 139, 140,
1109 0, 0, 0, 0, 0, 0, 228, 0, 0, 227,
1110 0, 224
Reid Spencere7c3c602006-11-30 06:36:44 +00001111};
1112
1113/* YYDEFGOTO[NTERM-NUM]. */
1114static const short int yydefgoto[] =
1115{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001116 -1, 81, 297, 253, 254, 255, 256, 257, 225, 226,
1117 143, 227, 24, 15, 38, 452, 338, 360, 420, 290,
1118 361, 82, 83, 228, 85, 86, 124, 237, 327, 258,
1119 328, 114, 1, 2, 3, 59, 206, 48, 109, 210,
1120 87, 371, 315, 316, 317, 39, 91, 16, 94, 17,
1121 29, 18, 321, 259, 88, 261, 439, 41, 42, 43,
1122 102, 492, 103, 273, 466, 467, 199, 200, 395, 201,
1123 202
Reid Spencere7c3c602006-11-30 06:36:44 +00001124};
1125
1126/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1127 STATE-NUM. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001128#define YYPACT_NINF -472
Reid Spencere7c3c602006-11-30 06:36:44 +00001129static const short int yypact[] =
1130{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001131 -472, 38, 138, 1015, -472, -472, 59, -472, -472, -472,
1132 -472, -472, -472, -472, -2, 80, 35, -472, -472, -472,
1133 -472, -29, -50, 18, 174, -37, -472, -472, -472, 80,
1134 73, 93, -472, -472, -472, -472, -472, -472, 744, -22,
1135 -472, -21, -472, 9, 3, 12, 54, 64, -472, 37,
1136 73, 744, 84, 84, 84, 84, -472, -472, -472, -472,
1137 -472, 62, -472, -472, -472, -472, -472, -472, -472, -472,
1138 -472, -472, -472, -472, -472, -472, -472, 173, 176, 177,
1139 431, -472, 86, 69, -472, -472, -106, -472, -472, -472,
1140 -472, -472, -472, -472, -472, -472, 772, 28, 343, -472,
1141 -472, 1211, -472, -472, 162, 66, 180, 169, 172, -472,
1142 -472, -472, -472, -472, 802, 802, 802, 831, -472, 72,
1143 74, -472, -472, -106, -46, 76, 504, -472, 62, 1011,
1144 -472, 1011, 1011, -472, -472, -472, -472, -472, -472, -472,
1145 -472, -472, -472, 1011, -472, 802, -472, 148, 80, -472,
1146 -472, -472, -472, -472, -472, -472, -472, -472, -472, -472,
1147 -472, -472, -472, -472, -472, -472, -472, 802, 802, 802,
1148 802, 802, 802, -472, -472, -472, -472, 802, 802, 802,
1149 802, -472, -472, -472, -472, -472, -472, -472, -472, -472,
1150 -472, -472, -472, -472, 802, 802, 802, 802, 802, 80,
1151 -472, 24, -472, -472, -472, -472, -472, -472, -472, -472,
1152 -70, 83, 83, 83, 101, 118, 192, 137, 193, 147,
1153 194, 153, 195, 204, 207, 170, 197, 209, 889, 83,
1154 802, 802, 802, -472, 565, -472, 105, 103, -472, -472,
1155 -472, -472, -472, -472, -472, -472, 171, 107, 108, 109,
1156 110, 113, 831, 114, 115, 116, 117, 122, -472, -472,
1157 -472, -472, 127, -472, 128, -472, -472, 744, 129, 130,
1158 -472, 1011, 132, 131, 133, 144, 145, 152, 154, 1011,
1159 1011, 1011, 155, 219, 744, 802, 802, 243, -472, -16,
1160 -472, -472, -472, -472, -472, -472, -472, -472, -472, -472,
1161 -472, -472, -472, 610, 831, 476, 244, -472, -472, -472,
1162 -102, -32, -106, -472, 86, -472, 156, 150, 638, -472,
1163 -472, 253, 831, 831, 831, 831, 831, -472, -90, 831,
1164 831, 831, 831, 831, 269, 272, 1011, 4, -472, 17,
1165 -472, 163, 1011, 161, 802, 802, 802, 802, 802, 166,
1166 167, 178, 802, 802, 1011, 1011, 179, -472, 265, 278,
1167 -472, 83, -472, -39, -71, -472, -35, -472, -472, -472,
1168 -472, -472, 698, 260, -472, 185, 163, 186, 203, 205,
1169 206, 831, -472, 210, 211, 213, 214, 259, 1011, 1011,
1170 175, 1011, 281, 1011, 802, -472, 215, 1011, 216, -472,
1171 -472, 217, 218, 1011, 1011, 1011, -472, -472, 202, -472,
1172 802, -472, -472, -472, -472, -472, -472, -472, -472, -472,
1173 266, 303, 228, 831, 831, 831, 831, -472, 831, 831,
1174 831, 831, 802, 220, 229, 802, 232, -472, 232, -472,
1175 234, 1011, 236, 802, 802, 802, -472, -472, -472, 802,
1176 1011, 317, -472, -472, -472, 240, 238, 245, 247, 246,
1177 248, 249, 250, 251, 359, 42, 234, 252, 325, -472,
1178 -472, 802, 255, 1011, -472, -472, -472, 254, -472, -472,
1179 831, -472, 831, 831, -472, -472, -472, -472, -472, 1011,
1180 -472, 1124, 61, 349, -472, -472, 258, -472, 264, 270,
1181 271, -472, 275, -472, 1124, 383, -472, -472, -472, -472,
1182 387, 277, 1011, 1011, 389, 332, -472, 1011, 397, -472,
1183 1011, -472
Reid Spencere7c3c602006-11-30 06:36:44 +00001184};
1185
1186/* YYPGOTO[NTERM-NUM]. */
1187static const short int yypgoto[] =
1188{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001189 -472, -472, -472, 312, 314, 315, 321, 326, -97, -96,
1190 -446, -472, 385, 405, -139, -472, -263, 57, -472, -195,
1191 -472, -44, -472, -38, -472, -69, 305, -472, -5, 221,
1192 -209, 55, -472, -472, -472, 382, -472, -472, -472, -472,
1193 2, -472, 81, -472, -472, 419, -472, -472, -472, -472,
1194 -472, 449, -472, -471, -103, -128, -80, -472, 413, -472,
1195 -472, -472, -472, -472, 63, 6, -472, -472, 82, -472,
1196 -472
Reid Spencere7c3c602006-11-30 06:36:44 +00001197};
1198
1199/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1200 positive, shift that token. If negative, reduce the rule which
1201 number is the opposite. If zero, do what YYDEFACT says.
1202 If YYTABLE_NINF, syntax error. */
Reid Spencerfcb5df82006-12-01 22:34:43 +00001203#define YYTABLE_NINF -146
Reid Spencere7c3c602006-11-30 06:36:44 +00001204static const short int yytable[] =
1205{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001206 84, 141, 142, 262, 263, 25, 340, 111, 40, 267,
1207 89, 123, 92, 84, 391, 264, 130, 291, 292, 491,
1208 502, 358, -84, 44, 45, 46, 260, 393, 260, 260,
1209 368, 127, 131, 511, 309, 127, 381, 19, 4, 20,
1210 260, 359, 47, 132, 382, 25, 504, 133, 134, 135,
1211 136, 137, 138, 139, 140, 381, 287, 123, 129, 30,
1212 284, 392, 288, 415, 40, 265, 133, 134, 135, 136,
1213 137, 138, 139, 140, 392, 49, 211, 212, 213, 50,
1214 232, 96, 97, 98, 125, 99, 100, 381, 56, 270,
1215 233, 381, 274, 414, 363, 364, 366, 275, 276, 277,
1216 278, 416, 369, 58, 27, 127, 28, 129, 115, 116,
1217 117, 60, 229, 90, 19, 93, 20, 282, 283, 112,
1218 113, 204, 205, 285, 286, 308, 293, 294, 104, 268,
1219 269, 129, 271, 272, 129, -44, -44, 105, -145, 129,
1220 129, 129, 129, 341, 31, 32, 33, 34, 35, 36,
1221 37, 349, 350, 351, -43, -43, 279, 280, 281, 129,
1222 129, 310, 311, 312, -42, -42, 413, 108, 260, 5,
1223 -41, -41, 6, 469, 490, 470, 260, 260, 260, 106,
1224 7, 8, 9, 10, 11, 12, 13, 295, 296, 107,
1225 -85, 118, 203, 503, 119, 120, 314, 126, 207, 208,
1226 14, 51, 209, 230, 234, 231, 356, 266, 390, 289,
1227 -48, -47, -46, -45, 396, 298, 7, 8, 9, 52,
1228 11, 53, 13, 336, 54, -51, 408, 409, -52, 84,
1229 299, 318, 319, 260, 320, 322, 323, 324, 325, 260,
1230 354, 326, 329, 330, 331, 332, 84, 355, 129, 312,
1231 333, 260, 260, 334, 335, 337, 339, 343, 353, 344,
1232 433, 434, 342, 436, 398, 438, 400, 401, 402, 442,
1233 345, 346, 406, 357, 367, 446, 447, 448, 347, 373,
1234 348, 352, 372, 375, 388, 260, 260, 389, 260, 394,
1235 260, 397, 403, 404, 260, 411, 412, 358, 432, 437,
1236 260, 260, 260, 435, 405, 410, 129, 399, 129, 129,
1237 129, 421, 423, 472, 129, 407, 370, 376, 377, 378,
1238 379, 380, 478, 451, 383, 384, 385, 386, 387, 424,
1239 449, 425, 426, 453, 314, 479, 428, 429, 260, 430,
1240 431, 441, 443, 444, 445, 496, 464, 260, 133, 134,
1241 135, 136, 137, 138, 139, 140, 129, 454, 468, 465,
1242 471, 501, 473, 474, 475, 476, 480, 481, 141, 142,
1243 260, 482, 450, 483, 489, 484, 427, 485, 486, 487,
1244 488, 493, 392, 497, 515, 516, 260, 495, 505, 519,
1245 506, 494, 521, 507, 463, 141, 142, 129, 512, 508,
1246 509, 510, 513, 514, 517, 129, 129, 129, 518, 260,
1247 260, 129, 520, 194, 260, 195, 196, 260, 455, 456,
1248 457, 458, 197, 459, 460, 461, 462, 198, 101, 55,
1249 419, 236, 110, 129, 121, 62, 63, 64, 65, 66,
1250 67, 68, 69, 70, 71, 72, 73, 74, 57, 307,
1251 75, 76, 26, 418, 95, 477, 0, 440, 422, 19,
1252 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1253 0, 0, 0, 0, 0, 498, 0, 499, 500, 121,
1254 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
1255 224, 73, 74, 0, 0, 75, 76, 0, 0, 0,
1256 0, 0, 0, 0, 19, 0, 20, 121, 62, 63,
1257 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1258 74, 0, 0, 75, 76, 0, 0, 0, 0, 0,
1259 0, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1260 0, 0, 0, 0, 235, 0, 0, 0, 0, 0,
1261 0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
1262 0, 78, 0, 0, 79, 0, 80, 122, 121, 62,
1263 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1264 73, 74, 0, 0, 75, 76, 0, 0, 0, 0,
1265 0, 0, 0, 19, 0, 20, 0, 0, 0, 0,
1266 0, 0, 0, 77, 0, 313, 78, 0, 0, 79,
1267 0, 80, 365, 121, 214, 215, 216, 217, 218, 219,
1268 220, 221, 222, 223, 224, 73, 74, 0, 0, 75,
1269 76, 77, 0, 0, 78, 0, 0, 79, 19, 80,
1270 20, 121, 62, 63, 64, 65, 66, 67, 68, 69,
1271 70, 71, 72, 73, 74, 0, 0, 75, 76, 0,
1272 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
1273 0, 0, 0, 0, 0, 0, 0, 0, 374, 0,
1274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencerf7bde222006-12-01 22:26:37 +00001275 0, 0, 77, 0, 0, 78, 0, 0, 79, 0,
1276 80, 121, 62, 63, 64, 65, 66, 67, 68, 69,
1277 70, 71, 72, 73, 74, 0, 0, 75, 76, 0,
1278 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001279 0, 0, 0, 0, 0, 0, 0, 77, 417, 0,
1280 78, 0, 362, 79, 0, 80, 0, 61, 62, 63,
1281 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1282 74, 0, 0, 75, 76, 77, 0, 0, 78, 0,
1283 0, 79, 19, 80, 20, 128, 62, 63, 64, 65,
1284 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
1285 0, 75, 76, 0, 0, 0, 0, 0, 0, 0,
1286 19, 0, 20, 0, 0, 121, 62, 63, 64, 65,
1287 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
1288 0, 75, 76, 0, 0, 77, 0, 0, 78, 0,
1289 19, 79, 20, 80, 121, 214, 215, 216, 217, 218,
1290 219, 220, 221, 222, 223, 224, 73, 74, 0, 0,
1291 75, 76, 0, 0, 0, 0, 0, 0, 0, 19,
1292 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1293 0, 77, 0, 0, 78, 0, 0, 79, 0, 80,
Reid Spencerf2d55322006-12-01 21:52:30 +00001294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencerf7bde222006-12-01 22:26:37 +00001295 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001296 0, 0, 78, 0, 0, 79, 0, 80, 75, 76,
1297 0, 300, 301, 302, 0, 0, 0, 19, 0, 20,
1298 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
Reid Spencerf7bde222006-12-01 22:26:37 +00001299 0, 0, 78, 0, 0, 79, 0, 80, 0, 0,
Reid Spencerf7bde222006-12-01 22:26:37 +00001300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001301 0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
1302 0, 78, 0, 0, 79, 0, 80, 149, 150, 151,
Reid Spencerf7bde222006-12-01 22:26:37 +00001303 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001304 162, 163, 164, 165, 166, 0, 0, 0, 0, 0,
1305 247, 0, 248, 173, 174, 175, 176, 0, 249, 250,
1306 251, 181, 182, 183, 184, 185, 186, 187, 188, 189,
1307 190, 191, 192, 193, 0, 0, 0, 0, 0, 303,
1308 0, 0, 304, 0, 305, 0, 0, 306, 238, 239,
1309 75, 76, 240, 241, 242, 243, 244, 245, 0, 19,
1310 0, 20, -54, 19, 0, 20, 0, 0, 0, 6,
1311 -54, -54, 0, 0, 0, 0, 0, -54, -54, -54,
1312 -54, -54, -54, -54, 0, -54, 21, 0, 0, 0,
1313 0, 0, 246, 22, 0, 0, 0, 23, 0, 0,
1314 0, 0, 0, 0, 0, 0, 0, 0, 0, 149,
1315 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1316 160, 161, 162, 163, 164, 165, 166, 0, 0, 0,
1317 0, 0, 247, 0, 248, 173, 174, 175, 176, 0,
1318 249, 250, 251, 181, 182, 183, 184, 185, 186, 187,
1319 188, 189, 190, 191, 192, 193, 0, 0, 0, 0,
1320 0, 238, 239, 0, 252, 240, 241, 242, 243, 244,
1321 245, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1323 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1324 0, 0, 0, 0, 0, 246, 0, 0, 0, 0,
1325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1326 0, 0, 149, 150, 151, 152, 153, 154, 155, 156,
1327 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
1328 0, 0, 0, 0, 0, 247, 0, 248, 173, 174,
1329 175, 176, 0, 249, 250, 251, 181, 182, 183, 184,
1330 185, 186, 187, 188, 189, 190, 191, 192, 193, 144,
1331 0, 0, 0, 0, 0, 0, 0, 252, 0, 0,
1332 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1333 146, 147, 0, 0, 0, 0, 0, 0, 0, 0,
1334 0, 0, 0, 0, 0, 0, 148, 0, 0, 149,
1335 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1336 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1337 0, 0, 170, 171, 172, 173, 174, 175, 176, 177,
1338 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1339 188, 189, 190, 191, 192, 193
Reid Spencere7c3c602006-11-30 06:36:44 +00001340};
1341
1342static const short int yycheck[] =
1343{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001344 38, 98, 98, 131, 132, 3, 269, 51, 29, 148,
1345 32, 80, 33, 51, 10, 143, 96, 212, 213, 465,
1346 491, 37, 128, 52, 53, 54, 129, 10, 131, 132,
1347 132, 137, 4, 504, 229, 137, 126, 28, 0, 30,
1348 143, 57, 71, 15, 134, 43, 492, 5, 6, 7,
1349 8, 9, 10, 11, 12, 126, 126, 126, 96, 61,
1350 199, 57, 132, 134, 29, 145, 5, 6, 7, 8,
1351 9, 10, 11, 12, 57, 125, 114, 115, 116, 61,
1352 126, 72, 73, 74, 82, 76, 77, 126, 125, 169,
1353 136, 126, 172, 132, 303, 304, 305, 177, 178, 179,
1354 180, 136, 134, 30, 45, 137, 47, 145, 53, 54,
1355 55, 18, 117, 135, 28, 136, 30, 197, 198, 35,
1356 36, 55, 56, 99, 100, 228, 25, 26, 125, 167,
1357 168, 169, 170, 171, 172, 17, 18, 125, 0, 177,
1358 178, 179, 180, 271, 64, 65, 66, 67, 68, 69,
1359 70, 279, 280, 281, 17, 18, 194, 195, 196, 197,
1360 198, 230, 231, 232, 17, 18, 361, 130, 271, 31,
1361 17, 18, 34, 436, 132, 438, 279, 280, 281, 125,
1362 42, 43, 44, 45, 46, 47, 48, 17, 18, 125,
1363 128, 18, 30, 132, 18, 18, 234, 128, 18, 30,
1364 62, 27, 30, 131, 128, 131, 286, 59, 336, 126,
1365 18, 18, 18, 18, 342, 18, 42, 43, 44, 45,
1366 46, 47, 48, 267, 50, 21, 354, 355, 21, 267,
1367 21, 126, 129, 336, 63, 128, 128, 128, 128, 342,
1368 284, 128, 128, 128, 128, 128, 284, 285, 286, 318,
1369 128, 354, 355, 126, 126, 126, 126, 126, 39, 126,
1370 388, 389, 130, 391, 344, 393, 346, 347, 348, 397,
1371 126, 126, 352, 30, 30, 403, 404, 405, 126, 129,
1372 126, 126, 126, 30, 15, 388, 389, 15, 391, 126,
1373 393, 130, 126, 126, 397, 30, 18, 37, 39, 18,
1374 403, 404, 405, 128, 126, 126, 344, 345, 346, 347,
1375 348, 126, 126, 441, 352, 353, 314, 322, 323, 324,
1376 325, 326, 450, 57, 329, 330, 331, 332, 333, 126,
1377 128, 126, 126, 30, 372, 18, 126, 126, 441, 126,
1378 126, 126, 126, 126, 126, 473, 126, 450, 5, 6,
1379 7, 8, 9, 10, 11, 12, 394, 129, 126, 130,
1380 126, 489, 126, 443, 444, 445, 126, 129, 465, 465,
1381 473, 126, 410, 126, 15, 129, 381, 129, 129, 129,
1382 129, 129, 57, 129, 512, 513, 489, 132, 39, 517,
1383 132, 471, 520, 129, 432, 492, 492, 435, 15, 129,
1384 129, 126, 15, 126, 15, 443, 444, 445, 76, 512,
1385 513, 449, 15, 101, 517, 101, 101, 520, 423, 424,
1386 425, 426, 101, 428, 429, 430, 431, 101, 43, 24,
1387 373, 126, 50, 471, 3, 4, 5, 6, 7, 8,
1388 9, 10, 11, 12, 13, 14, 15, 16, 29, 228,
1389 19, 20, 3, 372, 41, 449, -1, 394, 376, 28,
1390 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
1391 -1, -1, -1, -1, -1, 480, -1, 482, 483, 3,
Reid Spencerf7bde222006-12-01 22:26:37 +00001392 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001393 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1394 -1, -1, -1, -1, 28, -1, 30, 3, 4, 5,
Reid Spencerf2d55322006-12-01 21:52:30 +00001395 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1396 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001397 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
1398 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
1399 -1, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1400 -1, 130, -1, -1, 133, -1, 135, 136, 3, 4,
1401 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1402 15, 16, -1, -1, 19, 20, -1, -1, -1, -1,
1403 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1404 -1, -1, -1, 127, -1, 40, 130, -1, -1, 133,
1405 -1, 135, 136, 3, 4, 5, 6, 7, 8, 9,
1406 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1407 20, 127, -1, -1, 130, -1, -1, 133, 28, 135,
1408 30, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1409 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1410 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
1411 -1, -1, -1, -1, -1, -1, -1, -1, 40, -1,
Reid Spencerf2d55322006-12-01 21:52:30 +00001412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001413 -1, -1, 127, -1, -1, 130, -1, -1, 133, -1,
1414 135, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1415 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
1416 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
1417 -1, -1, -1, -1, -1, -1, -1, 127, 40, -1,
1418 130, -1, 132, 133, -1, 135, -1, 3, 4, 5,
1419 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1420 16, -1, -1, 19, 20, 127, -1, -1, 130, -1,
1421 -1, 133, 28, 135, 30, 3, 4, 5, 6, 7,
1422 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1423 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1424 28, -1, 30, -1, -1, 3, 4, 5, 6, 7,
1425 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1426 -1, 19, 20, -1, -1, 127, -1, -1, 130, -1,
1427 28, 133, 30, 135, 3, 4, 5, 6, 7, 8,
1428 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
1429 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
1430 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
1431 -1, 127, -1, -1, 130, -1, -1, 133, -1, 135,
Reid Spencerf2d55322006-12-01 21:52:30 +00001432 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001433 -1, -1, -1, -1, -1, -1, -1, -1, -1, 127,
1434 -1, -1, 130, -1, -1, 133, -1, 135, 19, 20,
1435 -1, 22, 23, 24, -1, -1, -1, 28, -1, 30,
1436 -1, -1, -1, -1, -1, -1, -1, -1, -1, 127,
1437 -1, -1, 130, -1, -1, 133, -1, 135, -1, -1,
Reid Spencerf7bde222006-12-01 22:26:37 +00001438 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001439 -1, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1440 -1, 130, -1, -1, 133, -1, 135, 78, 79, 80,
Reid Spencerf7bde222006-12-01 22:26:37 +00001441 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001442 91, 92, 93, 94, 95, -1, -1, -1, -1, -1,
1443 101, -1, 103, 104, 105, 106, 107, -1, 109, 110,
1444 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
1445 121, 122, 123, 124, -1, -1, -1, -1, -1, 130,
1446 -1, -1, 133, -1, 135, -1, -1, 138, 17, 18,
1447 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
1448 -1, 30, 27, 28, -1, 30, -1, -1, -1, 34,
1449 35, 36, -1, -1, -1, -1, -1, 42, 43, 44,
1450 45, 46, 47, 48, -1, 50, 51, -1, -1, -1,
1451 -1, -1, 61, 58, -1, -1, -1, 62, -1, -1,
1452 -1, -1, -1, -1, -1, -1, -1, -1, -1, 78,
1453 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1454 89, 90, 91, 92, 93, 94, 95, -1, -1, -1,
1455 -1, -1, 101, -1, 103, 104, 105, 106, 107, -1,
1456 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1457 119, 120, 121, 122, 123, 124, -1, -1, -1, -1,
1458 -1, 17, 18, -1, 133, 21, 22, 23, 24, 25,
1459 26, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1460 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1462 -1, -1, -1, -1, -1, 61, -1, -1, -1, -1,
1463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1464 -1, -1, 78, 79, 80, 81, 82, 83, 84, 85,
1465 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1466 -1, -1, -1, -1, -1, 101, -1, 103, 104, 105,
1467 106, 107, -1, 109, 110, 111, 112, 113, 114, 115,
1468 116, 117, 118, 119, 120, 121, 122, 123, 124, 38,
1469 -1, -1, -1, -1, -1, -1, -1, 133, -1, -1,
1470 49, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1471 59, 60, -1, -1, -1, -1, -1, -1, -1, -1,
1472 -1, -1, -1, -1, -1, -1, 75, -1, -1, 78,
1473 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1474 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1475 -1, -1, 101, 102, 103, 104, 105, 106, 107, 108,
1476 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1477 119, 120, 121, 122, 123, 124
Reid Spencere7c3c602006-11-30 06:36:44 +00001478};
1479
1480/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1481 symbol of state STATE-NUM. */
1482static const unsigned char yystos[] =
1483{
Reid Spencerfcb5df82006-12-01 22:34:43 +00001484 0, 171, 172, 173, 0, 31, 34, 42, 43, 44,
1485 45, 46, 47, 48, 62, 152, 186, 188, 190, 28,
1486 30, 51, 58, 62, 151, 179, 190, 45, 47, 189,
1487 61, 64, 65, 66, 67, 68, 69, 70, 153, 184,
1488 29, 196, 197, 198, 52, 53, 54, 71, 176, 125,
1489 61, 27, 45, 47, 50, 152, 125, 184, 30, 174,
Reid Spencerf2d55322006-12-01 21:52:30 +00001490 18, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001491 12, 13, 14, 15, 16, 19, 20, 127, 130, 133,
1492 135, 140, 160, 161, 162, 163, 164, 179, 193, 32,
1493 135, 185, 33, 136, 187, 197, 72, 73, 74, 76,
1494 77, 151, 199, 201, 125, 125, 125, 125, 130, 177,
1495 174, 160, 35, 36, 170, 170, 170, 170, 18, 18,
1496 18, 3, 136, 164, 165, 179, 128, 137, 3, 162,
1497 195, 4, 15, 5, 6, 7, 8, 9, 10, 11,
1498 12, 147, 148, 149, 38, 49, 59, 60, 75, 78,
Reid Spencer16244f42006-12-01 21:10:07 +00001499 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1500 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1501 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
Reid Spencerfcb5df82006-12-01 22:34:43 +00001502 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
1503 121, 122, 123, 124, 142, 143, 144, 145, 146, 205,
1504 206, 208, 209, 30, 55, 56, 175, 18, 30, 30,
1505 178, 162, 162, 162, 4, 5, 6, 7, 8, 9,
1506 10, 11, 12, 13, 14, 147, 148, 150, 162, 167,
1507 131, 131, 126, 136, 128, 40, 165, 166, 17, 18,
1508 21, 22, 23, 24, 25, 26, 61, 101, 103, 109,
1509 110, 111, 133, 142, 143, 144, 145, 146, 168, 192,
1510 193, 194, 194, 194, 194, 195, 59, 153, 162, 162,
1511 195, 162, 162, 202, 195, 195, 195, 195, 195, 162,
1512 162, 162, 195, 195, 153, 99, 100, 126, 132, 126,
1513 158, 158, 158, 25, 26, 17, 18, 141, 18, 21,
1514 22, 23, 24, 130, 133, 135, 138, 168, 193, 158,
1515 164, 164, 164, 40, 162, 181, 182, 183, 126, 129,
1516 63, 191, 128, 128, 128, 128, 128, 167, 169, 128,
1517 128, 128, 128, 128, 126, 126, 160, 126, 155, 126,
1518 155, 194, 130, 126, 126, 126, 126, 126, 126, 194,
1519 194, 194, 126, 39, 160, 162, 195, 30, 37, 57,
1520 156, 159, 132, 169, 169, 136, 169, 30, 132, 134,
1521 179, 180, 126, 129, 40, 30, 167, 167, 167, 167,
1522 167, 126, 134, 167, 167, 167, 167, 167, 15, 15,
1523 194, 10, 57, 10, 126, 207, 194, 130, 195, 162,
1524 195, 195, 195, 126, 126, 126, 195, 162, 194, 194,
1525 126, 30, 18, 158, 132, 134, 136, 40, 181, 156,
1526 157, 126, 207, 126, 126, 126, 126, 167, 126, 126,
1527 126, 126, 39, 194, 194, 128, 194, 18, 194, 195,
1528 203, 126, 194, 126, 126, 126, 194, 194, 194, 128,
1529 162, 57, 154, 30, 129, 167, 167, 167, 167, 167,
1530 167, 167, 167, 162, 126, 130, 203, 204, 126, 155,
1531 155, 126, 194, 126, 195, 195, 195, 204, 194, 18,
1532 126, 129, 126, 126, 129, 129, 129, 129, 129, 15,
1533 132, 149, 200, 129, 195, 132, 194, 129, 167, 167,
1534 167, 194, 192, 132, 149, 39, 132, 129, 129, 129,
1535 126, 192, 15, 15, 126, 194, 194, 15, 76, 194,
1536 15, 194
Reid Spencere7c3c602006-11-30 06:36:44 +00001537};
1538
1539#define yyerrok (yyerrstatus = 0)
1540#define yyclearin (yychar = YYEMPTY)
1541#define YYEMPTY (-2)
1542#define YYEOF 0
1543
1544#define YYACCEPT goto yyacceptlab
1545#define YYABORT goto yyabortlab
1546#define YYERROR goto yyerrorlab
1547
1548
1549/* Like YYERROR except do call yyerror. This remains here temporarily
1550 to ease the transition to the new meaning of YYERROR, for GCC.
1551 Once GCC version 2 has supplanted version 1, this can go. */
1552
1553#define YYFAIL goto yyerrlab
1554
1555#define YYRECOVERING() (!!yyerrstatus)
1556
1557#define YYBACKUP(Token, Value) \
1558do \
1559 if (yychar == YYEMPTY && yylen == 1) \
1560 { \
1561 yychar = (Token); \
1562 yylval = (Value); \
1563 yytoken = YYTRANSLATE (yychar); \
1564 YYPOPSTACK; \
1565 goto yybackup; \
1566 } \
1567 else \
1568 { \
1569 yyerror (YY_("syntax error: cannot back up")); \
1570 YYERROR; \
1571 } \
1572while (0)
1573
1574
1575#define YYTERROR 1
1576#define YYERRCODE 256
1577
1578
1579/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1580 If N is 0, then set CURRENT to the empty location which ends
1581 the previous symbol: RHS[0] (always defined). */
1582
1583#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1584#ifndef YYLLOC_DEFAULT
1585# define YYLLOC_DEFAULT(Current, Rhs, N) \
1586 do \
1587 if (N) \
1588 { \
1589 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1590 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1591 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1592 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1593 } \
1594 else \
1595 { \
1596 (Current).first_line = (Current).last_line = \
1597 YYRHSLOC (Rhs, 0).last_line; \
1598 (Current).first_column = (Current).last_column = \
1599 YYRHSLOC (Rhs, 0).last_column; \
1600 } \
1601 while (0)
1602#endif
1603
1604
1605/* YY_LOCATION_PRINT -- Print the location on the stream.
1606 This macro was not mandated originally: define only if we know
1607 we won't break user code: when these are the locations we know. */
1608
1609#ifndef YY_LOCATION_PRINT
1610# if YYLTYPE_IS_TRIVIAL
1611# define YY_LOCATION_PRINT(File, Loc) \
1612 fprintf (File, "%d.%d-%d.%d", \
1613 (Loc).first_line, (Loc).first_column, \
1614 (Loc).last_line, (Loc).last_column)
1615# else
1616# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1617# endif
1618#endif
1619
1620
1621/* YYLEX -- calling `yylex' with the right arguments. */
1622
1623#ifdef YYLEX_PARAM
1624# define YYLEX yylex (YYLEX_PARAM)
1625#else
1626# define YYLEX yylex ()
1627#endif
1628
1629/* Enable debugging if requested. */
1630#if YYDEBUG
1631
1632# ifndef YYFPRINTF
1633# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1634# define YYFPRINTF fprintf
1635# endif
1636
1637# define YYDPRINTF(Args) \
1638do { \
1639 if (yydebug) \
1640 YYFPRINTF Args; \
1641} while (0)
1642
1643# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1644do { \
1645 if (yydebug) \
1646 { \
1647 YYFPRINTF (stderr, "%s ", Title); \
1648 yysymprint (stderr, \
1649 Type, Value); \
1650 YYFPRINTF (stderr, "\n"); \
1651 } \
1652} while (0)
1653
1654/*------------------------------------------------------------------.
1655| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1656| TOP (included). |
1657`------------------------------------------------------------------*/
1658
1659#if defined (__STDC__) || defined (__cplusplus)
1660static void
1661yy_stack_print (short int *bottom, short int *top)
1662#else
1663static void
1664yy_stack_print (bottom, top)
1665 short int *bottom;
1666 short int *top;
1667#endif
1668{
1669 YYFPRINTF (stderr, "Stack now");
1670 for (/* Nothing. */; bottom <= top; ++bottom)
1671 YYFPRINTF (stderr, " %d", *bottom);
1672 YYFPRINTF (stderr, "\n");
1673}
1674
1675# define YY_STACK_PRINT(Bottom, Top) \
1676do { \
1677 if (yydebug) \
1678 yy_stack_print ((Bottom), (Top)); \
1679} while (0)
1680
1681
1682/*------------------------------------------------.
1683| Report that the YYRULE is going to be reduced. |
1684`------------------------------------------------*/
1685
1686#if defined (__STDC__) || defined (__cplusplus)
1687static void
1688yy_reduce_print (int yyrule)
1689#else
1690static void
1691yy_reduce_print (yyrule)
1692 int yyrule;
1693#endif
1694{
1695 int yyi;
1696 unsigned long int yylno = yyrline[yyrule];
1697 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1698 yyrule - 1, yylno);
1699 /* Print the symbols being reduced, and their result. */
1700 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1701 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1702 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1703}
1704
1705# define YY_REDUCE_PRINT(Rule) \
1706do { \
1707 if (yydebug) \
1708 yy_reduce_print (Rule); \
1709} while (0)
1710
1711/* Nonzero means print parse trace. It is left uninitialized so that
1712 multiple parsers can coexist. */
1713int yydebug;
1714#else /* !YYDEBUG */
1715# define YYDPRINTF(Args)
1716# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1717# define YY_STACK_PRINT(Bottom, Top)
1718# define YY_REDUCE_PRINT(Rule)
1719#endif /* !YYDEBUG */
1720
1721
1722/* YYINITDEPTH -- initial size of the parser's stacks. */
1723#ifndef YYINITDEPTH
1724# define YYINITDEPTH 200
1725#endif
1726
1727/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1728 if the built-in stack extension method is used).
1729
1730 Do not make this value too large; the results are undefined if
1731 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1732 evaluated with infinite-precision integer arithmetic. */
1733
1734#ifndef YYMAXDEPTH
1735# define YYMAXDEPTH 10000
1736#endif
1737
1738
1739
1740#if YYERROR_VERBOSE
1741
1742# ifndef yystrlen
1743# if defined (__GLIBC__) && defined (_STRING_H)
1744# define yystrlen strlen
1745# else
1746/* Return the length of YYSTR. */
1747static YYSIZE_T
1748# if defined (__STDC__) || defined (__cplusplus)
1749yystrlen (const char *yystr)
1750# else
1751yystrlen (yystr)
1752 const char *yystr;
1753# endif
1754{
1755 const char *yys = yystr;
1756
1757 while (*yys++ != '\0')
1758 continue;
1759
1760 return yys - yystr - 1;
1761}
1762# endif
1763# endif
1764
1765# ifndef yystpcpy
1766# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1767# define yystpcpy stpcpy
1768# else
1769/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1770 YYDEST. */
1771static char *
1772# if defined (__STDC__) || defined (__cplusplus)
1773yystpcpy (char *yydest, const char *yysrc)
1774# else
1775yystpcpy (yydest, yysrc)
1776 char *yydest;
1777 const char *yysrc;
1778# endif
1779{
1780 char *yyd = yydest;
1781 const char *yys = yysrc;
1782
1783 while ((*yyd++ = *yys++) != '\0')
1784 continue;
1785
1786 return yyd - 1;
1787}
1788# endif
1789# endif
1790
1791# ifndef yytnamerr
1792/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1793 quotes and backslashes, so that it's suitable for yyerror. The
1794 heuristic is that double-quoting is unnecessary unless the string
1795 contains an apostrophe, a comma, or backslash (other than
1796 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1797 null, do not copy; instead, return the length of what the result
1798 would have been. */
1799static YYSIZE_T
1800yytnamerr (char *yyres, const char *yystr)
1801{
1802 if (*yystr == '"')
1803 {
1804 size_t yyn = 0;
1805 char const *yyp = yystr;
1806
1807 for (;;)
1808 switch (*++yyp)
1809 {
1810 case '\'':
1811 case ',':
1812 goto do_not_strip_quotes;
1813
1814 case '\\':
1815 if (*++yyp != '\\')
1816 goto do_not_strip_quotes;
1817 /* Fall through. */
1818 default:
1819 if (yyres)
1820 yyres[yyn] = *yyp;
1821 yyn++;
1822 break;
1823
1824 case '"':
1825 if (yyres)
1826 yyres[yyn] = '\0';
1827 return yyn;
1828 }
1829 do_not_strip_quotes: ;
1830 }
1831
1832 if (! yyres)
1833 return yystrlen (yystr);
1834
1835 return yystpcpy (yyres, yystr) - yyres;
1836}
1837# endif
1838
1839#endif /* YYERROR_VERBOSE */
1840
1841
1842
1843#if YYDEBUG
1844/*--------------------------------.
1845| Print this symbol on YYOUTPUT. |
1846`--------------------------------*/
1847
1848#if defined (__STDC__) || defined (__cplusplus)
1849static void
1850yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1851#else
1852static void
1853yysymprint (yyoutput, yytype, yyvaluep)
1854 FILE *yyoutput;
1855 int yytype;
1856 YYSTYPE *yyvaluep;
1857#endif
1858{
1859 /* Pacify ``unused variable'' warnings. */
1860 (void) yyvaluep;
1861
1862 if (yytype < YYNTOKENS)
1863 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1864 else
1865 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1866
1867
1868# ifdef YYPRINT
1869 if (yytype < YYNTOKENS)
1870 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1871# endif
1872 switch (yytype)
1873 {
1874 default:
1875 break;
1876 }
1877 YYFPRINTF (yyoutput, ")");
1878}
1879
1880#endif /* ! YYDEBUG */
1881/*-----------------------------------------------.
1882| Release the memory associated to this symbol. |
1883`-----------------------------------------------*/
1884
1885#if defined (__STDC__) || defined (__cplusplus)
1886static void
1887yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1888#else
1889static void
1890yydestruct (yymsg, yytype, yyvaluep)
1891 const char *yymsg;
1892 int yytype;
1893 YYSTYPE *yyvaluep;
1894#endif
1895{
1896 /* Pacify ``unused variable'' warnings. */
1897 (void) yyvaluep;
1898
1899 if (!yymsg)
1900 yymsg = "Deleting";
1901 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1902
1903 switch (yytype)
1904 {
1905
1906 default:
1907 break;
1908 }
1909}
1910
1911
1912/* Prevent warnings from -Wmissing-prototypes. */
1913
1914#ifdef YYPARSE_PARAM
1915# if defined (__STDC__) || defined (__cplusplus)
1916int yyparse (void *YYPARSE_PARAM);
1917# else
1918int yyparse ();
1919# endif
1920#else /* ! YYPARSE_PARAM */
1921#if defined (__STDC__) || defined (__cplusplus)
1922int yyparse (void);
1923#else
1924int yyparse ();
1925#endif
1926#endif /* ! YYPARSE_PARAM */
1927
1928
1929
1930/* The look-ahead symbol. */
1931int yychar;
1932
1933/* The semantic value of the look-ahead symbol. */
1934YYSTYPE yylval;
1935
1936/* Number of syntax errors so far. */
1937int yynerrs;
1938
1939
1940
1941/*----------.
1942| yyparse. |
1943`----------*/
1944
1945#ifdef YYPARSE_PARAM
1946# if defined (__STDC__) || defined (__cplusplus)
1947int yyparse (void *YYPARSE_PARAM)
1948# else
1949int yyparse (YYPARSE_PARAM)
1950 void *YYPARSE_PARAM;
1951# endif
1952#else /* ! YYPARSE_PARAM */
1953#if defined (__STDC__) || defined (__cplusplus)
1954int
1955yyparse (void)
1956#else
1957int
1958yyparse ()
1959
1960#endif
1961#endif
1962{
1963
1964 int yystate;
1965 int yyn;
1966 int yyresult;
1967 /* Number of tokens to shift before error messages enabled. */
1968 int yyerrstatus;
1969 /* Look-ahead token as an internal (translated) token number. */
1970 int yytoken = 0;
1971
1972 /* Three stacks and their tools:
1973 `yyss': related to states,
1974 `yyvs': related to semantic values,
1975 `yyls': related to locations.
1976
1977 Refer to the stacks thru separate pointers, to allow yyoverflow
1978 to reallocate them elsewhere. */
1979
1980 /* The state stack. */
1981 short int yyssa[YYINITDEPTH];
1982 short int *yyss = yyssa;
1983 short int *yyssp;
1984
1985 /* The semantic value stack. */
1986 YYSTYPE yyvsa[YYINITDEPTH];
1987 YYSTYPE *yyvs = yyvsa;
1988 YYSTYPE *yyvsp;
1989
1990
1991
1992#define YYPOPSTACK (yyvsp--, yyssp--)
1993
1994 YYSIZE_T yystacksize = YYINITDEPTH;
1995
1996 /* The variables used to return semantic value and location from the
1997 action routines. */
1998 YYSTYPE yyval;
1999
2000
2001 /* When reducing, the number of symbols on the RHS of the reduced
2002 rule. */
2003 int yylen;
2004
2005 YYDPRINTF ((stderr, "Starting parse\n"));
2006
2007 yystate = 0;
2008 yyerrstatus = 0;
2009 yynerrs = 0;
2010 yychar = YYEMPTY; /* Cause a token to be read. */
2011
2012 /* Initialize stack pointers.
2013 Waste one element of value and location stack
2014 so that they stay on the same level as the state stack.
2015 The wasted elements are never initialized. */
2016
2017 yyssp = yyss;
2018 yyvsp = yyvs;
2019
2020 goto yysetstate;
2021
2022/*------------------------------------------------------------.
2023| yynewstate -- Push a new state, which is found in yystate. |
2024`------------------------------------------------------------*/
2025 yynewstate:
2026 /* In all cases, when you get here, the value and location stacks
2027 have just been pushed. so pushing a state here evens the stacks.
2028 */
2029 yyssp++;
2030
2031 yysetstate:
2032 *yyssp = yystate;
2033
2034 if (yyss + yystacksize - 1 <= yyssp)
2035 {
2036 /* Get the current used size of the three stacks, in elements. */
2037 YYSIZE_T yysize = yyssp - yyss + 1;
2038
2039#ifdef yyoverflow
2040 {
2041 /* Give user a chance to reallocate the stack. Use copies of
2042 these so that the &'s don't force the real ones into
2043 memory. */
2044 YYSTYPE *yyvs1 = yyvs;
2045 short int *yyss1 = yyss;
2046
2047
2048 /* Each stack pointer address is followed by the size of the
2049 data in use in that stack, in bytes. This used to be a
2050 conditional around just the two extra args, but that might
2051 be undefined if yyoverflow is a macro. */
2052 yyoverflow (YY_("memory exhausted"),
2053 &yyss1, yysize * sizeof (*yyssp),
2054 &yyvs1, yysize * sizeof (*yyvsp),
2055
2056 &yystacksize);
2057
2058 yyss = yyss1;
2059 yyvs = yyvs1;
2060 }
2061#else /* no yyoverflow */
2062# ifndef YYSTACK_RELOCATE
2063 goto yyexhaustedlab;
2064# else
2065 /* Extend the stack our own way. */
2066 if (YYMAXDEPTH <= yystacksize)
2067 goto yyexhaustedlab;
2068 yystacksize *= 2;
2069 if (YYMAXDEPTH < yystacksize)
2070 yystacksize = YYMAXDEPTH;
2071
2072 {
2073 short int *yyss1 = yyss;
2074 union yyalloc *yyptr =
2075 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2076 if (! yyptr)
2077 goto yyexhaustedlab;
2078 YYSTACK_RELOCATE (yyss);
2079 YYSTACK_RELOCATE (yyvs);
2080
2081# undef YYSTACK_RELOCATE
2082 if (yyss1 != yyssa)
2083 YYSTACK_FREE (yyss1);
2084 }
2085# endif
2086#endif /* no yyoverflow */
2087
2088 yyssp = yyss + yysize - 1;
2089 yyvsp = yyvs + yysize - 1;
2090
2091
2092 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2093 (unsigned long int) yystacksize));
2094
2095 if (yyss + yystacksize - 1 <= yyssp)
2096 YYABORT;
2097 }
2098
2099 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2100
2101 goto yybackup;
2102
2103/*-----------.
2104| yybackup. |
2105`-----------*/
2106yybackup:
2107
2108/* Do appropriate processing given the current state. */
2109/* Read a look-ahead token if we need one and don't already have one. */
2110/* yyresume: */
2111
2112 /* First try to decide what to do without reference to look-ahead token. */
2113
2114 yyn = yypact[yystate];
2115 if (yyn == YYPACT_NINF)
2116 goto yydefault;
2117
2118 /* Not known => get a look-ahead token if don't already have one. */
2119
2120 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2121 if (yychar == YYEMPTY)
2122 {
2123 YYDPRINTF ((stderr, "Reading a token: "));
2124 yychar = YYLEX;
2125 }
2126
2127 if (yychar <= YYEOF)
2128 {
2129 yychar = yytoken = YYEOF;
2130 YYDPRINTF ((stderr, "Now at end of input.\n"));
2131 }
2132 else
2133 {
2134 yytoken = YYTRANSLATE (yychar);
2135 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2136 }
2137
2138 /* If the proper action on seeing token YYTOKEN is to reduce or to
2139 detect an error, take that action. */
2140 yyn += yytoken;
2141 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2142 goto yydefault;
2143 yyn = yytable[yyn];
2144 if (yyn <= 0)
2145 {
2146 if (yyn == 0 || yyn == YYTABLE_NINF)
2147 goto yyerrlab;
2148 yyn = -yyn;
2149 goto yyreduce;
2150 }
2151
2152 if (yyn == YYFINAL)
2153 YYACCEPT;
2154
2155 /* Shift the look-ahead token. */
2156 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2157
2158 /* Discard the token being shifted unless it is eof. */
2159 if (yychar != YYEOF)
2160 yychar = YYEMPTY;
2161
2162 *++yyvsp = yylval;
2163
2164
2165 /* Count tokens shifted since error; after three, turn off error
2166 status. */
2167 if (yyerrstatus)
2168 yyerrstatus--;
2169
2170 yystate = yyn;
2171 goto yynewstate;
2172
2173
2174/*-----------------------------------------------------------.
2175| yydefault -- do the default action for the current state. |
2176`-----------------------------------------------------------*/
2177yydefault:
2178 yyn = yydefact[yystate];
2179 if (yyn == 0)
2180 goto yyerrlab;
2181 goto yyreduce;
2182
2183
2184/*-----------------------------.
2185| yyreduce -- Do a reduction. |
2186`-----------------------------*/
2187yyreduce:
2188 /* yyn is the number of a rule to reduce with. */
2189 yylen = yyr2[yyn];
2190
2191 /* If YYLEN is nonzero, implement the default value of the action:
2192 `$$ = $1'.
2193
2194 Otherwise, the following line sets YYVAL to garbage.
2195 This behavior is undocumented and Bison
2196 users should not rely upon it. Assigning to YYVAL
2197 unconditionally makes the parser a bit smaller, and it avoids a
2198 GCC warning that YYVAL may be used uninitialized. */
2199 yyval = yyvsp[1-yylen];
2200
2201
2202 YY_REDUCE_PRINT (yyn);
2203 switch (yyn)
2204 {
Reid Spencerfcb5df82006-12-01 22:34:43 +00002205 case 53:
Reid Spencerf459d392006-12-02 16:19:52 +00002206#line 292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002207 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002208 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002209 ;}
2210 break;
2211
Reid Spencerfcb5df82006-12-01 22:34:43 +00002212 case 54:
Reid Spencerf459d392006-12-02 16:19:52 +00002213#line 295 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002214 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002215 (yyval.String) = new std::string("");
Reid Spencere7c3c602006-11-30 06:36:44 +00002216 ;}
2217 break;
2218
Reid Spencerfcb5df82006-12-01 22:34:43 +00002219 case 62:
Reid Spencerf459d392006-12-02 16:19:52 +00002220#line 302 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002221 { (yyval.String) = new std::string(""); ;}
2222 break;
2223
Reid Spencerfcb5df82006-12-01 22:34:43 +00002224 case 69:
Reid Spencerf459d392006-12-02 16:19:52 +00002225#line 307 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002226 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002227 *(yyvsp[-1].String) += *(yyvsp[0].String);
2228 delete (yyvsp[0].String);
Reid Spencer16244f42006-12-01 21:10:07 +00002229 (yyval.String) = (yyvsp[-1].String);
2230 ;}
2231 break;
2232
Reid Spencerfcb5df82006-12-01 22:34:43 +00002233 case 70:
Reid Spencerf459d392006-12-02 16:19:52 +00002234#line 312 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002235 { (yyval.String) = new std::string(""); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002236 break;
2237
Reid Spencerfcb5df82006-12-01 22:34:43 +00002238 case 71:
Reid Spencerf459d392006-12-02 16:19:52 +00002239#line 317 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002240 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002241 break;
2242
Reid Spencerfcb5df82006-12-01 22:34:43 +00002243 case 72:
Reid Spencerf459d392006-12-02 16:19:52 +00002244#line 318 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002245 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2246 break;
2247
2248 case 73:
Reid Spencerf459d392006-12-02 16:19:52 +00002249#line 321 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002250 { (yyval.String) = new std::string(); ;}
2251 break;
2252
2253 case 74:
Reid Spencerf459d392006-12-02 16:19:52 +00002254#line 322 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002255 {
2256 (yyvsp[-1].String)->insert(0, ", ");
Reid Spencerf2d55322006-12-01 21:52:30 +00002257 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2258 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002259 (yyval.String) = (yyvsp[-1].String);
2260 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002261 break;
2262
Reid Spencerfcb5df82006-12-01 22:34:43 +00002263 case 75:
Reid Spencerf459d392006-12-02 16:19:52 +00002264#line 330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002265 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002266 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2267 delete (yyvsp[0].String);
2268 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002269 ;}
2270 break;
2271
Reid Spencerfcb5df82006-12-01 22:34:43 +00002272 case 76:
Reid Spencerf459d392006-12-02 16:19:52 +00002273#line 336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002274 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002275 break;
2276
Reid Spencerfcb5df82006-12-01 22:34:43 +00002277 case 78:
Reid Spencerf459d392006-12-02 16:19:52 +00002278#line 340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002279 { (yyval.String) = new std::string(); ;}
2280 break;
2281
2282 case 79:
Reid Spencerf459d392006-12-02 16:19:52 +00002283#line 341 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002284 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002285 (yyvsp[-1].String)->insert(0, ", ");
2286 if (!(yyvsp[0].String)->empty())
2287 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2288 delete (yyvsp[0].String);
2289 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002290 ;}
2291 break;
2292
Reid Spencerfcb5df82006-12-01 22:34:43 +00002293 case 81:
Reid Spencerf459d392006-12-02 16:19:52 +00002294#line 351 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002295 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002296 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2297 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002298 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002299 ;}
2300 break;
2301
Reid Spencera50d5962006-12-02 04:11:07 +00002302 case 99:
Reid Spencerf459d392006-12-02 16:19:52 +00002303#line 373 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002304 {
Reid Spencera50d5962006-12-02 04:11:07 +00002305 (yyval.Type).newTy = (yyvsp[0].String);
2306 (yyval.Type).oldTy = OpaqueTy;
2307 ;}
2308 break;
2309
2310 case 100:
Reid Spencerf459d392006-12-02 16:19:52 +00002311#line 377 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002312 {
2313 (yyval.Type).newTy = (yyvsp[0].String);
2314 (yyval.Type).oldTy = UnresolvedTy;
2315 ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00002316 break;
2317
Reid Spencerfcb5df82006-12-01 22:34:43 +00002318 case 102:
Reid Spencerf459d392006-12-02 16:19:52 +00002319#line 386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002320 { // Type UpReference
Reid Spencerf2d55322006-12-01 21:52:30 +00002321 (yyvsp[0].String)->insert(0, "\\");
2322 (yyval.Type).newTy = (yyvsp[0].String);
Reid Spencera50d5962006-12-02 04:11:07 +00002323 (yyval.Type).oldTy = NumericTy;
Reid Spencere77e35e2006-12-01 20:26:20 +00002324 ;}
2325 break;
2326
Reid Spencerfcb5df82006-12-01 22:34:43 +00002327 case 103:
Reid Spencerf459d392006-12-02 16:19:52 +00002328#line 391 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002329 { // Function derived type?
2330 *(yyvsp[-3].Type).newTy += "( " + *(yyvsp[-1].String) + " )";
2331 delete (yyvsp[-1].String);
2332 (yyval.Type).newTy = (yyvsp[-3].Type).newTy;
2333 (yyval.Type).oldTy = FunctionTy;
2334 ;}
2335 break;
2336
Reid Spencerfcb5df82006-12-01 22:34:43 +00002337 case 104:
Reid Spencerf459d392006-12-02 16:19:52 +00002338#line 397 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002339 { // Sized array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002340 (yyvsp[-3].String)->insert(0,"[ ");
2341 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " ]";
Reid Spencere77e35e2006-12-01 20:26:20 +00002342 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002343 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002344 (yyval.Type).oldTy = ArrayTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002345 ;}
2346 break;
2347
Reid Spencerfcb5df82006-12-01 22:34:43 +00002348 case 105:
Reid Spencerf459d392006-12-02 16:19:52 +00002349#line 404 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002350 { // Packed array type?
Reid Spencerf2d55322006-12-01 21:52:30 +00002351 (yyvsp[-3].String)->insert(0,"< ");
2352 *(yyvsp[-3].String) += " x " + *(yyvsp[-1].Type).newTy + " >";
Reid Spencere77e35e2006-12-01 20:26:20 +00002353 delete (yyvsp[-1].Type).newTy;
Reid Spencerf2d55322006-12-01 21:52:30 +00002354 (yyval.Type).newTy = (yyvsp[-3].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002355 (yyval.Type).oldTy = PackedTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002356 ;}
2357 break;
2358
Reid Spencerfcb5df82006-12-01 22:34:43 +00002359 case 106:
Reid Spencerf459d392006-12-02 16:19:52 +00002360#line 411 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002361 { // Structure type?
2362 (yyvsp[-1].String)->insert(0, "{ ");
2363 *(yyvsp[-1].String) += " }";
2364 (yyval.Type).newTy = (yyvsp[-1].String);
2365 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002366 ;}
2367 break;
2368
Reid Spencerfcb5df82006-12-01 22:34:43 +00002369 case 107:
Reid Spencerf459d392006-12-02 16:19:52 +00002370#line 417 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002371 { // Empty structure type?
Reid Spencer0b7e5072006-12-01 22:42:01 +00002372 (yyval.Type).newTy = new std::string("{}");
Reid Spencere77e35e2006-12-01 20:26:20 +00002373 (yyval.Type).oldTy = StructTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002374 ;}
2375 break;
2376
Reid Spencerfcb5df82006-12-01 22:34:43 +00002377 case 108:
Reid Spencerf459d392006-12-02 16:19:52 +00002378#line 421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002379 { // Pointer type?
2380 *(yyvsp[-1].Type).newTy += '*';
2381 (yyvsp[-1].Type).oldTy = PointerTy;
2382 (yyval.Type) = (yyvsp[-1].Type);
Reid Spencere7c3c602006-11-30 06:36:44 +00002383 ;}
2384 break;
2385
Reid Spencerfcb5df82006-12-01 22:34:43 +00002386 case 109:
Reid Spencerf459d392006-12-02 16:19:52 +00002387#line 431 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002388 {
2389 (yyval.String) = (yyvsp[0].Type).newTy;
Reid Spencere7c3c602006-11-30 06:36:44 +00002390 ;}
2391 break;
2392
Reid Spencerfcb5df82006-12-01 22:34:43 +00002393 case 110:
Reid Spencerf459d392006-12-02 16:19:52 +00002394#line 434 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002395 {
2396 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Type).newTy;
2397 delete (yyvsp[0].Type).newTy;
2398 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002399 ;}
2400 break;
2401
Reid Spencerfcb5df82006-12-01 22:34:43 +00002402 case 112:
Reid Spencerf459d392006-12-02 16:19:52 +00002403#line 443 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002404 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002405 *(yyvsp[-2].String) += ", ...";
2406 delete (yyvsp[0].String);
2407 (yyval.String) = (yyvsp[-2].String);
2408 ;}
2409 break;
2410
Reid Spencerfcb5df82006-12-01 22:34:43 +00002411 case 113:
Reid Spencerf459d392006-12-02 16:19:52 +00002412#line 448 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002413 {
2414 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002415 ;}
2416 break;
2417
Reid Spencerfcb5df82006-12-01 22:34:43 +00002418 case 114:
Reid Spencerf459d392006-12-02 16:19:52 +00002419#line 451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002420 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002421 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00002422 ;}
2423 break;
2424
Reid Spencerfcb5df82006-12-01 22:34:43 +00002425 case 115:
Reid Spencerf459d392006-12-02 16:19:52 +00002426#line 461 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002427 { // Nonempty unsized arr
2428 (yyval.Const).type = (yyvsp[-3].Type);
2429 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2430 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
2431 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002432 ;}
2433 break;
2434
Reid Spencerfcb5df82006-12-01 22:34:43 +00002435 case 116:
Reid Spencerf459d392006-12-02 16:19:52 +00002436#line 467 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002437 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002438 (yyval.Const).type = (yyvsp[-2].Type);
2439 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2440 *(yyval.Const).cnst += "[ ]";
Reid Spencere7c3c602006-11-30 06:36:44 +00002441 ;}
2442 break;
2443
Reid Spencerfcb5df82006-12-01 22:34:43 +00002444 case 117:
Reid Spencerf459d392006-12-02 16:19:52 +00002445#line 472 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002446 {
2447 (yyval.Const).type = (yyvsp[-2].Type);
2448 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
2449 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
2450 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002451 ;}
2452 break;
2453
Reid Spencerfcb5df82006-12-01 22:34:43 +00002454 case 118:
Reid Spencerf459d392006-12-02 16:19:52 +00002455#line 478 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002456 { // Nonempty unsized arr
2457 (yyval.Const).type = (yyvsp[-3].Type);
2458 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2459 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
2460 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002461 ;}
2462 break;
2463
Reid Spencerfcb5df82006-12-01 22:34:43 +00002464 case 119:
Reid Spencerf459d392006-12-02 16:19:52 +00002465#line 484 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002466 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002467 (yyval.Const).type = (yyvsp[-3].Type);
2468 (yyval.Const).cnst = new std::string(*(yyvsp[-3].Type).newTy);
2469 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
2470 delete (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002471 ;}
2472 break;
2473
Reid Spencerfcb5df82006-12-01 22:34:43 +00002474 case 120:
Reid Spencerf459d392006-12-02 16:19:52 +00002475#line 490 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002476 {
2477 (yyval.Const).type = (yyvsp[-2].Type);
2478 (yyval.Const).cnst = new std::string(*(yyvsp[-2].Type).newTy);
Reid Spencer0b7e5072006-12-01 22:42:01 +00002479 *(yyval.Const).cnst += " {}";
Reid Spencere7c3c602006-11-30 06:36:44 +00002480 ;}
2481 break;
2482
Reid Spencerfcb5df82006-12-01 22:34:43 +00002483 case 121:
Reid Spencerf459d392006-12-02 16:19:52 +00002484#line 495 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002485 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002486 (yyval.Const).type = (yyvsp[-1].Type);
2487 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002488 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2489 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002490 ;}
2491 break;
2492
Reid Spencerfcb5df82006-12-01 22:34:43 +00002493 case 122:
Reid Spencerf459d392006-12-02 16:19:52 +00002494#line 501 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002495 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002496 (yyval.Const).type = (yyvsp[-1].Type);
2497 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002498 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2499 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002500 ;}
2501 break;
2502
Reid Spencerfcb5df82006-12-01 22:34:43 +00002503 case 123:
Reid Spencerf459d392006-12-02 16:19:52 +00002504#line 507 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002505 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002506 (yyval.Const).type = (yyvsp[-1].Type);
2507 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2508 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2509 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002510 ;}
2511 break;
2512
Reid Spencerfcb5df82006-12-01 22:34:43 +00002513 case 124:
Reid Spencerf459d392006-12-02 16:19:52 +00002514#line 513 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002515 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002516 (yyval.Const).type = (yyvsp[-1].Type);
2517 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
2518 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2519 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002520 ;}
2521 break;
2522
Reid Spencerfcb5df82006-12-01 22:34:43 +00002523 case 125:
Reid Spencerf459d392006-12-02 16:19:52 +00002524#line 519 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002525 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002526 (yyval.Const).type = (yyvsp[-1].Type);
2527 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002528 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2529 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002530 ;}
2531 break;
2532
Reid Spencerfcb5df82006-12-01 22:34:43 +00002533 case 126:
Reid Spencerf459d392006-12-02 16:19:52 +00002534#line 525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002535 { // integral constants
2536 (yyval.Const).type = (yyvsp[-1].Type);
2537 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002538 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2539 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002540 ;}
2541 break;
2542
Reid Spencerfcb5df82006-12-01 22:34:43 +00002543 case 127:
Reid Spencerf459d392006-12-02 16:19:52 +00002544#line 531 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002545 { // integral constants
2546 (yyval.Const).type = (yyvsp[-1].Type);
2547 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002548 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2549 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002550 ;}
2551 break;
2552
Reid Spencerfcb5df82006-12-01 22:34:43 +00002553 case 128:
Reid Spencerf459d392006-12-02 16:19:52 +00002554#line 537 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002555 { // Boolean constants
2556 (yyval.Const).type = (yyvsp[-1].Type);
2557 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002558 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2559 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002560 ;}
2561 break;
2562
Reid Spencerfcb5df82006-12-01 22:34:43 +00002563 case 129:
Reid Spencerf459d392006-12-02 16:19:52 +00002564#line 543 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002565 { // Boolean constants
2566 (yyval.Const).type = (yyvsp[-1].Type);
2567 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002568 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2569 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002570 ;}
2571 break;
2572
Reid Spencerfcb5df82006-12-01 22:34:43 +00002573 case 130:
Reid Spencerf459d392006-12-02 16:19:52 +00002574#line 549 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002575 { // Float & Double constants
2576 (yyval.Const).type = (yyvsp[-1].Type);
2577 (yyval.Const).cnst = new std::string(*(yyvsp[-1].Type).newTy);
Reid Spencerf2d55322006-12-01 21:52:30 +00002578 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
2579 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002580 ;}
2581 break;
2582
Reid Spencerfcb5df82006-12-01 22:34:43 +00002583 case 131:
Reid Spencerf459d392006-12-02 16:19:52 +00002584#line 557 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002585 {
Reid Spencer280d8012006-12-01 23:40:53 +00002586 std::string source = *(yyvsp[-3].Const).cnst;
Reid Spencera50d5962006-12-02 04:11:07 +00002587 TypeInfo DstTy = (yyvsp[-1].Type);
2588 ResolveType(DstTy);
Reid Spencer280d8012006-12-01 23:40:53 +00002589 if (*(yyvsp[-5].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00002590 // Call getCastUpgrade to upgrade the old cast
2591 (yyval.String) = new std::string(getCastUpgrade(source, (yyvsp[-3].Const).type, (yyvsp[-1].Type), true));
2592 } else {
2593 // Nothing to upgrade, just create the cast constant expr
2594 (yyval.String) = new std::string(*(yyvsp[-5].String));
2595 *(yyval.String) += "( " + source + " to " + *(yyvsp[-1].Type).newTy + ")";
Reid Spencer280d8012006-12-01 23:40:53 +00002596 }
Reid Spencere77e35e2006-12-01 20:26:20 +00002597 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002598 ;}
2599 break;
2600
Reid Spencerfcb5df82006-12-01 22:34:43 +00002601 case 132:
Reid Spencerf459d392006-12-02 16:19:52 +00002602#line 571 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002603 {
Reid Spencerf8483652006-12-02 15:16:01 +00002604 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
2605 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
2606 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
2607 *(yyvsp[-4].String) += ", " + *VI.val;
2608 VI.destroy();
2609 }
2610 *(yyvsp[-4].String) += ")";
Reid Spencere77e35e2006-12-01 20:26:20 +00002611 (yyval.String) = (yyvsp[-4].String);
2612 (yyvsp[-2].Const).destroy();
Reid Spencerf8483652006-12-02 15:16:01 +00002613 delete (yyvsp[-1].ValList);
Reid Spencere7c3c602006-11-30 06:36:44 +00002614 ;}
2615 break;
2616
Reid Spencerfcb5df82006-12-01 22:34:43 +00002617 case 133:
Reid Spencerf459d392006-12-02 16:19:52 +00002618#line 583 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002619 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002620 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2621 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2622 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002623 ;}
2624 break;
2625
Reid Spencerfcb5df82006-12-01 22:34:43 +00002626 case 134:
Reid Spencerf459d392006-12-02 16:19:52 +00002627#line 588 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002628 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002629 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2630 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2631 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002632 ;}
2633 break;
2634
Reid Spencerfcb5df82006-12-01 22:34:43 +00002635 case 135:
Reid Spencerf459d392006-12-02 16:19:52 +00002636#line 593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002637 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002638 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2639 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2640 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002641 ;}
2642 break;
2643
Reid Spencerfcb5df82006-12-01 22:34:43 +00002644 case 136:
Reid Spencerf459d392006-12-02 16:19:52 +00002645#line 598 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002646 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002647 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2648 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2649 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002650 ;}
2651 break;
2652
Reid Spencerfcb5df82006-12-01 22:34:43 +00002653 case 137:
Reid Spencerf459d392006-12-02 16:19:52 +00002654#line 603 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002655 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002656 const char* shiftop = (yyvsp[-5].String)->c_str();
2657 if (*(yyvsp[-5].String) == "shr")
2658 shiftop = ((yyvsp[-3].Const).type.isUnsigned()) ? "lshr" : "ashr";
2659 (yyval.String) = new std::string(shiftop);
2660 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2661 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00002662 ;}
2663 break;
2664
Reid Spencerfcb5df82006-12-01 22:34:43 +00002665 case 138:
Reid Spencerf459d392006-12-02 16:19:52 +00002666#line 611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002667 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002668 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2669 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2670 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002671 ;}
2672 break;
2673
Reid Spencerfcb5df82006-12-01 22:34:43 +00002674 case 139:
Reid Spencerf459d392006-12-02 16:19:52 +00002675#line 616 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002676 {
2677 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2678 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2679 (yyval.String) = (yyvsp[-7].String);
2680 ;}
2681 break;
2682
Reid Spencerfcb5df82006-12-01 22:34:43 +00002683 case 140:
Reid Spencerf459d392006-12-02 16:19:52 +00002684#line 621 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00002685 {
2686 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
2687 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
2688 (yyval.String) = (yyvsp[-7].String);
2689 ;}
2690 break;
2691
Reid Spencerfcb5df82006-12-01 22:34:43 +00002692 case 141:
Reid Spencerf459d392006-12-02 16:19:52 +00002693#line 631 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002694 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002695 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
2696 (yyvsp[0].Const).destroy();
2697 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002698 ;}
2699 break;
2700
Reid Spencerfcb5df82006-12-01 22:34:43 +00002701 case 142:
Reid Spencerf459d392006-12-02 16:19:52 +00002702#line 636 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002703 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002704 break;
2705
Reid Spencerfcb5df82006-12-01 22:34:43 +00002706 case 145:
Reid Spencerf459d392006-12-02 16:19:52 +00002707#line 651 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002708 {
2709;}
2710 break;
2711
Reid Spencerfcb5df82006-12-01 22:34:43 +00002712 case 146:
Reid Spencerf459d392006-12-02 16:19:52 +00002713#line 656 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002714 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002715 (yyval.String) = 0;
2716 ;}
2717 break;
2718
Reid Spencerfcb5df82006-12-01 22:34:43 +00002719 case 147:
Reid Spencerf459d392006-12-02 16:19:52 +00002720#line 659 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002721 {
2722 *O << *(yyvsp[0].String) << "\n";
2723 delete (yyvsp[0].String);
2724 (yyval.String) = 0;
2725 ;}
2726 break;
2727
Reid Spencerfcb5df82006-12-01 22:34:43 +00002728 case 148:
Reid Spencerf459d392006-12-02 16:19:52 +00002729#line 664 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002730 {
2731 *O << "module asm " << " " << *(yyvsp[0].String) << "\n";
Reid Spencerd154b572006-12-01 20:36:40 +00002732 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002733 ;}
2734 break;
2735
Reid Spencerfcb5df82006-12-01 22:34:43 +00002736 case 149:
Reid Spencerf459d392006-12-02 16:19:52 +00002737#line 668 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002738 {
Reid Spencerd154b572006-12-01 20:36:40 +00002739 *O << "implementation\n";
2740 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002741 ;}
2742 break;
2743
Reid Spencera50d5962006-12-02 04:11:07 +00002744 case 150:
Reid Spencerf459d392006-12-02 16:19:52 +00002745#line 672 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencera50d5962006-12-02 04:11:07 +00002746 { (yyval.String) = 0; ;}
2747 break;
2748
Reid Spencerfcb5df82006-12-01 22:34:43 +00002749 case 151:
Reid Spencerf459d392006-12-02 16:19:52 +00002750#line 675 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002751 {
Reid Spencera50d5962006-12-02 04:11:07 +00002752 EnumeratedTypes.push_back((yyvsp[0].Type));
2753 if (!(yyvsp[-2].String)->empty()) {
2754 NamedTypes[*(yyvsp[-2].String)].newTy = new std::string(*(yyvsp[0].Type).newTy);
2755 NamedTypes[*(yyvsp[-2].String)].oldTy = (yyvsp[0].Type).oldTy;
2756 *O << *(yyvsp[-2].String) << " = ";
2757 }
2758 *O << "type " << *(yyvsp[0].Type).newTy << "\n";
2759 delete (yyvsp[-2].String); delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00002760 (yyval.String) = 0;
2761 ;}
2762 break;
2763
Reid Spencerfcb5df82006-12-01 22:34:43 +00002764 case 152:
Reid Spencerf459d392006-12-02 16:19:52 +00002765#line 686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002766 { // Function prototypes can be in const pool
2767 *O << *(yyvsp[0].String) << "\n";
2768 delete (yyvsp[0].String);
2769 (yyval.String) = 0;
2770 ;}
2771 break;
2772
Reid Spencerfcb5df82006-12-01 22:34:43 +00002773 case 153:
Reid Spencerf459d392006-12-02 16:19:52 +00002774#line 691 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002775 { // Asm blocks can be in the const pool
2776 *O << *(yyvsp[-2].String) << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
2777 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
2778 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002779 ;}
2780 break;
2781
Reid Spencerfcb5df82006-12-01 22:34:43 +00002782 case 154:
Reid Spencerf459d392006-12-02 16:19:52 +00002783#line 696 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002784 {
Reid Spencera50d5962006-12-02 04:11:07 +00002785 if (!(yyvsp[-4].String)->empty())
2786 *O << *(yyvsp[-4].String) << " = ";
2787 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Const).cnst << " " << *(yyvsp[0].String) << "\n";
Reid Spencere77e35e2006-12-01 20:26:20 +00002788 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Const).destroy(); delete (yyvsp[0].String);
2789 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002790 ;}
2791 break;
2792
Reid Spencerfcb5df82006-12-01 22:34:43 +00002793 case 155:
Reid Spencerf459d392006-12-02 16:19:52 +00002794#line 703 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002795 {
Reid Spencera50d5962006-12-02 04:11:07 +00002796 if (!(yyvsp[-4].String)->empty())
2797 *O << *(yyvsp[-4].String) << " = ";
2798 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencere77e35e2006-12-01 20:26:20 +00002799 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
2800 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002801 ;}
2802 break;
2803
Reid Spencerfcb5df82006-12-01 22:34:43 +00002804 case 156:
Reid Spencerf459d392006-12-02 16:19:52 +00002805#line 710 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00002806 {
Reid Spencera50d5962006-12-02 04:11:07 +00002807 if (!(yyvsp[-4].String)->empty())
2808 *O << *(yyvsp[-4].String) << " = ";
2809 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencerf7bde222006-12-01 22:26:37 +00002810 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
2811 (yyval.String) = 0;
2812 ;}
2813 break;
2814
Reid Spencerfcb5df82006-12-01 22:34:43 +00002815 case 157:
Reid Spencerf459d392006-12-02 16:19:52 +00002816#line 717 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00002817 {
Reid Spencera50d5962006-12-02 04:11:07 +00002818 if (!(yyvsp[-4].String)->empty())
2819 *O << *(yyvsp[-4].String) << " = ";
2820 *O << *(yyvsp[-3].String) << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].String) << "\n";
Reid Spencerfcb5df82006-12-01 22:34:43 +00002821 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
2822 (yyval.String) = 0;
2823 ;}
2824 break;
2825
2826 case 158:
Reid Spencerf459d392006-12-02 16:19:52 +00002827#line 724 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002828 {
2829 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
2830 delete (yyvsp[-1].String); delete (yyvsp[0].String);
2831 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002832 ;}
2833 break;
2834
Reid Spencerfcb5df82006-12-01 22:34:43 +00002835 case 159:
Reid Spencerf459d392006-12-02 16:19:52 +00002836#line 729 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002837 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002838 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << "\n";
2839 delete (yyvsp[-2].String); delete (yyvsp[0].String);
2840 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002841 ;}
2842 break;
2843
Reid Spencerfcb5df82006-12-01 22:34:43 +00002844 case 160:
Reid Spencerf459d392006-12-02 16:19:52 +00002845#line 734 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002846 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002847 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00002848 ;}
2849 break;
2850
Reid Spencerfcb5df82006-12-01 22:34:43 +00002851 case 164:
Reid Spencerf459d392006-12-02 16:19:52 +00002852#line 744 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002853 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002854 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
2855 delete (yyvsp[0].String);
2856 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002857 ;}
2858 break;
2859
Reid Spencerfcb5df82006-12-01 22:34:43 +00002860 case 165:
Reid Spencerf459d392006-12-02 16:19:52 +00002861#line 749 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002862 {
Reid Spencerf2d55322006-12-01 21:52:30 +00002863 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
2864 if (*(yyvsp[0].String) == "64")
Reid Spencere77e35e2006-12-01 20:26:20 +00002865 SizeOfPointer = 64;
Reid Spencerf2d55322006-12-01 21:52:30 +00002866 delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00002867 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002868 ;}
2869 break;
2870
Reid Spencerfcb5df82006-12-01 22:34:43 +00002871 case 166:
Reid Spencerf459d392006-12-02 16:19:52 +00002872#line 756 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencer16244f42006-12-01 21:10:07 +00002873 {
2874 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
2875 delete (yyvsp[0].String);
2876 (yyval.String) = (yyvsp[-2].String);
2877 ;}
2878 break;
2879
Reid Spencerfcb5df82006-12-01 22:34:43 +00002880 case 167:
Reid Spencerf459d392006-12-02 16:19:52 +00002881#line 761 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00002882 {
2883 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
2884 delete (yyvsp[0].String);
2885 (yyval.String) = (yyvsp[-2].String);
2886 ;}
2887 break;
2888
Reid Spencerfcb5df82006-12-01 22:34:43 +00002889 case 168:
Reid Spencerf459d392006-12-02 16:19:52 +00002890#line 768 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002891 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002892 (yyvsp[-1].String)->insert(0, "[ ");
2893 *(yyvsp[-1].String) += " ]";
2894 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002895 ;}
2896 break;
2897
Reid Spencerfcb5df82006-12-01 22:34:43 +00002898 case 169:
Reid Spencerf459d392006-12-02 16:19:52 +00002899#line 775 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002900 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002901 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
2902 delete (yyvsp[0].String);
2903 (yyval.String) = (yyvsp[-2].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002904 ;}
2905 break;
2906
Reid Spencerfcb5df82006-12-01 22:34:43 +00002907 case 171:
Reid Spencerf459d392006-12-02 16:19:52 +00002908#line 781 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002909 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002910 (yyval.String) = new std::string();
Reid Spencere7c3c602006-11-30 06:36:44 +00002911 ;}
2912 break;
2913
Reid Spencerfcb5df82006-12-01 22:34:43 +00002914 case 175:
Reid Spencerf459d392006-12-02 16:19:52 +00002915#line 790 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002916 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002917 break;
2918
Reid Spencerfcb5df82006-12-01 22:34:43 +00002919 case 176:
Reid Spencerf459d392006-12-02 16:19:52 +00002920#line 792 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002921 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002922 (yyval.String) = (yyvsp[-1].Type).newTy;
2923 if (!(yyvsp[0].String)->empty())
2924 *(yyval.String) += " " + *(yyvsp[0].String);
2925 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002926;}
2927 break;
2928
Reid Spencerfcb5df82006-12-01 22:34:43 +00002929 case 177:
Reid Spencerf459d392006-12-02 16:19:52 +00002930#line 799 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002931 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002932 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
2933 delete (yyvsp[0].String);
2934 ;}
2935 break;
2936
Reid Spencerfcb5df82006-12-01 22:34:43 +00002937 case 178:
Reid Spencerf459d392006-12-02 16:19:52 +00002938#line 803 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00002939 {
2940 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002941 ;}
2942 break;
2943
Reid Spencerfcb5df82006-12-01 22:34:43 +00002944 case 179:
Reid Spencerf459d392006-12-02 16:19:52 +00002945#line 807 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002946 {
Reid Spencerf7bde222006-12-01 22:26:37 +00002947 (yyval.String) = (yyvsp[0].String);
2948 ;}
2949 break;
2950
Reid Spencerfcb5df82006-12-01 22:34:43 +00002951 case 180:
Reid Spencerf459d392006-12-02 16:19:52 +00002952#line 810 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00002953 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002954 *(yyvsp[-2].String) += ", ...";
2955 (yyval.String) = (yyvsp[-2].String);
2956 delete (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002957 ;}
2958 break;
2959
Reid Spencerfcb5df82006-12-01 22:34:43 +00002960 case 181:
Reid Spencerf459d392006-12-02 16:19:52 +00002961#line 815 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002962 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002963 (yyval.String) = (yyvsp[0].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002964 ;}
2965 break;
2966
Reid Spencerfcb5df82006-12-01 22:34:43 +00002967 case 182:
Reid Spencerf459d392006-12-02 16:19:52 +00002968#line 818 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00002969 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00002970 break;
2971
Reid Spencerfcb5df82006-12-01 22:34:43 +00002972 case 183:
Reid Spencerf459d392006-12-02 16:19:52 +00002973#line 821 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002974 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002975 if (!(yyvsp[-7].String)->empty()) {
2976 *(yyvsp[-7].String) += " ";
2977 }
2978 *(yyvsp[-7].String) += *(yyvsp[-6].Type).newTy + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
2979 if (!(yyvsp[-1].String)->empty()) {
2980 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
2981 }
2982 if (!(yyvsp[0].String)->empty()) {
2983 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
2984 }
2985 (yyvsp[-6].Type).destroy();
2986 delete (yyvsp[-5].String);
2987 delete (yyvsp[-3].String);
2988 delete (yyvsp[-1].String);
2989 delete (yyvsp[0].String);
2990 (yyval.String) = (yyvsp[-7].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00002991 ;}
2992 break;
2993
Reid Spencerfcb5df82006-12-01 22:34:43 +00002994 case 184:
Reid Spencerf459d392006-12-02 16:19:52 +00002995#line 840 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00002996 {
Reid Spencere77e35e2006-12-01 20:26:20 +00002997 (yyval.String) = new std::string("begin");
Reid Spencere7c3c602006-11-30 06:36:44 +00002998 ;}
2999 break;
3000
Reid Spencerfcb5df82006-12-01 22:34:43 +00003001 case 185:
Reid Spencerf459d392006-12-02 16:19:52 +00003002#line 843 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003003 {
3004 (yyval.String) = new std::string ("{");
Reid Spencere7c3c602006-11-30 06:36:44 +00003005 ;}
3006 break;
3007
Reid Spencerfcb5df82006-12-01 22:34:43 +00003008 case 186:
Reid Spencerf459d392006-12-02 16:19:52 +00003009#line 847 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003010 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003011 if (!(yyvsp[-2].String)->empty()) {
3012 *O << *(yyvsp[-2].String) << " ";
3013 }
3014 *O << *(yyvsp[-1].String) << " " << *(yyvsp[0].String) << "\n";
3015 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3016 (yyval.String) = 0;
3017;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003018 break;
3019
Reid Spencerfcb5df82006-12-01 22:34:43 +00003020 case 187:
Reid Spencerf459d392006-12-02 16:19:52 +00003021#line 856 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003022 { (yyval.String) = new std::string("end"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003023 break;
3024
Reid Spencerfcb5df82006-12-01 22:34:43 +00003025 case 188:
Reid Spencerf459d392006-12-02 16:19:52 +00003026#line 857 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003027 { (yyval.String) = new std::string("}"); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003028 break;
3029
Reid Spencerfcb5df82006-12-01 22:34:43 +00003030 case 189:
Reid Spencerf459d392006-12-02 16:19:52 +00003031#line 859 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003032 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003033 if ((yyvsp[-1].String))
3034 *O << *(yyvsp[-1].String);
3035 *O << '\n' << *(yyvsp[0].String) << "\n";
3036 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003037;}
3038 break;
3039
Reid Spencerfcb5df82006-12-01 22:34:43 +00003040 case 190:
Reid Spencerf459d392006-12-02 16:19:52 +00003041#line 867 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003042 { (yyval.String) = new std::string(); ;}
3043 break;
3044
Reid Spencerfcb5df82006-12-01 22:34:43 +00003045 case 193:
Reid Spencerf459d392006-12-02 16:19:52 +00003046#line 873 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003047 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003048 if (!(yyvsp[-1].String)->empty())
3049 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3050 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3051 delete (yyvsp[-1].String);
3052 delete (yyvsp[0].String);
3053 (yyval.String) = (yyvsp[-2].String);
3054 ;}
3055 break;
3056
Reid Spencerfcb5df82006-12-01 22:34:43 +00003057 case 194:
Reid Spencerf459d392006-12-02 16:19:52 +00003058#line 886 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerd154b572006-12-01 20:36:40 +00003059 { (yyval.String) = new std::string(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003060 break;
3061
Reid Spencerfcb5df82006-12-01 22:34:43 +00003062 case 204:
Reid Spencerf459d392006-12-02 16:19:52 +00003063#line 892 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003064 {
3065 (yyvsp[-1].String)->insert(0, "<");
3066 *(yyvsp[-1].String) += ">";
3067 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003068 ;}
3069 break;
3070
Reid Spencerfcb5df82006-12-01 22:34:43 +00003071 case 206:
Reid Spencerf459d392006-12-02 16:19:52 +00003072#line 898 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003073 {
3074 if (!(yyvsp[-3].String)->empty()) {
3075 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3076 }
3077 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3078 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3079 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003080 ;}
3081 break;
3082
Reid Spencerf459d392006-12-02 16:19:52 +00003083 case 209:
3084#line 911 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003085 {
Reid Spencerf459d392006-12-02 16:19:52 +00003086 (yyval.Value).val = (yyvsp[0].String);
3087 (yyval.Value).constant = false;
3088 (yyval.Value).type.newTy = 0;
3089 (yyval.Value).type.oldTy = UnresolvedTy;
3090 ;}
3091 break;
3092
3093 case 210:
3094#line 917 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3095 {
3096 (yyval.Value).val = (yyvsp[0].String);
3097 (yyval.Value).constant = true;
3098 (yyval.Value).type.newTy = 0;
3099 (yyval.Value).type.oldTy = UnresolvedTy;
3100 ;}
3101 break;
3102
3103 case 211:
3104#line 928 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3105 {
3106 (yyval.Value) = (yyvsp[0].Value);
Reid Spencere77e35e2006-12-01 20:26:20 +00003107 (yyval.Value).type = (yyvsp[-1].Type);
Reid Spencerf459d392006-12-02 16:19:52 +00003108 (yyval.Value).val->insert(0, *(yyvsp[-1].Type).newTy + " ");
Reid Spencere77e35e2006-12-01 20:26:20 +00003109 ;}
3110 break;
3111
Reid Spencerfcb5df82006-12-01 22:34:43 +00003112 case 212:
Reid Spencerf459d392006-12-02 16:19:52 +00003113#line 934 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003114 {
Reid Spencerf2d55322006-12-01 21:52:30 +00003115 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003116 ;}
3117 break;
3118
Reid Spencerfcb5df82006-12-01 22:34:43 +00003119 case 213:
Reid Spencerf459d392006-12-02 16:19:52 +00003120#line 937 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003121 { // Do not allow functions with 0 basic blocks
Reid Spencerf2d55322006-12-01 21:52:30 +00003122 (yyval.String) = 0;
Reid Spencere77e35e2006-12-01 20:26:20 +00003123 ;}
3124 break;
3125
Reid Spencerfcb5df82006-12-01 22:34:43 +00003126 case 214:
Reid Spencerf459d392006-12-02 16:19:52 +00003127#line 945 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003128 {
3129 (yyval.String) = 0;
3130 ;}
3131 break;
3132
Reid Spencerfcb5df82006-12-01 22:34:43 +00003133 case 215:
Reid Spencerf459d392006-12-02 16:19:52 +00003134#line 949 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003135 {
3136 *O << " " << *(yyvsp[0].String) << "\n";
3137 delete (yyvsp[0].String);
3138 (yyval.String) = 0;
3139 ;}
3140 break;
3141
Reid Spencerfcb5df82006-12-01 22:34:43 +00003142 case 216:
Reid Spencerf459d392006-12-02 16:19:52 +00003143#line 954 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003144 {
3145 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003146 ;}
3147 break;
3148
Reid Spencerfcb5df82006-12-01 22:34:43 +00003149 case 217:
Reid Spencerf459d392006-12-02 16:19:52 +00003150#line 957 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003151 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003152 *O << *(yyvsp[0].String) << "\n";
3153 delete (yyvsp[0].String);
3154 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003155 ;}
3156 break;
3157
Reid Spencerfcb5df82006-12-01 22:34:43 +00003158 case 218:
Reid Spencerf459d392006-12-02 16:19:52 +00003159#line 963 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003160 { // Return with a result...
3161 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Value).val << "\n";
3162 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3163 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003164 ;}
3165 break;
3166
Reid Spencerfcb5df82006-12-01 22:34:43 +00003167 case 219:
Reid Spencerf459d392006-12-02 16:19:52 +00003168#line 968 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003169 { // Return with no result...
3170 *O << " " << *(yyvsp[-1].String) << " " << *(yyvsp[0].Type).newTy << "\n";
3171 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
3172 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003173 ;}
3174 break;
3175
Reid Spencerfcb5df82006-12-01 22:34:43 +00003176 case 220:
Reid Spencerf459d392006-12-02 16:19:52 +00003177#line 973 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003178 { // Unconditional Branch...
Reid Spencerf459d392006-12-02 16:19:52 +00003179 *O << " " << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3180 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003181 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003182 ;}
3183 break;
3184
Reid Spencerfcb5df82006-12-01 22:34:43 +00003185 case 221:
Reid Spencerf459d392006-12-02 16:19:52 +00003186#line 978 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003187 {
Reid Spencerf459d392006-12-02 16:19:52 +00003188 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3189 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << ", " << *(yyvsp[-1].Type).newTy << " "
3190 << *(yyvsp[0].Value).val << "\n";
3191 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3192 (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003193 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003194 ;}
3195 break;
3196
Reid Spencerfcb5df82006-12-01 22:34:43 +00003197 case 222:
Reid Spencerf459d392006-12-02 16:19:52 +00003198#line 986 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003199 {
Reid Spencerf459d392006-12-02 16:19:52 +00003200 *O << " " << *(yyvsp[-8].String) << " " << *(yyvsp[-7].Type).newTy << " " << *(yyvsp[-6].Value).val << ", "
3201 << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3202 delete (yyvsp[-8].String); (yyvsp[-7].Type).destroy(); (yyvsp[-6].Value).destroy(); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy();
3203 delete (yyvsp[-1].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003204 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003205 ;}
3206 break;
3207
Reid Spencerfcb5df82006-12-01 22:34:43 +00003208 case 223:
Reid Spencerf459d392006-12-02 16:19:52 +00003209#line 993 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003210 {
Reid Spencerf459d392006-12-02 16:19:52 +00003211 *O << " " << *(yyvsp[-7].String) << " " << *(yyvsp[-6].Type).newTy << " " << *(yyvsp[-5].Value).val << ", "
3212 << *(yyvsp[-3].Type).newTy << " " << *(yyvsp[-2].Value).val << "[]\n";
3213 delete (yyvsp[-7].String); (yyvsp[-6].Type).destroy(); (yyvsp[-5].Value).destroy(); (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003214 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003215 ;}
3216 break;
3217
Reid Spencerfcb5df82006-12-01 22:34:43 +00003218 case 224:
Reid Spencerf459d392006-12-02 16:19:52 +00003219#line 1000 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003220 {
Reid Spencer16244f42006-12-01 21:10:07 +00003221 *O << " ";
3222 if (!(yyvsp[-13].String)->empty())
Reid Spencera50d5962006-12-02 04:11:07 +00003223 *O << *(yyvsp[-13].String) << " = ";
Reid Spencerf459d392006-12-02 16:19:52 +00003224 *O << *(yyvsp[-12].String) << " " << *(yyvsp[-11].String) << " " << *(yyvsp[-10].Type).newTy << " " << *(yyvsp[-9].Value).val << " (";
Reid Spencerf8483652006-12-02 15:16:01 +00003225 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3226 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
3227 *O << *VI.val;
3228 if (i+1 < (yyvsp[-7].ValList)->size())
3229 *O << ", ";
3230 VI.destroy();
3231 }
Reid Spencerf459d392006-12-02 16:19:52 +00003232 *O << ") " << *(yyvsp[-5].String) << " " << *(yyvsp[-4].Type).newTy << " " << *(yyvsp[-3].Value).val << " "
3233 << *(yyvsp[-2].String) << " " << *(yyvsp[-1].Type).newTy << " " << *(yyvsp[0].Value).val << "\n";
3234 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-10].Type).destroy(); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3235 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy();
3236 (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003237 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003238 ;}
3239 break;
3240
Reid Spencerfcb5df82006-12-01 22:34:43 +00003241 case 225:
Reid Spencerf459d392006-12-02 16:19:52 +00003242#line 1019 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003243 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003244 *O << " " << *(yyvsp[0].String) << "\n";
3245 delete (yyvsp[0].String);
3246 (yyval.String) = 0;
Reid Spencere7c3c602006-11-30 06:36:44 +00003247 ;}
3248 break;
3249
Reid Spencerfcb5df82006-12-01 22:34:43 +00003250 case 226:
Reid Spencerf459d392006-12-02 16:19:52 +00003251#line 1024 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003252 {
Reid Spencerfcb5df82006-12-01 22:34:43 +00003253 *O << " " << *(yyvsp[0].String) << "\n";
3254 delete (yyvsp[0].String);
3255 (yyval.String) = 0;
3256 ;}
3257 break;
3258
3259 case 227:
Reid Spencerf459d392006-12-02 16:19:52 +00003260#line 1030 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerfcb5df82006-12-01 22:34:43 +00003261 {
Reid Spencerf459d392006-12-02 16:19:52 +00003262 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].String) + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3263 (yyvsp[-4].Type).destroy(); delete (yyvsp[-3].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003264 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003265 ;}
3266 break;
3267
Reid Spencerfcb5df82006-12-01 22:34:43 +00003268 case 228:
Reid Spencerf459d392006-12-02 16:19:52 +00003269#line 1035 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003270 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003271 (yyvsp[-3].String)->insert(0, *(yyvsp[-4].Type).newTy + " " );
Reid Spencerf459d392006-12-02 16:19:52 +00003272 *(yyvsp[-3].String) += ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3273 (yyvsp[-4].Type).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003274 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003275 ;}
3276 break;
3277
Reid Spencerfcb5df82006-12-01 22:34:43 +00003278 case 229:
Reid Spencerf459d392006-12-02 16:19:52 +00003279#line 1043 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003280 {
Reid Spencera50d5962006-12-02 04:11:07 +00003281 if (!(yyvsp[-1].String)->empty())
3282 *(yyvsp[-1].String) += " = ";
Reid Spencere77e35e2006-12-01 20:26:20 +00003283 *(yyvsp[-1].String) += *(yyvsp[0].String);
3284 delete (yyvsp[0].String);
3285 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003286 ;}
3287 break;
3288
Reid Spencerfcb5df82006-12-01 22:34:43 +00003289 case 230:
Reid Spencerf459d392006-12-02 16:19:52 +00003290#line 1052 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003291 { // Used for PHI nodes
Reid Spencerf459d392006-12-02 16:19:52 +00003292 (yyvsp[-3].Value).val->insert(0, *(yyvsp[-5].Type).newTy + "[");
3293 *(yyvsp[-3].Value).val += "," + *(yyvsp[-1].Value).val + "]";
3294 (yyvsp[-5].Type).destroy(); (yyvsp[-1].Value).destroy();
3295 (yyval.String) = new std::string(*(yyvsp[-3].Value).val);
3296 (yyvsp[-3].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003297 ;}
3298 break;
3299
Reid Spencerfcb5df82006-12-01 22:34:43 +00003300 case 231:
Reid Spencerf459d392006-12-02 16:19:52 +00003301#line 1059 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003302 {
Reid Spencerf459d392006-12-02 16:19:52 +00003303 *(yyvsp[-6].String) += ", [" + *(yyvsp[-3].Value).val + "," + *(yyvsp[-1].Value).val + "]";
3304 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003305 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003306 ;}
3307 break;
3308
Reid Spencerfcb5df82006-12-01 22:34:43 +00003309 case 232:
Reid Spencerf459d392006-12-02 16:19:52 +00003310#line 1067 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003311 {
3312 (yyval.ValList) = new ValueList();
3313 (yyval.ValList)->push_back((yyvsp[0].Value));
Reid Spencere7c3c602006-11-30 06:36:44 +00003314 ;}
3315 break;
3316
Reid Spencerf8483652006-12-02 15:16:01 +00003317 case 233:
Reid Spencerf459d392006-12-02 16:19:52 +00003318#line 1071 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003319 {
3320 (yyvsp[-2].ValList)->push_back((yyvsp[0].Value));
3321 (yyval.ValList) = (yyvsp[-2].ValList);
3322 ;}
3323 break;
3324
3325 case 234:
Reid Spencerf459d392006-12-02 16:19:52 +00003326#line 1078 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003327 { (yyval.ValList) = (yyvsp[0].ValList); ;}
3328 break;
3329
Reid Spencerfcb5df82006-12-01 22:34:43 +00003330 case 235:
Reid Spencerf459d392006-12-02 16:19:52 +00003331#line 1079 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003332 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere77e35e2006-12-01 20:26:20 +00003333 break;
3334
Reid Spencerfcb5df82006-12-01 22:34:43 +00003335 case 236:
Reid Spencerf459d392006-12-02 16:19:52 +00003336#line 1083 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003337 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003338 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3339 delete (yyvsp[0].String);
3340 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003341 ;}
3342 break;
3343
Reid Spencerfcb5df82006-12-01 22:34:43 +00003344 case 238:
Reid Spencerf459d392006-12-02 16:19:52 +00003345#line 1091 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003346 {
Reid Spencerf459d392006-12-02 16:19:52 +00003347 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3348 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003349 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003350 ;}
3351 break;
3352
Reid Spencerfcb5df82006-12-01 22:34:43 +00003353 case 239:
Reid Spencerf459d392006-12-02 16:19:52 +00003354#line 1096 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003355 {
Reid Spencerf459d392006-12-02 16:19:52 +00003356 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3357 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003358 (yyval.String) = (yyvsp[-4].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003359 ;}
3360 break;
3361
Reid Spencerfcb5df82006-12-01 22:34:43 +00003362 case 240:
Reid Spencerf459d392006-12-02 16:19:52 +00003363#line 1101 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003364 {
Reid Spencerf459d392006-12-02 16:19:52 +00003365 *(yyvsp[-4].String) += " " + *(yyvsp[-3].Type).newTy + " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3366 (yyvsp[-3].Type).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencerf7bde222006-12-01 22:26:37 +00003367 (yyval.String) = (yyvsp[-4].String);
3368 ;}
3369 break;
3370
Reid Spencerfcb5df82006-12-01 22:34:43 +00003371 case 241:
Reid Spencerf459d392006-12-02 16:19:52 +00003372#line 1106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003373 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003374 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3375 (yyvsp[0].Value).destroy();
3376 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003377 ;}
3378 break;
3379
Reid Spencerfcb5df82006-12-01 22:34:43 +00003380 case 242:
Reid Spencerf459d392006-12-02 16:19:52 +00003381#line 1111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003382 {
Reid Spencerf7bde222006-12-01 22:26:37 +00003383 const char* shiftop = (yyvsp[-3].String)->c_str();
3384 if (*(yyvsp[-3].String) == "shr")
3385 shiftop = ((yyvsp[-2].Value).type.isUnsigned()) ? "lshr" : "ashr";
3386 (yyval.String) = new std::string(shiftop);
3387 *(yyval.String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3388 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003389 ;}
3390 break;
3391
Reid Spencerfcb5df82006-12-01 22:34:43 +00003392 case 243:
Reid Spencerf459d392006-12-02 16:19:52 +00003393#line 1119 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003394 {
Reid Spencer280d8012006-12-01 23:40:53 +00003395 std::string source = *(yyvsp[-2].Value).val;
Reid Spencera50d5962006-12-02 04:11:07 +00003396 TypeInfo SrcTy = (yyvsp[-2].Value).type;
3397 TypeInfo DstTy = (yyvsp[0].Type);
3398 ResolveType(DstTy);
3399 (yyval.String) = new std::string();
Reid Spencer280d8012006-12-01 23:40:53 +00003400 if (*(yyvsp[-3].String) == "cast") {
Reid Spencera50d5962006-12-02 04:11:07 +00003401 *(yyval.String) += getCastUpgrade(source, SrcTy, DstTy, false);
3402 } else {
3403 *(yyval.String) += *(yyvsp[-3].String) + " " + source + " to " + *DstTy.newTy;
Reid Spencer280d8012006-12-01 23:40:53 +00003404 }
Reid Spencere77e35e2006-12-01 20:26:20 +00003405 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
3406 delete (yyvsp[-1].String); (yyvsp[0].Type).destroy();
Reid Spencere7c3c602006-11-30 06:36:44 +00003407 ;}
3408 break;
3409
Reid Spencerfcb5df82006-12-01 22:34:43 +00003410 case 244:
Reid Spencerf459d392006-12-02 16:19:52 +00003411#line 1133 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003412 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003413 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3414 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3415 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003416 ;}
3417 break;
3418
Reid Spencerfcb5df82006-12-01 22:34:43 +00003419 case 245:
Reid Spencerf459d392006-12-02 16:19:52 +00003420#line 1138 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003421 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003422 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Type).newTy;
3423 (yyvsp[-2].Value).destroy(); (yyvsp[0].Type).destroy();
3424 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003425 ;}
3426 break;
3427
Reid Spencerfcb5df82006-12-01 22:34:43 +00003428 case 246:
Reid Spencerf459d392006-12-02 16:19:52 +00003429#line 1143 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003430 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003431 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3432 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3433 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003434 ;}
3435 break;
3436
Reid Spencerfcb5df82006-12-01 22:34:43 +00003437 case 247:
Reid Spencerf459d392006-12-02 16:19:52 +00003438#line 1148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003439 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003440 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3441 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3442 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003443 ;}
3444 break;
3445
Reid Spencerfcb5df82006-12-01 22:34:43 +00003446 case 248:
Reid Spencerf459d392006-12-02 16:19:52 +00003447#line 1153 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003448 {
3449 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
3450 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
3451 (yyval.String) = (yyvsp[-5].String);
3452 ;}
3453 break;
3454
Reid Spencerfcb5df82006-12-01 22:34:43 +00003455 case 249:
Reid Spencerf459d392006-12-02 16:19:52 +00003456#line 1158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003457 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003458 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3459 delete (yyvsp[0].String);
3460 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003461 ;}
3462 break;
3463
Reid Spencerfcb5df82006-12-01 22:34:43 +00003464 case 250:
Reid Spencerf459d392006-12-02 16:19:52 +00003465#line 1163 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003466 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003467 if (!(yyvsp[-5].String)->empty())
3468 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
3469 if (!(yyvsp[-6].String)->empty())
3470 *(yyvsp[-6].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003471 *(yyvsp[-6].String) += *(yyvsp[-4].Type).newTy + " " + *(yyvsp[-3].Value).val + "(";
Reid Spencerf8483652006-12-02 15:16:01 +00003472 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3473 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3474 *(yyvsp[-6].String) += *VI.val;
3475 if (i+1 < (yyvsp[-1].ValList)->size())
3476 *(yyvsp[-6].String) += ", ";
3477 VI.destroy();
3478 }
3479 *(yyvsp[-6].String) += ")";
Reid Spencerf459d392006-12-02 16:19:52 +00003480 delete (yyvsp[-5].String); (yyvsp[-4].Type).destroy(); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003481 (yyval.String) = (yyvsp[-6].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003482 ;}
3483 break;
3484
Reid Spencerfcb5df82006-12-01 22:34:43 +00003485 case 252:
Reid Spencerf459d392006-12-02 16:19:52 +00003486#line 1185 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003487 { (yyval.ValList) = (yyvsp[0].ValList); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003488 break;
3489
Reid Spencerfcb5df82006-12-01 22:34:43 +00003490 case 253:
Reid Spencerf459d392006-12-02 16:19:52 +00003491#line 1186 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf8483652006-12-02 15:16:01 +00003492 { (yyval.ValList) = new ValueList(); ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003493 break;
3494
Reid Spencerfcb5df82006-12-01 22:34:43 +00003495 case 255:
Reid Spencerf459d392006-12-02 16:19:52 +00003496#line 1191 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003497 { (yyval.String) = new std::string(); ;}
3498 break;
3499
Reid Spencerfcb5df82006-12-01 22:34:43 +00003500 case 256:
Reid Spencerf459d392006-12-02 16:19:52 +00003501#line 1194 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere77e35e2006-12-01 20:26:20 +00003502 {
3503 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3504 if (!(yyvsp[0].String)->empty())
3505 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3506 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3507 (yyval.String) = (yyvsp[-2].String);
3508 ;}
Reid Spencere7c3c602006-11-30 06:36:44 +00003509 break;
3510
Reid Spencerfcb5df82006-12-01 22:34:43 +00003511 case 257:
Reid Spencerf459d392006-12-02 16:19:52 +00003512#line 1201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003513 {
Reid Spencerf459d392006-12-02 16:19:52 +00003514 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencere77e35e2006-12-01 20:26:20 +00003515 if (!(yyvsp[0].String)->empty())
3516 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencerf459d392006-12-02 16:19:52 +00003517 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencere77e35e2006-12-01 20:26:20 +00003518 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003519 ;}
3520 break;
3521
Reid Spencerfcb5df82006-12-01 22:34:43 +00003522 case 258:
Reid Spencerf459d392006-12-02 16:19:52 +00003523#line 1208 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003524 {
3525 *(yyvsp[-2].String) += " " + *(yyvsp[-1].Type).newTy;
3526 if (!(yyvsp[0].String)->empty())
3527 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3528 (yyvsp[-1].Type).destroy(); delete (yyvsp[0].String);
3529 (yyval.String) = (yyvsp[-2].String);
3530 ;}
3531 break;
3532
Reid Spencerfcb5df82006-12-01 22:34:43 +00003533 case 259:
Reid Spencerf459d392006-12-02 16:19:52 +00003534#line 1215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencerf7bde222006-12-01 22:26:37 +00003535 {
Reid Spencerf459d392006-12-02 16:19:52 +00003536 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Type).newTy + ", " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencerf7bde222006-12-01 22:26:37 +00003537 if (!(yyvsp[0].String)->empty())
3538 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
Reid Spencerf459d392006-12-02 16:19:52 +00003539 (yyvsp[-4].Type).destroy(); (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
Reid Spencerf7bde222006-12-01 22:26:37 +00003540 (yyval.String) = (yyvsp[-5].String);
3541 ;}
3542 break;
3543
Reid Spencerfcb5df82006-12-01 22:34:43 +00003544 case 260:
Reid Spencerf459d392006-12-02 16:19:52 +00003545#line 1222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003546 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003547 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
3548 (yyvsp[0].Value).destroy();
3549 (yyval.String) = (yyvsp[-1].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003550 ;}
3551 break;
3552
Reid Spencerfcb5df82006-12-01 22:34:43 +00003553 case 261:
Reid Spencerf459d392006-12-02 16:19:52 +00003554#line 1227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003555 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003556 if (!(yyvsp[-3].String)->empty())
3557 *(yyvsp[-3].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003558 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3559 delete (yyvsp[-2].String); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003560 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003561 ;}
3562 break;
3563
Reid Spencerfcb5df82006-12-01 22:34:43 +00003564 case 262:
Reid Spencerf459d392006-12-02 16:19:52 +00003565#line 1234 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003566 {
Reid Spencere77e35e2006-12-01 20:26:20 +00003567 if (!(yyvsp[-5].String)->empty())
3568 *(yyvsp[-5].String) += " ";
Reid Spencerf459d392006-12-02 16:19:52 +00003569 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + *(yyvsp[-1].Type).newTy + " " + *(yyvsp[0].Value).val;
3570 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[-1].Type).destroy(); (yyvsp[0].Value).destroy();
Reid Spencere77e35e2006-12-01 20:26:20 +00003571 (yyval.String) = (yyvsp[-5].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003572 ;}
3573 break;
3574
Reid Spencerfcb5df82006-12-01 22:34:43 +00003575 case 263:
Reid Spencerf459d392006-12-02 16:19:52 +00003576#line 1241 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003577 {
Reid Spencerf459d392006-12-02 16:19:52 +00003578 // Upgrade the indices
3579 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3580 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3581 if (VI.type.isUnsigned() && !VI.isConstant() &&
3582 VI.type.getBitWidth() < 64) {
3583 std::string* old = VI.val;
3584 *O << " %gep_upgrade" << unique << " = zext " << *old
3585 << " to ulong\n";
3586 VI.val = new std::string("ulong %gep_upgrade" + llvm::utostr(unique++));
3587 VI.type.oldTy = ULongTy;
3588 delete old;
3589 }
3590 }
3591 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Type).newTy + " " + *(yyvsp[-1].Value).val;
Reid Spencerf8483652006-12-02 15:16:01 +00003592 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
3593 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
3594 *(yyvsp[-3].String) += ", " + *VI.val;
3595 VI.destroy();
3596 }
Reid Spencerf459d392006-12-02 16:19:52 +00003597 (yyvsp[-2].Type).destroy(); (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
Reid Spencere77e35e2006-12-01 20:26:20 +00003598 (yyval.String) = (yyvsp[-3].String);
Reid Spencere7c3c602006-11-30 06:36:44 +00003599 ;}
3600 break;
3601
3602
3603 default: break;
3604 }
3605
3606/* Line 1126 of yacc.c. */
Reid Spencerf459d392006-12-02 16:19:52 +00003607#line 3608 "UpgradeParser.tab.c"
Reid Spencere7c3c602006-11-30 06:36:44 +00003608
3609 yyvsp -= yylen;
3610 yyssp -= yylen;
3611
3612
3613 YY_STACK_PRINT (yyss, yyssp);
3614
3615 *++yyvsp = yyval;
3616
3617
3618 /* Now `shift' the result of the reduction. Determine what state
3619 that goes to, based on the state we popped back to and the rule
3620 number reduced by. */
3621
3622 yyn = yyr1[yyn];
3623
3624 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3625 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3626 yystate = yytable[yystate];
3627 else
3628 yystate = yydefgoto[yyn - YYNTOKENS];
3629
3630 goto yynewstate;
3631
3632
3633/*------------------------------------.
3634| yyerrlab -- here on detecting error |
3635`------------------------------------*/
3636yyerrlab:
3637 /* If not already recovering from an error, report this error. */
3638 if (!yyerrstatus)
3639 {
3640 ++yynerrs;
3641#if YYERROR_VERBOSE
3642 yyn = yypact[yystate];
3643
3644 if (YYPACT_NINF < yyn && yyn < YYLAST)
3645 {
3646 int yytype = YYTRANSLATE (yychar);
3647 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3648 YYSIZE_T yysize = yysize0;
3649 YYSIZE_T yysize1;
3650 int yysize_overflow = 0;
3651 char *yymsg = 0;
3652# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3653 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3654 int yyx;
3655
3656#if 0
3657 /* This is so xgettext sees the translatable formats that are
3658 constructed on the fly. */
3659 YY_("syntax error, unexpected %s");
3660 YY_("syntax error, unexpected %s, expecting %s");
3661 YY_("syntax error, unexpected %s, expecting %s or %s");
3662 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3663 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3664#endif
3665 char *yyfmt;
3666 char const *yyf;
3667 static char const yyunexpected[] = "syntax error, unexpected %s";
3668 static char const yyexpecting[] = ", expecting %s";
3669 static char const yyor[] = " or %s";
3670 char yyformat[sizeof yyunexpected
3671 + sizeof yyexpecting - 1
3672 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3673 * (sizeof yyor - 1))];
3674 char const *yyprefix = yyexpecting;
3675
3676 /* Start YYX at -YYN if negative to avoid negative indexes in
3677 YYCHECK. */
3678 int yyxbegin = yyn < 0 ? -yyn : 0;
3679
3680 /* Stay within bounds of both yycheck and yytname. */
3681 int yychecklim = YYLAST - yyn;
3682 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3683 int yycount = 1;
3684
3685 yyarg[0] = yytname[yytype];
3686 yyfmt = yystpcpy (yyformat, yyunexpected);
3687
3688 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3689 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3690 {
3691 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3692 {
3693 yycount = 1;
3694 yysize = yysize0;
3695 yyformat[sizeof yyunexpected - 1] = '\0';
3696 break;
3697 }
3698 yyarg[yycount++] = yytname[yyx];
3699 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3700 yysize_overflow |= yysize1 < yysize;
3701 yysize = yysize1;
3702 yyfmt = yystpcpy (yyfmt, yyprefix);
3703 yyprefix = yyor;
3704 }
3705
3706 yyf = YY_(yyformat);
3707 yysize1 = yysize + yystrlen (yyf);
3708 yysize_overflow |= yysize1 < yysize;
3709 yysize = yysize1;
3710
3711 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
3712 yymsg = (char *) YYSTACK_ALLOC (yysize);
3713 if (yymsg)
3714 {
3715 /* Avoid sprintf, as that infringes on the user's name space.
3716 Don't have undefined behavior even if the translation
3717 produced a string with the wrong number of "%s"s. */
3718 char *yyp = yymsg;
3719 int yyi = 0;
3720 while ((*yyp = *yyf))
3721 {
3722 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3723 {
3724 yyp += yytnamerr (yyp, yyarg[yyi++]);
3725 yyf += 2;
3726 }
3727 else
3728 {
3729 yyp++;
3730 yyf++;
3731 }
3732 }
3733 yyerror (yymsg);
3734 YYSTACK_FREE (yymsg);
3735 }
3736 else
3737 {
3738 yyerror (YY_("syntax error"));
3739 goto yyexhaustedlab;
3740 }
3741 }
3742 else
3743#endif /* YYERROR_VERBOSE */
3744 yyerror (YY_("syntax error"));
3745 }
3746
3747
3748
3749 if (yyerrstatus == 3)
3750 {
3751 /* If just tried and failed to reuse look-ahead token after an
3752 error, discard it. */
3753
3754 if (yychar <= YYEOF)
3755 {
3756 /* Return failure if at end of input. */
3757 if (yychar == YYEOF)
3758 YYABORT;
3759 }
3760 else
3761 {
3762 yydestruct ("Error: discarding", yytoken, &yylval);
3763 yychar = YYEMPTY;
3764 }
3765 }
3766
3767 /* Else will try to reuse look-ahead token after shifting the error
3768 token. */
3769 goto yyerrlab1;
3770
3771
3772/*---------------------------------------------------.
3773| yyerrorlab -- error raised explicitly by YYERROR. |
3774`---------------------------------------------------*/
3775yyerrorlab:
3776
3777 /* Pacify compilers like GCC when the user code never invokes
3778 YYERROR and the label yyerrorlab therefore never appears in user
3779 code. */
3780 if (0)
3781 goto yyerrorlab;
3782
3783yyvsp -= yylen;
3784 yyssp -= yylen;
3785 yystate = *yyssp;
3786 goto yyerrlab1;
3787
3788
3789/*-------------------------------------------------------------.
3790| yyerrlab1 -- common code for both syntax error and YYERROR. |
3791`-------------------------------------------------------------*/
3792yyerrlab1:
3793 yyerrstatus = 3; /* Each real token shifted decrements this. */
3794
3795 for (;;)
3796 {
3797 yyn = yypact[yystate];
3798 if (yyn != YYPACT_NINF)
3799 {
3800 yyn += YYTERROR;
3801 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3802 {
3803 yyn = yytable[yyn];
3804 if (0 < yyn)
3805 break;
3806 }
3807 }
3808
3809 /* Pop the current state because it cannot handle the error token. */
3810 if (yyssp == yyss)
3811 YYABORT;
3812
3813
3814 yydestruct ("Error: popping", yystos[yystate], yyvsp);
3815 YYPOPSTACK;
3816 yystate = *yyssp;
3817 YY_STACK_PRINT (yyss, yyssp);
3818 }
3819
3820 if (yyn == YYFINAL)
3821 YYACCEPT;
3822
3823 *++yyvsp = yylval;
3824
3825
3826 /* Shift the error token. */
3827 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3828
3829 yystate = yyn;
3830 goto yynewstate;
3831
3832
3833/*-------------------------------------.
3834| yyacceptlab -- YYACCEPT comes here. |
3835`-------------------------------------*/
3836yyacceptlab:
3837 yyresult = 0;
3838 goto yyreturn;
3839
3840/*-----------------------------------.
3841| yyabortlab -- YYABORT comes here. |
3842`-----------------------------------*/
3843yyabortlab:
3844 yyresult = 1;
3845 goto yyreturn;
3846
3847#ifndef yyoverflow
3848/*-------------------------------------------------.
3849| yyexhaustedlab -- memory exhaustion comes here. |
3850`-------------------------------------------------*/
3851yyexhaustedlab:
3852 yyerror (YY_("memory exhausted"));
3853 yyresult = 2;
3854 /* Fall through. */
3855#endif
3856
3857yyreturn:
3858 if (yychar != YYEOF && yychar != YYEMPTY)
3859 yydestruct ("Cleanup: discarding lookahead",
3860 yytoken, &yylval);
3861 while (yyssp != yyss)
3862 {
3863 yydestruct ("Cleanup: popping",
3864 yystos[*yyssp], yyvsp);
3865 YYPOPSTACK;
3866 }
3867#ifndef yyoverflow
3868 if (yyss != yyssa)
3869 YYSTACK_FREE (yyss);
3870#endif
3871 return yyresult;
3872}
3873
3874
Reid Spencerf459d392006-12-02 16:19:52 +00003875#line 1265 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
Reid Spencere7c3c602006-11-30 06:36:44 +00003876
3877
3878int yyerror(const char *ErrorMsg) {
3879 std::string where
3880 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
3881 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
3882 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
3883 if (yychar == YYEMPTY || yychar == 0)
3884 errMsg += "end-of-file.";
3885 else
3886 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
3887 std::cerr << errMsg << '\n';
3888 exit(1);
3889}
3890