2 /* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define yyparse Upgradeparse
8 #define yylex Upgradelex
9 #define yyerror Upgradeerror
10 #define yylval Upgradelval
11 #define yychar Upgradechar
12 #define yydebug Upgradedebug
13 #define yynerrs Upgradenerrs
28 #define ESINT64VAL 271
29 #define EUINT64VAL 272
35 #define ZEROINITIALIZER 278
41 #define STRINGCONSTANT 284
42 #define IMPLEMENTATION 285
58 #define EXTERN_WEAK 301
65 #define POINTERSIZE 308
69 #define UNINITIALIZED 312
75 #define SIDEEFFECT 318
78 #define CSRETCC_TOK 321
79 #define FASTCC_TOK 322
80 #define COLDCC_TOK 323
81 #define X86_STDCALLCC_TOK 324
82 #define X86_FASTCALLCC_TOK 325
83 #define DATALAYOUT 326
90 #define UNREACHABLE 333
138 #define GETELEMENTPTR 381
146 #define EXTRACTELEMENT 389
147 #define INSERTELEMENT 390
148 #define SHUFFLEVECTOR 391
163 #line 14 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
165 #include "ParserInternals.h"
171 #define YYERROR_VERBOSE 1
172 #define YYINCLUDED_STDLIB_H
175 int yylex(); // declaration" of xxx warnings.
179 static std::string CurFilename;
180 static std::ostream *O = 0;
181 std::istream* LexInput = 0;
182 unsigned SizeOfPointer = 32;
183 static uint64_t unique = 1;
185 // This bool controls whether attributes are ever added to function declarations
186 // definitions and calls.
187 static bool AddAttributes = false;
189 // This bool is used to communicate between the InstVal and Inst rules about
190 // whether or not a cast should be deleted. When the flag is set, InstVal has
191 // determined that the cast is a candidate. However, it can only be deleted if
192 // the value being casted is the same value name as the instruction. The Inst
193 // rule makes that comparison if the flag is set and comments out the
194 // instruction if they match.
195 static bool deleteUselessCastFlag = false;
196 static std::string* deleteUselessCastName = 0;
198 typedef std::vector<TypeInfo> TypeVector;
199 static TypeVector EnumeratedTypes;
200 typedef std::map<std::string,TypeInfo> TypeMap;
201 static TypeMap NamedTypes;
202 static TypeMap Globals;
204 void destroy(ValueList* VL) {
205 while (!VL->empty()) {
206 ValueInfo& VI = VL->back();
213 void UpgradeAssembly(const std::string &infile, std::istream& in,
214 std::ostream &out, bool debug, bool addAttrs)
217 CurFilename = infile;
220 AddAttributes = addAttrs;
224 std::cerr << "Parse failed.\n";
225 out << "llvm-upgrade parse failed.\n";
230 TypeInfo* ResolveType(TypeInfo*& Ty) {
231 if (Ty->isUnresolved()) {
232 if (Ty->getNewTy()[0] == '%' && isdigit(Ty->getNewTy()[1])) {
233 unsigned ref = atoi(&((Ty->getNewTy().c_str())[1])); // skip the %
234 if (ref < EnumeratedTypes.size()) {
235 Ty = &EnumeratedTypes[ref];
238 std::string msg("Can't resolve numbered type: ");
239 msg += Ty->getNewTy();
240 yyerror(msg.c_str());
243 TypeMap::iterator I = NamedTypes.find(Ty->getNewTy());
244 if (I != NamedTypes.end()) {
248 std::string msg("Cannot resolve type: ");
249 msg += Ty->getNewTy();
250 yyerror(msg.c_str());
254 // otherwise its already resolved.
258 static const char* getCastOpcode(
259 std::string& Source, const TypeInfo* SrcTy, const TypeInfo* DstTy)
261 unsigned SrcBits = SrcTy->getBitWidth();
262 unsigned DstBits = DstTy->getBitWidth();
263 const char* opcode = "bitcast";
264 // Run through the possibilities ...
265 if (DstTy->isIntegral()) { // Casting to integral
266 if (SrcTy->isIntegral()) { // Casting from integral
267 if (DstBits < SrcBits)
269 else if (DstBits > SrcBits) { // its an extension
270 if (SrcTy->isSigned())
271 opcode ="sext"; // signed -> SEXT
273 opcode = "zext"; // unsigned -> ZEXT
275 opcode = "bitcast"; // Same size, No-op cast
277 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
278 if (DstTy->isSigned())
279 opcode = "fptosi"; // FP -> sint
281 opcode = "fptoui"; // FP -> uint
282 } else if (SrcTy->isPacked()) {
283 assert(DstBits == SrcTy->getBitWidth() &&
284 "Casting packed to integer of different width");
285 opcode = "bitcast"; // same size, no-op cast
287 assert(SrcTy->isPointer() &&
288 "Casting from a value that is not first-class type");
289 opcode = "ptrtoint"; // ptr -> int
291 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
292 if (SrcTy->isIntegral()) { // Casting from integral
293 if (SrcTy->isSigned())
294 opcode = "sitofp"; // sint -> FP
296 opcode = "uitofp"; // uint -> FP
297 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
298 if (DstBits < SrcBits) {
299 opcode = "fptrunc"; // FP -> smaller FP
300 } else if (DstBits > SrcBits) {
301 opcode = "fpext"; // FP -> larger FP
303 opcode ="bitcast"; // same size, no-op cast
305 } else if (SrcTy->isPacked()) {
306 assert(DstBits == SrcTy->getBitWidth() &&
307 "Casting packed to floating point of different width");
308 opcode = "bitcast"; // same size, no-op cast
310 assert(0 && "Casting pointer or non-first class to float");
312 } else if (DstTy->isPacked()) {
313 if (SrcTy->isPacked()) {
314 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
315 "Casting packed to packed of different widths");
316 opcode = "bitcast"; // packed -> packed
317 } else if (DstTy->getBitWidth() == SrcBits) {
318 opcode = "bitcast"; // float/int -> packed
320 assert(!"Illegal cast to packed (wrong type or size)");
322 } else if (DstTy->isPointer()) {
323 if (SrcTy->isPointer()) {
324 opcode = "bitcast"; // ptr -> ptr
325 } else if (SrcTy->isIntegral()) {
326 opcode = "inttoptr"; // int -> ptr
328 assert(!"Casting invalid type to pointer");
331 assert(!"Casting to type that is not first-class");
336 static std::string getCastUpgrade(const std::string& Src, TypeInfo* SrcTy,
337 TypeInfo* DstTy, bool isConst)
340 std::string Source = Src;
341 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
342 // fp -> ptr cast is no longer supported but we must upgrade this
343 // by doing a double cast: fp -> int -> ptr
345 Source = "i64 fptoui(" + Source + " to i64)";
347 *O << " %cast_upgrade" << unique << " = fptoui " << Source
349 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
351 // Update the SrcTy for the getCastOpcode call below
353 SrcTy = new TypeInfo("i64", ULongTy);
354 } else if (DstTy->isBool()) {
355 // cast type %x to bool was previously defined as setne type %x, null
356 // The cast semantic is now to truncate, not compare so we must retain
357 // the original intent by replacing the cast with a setne
358 const char* comparator = SrcTy->isPointer() ? ", null" :
359 (SrcTy->isFloatingPoint() ? ", 0.0" :
360 (SrcTy->isBool() ? ", false" : ", 0"));
361 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
363 Result = "(" + Source + comparator + ")";
364 Result = compareOp + Result;
366 Result = compareOp + Source + comparator;
367 return Result; // skip cast processing below
371 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
373 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
375 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
379 const char* getDivRemOpcode(const std::string& opcode, TypeInfo* TI) {
380 const char* op = opcode.c_str();
381 const TypeInfo* Ty = ResolveType(TI);
383 Ty = Ty->getElementType();
385 if (Ty->isFloatingPoint())
387 else if (Ty->isUnsigned())
389 else if (Ty->isSigned())
392 yyerror("Invalid type for div instruction");
393 else if (opcode == "rem")
394 if (Ty->isFloatingPoint())
396 else if (Ty->isUnsigned())
398 else if (Ty->isSigned())
401 yyerror("Invalid type for rem instruction");
406 getCompareOp(const std::string& setcc, const TypeInfo* TI) {
407 assert(setcc.length() == 5);
410 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
411 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
412 std::string result("xcmp xxx");
415 if (TI->isFloatingPoint()) {
419 result[5] = 'u'; // NE maps to unordered
421 result[5] = 'o'; // everything else maps to ordered
422 } else if (TI->isIntegral() || TI->isPointer()) {
424 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
426 else if (TI->isSigned())
428 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
431 yyerror("Invalid integral type for setcc");
436 static TypeInfo* getFunctionReturnType(TypeInfo* PFTy) {
438 if (PFTy->isPointer()) {
439 TypeInfo* ElemTy = PFTy->getElementType();
441 if (ElemTy->isFunction())
442 return ElemTy->getResultType()->clone();
443 } else if (PFTy->isFunction()) {
444 return PFTy->getResultType()->clone();
446 return PFTy->clone();
449 typedef std::vector<TypeInfo*> UpRefStack;
450 static TypeInfo* ResolveUpReference(TypeInfo* Ty, UpRefStack* stack) {
451 assert(Ty->isUpReference() && "Can't resolve a non-upreference");
452 unsigned upref = atoi(&((Ty->getNewTy().c_str())[1])); // skip the slash
453 assert(upref < stack->size() && "Invalid up reference");
454 return (*stack)[upref - stack->size() - 1];
457 static TypeInfo* getGEPIndexedType(TypeInfo* PTy, ValueList* idxs) {
458 TypeInfo* Result = ResolveType(PTy);
459 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
461 for (unsigned i = 0; i < idxs->size(); ++i) {
462 if (Result->isComposite()) {
463 Result = Result->getIndexedType((*idxs)[i]);
465 stack.push_back(Result);
467 yyerror("Invalid type for index");
469 // Resolve upreferences so we can return a more natural type
470 if (Result->isPointer()) {
471 if (Result->getElementType()->isUpReference()) {
472 stack.push_back(Result);
473 Result = ResolveUpReference(Result->getElementType(), &stack);
475 } else if (Result->isUpReference()) {
476 Result = ResolveUpReference(Result->getElementType(), &stack);
478 return Result->getPointerType();
481 static std::string makeUniqueName(const std::string *Name, bool isSigned) {
482 const char *suffix = ".u";
485 if ((*Name)[Name->size()-1] == '"') {
486 std::string Result(*Name);
487 Result.insert(Name->size()-1, suffix);
490 return *Name + suffix;
493 // This function handles appending .u or .s to integer value names that
494 // were previously unsigned or signed, respectively. This avoids name
495 // collisions since the unsigned and signed type planes have collapsed
496 // into a single signless type plane.
497 static std::string getUniqueName(const std::string *Name, TypeInfo* Ty) {
498 // If its not a symbolic name, don't modify it, probably a constant val.
499 if ((*Name)[0] != '%' && (*Name)[0] != '"')
501 // If its a numeric reference, just leave it alone.
502 if (isdigit((*Name)[1]))
508 // Remove as many levels of pointer nesting that we have.
509 if (Ty->isPointer()) {
510 // Avoid infinite loops in recursive types
512 while (Ty->isPointer() && Last != Ty) {
514 Ty = Ty->getElementType();
519 // Default the result to the current name
520 std::string Result = *Name;
522 // Now deal with the underlying type
523 if (Ty->isInteger()) {
524 // If its an integer type, make the name unique
525 Result = makeUniqueName(Name, Ty->isSigned());
526 } else if (Ty->isArray() || Ty->isPacked()) {
527 Ty = Ty->getElementType();
529 Result = makeUniqueName(Name, Ty->isSigned());
530 } else if (Ty->isStruct()) {
531 // Scan the fields and count the signed and unsigned fields
533 for (unsigned i = 0; i < Ty->getNumStructElements(); ++i) {
534 TypeInfo* Tmp = Ty->getElement(i);
535 if (Tmp->isInteger())
542 Result = makeUniqueName(Name, isSigned > 0);
548 #line 401 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
568 #define YYFLAG -32768
571 #define YYTRANSLATE(x) ((unsigned)(x) <= 404 ? yytranslate[x] : 239)
573 static const short yytranslate[] = { 0,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 154,
578 155, 163, 2, 152, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 159,
580 151, 160, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 156, 153, 158, 2, 2, 2, 2, 2, 164, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 157,
586 2, 2, 161, 2, 162, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
600 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
601 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
602 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
603 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
604 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
605 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
606 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
607 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
608 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
609 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
610 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
611 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
612 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
613 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
618 static const short yyprhs[] = { 0,
619 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
620 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
621 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
622 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,
623 80, 82, 84, 86, 88, 90, 92, 94, 96, 98,
624 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
625 120, 122, 124, 126, 128, 130, 132, 134, 136, 138,
626 140, 142, 144, 146, 148, 150, 152, 154, 156, 158,
627 161, 162, 164, 166, 168, 170, 172, 174, 176, 177,
628 179, 181, 183, 185, 187, 189, 192, 193, 194, 197,
629 198, 202, 205, 206, 208, 209, 213, 215, 218, 220,
630 222, 224, 226, 228, 230, 232, 234, 236, 238, 240,
631 242, 244, 246, 248, 250, 252, 254, 256, 258, 261,
632 266, 272, 278, 282, 285, 291, 296, 299, 301, 305,
633 307, 311, 313, 314, 319, 323, 327, 332, 337, 341,
634 344, 347, 350, 353, 356, 359, 362, 365, 368, 371,
635 378, 384, 393, 400, 407, 414, 422, 430, 437, 444,
636 453, 462, 466, 468, 470, 472, 474, 477, 480, 485,
637 488, 490, 492, 494, 499, 502, 507, 514, 521, 528,
638 535, 539, 544, 545, 547, 549, 551, 555, 559, 563,
639 567, 571, 575, 577, 578, 580, 582, 584, 585, 588,
640 592, 594, 596, 600, 602, 603, 612, 614, 616, 620,
641 622, 624, 628, 629, 631, 633, 637, 638, 640, 642,
642 644, 646, 648, 650, 652, 654, 656, 660, 662, 668,
643 670, 672, 674, 676, 679, 682, 684, 687, 690, 691,
644 693, 695, 697, 700, 703, 707, 717, 727, 736, 751,
645 753, 755, 762, 768, 771, 778, 786, 788, 792, 794,
646 795, 798, 800, 806, 812, 818, 825, 832, 835, 840,
647 845, 852, 857, 862, 869, 876, 879, 887, 889, 892,
648 893, 895, 896, 900, 907, 911, 918, 921, 926, 933
651 static const short yyrhs[] = { 19,
652 0, 20, 0, 17, 0, 18, 0, 80, 0, 81,
653 0, 82, 0, 83, 0, 84, 0, 85, 0, 86,
654 0, 87, 0, 88, 0, 89, 0, 90, 0, 91,
655 0, 92, 0, 93, 0, 94, 0, 95, 0, 96,
656 0, 97, 0, 98, 0, 99, 0, 102, 0, 103,
657 0, 104, 0, 105, 0, 106, 0, 107, 0, 118,
658 0, 119, 0, 120, 0, 121, 0, 108, 0, 109,
659 0, 110, 0, 111, 0, 112, 0, 113, 0, 114,
660 0, 115, 0, 116, 0, 117, 0, 118, 0, 119,
661 0, 120, 0, 121, 0, 25, 0, 26, 0, 130,
662 0, 131, 0, 132, 0, 133, 0, 139, 0, 140,
663 0, 141, 0, 142, 0, 143, 0, 144, 0, 145,
664 0, 146, 0, 147, 0, 148, 0, 149, 0, 150,
665 0, 138, 0, 11, 0, 9, 0, 7, 0, 5,
666 0, 12, 0, 10, 0, 8, 0, 6, 0, 174,
667 0, 175, 0, 13, 0, 14, 0, 207, 151, 0,
668 0, 42, 0, 43, 0, 44, 0, 48, 0, 45,
669 0, 46, 0, 47, 0, 0, 66, 0, 67, 0,
670 68, 0, 69, 0, 70, 0, 71, 0, 65, 18,
671 0, 0, 0, 57, 18, 0, 0, 152, 57, 18,
672 0, 37, 30, 0, 0, 183, 0, 0, 152, 186,
673 185, 0, 183, 0, 57, 18, 0, 189, 0, 3,
674 0, 191, 0, 3, 0, 191, 0, 4, 0, 5,
675 0, 6, 0, 7, 0, 8, 0, 9, 0, 10,
676 0, 11, 0, 12, 0, 13, 0, 14, 0, 15,
677 0, 16, 0, 221, 0, 190, 0, 153, 18, 0,
678 188, 154, 193, 155, 0, 156, 18, 157, 191, 158,
679 0, 159, 18, 157, 191, 160, 0, 161, 192, 162,
680 0, 161, 162, 0, 159, 161, 192, 162, 160, 0,
681 159, 161, 162, 160, 0, 191, 163, 0, 191, 0,
682 192, 152, 191, 0, 192, 0, 192, 152, 40, 0,
683 40, 0, 0, 189, 156, 196, 158, 0, 189, 156,
684 158, 0, 189, 164, 30, 0, 189, 159, 196, 160,
685 0, 189, 161, 196, 162, 0, 189, 161, 162, 0,
686 189, 22, 0, 189, 23, 0, 189, 221, 0, 189,
687 195, 0, 189, 24, 0, 174, 166, 0, 175, 166,
688 0, 4, 25, 0, 4, 26, 0, 177, 21, 0,
689 173, 154, 194, 39, 189, 155, 0, 127, 154, 194,
690 236, 155, 0, 129, 154, 194, 152, 194, 152, 194,
691 155, 0, 167, 154, 194, 152, 194, 155, 0, 168,
692 154, 194, 152, 194, 155, 0, 169, 154, 194, 152,
693 194, 155, 0, 100, 170, 154, 194, 152, 194, 155,
694 0, 101, 171, 154, 194, 152, 194, 155, 0, 172,
695 154, 194, 152, 194, 155, 0, 135, 154, 194, 152,
696 194, 155, 0, 136, 154, 194, 152, 194, 152, 194,
697 155, 0, 137, 154, 194, 152, 194, 152, 194, 155,
698 0, 196, 152, 194, 0, 194, 0, 35, 0, 36,
699 0, 199, 0, 199, 216, 0, 199, 218, 0, 199,
700 63, 62, 202, 0, 199, 31, 0, 201, 0, 50,
701 0, 58, 0, 201, 178, 27, 187, 0, 201, 218,
702 0, 201, 63, 62, 202, 0, 201, 178, 179, 197,
703 194, 185, 0, 201, 178, 200, 197, 189, 185, 0,
704 201, 178, 45, 197, 189, 185, 0, 201, 178, 47,
705 197, 189, 185, 0, 201, 51, 204, 0, 201, 59,
706 151, 205, 0, 0, 30, 0, 56, 0, 55, 0,
707 53, 151, 203, 0, 54, 151, 18, 0, 52, 151,
708 30, 0, 72, 151, 30, 0, 156, 206, 158, 0,
709 206, 152, 30, 0, 30, 0, 0, 28, 0, 30,
710 0, 207, 0, 0, 189, 208, 0, 210, 152, 209,
711 0, 209, 0, 210, 0, 210, 152, 40, 0, 40,
712 0, 0, 180, 187, 207, 154, 211, 155, 184, 181,
713 0, 32, 0, 161, 0, 179, 212, 213, 0, 33,
714 0, 162, 0, 214, 224, 215, 0, 0, 45, 0,
715 47, 0, 34, 217, 212, 0, 0, 64, 0, 17,
716 0, 18, 0, 21, 0, 25, 0, 26, 0, 22,
717 0, 23, 0, 24, 0, 159, 196, 160, 0, 195,
718 0, 62, 219, 30, 152, 30, 0, 165, 0, 207,
719 0, 221, 0, 220, 0, 189, 222, 0, 224, 225,
720 0, 225, 0, 226, 228, 0, 226, 230, 0, 0,
721 29, 0, 78, 0, 77, 0, 73, 223, 0, 73,
722 3, 0, 74, 15, 222, 0, 74, 4, 222, 152,
723 15, 222, 152, 15, 222, 0, 75, 176, 222, 152,
724 15, 222, 156, 229, 158, 0, 75, 176, 222, 152,
725 15, 222, 156, 158, 0, 178, 76, 180, 187, 222,
726 154, 233, 155, 39, 15, 222, 227, 15, 222, 0,
727 227, 0, 79, 0, 229, 176, 220, 152, 15, 222,
728 0, 176, 220, 152, 15, 222, 0, 178, 235, 0,
729 189, 156, 222, 152, 222, 158, 0, 231, 152, 156,
730 222, 152, 222, 158, 0, 223, 0, 232, 152, 223,
731 0, 232, 0, 0, 61, 60, 0, 60, 0, 167,
732 189, 222, 152, 222, 0, 168, 189, 222, 152, 222,
733 0, 169, 189, 222, 152, 222, 0, 100, 170, 189,
734 222, 152, 222, 0, 101, 171, 189, 222, 152, 222,
735 0, 49, 223, 0, 172, 223, 152, 223, 0, 173,
736 223, 39, 189, 0, 129, 223, 152, 223, 152, 223,
737 0, 134, 223, 152, 189, 0, 135, 223, 152, 223,
738 0, 136, 223, 152, 223, 152, 223, 0, 137, 223,
739 152, 223, 152, 223, 0, 128, 231, 0, 234, 180,
740 187, 222, 154, 233, 155, 0, 238, 0, 152, 232,
741 0, 0, 38, 0, 0, 122, 189, 182, 0, 122,
742 189, 152, 10, 222, 182, 0, 123, 189, 182, 0,
743 123, 189, 152, 10, 222, 182, 0, 124, 223, 0,
744 237, 125, 189, 222, 0, 237, 126, 223, 152, 189,
745 222, 0, 127, 189, 222, 236, 0
751 static const short yyrline[] = { 0,
752 466, 466, 467, 467, 471, 471, 471, 471, 471, 471,
753 471, 472, 472, 472, 472, 473, 473, 473, 474, 474,
754 474, 474, 474, 474, 475, 475, 475, 475, 475, 475,
755 475, 475, 475, 475, 476, 476, 476, 476, 476, 476,
756 476, 476, 476, 476, 477, 477, 477, 477, 477, 477,
757 478, 478, 478, 478, 479, 479, 479, 479, 479, 479,
758 479, 479, 480, 480, 480, 480, 480, 485, 485, 485,
759 485, 486, 486, 486, 486, 487, 487, 488, 488, 491,
760 494, 499, 499, 499, 499, 499, 499, 500, 501, 504,
761 504, 504, 504, 504, 505, 506, 511, 516, 517, 520,
762 521, 529, 535, 536, 539, 540, 549, 550, 563, 563,
763 564, 564, 565, 569, 569, 569, 569, 569, 569, 569,
764 570, 570, 570, 570, 570, 572, 575, 578, 581, 585,
765 598, 604, 610, 620, 623, 633, 636, 644, 648, 655,
766 656, 661, 666, 676, 682, 687, 693, 699, 705, 710,
767 716, 722, 729, 735, 741, 747, 753, 759, 765, 773,
768 786, 798, 803, 809, 814, 820, 825, 830, 838, 843,
769 848, 858, 863, 868, 868, 878, 883, 886, 891, 895,
770 899, 901, 901, 904, 914, 919, 924, 934, 944, 954,
771 964, 969, 974, 979, 981, 981, 984, 989, 996, 1001,
772 1008, 1015, 1020, 1021, 1029, 1029, 1030, 1030, 1032, 1041,
773 1045, 1049, 1052, 1057, 1060, 1063, 1081, 1082, 1085, 1096,
774 1097, 1099, 1108, 1109, 1110, 1114, 1127, 1128, 1131, 1131,
775 1131, 1131, 1131, 1131, 1131, 1132, 1133, 1138, 1139, 1148,
776 1148, 1152, 1157, 1167, 1177, 1180, 1188, 1192, 1197, 1200,
777 1206, 1206, 1208, 1213, 1218, 1223, 1232, 1240, 1247, 1270,
778 1275, 1281, 1287, 1295, 1313, 1321, 1330, 1334, 1341, 1342,
779 1346, 1351, 1354, 1363, 1371, 1380, 1388, 1396, 1401, 1410,
780 1438, 1444, 1450, 1457, 1463, 1469, 1475, 1493, 1498, 1499,
781 1503, 1504, 1507, 1515, 1524, 1532, 1541, 1547, 1556, 1565
786 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
788 static const char * const yytname[] = { "$","error","$undefined.","VOID","BOOL",
789 "SBYTE","UBYTE","SHORT","USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE",
790 "LABEL","OPAQUE","ESINT64VAL","EUINT64VAL","SINTVAL","UINTVAL","FPVAL","NULL_TOK",
791 "UNDEF","ZEROINITIALIZER","TRUETOK","FALSETOK","TYPE","VAR_ID","LABELSTR","STRINGCONSTANT",
792 "IMPLEMENTATION","BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION",
793 "VOLATILE","TO","DOTDOTDOT","CONST","INTERNAL","LINKONCE","WEAK","DLLIMPORT",
794 "DLLEXPORT","EXTERN_WEAK","APPENDING","NOT","EXTERNAL","TARGET","TRIPLE","ENDIAN",
795 "POINTERSIZE","LITTLE","BIG","ALIGN","UNINITIALIZED","DEPLIBS","CALL","TAIL",
796 "ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","CSRETCC_TOK","FASTCC_TOK",
797 "COLDCC_TOK","X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR",
798 "SWITCH","INVOKE","EXCEPT","UNWIND","UNREACHABLE","ADD","SUB","MUL","DIV","UDIV",
799 "SDIV","FDIV","REM","UREM","SREM","FREM","AND","OR","XOR","SETLE","SETGE","SETLT",
800 "SETGT","SETEQ","SETNE","ICMP","FCMP","EQ","NE","SLT","SGT","SLE","SGE","OEQ",
801 "ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE","ULT","UGT","ULE","UGE",
802 "MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","PHI_TOK","SELECT","SHL",
803 "SHR","ASHR","LSHR","VAARG","EXTRACTELEMENT","INSERTELEMENT","SHUFFLEVECTOR",
804 "CAST","TRUNC","ZEXT","SEXT","FPTRUNC","FPEXT","FPTOUI","FPTOSI","UITOFP","SITOFP",
805 "PTRTOINT","INTTOPTR","BITCAST","'='","','","'\\\\'","'('","')'","'['","'x'",
806 "']'","'<'","'>'","'{'","'}'","'*'","'c'","IntVal","EInt64Val","ArithmeticOps",
807 "LogicalOps","SetCondOps","IPredicates","FPredicates","ShiftOps","CastOps","SIntType",
808 "UIntType","IntType","FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign",
809 "OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute",
810 "TypesV","UpRTypesV","Types","PrimType","UpRTypes","TypeListI","ArgTypeListI",
811 "ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList",
812 "External","ConstPool","AsmBlock","BigOrLittle","TargetDefinition","LibrariesDefinition",
813 "LibList","Name","OptName","ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN",
814 "FunctionHeader","END","Function","FnDeclareLinkage","FunctionProto","OptSideEffect",
815 "ConstValueRef","SymbolicValueRef","ValueRef","ResolvedVal","BasicBlockList",
816 "BasicBlock","InstructionList","Unwind","BBTerminatorInst","JumpTable","Inst",
817 "PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal","IndexList",
818 "OptVolatile","MemoryInst", NULL
822 static const short yyr1[] = { 0,
823 165, 165, 166, 166, 167, 167, 167, 167, 167, 167,
824 167, 167, 167, 167, 167, 168, 168, 168, 169, 169,
825 169, 169, 169, 169, 170, 170, 170, 170, 170, 170,
826 170, 170, 170, 170, 171, 171, 171, 171, 171, 171,
827 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
828 172, 172, 172, 172, 173, 173, 173, 173, 173, 173,
829 173, 173, 173, 173, 173, 173, 173, 174, 174, 174,
830 174, 175, 175, 175, 175, 176, 176, 177, 177, 178,
831 178, 179, 179, 179, 179, 179, 179, 179, 179, 180,
832 180, 180, 180, 180, 180, 180, 180, 181, 181, 182,
833 182, 183, 184, 184, 185, 185, 186, 186, 187, 187,
834 188, 188, 189, 190, 190, 190, 190, 190, 190, 190,
835 190, 190, 190, 190, 190, 191, 191, 191, 191, 191,
836 191, 191, 191, 191, 191, 191, 191, 192, 192, 193,
837 193, 193, 193, 194, 194, 194, 194, 194, 194, 194,
838 194, 194, 194, 194, 194, 194, 194, 194, 194, 195,
839 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
840 195, 196, 196, 197, 197, 198, 199, 199, 199, 199,
841 199, 200, 200, 201, 201, 201, 201, 201, 201, 201,
842 201, 201, 201, 202, 203, 203, 204, 204, 204, 204,
843 205, 206, 206, 206, 207, 207, 208, 208, 209, 210,
844 210, 211, 211, 211, 211, 212, 213, 213, 214, 215,
845 215, 216, 217, 217, 217, 218, 219, 219, 220, 220,
846 220, 220, 220, 220, 220, 220, 220, 220, 220, 221,
847 221, 222, 222, 223, 224, 224, 225, 226, 226, 226,
848 227, 227, 228, 228, 228, 228, 228, 228, 228, 228,
849 228, 229, 229, 230, 231, 231, 232, 232, 233, 233,
850 234, 234, 235, 235, 235, 235, 235, 235, 235, 235,
851 235, 235, 235, 235, 235, 235, 235, 235, 236, 236,
852 237, 237, 238, 238, 238, 238, 238, 238, 238, 238
855 static const short yyr2[] = { 0,
856 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
857 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
858 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
859 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
860 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
861 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
862 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
863 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
864 0, 1, 1, 1, 1, 1, 1, 1, 0, 1,
865 1, 1, 1, 1, 1, 2, 0, 0, 2, 0,
866 3, 2, 0, 1, 0, 3, 1, 2, 1, 1,
867 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
868 1, 1, 1, 1, 1, 1, 1, 1, 2, 4,
869 5, 5, 3, 2, 5, 4, 2, 1, 3, 1,
870 3, 1, 0, 4, 3, 3, 4, 4, 3, 2,
871 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
872 5, 8, 6, 6, 6, 7, 7, 6, 6, 8,
873 8, 3, 1, 1, 1, 1, 2, 2, 4, 2,
874 1, 1, 1, 4, 2, 4, 6, 6, 6, 6,
875 3, 4, 0, 1, 1, 1, 3, 3, 3, 3,
876 3, 3, 1, 0, 1, 1, 1, 0, 2, 3,
877 1, 1, 3, 1, 0, 8, 1, 1, 3, 1,
878 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
879 1, 1, 1, 1, 1, 1, 3, 1, 5, 1,
880 1, 1, 1, 2, 2, 1, 2, 2, 0, 1,
881 1, 1, 2, 2, 3, 9, 9, 8, 14, 1,
882 1, 6, 5, 2, 6, 7, 1, 3, 1, 0,
883 2, 1, 5, 5, 5, 6, 6, 2, 4, 4,
884 6, 4, 4, 6, 6, 2, 7, 1, 2, 0,
885 1, 0, 3, 6, 3, 6, 2, 4, 6, 4
888 static const short yydefact[] = { 193,
889 89, 181, 180, 223, 82, 83, 84, 86, 87, 88,
890 85, 0, 97, 249, 177, 178, 205, 206, 0, 0,
891 0, 89, 0, 185, 224, 225, 97, 0, 0, 90,
892 91, 92, 93, 94, 95, 0, 0, 250, 249, 246,
893 81, 0, 0, 0, 0, 191, 0, 0, 0, 0,
894 0, 182, 183, 0, 0, 80, 226, 194, 179, 96,
895 110, 114, 115, 116, 117, 118, 119, 120, 121, 122,
896 123, 124, 125, 126, 1, 2, 0, 0, 0, 0,
897 240, 0, 0, 109, 128, 113, 241, 127, 217, 218,
898 219, 220, 221, 222, 245, 0, 0, 0, 252, 251,
899 261, 292, 260, 247, 248, 0, 0, 0, 0, 204,
900 192, 186, 184, 174, 175, 0, 0, 0, 0, 129,
901 0, 0, 0, 112, 134, 138, 0, 0, 143, 137,
902 254, 0, 253, 0, 0, 71, 75, 70, 74, 69,
903 73, 68, 72, 76, 77, 0, 291, 0, 272, 0,
904 97, 5, 6, 7, 8, 9, 10, 11, 12, 13,
905 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
906 24, 0, 0, 0, 0, 0, 0, 0, 0, 51,
907 52, 53, 54, 0, 0, 0, 0, 67, 55, 56,
908 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
909 0, 0, 0, 0, 0, 97, 264, 0, 288, 199,
910 196, 195, 197, 198, 200, 203, 0, 105, 105, 114,
911 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
912 0, 0, 0, 0, 105, 105, 0, 0, 0, 0,
913 0, 133, 215, 142, 140, 0, 229, 230, 231, 234,
914 235, 236, 232, 233, 227, 0, 0, 0, 0, 0,
915 0, 0, 0, 0, 0, 0, 0, 0, 238, 243,
916 242, 244, 0, 255, 0, 278, 271, 0, 25, 26,
917 27, 28, 29, 30, 31, 32, 33, 34, 0, 49,
918 50, 35, 36, 37, 38, 39, 40, 41, 42, 43,
919 44, 45, 46, 47, 48, 0, 100, 100, 297, 0,
920 0, 286, 0, 0, 0, 0, 0, 0, 0, 0,
921 0, 0, 0, 0, 0, 0, 201, 0, 189, 190,
922 157, 158, 3, 4, 155, 156, 159, 150, 151, 154,
923 0, 0, 0, 0, 153, 152, 187, 188, 111, 111,
924 136, 0, 139, 214, 208, 211, 212, 0, 0, 130,
925 228, 0, 0, 0, 0, 0, 0, 0, 0, 173,
926 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
927 0, 0, 293, 0, 295, 290, 0, 0, 0, 0,
928 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
929 0, 202, 0, 0, 107, 105, 145, 0, 0, 149,
930 0, 146, 131, 132, 135, 207, 209, 0, 103, 141,
931 0, 0, 0, 290, 0, 0, 0, 0, 0, 237,
932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
933 0, 0, 0, 0, 300, 0, 0, 0, 282, 283,
934 0, 0, 0, 0, 0, 279, 280, 0, 298, 0,
935 102, 108, 106, 144, 147, 148, 213, 210, 104, 98,
936 0, 0, 0, 0, 0, 0, 0, 0, 172, 0,
937 0, 0, 0, 0, 0, 0, 270, 0, 0, 100,
938 101, 100, 267, 289, 0, 0, 0, 0, 0, 273,
939 274, 275, 270, 0, 0, 216, 239, 0, 0, 161,
940 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
941 0, 269, 0, 276, 277, 0, 294, 296, 0, 0,
942 0, 281, 284, 285, 0, 299, 99, 0, 0, 0,
943 169, 0, 0, 163, 164, 165, 168, 160, 0, 258,
944 0, 0, 0, 268, 265, 0, 287, 166, 167, 0,
945 0, 0, 256, 0, 257, 0, 0, 266, 162, 170,
946 171, 0, 0, 0, 0, 0, 0, 263, 0, 0,
950 static const short yydefgoto[] = { 81,
951 335, 264, 265, 266, 289, 306, 267, 268, 231, 232,
952 146, 233, 22, 13, 36, 506, 383, 405, 470, 329,
953 406, 82, 83, 234, 85, 86, 127, 246, 370, 269,
954 371, 116, 584, 1, 55, 2, 59, 213, 46, 111,
955 217, 87, 417, 356, 357, 358, 37, 91, 14, 94,
956 15, 27, 16, 362, 270, 88, 272, 493, 39, 40,
957 41, 103, 104, 552, 105, 312, 522, 523, 206, 207,
961 static const short yypact[] = {-32768,
962 217, 541,-32768, 116,-32768,-32768,-32768,-32768,-32768,-32768,
963 -32768, 16, 111, 17,-32768,-32768,-32768,-32768, 34, -90,
964 61, 26, 19,-32768,-32768,-32768, 111, 144, 172,-32768,
965 -32768,-32768,-32768,-32768,-32768, 871, -26,-32768, -18,-32768,
966 47, 81, 87, 93, 98,-32768, 96, 144, 871, 69,
967 69,-32768,-32768, 69, 69,-32768,-32768,-32768,-32768,-32768,
968 100,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
969 -32768,-32768,-32768,-32768,-32768,-32768, 237, 238, -9, 215,
970 -32768, 134, 103,-32768,-32768, -111,-32768,-32768,-32768,-32768,
971 -32768,-32768,-32768,-32768,-32768, 909, 36, 148,-32768,-32768,
972 -32768, 1343,-32768,-32768,-32768, 228, 40, 248, 239, 241,
973 -32768,-32768,-32768,-32768,-32768, 937, 937, 965, 937,-32768,
974 110, 115, 506,-32768,-32768, -111, -98, 114, 673,-32768,
975 100, 1141,-32768, 1141, 1141,-32768,-32768,-32768,-32768,-32768,
976 -32768,-32768,-32768,-32768,-32768, 1141,-32768, 937,-32768, 213,
977 111,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
978 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
979 -32768, 195, 84, 937, 937, 937, 937, 937, 937,-32768,
980 -32768,-32768,-32768, 937, 937, 937, 937,-32768,-32768,-32768,
981 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
982 937, 937, 937, 937, 937, 111,-32768, 6,-32768,-32768,
983 -32768,-32768,-32768,-32768,-32768,-32768, -93, 122, 122, 91,
984 119, 129, 166, 169, 191, 193, 219, 223, 258, 260,
985 229, 229, 261, 1052, 122, 122, 937, 937, 124, -73,
986 937,-32768, 711,-32768, 133, 131,-32768,-32768,-32768,-32768,
987 -32768,-32768,-32768,-32768, 226, 195, 84, 137, 138, 140,
988 150, 154, 965, 156, 158, 167, 168, 170,-32768,-32768,
989 -32768,-32768, 171,-32768, 173,-32768,-32768, 871,-32768,-32768,
990 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 937,-32768,
991 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
992 -32768,-32768,-32768,-32768,-32768, 937, 174, 175,-32768, 1141,
993 164, 176, 177, 178, 179, 182, 183, 1141, 1141, 1141,
994 184, 299, 871, 937, 937, 310,-32768, -8,-32768,-32768,
995 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
996 749, 965, 614, 311,-32768,-32768,-32768,-32768, -55, -115,
997 -32768, 185, -111,-32768, 134,-32768, 190, 189, 777,-32768,
998 -32768, 316, 194, 198, 965, 965, 965, 965, 965,-32768,
999 -102, 965, 965, 965, 965, 965, 332, 344, 1141, 1141,
1000 1141, -2,-32768, 9,-32768, 208, 1141, 207, 937, 937,
1001 937, 937, 937, 212, 214, 218, 937, 937, 1141, 1141,
1002 220,-32768, 335, 349,-32768, 122,-32768, -61, -58,-32768,
1003 -70,-32768,-32768,-32768,-32768,-32768,-32768, 833, 336,-32768,
1004 231, 965, 965, 208, 235, 236, 240, 242, 965,-32768,
1005 243, 244, 245, 249, 330, 1141, 1141, 221, 250, 251,
1006 1141, 363, 1141, 937,-32768, 252, 1141, 253,-32768,-32768,
1007 254, 255, 1141, 1141, 1141,-32768,-32768, 256,-32768, 937,
1008 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 333,
1009 359, 257, 262, 263, 965, 965, 965, 965,-32768, 965,
1010 965, 965, 965, 937, 264, 259, 937, 1141, 1141, 265,
1011 -32768, 265,-32768, 267, 1141, 268, 937, 937, 937,-32768,
1012 -32768,-32768, 937, 1141, 375,-32768,-32768, 965, 965,-32768,
1013 269, 273, 270, 271, 274, 275, 276, 277, 278, 419,
1014 15, 267, 282,-32768,-32768, 381,-32768,-32768, 937, 281,
1015 1141,-32768,-32768,-32768, 286,-32768,-32768, 289, 292, 965,
1016 -32768, 965, 965,-32768,-32768,-32768,-32768,-32768, 1141,-32768,
1017 1230, 27, 410,-32768,-32768, 297,-32768,-32768,-32768, 295,
1018 303, 304,-32768, 308,-32768, 1230, 449,-32768,-32768,-32768,
1019 -32768, 450, 314, 1141, 1141, 453, 135,-32768, 1141, 454,
1020 -32768, 1141,-32768, 472, 473,-32768
1023 static const short yypgoto[] = {-32768,
1024 247, 372, 374, 378, 225, 227, 380, 383, -96, -95,
1025 -505,-32768, 436, 461, -139,-32768, -301, 67,-32768, -218,
1026 -32768, -45,-32768, -36,-32768, -66, -16,-32768, 132, 290,
1027 -214, 60,-32768,-32768,-32768,-32768, 441,-32768,-32768,-32768,
1028 -32768, 3,-32768, 72,-32768,-32768, 464,-32768,-32768,-32768,
1029 -32768,-32768, 490,-32768, -510, -104, -1, -86,-32768, 456,
1030 -32768, -81,-32768,-32768,-32768,-32768, 58, 20,-32768,-32768,
1038 static const short yytable[] = { 84,
1039 330, 144, 145, 113, 23, 89, 385, 441, 122, 133,
1040 38, 278, 84, 126, 92, 551, 347, 348, 443, 136,
1041 137, 138, 139, 140, 141, 142, 143, 271, 403, 271,
1042 271, 136, 137, 138, 139, 140, 141, 142, 143, 134,
1043 564, 271, -111, 23, 414, 38, 566, 130, 404, 429,
1044 135, 130, 49, 241, 442, 573, 126, 430, 326, 132,
1045 47, 276, 126, 242, 327, 442, 323, 5, 6, 7,
1046 50, 9, 51, 11, 17, 52, 18, 28, 241, 218,
1047 219, 429, 236, 53, 128, 42, 43, 44, 352, 309,
1048 429, 466, 313, 429, 211, 212, 464, 314, 315, 316,
1049 317, 465, 413, 114, 115, 45, 240, 130, 290, 291,
1050 117, 132, 245, 118, 119, 331, 332, 321, 322, 96,
1051 97, 98, 48, 99, 100, 101, 408, 409, 411, 346,
1052 324, 325, 273, 274, 90, -71, -71, 307, 308, 132,
1053 310, 311, 132, 93, 275, -75, -75, 132, 132, 132,
1054 132, 123, 136, 137, 138, 139, 140, 141, 142, 143,
1055 25, 17, 26, 18, 318, 319, 320, 132, 132, 56,
1056 349, 350, 550, 58, 353, 29, 30, 31, 32, 33,
1057 34, 35, -70, -70, 565, -74, -74, 463, 527, 60,
1058 528, 292, 293, 294, 295, 296, 297, 298, 299, 300,
1059 301, 302, 303, 304, 305, 271, 355, -69, -69, -73,
1060 -73, 99, 100, 271, 271, 271, -176, 124, 62, 63,
1061 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1062 74, 106, 379, 75, 76, -68, -68, 107, 401, -72,
1063 -72, 84, 17, 108, 18, 333, 334, 3, 109, 235,
1064 4, 110, 380, -112, 120, 121, 129, 210, 5, 6,
1065 7, 8, 9, 10, 11, 214, 237, 243, 215, 381,
1066 216, 238, 277, 328, 271, 271, 271, 399, -78, 12,
1067 -79, 337, 271, 351, 359, 360, 84, 400, 132, 361,
1068 365, 366, 353, 367, 271, 271, 279, 280, 281, 282,
1069 283, 284, 448, 368, 450, 451, 452, 369, 386, 372,
1070 456, 373, 285, 286, 287, 288, 394, 395, 396, 387,
1071 374, 375, 377, 376, 378, 382, 384, 388, 389, 390,
1072 391, 271, 271, 392, 393, 397, 271, 398, 271, 402,
1073 412, 418, 271, 419, 415, 421, 436, 422, 271, 271,
1074 271, 423, 132, 449, 132, 132, 132, 416, 437, 444,
1075 132, 457, 447, 453, 461, 454, 462, 77, 484, 455,
1076 78, 460, 403, 79, 487, 80, 125, 438, 439, 440,
1077 491, 355, 471, 271, 271, 446, 475, 476, 507, 505,
1078 271, 477, 537, 478, 480, 481, 482, 458, 459, 271,
1079 483, 488, 489, 495, 497, 498, 499, 132, 508, 503,
1080 532, 533, 534, 509, 521, 520, 526, 510, 529, 531,
1081 540, 542, 543, 504, 144, 145, 271, 541, 544, 545,
1082 546, 547, 548, 549, 485, 486, 553, 442, 555, 490,
1083 557, 492, 554, 558, 271, 496, 559, 519, 567, 569,
1084 132, 500, 501, 502, 568, 144, 145, 570, 571, 572,
1085 132, 132, 132, 574, 575, 576, 132, 579, 582, 271,
1086 271, 585, 586, 201, 271, 202, 102, 271, 336, 203,
1087 363, 204, 54, 364, 205, 469, 524, 525, 112, 468,
1088 57, 24, 132, 530, 95, 580, 424, 425, 426, 427,
1089 428, 494, 536, 431, 432, 433, 434, 435, 124, 62,
1090 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1091 73, 74, 535, 345, 75, 76, 0, 474, 0, 556,
1092 0, 0, 0, 17, 0, 18, 0, 0, 0, 0,
1093 0, 0, 0, 0, 0, 0, 0, 563, 0, 0,
1094 0, 0, 0, 472, 473, 0, 0, 0, 0, 0,
1095 479, 0, 0, 0, 0, 0, 0, -81, 17, 0,
1096 18, 0, 577, 578, 4, -81, -81, 581, 0, 0,
1097 583, 0, -81, -81, -81, -81, -81, -81, -81, 0,
1098 -81, 19, 0, 0, 0, 0, 0, 0, -81, 20,
1099 0, 0, 0, 21, 0, 0, 511, 512, 513, 514,
1100 0, 515, 516, 517, 518, 0, 124, 220, 221, 222,
1101 223, 224, 225, 226, 227, 228, 229, 230, 73, 74,
1102 0, 0, 75, 76, 0, 0, 0, 0, 0, 538,
1103 539, 17, 0, 18, 0, 0, 0, 0, 0, 0,
1104 0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
1105 0, 78, 0, 0, 79, 0, 80, 239, 0, 0,
1106 0, 560, 0, 561, 562, 124, 62, 63, 64, 65,
1107 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
1108 0, 75, 76, 0, 0, 0, 0, 0, 0, 0,
1109 17, 0, 18, 0, 0, 0, 0, 0, 0, 0,
1110 0, 0, 244, 124, 62, 63, 64, 65, 66, 67,
1111 68, 69, 70, 71, 72, 73, 74, 0, 0, 75,
1112 76, 0, 0, 0, 0, 0, 0, 0, 17, 0,
1113 18, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1114 354, 124, 220, 221, 222, 223, 224, 225, 226, 227,
1115 228, 229, 230, 73, 74, 0, 77, 75, 76, 78,
1116 0, 0, 79, 0, 80, 410, 17, 0, 18, 124,
1117 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1118 72, 73, 74, 0, 0, 75, 76, 0, 0, 0,
1119 0, 0, 0, 0, 17, 0, 18, 0, 0, 0,
1120 0, 0, 0, 0, 0, 0, 420, 0, 0, 0,
1121 0, 0, 0, 0, 0, 77, 0, 0, 78, 0,
1122 0, 79, 0, 80, 0, 124, 62, 63, 64, 65,
1123 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
1124 0, 75, 76, 0, 0, 0, 0, 0, 0, 0,
1125 17, 0, 18, 77, 0, 0, 78, 0, 0, 79,
1126 0, 80, 467, 61, 62, 63, 64, 65, 66, 67,
1127 68, 69, 70, 71, 72, 73, 74, 0, 0, 75,
1128 76, 0, 0, 0, 0, 0, 0, 0, 17, 0,
1129 18, 77, 0, 0, 78, 0, 407, 79, 0, 80,
1130 0, 131, 62, 63, 64, 65, 66, 67, 68, 69,
1131 70, 71, 72, 73, 74, 0, 0, 75, 76, 77,
1132 0, 0, 78, 0, 0, 79, 17, 80, 18, 124,
1133 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1134 72, 73, 74, 0, 0, 75, 76, 0, 0, 0,
1135 0, 0, 0, 0, 17, 0, 18, 124, 220, 221,
1136 222, 223, 224, 225, 226, 227, 228, 229, 230, 73,
1137 74, 0, 0, 75, 76, 77, 0, 0, 78, 0,
1138 0, 79, 17, 80, 18, 0, 0, 0, 0, 0,
1139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1141 0, 0, 0, 77, 0, 0, 78, 0, 0, 79,
1142 0, 80, 0, 0, 0, 0, 0, 0, 0, 0,
1143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1145 0, 77, 0, 0, 78, 0, 0, 79, 0, 80,
1146 75, 76, 0, 338, 339, 340, 0, 0, 0, 17,
1147 0, 18, 0, 0, 0, 0, 0, 0, 0, 77,
1148 0, 0, 78, 0, 0, 79, 0, 80, 0, 0,
1149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1150 0, 0, 0, 0, 0, 0, 0, 77, 0, 0,
1151 78, 0, 0, 79, 0, 80, 0, 0, 0, 0,
1152 0, 152, 153, 154, 155, 156, 157, 158, 159, 160,
1153 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1154 171, 256, 257, 0, 0, 0, 0, 247, 248, 75,
1155 76, 249, 250, 251, 252, 253, 254, 0, 17, 0,
1156 18, 0, 0, 0, 0, 0, 0, 0, 258, 0,
1157 259, 180, 181, 182, 183, 0, 260, 261, 262, 188,
1158 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1159 199, 200, 255, 0, 0, 0, 0, 341, 0, 0,
1160 342, 0, 343, 0, 0, 344, 0, 0, 0, 0,
1161 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1162 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
1163 256, 257, 0, 0, 0, 0, 247, 248, 0, 0,
1164 249, 250, 251, 252, 253, 254, 0, 0, 0, 0,
1165 0, 0, 0, 0, 0, 0, 0, 258, 0, 259,
1166 180, 181, 182, 183, 0, 260, 261, 262, 188, 189,
1167 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
1168 200, 255, 0, 0, 0, 0, 0, 0, 0, 263,
1169 0, 0, 0, 0, 0, 0, 0, 0, 0, 152,
1170 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
1171 163, 164, 165, 166, 167, 168, 169, 170, 171, 256,
1172 257, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1173 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1174 0, 0, 0, 0, 0, 0, 258, 0, 259, 180,
1175 181, 182, 183, 0, 260, 261, 262, 188, 189, 190,
1176 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
1177 147, 0, 0, 0, 0, 0, 0, 0, 263, 0,
1178 0, 148, 0, 0, 0, 0, 0, 0, 0, 0,
1179 0, 0, 149, 150, 0, 0, 0, 0, 0, 0,
1180 0, 0, 0, 0, 0, 0, 0, 0, 151, 0,
1181 0, 0, 152, 153, 154, 155, 156, 157, 158, 159,
1182 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1183 170, 171, 172, 173, 0, 0, 0, 0, 0, 0,
1184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1185 0, 0, 0, 0, 174, 175, 176, 0, 0, 177,
1186 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1187 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1191 static const short yycheck[] = { 36,
1192 219, 98, 98, 49, 2, 32, 308, 10, 18, 96,
1193 29, 151, 49, 80, 33, 521, 235, 236, 10, 5,
1194 6, 7, 8, 9, 10, 11, 12, 132, 37, 134,
1195 135, 5, 6, 7, 8, 9, 10, 11, 12, 4,
1196 551, 146, 154, 41, 160, 29, 552, 163, 57, 152,
1197 15, 163, 27, 152, 57, 566, 123, 160, 152, 96,
1198 151, 148, 129, 162, 158, 57, 206, 42, 43, 44,
1199 45, 46, 47, 48, 28, 50, 30, 62, 152, 116,
1200 117, 152, 119, 58, 82, 52, 53, 54, 162, 176,
1201 152, 162, 179, 152, 55, 56, 158, 184, 185, 186,
1202 187, 160, 158, 35, 36, 72, 123, 163, 25, 26,
1203 51, 148, 129, 54, 55, 25, 26, 204, 205, 73,
1204 74, 75, 62, 77, 78, 79, 341, 342, 343, 234,
1205 125, 126, 134, 135, 161, 17, 18, 174, 175, 176,
1206 177, 178, 179, 162, 146, 17, 18, 184, 185, 186,
1207 187, 161, 5, 6, 7, 8, 9, 10, 11, 12,
1208 45, 28, 47, 30, 201, 202, 203, 204, 205, 151,
1209 237, 238, 158, 30, 241, 65, 66, 67, 68, 69,
1210 70, 71, 17, 18, 158, 17, 18, 406, 490, 18,
1211 492, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1212 117, 118, 119, 120, 121, 310, 243, 17, 18, 17,
1213 18, 77, 78, 318, 319, 320, 0, 3, 4, 5,
1214 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1215 16, 151, 278, 19, 20, 17, 18, 151, 325, 17,
1216 18, 278, 28, 151, 30, 17, 18, 31, 151, 118,
1217 34, 156, 289, 154, 18, 18, 154, 30, 42, 43,
1218 44, 45, 46, 47, 48, 18, 157, 154, 30, 306,
1219 30, 157, 60, 152, 379, 380, 381, 323, 21, 63,
1220 21, 21, 387, 160, 152, 155, 323, 324, 325, 64,
1221 154, 154, 359, 154, 399, 400, 102, 103, 104, 105,
1222 106, 107, 389, 154, 391, 392, 393, 154, 310, 154,
1223 397, 154, 118, 119, 120, 121, 318, 319, 320, 156,
1224 154, 154, 152, 154, 152, 152, 152, 152, 152, 152,
1225 152, 436, 437, 152, 152, 152, 441, 39, 443, 30,
1226 30, 152, 447, 155, 160, 30, 15, 154, 453, 454,
1227 455, 154, 389, 390, 391, 392, 393, 355, 15, 152,
1228 397, 398, 156, 152, 30, 152, 18, 153, 39, 152,
1229 156, 152, 37, 159, 154, 161, 162, 379, 380, 381,
1230 18, 418, 152, 488, 489, 387, 152, 152, 30, 57,
1231 495, 152, 18, 152, 152, 152, 152, 399, 400, 504,
1232 152, 152, 152, 152, 152, 152, 152, 444, 152, 154,
1233 497, 498, 499, 152, 156, 152, 152, 155, 152, 152,
1234 152, 152, 152, 460, 521, 521, 531, 155, 155, 155,
1235 155, 155, 155, 15, 436, 437, 155, 57, 158, 441,
1236 155, 443, 529, 155, 549, 447, 155, 484, 39, 155,
1237 487, 453, 454, 455, 158, 552, 552, 155, 155, 152,
1238 497, 498, 499, 15, 15, 152, 503, 15, 15, 574,
1239 575, 0, 0, 102, 579, 102, 41, 582, 232, 102,
1240 256, 102, 22, 257, 102, 419, 488, 489, 48, 418,
1241 27, 2, 529, 495, 39, 577, 365, 366, 367, 368,
1242 369, 444, 504, 372, 373, 374, 375, 376, 3, 4,
1243 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1244 15, 16, 503, 234, 19, 20, -1, 424, -1, 531,
1245 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1246 -1, -1, -1, -1, -1, -1, -1, 549, -1, -1,
1247 -1, -1, -1, 422, 423, -1, -1, -1, -1, -1,
1248 429, -1, -1, -1, -1, -1, -1, 27, 28, -1,
1249 30, -1, 574, 575, 34, 35, 36, 579, -1, -1,
1250 582, -1, 42, 43, 44, 45, 46, 47, 48, -1,
1251 50, 51, -1, -1, -1, -1, -1, -1, 58, 59,
1252 -1, -1, -1, 63, -1, -1, 475, 476, 477, 478,
1253 -1, 480, 481, 482, 483, -1, 3, 4, 5, 6,
1254 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1255 -1, -1, 19, 20, -1, -1, -1, -1, -1, 508,
1256 509, 28, -1, 30, -1, -1, -1, -1, -1, -1,
1257 -1, -1, -1, -1, -1, -1, -1, -1, 153, -1,
1258 -1, 156, -1, -1, 159, -1, 161, 162, -1, -1,
1259 -1, 540, -1, 542, 543, 3, 4, 5, 6, 7,
1260 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1261 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1262 28, -1, 30, -1, -1, -1, -1, -1, -1, -1,
1263 -1, -1, 40, 3, 4, 5, 6, 7, 8, 9,
1264 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1265 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
1266 30, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1267 40, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1268 12, 13, 14, 15, 16, -1, 153, 19, 20, 156,
1269 -1, -1, 159, -1, 161, 162, 28, -1, 30, 3,
1270 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1271 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1272 -1, -1, -1, -1, 28, -1, 30, -1, -1, -1,
1273 -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
1274 -1, -1, -1, -1, -1, 153, -1, -1, 156, -1,
1275 -1, 159, -1, 161, -1, 3, 4, 5, 6, 7,
1276 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1277 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1278 28, -1, 30, 153, -1, -1, 156, -1, -1, 159,
1279 -1, 161, 40, 3, 4, 5, 6, 7, 8, 9,
1280 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1281 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
1282 30, 153, -1, -1, 156, -1, 158, 159, -1, 161,
1283 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1284 12, 13, 14, 15, 16, -1, -1, 19, 20, 153,
1285 -1, -1, 156, -1, -1, 159, 28, 161, 30, 3,
1286 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1287 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
1288 -1, -1, -1, -1, 28, -1, 30, 3, 4, 5,
1289 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1290 16, -1, -1, 19, 20, 153, -1, -1, 156, -1,
1291 -1, 159, 28, 161, 30, -1, -1, -1, -1, -1,
1292 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1293 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1294 -1, -1, -1, 153, -1, -1, 156, -1, -1, 159,
1295 -1, 161, -1, -1, -1, -1, -1, -1, -1, -1,
1296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1297 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1298 -1, 153, -1, -1, 156, -1, -1, 159, -1, 161,
1299 19, 20, -1, 22, 23, 24, -1, -1, -1, 28,
1300 -1, 30, -1, -1, -1, -1, -1, -1, -1, 153,
1301 -1, -1, 156, -1, -1, 159, -1, 161, -1, -1,
1302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1303 -1, -1, -1, -1, -1, -1, -1, 153, -1, -1,
1304 156, -1, -1, 159, -1, 161, -1, -1, -1, -1,
1305 -1, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1306 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1307 99, 100, 101, -1, -1, -1, -1, 17, 18, 19,
1308 20, 21, 22, 23, 24, 25, 26, -1, 28, -1,
1309 30, -1, -1, -1, -1, -1, -1, -1, 127, -1,
1310 129, 130, 131, 132, 133, -1, 135, 136, 137, 138,
1311 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
1312 149, 150, 62, -1, -1, -1, -1, 156, -1, -1,
1313 159, -1, 161, -1, -1, 164, -1, -1, -1, -1,
1314 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1315 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
1316 100, 101, -1, -1, -1, -1, 17, 18, -1, -1,
1317 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
1318 -1, -1, -1, -1, -1, -1, -1, 127, -1, 129,
1319 130, 131, 132, 133, -1, 135, 136, 137, 138, 139,
1320 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
1321 150, 62, -1, -1, -1, -1, -1, -1, -1, 159,
1322 -1, -1, -1, -1, -1, -1, -1, -1, -1, 80,
1323 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
1324 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
1325 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1327 -1, -1, -1, -1, -1, -1, 127, -1, 129, 130,
1328 131, 132, 133, -1, 135, 136, 137, 138, 139, 140,
1329 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1330 38, -1, -1, -1, -1, -1, -1, -1, 159, -1,
1331 -1, 49, -1, -1, -1, -1, -1, -1, -1, -1,
1332 -1, -1, 60, 61, -1, -1, -1, -1, -1, -1,
1333 -1, -1, -1, -1, -1, -1, -1, -1, 76, -1,
1334 -1, -1, 80, 81, 82, 83, 84, 85, 86, 87,
1335 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
1336 98, 99, 100, 101, -1, -1, -1, -1, -1, -1,
1337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1338 -1, -1, -1, -1, 122, 123, 124, -1, -1, 127,
1339 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1340 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1343 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1344 #line 3 "/usr/share/bison.simple"
1345 /* This file comes from bison-1.28. */
1347 /* Skeleton output parser for bison,
1348 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
1350 This program is free software; you can redistribute it and/or modify
1351 it under the terms of the GNU General Public License as published by
1352 the Free Software Foundation; either version 2, or (at your option)
1355 This program is distributed in the hope that it will be useful,
1356 but WITHOUT ANY WARRANTY; without even the implied warranty of
1357 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1358 GNU General Public License for more details.
1360 You should have received a copy of the GNU General Public License
1361 along with this program; if not, write to the Free Software
1362 Foundation, Inc., 59 Temple Place - Suite 330,
1363 Boston, MA 02111-1307, USA. */
1365 /* As a special exception, when this file is copied by Bison into a
1366 Bison output file, you may use that output file without restriction.
1367 This special exception was added by the Free Software Foundation
1368 in version 1.24 of Bison. */
1370 /* This is the parser code that is written into each bison parser
1371 when the %semantic_parser declaration is not specified in the grammar.
1372 It was written by Richard Stallman by simplifying the hairy parser
1373 used when %semantic_parser is specified. */
1375 #ifndef YYSTACK_USE_ALLOCA
1377 #define YYSTACK_USE_ALLOCA
1378 #else /* alloca not defined */
1380 #define YYSTACK_USE_ALLOCA
1381 #define alloca __builtin_alloca
1382 #else /* not GNU C. */
1383 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
1384 #define YYSTACK_USE_ALLOCA
1386 #else /* not sparc */
1387 /* We think this test detects Watcom and Microsoft C. */
1388 /* This used to test MSDOS, but that is a bad idea
1389 since that symbol is in the user namespace. */
1390 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
1391 #if 0 /* No need for malloc.h, which pollutes the namespace;
1392 instead, just don't use alloca. */
1395 #else /* not MSDOS, or __TURBOC__ */
1397 /* I don't know what this was needed for, but it pollutes the namespace.
1398 So I turned it off. rms, 2 May 1997. */
1399 /* #include <malloc.h> */
1401 #define YYSTACK_USE_ALLOCA
1402 #else /* not MSDOS, or __TURBOC__, or _AIX */
1404 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
1405 and on HPUX 10. Eventually we can turn this on. */
1406 #define YYSTACK_USE_ALLOCA
1407 #define alloca __builtin_alloca
1410 #endif /* not _AIX */
1411 #endif /* not MSDOS, or __TURBOC__ */
1412 #endif /* not sparc */
1413 #endif /* not GNU C */
1414 #endif /* alloca not defined */
1415 #endif /* YYSTACK_USE_ALLOCA not defined */
1417 #ifdef YYSTACK_USE_ALLOCA
1418 #define YYSTACK_ALLOC alloca
1420 #define YYSTACK_ALLOC malloc
1423 /* Note: there must be only one dollar sign in this file.
1424 It is replaced by the list of actions, each action
1425 as one case of the switch. */
1427 #define yyerrok (yyerrstatus = 0)
1428 #define yyclearin (yychar = YYEMPTY)
1431 #define YYACCEPT goto yyacceptlab
1432 #define YYABORT goto yyabortlab
1433 #define YYERROR goto yyerrlab1
1434 /* Like YYERROR except do call yyerror.
1435 This remains here temporarily to ease the
1436 transition to the new meaning of YYERROR, for GCC.
1437 Once GCC version 2 has supplanted version 1, this can go. */
1438 #define YYFAIL goto yyerrlab
1439 #define YYRECOVERING() (!!yyerrstatus)
1440 #define YYBACKUP(token, value) \
1442 if (yychar == YYEMPTY && yylen == 1) \
1443 { yychar = (token), yylval = (value); \
1444 yychar1 = YYTRANSLATE (yychar); \
1449 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1453 #define YYERRCODE 256
1456 #define YYLEX yylex()
1462 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1464 #define YYLEX yylex(&yylval, &yylloc)
1466 #else /* not YYLSP_NEEDED */
1468 #define YYLEX yylex(&yylval, YYLEX_PARAM)
1470 #define YYLEX yylex(&yylval)
1472 #endif /* not YYLSP_NEEDED */
1475 /* If nonreentrant, generate the variables here */
1479 int yychar; /* the lookahead symbol */
1480 YYSTYPE yylval; /* the semantic value of the */
1481 /* lookahead symbol */
1484 YYLTYPE yylloc; /* location data for the lookahead */
1488 int yynerrs; /* number of parse errors so far */
1489 #endif /* not YYPURE */
1492 int yydebug; /* nonzero means print parse trace */
1493 /* Since this is uninitialized, it does not stop multiple parsers
1497 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1500 #define YYINITDEPTH 200
1503 /* YYMAXDEPTH is the maximum size the stacks can grow to
1504 (effective only if the built-in stack extension method is used). */
1511 #define YYMAXDEPTH 10000
1514 /* Define __yy_memcpy. Note that the size argument
1515 should be passed with type unsigned int, because that is what the non-GCC
1516 definitions require. With GCC, __builtin_memcpy takes an arg
1517 of type size_t, but it can handle unsigned int. */
1519 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1520 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1521 #else /* not GNU C or C++ */
1524 /* This is the most reliable way to avoid incompatibilities
1525 in available built-in functions on various systems. */
1527 __yy_memcpy (to, from, count)
1532 register char *f = from;
1533 register char *t = to;
1534 register int i = count;
1540 #else /* __cplusplus */
1542 /* This is the most reliable way to avoid incompatibilities
1543 in available built-in functions on various systems. */
1545 __yy_memcpy (char *to, char *from, unsigned int count)
1547 register char *t = to;
1548 register char *f = from;
1549 register int i = count;
1558 #line 217 "/usr/share/bison.simple"
1560 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1561 into yyparse. The argument should have type void *.
1562 It should actually point to an object.
1563 Grammar actions can access the variable by casting it
1564 to the proper pointer type. */
1566 #ifdef YYPARSE_PARAM
1568 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1569 #define YYPARSE_PARAM_DECL
1570 #else /* not __cplusplus */
1571 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1572 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1573 #endif /* not __cplusplus */
1574 #else /* not YYPARSE_PARAM */
1575 #define YYPARSE_PARAM_ARG
1576 #define YYPARSE_PARAM_DECL
1577 #endif /* not YYPARSE_PARAM */
1579 /* Prevent warning if -Wstrict-prototypes. */
1581 #ifdef YYPARSE_PARAM
1582 int yyparse (void *);
1589 yyparse(YYPARSE_PARAM_ARG)
1592 register int yystate;
1594 register short *yyssp;
1595 register YYSTYPE *yyvsp;
1596 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1597 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1599 short yyssa[YYINITDEPTH]; /* the state stack */
1600 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1602 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1603 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1606 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1607 YYLTYPE *yyls = yylsa;
1610 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1612 #define YYPOPSTACK (yyvsp--, yyssp--)
1615 int yystacksize = YYINITDEPTH;
1616 int yyfree_stacks = 0;
1627 YYSTYPE yyval; /* the variable used to return */
1628 /* semantic values from the action */
1635 fprintf(stderr, "Starting parse\n");
1641 yychar = YYEMPTY; /* Cause a token to be read. */
1643 /* Initialize stack pointers.
1644 Waste one element of value and location stack
1645 so that they stay on the same level as the state stack.
1646 The wasted elements are never initialized. */
1654 /* Push a new state, which is found in yystate . */
1655 /* In all cases, when you get here, the value and location stacks
1656 have just been pushed. so pushing a state here evens the stacks. */
1661 if (yyssp >= yyss + yystacksize - 1)
1663 /* Give user a chance to reallocate the stack */
1664 /* Use copies of these so that the &'s don't force the real ones into memory. */
1665 YYSTYPE *yyvs1 = yyvs;
1666 short *yyss1 = yyss;
1668 YYLTYPE *yyls1 = yyls;
1671 /* Get the current used size of the three stacks, in elements. */
1672 int size = yyssp - yyss + 1;
1675 /* Each stack pointer address is followed by the size of
1676 the data in use in that stack, in bytes. */
1678 /* This used to be a conditional around just the two extra args,
1679 but that might be undefined if yyoverflow is a macro. */
1680 yyoverflow("parser stack overflow",
1681 &yyss1, size * sizeof (*yyssp),
1682 &yyvs1, size * sizeof (*yyvsp),
1683 &yyls1, size * sizeof (*yylsp),
1686 yyoverflow("parser stack overflow",
1687 &yyss1, size * sizeof (*yyssp),
1688 &yyvs1, size * sizeof (*yyvsp),
1692 yyss = yyss1; yyvs = yyvs1;
1696 #else /* no yyoverflow */
1697 /* Extend the stack our own way. */
1698 if (yystacksize >= YYMAXDEPTH)
1700 yyerror("parser stack overflow");
1712 if (yystacksize > YYMAXDEPTH)
1713 yystacksize = YYMAXDEPTH;
1714 #ifndef YYSTACK_USE_ALLOCA
1717 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1718 __yy_memcpy ((char *)yyss, (char *)yyss1,
1719 size * (unsigned int) sizeof (*yyssp));
1720 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1721 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1722 size * (unsigned int) sizeof (*yyvsp));
1724 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1725 __yy_memcpy ((char *)yyls, (char *)yyls1,
1726 size * (unsigned int) sizeof (*yylsp));
1728 #endif /* no yyoverflow */
1730 yyssp = yyss + size - 1;
1731 yyvsp = yyvs + size - 1;
1733 yylsp = yyls + size - 1;
1738 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1741 if (yyssp >= yyss + yystacksize - 1)
1747 fprintf(stderr, "Entering state %d\n", yystate);
1753 /* Do appropriate processing given the current state. */
1754 /* Read a lookahead token if we need one and don't already have one. */
1757 /* First try to decide what to do without reference to lookahead token. */
1759 yyn = yypact[yystate];
1763 /* Not known => get a lookahead token if don't already have one. */
1765 /* yychar is either YYEMPTY or YYEOF
1766 or a valid token in external form. */
1768 if (yychar == YYEMPTY)
1772 fprintf(stderr, "Reading a token: ");
1777 /* Convert token to internal form (in yychar1) for indexing tables with */
1779 if (yychar <= 0) /* This means end of input. */
1782 yychar = YYEOF; /* Don't call YYLEX any more */
1786 fprintf(stderr, "Now at end of input.\n");
1791 yychar1 = YYTRANSLATE(yychar);
1796 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1797 /* Give the individual parser a way to print the precise meaning
1798 of a token, for further debugging info. */
1800 YYPRINT (stderr, yychar, yylval);
1802 fprintf (stderr, ")\n");
1808 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1813 /* yyn is what to do for this token type in this state.
1814 Negative => reduce, -yyn is rule number.
1815 Positive => shift, yyn is new state.
1816 New state is final state => don't bother to shift,
1817 just return success.
1818 0, or most negative number => error. */
1833 /* Shift the lookahead token. */
1837 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1840 /* Discard the token being shifted unless it is eof. */
1841 if (yychar != YYEOF)
1849 /* count tokens shifted since error; after three, turn off error status. */
1850 if (yyerrstatus) yyerrstatus--;
1855 /* Do the default action for the current state. */
1858 yyn = yydefact[yystate];
1862 /* Do a reduction. yyn is the number of a rule to reduce with. */
1866 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1873 fprintf (stderr, "Reducing via rule %d (line %d), ",
1876 /* Print the symbols being reduced, and their result. */
1877 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1878 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1879 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1887 #line 491 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1889 yyval.String = yyvsp[-1].String;
1893 #line 494 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1895 yyval.String = new std::string("");
1899 #line 501 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1900 { yyval.String = new std::string(""); ;
1903 #line 506 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1905 *yyvsp[-1].String += *yyvsp[0].String;
1906 delete yyvsp[0].String;
1907 yyval.String = yyvsp[-1].String;
1911 #line 511 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1912 { yyval.String = new std::string(""); ;
1915 #line 516 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1916 { yyval.String = new std::string(); ;
1919 #line 517 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1920 { *yyvsp[-1].String += " " + *yyvsp[0].String; delete yyvsp[0].String; yyval.String = yyvsp[-1].String; ;
1923 #line 520 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1924 { yyval.String = new std::string(); ;
1927 #line 521 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1929 yyvsp[-1].String->insert(0, ", ");
1930 *yyvsp[-1].String += " " + *yyvsp[0].String;
1931 delete yyvsp[0].String;
1932 yyval.String = yyvsp[-1].String;
1936 #line 529 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1938 *yyvsp[-1].String += " " + *yyvsp[0].String;
1939 delete yyvsp[0].String;
1940 yyval.String = yyvsp[-1].String;
1944 #line 535 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1945 { yyval.String = new std::string(); ;
1948 #line 539 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1949 { yyval.String = new std::string(); ;
1952 #line 540 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1954 yyvsp[-1].String->insert(0, ", ");
1955 if (!yyvsp[0].String->empty())
1956 *yyvsp[-1].String += " " + *yyvsp[0].String;
1957 delete yyvsp[0].String;
1958 yyval.String = yyvsp[-1].String;
1962 #line 550 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1964 *yyvsp[-1].String += " " + *yyvsp[0].String;
1965 delete yyvsp[0].String;
1966 yyval.String = yyvsp[-1].String;
1970 #line 572 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1972 yyval.Type = new TypeInfo(yyvsp[0].String, OpaqueTy);
1976 #line 575 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1978 yyval.Type = new TypeInfo(yyvsp[0].String, UnresolvedTy);
1982 #line 578 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1984 yyval.Type = yyvsp[0].Type;
1988 #line 581 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1989 { // Type UpReference
1990 yyvsp[0].String->insert(0, "\\");
1991 yyval.Type = new TypeInfo(yyvsp[0].String, UpRefTy);
1995 #line 585 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
1996 { // Function derived type?
1997 std::string newTy( yyvsp[-3].Type->getNewTy() + "(");
1998 for (unsigned i = 0; i < yyvsp[-1].TypeVec->size(); ++i) {
2001 if ((*yyvsp[-1].TypeVec)[i]->isVoid())
2004 newTy += (*yyvsp[-1].TypeVec)[i]->getNewTy();
2007 yyval.Type = new TypeInfo(new std::string(newTy), yyvsp[-3].Type, yyvsp[-1].TypeVec);
2011 #line 598 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2012 { // Sized array type?
2013 yyvsp[-3].String->insert(0,"[ ");
2014 *yyvsp[-3].String += " x " + yyvsp[-1].Type->getNewTy() + " ]";
2015 uint64_t elems = atoi(yyvsp[-3].String->c_str());
2016 yyval.Type = new TypeInfo(yyvsp[-3].String, ArrayTy, yyvsp[-1].Type, elems);
2020 #line 604 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2021 { // Packed array type?
2022 yyvsp[-3].String->insert(0,"< ");
2023 *yyvsp[-3].String += " x " + yyvsp[-1].Type->getNewTy() + " >";
2024 uint64_t elems = atoi(yyvsp[-3].String->c_str());
2025 yyval.Type = new TypeInfo(yyvsp[-3].String, PackedTy, yyvsp[-1].Type, elems);
2029 #line 610 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2030 { // Structure type?
2031 std::string newTy("{");
2032 for (unsigned i = 0; i < yyvsp[-1].TypeVec->size(); ++i) {
2035 newTy += (*yyvsp[-1].TypeVec)[i]->getNewTy();
2038 yyval.Type = new TypeInfo(new std::string(newTy), StructTy, yyvsp[-1].TypeVec);
2042 #line 620 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2043 { // Empty structure type?
2044 yyval.Type = new TypeInfo(new std::string("{}"), StructTy, new TypeList());
2048 #line 623 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2049 { // Packed Structure type?
2050 std::string newTy("<{");
2051 for (unsigned i = 0; i < yyvsp[-2].TypeVec->size(); ++i) {
2054 newTy += (*yyvsp[-2].TypeVec)[i]->getNewTy();
2057 yyval.Type = new TypeInfo(new std::string(newTy), PackedStructTy, yyvsp[-2].TypeVec);
2061 #line 633 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2062 { // Empty packed structure type?
2063 yyval.Type = new TypeInfo(new std::string("<{}>"), PackedStructTy, new TypeList());
2067 #line 636 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2069 yyval.Type = yyvsp[-1].Type->getPointerType();
2073 #line 644 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2075 yyval.TypeVec = new TypeList();
2076 yyval.TypeVec->push_back(yyvsp[0].Type);
2080 #line 648 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2082 yyval.TypeVec = yyvsp[-2].TypeVec;
2083 yyval.TypeVec->push_back(yyvsp[0].Type);
2087 #line 656 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2089 yyval.TypeVec = yyvsp[-2].TypeVec;
2090 yyval.TypeVec->push_back(new TypeInfo("void",VoidTy));
2091 delete yyvsp[0].String;
2095 #line 661 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2097 yyval.TypeVec = new TypeList();
2098 yyval.TypeVec->push_back(new TypeInfo("void",VoidTy));
2099 delete yyvsp[0].String;
2103 #line 666 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2105 yyval.TypeVec = new TypeList();
2109 #line 676 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2110 { // Nonempty unsized arr
2111 yyval.Const.type = yyvsp[-3].Type;
2112 yyval.Const.cnst = new std::string(yyvsp[-3].Type->getNewTy());
2113 *yyval.Const.cnst += " [ " + *yyvsp[-1].String + " ]";
2114 delete yyvsp[-1].String;
2118 #line 682 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2120 yyval.Const.type = yyvsp[-2].Type;
2121 yyval.Const.cnst = new std::string(yyvsp[-2].Type->getNewTy());
2122 *yyval.Const.cnst += "[ ]";
2126 #line 687 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2128 yyval.Const.type = yyvsp[-2].Type;
2129 yyval.Const.cnst = new std::string(yyvsp[-2].Type->getNewTy());
2130 *yyval.Const.cnst += " c" + *yyvsp[0].String;
2131 delete yyvsp[0].String;
2135 #line 693 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2136 { // Nonempty unsized arr
2137 yyval.Const.type = yyvsp[-3].Type;
2138 yyval.Const.cnst = new std::string(yyvsp[-3].Type->getNewTy());
2139 *yyval.Const.cnst += " < " + *yyvsp[-1].String + " >";
2140 delete yyvsp[-1].String;
2144 #line 699 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2146 yyval.Const.type = yyvsp[-3].Type;
2147 yyval.Const.cnst = new std::string(yyvsp[-3].Type->getNewTy());
2148 *yyval.Const.cnst += " { " + *yyvsp[-1].String + " }";
2149 delete yyvsp[-1].String;
2153 #line 705 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2155 yyval.Const.type = yyvsp[-2].Type;
2156 yyval.Const.cnst = new std::string(yyvsp[-2].Type->getNewTy());
2157 *yyval.Const.cnst += " {}";
2161 #line 710 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2163 yyval.Const.type = yyvsp[-1].Type;
2164 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2165 *yyval.Const.cnst += " " + *yyvsp[0].String;
2166 delete yyvsp[0].String;
2170 #line 716 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2172 yyval.Const.type = yyvsp[-1].Type;
2173 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2174 *yyval.Const.cnst += " " + *yyvsp[0].String;
2175 delete yyvsp[0].String;
2179 #line 722 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2181 std::string Name = getUniqueName(yyvsp[0].String,yyvsp[-1].Type);
2182 yyval.Const.type = yyvsp[-1].Type;
2183 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2184 *yyval.Const.cnst += " " + Name;
2185 delete yyvsp[0].String;
2189 #line 729 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2191 yyval.Const.type = yyvsp[-1].Type;
2192 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2193 *yyval.Const.cnst += " " + *yyvsp[0].String;
2194 delete yyvsp[0].String;
2198 #line 735 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2200 yyval.Const.type = yyvsp[-1].Type;
2201 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2202 *yyval.Const.cnst += " " + *yyvsp[0].String;
2203 delete yyvsp[0].String;
2207 #line 741 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2208 { // integral constants
2209 yyval.Const.type = yyvsp[-1].Type;
2210 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2211 *yyval.Const.cnst += " " + *yyvsp[0].String;
2212 delete yyvsp[0].String;
2216 #line 747 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2217 { // integral constants
2218 yyval.Const.type = yyvsp[-1].Type;
2219 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2220 *yyval.Const.cnst += " " + *yyvsp[0].String;
2221 delete yyvsp[0].String;
2225 #line 753 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2226 { // Boolean constants
2227 yyval.Const.type = yyvsp[-1].Type;
2228 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2229 *yyval.Const.cnst += " " + *yyvsp[0].String;
2230 delete yyvsp[0].String;
2234 #line 759 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2235 { // Boolean constants
2236 yyval.Const.type = yyvsp[-1].Type;
2237 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2238 *yyval.Const.cnst += " " + *yyvsp[0].String;
2239 delete yyvsp[0].String;
2243 #line 765 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2244 { // Float & Double constants
2245 yyval.Const.type = yyvsp[-1].Type;
2246 yyval.Const.cnst = new std::string(yyvsp[-1].Type->getNewTy());
2247 *yyval.Const.cnst += " " + *yyvsp[0].String;
2248 delete yyvsp[0].String;
2252 #line 773 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2254 std::string source = *yyvsp[-3].Const.cnst;
2255 TypeInfo* DstTy = ResolveType(yyvsp[-1].Type);
2256 if (*yyvsp[-5].String == "cast") {
2257 // Call getCastUpgrade to upgrade the old cast
2258 yyval.String = new std::string(getCastUpgrade(source, yyvsp[-3].Const.type, DstTy, true));
2260 // Nothing to upgrade, just create the cast constant expr
2261 yyval.String = new std::string(*yyvsp[-5].String);
2262 *yyval.String += "( " + source + " to " + yyvsp[-1].Type->getNewTy() + ")";
2264 delete yyvsp[-5].String; yyvsp[-3].Const.destroy(); delete yyvsp[-2].String;
2268 #line 786 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2270 *yyvsp[-4].String += "(" + *yyvsp[-2].Const.cnst;
2271 for (unsigned i = 0; i < yyvsp[-1].ValList->size(); ++i) {
2272 ValueInfo& VI = (*yyvsp[-1].ValList)[i];
2273 *yyvsp[-4].String += ", " + *VI.val;
2276 *yyvsp[-4].String += ")";
2277 yyval.String = yyvsp[-4].String;
2278 yyvsp[-2].Const.destroy();
2279 delete yyvsp[-1].ValList;
2283 #line 798 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2285 *yyvsp[-7].String += "(" + *yyvsp[-5].Const.cnst + "," + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2286 yyvsp[-5].Const.destroy(); yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2287 yyval.String = yyvsp[-7].String;
2291 #line 803 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2293 const char* op = getDivRemOpcode(*yyvsp[-5].String, yyvsp[-3].Const.type);
2294 yyval.String = new std::string(op);
2295 *yyval.String += "(" + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2296 delete yyvsp[-5].String; yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2300 #line 809 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2302 *yyvsp[-5].String += "(" + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2303 yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2304 yyval.String = yyvsp[-5].String;
2308 #line 814 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2310 *yyvsp[-5].String = getCompareOp(*yyvsp[-5].String, yyvsp[-3].Const.type);
2311 *yyvsp[-5].String += "(" + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2312 yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2313 yyval.String = yyvsp[-5].String;
2317 #line 820 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2319 *yyvsp[-6].String += "(" + *yyvsp[-5].String + "," + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2320 delete yyvsp[-5].String; yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2321 yyval.String = yyvsp[-6].String;
2325 #line 825 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2327 *yyvsp[-6].String += "(" + *yyvsp[-5].String + "," + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2328 delete yyvsp[-5].String; yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2329 yyval.String = yyvsp[-6].String;
2333 #line 830 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2335 const char* shiftop = yyvsp[-5].String->c_str();
2336 if (*yyvsp[-5].String == "shr")
2337 shiftop = (yyvsp[-3].Const.type->isUnsigned()) ? "lshr" : "ashr";
2338 yyval.String = new std::string(shiftop);
2339 *yyval.String += "(" + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2340 delete yyvsp[-5].String; yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2344 #line 838 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2346 *yyvsp[-5].String += "(" + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2347 yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2348 yyval.String = yyvsp[-5].String;
2352 #line 843 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2354 *yyvsp[-7].String += "(" + *yyvsp[-5].Const.cnst + "," + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2355 yyvsp[-5].Const.destroy(); yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2356 yyval.String = yyvsp[-7].String;
2360 #line 848 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2362 *yyvsp[-7].String += "(" + *yyvsp[-5].Const.cnst + "," + *yyvsp[-3].Const.cnst + "," + *yyvsp[-1].Const.cnst + ")";
2363 yyvsp[-5].Const.destroy(); yyvsp[-3].Const.destroy(); yyvsp[-1].Const.destroy();
2364 yyval.String = yyvsp[-7].String;
2368 #line 858 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2370 *yyvsp[-2].String += ", " + *yyvsp[0].Const.cnst;
2371 yyvsp[0].Const.destroy();
2372 yyval.String = yyvsp[-2].String;
2376 #line 863 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2377 { yyval.String = new std::string(*yyvsp[0].Const.cnst); yyvsp[0].Const.destroy(); ;
2380 #line 878 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2385 #line 883 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2391 #line 886 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2393 *O << *yyvsp[0].String << '\n';
2394 delete yyvsp[0].String;
2399 #line 891 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2401 *O << "module asm " << ' ' << *yyvsp[0].String << '\n';
2406 #line 895 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2408 *O << "implementation\n";
2413 #line 899 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2414 { yyval.String = 0; ;
2417 #line 901 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2418 { yyval.String = yyvsp[0].String; *yyval.String = "external"; ;
2421 #line 904 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2423 EnumeratedTypes.push_back(*yyvsp[0].Type);
2424 if (!yyvsp[-2].String->empty()) {
2425 NamedTypes[*yyvsp[-2].String] = *yyvsp[0].Type;
2426 *O << *yyvsp[-2].String << " = ";
2428 *O << "type " << yyvsp[0].Type->getNewTy() << '\n';
2429 delete yyvsp[-2].String; delete yyvsp[-1].String;
2434 #line 914 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2435 { // Function prototypes can be in const pool
2436 *O << *yyvsp[0].String << '\n';
2437 delete yyvsp[0].String;
2442 #line 919 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2443 { // Asm blocks can be in the const pool
2444 *O << *yyvsp[-2].String << ' ' << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
2445 delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
2450 #line 924 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2452 if (!yyvsp[-4].String->empty()) {
2453 std::string Name = getUniqueName(yyvsp[-4].String,yyvsp[-1].Const.type);
2454 *O << Name << " = ";
2455 Globals[Name] = *yyvsp[-1].Const.type;
2457 *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << *yyvsp[-1].Const.cnst << ' ' << *yyvsp[0].String << '\n';
2458 delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
2463 #line 934 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2465 if (!yyvsp[-4].String->empty()) {
2466 std::string Name = getUniqueName(yyvsp[-4].String,yyvsp[-1].Type);
2467 *O << Name << " = ";
2468 Globals[Name] = *yyvsp[-1].Type;
2470 *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Type->getNewTy() << ' ' << *yyvsp[0].String << '\n';
2471 delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
2476 #line 944 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2478 if (!yyvsp[-4].String->empty()) {
2479 std::string Name = getUniqueName(yyvsp[-4].String,yyvsp[-1].Type);
2480 *O << Name << " = ";
2481 Globals[Name] = *yyvsp[-1].Type;
2483 *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Type->getNewTy() << ' ' << *yyvsp[0].String << '\n';
2484 delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
2489 #line 954 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2491 if (!yyvsp[-4].String->empty()) {
2492 std::string Name = getUniqueName(yyvsp[-4].String,yyvsp[-1].Type);
2493 *O << Name << " = ";
2494 Globals[Name] = *yyvsp[-1].Type;
2496 *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Type->getNewTy() << ' ' << *yyvsp[0].String << '\n';
2497 delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
2502 #line 964 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2504 *O << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
2505 delete yyvsp[-1].String; delete yyvsp[0].String;
2510 #line 969 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2512 *O << *yyvsp[-2].String << " = " << *yyvsp[0].String << '\n';
2513 delete yyvsp[-2].String; delete yyvsp[0].String;
2518 #line 974 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2524 #line 984 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2526 *yyvsp[-2].String += " = " + *yyvsp[0].String;
2527 delete yyvsp[0].String;
2528 yyval.String = yyvsp[-2].String;
2532 #line 989 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2534 *yyvsp[-2].String += " = " + *yyvsp[0].String;
2535 if (*yyvsp[0].String == "64")
2537 delete yyvsp[0].String;
2538 yyval.String = yyvsp[-2].String;
2542 #line 996 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2544 *yyvsp[-2].String += " = " + *yyvsp[0].String;
2545 delete yyvsp[0].String;
2546 yyval.String = yyvsp[-2].String;
2550 #line 1001 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2552 *yyvsp[-2].String += " = " + *yyvsp[0].String;
2553 delete yyvsp[0].String;
2554 yyval.String = yyvsp[-2].String;
2558 #line 1008 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2560 yyvsp[-1].String->insert(0, "[ ");
2561 *yyvsp[-1].String += " ]";
2562 yyval.String = yyvsp[-1].String;
2566 #line 1015 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2568 *yyvsp[-2].String += ", " + *yyvsp[0].String;
2569 delete yyvsp[0].String;
2570 yyval.String = yyvsp[-2].String;
2574 #line 1021 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2576 yyval.String = new std::string();
2580 #line 1030 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2581 { yyval.String = new std::string(); ;
2584 #line 1032 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2586 yyval.String = new std::string(yyvsp[-1].Type->getNewTy());
2587 if (!yyvsp[0].String->empty()) {
2588 std::string Name = getUniqueName(yyvsp[0].String, yyvsp[-1].Type);
2589 *yyval.String += " " + Name;
2591 delete yyvsp[0].String;
2595 #line 1041 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2597 *yyvsp[-2].String += ", " + *yyvsp[0].String;
2598 delete yyvsp[0].String;
2602 #line 1045 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2604 yyval.String = yyvsp[0].String;
2608 #line 1049 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2610 yyval.String = yyvsp[0].String;
2614 #line 1052 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2616 *yyvsp[-2].String += ", ...";
2617 yyval.String = yyvsp[-2].String;
2618 delete yyvsp[0].String;
2622 #line 1057 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2624 yyval.String = yyvsp[0].String;
2628 #line 1060 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2629 { yyval.String = new std::string(); ;
2632 #line 1063 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2634 if (!yyvsp[-7].String->empty()) {
2635 *yyvsp[-7].String += " ";
2637 *yyvsp[-7].String += yyvsp[-6].Type->getNewTy() + " " + *yyvsp[-5].String + "(" + *yyvsp[-3].String + ")";
2638 if (!yyvsp[-1].String->empty()) {
2639 *yyvsp[-7].String += " " + *yyvsp[-1].String;
2641 if (!yyvsp[0].String->empty()) {
2642 *yyvsp[-7].String += " " + *yyvsp[0].String;
2644 delete yyvsp[-5].String;
2645 delete yyvsp[-3].String;
2646 delete yyvsp[-1].String;
2647 delete yyvsp[0].String;
2648 yyval.String = yyvsp[-7].String;
2652 #line 1081 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2653 { yyval.String = new std::string("{"); delete yyvsp[0].String; ;
2656 #line 1082 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2657 { yyval.String = new std::string ("{"); ;
2660 #line 1085 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2663 if (!yyvsp[-2].String->empty()) {
2664 *O << *yyvsp[-2].String << ' ';
2666 *O << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
2667 delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
2672 #line 1096 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2673 { yyval.String = new std::string("}"); delete yyvsp[0].String; ;
2676 #line 1097 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2677 { yyval.String = new std::string("}"); ;
2680 #line 1099 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2682 if (yyvsp[-1].String)
2683 *O << *yyvsp[-1].String;
2684 *O << *yyvsp[0].String << "\n\n";
2685 delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
2690 #line 1108 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2691 { yyval.String = new std::string(); ;
2694 #line 1114 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2696 if (!yyvsp[-1].String->empty())
2697 *yyvsp[-2].String += " " + *yyvsp[-1].String;
2698 *yyvsp[-2].String += " " + *yyvsp[0].String;
2699 delete yyvsp[-1].String;
2700 delete yyvsp[0].String;
2701 yyval.String = yyvsp[-2].String;
2705 #line 1127 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2706 { yyval.String = new std::string(); ;
2709 #line 1133 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2711 yyvsp[-1].String->insert(0, "<");
2712 *yyvsp[-1].String += ">";
2713 yyval.String = yyvsp[-1].String;
2717 #line 1139 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2719 if (!yyvsp[-3].String->empty()) {
2720 *yyvsp[-4].String += " " + *yyvsp[-3].String;
2722 *yyvsp[-4].String += " " + *yyvsp[-2].String + ", " + *yyvsp[0].String;
2723 delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
2724 yyval.String = yyvsp[-4].String;
2728 #line 1152 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2730 yyval.Value.val = yyvsp[0].String;
2731 yyval.Value.constant = false;
2732 yyval.Value.type = new TypeInfo();
2736 #line 1157 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2738 yyval.Value.val = yyvsp[0].String;
2739 yyval.Value.constant = true;
2740 yyval.Value.type = new TypeInfo();
2744 #line 1167 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2746 ResolveType(yyvsp[-1].Type);
2747 std::string Name = getUniqueName(yyvsp[0].Value.val, yyvsp[-1].Type);
2748 yyval.Value = yyvsp[0].Value;
2749 delete yyval.Value.val;
2750 delete yyval.Value.type;
2751 yyval.Value.val = new std::string(yyvsp[-1].Type->getNewTy() + " " + Name);
2752 yyval.Value.type = yyvsp[-1].Type;
2756 #line 1177 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2762 #line 1180 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2763 { // Do not allow functions with 0 basic blocks
2768 #line 1188 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2774 #line 1192 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2776 *O << " " << *yyvsp[0].String << '\n';
2777 delete yyvsp[0].String;
2782 #line 1197 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2788 #line 1200 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2790 *O << *yyvsp[0].String << '\n';
2791 delete yyvsp[0].String;
2796 #line 1206 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2797 { yyval.String = yyvsp[0].String; *yyval.String = "unwind"; ;
2800 #line 1208 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2801 { // Return with a result...
2802 *O << " " << *yyvsp[-1].String << ' ' << *yyvsp[0].Value.val << '\n';
2803 delete yyvsp[-1].String; yyvsp[0].Value.destroy();
2808 #line 1213 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2809 { // Return with no result...
2810 *O << " " << *yyvsp[-1].String << ' ' << yyvsp[0].Type->getNewTy() << '\n';
2811 delete yyvsp[-1].String; delete yyvsp[0].Type;
2816 #line 1218 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2817 { // Unconditional Branch...
2818 *O << " " << *yyvsp[-2].String << ' ' << yyvsp[-1].Type->getNewTy() << ' ' << *yyvsp[0].Value.val << '\n';
2819 delete yyvsp[-2].String; delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
2824 #line 1223 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2826 std::string Name = getUniqueName(yyvsp[-6].Value.val, yyvsp[-7].Type);
2827 *O << " " << *yyvsp[-8].String << ' ' << yyvsp[-7].Type->getNewTy() << ' ' << Name << ", "
2828 << yyvsp[-4].Type->getNewTy() << ' ' << *yyvsp[-3].Value.val << ", " << yyvsp[-1].Type->getNewTy() << ' '
2829 << *yyvsp[0].Value.val << '\n';
2830 delete yyvsp[-8].String; delete yyvsp[-7].Type; yyvsp[-6].Value.destroy(); delete yyvsp[-4].Type; yyvsp[-3].Value.destroy();
2831 delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
2836 #line 1232 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2838 std::string Name = getUniqueName(yyvsp[-6].Value.val, yyvsp[-7].Type);
2839 *O << " " << *yyvsp[-8].String << ' ' << yyvsp[-7].Type->getNewTy() << ' ' << Name << ", "
2840 << yyvsp[-4].Type->getNewTy() << ' ' << *yyvsp[-3].Value.val << " [" << *yyvsp[-1].String << " ]\n";
2841 delete yyvsp[-8].String; delete yyvsp[-7].Type; yyvsp[-6].Value.destroy(); delete yyvsp[-4].Type; yyvsp[-3].Value.destroy();
2842 delete yyvsp[-1].String;
2847 #line 1240 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2849 std::string Name = getUniqueName(yyvsp[-5].Value.val, yyvsp[-6].Type);
2850 *O << " " << *yyvsp[-7].String << ' ' << yyvsp[-6].Type->getNewTy() << ' ' << Name << ", "
2851 << yyvsp[-3].Type->getNewTy() << ' ' << *yyvsp[-2].Value.val << "[]\n";
2852 delete yyvsp[-7].String; delete yyvsp[-6].Type; yyvsp[-5].Value.destroy(); delete yyvsp[-3].Type; yyvsp[-2].Value.destroy();
2857 #line 1248 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2859 TypeInfo* ResTy = getFunctionReturnType(yyvsp[-10].Type);
2861 if (!yyvsp[-13].String->empty()) {
2862 std::string Name = getUniqueName(yyvsp[-13].String, ResTy);
2863 *O << Name << " = ";
2865 *O << *yyvsp[-12].String << ' ' << *yyvsp[-11].String << ' ' << yyvsp[-10].Type->getNewTy() << ' ' << *yyvsp[-9].Value.val << " (";
2866 for (unsigned i = 0; i < yyvsp[-7].ValList->size(); ++i) {
2867 ValueInfo& VI = (*yyvsp[-7].ValList)[i];
2869 if (i+1 < yyvsp[-7].ValList->size())
2873 *O << ") " << *yyvsp[-5].String << ' ' << yyvsp[-4].Type->getNewTy() << ' ' << *yyvsp[-3].Value.val << ' '
2874 << *yyvsp[-2].String << ' ' << yyvsp[-1].Type->getNewTy() << ' ' << *yyvsp[0].Value.val << '\n';
2875 delete yyvsp[-13].String; delete yyvsp[-12].String; delete yyvsp[-11].String; delete yyvsp[-10].Type; yyvsp[-9].Value.destroy(); delete yyvsp[-7].ValList;
2876 delete yyvsp[-5].String; delete yyvsp[-4].Type; yyvsp[-3].Value.destroy(); delete yyvsp[-2].String; delete yyvsp[-1].Type;
2877 yyvsp[0].Value.destroy();
2882 #line 1270 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2884 *O << " " << *yyvsp[0].String << '\n';
2885 delete yyvsp[0].String;
2890 #line 1275 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2892 *O << " " << *yyvsp[0].String << '\n';
2893 delete yyvsp[0].String;
2898 #line 1281 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2900 *yyvsp[-5].String += " " + yyvsp[-4].Type->getNewTy() + " " + *yyvsp[-3].String + ", " + yyvsp[-1].Type->getNewTy() + " " +
2901 *yyvsp[0].Value.val;
2902 delete yyvsp[-4].Type; delete yyvsp[-3].String; delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
2903 yyval.String = yyvsp[-5].String;
2907 #line 1287 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2909 yyvsp[-3].String->insert(0, yyvsp[-4].Type->getNewTy() + " " );
2910 *yyvsp[-3].String += ", " + yyvsp[-1].Type->getNewTy() + " " + *yyvsp[0].Value.val;
2911 delete yyvsp[-4].Type; delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
2912 yyval.String = yyvsp[-3].String;
2916 #line 1295 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2918 if (!yyvsp[-1].String->empty()) {
2919 if (deleteUselessCastFlag && *deleteUselessCastName == *yyvsp[-1].String) {
2920 *yyvsp[-1].String += " = ";
2921 yyvsp[-1].String->insert(0, "; "); // don't actually delete it, just comment it out
2922 delete deleteUselessCastName;
2924 // Get a unique name for the name of this value, based on its type.
2925 *yyvsp[-1].String = getUniqueName(yyvsp[-1].String, yyvsp[0].Value.type) + " = ";
2928 *yyvsp[-1].String += *yyvsp[0].Value.val;
2929 yyvsp[0].Value.destroy();
2930 deleteUselessCastFlag = false;
2931 yyval.String = yyvsp[-1].String;
2935 #line 1313 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2936 { // Used for PHI nodes
2937 std::string Name = getUniqueName(yyvsp[-3].Value.val, yyvsp[-5].Type);
2938 Name.insert(0, yyvsp[-5].Type->getNewTy() + "[");
2939 Name += "," + *yyvsp[-1].Value.val + "]";
2940 yyval.Value.val = new std::string(Name);
2941 yyval.Value.type = yyvsp[-5].Type;
2942 yyvsp[-3].Value.destroy(); yyvsp[-1].Value.destroy();
2946 #line 1321 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2948 std::string Name = getUniqueName(yyvsp[-3].Value.val, yyvsp[-6].Value.type);
2949 *yyvsp[-6].Value.val += ", [" + Name + "," + *yyvsp[-1].Value.val + "]";
2950 yyvsp[-3].Value.destroy(); yyvsp[-1].Value.destroy();
2951 yyval.Value = yyvsp[-6].Value;
2955 #line 1330 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2957 yyval.ValList = new ValueList();
2958 yyval.ValList->push_back(yyvsp[0].Value);
2962 #line 1334 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2964 yyval.ValList = yyvsp[-2].ValList;
2965 yyval.ValList->push_back(yyvsp[0].Value);
2969 #line 1341 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2970 { yyval.ValList = yyvsp[0].ValList; ;
2973 #line 1342 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2974 { yyval.ValList = new ValueList(); ;
2977 #line 1346 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2979 *yyvsp[-1].String += " " + *yyvsp[0].String;
2980 delete yyvsp[0].String;
2981 yyval.String = yyvsp[-1].String;
2985 #line 1354 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2987 const char* op = getDivRemOpcode(*yyvsp[-4].String, yyvsp[-3].Type);
2988 std::string Name1 = getUniqueName(yyvsp[-2].Value.val, yyvsp[-3].Type);
2989 std::string Name2 = getUniqueName(yyvsp[0].Value.val, yyvsp[-3].Type);
2990 yyval.Value.val = new std::string(op);
2991 *yyval.Value.val += " " + yyvsp[-3].Type->getNewTy() + " " + Name1 + ", " + Name2;
2992 yyval.Value.type = yyvsp[-3].Type;
2993 delete yyvsp[-4].String; yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
2997 #line 1363 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
2999 std::string Name1 = getUniqueName(yyvsp[-2].Value.val, yyvsp[-3].Type);
3000 std::string Name2 = getUniqueName(yyvsp[0].Value.val, yyvsp[-3].Type);
3001 *yyvsp[-4].String += " " + yyvsp[-3].Type->getNewTy() + " " + Name1 + ", " + Name2;
3002 yyval.Value.val = yyvsp[-4].String;
3003 yyval.Value.type = yyvsp[-3].Type;
3004 yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3008 #line 1371 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3010 std::string Name1 = getUniqueName(yyvsp[-2].Value.val, yyvsp[-3].Type);
3011 std::string Name2 = getUniqueName(yyvsp[0].Value.val, yyvsp[-3].Type);
3012 *yyvsp[-4].String = getCompareOp(*yyvsp[-4].String, yyvsp[-3].Type);
3013 *yyvsp[-4].String += " " + yyvsp[-3].Type->getNewTy() + " " + Name1 + ", " + Name2;
3014 yyval.Value.val = yyvsp[-4].String;
3015 yyval.Value.type = new TypeInfo("bool",BoolTy);
3016 yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3020 #line 1380 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3022 std::string Name1 = getUniqueName(yyvsp[-2].Value.val, yyvsp[-3].Type);
3023 std::string Name2 = getUniqueName(yyvsp[0].Value.val, yyvsp[-3].Type);
3024 *yyvsp[-5].String += " " + *yyvsp[-4].String + " " + yyvsp[-3].Type->getNewTy() + " " + Name1 + "," + Name2;
3025 yyval.Value.val = yyvsp[-5].String;
3026 yyval.Value.type = new TypeInfo("bool",BoolTy);
3027 delete yyvsp[-4].String; yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3031 #line 1388 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3033 std::string Name1 = getUniqueName(yyvsp[-2].Value.val, yyvsp[-3].Type);
3034 std::string Name2 = getUniqueName(yyvsp[0].Value.val, yyvsp[-3].Type);
3035 *yyvsp[-5].String += " " + *yyvsp[-4].String + " " + yyvsp[-3].Type->getNewTy() + " " + Name1 + "," + Name2;
3036 yyval.Value.val = yyvsp[-5].String;
3037 yyval.Value.type = new TypeInfo("bool",BoolTy);
3038 delete yyvsp[-4].String; yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3042 #line 1396 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3044 yyval.Value = yyvsp[0].Value;
3045 yyval.Value.val->insert(0, *yyvsp[-1].String + " ");
3046 delete yyvsp[-1].String;
3050 #line 1401 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3052 const char* shiftop = yyvsp[-3].String->c_str();
3053 if (*yyvsp[-3].String == "shr")
3054 shiftop = (yyvsp[-2].Value.type->isUnsigned()) ? "lshr" : "ashr";
3055 yyval.Value.val = new std::string(shiftop);
3056 *yyval.Value.val += " " + *yyvsp[-2].Value.val + ", " + *yyvsp[0].Value.val;
3057 yyval.Value.type = yyvsp[-2].Value.type;
3058 delete yyvsp[-3].String; delete yyvsp[-2].Value.val; yyvsp[0].Value.destroy();
3062 #line 1410 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3064 std::string source = *yyvsp[-2].Value.val;
3065 TypeInfo* SrcTy = yyvsp[-2].Value.type;
3066 TypeInfo* DstTy = ResolveType(yyvsp[0].Type);
3067 yyval.Value.val = new std::string();
3068 if (*yyvsp[-3].String == "cast") {
3069 *yyval.Value.val += getCastUpgrade(source, SrcTy, DstTy, false);
3071 *yyval.Value.val += *yyvsp[-3].String + " " + source + " to " + DstTy->getNewTy();
3073 yyval.Value.type = yyvsp[0].Type;
3074 // Check to see if this is a useless cast of a value to the same name
3075 // and the same type. Such casts will probably cause redefinition errors
3076 // when assembled and perform no code gen action so just remove them.
3077 if (*yyvsp[-3].String == "cast" || *yyvsp[-3].String == "bitcast")
3078 if (yyvsp[-2].Value.type->isInteger() && DstTy->isInteger() &&
3079 yyvsp[-2].Value.type->getBitWidth() == DstTy->getBitWidth()) {
3080 deleteUselessCastFlag = true; // Flag the "Inst" rule
3081 deleteUselessCastName = new std::string(*yyvsp[-2].Value.val); // save the name
3082 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
3083 if (pos != std::string::npos) {
3084 // remove the type portion before val
3085 deleteUselessCastName->erase(0, pos);
3088 delete yyvsp[-3].String; yyvsp[-2].Value.destroy();
3089 delete yyvsp[-1].String;
3093 #line 1438 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3095 *yyvsp[-5].String += " " + *yyvsp[-4].Value.val + ", " + *yyvsp[-2].Value.val + ", " + *yyvsp[0].Value.val;
3096 yyval.Value.val = yyvsp[-5].String;
3097 yyval.Value.type = yyvsp[-2].Value.type;
3098 yyvsp[-4].Value.destroy(); delete yyvsp[-2].Value.val; yyvsp[0].Value.destroy();
3102 #line 1444 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3104 *yyvsp[-3].String += " " + *yyvsp[-2].Value.val + ", " + yyvsp[0].Type->getNewTy();
3105 yyval.Value.val = yyvsp[-3].String;
3106 yyval.Value.type = yyvsp[0].Type;
3107 yyvsp[-2].Value.destroy();
3111 #line 1450 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3113 *yyvsp[-3].String += " " + *yyvsp[-2].Value.val + ", " + *yyvsp[0].Value.val;
3114 yyval.Value.val = yyvsp[-3].String;
3115 ResolveType(yyvsp[-2].Value.type);
3116 yyval.Value.type = yyvsp[-2].Value.type->getElementType();
3117 delete yyvsp[-2].Value.val; yyvsp[0].Value.destroy();
3121 #line 1457 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3123 *yyvsp[-5].String += " " + *yyvsp[-4].Value.val + ", " + *yyvsp[-2].Value.val + ", " + *yyvsp[0].Value.val;
3124 yyval.Value.val = yyvsp[-5].String;
3125 yyval.Value.type = yyvsp[-4].Value.type;
3126 delete yyvsp[-4].Value.val; yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3130 #line 1463 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3132 *yyvsp[-5].String += " " + *yyvsp[-4].Value.val + ", " + *yyvsp[-2].Value.val + ", " + *yyvsp[0].Value.val;
3133 yyval.Value.val = yyvsp[-5].String;
3134 yyval.Value.type = yyvsp[-4].Value.type;
3135 delete yyvsp[-4].Value.val; yyvsp[-2].Value.destroy(); yyvsp[0].Value.destroy();
3139 #line 1469 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3141 *yyvsp[-1].String += " " + *yyvsp[0].Value.val;
3142 yyval.Value.val = yyvsp[-1].String;
3143 yyval.Value.type = yyvsp[0].Value.type;
3144 delete yyvsp[0].Value.val;
3148 #line 1475 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3150 if (!yyvsp[-5].String->empty())
3151 *yyvsp[-6].String += " " + *yyvsp[-5].String;
3152 if (!yyvsp[-6].String->empty())
3153 *yyvsp[-6].String += " ";
3154 *yyvsp[-6].String += yyvsp[-4].Type->getNewTy() + " " + *yyvsp[-3].Value.val + "(";
3155 for (unsigned i = 0; i < yyvsp[-1].ValList->size(); ++i) {
3156 ValueInfo& VI = (*yyvsp[-1].ValList)[i];
3157 *yyvsp[-6].String += *VI.val;
3158 if (i+1 < yyvsp[-1].ValList->size())
3159 *yyvsp[-6].String += ", ";
3162 *yyvsp[-6].String += ")";
3163 yyval.Value.val = yyvsp[-6].String;
3164 yyval.Value.type = getFunctionReturnType(yyvsp[-4].Type);
3165 delete yyvsp[-5].String; delete yyvsp[-4].Type; yyvsp[-3].Value.destroy(); delete yyvsp[-1].ValList;
3169 #line 1498 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3170 { yyval.ValList = yyvsp[0].ValList; ;
3173 #line 1499 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3174 { yyval.ValList = new ValueList(); ;
3177 #line 1504 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3178 { yyval.String = new std::string(); ;
3181 #line 1507 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3183 *yyvsp[-2].String += " " + yyvsp[-1].Type->getNewTy();
3184 if (!yyvsp[0].String->empty())
3185 *yyvsp[-2].String += " " + *yyvsp[0].String;
3186 yyval.Value.val = yyvsp[-2].String;
3187 yyval.Value.type = yyvsp[-1].Type->getPointerType();
3188 delete yyvsp[-1].Type; delete yyvsp[0].String;
3192 #line 1515 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3194 std::string Name = getUniqueName(yyvsp[-1].Value.val, yyvsp[-2].Type);
3195 *yyvsp[-5].String += " " + yyvsp[-4].Type->getNewTy() + ", " + yyvsp[-2].Type->getNewTy() + " " + Name;
3196 if (!yyvsp[0].String->empty())
3197 *yyvsp[-5].String += " " + *yyvsp[0].String;
3198 yyval.Value.val = yyvsp[-5].String;
3199 yyval.Value.type = yyvsp[-4].Type->getPointerType();
3200 delete yyvsp[-4].Type; delete yyvsp[-2].Type; yyvsp[-1].Value.destroy(); delete yyvsp[0].String;
3204 #line 1524 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3206 *yyvsp[-2].String += " " + yyvsp[-1].Type->getNewTy();
3207 if (!yyvsp[0].String->empty())
3208 *yyvsp[-2].String += " " + *yyvsp[0].String;
3209 yyval.Value.val = yyvsp[-2].String;
3210 yyval.Value.type = yyvsp[-1].Type->getPointerType();
3211 delete yyvsp[-1].Type; delete yyvsp[0].String;
3215 #line 1532 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3217 std::string Name = getUniqueName(yyvsp[-1].Value.val, yyvsp[-2].Type);
3218 *yyvsp[-5].String += " " + yyvsp[-4].Type->getNewTy() + ", " + yyvsp[-2].Type->getNewTy() + " " + Name;
3219 if (!yyvsp[0].String->empty())
3220 *yyvsp[-5].String += " " + *yyvsp[0].String;
3221 yyval.Value.val = yyvsp[-5].String;
3222 yyval.Value.type = yyvsp[-4].Type->getPointerType();
3223 delete yyvsp[-4].Type; delete yyvsp[-2].Type; yyvsp[-1].Value.destroy(); delete yyvsp[0].String;
3227 #line 1541 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3229 *yyvsp[-1].String += " " + *yyvsp[0].Value.val;
3230 yyval.Value.val = yyvsp[-1].String;
3231 yyval.Value.type = new TypeInfo("void", VoidTy);
3232 yyvsp[0].Value.destroy();
3236 #line 1547 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3238 std::string Name = getUniqueName(yyvsp[0].Value.val, yyvsp[-1].Type);
3239 if (!yyvsp[-3].String->empty())
3240 *yyvsp[-3].String += " ";
3241 *yyvsp[-3].String += *yyvsp[-2].String + " " + yyvsp[-1].Type->getNewTy() + " " + Name;
3242 yyval.Value.val = yyvsp[-3].String;
3243 yyval.Value.type = yyvsp[-1].Type->getElementType()->clone();
3244 delete yyvsp[-2].String; delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
3248 #line 1556 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3250 std::string Name = getUniqueName(yyvsp[0].Value.val, yyvsp[-1].Type);
3251 if (!yyvsp[-5].String->empty())
3252 *yyvsp[-5].String += " ";
3253 *yyvsp[-5].String += *yyvsp[-4].String + " " + *yyvsp[-3].Value.val + ", " + yyvsp[-1].Type->getNewTy() + " " + Name;
3254 yyval.Value.val = yyvsp[-5].String;
3255 yyval.Value.type = new TypeInfo("void", VoidTy);
3256 delete yyvsp[-4].String; yyvsp[-3].Value.destroy(); delete yyvsp[-1].Type; yyvsp[0].Value.destroy();
3260 #line 1565 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3262 std::string Name = getUniqueName(yyvsp[-1].Value.val, yyvsp[-2].Type);
3263 // Upgrade the indices
3264 for (unsigned i = 0; i < yyvsp[0].ValList->size(); ++i) {
3265 ValueInfo& VI = (*yyvsp[0].ValList)[i];
3266 if (VI.type->isUnsigned() && !VI.isConstant() &&
3267 VI.type->getBitWidth() < 64) {
3268 std::string* old = VI.val;
3269 *O << " %gep_upgrade" << unique << " = zext " << *old
3271 VI.val = new std::string("i64 %gep_upgrade" + llvm::utostr(unique++));
3272 VI.type->setOldTy(ULongTy);
3275 *yyvsp[-3].String += " " + yyvsp[-2].Type->getNewTy() + " " + Name;
3276 for (unsigned i = 0; i < yyvsp[0].ValList->size(); ++i) {
3277 ValueInfo& VI = (*yyvsp[0].ValList)[i];
3278 *yyvsp[-3].String += ", " + *VI.val;
3280 yyval.Value.val = yyvsp[-3].String;
3281 yyval.Value.type = getGEPIndexedType(yyvsp[-2].Type,yyvsp[0].ValList);
3282 yyvsp[-1].Value.destroy(); delete yyvsp[0].ValList;
3286 /* the action file gets copied in in place of this dollarsign */
3287 #line 543 "/usr/share/bison.simple"
3298 short *ssp1 = yyss - 1;
3299 fprintf (stderr, "state stack now");
3300 while (ssp1 != yyssp)
3301 fprintf (stderr, " %d", *++ssp1);
3302 fprintf (stderr, "\n");
3312 yylsp->first_line = yylloc.first_line;
3313 yylsp->first_column = yylloc.first_column;
3314 yylsp->last_line = (yylsp-1)->last_line;
3315 yylsp->last_column = (yylsp-1)->last_column;
3320 yylsp->last_line = (yylsp+yylen-1)->last_line;
3321 yylsp->last_column = (yylsp+yylen-1)->last_column;
3325 /* Now "shift" the result of the reduction.
3326 Determine what state that goes to,
3327 based on the state we popped back to
3328 and the rule number reduced by. */
3332 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3333 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3334 yystate = yytable[yystate];
3336 yystate = yydefgoto[yyn - YYNTBASE];
3340 yyerrlab: /* here on detecting error */
3343 /* If not already recovering from an error, report this error. */
3347 #ifdef YYERROR_VERBOSE
3348 yyn = yypact[yystate];
3350 if (yyn > YYFLAG && yyn < YYLAST)
3357 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3358 for (x = (yyn < 0 ? -yyn : 0);
3359 x < (sizeof(yytname) / sizeof(char *)); x++)
3360 if (yycheck[x + yyn] == x)
3361 size += strlen(yytname[x]) + 15, count++;
3362 msg = (char *) malloc(size + 15);
3365 strcpy(msg, "parse error");
3370 for (x = (yyn < 0 ? -yyn : 0);
3371 x < (sizeof(yytname) / sizeof(char *)); x++)
3372 if (yycheck[x + yyn] == x)
3374 strcat(msg, count == 0 ? ", expecting `" : " or `");
3375 strcat(msg, yytname[x]);
3384 yyerror ("parse error; also virtual memory exceeded");
3387 #endif /* YYERROR_VERBOSE */
3388 yyerror("parse error");
3392 yyerrlab1: /* here on error raised explicitly by an action */
3394 if (yyerrstatus == 3)
3396 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3398 /* return failure if at end of input */
3399 if (yychar == YYEOF)
3404 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3410 /* Else will try to reuse lookahead token
3411 after shifting the error token. */
3413 yyerrstatus = 3; /* Each real token shifted decrements this */
3417 yyerrdefault: /* current state does not do anything special for the error token. */
3420 /* This is wrong; only states that explicitly want error tokens
3421 should shift them. */
3422 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3423 if (yyn) goto yydefault;
3426 yyerrpop: /* pop the current state because it cannot handle the error token */
3428 if (yyssp == yyss) YYABORT;
3438 short *ssp1 = yyss - 1;
3439 fprintf (stderr, "Error: state stack now");
3440 while (ssp1 != yyssp)
3441 fprintf (stderr, " %d", *++ssp1);
3442 fprintf (stderr, "\n");
3448 yyn = yypact[yystate];
3453 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3472 fprintf(stderr, "Shifting error token, ");
3484 /* YYACCEPT comes here. */
3496 /* YYABORT comes here. */
3507 #line 1589 "/Volumes/ProjectsDisk/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y"
3510 int yyerror(const char *ErrorMsg) {
3512 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
3513 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
3514 std::string errMsg = std::string(ErrorMsg) + "\n" + where + " while reading ";
3515 if (yychar == YYEMPTY || yychar == 0)
3516 errMsg += "end-of-file.";
3518 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
3519 std::cerr << "llvm-upgrade: " << errMsg << '\n';
3520 *O << "llvm-upgrade parse failed.\n";