1 /* A Bison parser, made by GNU Bison 2.1. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
51 /* Substitute the variable and function names. */
52 #define yyparse Upgradeparse
53 #define yylex Upgradelex
54 #define yyerror Upgradeerror
55 #define yylval Upgradelval
56 #define yychar Upgradechar
57 #define yydebug Upgradedebug
58 #define yynerrs Upgradenerrs
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
88 ZEROINITIALIZER = 279,
134 X86_STDCALLCC_TOK = 325,
135 X86_FASTCALLCC_TOK = 326,
199 EXTRACTELEMENT = 390,
232 #define ESINT64VAL 272
233 #define EUINT64VAL 273
239 #define ZEROINITIALIZER 279
245 #define STRINGCONSTANT 285
246 #define IMPLEMENTATION 286
255 #define DOTDOTDOT 295
260 #define DLLIMPORT 300
261 #define DLLEXPORT 301
262 #define EXTERN_WEAK 302
263 #define APPENDING 303
269 #define POINTERSIZE 309
273 #define UNINITIALIZED 313
279 #define SIDEEFFECT 319
282 #define CSRETCC_TOK 322
283 #define FASTCC_TOK 323
284 #define COLDCC_TOK 324
285 #define X86_STDCALLCC_TOK 325
286 #define X86_FASTCALLCC_TOK 326
287 #define DATALAYOUT 327
294 #define UNREACHABLE 334
342 #define GETELEMENTPTR 382
350 #define EXTRACTELEMENT 390
351 #define INSERTELEMENT 391
352 #define SHUFFLEVECTOR 392
370 /* Copy the first part of user declarations. */
371 #line 14 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
373 #include "UpgradeInternals.h"
379 #define YYERROR_VERBOSE 1
380 #define YYINCLUDED_STDLIB_H
383 int yylex(); // declaration" of xxx warnings.
387 static std::string CurFilename;
388 static std::ostream *O = 0;
389 std::istream* LexInput = 0;
390 unsigned SizeOfPointer = 32;
391 static uint64_t unique = 1;
393 // This bool controls whether attributes are ever added to function declarations
394 // definitions and calls.
395 static bool AddAttributes = false;
397 // This bool is used to communicate between the InstVal and Inst rules about
398 // whether or not a cast should be deleted. When the flag is set, InstVal has
399 // determined that the cast is a candidate. However, it can only be deleted if
400 // the value being casted is the same value name as the instruction. The Inst
401 // rule makes that comparison if the flag is set and comments out the
402 // instruction if they match.
403 static bool deleteUselessCastFlag = false;
404 static std::string* deleteUselessCastName = 0;
406 typedef std::vector<const TypeInfo*> TypeVector;
407 static TypeVector EnumeratedTypes;
408 typedef std::map<std::string,const TypeInfo*> TypeMap;
409 static TypeMap NamedTypes;
410 typedef std::map<const TypeInfo*,std::string> TypePlaneMap;
411 typedef std::map<std::string,TypePlaneMap> GlobalsTypeMap;
412 static GlobalsTypeMap Globals;
414 static void warning(const std::string& msg);
416 void destroy(ValueList* VL) {
417 while (!VL->empty()) {
418 ValueInfo& VI = VL->back();
425 void UpgradeAssembly(const std::string &infile, std::istream& in,
426 std::ostream &out, bool debug, bool addAttrs)
429 CurFilename = infile;
432 AddAttributes = addAttrs;
436 std::cerr << "Parse failed.\n";
437 out << "llvm-upgrade parse failed.\n";
442 TypeInfo::TypeRegMap TypeInfo::registry;
444 const TypeInfo* TypeInfo::get(const std::string &newType, Types oldType) {
445 TypeInfo* Ty = new TypeInfo();
448 return add_new_type(Ty);
451 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
452 const TypeInfo* eTy, const TypeInfo* rTy) {
453 TypeInfo* Ty= new TypeInfo();
456 Ty->elemTy = const_cast<TypeInfo*>(eTy);
457 Ty->resultTy = const_cast<TypeInfo*>(rTy);
458 return add_new_type(Ty);
461 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
462 const TypeInfo *eTy, uint64_t elems) {
463 TypeInfo* Ty = new TypeInfo();
466 Ty->elemTy = const_cast<TypeInfo*>(eTy);
468 return add_new_type(Ty);
471 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
473 TypeInfo* Ty = new TypeInfo();
477 return add_new_type(Ty);
480 const TypeInfo* TypeInfo::get(const std::string& newType, const TypeInfo* resTy,
482 TypeInfo* Ty = new TypeInfo();
484 Ty->oldTy = FunctionTy;
485 Ty->resultTy = const_cast<TypeInfo*>(resTy);
487 return add_new_type(Ty);
490 const TypeInfo* TypeInfo::resolve() const {
491 if (isUnresolved()) {
492 if (getNewTy()[0] == '%' && isdigit(getNewTy()[1])) {
493 unsigned ref = atoi(&((getNewTy().c_str())[1])); // skip the %
494 if (ref < EnumeratedTypes.size()) {
495 return EnumeratedTypes[ref];
497 std::string msg("Can't resolve numbered type: ");
499 yyerror(msg.c_str());
502 TypeMap::iterator I = NamedTypes.find(getNewTy());
503 if (I != NamedTypes.end()) {
506 std::string msg("Cannot resolve type: ");
508 yyerror(msg.c_str());
512 // otherwise its already resolved.
516 bool TypeInfo::operator<(const TypeInfo& that) const {
519 if (oldTy != that.oldTy)
520 return oldTy < that.oldTy;
523 unsigned thisUp = this->getUpRefNum();
524 unsigned thatUp = that.getUpRefNum();
525 return thisUp < thatUp;
529 if (this->nelems != that.nelems)
530 return nelems < that.nelems;
532 const TypeInfo* thisTy = this->elemTy;
533 const TypeInfo* thatTy = that.elemTy;
534 return *thisTy < *thatTy;
537 const TypeInfo* thisTy = this->resultTy;
538 const TypeInfo* thatTy = that.resultTy;
539 if (!thisTy->sameOldTyAs(thatTy))
540 return *thisTy < *thatTy;
544 case PackedStructTy: {
545 if (elements->size() != that.elements->size())
546 return elements->size() < that.elements->size();
547 for (unsigned i = 0; i < elements->size(); i++) {
548 const TypeInfo* thisTy = (*this->elements)[i];
549 const TypeInfo* thatTy = (*that.elements)[i];
550 if (!thisTy->sameOldTyAs(thatTy))
551 return *thisTy < *thatTy;
556 return this->newTy < that.newTy;
563 bool TypeInfo::sameOldTyAs(const TypeInfo* that) const {
568 if (oldTy != that->oldTy)
573 if (nelems != that->nelems)
577 const TypeInfo* thisTy = this->elemTy;
578 const TypeInfo* thatTy = that->elemTy;
579 return thisTy->sameOldTyAs(thatTy);
582 const TypeInfo* thisTy = this->resultTy;
583 const TypeInfo* thatTy = that->resultTy;
584 if (!thisTy->sameOldTyAs(thatTy))
589 case PackedStructTy: {
590 if (elements->size() != that->elements->size())
592 for (unsigned i = 0; i < elements->size(); i++) {
593 const TypeInfo* thisTy = (*this->elements)[i];
594 const TypeInfo* thatTy = (*that->elements)[i];
595 if (!thisTy->sameOldTyAs(thatTy))
601 return this->newTy == that->newTy;
603 return true; // for all others oldTy == that->oldTy is sufficient
608 bool TypeInfo::isUnresolvedDeep() const {
615 return elemTy->isUnresolvedDeep();
618 for (unsigned i = 0; i < elements->size(); i++)
619 if ((*elements)[i]->isUnresolvedDeep())
627 unsigned TypeInfo::getBitWidth() const {
631 case VoidTy : return 0;
632 case BoolTy : return 1;
633 case SByteTy: case UByteTy : return 8;
634 case ShortTy: case UShortTy : return 16;
635 case IntTy: case UIntTy: case FloatTy: return 32;
636 case LongTy: case ULongTy: case DoubleTy : return 64;
637 case PointerTy: return SizeOfPointer; // global var
640 return nelems * elemTy->getBitWidth();
642 case PackedStructTy: {
644 for (unsigned i = 0; i < elements->size(); i++) {
645 size += (*elements)[i]->getBitWidth();
652 const TypeInfo* TypeInfo::getIndexedType(const ValueInfo& VI) const {
654 if (VI.isConstant() && VI.type->isInteger()) {
655 size_t pos = VI.val->find(' ') + 1;
656 if (pos < VI.val->size()) {
657 uint64_t idx = atoi(VI.val->substr(pos).c_str());
658 return (*elements)[idx];
660 yyerror("Invalid value for constant integer");
664 yyerror("Structure requires constant index");
668 if (isArray() || isPacked() || isPointer())
670 yyerror("Invalid type for getIndexedType");
674 TypeInfo& TypeInfo::operator=(const TypeInfo& that) {
676 nelems = that.nelems;
678 elemTy = that.elemTy;
679 resultTy = that.resultTy;
681 elements = new TypeList(that.elements->size());
682 *elements = *that.elements;
689 const TypeInfo* TypeInfo::add_new_type(TypeInfo* newTy) {
690 TypeRegMap::iterator I = registry.find(newTy);
691 if (I != registry.end()) {
695 registry.insert(newTy);
699 static const char* getCastOpcode(
700 std::string& Source, const TypeInfo* SrcTy, const TypeInfo* DstTy)
702 unsigned SrcBits = SrcTy->getBitWidth();
703 unsigned DstBits = DstTy->getBitWidth();
704 const char* opcode = "bitcast";
705 // Run through the possibilities ...
706 if (DstTy->isIntegral()) { // Casting to integral
707 if (SrcTy->isIntegral()) { // Casting from integral
708 if (DstBits < SrcBits)
710 else if (DstBits > SrcBits) { // its an extension
711 if (SrcTy->isSigned())
712 opcode ="sext"; // signed -> SEXT
714 opcode = "zext"; // unsigned -> ZEXT
716 opcode = "bitcast"; // Same size, No-op cast
718 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
719 if (DstTy->isSigned())
720 opcode = "fptosi"; // FP -> sint
722 opcode = "fptoui"; // FP -> uint
723 } else if (SrcTy->isPacked()) {
724 assert(DstBits == SrcTy->getBitWidth() &&
725 "Casting packed to integer of different width");
726 opcode = "bitcast"; // same size, no-op cast
728 assert(SrcTy->isPointer() &&
729 "Casting from a value that is not first-class type");
730 opcode = "ptrtoint"; // ptr -> int
732 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
733 if (SrcTy->isIntegral()) { // Casting from integral
734 if (SrcTy->isSigned())
735 opcode = "sitofp"; // sint -> FP
737 opcode = "uitofp"; // uint -> FP
738 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
739 if (DstBits < SrcBits) {
740 opcode = "fptrunc"; // FP -> smaller FP
741 } else if (DstBits > SrcBits) {
742 opcode = "fpext"; // FP -> larger FP
744 opcode ="bitcast"; // same size, no-op cast
746 } else if (SrcTy->isPacked()) {
747 assert(DstBits == SrcTy->getBitWidth() &&
748 "Casting packed to floating point of different width");
749 opcode = "bitcast"; // same size, no-op cast
751 assert(0 && "Casting pointer or non-first class to float");
753 } else if (DstTy->isPacked()) {
754 if (SrcTy->isPacked()) {
755 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
756 "Casting packed to packed of different widths");
757 opcode = "bitcast"; // packed -> packed
758 } else if (DstTy->getBitWidth() == SrcBits) {
759 opcode = "bitcast"; // float/int -> packed
761 assert(!"Illegal cast to packed (wrong type or size)");
763 } else if (DstTy->isPointer()) {
764 if (SrcTy->isPointer()) {
765 opcode = "bitcast"; // ptr -> ptr
766 } else if (SrcTy->isIntegral()) {
767 opcode = "inttoptr"; // int -> ptr
769 assert(!"Casting invalid type to pointer");
772 assert(!"Casting to type that is not first-class");
777 static std::string getCastUpgrade(const std::string& Src, const TypeInfo* SrcTy,
778 const TypeInfo* DstTy, bool isConst)
781 std::string Source = Src;
782 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
783 // fp -> ptr cast is no longer supported but we must upgrade this
784 // by doing a double cast: fp -> int -> ptr
786 Source = "i64 fptoui(" + Source + " to i64)";
788 *O << " %cast_upgrade" << unique << " = fptoui " << Source
790 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
792 // Update the SrcTy for the getCastOpcode call below
793 SrcTy = TypeInfo::get("i64", ULongTy);
794 } else if (DstTy->isBool()) {
795 // cast type %x to bool was previously defined as setne type %x, null
796 // The cast semantic is now to truncate, not compare so we must retain
797 // the original intent by replacing the cast with a setne
798 const char* comparator = SrcTy->isPointer() ? ", null" :
799 (SrcTy->isFloatingPoint() ? ", 0.0" :
800 (SrcTy->isBool() ? ", false" : ", 0"));
801 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
803 Result = "(" + Source + comparator + ")";
804 Result = compareOp + Result;
806 Result = compareOp + Source + comparator;
807 return Result; // skip cast processing below
809 SrcTy = SrcTy->resolve();
810 DstTy = DstTy->resolve();
811 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
813 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
815 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
819 const char* getDivRemOpcode(const std::string& opcode, const TypeInfo* TI) {
820 const char* op = opcode.c_str();
821 const TypeInfo* Ty = TI->resolve();
823 Ty = Ty->getElementType();
825 if (Ty->isFloatingPoint())
827 else if (Ty->isUnsigned())
829 else if (Ty->isSigned())
832 yyerror("Invalid type for div instruction");
833 else if (opcode == "rem")
834 if (Ty->isFloatingPoint())
836 else if (Ty->isUnsigned())
838 else if (Ty->isSigned())
841 yyerror("Invalid type for rem instruction");
846 getCompareOp(const std::string& setcc, const TypeInfo* TI) {
847 assert(setcc.length() == 5);
850 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
851 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
852 std::string result("xcmp xxx");
855 if (TI->isFloatingPoint()) {
859 result[5] = 'u'; // NE maps to unordered
861 result[5] = 'o'; // everything else maps to ordered
862 } else if (TI->isIntegral() || TI->isPointer()) {
864 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
866 else if (TI->isSigned())
868 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
871 yyerror("Invalid integral type for setcc");
876 static const TypeInfo* getFunctionReturnType(const TypeInfo* PFTy) {
877 PFTy = PFTy->resolve();
878 if (PFTy->isPointer()) {
879 const TypeInfo* ElemTy = PFTy->getElementType();
880 ElemTy = ElemTy->resolve();
881 if (ElemTy->isFunction())
882 return ElemTy->getResultType();
883 } else if (PFTy->isFunction()) {
884 return PFTy->getResultType();
889 typedef std::vector<const TypeInfo*> UpRefStack;
890 static const TypeInfo* ResolveUpReference(const TypeInfo* Ty,
892 assert(Ty->isUpReference() && "Can't resolve a non-upreference");
893 unsigned upref = Ty->getUpRefNum();
894 assert(upref < stack->size() && "Invalid up reference");
895 return (*stack)[upref - stack->size() - 1];
898 static const TypeInfo* getGEPIndexedType(const TypeInfo* PTy, ValueList* idxs) {
899 const TypeInfo* Result = PTy = PTy->resolve();
900 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
902 for (unsigned i = 0; i < idxs->size(); ++i) {
903 if (Result->isComposite()) {
904 Result = Result->getIndexedType((*idxs)[i]);
905 Result = Result->resolve();
906 stack.push_back(Result);
908 yyerror("Invalid type for index");
910 // Resolve upreferences so we can return a more natural type
911 if (Result->isPointer()) {
912 if (Result->getElementType()->isUpReference()) {
913 stack.push_back(Result);
914 Result = ResolveUpReference(Result->getElementType(), &stack);
916 } else if (Result->isUpReference()) {
917 Result = ResolveUpReference(Result->getElementType(), &stack);
919 return Result->getPointerType();
922 static std::string makeUniqueName(const std::string *Name, bool isSigned) {
923 const char *suffix = ".u";
926 if ((*Name)[Name->size()-1] == '"') {
927 std::string Result(*Name);
928 Result.insert(Name->size()-1, suffix);
931 return *Name + suffix;
934 // This function handles appending .u or .s to integer value names that
935 // were previously unsigned or signed, respectively. This avoids name
936 // collisions since the unsigned and signed type planes have collapsed
937 // into a single signless type plane.
938 static std::string getUniqueName(const std::string *Name, const TypeInfo* Ty,
939 bool isGlobal = false) {
941 // If its not a symbolic name, don't modify it, probably a constant val.
942 if ((*Name)[0] != '%' && (*Name)[0] != '"')
945 // If its a numeric reference, just leave it alone.
946 if (isdigit((*Name)[1]))
952 // If its a global name, get its uniquified name, if any
953 GlobalsTypeMap::iterator GI = Globals.find(*Name);
954 if (GI != Globals.end()) {
955 TypePlaneMap::iterator TPI = GI->second.begin();
956 TypePlaneMap::iterator TPE = GI->second.end();
957 for ( ; TPI != TPE ; ++TPI) {
958 if (TPI->first->sameNewTyAs(Ty))
964 // We didn't find a global name, but if its supposed to be global then all
965 // we can do is return the name. This is probably a forward reference of a
966 // global value that hasn't been defined yet. Since we have no definition
967 // we don't know its linkage class. Just assume its an external and the name
972 // Remove as many levels of pointer nesting that we have.
973 if (Ty->isPointer()) {
974 // Avoid infinite loops in recursive types
975 const TypeInfo* Last = 0;
976 while (Ty->isPointer() && !Ty->sameOldTyAs(Last)) {
978 Ty = Ty->getElementType()->resolve();
982 // Default the result to the current name
983 std::string Result = *Name;
985 // Now deal with the underlying type
986 if (Ty->isInteger()) {
987 // If its an integer type, make the name unique
988 Result = makeUniqueName(Name, Ty->isSigned());
989 } else if (Ty->isArray() || Ty->isPacked()) {
990 Ty = Ty->getElementType();
992 Result = makeUniqueName(Name, Ty->isSigned());
993 } else if (Ty->isStruct()) {
994 // Scan the fields and count the signed and unsigned fields
996 for (unsigned i = 0; i < Ty->getNumStructElements(); ++i) {
997 const TypeInfo* Tmp = Ty->getElement(i);
998 if (Tmp->isInteger())
1005 Result = makeUniqueName(Name, isSigned > 0);
1010 static unsigned UniqueNameCounter = 0;
1012 std::string getGlobalName(const std::string* Name, const std::string Linkage,
1013 const TypeInfo* Ty, bool isConstant) {
1014 // Default to given name
1015 std::string Result = *Name;
1016 // Look up the name in the Globals Map
1017 GlobalsTypeMap::iterator GI = Globals.find(*Name);
1018 // Did we see this global name before?
1019 if (GI != Globals.end()) {
1020 if (Ty->isUnresolvedDeep()) {
1021 // The Gval's type is unresolved. Consequently, we can't disambiguate it
1022 // by type. We'll just change its name and emit a warning.
1023 warning("Cannot disambiguate global value '" + *Name +
1024 "' because type '" + Ty->getNewTy() + "'is unresolved.\n");
1025 Result = *Name + ".unique";
1026 UniqueNameCounter++;
1027 Result += llvm::utostr(UniqueNameCounter);
1030 TypePlaneMap::iterator TPI = GI->second.find(Ty);
1031 if (TPI != GI->second.end()) {
1032 // We found an existing name of the same old type. This isn't allowed
1033 // in LLVM 2.0. Consequently, we must alter the name of the global so it
1034 // can at least compile. References to the global will yield the first
1035 // definition, which is okay. We also must warn about this.
1036 Result = *Name + ".unique";
1037 UniqueNameCounter++;
1038 Result += llvm::utostr(UniqueNameCounter);
1039 warning(std::string("Global variable '") + *Name + "' was renamed to '"+
1042 // There isn't an existing definition for this name according to the
1043 // old types. Now search the TypePlanMap for types with the same new
1045 TypePlaneMap::iterator TPI = GI->second.begin();
1046 TypePlaneMap::iterator TPE = GI->second.end();
1047 for ( ; TPI != TPE; ++TPI) {
1048 if (TPI->first->sameNewTyAs(Ty)) {
1049 // The new types are the same but the old types are different so
1050 // this is a global name collision resulting from type planes
1052 if (Linkage == "external" || Linkage == "dllimport" ||
1053 Linkage == "extern_weak" || Linkage == "") {
1054 // The linkage of this gval is external so we can't reliably
1055 // rename it because it could potentially create a linking
1056 // problem. However, we can't leave the name conflict in the
1057 // output either or it won't assemble with LLVM 2.0. So, all we
1058 // can do is rename this one to something unique and emit a
1059 // warning about the problem.
1060 Result = *Name + ".unique";
1061 UniqueNameCounter++;
1062 Result += llvm::utostr(UniqueNameCounter);
1063 warning("Renaming global value '" + *Name + "' to '" + Result +
1064 "' may cause linkage errors.");
1067 // Its linkage is internal and its type is known so we can
1068 // disambiguate the name collision successfully based on the type.
1069 Result = getUniqueName(Name, Ty);
1070 TPI->second = Result;
1075 // We didn't find an entry in the type plane with the same new type and
1076 // the old types differ so this is a new type plane for this global
1077 // variable. We just fall through to the logic below which inserts
1083 // Its a new global name, if it is external we can't change it
1084 if (isConstant || Linkage == "external" || Linkage == "dllimport" ||
1085 Linkage == "extern_weak" || Linkage == "") {
1086 Globals[Result][Ty] = Result;
1090 // Its a new global name, and it is internal, change the name to make it
1091 // unique for its type.
1092 // Result = getUniqueName(Name, Ty);
1093 Globals[*Name][Ty] = Result;
1098 /* Enabling traces. */
1103 /* Enabling verbose error messages. */
1104 #ifdef YYERROR_VERBOSE
1105 # undef YYERROR_VERBOSE
1106 # define YYERROR_VERBOSE 1
1108 # define YYERROR_VERBOSE 0
1111 /* Enabling the token table. */
1112 #ifndef YYTOKEN_TABLE
1113 # define YYTOKEN_TABLE 0
1116 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1117 #line 742 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
1118 typedef union YYSTYPE {
1119 std::string* String;
1120 const TypeInfo* Type;
1126 /* Line 196 of yacc.c. */
1127 #line 1128 "UpgradeParser.tab.c"
1128 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1129 # define YYSTYPE_IS_DECLARED 1
1130 # define YYSTYPE_IS_TRIVIAL 1
1135 /* Copy the second part of user declarations. */
1138 /* Line 219 of yacc.c. */
1139 #line 1140 "UpgradeParser.tab.c"
1141 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1142 # define YYSIZE_T __SIZE_TYPE__
1144 #if ! defined (YYSIZE_T) && defined (size_t)
1145 # define YYSIZE_T size_t
1147 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1148 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1149 # define YYSIZE_T size_t
1151 #if ! defined (YYSIZE_T)
1152 # define YYSIZE_T unsigned int
1158 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1159 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1163 # define YY_(msgid) msgid
1167 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1169 /* The parser invokes alloca or malloc; define the necessary symbols. */
1171 # ifdef YYSTACK_USE_ALLOCA
1172 # if YYSTACK_USE_ALLOCA
1174 # define YYSTACK_ALLOC __builtin_alloca
1176 # define YYSTACK_ALLOC alloca
1177 # if defined (__STDC__) || defined (__cplusplus)
1178 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1179 # define YYINCLUDED_STDLIB_H
1185 # ifdef YYSTACK_ALLOC
1186 /* Pacify GCC's `empty if-body' warning. */
1187 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1188 # ifndef YYSTACK_ALLOC_MAXIMUM
1189 /* The OS might guarantee only one guard page at the bottom of the stack,
1190 and a page size can be as small as 4096 bytes. So we cannot safely
1191 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1192 to allow for a few compiler-allocated temporary stack slots. */
1193 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1196 # define YYSTACK_ALLOC YYMALLOC
1197 # define YYSTACK_FREE YYFREE
1198 # ifndef YYSTACK_ALLOC_MAXIMUM
1199 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1205 # define YYMALLOC malloc
1206 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1207 && (defined (__STDC__) || defined (__cplusplus)))
1208 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1212 # define YYFREE free
1213 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1214 && (defined (__STDC__) || defined (__cplusplus)))
1215 void free (void *); /* INFRINGES ON USER NAME SPACE */
1222 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1225 #if (! defined (yyoverflow) \
1226 && (! defined (__cplusplus) \
1227 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1229 /* A type that is properly aligned for any stack member. */
1236 /* The size of the maximum gap between one aligned stack and the next. */
1237 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1239 /* The size of an array large to enough to hold all stacks, each with
1241 # define YYSTACK_BYTES(N) \
1242 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
1243 + YYSTACK_GAP_MAXIMUM)
1245 /* Copy COUNT objects from FROM to TO. The source and destination do
1248 # if defined (__GNUC__) && 1 < __GNUC__
1249 # define YYCOPY(To, From, Count) \
1250 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1252 # define YYCOPY(To, From, Count) \
1256 for (yyi = 0; yyi < (Count); yyi++) \
1257 (To)[yyi] = (From)[yyi]; \
1263 /* Relocate STACK from its old location to the new one. The
1264 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1265 elements in the stack, and YYPTR gives the new location of the
1266 stack. Advance YYPTR to a properly aligned location for the next
1268 # define YYSTACK_RELOCATE(Stack) \
1271 YYSIZE_T yynewbytes; \
1272 YYCOPY (&yyptr->Stack, Stack, yysize); \
1273 Stack = &yyptr->Stack; \
1274 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1275 yyptr += yynewbytes / sizeof (*yyptr); \
1281 #if defined (__STDC__) || defined (__cplusplus)
1282 typedef signed char yysigned_char;
1284 typedef short int yysigned_char;
1287 /* YYFINAL -- State number of the termination state. */
1289 /* YYLAST -- Last index in YYTABLE. */
1292 /* YYNTOKENS -- Number of terminals. */
1293 #define YYNTOKENS 165
1294 /* YYNNTS -- Number of nonterminals. */
1296 /* YYNRULES -- Number of rules. */
1297 #define YYNRULES 301
1298 /* YYNRULES -- Number of states. */
1299 #define YYNSTATES 586
1301 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1302 #define YYUNDEFTOK 2
1303 #define YYMAXUTOK 405
1305 #define YYTRANSLATE(YYX) \
1306 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1308 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1309 static const unsigned char yytranslate[] =
1311 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1312 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1313 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1314 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1315 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
1316 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1317 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
1318 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1319 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1320 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
1321 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1322 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1323 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
1324 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1325 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1326 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1327 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1328 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1329 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1330 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1331 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1332 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1333 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1334 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1335 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1336 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1337 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1338 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1339 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1340 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1341 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1342 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1343 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1344 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1345 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1346 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1347 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1348 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1349 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1350 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1351 145, 146, 147, 148, 149, 150
1355 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1357 static const unsigned short int yyprhs[] =
1359 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1360 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1361 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1362 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1363 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1364 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1365 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
1366 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
1367 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
1368 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
1369 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
1370 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
1371 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
1372 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
1373 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
1374 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
1375 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
1376 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
1377 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
1378 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
1379 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
1380 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
1381 619, 623, 625, 627, 631, 632, 634, 636, 640, 641,
1382 643, 645, 647, 649, 651, 653, 655, 657, 659, 663,
1383 665, 671, 673, 675, 677, 679, 682, 685, 687, 690,
1384 693, 694, 696, 698, 700, 703, 706, 710, 720, 730,
1385 739, 754, 756, 758, 765, 771, 774, 781, 789, 791,
1386 795, 797, 798, 801, 803, 809, 815, 821, 828, 835,
1387 838, 843, 848, 855, 860, 865, 872, 879, 882, 890,
1388 892, 895, 896, 898, 899, 903, 910, 914, 921, 924,
1392 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1393 static const short int yyrhs[] =
1395 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
1396 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1397 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
1398 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
1399 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
1400 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1401 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
1402 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
1403 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
1404 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
1405 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
1406 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
1407 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
1408 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
1409 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
1410 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
1411 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
1412 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
1413 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
1414 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
1415 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
1416 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
1417 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
1418 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
1419 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
1420 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
1421 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
1422 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
1423 -1, 161, 193, 162, -1, 161, 162, -1, 159, 161,
1424 193, 162, 160, -1, 159, 161, 162, 160, -1, 192,
1425 163, -1, 192, -1, 193, 152, 192, -1, 193, -1,
1426 193, 152, 40, -1, 40, -1, -1, 190, 156, 197,
1427 158, -1, 190, 156, 158, -1, 190, 164, 30, -1,
1428 190, 159, 197, 160, -1, 190, 161, 197, 162, -1,
1429 190, 161, 162, -1, 190, 22, -1, 190, 23, -1,
1430 190, 222, -1, 190, 196, -1, 190, 24, -1, 175,
1431 167, -1, 176, 167, -1, 4, 25, -1, 4, 26,
1432 -1, 178, 21, -1, 174, 154, 195, 39, 190, 155,
1433 -1, 127, 154, 195, 237, 155, -1, 129, 154, 195,
1434 152, 195, 152, 195, 155, -1, 168, 154, 195, 152,
1435 195, 155, -1, 169, 154, 195, 152, 195, 155, -1,
1436 170, 154, 195, 152, 195, 155, -1, 100, 171, 154,
1437 195, 152, 195, 155, -1, 101, 172, 154, 195, 152,
1438 195, 155, -1, 173, 154, 195, 152, 195, 155, -1,
1439 135, 154, 195, 152, 195, 155, -1, 136, 154, 195,
1440 152, 195, 152, 195, 155, -1, 137, 154, 195, 152,
1441 195, 152, 195, 155, -1, 197, 152, 195, -1, 195,
1442 -1, 35, -1, 36, -1, 200, -1, 200, 217, -1,
1443 200, 219, -1, 200, 63, 62, 203, -1, 200, 31,
1444 -1, 202, -1, 50, -1, 58, -1, 202, 179, 27,
1445 188, -1, 202, 219, -1, 202, 63, 62, 203, -1,
1446 202, 179, 180, 198, 195, 186, -1, 202, 179, 201,
1447 198, 190, 186, -1, 202, 179, 45, 198, 190, 186,
1448 -1, 202, 179, 47, 198, 190, 186, -1, 202, 51,
1449 205, -1, 202, 59, 151, 206, -1, -1, 30, -1,
1450 56, -1, 55, -1, 53, 151, 204, -1, 54, 151,
1451 18, -1, 52, 151, 30, -1, 72, 151, 30, -1,
1452 156, 207, 158, -1, 207, 152, 30, -1, 30, -1,
1453 -1, 28, -1, 30, -1, 208, -1, -1, 190, 209,
1454 -1, 211, 152, 210, -1, 210, -1, 211, -1, 211,
1455 152, 40, -1, 40, -1, -1, 181, 188, 208, 154,
1456 212, 155, 185, 182, -1, 32, -1, 161, -1, 180,
1457 213, 214, -1, 33, -1, 162, -1, 215, 225, 216,
1458 -1, -1, 45, -1, 47, -1, 34, 218, 213, -1,
1459 -1, 64, -1, 17, -1, 18, -1, 21, -1, 25,
1460 -1, 26, -1, 22, -1, 23, -1, 24, -1, 159,
1461 197, 160, -1, 196, -1, 62, 220, 30, 152, 30,
1462 -1, 166, -1, 208, -1, 222, -1, 221, -1, 190,
1463 223, -1, 225, 226, -1, 226, -1, 227, 229, -1,
1464 227, 231, -1, -1, 29, -1, 78, -1, 77, -1,
1465 73, 224, -1, 73, 3, -1, 74, 15, 223, -1,
1466 74, 4, 223, 152, 15, 223, 152, 15, 223, -1,
1467 75, 177, 223, 152, 15, 223, 156, 230, 158, -1,
1468 75, 177, 223, 152, 15, 223, 156, 158, -1, 179,
1469 76, 181, 188, 223, 154, 234, 155, 39, 15, 223,
1470 228, 15, 223, -1, 228, -1, 79, -1, 230, 177,
1471 221, 152, 15, 223, -1, 177, 221, 152, 15, 223,
1472 -1, 179, 236, -1, 190, 156, 223, 152, 223, 158,
1473 -1, 232, 152, 156, 223, 152, 223, 158, -1, 224,
1474 -1, 233, 152, 224, -1, 233, -1, -1, 61, 60,
1475 -1, 60, -1, 168, 190, 223, 152, 223, -1, 169,
1476 190, 223, 152, 223, -1, 170, 190, 223, 152, 223,
1477 -1, 100, 171, 190, 223, 152, 223, -1, 101, 172,
1478 190, 223, 152, 223, -1, 49, 224, -1, 173, 224,
1479 152, 224, -1, 174, 224, 39, 190, -1, 129, 224,
1480 152, 224, 152, 224, -1, 134, 224, 152, 190, -1,
1481 135, 224, 152, 224, -1, 136, 224, 152, 224, 152,
1482 224, -1, 137, 224, 152, 224, 152, 224, -1, 128,
1483 232, -1, 235, 181, 188, 223, 154, 234, 155, -1,
1484 239, -1, 152, 233, -1, -1, 38, -1, -1, 122,
1485 190, 183, -1, 122, 190, 152, 10, 223, 183, -1,
1486 123, 190, 183, -1, 123, 190, 152, 10, 223, 183,
1487 -1, 124, 224, -1, 238, 125, 190, 223, -1, 238,
1488 126, 224, 152, 190, 223, -1, 127, 190, 223, 237,
1492 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1493 static const unsigned short int yyrline[] =
1495 0, 807, 807, 807, 808, 808, 812, 812, 812, 812,
1496 812, 812, 812, 813, 813, 813, 813, 814, 814, 814,
1497 815, 815, 815, 815, 815, 815, 816, 816, 816, 816,
1498 816, 816, 816, 816, 816, 816, 817, 817, 817, 817,
1499 817, 817, 817, 817, 817, 817, 818, 818, 818, 818,
1500 818, 818, 819, 819, 819, 819, 820, 820, 820, 820,
1501 820, 820, 820, 821, 821, 821, 821, 821, 821, 826,
1502 826, 826, 826, 827, 827, 827, 827, 828, 828, 829,
1503 829, 832, 835, 840, 840, 840, 840, 840, 840, 841,
1504 842, 845, 845, 845, 845, 845, 846, 847, 852, 857,
1505 858, 861, 862, 870, 876, 877, 880, 881, 890, 891,
1506 904, 904, 905, 905, 906, 910, 910, 910, 910, 910,
1507 910, 910, 911, 911, 911, 911, 911, 913, 916, 919,
1508 922, 926, 939, 945, 951, 961, 964, 974, 977, 985,
1509 989, 996, 997, 1002, 1007, 1017, 1023, 1028, 1034, 1040,
1510 1046, 1051, 1057, 1063, 1070, 1076, 1082, 1088, 1094, 1100,
1511 1106, 1114, 1128, 1140, 1145, 1151, 1156, 1162, 1167, 1172,
1512 1180, 1185, 1190, 1200, 1205, 1210, 1210, 1220, 1225, 1228,
1513 1233, 1237, 1241, 1243, 1243, 1246, 1256, 1261, 1266, 1276,
1514 1286, 1296, 1306, 1311, 1316, 1321, 1323, 1323, 1326, 1331,
1515 1338, 1343, 1350, 1357, 1362, 1363, 1371, 1371, 1372, 1372,
1516 1374, 1383, 1387, 1391, 1394, 1399, 1402, 1405, 1423, 1424,
1517 1427, 1438, 1439, 1441, 1450, 1451, 1452, 1456, 1469, 1470,
1518 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1474, 1475, 1480,
1519 1481, 1490, 1490, 1494, 1499, 1509, 1518, 1521, 1529, 1533,
1520 1538, 1541, 1547, 1547, 1549, 1554, 1559, 1564, 1572, 1580,
1521 1587, 1609, 1614, 1620, 1626, 1634, 1652, 1660, 1669, 1673,
1522 1680, 1681, 1685, 1690, 1693, 1702, 1710, 1719, 1727, 1735,
1523 1740, 1749, 1777, 1783, 1789, 1796, 1802, 1808, 1814, 1832,
1524 1837, 1838, 1842, 1843, 1846, 1854, 1863, 1871, 1880, 1886,
1529 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1530 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1531 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1532 static const char *const yytname[] =
1534 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1535 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1536 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1537 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1538 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1539 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1540 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1541 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1542 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1543 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1544 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1545 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1546 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1547 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1548 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1549 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1550 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1551 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1552 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1553 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1554 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1555 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1556 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1557 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1558 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1559 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1560 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1561 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1562 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1563 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1564 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1565 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1566 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1567 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1568 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1569 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1570 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1571 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1572 "IndexList", "OptVolatile", "MemoryInst", 0
1577 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1579 static const unsigned short int yytoknum[] =
1581 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1582 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1583 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1584 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1585 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1586 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1587 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1588 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1589 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1590 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1591 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1592 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1593 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1594 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1595 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1596 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1597 62, 123, 125, 42, 99
1601 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1602 static const unsigned char yyr1[] =
1604 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1605 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1606 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1607 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
1608 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1609 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1610 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1611 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1612 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1613 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1614 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1615 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1616 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1617 192, 192, 192, 192, 192, 192, 192, 192, 192, 193,
1618 193, 194, 194, 194, 194, 195, 195, 195, 195, 195,
1619 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1620 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1621 196, 196, 196, 197, 197, 198, 198, 199, 200, 200,
1622 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1623 202, 202, 202, 202, 202, 203, 204, 204, 205, 205,
1624 205, 205, 206, 207, 207, 207, 208, 208, 209, 209,
1625 210, 211, 211, 212, 212, 212, 212, 213, 214, 214,
1626 215, 216, 216, 217, 218, 218, 218, 219, 220, 220,
1627 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1628 221, 222, 222, 223, 223, 224, 225, 225, 226, 227,
1629 227, 227, 228, 228, 229, 229, 229, 229, 229, 229,
1630 229, 229, 229, 230, 230, 231, 232, 232, 233, 233,
1631 234, 234, 235, 235, 236, 236, 236, 236, 236, 236,
1632 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1633 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1637 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1638 static const unsigned char yyr2[] =
1640 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1641 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1643 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1648 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1649 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1650 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1653 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1654 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1655 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1656 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1657 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1658 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1659 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1660 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1661 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1662 3, 1, 1, 3, 0, 1, 1, 3, 0, 1,
1663 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1664 5, 1, 1, 1, 1, 2, 2, 1, 2, 2,
1665 0, 1, 1, 1, 2, 2, 3, 9, 9, 8,
1666 14, 1, 1, 6, 5, 2, 6, 7, 1, 3,
1667 1, 0, 2, 1, 5, 5, 5, 6, 6, 2,
1668 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1669 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1673 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1674 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1675 means the default is an error. */
1676 static const unsigned short int yydefact[] =
1678 194, 0, 90, 182, 1, 181, 224, 83, 84, 85,
1679 87, 88, 89, 86, 0, 98, 250, 178, 179, 206,
1680 207, 0, 0, 0, 90, 0, 186, 225, 226, 98,
1681 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1682 251, 250, 247, 82, 0, 0, 0, 0, 192, 0,
1683 0, 0, 0, 0, 183, 184, 0, 0, 81, 227,
1684 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1685 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1686 0, 0, 0, 241, 0, 0, 110, 129, 114, 242,
1687 128, 218, 219, 220, 221, 222, 223, 246, 0, 0,
1688 0, 253, 252, 262, 293, 261, 248, 249, 0, 0,
1689 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1690 0, 0, 130, 0, 0, 0, 113, 135, 139, 0,
1691 0, 144, 138, 255, 0, 254, 0, 0, 72, 76,
1692 71, 75, 70, 74, 69, 73, 77, 78, 0, 292,
1693 0, 273, 0, 98, 6, 7, 8, 9, 10, 11,
1694 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1695 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1696 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1697 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1698 65, 66, 67, 0, 0, 0, 0, 0, 98, 265,
1699 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1700 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1701 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1702 0, 0, 0, 0, 134, 216, 143, 141, 0, 230,
1703 231, 232, 235, 236, 237, 233, 234, 228, 0, 0,
1704 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1705 0, 239, 244, 243, 245, 0, 256, 0, 279, 272,
1706 0, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1707 35, 0, 50, 51, 36, 37, 38, 39, 40, 41,
1708 42, 43, 44, 45, 46, 47, 48, 49, 0, 101,
1709 101, 298, 0, 0, 287, 0, 0, 0, 0, 0,
1710 0, 0, 0, 0, 0, 0, 0, 0, 0, 202,
1711 0, 190, 191, 158, 159, 4, 5, 156, 157, 160,
1712 151, 152, 155, 0, 0, 0, 0, 154, 153, 188,
1713 189, 112, 112, 137, 0, 140, 215, 209, 212, 213,
1714 0, 0, 131, 229, 0, 0, 0, 0, 0, 0,
1715 0, 0, 174, 0, 0, 0, 0, 0, 0, 0,
1716 0, 0, 0, 0, 0, 294, 0, 296, 291, 0,
1717 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1718 0, 0, 0, 0, 203, 0, 0, 108, 106, 146,
1719 0, 0, 150, 0, 147, 132, 133, 136, 208, 210,
1720 0, 104, 142, 0, 0, 0, 291, 0, 0, 0,
1721 0, 0, 238, 0, 0, 0, 0, 0, 0, 0,
1722 0, 0, 0, 0, 0, 0, 0, 301, 0, 0,
1723 0, 283, 284, 0, 0, 0, 0, 0, 280, 281,
1724 0, 299, 0, 103, 109, 107, 145, 148, 149, 214,
1725 211, 105, 99, 0, 0, 0, 0, 0, 0, 0,
1726 0, 173, 0, 0, 0, 0, 0, 0, 0, 271,
1727 0, 0, 101, 102, 101, 268, 290, 0, 0, 0,
1728 0, 0, 274, 275, 276, 271, 0, 0, 217, 240,
1729 0, 0, 162, 0, 0, 0, 0, 0, 0, 0,
1730 0, 0, 0, 0, 270, 0, 277, 278, 0, 295,
1731 297, 0, 0, 0, 282, 285, 286, 0, 300, 100,
1732 0, 0, 0, 170, 0, 0, 164, 165, 166, 169,
1733 161, 0, 259, 0, 0, 0, 269, 266, 0, 288,
1734 167, 168, 0, 0, 0, 257, 0, 258, 0, 0,
1735 267, 163, 171, 172, 0, 0, 0, 0, 0, 0,
1736 264, 0, 0, 263, 0, 260
1739 /* YYDEFGOTO[NTERM-NUM]. */
1740 static const short int yydefgoto[] =
1742 -1, 83, 337, 266, 267, 268, 291, 308, 269, 270,
1743 233, 234, 148, 235, 24, 15, 38, 508, 385, 407,
1744 472, 331, 408, 84, 85, 236, 87, 88, 129, 248,
1745 372, 271, 373, 118, 1, 2, 57, 3, 61, 215,
1746 48, 113, 219, 89, 419, 358, 359, 360, 39, 93,
1747 16, 96, 17, 29, 18, 364, 272, 90, 274, 495,
1748 41, 42, 43, 105, 106, 554, 107, 314, 524, 525,
1749 208, 209, 447, 210, 211
1752 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1754 #define YYPACT_NINF -513
1755 static const short int yypact[] =
1757 -513, 46, 217, 541, -513, -513, 82, -513, -513, -513,
1758 -513, -513, -513, -513, 16, 111, 25, -513, -513, -513,
1759 -513, 34, -55, 61, 26, -23, -513, -513, -513, 111,
1760 132, 146, -513, -513, -513, -513, -513, -513, 873, -26,
1761 -513, -18, -513, 47, 19, 23, 39, 67, -513, 77,
1762 132, 873, 81, 81, -513, -513, 81, 81, -513, -513,
1763 -513, -513, -513, 89, -513, -513, -513, -513, -513, -513,
1764 -513, -513, -513, -513, -513, -513, -513, -513, -513, 227,
1765 229, -9, 506, -513, 133, 95, -513, -513, -111, -513,
1766 -513, -513, -513, -513, -513, -513, -513, -513, 901, 36,
1767 148, -513, -513, -513, 1336, -513, -513, -513, 222, 76,
1768 250, 239, 241, -513, -513, -513, -513, -513, 933, 933,
1769 963, 933, -513, 115, 116, 614, -513, -513, -111, -104,
1770 120, 216, -513, 89, 1134, -513, 1134, 1134, -513, -513,
1771 -513, -513, -513, -513, -513, -513, -513, -513, 1134, -513,
1772 933, -513, 218, 111, -513, -513, -513, -513, -513, -513,
1773 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1774 -513, -513, -513, -513, 195, 84, 933, 933, 933, 933,
1775 933, 933, -513, -513, -513, -513, 933, 933, 933, 933,
1776 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1777 -513, -513, -513, 933, 933, 933, 933, 933, 111, -513,
1778 11, -513, -513, -513, -513, -513, -513, -513, -513, -93,
1779 129, 129, 121, 166, 169, 191, 193, 220, 223, 237,
1780 240, 261, 263, 249, 249, 264, 1045, 129, 129, 933,
1781 933, 126, -73, 933, -513, 701, -513, 138, 136, -513,
1782 -513, -513, -513, -513, -513, -513, -513, 228, 195, 84,
1783 140, 150, 154, 156, 158, 963, 167, 168, 170, 171,
1784 172, -513, -513, -513, -513, 175, -513, 176, -513, -513,
1785 873, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1786 -513, 933, -513, -513, -513, -513, -513, -513, -513, -513,
1787 -513, -513, -513, -513, -513, -513, -513, -513, 933, 177,
1788 178, -513, 1134, 164, 179, 182, 183, 184, 186, 188,
1789 1134, 1134, 1134, 189, 284, 873, 933, 933, 312, -513,
1790 -8, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1791 -513, -513, -513, 741, 963, 673, 314, -513, -513, -513,
1792 -513, -113, -99, -513, 185, -111, -513, 133, -513, 194,
1793 192, 774, -513, -513, 318, 198, 205, 963, 963, 963,
1794 963, 963, -513, -58, 963, 963, 963, 963, 963, 345,
1795 348, 1134, 1134, 1134, -2, -513, 9, -513, 212, 1134,
1796 209, 933, 933, 933, 933, 933, 214, 215, 219, 933,
1797 933, 1134, 1134, 221, -513, 338, 352, -513, 129, -513,
1798 -61, -57, -513, -70, -513, -513, -513, -513, -513, -513,
1799 833, 337, -513, 224, 963, 963, 212, 231, 235, 236,
1800 238, 963, -513, 242, 243, 244, 245, 342, 1134, 1134,
1801 247, 251, 252, 1134, 371, 1134, 933, -513, 253, 1134,
1802 254, -513, -513, 255, 257, 1134, 1134, 1134, -513, -513,
1803 248, -513, 933, -513, -513, -513, -513, -513, -513, -513,
1804 -513, -513, 335, 363, 258, 262, 260, 963, 963, 963,
1805 963, -513, 963, 963, 963, 963, 933, 265, 266, 933,
1806 1134, 1134, 267, -513, 267, -513, 268, 1134, 269, 933,
1807 933, 933, -513, -513, -513, 933, 1134, 398, -513, -513,
1808 963, 963, -513, 271, 273, 277, 278, 276, 279, 282,
1809 283, 286, 403, 15, 268, 289, -513, -513, 375, -513,
1810 -513, 933, 275, 1134, -513, -513, -513, 292, -513, -513,
1811 294, 295, 963, -513, 963, 963, -513, -513, -513, -513,
1812 -513, 1134, -513, 1223, 27, 400, -513, -513, 297, -513,
1813 -513, -513, 303, 304, 305, -513, 313, -513, 1223, 449,
1814 -513, -513, -513, -513, 451, 316, 1134, 1134, 454, 135,
1815 -513, 1134, 457, -513, 1134, -513
1818 /* YYPGOTO[NTERM-NUM]. */
1819 static const short int yypgoto[] =
1821 -513, -513, 246, 369, 370, 372, 225, 226, 373, 377,
1822 -98, -97, -507, -513, 436, 458, -141, -513, -303, 63,
1823 -513, -220, -513, -46, -513, -38, -513, -68, -20, -513,
1824 130, 256, -230, 51, -513, -513, -513, -513, 439, -513,
1825 -513, -513, -513, 1, -513, 66, -513, -513, 461, -513,
1826 -513, -513, -513, -513, 488, -513, -512, -106, -3, -88,
1827 -513, 455, -513, -84, -513, -513, -513, -513, 56, 18,
1828 -513, -513, 98, -513, -513
1831 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1832 positive, shift that token. If negative, reduce the rule which
1833 number is the opposite. If zero, do what YYDEFACT says.
1834 If YYTABLE_NINF, syntax error. */
1835 #define YYTABLE_NINF -178
1836 static const short int yytable[] =
1838 86, 332, 146, 147, 25, 115, 91, 387, 443, 124,
1839 135, 40, 280, 86, 128, 94, 553, 349, 350, 445,
1840 138, 139, 140, 141, 142, 143, 144, 145, 273, 405,
1841 273, 273, 138, 139, 140, 141, 142, 143, 144, 145,
1842 136, 566, 273, -112, 25, 415, 4, 568, 243, 406,
1843 132, 137, 132, 51, 40, 444, 575, 128, 244, 328,
1844 134, 416, 278, 128, 132, 329, 444, 325, 7, 8,
1845 9, 52, 11, 53, 13, 19, 54, 20, 30, 243,
1846 220, 221, 431, 238, 55, 130, 44, 45, 46, 354,
1847 311, 431, 468, 315, 431, 431, 49, 466, 316, 317,
1848 318, 319, 432, 467, 119, 242, 47, 120, 121, 292,
1849 293, 247, 134, 410, 411, 413, 116, 117, 323, 324,
1850 98, 99, 100, 50, 101, 102, 103, 27, 58, 28,
1851 348, 213, 214, 275, 276, 92, 326, 327, 309, 310,
1852 134, 312, 313, 134, 95, 277, 333, 334, 134, 134,
1853 134, 134, 125, 138, 139, 140, 141, 142, 143, 144,
1854 145, 19, 60, 20, 62, 320, 321, 322, 134, 134,
1855 108, 351, 352, 552, 109, 355, 31, 32, 33, 34,
1856 35, 36, 37, -72, -72, 567, -76, -76, 465, 529,
1857 110, 530, 294, 295, 296, 297, 298, 299, 300, 301,
1858 302, 303, 304, 305, 306, 307, 273, 357, -71, -71,
1859 -75, -75, 101, 102, 273, 273, 273, -177, 111, 126,
1860 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1861 74, 75, 76, 112, 381, 77, 78, -70, -70, 403,
1862 -74, -74, 86, -113, 19, 122, 20, 123, 5, 131,
1863 237, 6, 212, 382, -69, -69, 246, -73, -73, 7,
1864 8, 9, 10, 11, 12, 13, 335, 336, 216, 217,
1865 383, 218, 239, 240, 245, 273, 273, 273, 279, 401,
1866 14, 330, -79, 273, -80, 339, 353, 86, 402, 134,
1867 361, 362, 363, 355, 367, 273, 273, 281, 282, 283,
1868 284, 285, 286, 450, 368, 452, 453, 454, 369, 388,
1869 370, 458, 371, 287, 288, 289, 290, 396, 397, 398,
1870 389, 374, 375, 400, 376, 377, 378, 379, 380, 384,
1871 386, 390, 273, 273, 391, 392, 393, 273, 394, 273,
1872 395, 399, 404, 273, 414, 417, 420, 421, 423, 273,
1873 273, 273, 424, 134, 451, 134, 134, 134, 418, 425,
1874 438, 134, 459, 439, 446, 449, 455, 456, 463, 79,
1875 464, 457, 80, 462, 405, 81, 473, 82, 440, 441,
1876 442, 486, 357, 477, 273, 273, 448, 478, 479, 493,
1877 480, 273, 507, 509, 482, 483, 484, 485, 460, 461,
1878 273, 489, 505, 490, 491, 497, 499, 500, 134, 501,
1879 510, 534, 535, 536, 511, 512, 539, 522, 551, 528,
1880 531, 533, 523, 542, 506, 146, 147, 273, 543, 544,
1881 545, 546, 444, 557, 547, 487, 488, 548, 549, 569,
1882 492, 550, 494, 556, 555, 273, 498, 559, 521, 560,
1883 561, 134, 502, 503, 504, 570, 146, 147, 571, 572,
1884 573, 134, 134, 134, 576, 574, 577, 134, 578, 581,
1885 273, 273, 584, 203, 204, 273, 205, 206, 273, 104,
1886 338, 207, 56, 365, 471, 366, 470, 526, 527, 114,
1887 59, 26, 347, 134, 532, 582, 97, 426, 427, 428,
1888 429, 430, 496, 538, 433, 434, 435, 436, 437, 126,
1889 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1890 74, 75, 76, 537, 476, 77, 78, 0, 0, 0,
1891 558, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1892 0, 0, 0, 0, 0, 0, 0, 0, 565, 0,
1893 0, 0, 0, 0, 474, 475, 0, 0, 0, 0,
1894 0, 481, 0, 0, 0, 0, 0, 0, -82, 19,
1895 0, 20, 0, 579, 580, 6, -82, -82, 583, 0,
1896 0, 585, 0, -82, -82, -82, -82, -82, -82, -82,
1897 0, -82, 21, 0, 0, 0, 0, 0, 0, -82,
1898 22, 0, 0, 0, 23, 0, 0, 513, 514, 515,
1899 516, 0, 517, 518, 519, 520, 0, 126, 64, 65,
1900 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1901 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1902 540, 541, 19, 0, 20, 0, 0, 0, 0, 0,
1903 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
1904 0, 0, 80, 0, 0, 81, 0, 82, 127, 0,
1905 0, 0, 562, 0, 563, 564, 126, 222, 223, 224,
1906 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1907 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1908 0, 19, 0, 20, 126, 64, 65, 66, 67, 68,
1909 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1910 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1911 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1912 0, 356, 0, 0, 126, 222, 223, 224, 225, 226,
1913 227, 228, 229, 230, 231, 232, 75, 76, 0, 0,
1914 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1915 80, 20, 0, 81, 0, 82, 241, 126, 64, 65,
1916 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1917 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1918 0, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1919 0, 0, 0, 0, 422, 0, 0, 0, 0, 0,
1920 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1921 0, 0, 81, 0, 82, 412, 126, 64, 65, 66,
1922 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1923 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
1924 81, 19, 82, 20, 0, 0, 0, 0, 0, 0,
1925 0, 0, 0, 469, 0, 0, 63, 64, 65, 66,
1926 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1927 0, 0, 77, 78, 79, 0, 0, 80, 0, 409,
1928 81, 19, 82, 20, 133, 64, 65, 66, 67, 68,
1929 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1930 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1931 80, 20, 0, 81, 0, 82, 126, 64, 65, 66,
1932 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1933 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1934 0, 19, 0, 20, 0, 0, 126, 222, 223, 224,
1935 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1936 0, 0, 77, 78, 0, 0, 79, 0, 0, 80,
1937 0, 19, 81, 20, 82, 0, 0, 0, 0, 0,
1938 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1939 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1940 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1941 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1942 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1943 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
1944 81, 0, 82, 0, 77, 78, 0, 340, 341, 342,
1945 0, 0, 0, 19, 0, 20, 0, 0, 0, 0,
1946 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1947 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
1948 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1949 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1950 0, 0, 81, 0, 82, 154, 155, 156, 157, 158,
1951 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
1952 169, 170, 171, 172, 173, 258, 259, 0, 0, 0,
1953 0, 249, 250, 77, 78, 251, 252, 253, 254, 255,
1954 256, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1955 0, 0, 260, 0, 261, 182, 183, 184, 185, 0,
1956 262, 263, 264, 190, 191, 192, 193, 194, 195, 196,
1957 197, 198, 199, 200, 201, 202, 257, 0, 0, 0,
1958 0, 343, 0, 0, 344, 0, 345, 0, 0, 346,
1959 0, 0, 0, 0, 154, 155, 156, 157, 158, 159,
1960 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
1961 170, 171, 172, 173, 258, 259, 0, 0, 0, 0,
1962 249, 250, 0, 0, 251, 252, 253, 254, 255, 256,
1963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1964 0, 260, 0, 261, 182, 183, 184, 185, 0, 262,
1965 263, 264, 190, 191, 192, 193, 194, 195, 196, 197,
1966 198, 199, 200, 201, 202, 257, 0, 0, 0, 0,
1967 0, 0, 0, 265, 0, 0, 0, 0, 0, 0,
1968 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
1969 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
1970 171, 172, 173, 258, 259, 0, 0, 0, 0, 0,
1971 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1972 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1973 260, 0, 261, 182, 183, 184, 185, 0, 262, 263,
1974 264, 190, 191, 192, 193, 194, 195, 196, 197, 198,
1975 199, 200, 201, 202, 149, 0, 0, 0, 0, 0,
1976 0, 0, 265, 0, 0, 150, 0, 0, 0, 0,
1977 0, 0, 0, 0, 0, 0, 151, 152, 0, 0,
1978 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1979 0, 0, 153, 0, 0, 0, 154, 155, 156, 157,
1980 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
1981 168, 169, 170, 171, 172, 173, 174, 175, 0, 0,
1982 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1983 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
1984 178, 0, 0, 179, 180, 181, 182, 183, 184, 185,
1985 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
1986 196, 197, 198, 199, 200, 201, 202
1989 static const short int yycheck[] =
1991 38, 221, 100, 100, 3, 51, 32, 310, 10, 18,
1992 98, 29, 153, 51, 82, 33, 523, 237, 238, 10,
1993 5, 6, 7, 8, 9, 10, 11, 12, 134, 37,
1994 136, 137, 5, 6, 7, 8, 9, 10, 11, 12,
1995 4, 553, 148, 154, 43, 158, 0, 554, 152, 57,
1996 163, 15, 163, 27, 29, 57, 568, 125, 162, 152,
1997 98, 160, 150, 131, 163, 158, 57, 208, 42, 43,
1998 44, 45, 46, 47, 48, 28, 50, 30, 62, 152,
1999 118, 119, 152, 121, 58, 84, 52, 53, 54, 162,
2000 178, 152, 162, 181, 152, 152, 151, 158, 186, 187,
2001 188, 189, 160, 160, 53, 125, 72, 56, 57, 25,
2002 26, 131, 150, 343, 344, 345, 35, 36, 206, 207,
2003 73, 74, 75, 62, 77, 78, 79, 45, 151, 47,
2004 236, 55, 56, 136, 137, 161, 125, 126, 176, 177,
2005 178, 179, 180, 181, 162, 148, 25, 26, 186, 187,
2006 188, 189, 161, 5, 6, 7, 8, 9, 10, 11,
2007 12, 28, 30, 30, 18, 203, 204, 205, 206, 207,
2008 151, 239, 240, 158, 151, 243, 65, 66, 67, 68,
2009 69, 70, 71, 17, 18, 158, 17, 18, 408, 492,
2010 151, 494, 108, 109, 110, 111, 112, 113, 114, 115,
2011 116, 117, 118, 119, 120, 121, 312, 245, 17, 18,
2012 17, 18, 77, 78, 320, 321, 322, 0, 151, 3,
2013 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2014 14, 15, 16, 156, 280, 19, 20, 17, 18, 327,
2015 17, 18, 280, 154, 28, 18, 30, 18, 31, 154,
2016 120, 34, 30, 291, 17, 18, 40, 17, 18, 42,
2017 43, 44, 45, 46, 47, 48, 17, 18, 18, 30,
2018 308, 30, 157, 157, 154, 381, 382, 383, 60, 325,
2019 63, 152, 21, 389, 21, 21, 160, 325, 326, 327,
2020 152, 155, 64, 361, 154, 401, 402, 102, 103, 104,
2021 105, 106, 107, 391, 154, 393, 394, 395, 154, 312,
2022 154, 399, 154, 118, 119, 120, 121, 320, 321, 322,
2023 156, 154, 154, 39, 154, 154, 154, 152, 152, 152,
2024 152, 152, 438, 439, 152, 152, 152, 443, 152, 445,
2025 152, 152, 30, 449, 30, 160, 152, 155, 30, 455,
2026 456, 457, 154, 391, 392, 393, 394, 395, 357, 154,
2027 15, 399, 400, 15, 152, 156, 152, 152, 30, 153,
2028 18, 152, 156, 152, 37, 159, 152, 161, 381, 382,
2029 383, 39, 420, 152, 490, 491, 389, 152, 152, 18,
2030 152, 497, 57, 30, 152, 152, 152, 152, 401, 402,
2031 506, 154, 154, 152, 152, 152, 152, 152, 446, 152,
2032 152, 499, 500, 501, 152, 155, 18, 152, 15, 152,
2033 152, 152, 156, 152, 462, 523, 523, 533, 155, 152,
2034 152, 155, 57, 158, 155, 438, 439, 155, 155, 39,
2035 443, 155, 445, 531, 155, 551, 449, 155, 486, 155,
2036 155, 489, 455, 456, 457, 158, 554, 554, 155, 155,
2037 155, 499, 500, 501, 15, 152, 15, 505, 152, 15,
2038 576, 577, 15, 104, 104, 581, 104, 104, 584, 43,
2039 234, 104, 24, 258, 421, 259, 420, 490, 491, 50,
2040 29, 3, 236, 531, 497, 579, 41, 367, 368, 369,
2041 370, 371, 446, 506, 374, 375, 376, 377, 378, 3,
2042 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2043 14, 15, 16, 505, 426, 19, 20, -1, -1, -1,
2044 533, -1, -1, -1, 28, -1, 30, -1, -1, -1,
2045 -1, -1, -1, -1, -1, -1, -1, -1, 551, -1,
2046 -1, -1, -1, -1, 424, 425, -1, -1, -1, -1,
2047 -1, 431, -1, -1, -1, -1, -1, -1, 27, 28,
2048 -1, 30, -1, 576, 577, 34, 35, 36, 581, -1,
2049 -1, 584, -1, 42, 43, 44, 45, 46, 47, 48,
2050 -1, 50, 51, -1, -1, -1, -1, -1, -1, 58,
2051 59, -1, -1, -1, 63, -1, -1, 477, 478, 479,
2052 480, -1, 482, 483, 484, 485, -1, 3, 4, 5,
2053 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2054 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
2055 510, 511, 28, -1, 30, -1, -1, -1, -1, -1,
2056 -1, -1, -1, -1, -1, -1, -1, -1, -1, 153,
2057 -1, -1, 156, -1, -1, 159, -1, 161, 162, -1,
2058 -1, -1, 542, -1, 544, 545, 3, 4, 5, 6,
2059 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2060 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
2061 -1, 28, -1, 30, 3, 4, 5, 6, 7, 8,
2062 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2063 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2064 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
2065 -1, 40, -1, -1, 3, 4, 5, 6, 7, 8,
2066 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2067 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
2068 156, 30, -1, 159, -1, 161, 162, 3, 4, 5,
2069 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2070 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
2071 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
2072 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
2073 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2074 -1, -1, 159, -1, 161, 162, 3, 4, 5, 6,
2075 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2076 -1, -1, 19, 20, 153, -1, -1, 156, -1, -1,
2077 159, 28, 161, 30, -1, -1, -1, -1, -1, -1,
2078 -1, -1, -1, 40, -1, -1, 3, 4, 5, 6,
2079 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2080 -1, -1, 19, 20, 153, -1, -1, 156, -1, 158,
2081 159, 28, 161, 30, 3, 4, 5, 6, 7, 8,
2082 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2083 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
2084 156, 30, -1, 159, -1, 161, 3, 4, 5, 6,
2085 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2086 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
2087 -1, 28, -1, 30, -1, -1, 3, 4, 5, 6,
2088 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2089 -1, -1, 19, 20, -1, -1, 153, -1, -1, 156,
2090 -1, 28, 159, 30, 161, -1, -1, -1, -1, -1,
2091 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2092 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2093 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2094 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
2095 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2096 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
2097 159, -1, 161, -1, 19, 20, -1, 22, 23, 24,
2098 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
2099 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2100 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
2101 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2102 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2103 -1, -1, 159, -1, 161, 80, 81, 82, 83, 84,
2104 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2105 95, 96, 97, 98, 99, 100, 101, -1, -1, -1,
2106 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
2107 26, -1, 28, -1, 30, -1, -1, -1, -1, -1,
2108 -1, -1, 127, -1, 129, 130, 131, 132, 133, -1,
2109 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
2110 145, 146, 147, 148, 149, 150, 62, -1, -1, -1,
2111 -1, 156, -1, -1, 159, -1, 161, -1, -1, 164,
2112 -1, -1, -1, -1, 80, 81, 82, 83, 84, 85,
2113 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2114 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
2115 17, 18, -1, -1, 21, 22, 23, 24, 25, 26,
2116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2117 -1, 127, -1, 129, 130, 131, 132, 133, -1, 135,
2118 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
2119 146, 147, 148, 149, 150, 62, -1, -1, -1, -1,
2120 -1, -1, -1, 159, -1, -1, -1, -1, -1, -1,
2121 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
2122 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2123 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
2124 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2125 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2126 127, -1, 129, 130, 131, 132, 133, -1, 135, 136,
2127 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2128 147, 148, 149, 150, 38, -1, -1, -1, -1, -1,
2129 -1, -1, 159, -1, -1, 49, -1, -1, -1, -1,
2130 -1, -1, -1, -1, -1, -1, 60, 61, -1, -1,
2131 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2132 -1, -1, 76, -1, -1, -1, 80, 81, 82, 83,
2133 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2134 94, 95, 96, 97, 98, 99, 100, 101, -1, -1,
2135 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2136 -1, -1, -1, -1, -1, -1, -1, -1, 122, 123,
2137 124, -1, -1, 127, 128, 129, 130, 131, 132, 133,
2138 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
2139 144, 145, 146, 147, 148, 149, 150
2142 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2143 symbol of state STATE-NUM. */
2144 static const unsigned char yystos[] =
2146 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
2147 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
2148 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
2149 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
2150 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
2151 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
2152 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
2153 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
2154 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
2155 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
2156 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
2157 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
2158 198, 198, 18, 18, 18, 161, 3, 162, 192, 193,
2159 208, 154, 163, 3, 190, 224, 4, 15, 5, 6,
2160 7, 8, 9, 10, 11, 12, 175, 176, 177, 38,
2161 49, 60, 61, 76, 80, 81, 82, 83, 84, 85,
2162 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2163 96, 97, 98, 99, 100, 101, 122, 123, 124, 127,
2164 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
2165 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
2166 148, 149, 150, 168, 169, 170, 173, 174, 235, 236,
2167 238, 239, 30, 55, 56, 204, 18, 30, 30, 207,
2168 190, 190, 4, 5, 6, 7, 8, 9, 10, 11,
2169 12, 13, 14, 175, 176, 178, 190, 195, 190, 157,
2170 157, 162, 193, 152, 162, 154, 40, 193, 194, 17,
2171 18, 21, 22, 23, 24, 25, 26, 62, 100, 101,
2172 127, 129, 135, 136, 137, 159, 168, 169, 170, 173,
2173 174, 196, 221, 222, 223, 223, 223, 223, 224, 60,
2174 181, 102, 103, 104, 105, 106, 107, 118, 119, 120,
2175 121, 171, 25, 26, 108, 109, 110, 111, 112, 113,
2176 114, 115, 116, 117, 118, 119, 120, 121, 172, 190,
2177 190, 224, 190, 190, 232, 224, 224, 224, 224, 224,
2178 190, 190, 190, 224, 224, 181, 125, 126, 152, 158,
2179 152, 186, 186, 25, 26, 17, 18, 167, 167, 21,
2180 22, 23, 24, 156, 159, 161, 164, 196, 222, 186,
2181 186, 192, 192, 160, 162, 192, 40, 190, 210, 211,
2182 212, 152, 155, 64, 220, 171, 172, 154, 154, 154,
2183 154, 154, 195, 197, 154, 154, 154, 154, 154, 152,
2184 152, 188, 190, 190, 152, 183, 152, 183, 223, 156,
2185 152, 152, 152, 152, 152, 152, 223, 223, 223, 152,
2186 39, 188, 190, 224, 30, 37, 57, 184, 187, 158,
2187 197, 197, 162, 197, 30, 158, 160, 160, 208, 209,
2188 152, 155, 40, 30, 154, 154, 195, 195, 195, 195,
2189 195, 152, 160, 195, 195, 195, 195, 195, 15, 15,
2190 223, 223, 223, 10, 57, 10, 152, 237, 223, 156,
2191 224, 190, 224, 224, 224, 152, 152, 152, 224, 190,
2192 223, 223, 152, 30, 18, 186, 158, 160, 162, 40,
2193 210, 184, 185, 152, 195, 195, 237, 152, 152, 152,
2194 152, 195, 152, 152, 152, 152, 39, 223, 223, 154,
2195 152, 152, 223, 18, 223, 224, 233, 152, 223, 152,
2196 152, 152, 223, 223, 223, 154, 190, 57, 182, 30,
2197 152, 152, 155, 195, 195, 195, 195, 195, 195, 195,
2198 195, 190, 152, 156, 233, 234, 223, 223, 152, 183,
2199 183, 152, 223, 152, 224, 224, 224, 234, 223, 18,
2200 195, 195, 152, 155, 152, 152, 155, 155, 155, 155,
2201 155, 15, 158, 177, 230, 155, 224, 158, 223, 155,
2202 155, 155, 195, 195, 195, 223, 221, 158, 177, 39,
2203 158, 155, 155, 155, 152, 221, 15, 15, 152, 223,
2204 223, 15, 228, 223, 15, 223
2207 #define yyerrok (yyerrstatus = 0)
2208 #define yyclearin (yychar = YYEMPTY)
2209 #define YYEMPTY (-2)
2212 #define YYACCEPT goto yyacceptlab
2213 #define YYABORT goto yyabortlab
2214 #define YYERROR goto yyerrorlab
2217 /* Like YYERROR except do call yyerror. This remains here temporarily
2218 to ease the transition to the new meaning of YYERROR, for GCC.
2219 Once GCC version 2 has supplanted version 1, this can go. */
2221 #define YYFAIL goto yyerrlab
2223 #define YYRECOVERING() (!!yyerrstatus)
2225 #define YYBACKUP(Token, Value) \
2227 if (yychar == YYEMPTY && yylen == 1) \
2231 yytoken = YYTRANSLATE (yychar); \
2237 yyerror (YY_("syntax error: cannot back up")); \
2244 #define YYERRCODE 256
2247 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2248 If N is 0, then set CURRENT to the empty location which ends
2249 the previous symbol: RHS[0] (always defined). */
2251 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2252 #ifndef YYLLOC_DEFAULT
2253 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2257 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2258 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2259 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2260 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2264 (Current).first_line = (Current).last_line = \
2265 YYRHSLOC (Rhs, 0).last_line; \
2266 (Current).first_column = (Current).last_column = \
2267 YYRHSLOC (Rhs, 0).last_column; \
2273 /* YY_LOCATION_PRINT -- Print the location on the stream.
2274 This macro was not mandated originally: define only if we know
2275 we won't break user code: when these are the locations we know. */
2277 #ifndef YY_LOCATION_PRINT
2278 # if YYLTYPE_IS_TRIVIAL
2279 # define YY_LOCATION_PRINT(File, Loc) \
2280 fprintf (File, "%d.%d-%d.%d", \
2281 (Loc).first_line, (Loc).first_column, \
2282 (Loc).last_line, (Loc).last_column)
2284 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2289 /* YYLEX -- calling `yylex' with the right arguments. */
2292 # define YYLEX yylex (YYLEX_PARAM)
2294 # define YYLEX yylex ()
2297 /* Enable debugging if requested. */
2301 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2302 # define YYFPRINTF fprintf
2305 # define YYDPRINTF(Args) \
2311 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2315 YYFPRINTF (stderr, "%s ", Title); \
2316 yysymprint (stderr, \
2318 YYFPRINTF (stderr, "\n"); \
2322 /*------------------------------------------------------------------.
2323 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2325 `------------------------------------------------------------------*/
2327 #if defined (__STDC__) || defined (__cplusplus)
2329 yy_stack_print (short int *bottom, short int *top)
2332 yy_stack_print (bottom, top)
2337 YYFPRINTF (stderr, "Stack now");
2338 for (/* Nothing. */; bottom <= top; ++bottom)
2339 YYFPRINTF (stderr, " %d", *bottom);
2340 YYFPRINTF (stderr, "\n");
2343 # define YY_STACK_PRINT(Bottom, Top) \
2346 yy_stack_print ((Bottom), (Top)); \
2350 /*------------------------------------------------.
2351 | Report that the YYRULE is going to be reduced. |
2352 `------------------------------------------------*/
2354 #if defined (__STDC__) || defined (__cplusplus)
2356 yy_reduce_print (int yyrule)
2359 yy_reduce_print (yyrule)
2364 unsigned long int yylno = yyrline[yyrule];
2365 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2367 /* Print the symbols being reduced, and their result. */
2368 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2369 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2370 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2373 # define YY_REDUCE_PRINT(Rule) \
2376 yy_reduce_print (Rule); \
2379 /* Nonzero means print parse trace. It is left uninitialized so that
2380 multiple parsers can coexist. */
2382 #else /* !YYDEBUG */
2383 # define YYDPRINTF(Args)
2384 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2385 # define YY_STACK_PRINT(Bottom, Top)
2386 # define YY_REDUCE_PRINT(Rule)
2387 #endif /* !YYDEBUG */
2390 /* YYINITDEPTH -- initial size of the parser's stacks. */
2392 # define YYINITDEPTH 200
2395 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2396 if the built-in stack extension method is used).
2398 Do not make this value too large; the results are undefined if
2399 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2400 evaluated with infinite-precision integer arithmetic. */
2403 # define YYMAXDEPTH 10000
2411 # if defined (__GLIBC__) && defined (_STRING_H)
2412 # define yystrlen strlen
2414 /* Return the length of YYSTR. */
2416 # if defined (__STDC__) || defined (__cplusplus)
2417 yystrlen (const char *yystr)
2423 const char *yys = yystr;
2425 while (*yys++ != '\0')
2428 return yys - yystr - 1;
2434 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2435 # define yystpcpy stpcpy
2437 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2440 # if defined (__STDC__) || defined (__cplusplus)
2441 yystpcpy (char *yydest, const char *yysrc)
2443 yystpcpy (yydest, yysrc)
2449 const char *yys = yysrc;
2451 while ((*yyd++ = *yys++) != '\0')
2460 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2461 quotes and backslashes, so that it's suitable for yyerror. The
2462 heuristic is that double-quoting is unnecessary unless the string
2463 contains an apostrophe, a comma, or backslash (other than
2464 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2465 null, do not copy; instead, return the length of what the result
2468 yytnamerr (char *yyres, const char *yystr)
2473 char const *yyp = yystr;
2480 goto do_not_strip_quotes;
2484 goto do_not_strip_quotes;
2497 do_not_strip_quotes: ;
2501 return yystrlen (yystr);
2503 return yystpcpy (yyres, yystr) - yyres;
2507 #endif /* YYERROR_VERBOSE */
2512 /*--------------------------------.
2513 | Print this symbol on YYOUTPUT. |
2514 `--------------------------------*/
2516 #if defined (__STDC__) || defined (__cplusplus)
2518 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2521 yysymprint (yyoutput, yytype, yyvaluep)
2527 /* Pacify ``unused variable'' warnings. */
2530 if (yytype < YYNTOKENS)
2531 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2533 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2537 if (yytype < YYNTOKENS)
2538 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2545 YYFPRINTF (yyoutput, ")");
2548 #endif /* ! YYDEBUG */
2549 /*-----------------------------------------------.
2550 | Release the memory associated to this symbol. |
2551 `-----------------------------------------------*/
2553 #if defined (__STDC__) || defined (__cplusplus)
2555 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2558 yydestruct (yymsg, yytype, yyvaluep)
2564 /* Pacify ``unused variable'' warnings. */
2569 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2580 /* Prevent warnings from -Wmissing-prototypes. */
2582 #ifdef YYPARSE_PARAM
2583 # if defined (__STDC__) || defined (__cplusplus)
2584 int yyparse (void *YYPARSE_PARAM);
2588 #else /* ! YYPARSE_PARAM */
2589 #if defined (__STDC__) || defined (__cplusplus)
2594 #endif /* ! YYPARSE_PARAM */
2598 /* The look-ahead symbol. */
2601 /* The semantic value of the look-ahead symbol. */
2604 /* Number of syntax errors so far. */
2613 #ifdef YYPARSE_PARAM
2614 # if defined (__STDC__) || defined (__cplusplus)
2615 int yyparse (void *YYPARSE_PARAM)
2617 int yyparse (YYPARSE_PARAM)
2618 void *YYPARSE_PARAM;
2620 #else /* ! YYPARSE_PARAM */
2621 #if defined (__STDC__) || defined (__cplusplus)
2635 /* Number of tokens to shift before error messages enabled. */
2637 /* Look-ahead token as an internal (translated) token number. */
2640 /* Three stacks and their tools:
2641 `yyss': related to states,
2642 `yyvs': related to semantic values,
2643 `yyls': related to locations.
2645 Refer to the stacks thru separate pointers, to allow yyoverflow
2646 to reallocate them elsewhere. */
2648 /* The state stack. */
2649 short int yyssa[YYINITDEPTH];
2650 short int *yyss = yyssa;
2653 /* The semantic value stack. */
2654 YYSTYPE yyvsa[YYINITDEPTH];
2655 YYSTYPE *yyvs = yyvsa;
2660 #define YYPOPSTACK (yyvsp--, yyssp--)
2662 YYSIZE_T yystacksize = YYINITDEPTH;
2664 /* The variables used to return semantic value and location from the
2669 /* When reducing, the number of symbols on the RHS of the reduced
2673 YYDPRINTF ((stderr, "Starting parse\n"));
2678 yychar = YYEMPTY; /* Cause a token to be read. */
2680 /* Initialize stack pointers.
2681 Waste one element of value and location stack
2682 so that they stay on the same level as the state stack.
2683 The wasted elements are never initialized. */
2690 /*------------------------------------------------------------.
2691 | yynewstate -- Push a new state, which is found in yystate. |
2692 `------------------------------------------------------------*/
2694 /* In all cases, when you get here, the value and location stacks
2695 have just been pushed. so pushing a state here evens the stacks.
2702 if (yyss + yystacksize - 1 <= yyssp)
2704 /* Get the current used size of the three stacks, in elements. */
2705 YYSIZE_T yysize = yyssp - yyss + 1;
2709 /* Give user a chance to reallocate the stack. Use copies of
2710 these so that the &'s don't force the real ones into
2712 YYSTYPE *yyvs1 = yyvs;
2713 short int *yyss1 = yyss;
2716 /* Each stack pointer address is followed by the size of the
2717 data in use in that stack, in bytes. This used to be a
2718 conditional around just the two extra args, but that might
2719 be undefined if yyoverflow is a macro. */
2720 yyoverflow (YY_("memory exhausted"),
2721 &yyss1, yysize * sizeof (*yyssp),
2722 &yyvs1, yysize * sizeof (*yyvsp),
2729 #else /* no yyoverflow */
2730 # ifndef YYSTACK_RELOCATE
2731 goto yyexhaustedlab;
2733 /* Extend the stack our own way. */
2734 if (YYMAXDEPTH <= yystacksize)
2735 goto yyexhaustedlab;
2737 if (YYMAXDEPTH < yystacksize)
2738 yystacksize = YYMAXDEPTH;
2741 short int *yyss1 = yyss;
2742 union yyalloc *yyptr =
2743 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2745 goto yyexhaustedlab;
2746 YYSTACK_RELOCATE (yyss);
2747 YYSTACK_RELOCATE (yyvs);
2749 # undef YYSTACK_RELOCATE
2751 YYSTACK_FREE (yyss1);
2754 #endif /* no yyoverflow */
2756 yyssp = yyss + yysize - 1;
2757 yyvsp = yyvs + yysize - 1;
2760 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2761 (unsigned long int) yystacksize));
2763 if (yyss + yystacksize - 1 <= yyssp)
2767 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2776 /* Do appropriate processing given the current state. */
2777 /* Read a look-ahead token if we need one and don't already have one. */
2780 /* First try to decide what to do without reference to look-ahead token. */
2782 yyn = yypact[yystate];
2783 if (yyn == YYPACT_NINF)
2786 /* Not known => get a look-ahead token if don't already have one. */
2788 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2789 if (yychar == YYEMPTY)
2791 YYDPRINTF ((stderr, "Reading a token: "));
2795 if (yychar <= YYEOF)
2797 yychar = yytoken = YYEOF;
2798 YYDPRINTF ((stderr, "Now at end of input.\n"));
2802 yytoken = YYTRANSLATE (yychar);
2803 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2806 /* If the proper action on seeing token YYTOKEN is to reduce or to
2807 detect an error, take that action. */
2809 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2814 if (yyn == 0 || yyn == YYTABLE_NINF)
2823 /* Shift the look-ahead token. */
2824 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2826 /* Discard the token being shifted unless it is eof. */
2827 if (yychar != YYEOF)
2833 /* Count tokens shifted since error; after three, turn off error
2842 /*-----------------------------------------------------------.
2843 | yydefault -- do the default action for the current state. |
2844 `-----------------------------------------------------------*/
2846 yyn = yydefact[yystate];
2852 /*-----------------------------.
2853 | yyreduce -- Do a reduction. |
2854 `-----------------------------*/
2856 /* yyn is the number of a rule to reduce with. */
2859 /* If YYLEN is nonzero, implement the default value of the action:
2862 Otherwise, the following line sets YYVAL to garbage.
2863 This behavior is undocumented and Bison
2864 users should not rely upon it. Assigning to YYVAL
2865 unconditionally makes the parser a bit smaller, and it avoids a
2866 GCC warning that YYVAL may be used uninitialized. */
2867 yyval = yyvsp[1-yylen];
2870 YY_REDUCE_PRINT (yyn);
2874 #line 832 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2876 (yyval.String) = (yyvsp[-1].String);
2881 #line 835 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2883 (yyval.String) = new std::string("");
2888 #line 842 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2889 { (yyval.String) = new std::string(""); ;}
2893 #line 847 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2895 *(yyvsp[-1].String) += *(yyvsp[0].String);
2896 delete (yyvsp[0].String);
2897 (yyval.String) = (yyvsp[-1].String);
2902 #line 852 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2903 { (yyval.String) = new std::string(""); ;}
2907 #line 857 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2908 { (yyval.String) = new std::string(); ;}
2912 #line 858 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2913 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2917 #line 861 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2918 { (yyval.String) = new std::string(); ;}
2922 #line 862 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2924 (yyvsp[-1].String)->insert(0, ", ");
2925 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2926 delete (yyvsp[0].String);
2927 (yyval.String) = (yyvsp[-1].String);
2932 #line 870 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2934 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2935 delete (yyvsp[0].String);
2936 (yyval.String) = (yyvsp[-1].String);
2941 #line 876 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2942 { (yyval.String) = new std::string(); ;}
2946 #line 880 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2947 { (yyval.String) = new std::string(); ;}
2951 #line 881 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2953 (yyvsp[-1].String)->insert(0, ", ");
2954 if (!(yyvsp[0].String)->empty())
2955 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2956 delete (yyvsp[0].String);
2957 (yyval.String) = (yyvsp[-1].String);
2962 #line 891 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2964 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2965 delete (yyvsp[0].String);
2966 (yyval.String) = (yyvsp[-1].String);
2971 #line 913 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2973 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), OpaqueTy);
2978 #line 916 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2980 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UnresolvedTy);
2985 #line 919 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2987 (yyval.Type) = (yyvsp[0].Type);
2992 #line 922 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2993 { // Type UpReference
2994 (yyvsp[0].String)->insert(0, "\\");
2995 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UpRefTy);
3000 #line 926 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3001 { // Function derived type?
3002 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
3003 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3006 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
3009 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3012 (yyval.Type) = TypeInfo::get(newTy, (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
3017 #line 939 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3018 { // Sized array type?
3019 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3020 (yyvsp[-3].String)->insert(0,"[ ");
3021 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
3022 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
3027 #line 945 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3028 { // Packed array type?
3029 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3030 (yyvsp[-3].String)->insert(0,"< ");
3031 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
3032 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
3037 #line 951 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3038 { // Structure type?
3039 std::string newTy("{");
3040 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3043 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3046 (yyval.Type) = TypeInfo::get(newTy, StructTy, (yyvsp[-1].TypeVec));
3051 #line 961 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3052 { // Empty structure type?
3053 (yyval.Type) = TypeInfo::get("{}", StructTy, new TypeList());
3058 #line 964 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3059 { // Packed Structure type?
3060 std::string newTy("<{");
3061 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
3064 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
3067 (yyval.Type) = TypeInfo::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
3072 #line 974 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3073 { // Empty packed structure type?
3074 (yyval.Type) = TypeInfo::get("<{}>", PackedStructTy, new TypeList());
3079 #line 977 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3081 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
3086 #line 985 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3088 (yyval.TypeVec) = new TypeList();
3089 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3094 #line 989 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3096 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3097 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3102 #line 997 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3104 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3105 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3106 delete (yyvsp[0].String);
3111 #line 1002 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3113 (yyval.TypeVec) = new TypeList();
3114 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3115 delete (yyvsp[0].String);
3120 #line 1007 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3122 (yyval.TypeVec) = new TypeList();
3127 #line 1017 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3128 { // Nonempty unsized arr
3129 (yyval.Const).type = (yyvsp[-3].Type);
3130 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3131 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
3132 delete (yyvsp[-1].String);
3137 #line 1023 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3139 (yyval.Const).type = (yyvsp[-2].Type);
3140 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3141 *(yyval.Const).cnst += "[ ]";
3146 #line 1028 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3148 (yyval.Const).type = (yyvsp[-2].Type);
3149 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3150 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
3151 delete (yyvsp[0].String);
3156 #line 1034 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3157 { // Nonempty unsized arr
3158 (yyval.Const).type = (yyvsp[-3].Type);
3159 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3160 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
3161 delete (yyvsp[-1].String);
3166 #line 1040 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3168 (yyval.Const).type = (yyvsp[-3].Type);
3169 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3170 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
3171 delete (yyvsp[-1].String);
3176 #line 1046 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3178 (yyval.Const).type = (yyvsp[-2].Type);
3179 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3180 *(yyval.Const).cnst += " {}";
3185 #line 1051 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3187 (yyval.Const).type = (yyvsp[-1].Type);
3188 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3189 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3190 delete (yyvsp[0].String);
3195 #line 1057 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3197 (yyval.Const).type = (yyvsp[-1].Type);
3198 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3199 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3200 delete (yyvsp[0].String);
3205 #line 1063 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3207 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve(), true);
3208 (yyval.Const).type = (yyvsp[-1].Type);
3209 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3210 *(yyval.Const).cnst += " " + Name;
3211 delete (yyvsp[0].String);
3216 #line 1070 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3218 (yyval.Const).type = (yyvsp[-1].Type);
3219 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3220 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3221 delete (yyvsp[0].String);
3226 #line 1076 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3228 (yyval.Const).type = (yyvsp[-1].Type);
3229 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3230 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3231 delete (yyvsp[0].String);
3236 #line 1082 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3237 { // integral constants
3238 (yyval.Const).type = (yyvsp[-1].Type);
3239 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3240 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3241 delete (yyvsp[0].String);
3246 #line 1088 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3247 { // integral constants
3248 (yyval.Const).type = (yyvsp[-1].Type);
3249 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3250 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3251 delete (yyvsp[0].String);
3256 #line 1094 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3257 { // Boolean constants
3258 (yyval.Const).type = (yyvsp[-1].Type);
3259 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3260 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3261 delete (yyvsp[0].String);
3266 #line 1100 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3267 { // Boolean constants
3268 (yyval.Const).type = (yyvsp[-1].Type);
3269 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3270 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3271 delete (yyvsp[0].String);
3276 #line 1106 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3277 { // Float & Double constants
3278 (yyval.Const).type = (yyvsp[-1].Type);
3279 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3280 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3281 delete (yyvsp[0].String);
3286 #line 1114 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3288 std::string source = *(yyvsp[-3].Const).cnst;
3289 const TypeInfo* SrcTy = (yyvsp[-3].Const).type->resolve();
3290 const TypeInfo* DstTy = (yyvsp[-1].Type)->resolve();
3291 if (*(yyvsp[-5].String) == "cast") {
3292 // Call getCastUpgrade to upgrade the old cast
3293 (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
3295 // Nothing to upgrade, just create the cast constant expr
3296 (yyval.String) = new std::string(*(yyvsp[-5].String));
3297 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
3299 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String);
3304 #line 1128 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3306 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
3307 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3308 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3309 *(yyvsp[-4].String) += ", " + *VI.val;
3312 *(yyvsp[-4].String) += ")";
3313 (yyval.String) = (yyvsp[-4].String);
3314 (yyvsp[-2].Const).destroy();
3315 delete (yyvsp[-1].ValList);
3320 #line 1140 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3322 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3323 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3324 (yyval.String) = (yyvsp[-7].String);
3329 #line 1145 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3331 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3332 (yyval.String) = new std::string(op);
3333 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3334 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3339 #line 1151 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3341 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3342 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3343 (yyval.String) = (yyvsp[-5].String);
3348 #line 1156 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3350 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3351 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3352 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3353 (yyval.String) = (yyvsp[-5].String);
3358 #line 1162 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3360 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3361 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3362 (yyval.String) = (yyvsp[-6].String);
3367 #line 1167 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3369 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3370 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3371 (yyval.String) = (yyvsp[-6].String);
3376 #line 1172 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3378 const char* shiftop = (yyvsp[-5].String)->c_str();
3379 if (*(yyvsp[-5].String) == "shr")
3380 shiftop = ((yyvsp[-3].Const).type->isUnsigned()) ? "lshr" : "ashr";
3381 (yyval.String) = new std::string(shiftop);
3382 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3383 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3388 #line 1180 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3390 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3391 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3392 (yyval.String) = (yyvsp[-5].String);
3397 #line 1185 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3399 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3400 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3401 (yyval.String) = (yyvsp[-7].String);
3406 #line 1190 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3408 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3409 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3410 (yyval.String) = (yyvsp[-7].String);
3415 #line 1200 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3417 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
3418 (yyvsp[0].Const).destroy();
3419 (yyval.String) = (yyvsp[-2].String);
3424 #line 1205 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3425 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
3429 #line 1220 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3435 #line 1225 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3442 #line 1228 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3444 *O << *(yyvsp[0].String) << '\n';
3445 delete (yyvsp[0].String);
3451 #line 1233 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3453 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3459 #line 1237 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3461 *O << "implementation\n";
3467 #line 1241 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3468 { (yyval.String) = 0; ;}
3472 #line 1243 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3473 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3477 #line 1246 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3479 EnumeratedTypes.push_back((yyvsp[0].Type));
3480 if (!(yyvsp[-2].String)->empty()) {
3481 NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Type);
3482 *O << *(yyvsp[-2].String) << " = ";
3484 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3485 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
3491 #line 1256 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3492 { // Function prototypes can be in const pool
3493 *O << *(yyvsp[0].String) << '\n';
3494 delete (yyvsp[0].String);
3500 #line 1261 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3501 { // Asm blocks can be in the const pool
3502 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3503 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3509 #line 1266 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3511 if (!(yyvsp[-4].String)->empty()) {
3512 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const).type->getPointerType(),
3513 *(yyvsp[-2].String) == "constant");
3514 *O << Name << " = ";
3516 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
3517 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3523 #line 1276 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3525 if (!(yyvsp[-4].String)->empty()) {
3526 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3527 *(yyvsp[-2].String) == "constant");
3528 *O << Name << " = ";
3530 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3531 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3537 #line 1286 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3539 if (!(yyvsp[-4].String)->empty()) {
3540 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3541 *(yyvsp[-2].String) == "constant");
3542 *O << Name << " = ";
3544 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3545 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3551 #line 1296 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3553 if (!(yyvsp[-4].String)->empty()) {
3554 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3555 *(yyvsp[-2].String) == "constant");
3556 *O << Name << " = ";
3558 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3559 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3565 #line 1306 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3567 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3568 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3574 #line 1311 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3576 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3577 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3583 #line 1316 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3590 #line 1326 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3592 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3593 delete (yyvsp[0].String);
3594 (yyval.String) = (yyvsp[-2].String);
3599 #line 1331 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3601 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3602 if (*(yyvsp[0].String) == "64")
3604 delete (yyvsp[0].String);
3605 (yyval.String) = (yyvsp[-2].String);
3610 #line 1338 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3612 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3613 delete (yyvsp[0].String);
3614 (yyval.String) = (yyvsp[-2].String);
3619 #line 1343 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3621 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3622 delete (yyvsp[0].String);
3623 (yyval.String) = (yyvsp[-2].String);
3628 #line 1350 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3630 (yyvsp[-1].String)->insert(0, "[ ");
3631 *(yyvsp[-1].String) += " ]";
3632 (yyval.String) = (yyvsp[-1].String);
3637 #line 1357 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3639 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3640 delete (yyvsp[0].String);
3641 (yyval.String) = (yyvsp[-2].String);
3646 #line 1363 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3648 (yyval.String) = new std::string();
3653 #line 1372 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3654 { (yyval.String) = new std::string(); ;}
3658 #line 1374 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3660 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3661 if (!(yyvsp[0].String)->empty()) {
3662 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve());
3663 *(yyval.String) += " " + Name;
3665 delete (yyvsp[0].String);
3670 #line 1383 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3672 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3673 delete (yyvsp[0].String);
3678 #line 1387 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3680 (yyval.String) = (yyvsp[0].String);
3685 #line 1391 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3687 (yyval.String) = (yyvsp[0].String);
3692 #line 1394 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3694 *(yyvsp[-2].String) += ", ...";
3695 (yyval.String) = (yyvsp[-2].String);
3696 delete (yyvsp[0].String);
3701 #line 1399 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3703 (yyval.String) = (yyvsp[0].String);
3708 #line 1402 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3709 { (yyval.String) = new std::string(); ;}
3713 #line 1405 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3715 if (!(yyvsp[-7].String)->empty()) {
3716 *(yyvsp[-7].String) += " ";
3718 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3719 if (!(yyvsp[-1].String)->empty()) {
3720 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3722 if (!(yyvsp[0].String)->empty()) {
3723 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3725 delete (yyvsp[-5].String);
3726 delete (yyvsp[-3].String);
3727 delete (yyvsp[-1].String);
3728 delete (yyvsp[0].String);
3729 (yyval.String) = (yyvsp[-7].String);
3734 #line 1423 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3735 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3739 #line 1424 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3740 { (yyval.String) = new std::string ("{"); ;}
3744 #line 1427 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3747 if (!(yyvsp[-2].String)->empty()) {
3748 *O << *(yyvsp[-2].String) << ' ';
3750 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3751 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3757 #line 1438 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3758 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3762 #line 1439 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3763 { (yyval.String) = new std::string("}"); ;}
3767 #line 1441 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3769 if ((yyvsp[-1].String))
3770 *O << *(yyvsp[-1].String);
3771 *O << *(yyvsp[0].String) << "\n\n";
3772 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3778 #line 1450 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3779 { (yyval.String) = new std::string(); ;}
3783 #line 1456 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3785 if (!(yyvsp[-1].String)->empty())
3786 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3787 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3788 delete (yyvsp[-1].String);
3789 delete (yyvsp[0].String);
3790 (yyval.String) = (yyvsp[-2].String);
3795 #line 1469 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3796 { (yyval.String) = new std::string(); ;}
3800 #line 1475 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3802 (yyvsp[-1].String)->insert(0, "<");
3803 *(yyvsp[-1].String) += ">";
3804 (yyval.String) = (yyvsp[-1].String);
3809 #line 1481 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3811 if (!(yyvsp[-3].String)->empty()) {
3812 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3814 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3815 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3816 (yyval.String) = (yyvsp[-4].String);
3821 #line 1494 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3823 (yyval.Value).val = (yyvsp[0].String);
3824 (yyval.Value).constant = false;
3825 (yyval.Value).type = 0;
3830 #line 1499 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3832 (yyval.Value).val = (yyvsp[0].String);
3833 (yyval.Value).constant = true;
3834 (yyval.Value).type = 0;
3839 #line 1509 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3841 (yyvsp[-1].Type) = (yyvsp[-1].Type)->resolve();
3842 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
3843 (yyval.Value) = (yyvsp[0].Value);
3844 delete (yyval.Value).val;
3845 (yyval.Value).val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
3846 (yyval.Value).type = (yyvsp[-1].Type);
3851 #line 1518 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3858 #line 1521 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3859 { // Do not allow functions with 0 basic blocks
3865 #line 1529 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3872 #line 1533 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3874 *O << " " << *(yyvsp[0].String) << '\n';
3875 delete (yyvsp[0].String);
3881 #line 1538 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3888 #line 1541 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3890 *O << *(yyvsp[0].String) << '\n';
3891 delete (yyvsp[0].String);
3897 #line 1547 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3898 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3902 #line 1549 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3903 { // Return with a result...
3904 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3905 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3911 #line 1554 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3912 { // Return with no result...
3913 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
3914 delete (yyvsp[-1].String);
3920 #line 1559 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3921 { // Unconditional Branch...
3922 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3923 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
3929 #line 1564 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3931 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3932 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3933 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
3934 << *(yyvsp[0].Value).val << '\n';
3935 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
3941 #line 1572 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3943 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3944 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3945 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
3946 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy();
3947 delete (yyvsp[-1].String);
3953 #line 1580 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3955 std::string Name = getUniqueName((yyvsp[-5].Value).val, (yyvsp[-6].Type));
3956 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
3957 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value).val << "[]\n";
3958 delete (yyvsp[-7].String); (yyvsp[-5].Value).destroy(); (yyvsp[-2].Value).destroy();
3964 #line 1588 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3966 const TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
3968 if (!(yyvsp[-13].String)->empty()) {
3969 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
3970 *O << Name << " = ";
3972 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value).val << " (";
3973 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
3974 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
3976 if (i+1 < (yyvsp[-7].ValList)->size())
3980 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ' '
3981 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3982 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
3983 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
3989 #line 1609 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3991 *O << " " << *(yyvsp[0].String) << '\n';
3992 delete (yyvsp[0].String);
3998 #line 1614 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4000 *O << " " << *(yyvsp[0].String) << '\n';
4001 delete (yyvsp[0].String);
4007 #line 1620 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4009 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
4010 *(yyvsp[0].Value).val;
4011 delete (yyvsp[-3].String); (yyvsp[0].Value).destroy();
4012 (yyval.String) = (yyvsp[-5].String);
4017 #line 1626 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4019 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
4020 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value).val;
4021 (yyvsp[0].Value).destroy();
4022 (yyval.String) = (yyvsp[-3].String);
4027 #line 1634 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4029 if (!(yyvsp[-1].String)->empty()) {
4030 // Get a unique name for this value, based on its type.
4031 std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value).type);
4032 *(yyvsp[-1].String) = Name + " = ";
4033 if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
4034 // don't actually delete it, just comment it out
4035 (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
4036 delete deleteUselessCastName;
4039 *(yyvsp[-1].String) += *(yyvsp[0].Value).val;
4040 (yyvsp[0].Value).destroy();
4041 deleteUselessCastFlag = false;
4042 (yyval.String) = (yyvsp[-1].String);
4047 #line 1652 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4048 { // Used for PHI nodes
4049 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-5].Type));
4050 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
4051 Name += "," + *(yyvsp[-1].Value).val + "]";
4052 (yyval.Value).val = new std::string(Name);
4053 (yyval.Value).type = (yyvsp[-5].Type);
4054 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4059 #line 1660 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4061 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-6].Value).type);
4062 *(yyvsp[-6].Value).val += ", [" + Name + "," + *(yyvsp[-1].Value).val + "]";
4063 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4064 (yyval.Value) = (yyvsp[-6].Value);
4069 #line 1669 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4071 (yyval.ValList) = new ValueList();
4072 (yyval.ValList)->push_back((yyvsp[0].Value));
4077 #line 1673 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4079 (yyval.ValList) = (yyvsp[-2].ValList);
4080 (yyval.ValList)->push_back((yyvsp[0].Value));
4085 #line 1680 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4086 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4090 #line 1681 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4091 { (yyval.ValList) = new ValueList(); ;}
4095 #line 1685 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4097 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
4098 delete (yyvsp[0].String);
4099 (yyval.String) = (yyvsp[-1].String);
4104 #line 1693 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4106 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
4107 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4108 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4109 (yyval.Value).val = new std::string(op);
4110 *(yyval.Value).val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4111 (yyval.Value).type = (yyvsp[-3].Type);
4112 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4117 #line 1702 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4119 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4120 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4121 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4122 (yyval.Value).val = (yyvsp[-4].String);
4123 (yyval.Value).type = (yyvsp[-3].Type);
4124 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4129 #line 1710 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4131 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4132 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4133 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
4134 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4135 (yyval.Value).val = (yyvsp[-4].String);
4136 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4137 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4142 #line 1719 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4144 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4145 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4146 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4147 (yyval.Value).val = (yyvsp[-5].String);
4148 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4149 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4154 #line 1727 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4156 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4157 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4158 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4159 (yyval.Value).val = (yyvsp[-5].String);
4160 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4161 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4166 #line 1735 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4168 (yyval.Value) = (yyvsp[0].Value);
4169 (yyval.Value).val->insert(0, *(yyvsp[-1].String) + " ");
4170 delete (yyvsp[-1].String);
4175 #line 1740 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4177 const char* shiftop = (yyvsp[-3].String)->c_str();
4178 if (*(yyvsp[-3].String) == "shr")
4179 shiftop = ((yyvsp[-2].Value).type->isUnsigned()) ? "lshr" : "ashr";
4180 (yyval.Value).val = new std::string(shiftop);
4181 *(yyval.Value).val += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4182 (yyval.Value).type = (yyvsp[-2].Value).type;
4183 delete (yyvsp[-3].String); delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
4188 #line 1749 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4190 std::string source = *(yyvsp[-2].Value).val;
4191 const TypeInfo* SrcTy = (yyvsp[-2].Value).type->resolve();
4192 const TypeInfo* DstTy = (yyvsp[0].Type)->resolve();
4193 (yyval.Value).val = new std::string();
4194 (yyval.Value).type = DstTy;
4195 if (*(yyvsp[-3].String) == "cast") {
4196 *(yyval.Value).val += getCastUpgrade(source, SrcTy, DstTy, false);
4198 *(yyval.Value).val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
4200 // Check to see if this is a useless cast of a value to the same name
4201 // and the same type. Such casts will probably cause redefinition errors
4202 // when assembled and perform no code gen action so just remove them.
4203 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
4204 if (SrcTy->isInteger() && DstTy->isInteger() &&
4205 SrcTy->getBitWidth() == DstTy->getBitWidth()) {
4206 deleteUselessCastFlag = true; // Flag the "Inst" rule
4207 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
4208 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
4209 if (pos != std::string::npos) {
4210 // remove the type portion before val
4211 deleteUselessCastName->erase(0, pos);
4214 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
4215 delete (yyvsp[-1].String);
4220 #line 1777 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4222 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4223 (yyval.Value).val = (yyvsp[-5].String);
4224 (yyval.Value).type = (yyvsp[-2].Value).type;
4225 (yyvsp[-4].Value).destroy(); delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
4230 #line 1783 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4232 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + (yyvsp[0].Type)->getNewTy();
4233 (yyval.Value).val = (yyvsp[-3].String);
4234 (yyval.Value).type = (yyvsp[0].Type);
4235 (yyvsp[-2].Value).destroy();
4240 #line 1789 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4242 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4243 (yyval.Value).val = (yyvsp[-3].String);
4244 (yyvsp[-2].Value).type = (yyvsp[-2].Value).type->resolve();;
4245 (yyval.Value).type = (yyvsp[-2].Value).type->getElementType();
4246 delete (yyvsp[-2].Value).val; (yyvsp[0].Value).destroy();
4251 #line 1796 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4253 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4254 (yyval.Value).val = (yyvsp[-5].String);
4255 (yyval.Value).type = (yyvsp[-4].Value).type;
4256 delete (yyvsp[-4].Value).val; (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4261 #line 1802 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4263 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4264 (yyval.Value).val = (yyvsp[-5].String);
4265 (yyval.Value).type = (yyvsp[-4].Value).type;
4266 delete (yyvsp[-4].Value).val; (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4271 #line 1808 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4273 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4274 (yyval.Value).val = (yyvsp[-1].String);
4275 (yyval.Value).type = (yyvsp[0].Value).type;
4276 delete (yyvsp[0].Value).val;
4281 #line 1814 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4283 if (!(yyvsp[-5].String)->empty())
4284 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
4285 if (!(yyvsp[-6].String)->empty())
4286 *(yyvsp[-6].String) += " ";
4287 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value).val + "(";
4288 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
4289 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
4290 *(yyvsp[-6].String) += *VI.val;
4291 if (i+1 < (yyvsp[-1].ValList)->size())
4292 *(yyvsp[-6].String) += ", ";
4295 *(yyvsp[-6].String) += ")";
4296 (yyval.Value).val = (yyvsp[-6].String);
4297 (yyval.Value).type = getFunctionReturnType((yyvsp[-4].Type));
4298 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
4303 #line 1837 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4304 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4308 #line 1838 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4309 { (yyval.ValList) = new ValueList(); ;}
4313 #line 1843 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4314 { (yyval.String) = new std::string(); ;}
4318 #line 1846 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4320 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4321 if (!(yyvsp[0].String)->empty())
4322 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4323 (yyval.Value).val = (yyvsp[-2].String);
4324 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4325 delete (yyvsp[0].String);
4330 #line 1854 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4332 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4333 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4334 if (!(yyvsp[0].String)->empty())
4335 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4336 (yyval.Value).val = (yyvsp[-5].String);
4337 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4338 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4343 #line 1863 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4345 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4346 if (!(yyvsp[0].String)->empty())
4347 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4348 (yyval.Value).val = (yyvsp[-2].String);
4349 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4350 delete (yyvsp[0].String);
4355 #line 1871 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4357 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4358 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4359 if (!(yyvsp[0].String)->empty())
4360 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4361 (yyval.Value).val = (yyvsp[-5].String);
4362 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4363 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4368 #line 1880 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4370 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4371 (yyval.Value).val = (yyvsp[-1].String);
4372 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4373 (yyvsp[0].Value).destroy();
4378 #line 1886 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4380 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4381 if (!(yyvsp[-3].String)->empty())
4382 *(yyvsp[-3].String) += " ";
4383 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4384 (yyval.Value).val = (yyvsp[-3].String);
4385 (yyval.Value).type = (yyvsp[-1].Type)->getElementType();
4386 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4391 #line 1895 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4393 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4394 if (!(yyvsp[-5].String)->empty())
4395 *(yyvsp[-5].String) += " ";
4396 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4397 (yyval.Value).val = (yyvsp[-5].String);
4398 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4399 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4404 #line 1904 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4406 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4407 // Upgrade the indices
4408 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4409 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4410 if (VI.type->isUnsigned() && !VI.isConstant() &&
4411 VI.type->getBitWidth() < 64) {
4412 std::string* old = VI.val;
4413 *O << " %gep_upgrade" << unique << " = zext " << *old
4415 VI.val = new std::string("i64 %gep_upgrade" + llvm::utostr(unique++));
4416 VI.type = TypeInfo::get("i64",ULongTy);
4419 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4420 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4421 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4422 *(yyvsp[-3].String) += ", " + *VI.val;
4424 (yyval.Value).val = (yyvsp[-3].String);
4425 (yyval.Value).type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4426 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
4434 /* Line 1126 of yacc.c. */
4435 #line 4436 "UpgradeParser.tab.c"
4441 YY_STACK_PRINT (yyss, yyssp);
4446 /* Now `shift' the result of the reduction. Determine what state
4447 that goes to, based on the state we popped back to and the rule
4448 number reduced by. */
4452 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4453 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4454 yystate = yytable[yystate];
4456 yystate = yydefgoto[yyn - YYNTOKENS];
4461 /*------------------------------------.
4462 | yyerrlab -- here on detecting error |
4463 `------------------------------------*/
4465 /* If not already recovering from an error, report this error. */
4470 yyn = yypact[yystate];
4472 if (YYPACT_NINF < yyn && yyn < YYLAST)
4474 int yytype = YYTRANSLATE (yychar);
4475 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4476 YYSIZE_T yysize = yysize0;
4478 int yysize_overflow = 0;
4480 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4481 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4485 /* This is so xgettext sees the translatable formats that are
4486 constructed on the fly. */
4487 YY_("syntax error, unexpected %s");
4488 YY_("syntax error, unexpected %s, expecting %s");
4489 YY_("syntax error, unexpected %s, expecting %s or %s");
4490 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4491 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4495 static char const yyunexpected[] = "syntax error, unexpected %s";
4496 static char const yyexpecting[] = ", expecting %s";
4497 static char const yyor[] = " or %s";
4498 char yyformat[sizeof yyunexpected
4499 + sizeof yyexpecting - 1
4500 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4501 * (sizeof yyor - 1))];
4502 char const *yyprefix = yyexpecting;
4504 /* Start YYX at -YYN if negative to avoid negative indexes in
4506 int yyxbegin = yyn < 0 ? -yyn : 0;
4508 /* Stay within bounds of both yycheck and yytname. */
4509 int yychecklim = YYLAST - yyn;
4510 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4513 yyarg[0] = yytname[yytype];
4514 yyfmt = yystpcpy (yyformat, yyunexpected);
4516 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4517 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4519 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4523 yyformat[sizeof yyunexpected - 1] = '\0';
4526 yyarg[yycount++] = yytname[yyx];
4527 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4528 yysize_overflow |= yysize1 < yysize;
4530 yyfmt = yystpcpy (yyfmt, yyprefix);
4534 yyf = YY_(yyformat);
4535 yysize1 = yysize + yystrlen (yyf);
4536 yysize_overflow |= yysize1 < yysize;
4539 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4540 yymsg = (char *) YYSTACK_ALLOC (yysize);
4543 /* Avoid sprintf, as that infringes on the user's name space.
4544 Don't have undefined behavior even if the translation
4545 produced a string with the wrong number of "%s"s. */
4548 while ((*yyp = *yyf))
4550 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4552 yyp += yytnamerr (yyp, yyarg[yyi++]);
4562 YYSTACK_FREE (yymsg);
4566 yyerror (YY_("syntax error"));
4567 goto yyexhaustedlab;
4571 #endif /* YYERROR_VERBOSE */
4572 yyerror (YY_("syntax error"));
4577 if (yyerrstatus == 3)
4579 /* If just tried and failed to reuse look-ahead token after an
4580 error, discard it. */
4582 if (yychar <= YYEOF)
4584 /* Return failure if at end of input. */
4585 if (yychar == YYEOF)
4590 yydestruct ("Error: discarding", yytoken, &yylval);
4595 /* Else will try to reuse look-ahead token after shifting the error
4600 /*---------------------------------------------------.
4601 | yyerrorlab -- error raised explicitly by YYERROR. |
4602 `---------------------------------------------------*/
4605 /* Pacify compilers like GCC when the user code never invokes
4606 YYERROR and the label yyerrorlab therefore never appears in user
4617 /*-------------------------------------------------------------.
4618 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4619 `-------------------------------------------------------------*/
4621 yyerrstatus = 3; /* Each real token shifted decrements this. */
4625 yyn = yypact[yystate];
4626 if (yyn != YYPACT_NINF)
4629 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4637 /* Pop the current state because it cannot handle the error token. */
4642 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4645 YY_STACK_PRINT (yyss, yyssp);
4654 /* Shift the error token. */
4655 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4661 /*-------------------------------------.
4662 | yyacceptlab -- YYACCEPT comes here. |
4663 `-------------------------------------*/
4668 /*-----------------------------------.
4669 | yyabortlab -- YYABORT comes here. |
4670 `-----------------------------------*/
4676 /*-------------------------------------------------.
4677 | yyexhaustedlab -- memory exhaustion comes here. |
4678 `-------------------------------------------------*/
4680 yyerror (YY_("memory exhausted"));
4686 if (yychar != YYEOF && yychar != YYEMPTY)
4687 yydestruct ("Cleanup: discarding lookahead",
4689 while (yyssp != yyss)
4691 yydestruct ("Cleanup: popping",
4692 yystos[*yyssp], yyvsp);
4697 YYSTACK_FREE (yyss);
4703 #line 1928 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4706 int yyerror(const char *ErrorMsg) {
4708 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4709 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4710 std::string errMsg = where + "error: " + std::string(ErrorMsg) +
4712 if (yychar == YYEMPTY || yychar == 0)
4713 errMsg += "end-of-file.";
4715 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4716 std::cerr << "llvm-upgrade: " << errMsg << '\n';
4717 *O << "llvm-upgrade parse failed.\n";
4721 static void warning(const std::string& ErrorMsg) {
4723 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4724 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4725 std::string errMsg = where + "warning: " + std::string(ErrorMsg) +
4727 if (yychar == YYEMPTY || yychar == 0)
4728 errMsg += "end-of-file.";
4730 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4731 std::cerr << "llvm-upgrade: " << errMsg << '\n';