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(newTy[1])) {
493 unsigned ref = atoi(&((newTy.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(newTy);
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 void TypeInfo::getSignedness(unsigned &sNum, unsigned &uNum,
675 UpRefStack& stack) const {
678 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy:
679 case FloatTy : case DoubleTy: case UpRefTy:
681 case SByteTy: case ShortTy: case LongTy: case IntTy:
684 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
690 stack.push_back(this);
691 elemTy->getSignedness(sNum, uNum, stack);
694 case PackedStructTy: {
695 stack.push_back(this);
696 for (unsigned i = 0; i < elements->size(); i++) {
697 (*elements)[i]->getSignedness(sNum, uNum, stack);
702 const TypeInfo* Ty = this->resolve();
703 // Let's not recurse.
704 UpRefStack::const_iterator I = stack.begin(), E = stack.end();
705 for ( ; I != E && *I != Ty; ++I)
708 Ty->getSignedness(sNum, uNum, stack);
714 std::string AddSuffix(const std::string& Name, const std::string& Suffix) {
715 if (Name[Name.size()-1] == '"') {
716 std::string Result = Name;
717 Result.insert(Result.size()-1, Suffix);
720 return Name + Suffix;
723 std::string TypeInfo::makeUniqueName(const std::string& BaseName) const {
724 if (BaseName == "\"alloca point\"")
729 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy: case UpRefTy:
730 case FloatTy : case DoubleTy: case UnresolvedTy:
732 case SByteTy: case ShortTy: case LongTy: case IntTy:
733 return AddSuffix(BaseName, ".s");
734 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
735 return AddSuffix(BaseName, ".u");
738 unsigned uNum = 0, sNum = 0;
744 TypeInfo::UpRefStack stack;
745 elemTy->resolve()->getSignedness(sNum, uNum, stack);
749 case PackedStructTy: {
750 for (unsigned i = 0; i < elements->size(); i++) {
751 TypeInfo::UpRefStack stack;
752 (*elements)[i]->resolve()->getSignedness(sNum, uNum, stack);
757 assert(0 && "Invalid Type");
761 if (sNum == 0 && uNum == 0)
765 default: Suffix += ".nada"; break;
766 case PointerTy: Suffix += ".pntr"; break;
767 case PackedTy: Suffix += ".pckd"; break;
768 case ArrayTy: Suffix += ".arry"; break;
769 case StructTy: Suffix += ".strc"; break;
770 case PackedStructTy: Suffix += ".pstr"; break;
773 Suffix += ".s" + llvm::utostr(sNum);
774 Suffix += ".u" + llvm::utostr(uNum);
775 return AddSuffix(BaseName, Suffix);
778 TypeInfo& TypeInfo::operator=(const TypeInfo& that) {
780 nelems = that.nelems;
782 elemTy = that.elemTy;
783 resultTy = that.resultTy;
785 elements = new TypeList(that.elements->size());
786 *elements = *that.elements;
793 const TypeInfo* TypeInfo::add_new_type(TypeInfo* newTy) {
794 TypeRegMap::iterator I = registry.find(newTy);
795 if (I != registry.end()) {
799 registry.insert(newTy);
803 static const char* getCastOpcode(
804 std::string& Source, const TypeInfo* SrcTy, const TypeInfo* DstTy)
806 unsigned SrcBits = SrcTy->getBitWidth();
807 unsigned DstBits = DstTy->getBitWidth();
808 const char* opcode = "bitcast";
809 // Run through the possibilities ...
810 if (DstTy->isIntegral()) { // Casting to integral
811 if (SrcTy->isIntegral()) { // Casting from integral
812 if (DstBits < SrcBits)
814 else if (DstBits > SrcBits) { // its an extension
815 if (SrcTy->isSigned())
816 opcode ="sext"; // signed -> SEXT
818 opcode = "zext"; // unsigned -> ZEXT
820 opcode = "bitcast"; // Same size, No-op cast
822 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
823 if (DstTy->isSigned())
824 opcode = "fptosi"; // FP -> sint
826 opcode = "fptoui"; // FP -> uint
827 } else if (SrcTy->isPacked()) {
828 assert(DstBits == SrcTy->getBitWidth() &&
829 "Casting packed to integer of different width");
830 opcode = "bitcast"; // same size, no-op cast
832 assert(SrcTy->isPointer() &&
833 "Casting from a value that is not first-class type");
834 opcode = "ptrtoint"; // ptr -> int
836 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
837 if (SrcTy->isIntegral()) { // Casting from integral
838 if (SrcTy->isSigned())
839 opcode = "sitofp"; // sint -> FP
841 opcode = "uitofp"; // uint -> FP
842 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
843 if (DstBits < SrcBits) {
844 opcode = "fptrunc"; // FP -> smaller FP
845 } else if (DstBits > SrcBits) {
846 opcode = "fpext"; // FP -> larger FP
848 opcode ="bitcast"; // same size, no-op cast
850 } else if (SrcTy->isPacked()) {
851 assert(DstBits == SrcTy->getBitWidth() &&
852 "Casting packed to floating point of different width");
853 opcode = "bitcast"; // same size, no-op cast
855 assert(0 && "Casting pointer or non-first class to float");
857 } else if (DstTy->isPacked()) {
858 if (SrcTy->isPacked()) {
859 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
860 "Casting packed to packed of different widths");
861 opcode = "bitcast"; // packed -> packed
862 } else if (DstTy->getBitWidth() == SrcBits) {
863 opcode = "bitcast"; // float/int -> packed
865 assert(!"Illegal cast to packed (wrong type or size)");
867 } else if (DstTy->isPointer()) {
868 if (SrcTy->isPointer()) {
869 opcode = "bitcast"; // ptr -> ptr
870 } else if (SrcTy->isIntegral()) {
871 opcode = "inttoptr"; // int -> ptr
873 assert(!"Casting invalid type to pointer");
876 assert(!"Casting to type that is not first-class");
881 static std::string getCastUpgrade(const std::string& Src, const TypeInfo* SrcTy,
882 const TypeInfo* DstTy, bool isConst)
885 std::string Source = Src;
886 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
887 // fp -> ptr cast is no longer supported but we must upgrade this
888 // by doing a double cast: fp -> int -> ptr
890 Source = "i64 fptoui(" + Source + " to i64)";
892 *O << " %cast_upgrade" << unique << " = fptoui " << Source
894 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
896 // Update the SrcTy for the getCastOpcode call below
897 SrcTy = TypeInfo::get("i64", ULongTy);
898 } else if (DstTy->isBool()) {
899 // cast type %x to bool was previously defined as setne type %x, null
900 // The cast semantic is now to truncate, not compare so we must retain
901 // the original intent by replacing the cast with a setne
902 const char* comparator = SrcTy->isPointer() ? ", null" :
903 (SrcTy->isFloatingPoint() ? ", 0.0" :
904 (SrcTy->isBool() ? ", false" : ", 0"));
905 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
907 Result = "(" + Source + comparator + ")";
908 Result = compareOp + Result;
910 Result = compareOp + Source + comparator;
911 return Result; // skip cast processing below
913 SrcTy = SrcTy->resolve();
914 DstTy = DstTy->resolve();
915 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
917 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
919 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
923 const char* getDivRemOpcode(const std::string& opcode, const TypeInfo* TI) {
924 const char* op = opcode.c_str();
925 const TypeInfo* Ty = TI->resolve();
927 Ty = Ty->getElementType();
929 if (Ty->isFloatingPoint())
931 else if (Ty->isUnsigned())
933 else if (Ty->isSigned())
936 yyerror("Invalid type for div instruction");
937 else if (opcode == "rem")
938 if (Ty->isFloatingPoint())
940 else if (Ty->isUnsigned())
942 else if (Ty->isSigned())
945 yyerror("Invalid type for rem instruction");
950 getCompareOp(const std::string& setcc, const TypeInfo* TI) {
951 assert(setcc.length() == 5);
954 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
955 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
956 std::string result("xcmp xxx");
959 if (TI->isFloatingPoint()) {
963 result[5] = 'u'; // NE maps to unordered
965 result[5] = 'o'; // everything else maps to ordered
966 } else if (TI->isIntegral() || TI->isPointer()) {
968 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
970 else if (TI->isSigned())
972 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
975 yyerror("Invalid integral type for setcc");
980 static const TypeInfo* getFunctionReturnType(const TypeInfo* PFTy) {
981 PFTy = PFTy->resolve();
982 if (PFTy->isPointer()) {
983 const TypeInfo* ElemTy = PFTy->getElementType();
984 ElemTy = ElemTy->resolve();
985 if (ElemTy->isFunction())
986 return ElemTy->getResultType();
987 } else if (PFTy->isFunction()) {
988 return PFTy->getResultType();
993 static const TypeInfo* ResolveUpReference(const TypeInfo* Ty,
994 TypeInfo::UpRefStack* stack) {
995 assert(Ty->isUpReference() && "Can't resolve a non-upreference");
996 unsigned upref = Ty->getUpRefNum();
997 assert(upref < stack->size() && "Invalid up reference");
998 return (*stack)[upref - stack->size() - 1];
1001 static const TypeInfo* getGEPIndexedType(const TypeInfo* PTy, ValueList* idxs) {
1002 const TypeInfo* Result = PTy = PTy->resolve();
1003 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
1004 TypeInfo::UpRefStack stack;
1005 for (unsigned i = 0; i < idxs->size(); ++i) {
1006 if (Result->isComposite()) {
1007 Result = Result->getIndexedType((*idxs)[i]);
1008 Result = Result->resolve();
1009 stack.push_back(Result);
1011 yyerror("Invalid type for index");
1013 // Resolve upreferences so we can return a more natural type
1014 if (Result->isPointer()) {
1015 if (Result->getElementType()->isUpReference()) {
1016 stack.push_back(Result);
1017 Result = ResolveUpReference(Result->getElementType(), &stack);
1019 } else if (Result->isUpReference()) {
1020 Result = ResolveUpReference(Result->getElementType(), &stack);
1022 return Result->getPointerType();
1026 // This function handles appending .u or .s to integer value names that
1027 // were previously unsigned or signed, respectively. This avoids name
1028 // collisions since the unsigned and signed type planes have collapsed
1029 // into a single signless type plane.
1030 static std::string getUniqueName(const std::string *Name, const TypeInfo* Ty,
1031 bool isGlobal = false, bool isDef = false) {
1033 // If its not a symbolic name, don't modify it, probably a constant val.
1034 if ((*Name)[0] != '%' && (*Name)[0] != '"')
1037 // If its a numeric reference, just leave it alone.
1038 if (isdigit((*Name)[1]))
1044 // If its a global name, get its uniquified name, if any
1045 GlobalsTypeMap::iterator GI = Globals.find(*Name);
1046 if (GI != Globals.end()) {
1047 TypePlaneMap::iterator TPI = GI->second.begin();
1048 TypePlaneMap::iterator TPE = GI->second.end();
1049 for ( ; TPI != TPE ; ++TPI) {
1050 if (TPI->first->sameNewTyAs(Ty))
1056 // We didn't find a global name, but if its supposed to be global then all
1057 // we can do is return the name. This is probably a forward reference of a
1058 // global value that hasn't been defined yet. Since we have no definition
1059 // we don't know its linkage class. Just assume its an external and the name
1060 // shouldn't change.
1064 // Default the result to the current name
1065 std::string Result = Ty->makeUniqueName(*Name);
1070 static unsigned UniqueNameCounter = 0;
1072 std::string getGlobalName(const std::string* Name, const std::string Linkage,
1073 const TypeInfo* Ty, bool isConstant) {
1074 // Default to given name
1075 std::string Result = *Name;
1076 // Look up the name in the Globals Map
1077 GlobalsTypeMap::iterator GI = Globals.find(*Name);
1078 // Did we see this global name before?
1079 if (GI != Globals.end()) {
1080 if (Ty->isUnresolvedDeep()) {
1081 // The Gval's type is unresolved. Consequently, we can't disambiguate it
1082 // by type. We'll just change its name and emit a warning.
1083 warning("Cannot disambiguate global value '" + *Name +
1084 "' because type '" + Ty->getNewTy() + "'is unresolved.\n");
1085 Result = *Name + ".unique";
1086 UniqueNameCounter++;
1087 Result += llvm::utostr(UniqueNameCounter);
1090 TypePlaneMap::iterator TPI = GI->second.find(Ty);
1091 if (TPI != GI->second.end()) {
1092 // We found an existing name of the same old type. This isn't allowed
1093 // in LLVM 2.0. Consequently, we must alter the name of the global so it
1094 // can at least compile. References to the global will yield the first
1095 // definition, which is okay. We also must warn about this.
1096 Result = *Name + ".unique";
1097 UniqueNameCounter++;
1098 Result += llvm::utostr(UniqueNameCounter);
1099 warning(std::string("Global variable '") + *Name + "' was renamed to '"+
1102 // There isn't an existing definition for this name according to the
1103 // old types. Now search the TypePlanMap for types with the same new
1105 TypePlaneMap::iterator TPI = GI->second.begin();
1106 TypePlaneMap::iterator TPE = GI->second.end();
1107 for ( ; TPI != TPE; ++TPI) {
1108 if (TPI->first->sameNewTyAs(Ty)) {
1109 // The new types are the same but the old types are different so
1110 // this is a global name collision resulting from type planes
1112 if (Linkage == "external" || Linkage == "dllimport" ||
1113 Linkage == "extern_weak" || Linkage == "") {
1114 // The linkage of this gval is external so we can't reliably
1115 // rename it because it could potentially create a linking
1116 // problem. However, we can't leave the name conflict in the
1117 // output either or it won't assemble with LLVM 2.0. So, all we
1118 // can do is rename this one to something unique and emit a
1119 // warning about the problem.
1120 Result = *Name + ".unique";
1121 UniqueNameCounter++;
1122 Result += llvm::utostr(UniqueNameCounter);
1123 warning("Renaming global value '" + *Name + "' to '" + Result +
1124 "' may cause linkage errors.");
1127 // Its linkage is internal and its type is known so we can
1128 // disambiguate the name collision successfully based on the type.
1129 Result = getUniqueName(Name, Ty);
1130 TPI->second = Result;
1135 // We didn't find an entry in the type plane with the same new type and
1136 // the old types differ so this is a new type plane for this global
1137 // variable. We just fall through to the logic below which inserts
1143 // Its a new global name, if it is external we can't change it
1144 if (isConstant || Linkage == "external" || Linkage == "dllimport" ||
1145 Linkage == "extern_weak" || Linkage == "") {
1146 Globals[Result][Ty] = Result;
1150 // Its a new global name, and it is internal, change the name to make it
1151 // unique for its type.
1152 // Result = getUniqueName(Name, Ty);
1153 Globals[*Name][Ty] = Result;
1158 /* Enabling traces. */
1163 /* Enabling verbose error messages. */
1164 #ifdef YYERROR_VERBOSE
1165 # undef YYERROR_VERBOSE
1166 # define YYERROR_VERBOSE 1
1168 # define YYERROR_VERBOSE 0
1171 /* Enabling the token table. */
1172 #ifndef YYTOKEN_TABLE
1173 # define YYTOKEN_TABLE 0
1176 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1177 #line 802 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
1178 typedef union YYSTYPE {
1179 std::string* String;
1180 const TypeInfo* Type;
1186 /* Line 196 of yacc.c. */
1187 #line 1188 "UpgradeParser.tab.c"
1188 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1189 # define YYSTYPE_IS_DECLARED 1
1190 # define YYSTYPE_IS_TRIVIAL 1
1195 /* Copy the second part of user declarations. */
1198 /* Line 219 of yacc.c. */
1199 #line 1200 "UpgradeParser.tab.c"
1201 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1202 # define YYSIZE_T __SIZE_TYPE__
1204 #if ! defined (YYSIZE_T) && defined (size_t)
1205 # define YYSIZE_T size_t
1207 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1208 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1209 # define YYSIZE_T size_t
1211 #if ! defined (YYSIZE_T)
1212 # define YYSIZE_T unsigned int
1218 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1219 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1223 # define YY_(msgid) msgid
1227 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1229 /* The parser invokes alloca or malloc; define the necessary symbols. */
1231 # ifdef YYSTACK_USE_ALLOCA
1232 # if YYSTACK_USE_ALLOCA
1234 # define YYSTACK_ALLOC __builtin_alloca
1236 # define YYSTACK_ALLOC alloca
1237 # if defined (__STDC__) || defined (__cplusplus)
1238 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1239 # define YYINCLUDED_STDLIB_H
1245 # ifdef YYSTACK_ALLOC
1246 /* Pacify GCC's `empty if-body' warning. */
1247 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1248 # ifndef YYSTACK_ALLOC_MAXIMUM
1249 /* The OS might guarantee only one guard page at the bottom of the stack,
1250 and a page size can be as small as 4096 bytes. So we cannot safely
1251 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1252 to allow for a few compiler-allocated temporary stack slots. */
1253 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1256 # define YYSTACK_ALLOC YYMALLOC
1257 # define YYSTACK_FREE YYFREE
1258 # ifndef YYSTACK_ALLOC_MAXIMUM
1259 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1265 # define YYMALLOC malloc
1266 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1267 && (defined (__STDC__) || defined (__cplusplus)))
1268 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1272 # define YYFREE free
1273 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1274 && (defined (__STDC__) || defined (__cplusplus)))
1275 void free (void *); /* INFRINGES ON USER NAME SPACE */
1282 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1285 #if (! defined (yyoverflow) \
1286 && (! defined (__cplusplus) \
1287 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1289 /* A type that is properly aligned for any stack member. */
1296 /* The size of the maximum gap between one aligned stack and the next. */
1297 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1299 /* The size of an array large to enough to hold all stacks, each with
1301 # define YYSTACK_BYTES(N) \
1302 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
1303 + YYSTACK_GAP_MAXIMUM)
1305 /* Copy COUNT objects from FROM to TO. The source and destination do
1308 # if defined (__GNUC__) && 1 < __GNUC__
1309 # define YYCOPY(To, From, Count) \
1310 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1312 # define YYCOPY(To, From, Count) \
1316 for (yyi = 0; yyi < (Count); yyi++) \
1317 (To)[yyi] = (From)[yyi]; \
1323 /* Relocate STACK from its old location to the new one. The
1324 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1325 elements in the stack, and YYPTR gives the new location of the
1326 stack. Advance YYPTR to a properly aligned location for the next
1328 # define YYSTACK_RELOCATE(Stack) \
1331 YYSIZE_T yynewbytes; \
1332 YYCOPY (&yyptr->Stack, Stack, yysize); \
1333 Stack = &yyptr->Stack; \
1334 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1335 yyptr += yynewbytes / sizeof (*yyptr); \
1341 #if defined (__STDC__) || defined (__cplusplus)
1342 typedef signed char yysigned_char;
1344 typedef short int yysigned_char;
1347 /* YYFINAL -- State number of the termination state. */
1349 /* YYLAST -- Last index in YYTABLE. */
1352 /* YYNTOKENS -- Number of terminals. */
1353 #define YYNTOKENS 165
1354 /* YYNNTS -- Number of nonterminals. */
1356 /* YYNRULES -- Number of rules. */
1357 #define YYNRULES 301
1358 /* YYNRULES -- Number of states. */
1359 #define YYNSTATES 586
1361 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1362 #define YYUNDEFTOK 2
1363 #define YYMAXUTOK 405
1365 #define YYTRANSLATE(YYX) \
1366 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1368 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1369 static const unsigned char yytranslate[] =
1371 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1375 154, 155, 163, 2, 152, 2, 2, 2, 2, 2,
1376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1377 159, 151, 160, 2, 2, 2, 2, 2, 2, 2,
1378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1380 2, 156, 153, 158, 2, 2, 2, 2, 2, 164,
1381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1383 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
1384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1396 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1397 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1398 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1399 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1400 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1401 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1402 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1403 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1404 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1405 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1406 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1407 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1408 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1409 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1410 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1411 145, 146, 147, 148, 149, 150
1415 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1417 static const unsigned short int yyprhs[] =
1419 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1420 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1421 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1422 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1423 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1424 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1425 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
1426 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
1427 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
1428 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
1429 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
1430 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
1431 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
1432 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
1433 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
1434 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
1435 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
1436 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
1437 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
1438 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
1439 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
1440 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
1441 619, 623, 625, 627, 631, 632, 634, 636, 640, 641,
1442 643, 645, 647, 649, 651, 653, 655, 657, 659, 663,
1443 665, 671, 673, 675, 677, 679, 682, 685, 687, 690,
1444 693, 694, 696, 698, 700, 703, 706, 710, 720, 730,
1445 739, 754, 756, 758, 765, 771, 774, 781, 789, 791,
1446 795, 797, 798, 801, 803, 809, 815, 821, 828, 835,
1447 838, 843, 848, 855, 860, 865, 872, 879, 882, 890,
1448 892, 895, 896, 898, 899, 903, 910, 914, 921, 924,
1452 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1453 static const short int yyrhs[] =
1455 199, 0, -1, 19, -1, 20, -1, 17, -1, 18,
1456 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1457 -1, 85, -1, 86, -1, 87, -1, 88, -1, 89,
1458 -1, 90, -1, 91, -1, 92, -1, 93, -1, 94,
1459 -1, 95, -1, 96, -1, 97, -1, 98, -1, 99,
1460 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1461 -1, 107, -1, 118, -1, 119, -1, 120, -1, 121,
1462 -1, 108, -1, 109, -1, 110, -1, 111, -1, 112,
1463 -1, 113, -1, 114, -1, 115, -1, 116, -1, 117,
1464 -1, 118, -1, 119, -1, 120, -1, 121, -1, 25,
1465 -1, 26, -1, 130, -1, 131, -1, 132, -1, 133,
1466 -1, 139, -1, 140, -1, 141, -1, 142, -1, 143,
1467 -1, 144, -1, 145, -1, 146, -1, 147, -1, 148,
1468 -1, 149, -1, 150, -1, 138, -1, 11, -1, 9,
1469 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
1470 -1, 6, -1, 175, -1, 176, -1, 13, -1, 14,
1471 -1, 208, 151, -1, -1, 42, -1, 43, -1, 44,
1472 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
1473 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
1474 71, -1, 65, 18, -1, -1, -1, 57, 18, -1,
1475 -1, 152, 57, 18, -1, 37, 30, -1, -1, 184,
1476 -1, -1, 152, 187, 186, -1, 184, -1, 57, 18,
1477 -1, 190, -1, 3, -1, 192, -1, 3, -1, 192,
1478 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
1479 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
1480 -1, 14, -1, 15, -1, 16, -1, 222, -1, 191,
1481 -1, 153, 18, -1, 189, 154, 194, 155, -1, 156,
1482 18, 157, 192, 158, -1, 159, 18, 157, 192, 160,
1483 -1, 161, 193, 162, -1, 161, 162, -1, 159, 161,
1484 193, 162, 160, -1, 159, 161, 162, 160, -1, 192,
1485 163, -1, 192, -1, 193, 152, 192, -1, 193, -1,
1486 193, 152, 40, -1, 40, -1, -1, 190, 156, 197,
1487 158, -1, 190, 156, 158, -1, 190, 164, 30, -1,
1488 190, 159, 197, 160, -1, 190, 161, 197, 162, -1,
1489 190, 161, 162, -1, 190, 22, -1, 190, 23, -1,
1490 190, 222, -1, 190, 196, -1, 190, 24, -1, 175,
1491 167, -1, 176, 167, -1, 4, 25, -1, 4, 26,
1492 -1, 178, 21, -1, 174, 154, 195, 39, 190, 155,
1493 -1, 127, 154, 195, 237, 155, -1, 129, 154, 195,
1494 152, 195, 152, 195, 155, -1, 168, 154, 195, 152,
1495 195, 155, -1, 169, 154, 195, 152, 195, 155, -1,
1496 170, 154, 195, 152, 195, 155, -1, 100, 171, 154,
1497 195, 152, 195, 155, -1, 101, 172, 154, 195, 152,
1498 195, 155, -1, 173, 154, 195, 152, 195, 155, -1,
1499 135, 154, 195, 152, 195, 155, -1, 136, 154, 195,
1500 152, 195, 152, 195, 155, -1, 137, 154, 195, 152,
1501 195, 152, 195, 155, -1, 197, 152, 195, -1, 195,
1502 -1, 35, -1, 36, -1, 200, -1, 200, 217, -1,
1503 200, 219, -1, 200, 63, 62, 203, -1, 200, 31,
1504 -1, 202, -1, 50, -1, 58, -1, 202, 179, 27,
1505 188, -1, 202, 219, -1, 202, 63, 62, 203, -1,
1506 202, 179, 180, 198, 195, 186, -1, 202, 179, 201,
1507 198, 190, 186, -1, 202, 179, 45, 198, 190, 186,
1508 -1, 202, 179, 47, 198, 190, 186, -1, 202, 51,
1509 205, -1, 202, 59, 151, 206, -1, -1, 30, -1,
1510 56, -1, 55, -1, 53, 151, 204, -1, 54, 151,
1511 18, -1, 52, 151, 30, -1, 72, 151, 30, -1,
1512 156, 207, 158, -1, 207, 152, 30, -1, 30, -1,
1513 -1, 28, -1, 30, -1, 208, -1, -1, 190, 209,
1514 -1, 211, 152, 210, -1, 210, -1, 211, -1, 211,
1515 152, 40, -1, 40, -1, -1, 181, 188, 208, 154,
1516 212, 155, 185, 182, -1, 32, -1, 161, -1, 180,
1517 213, 214, -1, 33, -1, 162, -1, 215, 225, 216,
1518 -1, -1, 45, -1, 47, -1, 34, 218, 213, -1,
1519 -1, 64, -1, 17, -1, 18, -1, 21, -1, 25,
1520 -1, 26, -1, 22, -1, 23, -1, 24, -1, 159,
1521 197, 160, -1, 196, -1, 62, 220, 30, 152, 30,
1522 -1, 166, -1, 208, -1, 222, -1, 221, -1, 190,
1523 223, -1, 225, 226, -1, 226, -1, 227, 229, -1,
1524 227, 231, -1, -1, 29, -1, 78, -1, 77, -1,
1525 73, 224, -1, 73, 3, -1, 74, 15, 223, -1,
1526 74, 4, 223, 152, 15, 223, 152, 15, 223, -1,
1527 75, 177, 223, 152, 15, 223, 156, 230, 158, -1,
1528 75, 177, 223, 152, 15, 223, 156, 158, -1, 179,
1529 76, 181, 188, 223, 154, 234, 155, 39, 15, 223,
1530 228, 15, 223, -1, 228, -1, 79, -1, 230, 177,
1531 221, 152, 15, 223, -1, 177, 221, 152, 15, 223,
1532 -1, 179, 236, -1, 190, 156, 223, 152, 223, 158,
1533 -1, 232, 152, 156, 223, 152, 223, 158, -1, 224,
1534 -1, 233, 152, 224, -1, 233, -1, -1, 61, 60,
1535 -1, 60, -1, 168, 190, 223, 152, 223, -1, 169,
1536 190, 223, 152, 223, -1, 170, 190, 223, 152, 223,
1537 -1, 100, 171, 190, 223, 152, 223, -1, 101, 172,
1538 190, 223, 152, 223, -1, 49, 224, -1, 173, 224,
1539 152, 224, -1, 174, 224, 39, 190, -1, 129, 224,
1540 152, 224, 152, 224, -1, 134, 224, 152, 190, -1,
1541 135, 224, 152, 224, -1, 136, 224, 152, 224, 152,
1542 224, -1, 137, 224, 152, 224, 152, 224, -1, 128,
1543 232, -1, 235, 181, 188, 223, 154, 234, 155, -1,
1544 239, -1, 152, 233, -1, -1, 38, -1, -1, 122,
1545 190, 183, -1, 122, 190, 152, 10, 223, 183, -1,
1546 123, 190, 183, -1, 123, 190, 152, 10, 223, 183,
1547 -1, 124, 224, -1, 238, 125, 190, 223, -1, 238,
1548 126, 224, 152, 190, 223, -1, 127, 190, 223, 237,
1552 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1553 static const unsigned short int yyrline[] =
1555 0, 867, 867, 867, 868, 868, 872, 872, 872, 872,
1556 872, 872, 872, 873, 873, 873, 873, 874, 874, 874,
1557 875, 875, 875, 875, 875, 875, 876, 876, 876, 876,
1558 876, 876, 876, 876, 876, 876, 877, 877, 877, 877,
1559 877, 877, 877, 877, 877, 877, 878, 878, 878, 878,
1560 878, 878, 879, 879, 879, 879, 880, 880, 880, 880,
1561 880, 880, 880, 881, 881, 881, 881, 881, 881, 886,
1562 886, 886, 886, 887, 887, 887, 887, 888, 888, 889,
1563 889, 892, 895, 900, 900, 900, 900, 900, 900, 901,
1564 902, 905, 905, 905, 905, 905, 906, 907, 912, 917,
1565 918, 921, 922, 930, 936, 937, 940, 941, 950, 951,
1566 964, 964, 965, 965, 966, 970, 970, 970, 970, 970,
1567 970, 970, 971, 971, 971, 971, 971, 973, 976, 979,
1568 982, 986, 999, 1005, 1011, 1021, 1024, 1034, 1037, 1045,
1569 1049, 1056, 1057, 1062, 1067, 1077, 1083, 1088, 1094, 1100,
1570 1106, 1111, 1117, 1123, 1130, 1136, 1142, 1148, 1154, 1160,
1571 1166, 1174, 1188, 1200, 1205, 1211, 1216, 1222, 1227, 1232,
1572 1240, 1245, 1250, 1260, 1265, 1270, 1270, 1280, 1285, 1288,
1573 1293, 1297, 1301, 1303, 1303, 1306, 1316, 1321, 1326, 1336,
1574 1346, 1356, 1366, 1371, 1376, 1381, 1383, 1383, 1386, 1391,
1575 1398, 1403, 1410, 1417, 1422, 1423, 1431, 1431, 1432, 1432,
1576 1434, 1443, 1447, 1451, 1454, 1459, 1462, 1465, 1483, 1484,
1577 1487, 1498, 1499, 1501, 1510, 1511, 1512, 1516, 1529, 1530,
1578 1533, 1533, 1533, 1533, 1533, 1533, 1533, 1534, 1535, 1540,
1579 1541, 1550, 1550, 1554, 1559, 1569, 1578, 1581, 1589, 1593,
1580 1598, 1601, 1607, 1607, 1609, 1614, 1619, 1624, 1632, 1640,
1581 1647, 1669, 1674, 1680, 1686, 1694, 1712, 1720, 1729, 1733,
1582 1740, 1741, 1745, 1750, 1753, 1762, 1770, 1779, 1787, 1795,
1583 1800, 1809, 1837, 1843, 1849, 1856, 1862, 1868, 1874, 1902,
1584 1907, 1908, 1912, 1913, 1916, 1924, 1933, 1941, 1950, 1956,
1589 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1590 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1591 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1592 static const char *const yytname[] =
1594 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1595 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1596 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1597 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1598 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1599 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1600 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1601 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1602 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1603 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1604 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1605 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1606 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1607 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1608 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1609 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1610 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1611 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1612 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1613 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1614 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1615 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1616 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1617 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1618 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1619 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1620 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1621 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1622 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1623 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1624 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1625 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1626 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1627 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1628 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1629 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1630 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1631 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1632 "IndexList", "OptVolatile", "MemoryInst", 0
1637 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1639 static const unsigned short int yytoknum[] =
1641 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1642 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1643 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1644 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1645 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1646 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1647 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1648 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1649 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1650 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1651 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1652 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1653 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1654 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1655 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1656 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1657 62, 123, 125, 42, 99
1661 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1662 static const unsigned char yyr1[] =
1664 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1665 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1666 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1667 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
1668 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1669 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1670 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1671 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1672 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1673 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1674 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1675 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1676 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1677 192, 192, 192, 192, 192, 192, 192, 192, 192, 193,
1678 193, 194, 194, 194, 194, 195, 195, 195, 195, 195,
1679 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1680 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1681 196, 196, 196, 197, 197, 198, 198, 199, 200, 200,
1682 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1683 202, 202, 202, 202, 202, 203, 204, 204, 205, 205,
1684 205, 205, 206, 207, 207, 207, 208, 208, 209, 209,
1685 210, 211, 211, 212, 212, 212, 212, 213, 214, 214,
1686 215, 216, 216, 217, 218, 218, 218, 219, 220, 220,
1687 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1688 221, 222, 222, 223, 223, 224, 225, 225, 226, 227,
1689 227, 227, 228, 228, 229, 229, 229, 229, 229, 229,
1690 229, 229, 229, 230, 230, 231, 232, 232, 233, 233,
1691 234, 234, 235, 235, 236, 236, 236, 236, 236, 236,
1692 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1693 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1697 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1698 static const unsigned char yyr2[] =
1700 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1701 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1702 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1703 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1704 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1705 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1706 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1707 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1708 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1709 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1710 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1711 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1712 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1713 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1714 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1715 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1716 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1717 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1718 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1719 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1720 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1721 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1722 3, 1, 1, 3, 0, 1, 1, 3, 0, 1,
1723 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1724 5, 1, 1, 1, 1, 2, 2, 1, 2, 2,
1725 0, 1, 1, 1, 2, 2, 3, 9, 9, 8,
1726 14, 1, 1, 6, 5, 2, 6, 7, 1, 3,
1727 1, 0, 2, 1, 5, 5, 5, 6, 6, 2,
1728 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1729 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1733 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1734 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1735 means the default is an error. */
1736 static const unsigned short int yydefact[] =
1738 194, 0, 90, 182, 1, 181, 224, 83, 84, 85,
1739 87, 88, 89, 86, 0, 98, 250, 178, 179, 206,
1740 207, 0, 0, 0, 90, 0, 186, 225, 226, 98,
1741 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1742 251, 250, 247, 82, 0, 0, 0, 0, 192, 0,
1743 0, 0, 0, 0, 183, 184, 0, 0, 81, 227,
1744 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1745 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1746 0, 0, 0, 241, 0, 0, 110, 129, 114, 242,
1747 128, 218, 219, 220, 221, 222, 223, 246, 0, 0,
1748 0, 253, 252, 262, 293, 261, 248, 249, 0, 0,
1749 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1750 0, 0, 130, 0, 0, 0, 113, 135, 139, 0,
1751 0, 144, 138, 255, 0, 254, 0, 0, 72, 76,
1752 71, 75, 70, 74, 69, 73, 77, 78, 0, 292,
1753 0, 273, 0, 98, 6, 7, 8, 9, 10, 11,
1754 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1755 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1756 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1757 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1758 65, 66, 67, 0, 0, 0, 0, 0, 98, 265,
1759 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1760 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1761 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1762 0, 0, 0, 0, 134, 216, 143, 141, 0, 230,
1763 231, 232, 235, 236, 237, 233, 234, 228, 0, 0,
1764 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1765 0, 239, 244, 243, 245, 0, 256, 0, 279, 272,
1766 0, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1767 35, 0, 50, 51, 36, 37, 38, 39, 40, 41,
1768 42, 43, 44, 45, 46, 47, 48, 49, 0, 101,
1769 101, 298, 0, 0, 287, 0, 0, 0, 0, 0,
1770 0, 0, 0, 0, 0, 0, 0, 0, 0, 202,
1771 0, 190, 191, 158, 159, 4, 5, 156, 157, 160,
1772 151, 152, 155, 0, 0, 0, 0, 154, 153, 188,
1773 189, 112, 112, 137, 0, 140, 215, 209, 212, 213,
1774 0, 0, 131, 229, 0, 0, 0, 0, 0, 0,
1775 0, 0, 174, 0, 0, 0, 0, 0, 0, 0,
1776 0, 0, 0, 0, 0, 294, 0, 296, 291, 0,
1777 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1778 0, 0, 0, 0, 203, 0, 0, 108, 106, 146,
1779 0, 0, 150, 0, 147, 132, 133, 136, 208, 210,
1780 0, 104, 142, 0, 0, 0, 291, 0, 0, 0,
1781 0, 0, 238, 0, 0, 0, 0, 0, 0, 0,
1782 0, 0, 0, 0, 0, 0, 0, 301, 0, 0,
1783 0, 283, 284, 0, 0, 0, 0, 0, 280, 281,
1784 0, 299, 0, 103, 109, 107, 145, 148, 149, 214,
1785 211, 105, 99, 0, 0, 0, 0, 0, 0, 0,
1786 0, 173, 0, 0, 0, 0, 0, 0, 0, 271,
1787 0, 0, 101, 102, 101, 268, 290, 0, 0, 0,
1788 0, 0, 274, 275, 276, 271, 0, 0, 217, 240,
1789 0, 0, 162, 0, 0, 0, 0, 0, 0, 0,
1790 0, 0, 0, 0, 270, 0, 277, 278, 0, 295,
1791 297, 0, 0, 0, 282, 285, 286, 0, 300, 100,
1792 0, 0, 0, 170, 0, 0, 164, 165, 166, 169,
1793 161, 0, 259, 0, 0, 0, 269, 266, 0, 288,
1794 167, 168, 0, 0, 0, 257, 0, 258, 0, 0,
1795 267, 163, 171, 172, 0, 0, 0, 0, 0, 0,
1796 264, 0, 0, 263, 0, 260
1799 /* YYDEFGOTO[NTERM-NUM]. */
1800 static const short int yydefgoto[] =
1802 -1, 83, 337, 266, 267, 268, 291, 308, 269, 270,
1803 233, 234, 148, 235, 24, 15, 38, 508, 385, 407,
1804 472, 331, 408, 84, 85, 236, 87, 88, 129, 248,
1805 372, 271, 373, 118, 1, 2, 57, 3, 61, 215,
1806 48, 113, 219, 89, 419, 358, 359, 360, 39, 93,
1807 16, 96, 17, 29, 18, 364, 272, 90, 274, 495,
1808 41, 42, 43, 105, 106, 554, 107, 314, 524, 525,
1809 208, 209, 447, 210, 211
1812 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1814 #define YYPACT_NINF -513
1815 static const short int yypact[] =
1817 -513, 46, 217, 541, -513, -513, 82, -513, -513, -513,
1818 -513, -513, -513, -513, 16, 111, 25, -513, -513, -513,
1819 -513, 34, -55, 61, 26, -23, -513, -513, -513, 111,
1820 132, 146, -513, -513, -513, -513, -513, -513, 873, -26,
1821 -513, -18, -513, 47, 19, 23, 39, 67, -513, 77,
1822 132, 873, 81, 81, -513, -513, 81, 81, -513, -513,
1823 -513, -513, -513, 89, -513, -513, -513, -513, -513, -513,
1824 -513, -513, -513, -513, -513, -513, -513, -513, -513, 227,
1825 229, -9, 506, -513, 133, 95, -513, -513, -111, -513,
1826 -513, -513, -513, -513, -513, -513, -513, -513, 901, 36,
1827 148, -513, -513, -513, 1336, -513, -513, -513, 222, 76,
1828 250, 239, 241, -513, -513, -513, -513, -513, 933, 933,
1829 963, 933, -513, 115, 116, 614, -513, -513, -111, -104,
1830 120, 216, -513, 89, 1134, -513, 1134, 1134, -513, -513,
1831 -513, -513, -513, -513, -513, -513, -513, -513, 1134, -513,
1832 933, -513, 218, 111, -513, -513, -513, -513, -513, -513,
1833 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1834 -513, -513, -513, -513, 195, 84, 933, 933, 933, 933,
1835 933, 933, -513, -513, -513, -513, 933, 933, 933, 933,
1836 -513, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1837 -513, -513, -513, 933, 933, 933, 933, 933, 111, -513,
1838 11, -513, -513, -513, -513, -513, -513, -513, -513, -93,
1839 129, 129, 121, 166, 169, 191, 193, 220, 223, 237,
1840 240, 261, 263, 249, 249, 264, 1045, 129, 129, 933,
1841 933, 126, -73, 933, -513, 701, -513, 138, 136, -513,
1842 -513, -513, -513, -513, -513, -513, -513, 228, 195, 84,
1843 140, 150, 154, 156, 158, 963, 167, 168, 170, 171,
1844 172, -513, -513, -513, -513, 175, -513, 176, -513, -513,
1845 873, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1846 -513, 933, -513, -513, -513, -513, -513, -513, -513, -513,
1847 -513, -513, -513, -513, -513, -513, -513, -513, 933, 177,
1848 178, -513, 1134, 164, 179, 182, 183, 184, 186, 188,
1849 1134, 1134, 1134, 189, 284, 873, 933, 933, 312, -513,
1850 -8, -513, -513, -513, -513, -513, -513, -513, -513, -513,
1851 -513, -513, -513, 741, 963, 673, 314, -513, -513, -513,
1852 -513, -113, -99, -513, 185, -111, -513, 133, -513, 194,
1853 192, 774, -513, -513, 318, 198, 205, 963, 963, 963,
1854 963, 963, -513, -58, 963, 963, 963, 963, 963, 345,
1855 348, 1134, 1134, 1134, -2, -513, 9, -513, 212, 1134,
1856 209, 933, 933, 933, 933, 933, 214, 215, 219, 933,
1857 933, 1134, 1134, 221, -513, 338, 352, -513, 129, -513,
1858 -61, -57, -513, -70, -513, -513, -513, -513, -513, -513,
1859 833, 337, -513, 224, 963, 963, 212, 231, 235, 236,
1860 238, 963, -513, 242, 243, 244, 245, 342, 1134, 1134,
1861 247, 251, 252, 1134, 371, 1134, 933, -513, 253, 1134,
1862 254, -513, -513, 255, 257, 1134, 1134, 1134, -513, -513,
1863 248, -513, 933, -513, -513, -513, -513, -513, -513, -513,
1864 -513, -513, 335, 363, 258, 262, 260, 963, 963, 963,
1865 963, -513, 963, 963, 963, 963, 933, 265, 266, 933,
1866 1134, 1134, 267, -513, 267, -513, 268, 1134, 269, 933,
1867 933, 933, -513, -513, -513, 933, 1134, 398, -513, -513,
1868 963, 963, -513, 271, 273, 277, 278, 276, 279, 282,
1869 283, 286, 403, 15, 268, 289, -513, -513, 375, -513,
1870 -513, 933, 275, 1134, -513, -513, -513, 292, -513, -513,
1871 294, 295, 963, -513, 963, 963, -513, -513, -513, -513,
1872 -513, 1134, -513, 1223, 27, 400, -513, -513, 297, -513,
1873 -513, -513, 303, 304, 305, -513, 313, -513, 1223, 449,
1874 -513, -513, -513, -513, 451, 316, 1134, 1134, 454, 135,
1875 -513, 1134, 457, -513, 1134, -513
1878 /* YYPGOTO[NTERM-NUM]. */
1879 static const short int yypgoto[] =
1881 -513, -513, 246, 369, 370, 372, 225, 226, 373, 377,
1882 -98, -97, -507, -513, 436, 458, -141, -513, -303, 63,
1883 -513, -220, -513, -46, -513, -38, -513, -68, -20, -513,
1884 130, 256, -230, 51, -513, -513, -513, -513, 439, -513,
1885 -513, -513, -513, 1, -513, 66, -513, -513, 461, -513,
1886 -513, -513, -513, -513, 488, -513, -512, -106, -3, -88,
1887 -513, 455, -513, -84, -513, -513, -513, -513, 56, 18,
1888 -513, -513, 98, -513, -513
1891 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1892 positive, shift that token. If negative, reduce the rule which
1893 number is the opposite. If zero, do what YYDEFACT says.
1894 If YYTABLE_NINF, syntax error. */
1895 #define YYTABLE_NINF -178
1896 static const short int yytable[] =
1898 86, 332, 146, 147, 25, 115, 91, 387, 443, 124,
1899 135, 40, 280, 86, 128, 94, 553, 349, 350, 445,
1900 138, 139, 140, 141, 142, 143, 144, 145, 273, 405,
1901 273, 273, 138, 139, 140, 141, 142, 143, 144, 145,
1902 136, 566, 273, -112, 25, 415, 4, 568, 243, 406,
1903 132, 137, 132, 51, 40, 444, 575, 128, 244, 328,
1904 134, 416, 278, 128, 132, 329, 444, 325, 7, 8,
1905 9, 52, 11, 53, 13, 19, 54, 20, 30, 243,
1906 220, 221, 431, 238, 55, 130, 44, 45, 46, 354,
1907 311, 431, 468, 315, 431, 431, 49, 466, 316, 317,
1908 318, 319, 432, 467, 119, 242, 47, 120, 121, 292,
1909 293, 247, 134, 410, 411, 413, 116, 117, 323, 324,
1910 98, 99, 100, 50, 101, 102, 103, 27, 58, 28,
1911 348, 213, 214, 275, 276, 92, 326, 327, 309, 310,
1912 134, 312, 313, 134, 95, 277, 333, 334, 134, 134,
1913 134, 134, 125, 138, 139, 140, 141, 142, 143, 144,
1914 145, 19, 60, 20, 62, 320, 321, 322, 134, 134,
1915 108, 351, 352, 552, 109, 355, 31, 32, 33, 34,
1916 35, 36, 37, -72, -72, 567, -76, -76, 465, 529,
1917 110, 530, 294, 295, 296, 297, 298, 299, 300, 301,
1918 302, 303, 304, 305, 306, 307, 273, 357, -71, -71,
1919 -75, -75, 101, 102, 273, 273, 273, -177, 111, 126,
1920 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1921 74, 75, 76, 112, 381, 77, 78, -70, -70, 403,
1922 -74, -74, 86, -113, 19, 122, 20, 123, 5, 131,
1923 237, 6, 212, 382, -69, -69, 246, -73, -73, 7,
1924 8, 9, 10, 11, 12, 13, 335, 336, 216, 217,
1925 383, 218, 239, 240, 245, 273, 273, 273, 279, 401,
1926 14, 330, -79, 273, -80, 339, 353, 86, 402, 134,
1927 361, 362, 363, 355, 367, 273, 273, 281, 282, 283,
1928 284, 285, 286, 450, 368, 452, 453, 454, 369, 388,
1929 370, 458, 371, 287, 288, 289, 290, 396, 397, 398,
1930 389, 374, 375, 400, 376, 377, 378, 379, 380, 384,
1931 386, 390, 273, 273, 391, 392, 393, 273, 394, 273,
1932 395, 399, 404, 273, 414, 417, 420, 421, 423, 273,
1933 273, 273, 424, 134, 451, 134, 134, 134, 418, 425,
1934 438, 134, 459, 439, 446, 449, 455, 456, 463, 79,
1935 464, 457, 80, 462, 405, 81, 473, 82, 440, 441,
1936 442, 486, 357, 477, 273, 273, 448, 478, 479, 493,
1937 480, 273, 507, 509, 482, 483, 484, 485, 460, 461,
1938 273, 489, 505, 490, 491, 497, 499, 500, 134, 501,
1939 510, 534, 535, 536, 511, 512, 539, 522, 551, 528,
1940 531, 533, 523, 542, 506, 146, 147, 273, 543, 544,
1941 545, 546, 444, 557, 547, 487, 488, 548, 549, 569,
1942 492, 550, 494, 556, 555, 273, 498, 559, 521, 560,
1943 561, 134, 502, 503, 504, 570, 146, 147, 571, 572,
1944 573, 134, 134, 134, 576, 574, 577, 134, 578, 581,
1945 273, 273, 584, 203, 204, 273, 205, 206, 273, 104,
1946 338, 207, 56, 365, 471, 366, 470, 526, 527, 114,
1947 59, 26, 347, 134, 532, 582, 97, 426, 427, 428,
1948 429, 430, 496, 538, 433, 434, 435, 436, 437, 126,
1949 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
1950 74, 75, 76, 537, 476, 77, 78, 0, 0, 0,
1951 558, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1952 0, 0, 0, 0, 0, 0, 0, 0, 565, 0,
1953 0, 0, 0, 0, 474, 475, 0, 0, 0, 0,
1954 0, 481, 0, 0, 0, 0, 0, 0, -82, 19,
1955 0, 20, 0, 579, 580, 6, -82, -82, 583, 0,
1956 0, 585, 0, -82, -82, -82, -82, -82, -82, -82,
1957 0, -82, 21, 0, 0, 0, 0, 0, 0, -82,
1958 22, 0, 0, 0, 23, 0, 0, 513, 514, 515,
1959 516, 0, 517, 518, 519, 520, 0, 126, 64, 65,
1960 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1961 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1962 540, 541, 19, 0, 20, 0, 0, 0, 0, 0,
1963 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
1964 0, 0, 80, 0, 0, 81, 0, 82, 127, 0,
1965 0, 0, 562, 0, 563, 564, 126, 222, 223, 224,
1966 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1967 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1968 0, 19, 0, 20, 126, 64, 65, 66, 67, 68,
1969 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1970 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1971 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1972 0, 356, 0, 0, 126, 222, 223, 224, 225, 226,
1973 227, 228, 229, 230, 231, 232, 75, 76, 0, 0,
1974 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1975 80, 20, 0, 81, 0, 82, 241, 126, 64, 65,
1976 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1977 76, 0, 0, 77, 78, 0, 0, 0, 0, 0,
1978 0, 0, 19, 0, 20, 0, 0, 0, 0, 0,
1979 0, 0, 0, 0, 422, 0, 0, 0, 0, 0,
1980 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1981 0, 0, 81, 0, 82, 412, 126, 64, 65, 66,
1982 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1983 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
1984 81, 19, 82, 20, 0, 0, 0, 0, 0, 0,
1985 0, 0, 0, 469, 0, 0, 63, 64, 65, 66,
1986 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1987 0, 0, 77, 78, 79, 0, 0, 80, 0, 409,
1988 81, 19, 82, 20, 133, 64, 65, 66, 67, 68,
1989 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1990 77, 78, 0, 0, 0, 0, 0, 79, 0, 19,
1991 80, 20, 0, 81, 0, 82, 126, 64, 65, 66,
1992 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1993 0, 0, 77, 78, 0, 0, 0, 0, 0, 0,
1994 0, 19, 0, 20, 0, 0, 126, 222, 223, 224,
1995 225, 226, 227, 228, 229, 230, 231, 232, 75, 76,
1996 0, 0, 77, 78, 0, 0, 79, 0, 0, 80,
1997 0, 19, 81, 20, 82, 0, 0, 0, 0, 0,
1998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1999 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2000 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
2001 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
2002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2003 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
2004 81, 0, 82, 0, 77, 78, 0, 340, 341, 342,
2005 0, 0, 0, 19, 0, 20, 0, 0, 0, 0,
2006 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
2007 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
2008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2009 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
2010 0, 0, 81, 0, 82, 154, 155, 156, 157, 158,
2011 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
2012 169, 170, 171, 172, 173, 258, 259, 0, 0, 0,
2013 0, 249, 250, 77, 78, 251, 252, 253, 254, 255,
2014 256, 0, 19, 0, 20, 0, 0, 0, 0, 0,
2015 0, 0, 260, 0, 261, 182, 183, 184, 185, 0,
2016 262, 263, 264, 190, 191, 192, 193, 194, 195, 196,
2017 197, 198, 199, 200, 201, 202, 257, 0, 0, 0,
2018 0, 343, 0, 0, 344, 0, 345, 0, 0, 346,
2019 0, 0, 0, 0, 154, 155, 156, 157, 158, 159,
2020 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
2021 170, 171, 172, 173, 258, 259, 0, 0, 0, 0,
2022 249, 250, 0, 0, 251, 252, 253, 254, 255, 256,
2023 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2024 0, 260, 0, 261, 182, 183, 184, 185, 0, 262,
2025 263, 264, 190, 191, 192, 193, 194, 195, 196, 197,
2026 198, 199, 200, 201, 202, 257, 0, 0, 0, 0,
2027 0, 0, 0, 265, 0, 0, 0, 0, 0, 0,
2028 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
2029 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
2030 171, 172, 173, 258, 259, 0, 0, 0, 0, 0,
2031 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2032 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2033 260, 0, 261, 182, 183, 184, 185, 0, 262, 263,
2034 264, 190, 191, 192, 193, 194, 195, 196, 197, 198,
2035 199, 200, 201, 202, 149, 0, 0, 0, 0, 0,
2036 0, 0, 265, 0, 0, 150, 0, 0, 0, 0,
2037 0, 0, 0, 0, 0, 0, 151, 152, 0, 0,
2038 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2039 0, 0, 153, 0, 0, 0, 154, 155, 156, 157,
2040 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
2041 168, 169, 170, 171, 172, 173, 174, 175, 0, 0,
2042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2043 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
2044 178, 0, 0, 179, 180, 181, 182, 183, 184, 185,
2045 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2046 196, 197, 198, 199, 200, 201, 202
2049 static const short int yycheck[] =
2051 38, 221, 100, 100, 3, 51, 32, 310, 10, 18,
2052 98, 29, 153, 51, 82, 33, 523, 237, 238, 10,
2053 5, 6, 7, 8, 9, 10, 11, 12, 134, 37,
2054 136, 137, 5, 6, 7, 8, 9, 10, 11, 12,
2055 4, 553, 148, 154, 43, 158, 0, 554, 152, 57,
2056 163, 15, 163, 27, 29, 57, 568, 125, 162, 152,
2057 98, 160, 150, 131, 163, 158, 57, 208, 42, 43,
2058 44, 45, 46, 47, 48, 28, 50, 30, 62, 152,
2059 118, 119, 152, 121, 58, 84, 52, 53, 54, 162,
2060 178, 152, 162, 181, 152, 152, 151, 158, 186, 187,
2061 188, 189, 160, 160, 53, 125, 72, 56, 57, 25,
2062 26, 131, 150, 343, 344, 345, 35, 36, 206, 207,
2063 73, 74, 75, 62, 77, 78, 79, 45, 151, 47,
2064 236, 55, 56, 136, 137, 161, 125, 126, 176, 177,
2065 178, 179, 180, 181, 162, 148, 25, 26, 186, 187,
2066 188, 189, 161, 5, 6, 7, 8, 9, 10, 11,
2067 12, 28, 30, 30, 18, 203, 204, 205, 206, 207,
2068 151, 239, 240, 158, 151, 243, 65, 66, 67, 68,
2069 69, 70, 71, 17, 18, 158, 17, 18, 408, 492,
2070 151, 494, 108, 109, 110, 111, 112, 113, 114, 115,
2071 116, 117, 118, 119, 120, 121, 312, 245, 17, 18,
2072 17, 18, 77, 78, 320, 321, 322, 0, 151, 3,
2073 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2074 14, 15, 16, 156, 280, 19, 20, 17, 18, 327,
2075 17, 18, 280, 154, 28, 18, 30, 18, 31, 154,
2076 120, 34, 30, 291, 17, 18, 40, 17, 18, 42,
2077 43, 44, 45, 46, 47, 48, 17, 18, 18, 30,
2078 308, 30, 157, 157, 154, 381, 382, 383, 60, 325,
2079 63, 152, 21, 389, 21, 21, 160, 325, 326, 327,
2080 152, 155, 64, 361, 154, 401, 402, 102, 103, 104,
2081 105, 106, 107, 391, 154, 393, 394, 395, 154, 312,
2082 154, 399, 154, 118, 119, 120, 121, 320, 321, 322,
2083 156, 154, 154, 39, 154, 154, 154, 152, 152, 152,
2084 152, 152, 438, 439, 152, 152, 152, 443, 152, 445,
2085 152, 152, 30, 449, 30, 160, 152, 155, 30, 455,
2086 456, 457, 154, 391, 392, 393, 394, 395, 357, 154,
2087 15, 399, 400, 15, 152, 156, 152, 152, 30, 153,
2088 18, 152, 156, 152, 37, 159, 152, 161, 381, 382,
2089 383, 39, 420, 152, 490, 491, 389, 152, 152, 18,
2090 152, 497, 57, 30, 152, 152, 152, 152, 401, 402,
2091 506, 154, 154, 152, 152, 152, 152, 152, 446, 152,
2092 152, 499, 500, 501, 152, 155, 18, 152, 15, 152,
2093 152, 152, 156, 152, 462, 523, 523, 533, 155, 152,
2094 152, 155, 57, 158, 155, 438, 439, 155, 155, 39,
2095 443, 155, 445, 531, 155, 551, 449, 155, 486, 155,
2096 155, 489, 455, 456, 457, 158, 554, 554, 155, 155,
2097 155, 499, 500, 501, 15, 152, 15, 505, 152, 15,
2098 576, 577, 15, 104, 104, 581, 104, 104, 584, 43,
2099 234, 104, 24, 258, 421, 259, 420, 490, 491, 50,
2100 29, 3, 236, 531, 497, 579, 41, 367, 368, 369,
2101 370, 371, 446, 506, 374, 375, 376, 377, 378, 3,
2102 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2103 14, 15, 16, 505, 426, 19, 20, -1, -1, -1,
2104 533, -1, -1, -1, 28, -1, 30, -1, -1, -1,
2105 -1, -1, -1, -1, -1, -1, -1, -1, 551, -1,
2106 -1, -1, -1, -1, 424, 425, -1, -1, -1, -1,
2107 -1, 431, -1, -1, -1, -1, -1, -1, 27, 28,
2108 -1, 30, -1, 576, 577, 34, 35, 36, 581, -1,
2109 -1, 584, -1, 42, 43, 44, 45, 46, 47, 48,
2110 -1, 50, 51, -1, -1, -1, -1, -1, -1, 58,
2111 59, -1, -1, -1, 63, -1, -1, 477, 478, 479,
2112 480, -1, 482, 483, 484, 485, -1, 3, 4, 5,
2113 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2114 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
2115 510, 511, 28, -1, 30, -1, -1, -1, -1, -1,
2116 -1, -1, -1, -1, -1, -1, -1, -1, -1, 153,
2117 -1, -1, 156, -1, -1, 159, -1, 161, 162, -1,
2118 -1, -1, 542, -1, 544, 545, 3, 4, 5, 6,
2119 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2120 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
2121 -1, 28, -1, 30, 3, 4, 5, 6, 7, 8,
2122 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2123 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2124 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
2125 -1, 40, -1, -1, 3, 4, 5, 6, 7, 8,
2126 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2127 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
2128 156, 30, -1, 159, -1, 161, 162, 3, 4, 5,
2129 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2130 16, -1, -1, 19, 20, -1, -1, -1, -1, -1,
2131 -1, -1, 28, -1, 30, -1, -1, -1, -1, -1,
2132 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
2133 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2134 -1, -1, 159, -1, 161, 162, 3, 4, 5, 6,
2135 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2136 -1, -1, 19, 20, 153, -1, -1, 156, -1, -1,
2137 159, 28, 161, 30, -1, -1, -1, -1, -1, -1,
2138 -1, -1, -1, 40, -1, -1, 3, 4, 5, 6,
2139 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2140 -1, -1, 19, 20, 153, -1, -1, 156, -1, 158,
2141 159, 28, 161, 30, 3, 4, 5, 6, 7, 8,
2142 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2143 19, 20, -1, -1, -1, -1, -1, 153, -1, 28,
2144 156, 30, -1, 159, -1, 161, 3, 4, 5, 6,
2145 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2146 -1, -1, 19, 20, -1, -1, -1, -1, -1, -1,
2147 -1, 28, -1, 30, -1, -1, 3, 4, 5, 6,
2148 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2149 -1, -1, 19, 20, -1, -1, 153, -1, -1, 156,
2150 -1, 28, 159, 30, 161, -1, -1, -1, -1, -1,
2151 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2152 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2153 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2154 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
2155 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2156 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
2157 159, -1, 161, -1, 19, 20, -1, 22, 23, 24,
2158 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
2159 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2160 -1, -1, 159, -1, 161, -1, -1, -1, -1, -1,
2161 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2162 -1, -1, -1, -1, -1, -1, 153, -1, -1, 156,
2163 -1, -1, 159, -1, 161, 80, 81, 82, 83, 84,
2164 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2165 95, 96, 97, 98, 99, 100, 101, -1, -1, -1,
2166 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
2167 26, -1, 28, -1, 30, -1, -1, -1, -1, -1,
2168 -1, -1, 127, -1, 129, 130, 131, 132, 133, -1,
2169 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
2170 145, 146, 147, 148, 149, 150, 62, -1, -1, -1,
2171 -1, 156, -1, -1, 159, -1, 161, -1, -1, 164,
2172 -1, -1, -1, -1, 80, 81, 82, 83, 84, 85,
2173 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2174 96, 97, 98, 99, 100, 101, -1, -1, -1, -1,
2175 17, 18, -1, -1, 21, 22, 23, 24, 25, 26,
2176 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2177 -1, 127, -1, 129, 130, 131, 132, 133, -1, 135,
2178 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
2179 146, 147, 148, 149, 150, 62, -1, -1, -1, -1,
2180 -1, -1, -1, 159, -1, -1, -1, -1, -1, -1,
2181 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
2182 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2183 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
2184 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2185 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2186 127, -1, 129, 130, 131, 132, 133, -1, 135, 136,
2187 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2188 147, 148, 149, 150, 38, -1, -1, -1, -1, -1,
2189 -1, -1, 159, -1, -1, 49, -1, -1, -1, -1,
2190 -1, -1, -1, -1, -1, -1, 60, 61, -1, -1,
2191 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2192 -1, -1, 76, -1, -1, -1, 80, 81, 82, 83,
2193 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2194 94, 95, 96, 97, 98, 99, 100, 101, -1, -1,
2195 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2196 -1, -1, -1, -1, -1, -1, -1, -1, 122, 123,
2197 124, -1, -1, 127, 128, 129, 130, 131, 132, 133,
2198 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
2199 144, 145, 146, 147, 148, 149, 150
2202 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2203 symbol of state STATE-NUM. */
2204 static const unsigned char yystos[] =
2206 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
2207 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
2208 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
2209 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
2210 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
2211 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
2212 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
2213 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
2214 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
2215 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
2216 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
2217 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
2218 198, 198, 18, 18, 18, 161, 3, 162, 192, 193,
2219 208, 154, 163, 3, 190, 224, 4, 15, 5, 6,
2220 7, 8, 9, 10, 11, 12, 175, 176, 177, 38,
2221 49, 60, 61, 76, 80, 81, 82, 83, 84, 85,
2222 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2223 96, 97, 98, 99, 100, 101, 122, 123, 124, 127,
2224 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
2225 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
2226 148, 149, 150, 168, 169, 170, 173, 174, 235, 236,
2227 238, 239, 30, 55, 56, 204, 18, 30, 30, 207,
2228 190, 190, 4, 5, 6, 7, 8, 9, 10, 11,
2229 12, 13, 14, 175, 176, 178, 190, 195, 190, 157,
2230 157, 162, 193, 152, 162, 154, 40, 193, 194, 17,
2231 18, 21, 22, 23, 24, 25, 26, 62, 100, 101,
2232 127, 129, 135, 136, 137, 159, 168, 169, 170, 173,
2233 174, 196, 221, 222, 223, 223, 223, 223, 224, 60,
2234 181, 102, 103, 104, 105, 106, 107, 118, 119, 120,
2235 121, 171, 25, 26, 108, 109, 110, 111, 112, 113,
2236 114, 115, 116, 117, 118, 119, 120, 121, 172, 190,
2237 190, 224, 190, 190, 232, 224, 224, 224, 224, 224,
2238 190, 190, 190, 224, 224, 181, 125, 126, 152, 158,
2239 152, 186, 186, 25, 26, 17, 18, 167, 167, 21,
2240 22, 23, 24, 156, 159, 161, 164, 196, 222, 186,
2241 186, 192, 192, 160, 162, 192, 40, 190, 210, 211,
2242 212, 152, 155, 64, 220, 171, 172, 154, 154, 154,
2243 154, 154, 195, 197, 154, 154, 154, 154, 154, 152,
2244 152, 188, 190, 190, 152, 183, 152, 183, 223, 156,
2245 152, 152, 152, 152, 152, 152, 223, 223, 223, 152,
2246 39, 188, 190, 224, 30, 37, 57, 184, 187, 158,
2247 197, 197, 162, 197, 30, 158, 160, 160, 208, 209,
2248 152, 155, 40, 30, 154, 154, 195, 195, 195, 195,
2249 195, 152, 160, 195, 195, 195, 195, 195, 15, 15,
2250 223, 223, 223, 10, 57, 10, 152, 237, 223, 156,
2251 224, 190, 224, 224, 224, 152, 152, 152, 224, 190,
2252 223, 223, 152, 30, 18, 186, 158, 160, 162, 40,
2253 210, 184, 185, 152, 195, 195, 237, 152, 152, 152,
2254 152, 195, 152, 152, 152, 152, 39, 223, 223, 154,
2255 152, 152, 223, 18, 223, 224, 233, 152, 223, 152,
2256 152, 152, 223, 223, 223, 154, 190, 57, 182, 30,
2257 152, 152, 155, 195, 195, 195, 195, 195, 195, 195,
2258 195, 190, 152, 156, 233, 234, 223, 223, 152, 183,
2259 183, 152, 223, 152, 224, 224, 224, 234, 223, 18,
2260 195, 195, 152, 155, 152, 152, 155, 155, 155, 155,
2261 155, 15, 158, 177, 230, 155, 224, 158, 223, 155,
2262 155, 155, 195, 195, 195, 223, 221, 158, 177, 39,
2263 158, 155, 155, 155, 152, 221, 15, 15, 152, 223,
2264 223, 15, 228, 223, 15, 223
2267 #define yyerrok (yyerrstatus = 0)
2268 #define yyclearin (yychar = YYEMPTY)
2269 #define YYEMPTY (-2)
2272 #define YYACCEPT goto yyacceptlab
2273 #define YYABORT goto yyabortlab
2274 #define YYERROR goto yyerrorlab
2277 /* Like YYERROR except do call yyerror. This remains here temporarily
2278 to ease the transition to the new meaning of YYERROR, for GCC.
2279 Once GCC version 2 has supplanted version 1, this can go. */
2281 #define YYFAIL goto yyerrlab
2283 #define YYRECOVERING() (!!yyerrstatus)
2285 #define YYBACKUP(Token, Value) \
2287 if (yychar == YYEMPTY && yylen == 1) \
2291 yytoken = YYTRANSLATE (yychar); \
2297 yyerror (YY_("syntax error: cannot back up")); \
2304 #define YYERRCODE 256
2307 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2308 If N is 0, then set CURRENT to the empty location which ends
2309 the previous symbol: RHS[0] (always defined). */
2311 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2312 #ifndef YYLLOC_DEFAULT
2313 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2317 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2318 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2319 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2320 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2324 (Current).first_line = (Current).last_line = \
2325 YYRHSLOC (Rhs, 0).last_line; \
2326 (Current).first_column = (Current).last_column = \
2327 YYRHSLOC (Rhs, 0).last_column; \
2333 /* YY_LOCATION_PRINT -- Print the location on the stream.
2334 This macro was not mandated originally: define only if we know
2335 we won't break user code: when these are the locations we know. */
2337 #ifndef YY_LOCATION_PRINT
2338 # if YYLTYPE_IS_TRIVIAL
2339 # define YY_LOCATION_PRINT(File, Loc) \
2340 fprintf (File, "%d.%d-%d.%d", \
2341 (Loc).first_line, (Loc).first_column, \
2342 (Loc).last_line, (Loc).last_column)
2344 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2349 /* YYLEX -- calling `yylex' with the right arguments. */
2352 # define YYLEX yylex (YYLEX_PARAM)
2354 # define YYLEX yylex ()
2357 /* Enable debugging if requested. */
2361 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2362 # define YYFPRINTF fprintf
2365 # define YYDPRINTF(Args) \
2371 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2375 YYFPRINTF (stderr, "%s ", Title); \
2376 yysymprint (stderr, \
2378 YYFPRINTF (stderr, "\n"); \
2382 /*------------------------------------------------------------------.
2383 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2385 `------------------------------------------------------------------*/
2387 #if defined (__STDC__) || defined (__cplusplus)
2389 yy_stack_print (short int *bottom, short int *top)
2392 yy_stack_print (bottom, top)
2397 YYFPRINTF (stderr, "Stack now");
2398 for (/* Nothing. */; bottom <= top; ++bottom)
2399 YYFPRINTF (stderr, " %d", *bottom);
2400 YYFPRINTF (stderr, "\n");
2403 # define YY_STACK_PRINT(Bottom, Top) \
2406 yy_stack_print ((Bottom), (Top)); \
2410 /*------------------------------------------------.
2411 | Report that the YYRULE is going to be reduced. |
2412 `------------------------------------------------*/
2414 #if defined (__STDC__) || defined (__cplusplus)
2416 yy_reduce_print (int yyrule)
2419 yy_reduce_print (yyrule)
2424 unsigned long int yylno = yyrline[yyrule];
2425 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2427 /* Print the symbols being reduced, and their result. */
2428 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2429 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2430 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2433 # define YY_REDUCE_PRINT(Rule) \
2436 yy_reduce_print (Rule); \
2439 /* Nonzero means print parse trace. It is left uninitialized so that
2440 multiple parsers can coexist. */
2442 #else /* !YYDEBUG */
2443 # define YYDPRINTF(Args)
2444 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2445 # define YY_STACK_PRINT(Bottom, Top)
2446 # define YY_REDUCE_PRINT(Rule)
2447 #endif /* !YYDEBUG */
2450 /* YYINITDEPTH -- initial size of the parser's stacks. */
2452 # define YYINITDEPTH 200
2455 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2456 if the built-in stack extension method is used).
2458 Do not make this value too large; the results are undefined if
2459 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2460 evaluated with infinite-precision integer arithmetic. */
2463 # define YYMAXDEPTH 10000
2471 # if defined (__GLIBC__) && defined (_STRING_H)
2472 # define yystrlen strlen
2474 /* Return the length of YYSTR. */
2476 # if defined (__STDC__) || defined (__cplusplus)
2477 yystrlen (const char *yystr)
2483 const char *yys = yystr;
2485 while (*yys++ != '\0')
2488 return yys - yystr - 1;
2494 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2495 # define yystpcpy stpcpy
2497 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2500 # if defined (__STDC__) || defined (__cplusplus)
2501 yystpcpy (char *yydest, const char *yysrc)
2503 yystpcpy (yydest, yysrc)
2509 const char *yys = yysrc;
2511 while ((*yyd++ = *yys++) != '\0')
2520 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2521 quotes and backslashes, so that it's suitable for yyerror. The
2522 heuristic is that double-quoting is unnecessary unless the string
2523 contains an apostrophe, a comma, or backslash (other than
2524 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2525 null, do not copy; instead, return the length of what the result
2528 yytnamerr (char *yyres, const char *yystr)
2533 char const *yyp = yystr;
2540 goto do_not_strip_quotes;
2544 goto do_not_strip_quotes;
2557 do_not_strip_quotes: ;
2561 return yystrlen (yystr);
2563 return yystpcpy (yyres, yystr) - yyres;
2567 #endif /* YYERROR_VERBOSE */
2572 /*--------------------------------.
2573 | Print this symbol on YYOUTPUT. |
2574 `--------------------------------*/
2576 #if defined (__STDC__) || defined (__cplusplus)
2578 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2581 yysymprint (yyoutput, yytype, yyvaluep)
2587 /* Pacify ``unused variable'' warnings. */
2590 if (yytype < YYNTOKENS)
2591 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2593 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2597 if (yytype < YYNTOKENS)
2598 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2605 YYFPRINTF (yyoutput, ")");
2608 #endif /* ! YYDEBUG */
2609 /*-----------------------------------------------.
2610 | Release the memory associated to this symbol. |
2611 `-----------------------------------------------*/
2613 #if defined (__STDC__) || defined (__cplusplus)
2615 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2618 yydestruct (yymsg, yytype, yyvaluep)
2624 /* Pacify ``unused variable'' warnings. */
2629 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2640 /* Prevent warnings from -Wmissing-prototypes. */
2642 #ifdef YYPARSE_PARAM
2643 # if defined (__STDC__) || defined (__cplusplus)
2644 int yyparse (void *YYPARSE_PARAM);
2648 #else /* ! YYPARSE_PARAM */
2649 #if defined (__STDC__) || defined (__cplusplus)
2654 #endif /* ! YYPARSE_PARAM */
2658 /* The look-ahead symbol. */
2661 /* The semantic value of the look-ahead symbol. */
2664 /* Number of syntax errors so far. */
2673 #ifdef YYPARSE_PARAM
2674 # if defined (__STDC__) || defined (__cplusplus)
2675 int yyparse (void *YYPARSE_PARAM)
2677 int yyparse (YYPARSE_PARAM)
2678 void *YYPARSE_PARAM;
2680 #else /* ! YYPARSE_PARAM */
2681 #if defined (__STDC__) || defined (__cplusplus)
2695 /* Number of tokens to shift before error messages enabled. */
2697 /* Look-ahead token as an internal (translated) token number. */
2700 /* Three stacks and their tools:
2701 `yyss': related to states,
2702 `yyvs': related to semantic values,
2703 `yyls': related to locations.
2705 Refer to the stacks thru separate pointers, to allow yyoverflow
2706 to reallocate them elsewhere. */
2708 /* The state stack. */
2709 short int yyssa[YYINITDEPTH];
2710 short int *yyss = yyssa;
2713 /* The semantic value stack. */
2714 YYSTYPE yyvsa[YYINITDEPTH];
2715 YYSTYPE *yyvs = yyvsa;
2720 #define YYPOPSTACK (yyvsp--, yyssp--)
2722 YYSIZE_T yystacksize = YYINITDEPTH;
2724 /* The variables used to return semantic value and location from the
2729 /* When reducing, the number of symbols on the RHS of the reduced
2733 YYDPRINTF ((stderr, "Starting parse\n"));
2738 yychar = YYEMPTY; /* Cause a token to be read. */
2740 /* Initialize stack pointers.
2741 Waste one element of value and location stack
2742 so that they stay on the same level as the state stack.
2743 The wasted elements are never initialized. */
2750 /*------------------------------------------------------------.
2751 | yynewstate -- Push a new state, which is found in yystate. |
2752 `------------------------------------------------------------*/
2754 /* In all cases, when you get here, the value and location stacks
2755 have just been pushed. so pushing a state here evens the stacks.
2762 if (yyss + yystacksize - 1 <= yyssp)
2764 /* Get the current used size of the three stacks, in elements. */
2765 YYSIZE_T yysize = yyssp - yyss + 1;
2769 /* Give user a chance to reallocate the stack. Use copies of
2770 these so that the &'s don't force the real ones into
2772 YYSTYPE *yyvs1 = yyvs;
2773 short int *yyss1 = yyss;
2776 /* Each stack pointer address is followed by the size of the
2777 data in use in that stack, in bytes. This used to be a
2778 conditional around just the two extra args, but that might
2779 be undefined if yyoverflow is a macro. */
2780 yyoverflow (YY_("memory exhausted"),
2781 &yyss1, yysize * sizeof (*yyssp),
2782 &yyvs1, yysize * sizeof (*yyvsp),
2789 #else /* no yyoverflow */
2790 # ifndef YYSTACK_RELOCATE
2791 goto yyexhaustedlab;
2793 /* Extend the stack our own way. */
2794 if (YYMAXDEPTH <= yystacksize)
2795 goto yyexhaustedlab;
2797 if (YYMAXDEPTH < yystacksize)
2798 yystacksize = YYMAXDEPTH;
2801 short int *yyss1 = yyss;
2802 union yyalloc *yyptr =
2803 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2805 goto yyexhaustedlab;
2806 YYSTACK_RELOCATE (yyss);
2807 YYSTACK_RELOCATE (yyvs);
2809 # undef YYSTACK_RELOCATE
2811 YYSTACK_FREE (yyss1);
2814 #endif /* no yyoverflow */
2816 yyssp = yyss + yysize - 1;
2817 yyvsp = yyvs + yysize - 1;
2820 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2821 (unsigned long int) yystacksize));
2823 if (yyss + yystacksize - 1 <= yyssp)
2827 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2836 /* Do appropriate processing given the current state. */
2837 /* Read a look-ahead token if we need one and don't already have one. */
2840 /* First try to decide what to do without reference to look-ahead token. */
2842 yyn = yypact[yystate];
2843 if (yyn == YYPACT_NINF)
2846 /* Not known => get a look-ahead token if don't already have one. */
2848 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2849 if (yychar == YYEMPTY)
2851 YYDPRINTF ((stderr, "Reading a token: "));
2855 if (yychar <= YYEOF)
2857 yychar = yytoken = YYEOF;
2858 YYDPRINTF ((stderr, "Now at end of input.\n"));
2862 yytoken = YYTRANSLATE (yychar);
2863 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2866 /* If the proper action on seeing token YYTOKEN is to reduce or to
2867 detect an error, take that action. */
2869 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2874 if (yyn == 0 || yyn == YYTABLE_NINF)
2883 /* Shift the look-ahead token. */
2884 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2886 /* Discard the token being shifted unless it is eof. */
2887 if (yychar != YYEOF)
2893 /* Count tokens shifted since error; after three, turn off error
2902 /*-----------------------------------------------------------.
2903 | yydefault -- do the default action for the current state. |
2904 `-----------------------------------------------------------*/
2906 yyn = yydefact[yystate];
2912 /*-----------------------------.
2913 | yyreduce -- Do a reduction. |
2914 `-----------------------------*/
2916 /* yyn is the number of a rule to reduce with. */
2919 /* If YYLEN is nonzero, implement the default value of the action:
2922 Otherwise, the following line sets YYVAL to garbage.
2923 This behavior is undocumented and Bison
2924 users should not rely upon it. Assigning to YYVAL
2925 unconditionally makes the parser a bit smaller, and it avoids a
2926 GCC warning that YYVAL may be used uninitialized. */
2927 yyval = yyvsp[1-yylen];
2930 YY_REDUCE_PRINT (yyn);
2934 #line 892 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2936 (yyval.String) = (yyvsp[-1].String);
2941 #line 895 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2943 (yyval.String) = new std::string("");
2948 #line 902 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2949 { (yyval.String) = new std::string(""); ;}
2953 #line 907 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2955 *(yyvsp[-1].String) += *(yyvsp[0].String);
2956 delete (yyvsp[0].String);
2957 (yyval.String) = (yyvsp[-1].String);
2962 #line 912 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2963 { (yyval.String) = new std::string(""); ;}
2967 #line 917 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2968 { (yyval.String) = new std::string(); ;}
2972 #line 918 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2973 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2977 #line 921 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2978 { (yyval.String) = new std::string(); ;}
2982 #line 922 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2984 (yyvsp[-1].String)->insert(0, ", ");
2985 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2986 delete (yyvsp[0].String);
2987 (yyval.String) = (yyvsp[-1].String);
2992 #line 930 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
2994 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2995 delete (yyvsp[0].String);
2996 (yyval.String) = (yyvsp[-1].String);
3001 #line 936 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3002 { (yyval.String) = new std::string(); ;}
3006 #line 940 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3007 { (yyval.String) = new std::string(); ;}
3011 #line 941 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3013 (yyvsp[-1].String)->insert(0, ", ");
3014 if (!(yyvsp[0].String)->empty())
3015 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3016 delete (yyvsp[0].String);
3017 (yyval.String) = (yyvsp[-1].String);
3022 #line 951 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3024 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3025 delete (yyvsp[0].String);
3026 (yyval.String) = (yyvsp[-1].String);
3031 #line 973 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3033 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), OpaqueTy);
3038 #line 976 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3040 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UnresolvedTy);
3045 #line 979 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3047 (yyval.Type) = (yyvsp[0].Type);
3052 #line 982 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3053 { // Type UpReference
3054 (yyvsp[0].String)->insert(0, "\\");
3055 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UpRefTy);
3060 #line 986 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3061 { // Function derived type?
3062 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
3063 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3066 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
3069 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3072 (yyval.Type) = TypeInfo::get(newTy, (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
3077 #line 999 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3078 { // Sized array type?
3079 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3080 (yyvsp[-3].String)->insert(0,"[ ");
3081 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
3082 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
3087 #line 1005 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3088 { // Packed array type?
3089 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3090 (yyvsp[-3].String)->insert(0,"< ");
3091 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
3092 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
3097 #line 1011 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3098 { // Structure type?
3099 std::string newTy("{");
3100 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3103 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3106 (yyval.Type) = TypeInfo::get(newTy, StructTy, (yyvsp[-1].TypeVec));
3111 #line 1021 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3112 { // Empty structure type?
3113 (yyval.Type) = TypeInfo::get("{}", StructTy, new TypeList());
3118 #line 1024 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3119 { // Packed Structure type?
3120 std::string newTy("<{");
3121 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
3124 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
3127 (yyval.Type) = TypeInfo::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
3132 #line 1034 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3133 { // Empty packed structure type?
3134 (yyval.Type) = TypeInfo::get("<{}>", PackedStructTy, new TypeList());
3139 #line 1037 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3141 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
3146 #line 1045 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3148 (yyval.TypeVec) = new TypeList();
3149 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3154 #line 1049 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3156 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3157 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3162 #line 1057 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3164 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3165 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3166 delete (yyvsp[0].String);
3171 #line 1062 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3173 (yyval.TypeVec) = new TypeList();
3174 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3175 delete (yyvsp[0].String);
3180 #line 1067 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3182 (yyval.TypeVec) = new TypeList();
3187 #line 1077 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3188 { // Nonempty unsized arr
3189 (yyval.Const).type = (yyvsp[-3].Type);
3190 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3191 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
3192 delete (yyvsp[-1].String);
3197 #line 1083 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3199 (yyval.Const).type = (yyvsp[-2].Type);
3200 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3201 *(yyval.Const).cnst += "[ ]";
3206 #line 1088 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3208 (yyval.Const).type = (yyvsp[-2].Type);
3209 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3210 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
3211 delete (yyvsp[0].String);
3216 #line 1094 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3217 { // Nonempty unsized arr
3218 (yyval.Const).type = (yyvsp[-3].Type);
3219 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3220 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
3221 delete (yyvsp[-1].String);
3226 #line 1100 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3228 (yyval.Const).type = (yyvsp[-3].Type);
3229 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3230 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
3231 delete (yyvsp[-1].String);
3236 #line 1106 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3238 (yyval.Const).type = (yyvsp[-2].Type);
3239 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3240 *(yyval.Const).cnst += " {}";
3245 #line 1111 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3247 (yyval.Const).type = (yyvsp[-1].Type);
3248 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3249 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3250 delete (yyvsp[0].String);
3255 #line 1117 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3257 (yyval.Const).type = (yyvsp[-1].Type);
3258 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3259 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3260 delete (yyvsp[0].String);
3265 #line 1123 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3267 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve(), true);
3268 (yyval.Const).type = (yyvsp[-1].Type);
3269 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3270 *(yyval.Const).cnst += " " + Name;
3271 delete (yyvsp[0].String);
3276 #line 1130 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
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 1136 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3288 (yyval.Const).type = (yyvsp[-1].Type);
3289 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3290 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3291 delete (yyvsp[0].String);
3296 #line 1142 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3297 { // integral constants
3298 (yyval.Const).type = (yyvsp[-1].Type);
3299 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3300 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3301 delete (yyvsp[0].String);
3306 #line 1148 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3307 { // integral constants
3308 (yyval.Const).type = (yyvsp[-1].Type);
3309 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3310 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3311 delete (yyvsp[0].String);
3316 #line 1154 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3317 { // Boolean constants
3318 (yyval.Const).type = (yyvsp[-1].Type);
3319 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3320 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3321 delete (yyvsp[0].String);
3326 #line 1160 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3327 { // Boolean constants
3328 (yyval.Const).type = (yyvsp[-1].Type);
3329 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3330 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3331 delete (yyvsp[0].String);
3336 #line 1166 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3337 { // Float & Double constants
3338 (yyval.Const).type = (yyvsp[-1].Type);
3339 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3340 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3341 delete (yyvsp[0].String);
3346 #line 1174 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3348 std::string source = *(yyvsp[-3].Const).cnst;
3349 const TypeInfo* SrcTy = (yyvsp[-3].Const).type->resolve();
3350 const TypeInfo* DstTy = (yyvsp[-1].Type)->resolve();
3351 if (*(yyvsp[-5].String) == "cast") {
3352 // Call getCastUpgrade to upgrade the old cast
3353 (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
3355 // Nothing to upgrade, just create the cast constant expr
3356 (yyval.String) = new std::string(*(yyvsp[-5].String));
3357 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
3359 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String);
3364 #line 1188 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3366 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
3367 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3368 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3369 *(yyvsp[-4].String) += ", " + *VI.val;
3372 *(yyvsp[-4].String) += ")";
3373 (yyval.String) = (yyvsp[-4].String);
3374 (yyvsp[-2].Const).destroy();
3375 delete (yyvsp[-1].ValList);
3380 #line 1200 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3382 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3383 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3384 (yyval.String) = (yyvsp[-7].String);
3389 #line 1205 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3391 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3392 (yyval.String) = new std::string(op);
3393 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3394 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3399 #line 1211 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3401 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3402 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3403 (yyval.String) = (yyvsp[-5].String);
3408 #line 1216 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3410 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3411 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3412 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3413 (yyval.String) = (yyvsp[-5].String);
3418 #line 1222 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3420 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3421 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3422 (yyval.String) = (yyvsp[-6].String);
3427 #line 1227 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3429 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3430 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3431 (yyval.String) = (yyvsp[-6].String);
3436 #line 1232 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3438 const char* shiftop = (yyvsp[-5].String)->c_str();
3439 if (*(yyvsp[-5].String) == "shr")
3440 shiftop = ((yyvsp[-3].Const).type->isUnsigned()) ? "lshr" : "ashr";
3441 (yyval.String) = new std::string(shiftop);
3442 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3443 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3448 #line 1240 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3450 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3451 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3452 (yyval.String) = (yyvsp[-5].String);
3457 #line 1245 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3459 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3460 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3461 (yyval.String) = (yyvsp[-7].String);
3466 #line 1250 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3468 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3469 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3470 (yyval.String) = (yyvsp[-7].String);
3475 #line 1260 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3477 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
3478 (yyvsp[0].Const).destroy();
3479 (yyval.String) = (yyvsp[-2].String);
3484 #line 1265 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3485 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
3489 #line 1280 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3495 #line 1285 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3502 #line 1288 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3504 *O << *(yyvsp[0].String) << '\n';
3505 delete (yyvsp[0].String);
3511 #line 1293 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3513 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3519 #line 1297 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3521 *O << "implementation\n";
3527 #line 1301 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3528 { (yyval.String) = 0; ;}
3532 #line 1303 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3533 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3537 #line 1306 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3539 EnumeratedTypes.push_back((yyvsp[0].Type));
3540 if (!(yyvsp[-2].String)->empty()) {
3541 NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Type);
3542 *O << *(yyvsp[-2].String) << " = ";
3544 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3545 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
3551 #line 1316 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3552 { // Function prototypes can be in const pool
3553 *O << *(yyvsp[0].String) << '\n';
3554 delete (yyvsp[0].String);
3560 #line 1321 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3561 { // Asm blocks can be in the const pool
3562 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3563 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3569 #line 1326 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3571 if (!(yyvsp[-4].String)->empty()) {
3572 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const).type->getPointerType(),
3573 *(yyvsp[-2].String) == "constant");
3574 *O << Name << " = ";
3576 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
3577 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3583 #line 1336 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3585 if (!(yyvsp[-4].String)->empty()) {
3586 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3587 *(yyvsp[-2].String) == "constant");
3588 *O << Name << " = ";
3590 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3591 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3597 #line 1346 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3599 if (!(yyvsp[-4].String)->empty()) {
3600 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3601 *(yyvsp[-2].String) == "constant");
3602 *O << Name << " = ";
3604 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3605 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3611 #line 1356 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3613 if (!(yyvsp[-4].String)->empty()) {
3614 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3615 *(yyvsp[-2].String) == "constant");
3616 *O << Name << " = ";
3618 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3619 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3625 #line 1366 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3627 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3628 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3634 #line 1371 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3636 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3637 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3643 #line 1376 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3650 #line 1386 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3652 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3653 delete (yyvsp[0].String);
3654 (yyval.String) = (yyvsp[-2].String);
3659 #line 1391 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3661 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3662 if (*(yyvsp[0].String) == "64")
3664 delete (yyvsp[0].String);
3665 (yyval.String) = (yyvsp[-2].String);
3670 #line 1398 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3672 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3673 delete (yyvsp[0].String);
3674 (yyval.String) = (yyvsp[-2].String);
3679 #line 1403 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3681 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3682 delete (yyvsp[0].String);
3683 (yyval.String) = (yyvsp[-2].String);
3688 #line 1410 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3690 (yyvsp[-1].String)->insert(0, "[ ");
3691 *(yyvsp[-1].String) += " ]";
3692 (yyval.String) = (yyvsp[-1].String);
3697 #line 1417 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3699 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3700 delete (yyvsp[0].String);
3701 (yyval.String) = (yyvsp[-2].String);
3706 #line 1423 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3708 (yyval.String) = new std::string();
3713 #line 1432 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3714 { (yyval.String) = new std::string(); ;}
3718 #line 1434 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3720 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3721 if (!(yyvsp[0].String)->empty()) {
3722 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve());
3723 *(yyval.String) += " " + Name;
3725 delete (yyvsp[0].String);
3730 #line 1443 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3732 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3733 delete (yyvsp[0].String);
3738 #line 1447 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3740 (yyval.String) = (yyvsp[0].String);
3745 #line 1451 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3747 (yyval.String) = (yyvsp[0].String);
3752 #line 1454 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3754 *(yyvsp[-2].String) += ", ...";
3755 (yyval.String) = (yyvsp[-2].String);
3756 delete (yyvsp[0].String);
3761 #line 1459 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3763 (yyval.String) = (yyvsp[0].String);
3768 #line 1462 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3769 { (yyval.String) = new std::string(); ;}
3773 #line 1465 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3775 if (!(yyvsp[-7].String)->empty()) {
3776 *(yyvsp[-7].String) += " ";
3778 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3779 if (!(yyvsp[-1].String)->empty()) {
3780 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3782 if (!(yyvsp[0].String)->empty()) {
3783 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3785 delete (yyvsp[-5].String);
3786 delete (yyvsp[-3].String);
3787 delete (yyvsp[-1].String);
3788 delete (yyvsp[0].String);
3789 (yyval.String) = (yyvsp[-7].String);
3794 #line 1483 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3795 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3799 #line 1484 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3800 { (yyval.String) = new std::string ("{"); ;}
3804 #line 1487 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3807 if (!(yyvsp[-2].String)->empty()) {
3808 *O << *(yyvsp[-2].String) << ' ';
3810 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3811 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3817 #line 1498 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3818 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3822 #line 1499 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3823 { (yyval.String) = new std::string("}"); ;}
3827 #line 1501 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3829 if ((yyvsp[-1].String))
3830 *O << *(yyvsp[-1].String);
3831 *O << *(yyvsp[0].String) << "\n\n";
3832 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3838 #line 1510 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3839 { (yyval.String) = new std::string(); ;}
3843 #line 1516 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3845 if (!(yyvsp[-1].String)->empty())
3846 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3847 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3848 delete (yyvsp[-1].String);
3849 delete (yyvsp[0].String);
3850 (yyval.String) = (yyvsp[-2].String);
3855 #line 1529 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3856 { (yyval.String) = new std::string(); ;}
3860 #line 1535 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3862 (yyvsp[-1].String)->insert(0, "<");
3863 *(yyvsp[-1].String) += ">";
3864 (yyval.String) = (yyvsp[-1].String);
3869 #line 1541 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3871 if (!(yyvsp[-3].String)->empty()) {
3872 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3874 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3875 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3876 (yyval.String) = (yyvsp[-4].String);
3881 #line 1554 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3883 (yyval.Value).val = (yyvsp[0].String);
3884 (yyval.Value).constant = false;
3885 (yyval.Value).type = 0;
3890 #line 1559 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3892 (yyval.Value).val = (yyvsp[0].String);
3893 (yyval.Value).constant = true;
3894 (yyval.Value).type = 0;
3899 #line 1569 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3901 (yyvsp[-1].Type) = (yyvsp[-1].Type)->resolve();
3902 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
3903 (yyval.Value) = (yyvsp[0].Value);
3904 delete (yyval.Value).val;
3905 (yyval.Value).val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
3906 (yyval.Value).type = (yyvsp[-1].Type);
3911 #line 1578 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3918 #line 1581 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3919 { // Do not allow functions with 0 basic blocks
3925 #line 1589 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3932 #line 1593 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3934 *O << " " << *(yyvsp[0].String) << '\n';
3935 delete (yyvsp[0].String);
3941 #line 1598 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3948 #line 1601 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3950 *O << *(yyvsp[0].String) << '\n';
3951 delete (yyvsp[0].String);
3957 #line 1607 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3958 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3962 #line 1609 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3963 { // Return with a result...
3964 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3965 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3971 #line 1614 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3972 { // Return with no result...
3973 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
3974 delete (yyvsp[-1].String);
3980 #line 1619 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3981 { // Unconditional Branch...
3982 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3983 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
3989 #line 1624 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
3991 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3992 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3993 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
3994 << *(yyvsp[0].Value).val << '\n';
3995 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4001 #line 1632 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4003 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
4004 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4005 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
4006 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy();
4007 delete (yyvsp[-1].String);
4013 #line 1640 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4015 std::string Name = getUniqueName((yyvsp[-5].Value).val, (yyvsp[-6].Type));
4016 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
4017 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value).val << "[]\n";
4018 delete (yyvsp[-7].String); (yyvsp[-5].Value).destroy(); (yyvsp[-2].Value).destroy();
4024 #line 1648 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4026 const TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
4028 if (!(yyvsp[-13].String)->empty()) {
4029 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
4030 *O << Name << " = ";
4032 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value).val << " (";
4033 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
4034 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
4036 if (i+1 < (yyvsp[-7].ValList)->size())
4040 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ' '
4041 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
4042 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
4043 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4049 #line 1669 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4051 *O << " " << *(yyvsp[0].String) << '\n';
4052 delete (yyvsp[0].String);
4058 #line 1674 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4060 *O << " " << *(yyvsp[0].String) << '\n';
4061 delete (yyvsp[0].String);
4067 #line 1680 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4069 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
4070 *(yyvsp[0].Value).val;
4071 delete (yyvsp[-3].String); (yyvsp[0].Value).destroy();
4072 (yyval.String) = (yyvsp[-5].String);
4077 #line 1686 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4079 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
4080 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value).val;
4081 (yyvsp[0].Value).destroy();
4082 (yyval.String) = (yyvsp[-3].String);
4087 #line 1694 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4089 if (!(yyvsp[-1].String)->empty()) {
4090 // Get a unique name for this value, based on its type.
4091 std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value).type);
4092 *(yyvsp[-1].String) = Name + " = ";
4093 if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
4094 // don't actually delete it, just comment it out
4095 (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
4096 delete deleteUselessCastName;
4099 *(yyvsp[-1].String) += *(yyvsp[0].Value).val;
4100 (yyvsp[0].Value).destroy();
4101 deleteUselessCastFlag = false;
4102 (yyval.String) = (yyvsp[-1].String);
4107 #line 1712 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4108 { // Used for PHI nodes
4109 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-5].Type));
4110 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
4111 Name += "," + *(yyvsp[-1].Value).val + "]";
4112 (yyval.Value).val = new std::string(Name);
4113 (yyval.Value).type = (yyvsp[-5].Type);
4114 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4119 #line 1720 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4121 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-6].Value).type);
4122 *(yyvsp[-6].Value).val += ", [" + Name + "," + *(yyvsp[-1].Value).val + "]";
4123 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4124 (yyval.Value) = (yyvsp[-6].Value);
4129 #line 1729 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4131 (yyval.ValList) = new ValueList();
4132 (yyval.ValList)->push_back((yyvsp[0].Value));
4137 #line 1733 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4139 (yyval.ValList) = (yyvsp[-2].ValList);
4140 (yyval.ValList)->push_back((yyvsp[0].Value));
4145 #line 1740 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4146 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4150 #line 1741 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4151 { (yyval.ValList) = new ValueList(); ;}
4155 #line 1745 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4157 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
4158 delete (yyvsp[0].String);
4159 (yyval.String) = (yyvsp[-1].String);
4164 #line 1753 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4166 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
4167 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4168 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4169 (yyval.Value).val = new std::string(op);
4170 *(yyval.Value).val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4171 (yyval.Value).type = (yyvsp[-3].Type);
4172 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4177 #line 1762 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4179 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4180 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4181 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4182 (yyval.Value).val = (yyvsp[-4].String);
4183 (yyval.Value).type = (yyvsp[-3].Type);
4184 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4189 #line 1770 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4191 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4192 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4193 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
4194 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4195 (yyval.Value).val = (yyvsp[-4].String);
4196 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4197 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4202 #line 1779 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4204 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4205 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4206 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4207 (yyval.Value).val = (yyvsp[-5].String);
4208 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4209 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4214 #line 1787 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4216 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4217 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4218 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4219 (yyval.Value).val = (yyvsp[-5].String);
4220 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4221 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4226 #line 1795 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4228 (yyval.Value) = (yyvsp[0].Value);
4229 (yyval.Value).val->insert(0, *(yyvsp[-1].String) + " ");
4230 delete (yyvsp[-1].String);
4235 #line 1800 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4237 const char* shiftop = (yyvsp[-3].String)->c_str();
4238 if (*(yyvsp[-3].String) == "shr")
4239 shiftop = ((yyvsp[-2].Value).type->isUnsigned()) ? "lshr" : "ashr";
4240 (yyval.Value).val = new std::string(shiftop);
4241 *(yyval.Value).val += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4242 (yyval.Value).type = (yyvsp[-2].Value).type;
4243 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4248 #line 1809 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4250 std::string source = *(yyvsp[-2].Value).val;
4251 const TypeInfo* SrcTy = (yyvsp[-2].Value).type->resolve();
4252 const TypeInfo* DstTy = (yyvsp[0].Type)->resolve();
4253 (yyval.Value).val = new std::string();
4254 (yyval.Value).type = DstTy;
4255 if (*(yyvsp[-3].String) == "cast") {
4256 *(yyval.Value).val += getCastUpgrade(source, SrcTy, DstTy, false);
4258 *(yyval.Value).val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
4260 // Check to see if this is a useless cast of a value to the same name
4261 // and the same type. Such casts will probably cause redefinition errors
4262 // when assembled and perform no code gen action so just remove them.
4263 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
4264 if (SrcTy->isInteger() && DstTy->isInteger() &&
4265 SrcTy->getBitWidth() == DstTy->getBitWidth()) {
4266 deleteUselessCastFlag = true; // Flag the "Inst" rule
4267 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
4268 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
4269 if (pos != std::string::npos) {
4270 // remove the type portion before val
4271 deleteUselessCastName->erase(0, pos);
4274 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
4275 delete (yyvsp[-1].String);
4280 #line 1837 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4282 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4283 (yyval.Value).val = (yyvsp[-5].String);
4284 (yyval.Value).type = (yyvsp[-2].Value).type;
4285 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4290 #line 1843 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4292 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + (yyvsp[0].Type)->getNewTy();
4293 (yyval.Value).val = (yyvsp[-3].String);
4294 (yyval.Value).type = (yyvsp[0].Type);
4295 (yyvsp[-2].Value).destroy();
4300 #line 1849 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4302 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4303 (yyval.Value).val = (yyvsp[-3].String);
4304 (yyvsp[-2].Value).type = (yyvsp[-2].Value).type->resolve();;
4305 (yyval.Value).type = (yyvsp[-2].Value).type->getElementType();
4306 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4311 #line 1856 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4313 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4314 (yyval.Value).val = (yyvsp[-5].String);
4315 (yyval.Value).type = (yyvsp[-4].Value).type;
4316 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4321 #line 1862 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4323 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4324 (yyval.Value).val = (yyvsp[-5].String);
4325 (yyval.Value).type = (yyvsp[-4].Value).type;
4326 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4331 #line 1868 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4333 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4334 (yyval.Value).val = (yyvsp[-1].String);
4335 (yyval.Value).type = (yyvsp[0].Value).type;
4336 delete (yyvsp[0].Value).val;
4341 #line 1874 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4343 // map llvm.isunordered to "fcmp uno"
4344 if (*(yyvsp[-3].Value).val == "%llvm.isunordered.f32" ||
4345 *(yyvsp[-3].Value).val == "%llvm.isunordered.f64") {
4346 (yyval.Value).val = new std::string( "fcmp uno " + *(*(yyvsp[-1].ValList))[0].val + ", ");
4347 size_t pos = (*(yyvsp[-1].ValList))[1].val->find(' ');
4348 assert(pos != std::string::npos && "no space?");
4349 *(yyval.Value).val += (*(yyvsp[-1].ValList))[1].val->substr(pos+1);
4350 (yyval.Value).type = TypeInfo::get("bool", BoolTy);
4352 if (!(yyvsp[-5].String)->empty())
4353 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
4354 if (!(yyvsp[-6].String)->empty())
4355 *(yyvsp[-6].String) += " ";
4356 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value).val + "(";
4357 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
4358 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
4359 *(yyvsp[-6].String) += *VI.val;
4360 if (i+1 < (yyvsp[-1].ValList)->size())
4361 *(yyvsp[-6].String) += ", ";
4364 *(yyvsp[-6].String) += ")";
4365 (yyval.Value).val = (yyvsp[-6].String);
4366 (yyval.Value).type = getFunctionReturnType((yyvsp[-4].Type));
4368 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
4373 #line 1907 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4374 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4378 #line 1908 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4379 { (yyval.ValList) = new ValueList(); ;}
4383 #line 1913 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4384 { (yyval.String) = new std::string(); ;}
4388 #line 1916 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4390 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4391 if (!(yyvsp[0].String)->empty())
4392 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4393 (yyval.Value).val = (yyvsp[-2].String);
4394 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4395 delete (yyvsp[0].String);
4400 #line 1924 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4402 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4403 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4404 if (!(yyvsp[0].String)->empty())
4405 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4406 (yyval.Value).val = (yyvsp[-5].String);
4407 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4408 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4413 #line 1933 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4415 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4416 if (!(yyvsp[0].String)->empty())
4417 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4418 (yyval.Value).val = (yyvsp[-2].String);
4419 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4420 delete (yyvsp[0].String);
4425 #line 1941 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4427 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4428 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4429 if (!(yyvsp[0].String)->empty())
4430 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4431 (yyval.Value).val = (yyvsp[-5].String);
4432 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4433 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4438 #line 1950 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4440 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4441 (yyval.Value).val = (yyvsp[-1].String);
4442 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4443 (yyvsp[0].Value).destroy();
4448 #line 1956 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4450 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4451 if (!(yyvsp[-3].String)->empty())
4452 *(yyvsp[-3].String) += " ";
4453 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4454 (yyval.Value).val = (yyvsp[-3].String);
4455 (yyval.Value).type = (yyvsp[-1].Type)->getElementType();
4456 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4461 #line 1965 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4463 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4464 if (!(yyvsp[-5].String)->empty())
4465 *(yyvsp[-5].String) += " ";
4466 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4467 (yyval.Value).val = (yyvsp[-5].String);
4468 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4469 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4474 #line 1974 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4476 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4477 // Upgrade the indices
4478 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4479 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4480 if (VI.type->isUnsigned() && !VI.isConstant() &&
4481 VI.type->getBitWidth() < 64) {
4482 *O << " %gep_upgrade" << unique << " = zext " << *VI.val
4484 *VI.val = "i64 %gep_upgrade" + llvm::utostr(unique++);
4485 VI.type = TypeInfo::get("i64",ULongTy);
4488 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4489 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4490 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4491 *(yyvsp[-3].String) += ", " + *VI.val;
4493 (yyval.Value).val = (yyvsp[-3].String);
4494 (yyval.Value).type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4495 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
4503 /* Line 1126 of yacc.c. */
4504 #line 4505 "UpgradeParser.tab.c"
4510 YY_STACK_PRINT (yyss, yyssp);
4515 /* Now `shift' the result of the reduction. Determine what state
4516 that goes to, based on the state we popped back to and the rule
4517 number reduced by. */
4521 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4522 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4523 yystate = yytable[yystate];
4525 yystate = yydefgoto[yyn - YYNTOKENS];
4530 /*------------------------------------.
4531 | yyerrlab -- here on detecting error |
4532 `------------------------------------*/
4534 /* If not already recovering from an error, report this error. */
4539 yyn = yypact[yystate];
4541 if (YYPACT_NINF < yyn && yyn < YYLAST)
4543 int yytype = YYTRANSLATE (yychar);
4544 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4545 YYSIZE_T yysize = yysize0;
4547 int yysize_overflow = 0;
4549 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4550 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4554 /* This is so xgettext sees the translatable formats that are
4555 constructed on the fly. */
4556 YY_("syntax error, unexpected %s");
4557 YY_("syntax error, unexpected %s, expecting %s");
4558 YY_("syntax error, unexpected %s, expecting %s or %s");
4559 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4560 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4564 static char const yyunexpected[] = "syntax error, unexpected %s";
4565 static char const yyexpecting[] = ", expecting %s";
4566 static char const yyor[] = " or %s";
4567 char yyformat[sizeof yyunexpected
4568 + sizeof yyexpecting - 1
4569 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4570 * (sizeof yyor - 1))];
4571 char const *yyprefix = yyexpecting;
4573 /* Start YYX at -YYN if negative to avoid negative indexes in
4575 int yyxbegin = yyn < 0 ? -yyn : 0;
4577 /* Stay within bounds of both yycheck and yytname. */
4578 int yychecklim = YYLAST - yyn;
4579 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4582 yyarg[0] = yytname[yytype];
4583 yyfmt = yystpcpy (yyformat, yyunexpected);
4585 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4586 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4588 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4592 yyformat[sizeof yyunexpected - 1] = '\0';
4595 yyarg[yycount++] = yytname[yyx];
4596 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4597 yysize_overflow |= yysize1 < yysize;
4599 yyfmt = yystpcpy (yyfmt, yyprefix);
4603 yyf = YY_(yyformat);
4604 yysize1 = yysize + yystrlen (yyf);
4605 yysize_overflow |= yysize1 < yysize;
4608 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4609 yymsg = (char *) YYSTACK_ALLOC (yysize);
4612 /* Avoid sprintf, as that infringes on the user's name space.
4613 Don't have undefined behavior even if the translation
4614 produced a string with the wrong number of "%s"s. */
4617 while ((*yyp = *yyf))
4619 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4621 yyp += yytnamerr (yyp, yyarg[yyi++]);
4631 YYSTACK_FREE (yymsg);
4635 yyerror (YY_("syntax error"));
4636 goto yyexhaustedlab;
4640 #endif /* YYERROR_VERBOSE */
4641 yyerror (YY_("syntax error"));
4646 if (yyerrstatus == 3)
4648 /* If just tried and failed to reuse look-ahead token after an
4649 error, discard it. */
4651 if (yychar <= YYEOF)
4653 /* Return failure if at end of input. */
4654 if (yychar == YYEOF)
4659 yydestruct ("Error: discarding", yytoken, &yylval);
4664 /* Else will try to reuse look-ahead token after shifting the error
4669 /*---------------------------------------------------.
4670 | yyerrorlab -- error raised explicitly by YYERROR. |
4671 `---------------------------------------------------*/
4674 /* Pacify compilers like GCC when the user code never invokes
4675 YYERROR and the label yyerrorlab therefore never appears in user
4686 /*-------------------------------------------------------------.
4687 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4688 `-------------------------------------------------------------*/
4690 yyerrstatus = 3; /* Each real token shifted decrements this. */
4694 yyn = yypact[yystate];
4695 if (yyn != YYPACT_NINF)
4698 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4706 /* Pop the current state because it cannot handle the error token. */
4711 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4714 YY_STACK_PRINT (yyss, yyssp);
4723 /* Shift the error token. */
4724 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4730 /*-------------------------------------.
4731 | yyacceptlab -- YYACCEPT comes here. |
4732 `-------------------------------------*/
4737 /*-----------------------------------.
4738 | yyabortlab -- YYABORT comes here. |
4739 `-----------------------------------*/
4745 /*-------------------------------------------------.
4746 | yyexhaustedlab -- memory exhaustion comes here. |
4747 `-------------------------------------------------*/
4749 yyerror (YY_("memory exhausted"));
4755 if (yychar != YYEOF && yychar != YYEMPTY)
4756 yydestruct ("Cleanup: discarding lookahead",
4758 while (yyssp != yyss)
4760 yydestruct ("Cleanup: popping",
4761 yystos[*yyssp], yyvsp);
4766 YYSTACK_FREE (yyss);
4772 #line 1997 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y"
4775 int yyerror(const char *ErrorMsg) {
4777 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4778 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4779 std::string errMsg = where + "error: " + std::string(ErrorMsg) +
4781 if (yychar == YYEMPTY || yychar == 0)
4782 errMsg += "end-of-file.";
4784 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4785 std::cerr << "llvm-upgrade: " << errMsg << '\n';
4786 *O << "llvm-upgrade parse failed.\n";
4790 static void warning(const std::string& ErrorMsg) {
4792 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4793 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4794 std::string errMsg = where + "warning: " + std::string(ErrorMsg) +
4796 if (yychar == YYEMPTY || yychar == 0)
4797 errMsg += "end-of-file.";
4799 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4800 std::cerr << "llvm-upgrade: " << errMsg << '\n';