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-4/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-4/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 300
1358 /* YYNRULES -- Number of states. */
1359 #define YYNSTATES 584
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 840, 845, 852, 857, 862, 869, 876, 879, 887, 889,
1448 892, 893, 895, 896, 900, 907, 911, 918, 921, 926,
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, 173, 224, 152, 224, -1,
1539 174, 224, 39, 190, -1, 129, 224, 152, 224, 152,
1540 224, -1, 134, 224, 152, 190, -1, 135, 224, 152,
1541 224, -1, 136, 224, 152, 224, 152, 224, -1, 137,
1542 224, 152, 224, 152, 224, -1, 128, 232, -1, 235,
1543 181, 188, 223, 154, 234, 155, -1, 239, -1, 152,
1544 233, -1, -1, 38, -1, -1, 122, 190, 183, -1,
1545 122, 190, 152, 10, 223, 183, -1, 123, 190, 183,
1546 -1, 123, 190, 152, 10, 223, 183, -1, 124, 224,
1547 -1, 238, 125, 190, 223, -1, 238, 126, 224, 152,
1548 190, 223, -1, 127, 190, 223, 237, -1
1551 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1552 static const unsigned short int yyrline[] =
1554 0, 867, 867, 867, 868, 868, 872, 872, 872, 872,
1555 872, 872, 872, 873, 873, 873, 873, 874, 874, 874,
1556 875, 875, 875, 875, 875, 875, 876, 876, 876, 876,
1557 876, 876, 876, 876, 876, 876, 877, 877, 877, 877,
1558 877, 877, 877, 877, 877, 877, 878, 878, 878, 878,
1559 878, 878, 879, 879, 879, 879, 880, 880, 880, 880,
1560 880, 880, 880, 881, 881, 881, 881, 881, 881, 886,
1561 886, 886, 886, 887, 887, 887, 887, 888, 888, 889,
1562 889, 892, 895, 900, 900, 900, 900, 900, 900, 901,
1563 902, 905, 905, 905, 905, 905, 906, 907, 912, 917,
1564 918, 921, 922, 930, 936, 937, 940, 941, 950, 951,
1565 964, 964, 965, 965, 966, 970, 970, 970, 970, 970,
1566 970, 970, 971, 971, 971, 971, 971, 973, 976, 979,
1567 982, 986, 999, 1005, 1011, 1021, 1024, 1034, 1037, 1045,
1568 1049, 1056, 1057, 1062, 1067, 1077, 1083, 1088, 1094, 1100,
1569 1106, 1111, 1117, 1123, 1130, 1136, 1142, 1148, 1154, 1160,
1570 1166, 1174, 1188, 1200, 1205, 1211, 1216, 1222, 1227, 1232,
1571 1240, 1245, 1250, 1260, 1265, 1270, 1270, 1280, 1285, 1288,
1572 1293, 1297, 1301, 1303, 1303, 1306, 1316, 1321, 1326, 1336,
1573 1346, 1356, 1366, 1371, 1376, 1381, 1383, 1383, 1386, 1391,
1574 1398, 1403, 1410, 1417, 1422, 1423, 1431, 1431, 1432, 1432,
1575 1434, 1443, 1447, 1451, 1454, 1459, 1462, 1465, 1483, 1484,
1576 1487, 1498, 1499, 1501, 1510, 1511, 1512, 1516, 1529, 1530,
1577 1533, 1533, 1533, 1533, 1533, 1533, 1533, 1534, 1535, 1540,
1578 1541, 1550, 1550, 1554, 1559, 1569, 1578, 1581, 1589, 1593,
1579 1598, 1601, 1607, 1607, 1609, 1614, 1619, 1624, 1632, 1640,
1580 1647, 1669, 1674, 1680, 1686, 1694, 1712, 1720, 1729, 1733,
1581 1740, 1741, 1745, 1750, 1753, 1762, 1770, 1779, 1787, 1795,
1582 1804, 1832, 1838, 1844, 1851, 1857, 1863, 1869, 1897, 1902,
1583 1903, 1907, 1908, 1911, 1919, 1928, 1936, 1945, 1951, 1960,
1588 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1589 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1590 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1591 static const char *const yytname[] =
1593 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1594 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1595 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1596 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1597 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1598 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1599 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1600 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
1601 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1602 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1603 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1604 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1605 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1606 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1607 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1608 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1609 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1610 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1611 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1612 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1613 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1614 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1615 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1616 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1617 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1618 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1619 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1620 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1621 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1622 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1623 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1624 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1625 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1626 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1627 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1628 "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock",
1629 "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst",
1630 "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal",
1631 "IndexList", "OptVolatile", "MemoryInst", 0
1636 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1638 static const unsigned short int yytoknum[] =
1640 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1641 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1642 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1643 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1644 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1645 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1646 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1647 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1648 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1649 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1650 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1651 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1652 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1653 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1654 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1655 405, 61, 44, 92, 40, 41, 91, 120, 93, 60,
1656 62, 123, 125, 42, 99
1660 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1661 static const unsigned char yyr1[] =
1663 0, 165, 166, 166, 167, 167, 168, 168, 168, 168,
1664 168, 168, 168, 168, 168, 168, 168, 169, 169, 169,
1665 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1666 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
1667 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1668 172, 172, 173, 173, 173, 173, 174, 174, 174, 174,
1669 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1670 175, 175, 175, 176, 176, 176, 176, 177, 177, 178,
1671 178, 179, 179, 180, 180, 180, 180, 180, 180, 180,
1672 180, 181, 181, 181, 181, 181, 181, 181, 181, 182,
1673 182, 183, 183, 184, 185, 185, 186, 186, 187, 187,
1674 188, 188, 189, 189, 190, 191, 191, 191, 191, 191,
1675 191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
1676 192, 192, 192, 192, 192, 192, 192, 192, 192, 193,
1677 193, 194, 194, 194, 194, 195, 195, 195, 195, 195,
1678 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1679 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1680 196, 196, 196, 197, 197, 198, 198, 199, 200, 200,
1681 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1682 202, 202, 202, 202, 202, 203, 204, 204, 205, 205,
1683 205, 205, 206, 207, 207, 207, 208, 208, 209, 209,
1684 210, 211, 211, 212, 212, 212, 212, 213, 214, 214,
1685 215, 216, 216, 217, 218, 218, 218, 219, 220, 220,
1686 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1687 221, 222, 222, 223, 223, 224, 225, 225, 226, 227,
1688 227, 227, 228, 228, 229, 229, 229, 229, 229, 229,
1689 229, 229, 229, 230, 230, 231, 232, 232, 233, 233,
1690 234, 234, 235, 235, 236, 236, 236, 236, 236, 236,
1691 236, 236, 236, 236, 236, 236, 236, 236, 236, 237,
1692 237, 238, 238, 239, 239, 239, 239, 239, 239, 239,
1696 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1697 static const unsigned char yyr2[] =
1699 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1700 1, 1, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1708 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1709 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1710 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1711 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1712 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1713 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1714 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1715 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1716 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1717 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1718 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1719 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1720 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1721 3, 1, 1, 3, 0, 1, 1, 3, 0, 1,
1722 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1723 5, 1, 1, 1, 1, 2, 2, 1, 2, 2,
1724 0, 1, 1, 1, 2, 2, 3, 9, 9, 8,
1725 14, 1, 1, 6, 5, 2, 6, 7, 1, 3,
1726 1, 0, 2, 1, 5, 5, 5, 6, 6, 4,
1727 4, 6, 4, 4, 6, 6, 2, 7, 1, 2,
1728 0, 1, 0, 3, 6, 3, 6, 2, 4, 6,
1732 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1733 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1734 means the default is an error. */
1735 static const unsigned short int yydefact[] =
1737 194, 0, 90, 182, 1, 181, 224, 83, 84, 85,
1738 87, 88, 89, 86, 0, 98, 250, 178, 179, 206,
1739 207, 0, 0, 0, 90, 0, 186, 225, 226, 98,
1740 0, 0, 91, 92, 93, 94, 95, 96, 0, 0,
1741 251, 250, 247, 82, 0, 0, 0, 0, 192, 0,
1742 0, 0, 0, 0, 183, 184, 0, 0, 81, 227,
1743 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1744 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1745 0, 0, 0, 241, 0, 0, 110, 129, 114, 242,
1746 128, 218, 219, 220, 221, 222, 223, 246, 0, 0,
1747 0, 253, 252, 262, 292, 261, 248, 249, 0, 0,
1748 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1749 0, 0, 130, 0, 0, 0, 113, 135, 139, 0,
1750 0, 144, 138, 255, 0, 254, 0, 0, 72, 76,
1751 71, 75, 70, 74, 69, 73, 77, 78, 0, 291,
1752 273, 0, 98, 6, 7, 8, 9, 10, 11, 12,
1753 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1754 23, 24, 25, 0, 0, 0, 0, 0, 0, 0,
1755 0, 52, 53, 54, 55, 0, 0, 0, 0, 68,
1756 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1757 66, 67, 0, 0, 0, 0, 0, 98, 265, 0,
1758 288, 200, 197, 196, 198, 199, 201, 204, 0, 106,
1759 106, 115, 116, 117, 118, 119, 120, 121, 122, 123,
1760 124, 125, 0, 0, 0, 0, 106, 106, 0, 0,
1761 0, 0, 0, 134, 216, 143, 141, 0, 230, 231,
1762 232, 235, 236, 237, 233, 234, 228, 0, 0, 0,
1763 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1764 239, 244, 243, 245, 0, 256, 0, 272, 0, 26,
1765 27, 28, 29, 30, 31, 32, 33, 34, 35, 0,
1766 50, 51, 36, 37, 38, 39, 40, 41, 42, 43,
1767 44, 45, 46, 47, 48, 49, 0, 101, 101, 297,
1768 0, 0, 286, 0, 0, 0, 0, 0, 0, 0,
1769 0, 0, 0, 0, 0, 0, 0, 202, 0, 190,
1770 191, 158, 159, 4, 5, 156, 157, 160, 151, 152,
1771 155, 0, 0, 0, 0, 154, 153, 188, 189, 112,
1772 112, 137, 0, 140, 215, 209, 212, 213, 0, 0,
1773 131, 229, 0, 0, 0, 0, 0, 0, 0, 0,
1774 174, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1775 0, 0, 0, 293, 0, 295, 290, 0, 0, 0,
1776 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1777 0, 0, 203, 0, 0, 108, 106, 146, 0, 0,
1778 150, 0, 147, 132, 133, 136, 208, 210, 0, 104,
1779 142, 0, 0, 0, 290, 0, 0, 0, 0, 0,
1780 238, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1781 0, 0, 0, 0, 0, 300, 0, 0, 0, 282,
1782 283, 0, 0, 0, 0, 0, 279, 280, 0, 298,
1783 0, 103, 109, 107, 145, 148, 149, 214, 211, 105,
1784 99, 0, 0, 0, 0, 0, 0, 0, 0, 173,
1785 0, 0, 0, 0, 0, 0, 0, 271, 0, 0,
1786 101, 102, 101, 268, 289, 0, 0, 0, 0, 0,
1787 274, 275, 276, 271, 0, 0, 217, 240, 0, 0,
1788 162, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1789 0, 0, 270, 0, 277, 278, 0, 294, 296, 0,
1790 0, 0, 281, 284, 285, 0, 299, 100, 0, 0,
1791 0, 170, 0, 0, 164, 165, 166, 169, 161, 0,
1792 259, 0, 0, 0, 269, 266, 0, 287, 167, 168,
1793 0, 0, 0, 257, 0, 258, 0, 0, 267, 163,
1794 171, 172, 0, 0, 0, 0, 0, 0, 264, 0,
1798 /* YYDEFGOTO[NTERM-NUM]. */
1799 static const short int yydefgoto[] =
1801 -1, 83, 335, 265, 266, 267, 289, 306, 268, 269,
1802 232, 233, 148, 234, 24, 15, 38, 506, 383, 405,
1803 470, 329, 406, 84, 85, 235, 87, 88, 129, 247,
1804 370, 270, 371, 118, 1, 2, 57, 3, 61, 214,
1805 48, 113, 218, 89, 417, 356, 357, 358, 39, 93,
1806 16, 96, 17, 29, 18, 362, 271, 90, 273, 493,
1807 41, 42, 43, 105, 106, 552, 107, 312, 522, 523,
1808 207, 208, 445, 209, 210
1811 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1813 #define YYPACT_NINF -509
1814 static const short int yypact[] =
1816 -509, 53, 152, 539, -509, -509, 46, -509, -509, -509,
1817 -509, -509, -509, -509, 5, 56, 55, -509, -509, -509,
1818 -509, -4, -81, 26, 134, -16, -509, -509, -509, 56,
1819 113, 128, -509, -509, -509, -509, -509, -509, 830, -25,
1820 -509, -18, -509, -1, 11, 40, 42, 54, -509, 33,
1821 113, 830, 96, 96, -509, -509, 96, 96, -509, -509,
1822 -509, -509, -509, 62, -509, -509, -509, -509, -509, -509,
1823 -509, -509, -509, -509, -509, -509, -509, -509, -509, 223,
1824 225, -10, 100, -509, 145, 77, -509, -509, -108, -509,
1825 -509, -509, -509, -509, -509, -509, -509, -509, 869, 41,
1826 148, -509, -509, -509, 1313, -509, -509, -509, 219, 153,
1827 234, 237, 250, -509, -509, -509, -509, -509, 898, 898,
1828 936, 898, -509, 98, 103, 504, -509, -509, -108, -100,
1829 122, 214, -509, 62, 1128, -509, 1128, 1128, -509, -509,
1830 -509, -509, -509, -509, -509, -509, -509, -509, 1128, -509,
1831 -509, 224, 56, -509, -509, -509, -509, -509, -509, -509,
1832 -509, -509, -509, -509, -509, -509, -509, -509, -509, -509,
1833 -509, -509, -509, 193, 535, 898, 898, 898, 898, 898,
1834 898, -509, -509, -509, -509, 898, 898, 898, 898, -509,
1835 -509, -509, -509, -509, -509, -509, -509, -509, -509, -509,
1836 -509, -509, 898, 898, 898, 898, 898, 56, -509, 110,
1837 -509, -509, -509, -509, -509, -509, -509, -509, -57, 138,
1838 138, 213, 228, 230, 240, 246, 248, 252, 254, 261,
1839 271, 281, 265, 265, 285, 980, 138, 138, 898, 898,
1840 150, -87, 898, -509, 671, -509, 156, 163, -509, -509,
1841 -509, -509, -509, -509, -509, -509, 255, 193, 535, 166,
1842 167, 168, 169, 170, 936, 171, 172, 173, 174, 175,
1843 -509, -509, -509, -509, 180, -509, 181, -509, 830, -509,
1844 -509, -509, -509, -509, -509, -509, -509, -509, -509, 898,
1845 -509, -509, -509, -509, -509, -509, -509, -509, -509, -509,
1846 -509, -509, -509, -509, -509, -509, 898, 182, 184, -509,
1847 1128, 183, 186, 188, 190, 191, 192, 194, 1128, 1128,
1848 1128, 198, 306, 830, 898, 898, 327, -509, 4, -509,
1849 -509, -509, -509, -509, -509, -509, -509, -509, -509, -509,
1850 -509, 709, 936, 612, 328, -509, -509, -509, -509, -92,
1851 -109, -509, 201, -108, -509, 145, -509, 210, 208, 739,
1852 -509, -509, 334, 212, 215, 936, 936, 936, 936, 936,
1853 -509, -70, 936, 936, 936, 936, 936, 350, 353, 1128,
1854 1128, 1128, 2, -509, 30, -509, 220, 1128, 218, 898,
1855 898, 898, 898, 898, 227, 229, 233, 898, 898, 1128,
1856 1128, 235, -509, 341, 368, -509, 138, -509, -56, -66,
1857 -509, -83, -509, -509, -509, -509, -509, -509, 777, 351,
1858 -509, 238, 936, 936, 220, 239, 241, 242, 243, 936,
1859 -509, 247, 249, 251, 253, 361, 1128, 1128, 258, 256,
1860 262, 1128, 374, 1128, 898, -509, 263, 1128, 264, -509,
1861 -509, 266, 267, 1128, 1128, 1128, -509, -509, 259, -509,
1862 898, -509, -509, -509, -509, -509, -509, -509, -509, -509,
1863 345, 377, 268, 269, 272, 936, 936, 936, 936, -509,
1864 936, 936, 936, 936, 898, 274, 273, 898, 1128, 1128,
1865 276, -509, 276, -509, 278, 1128, 279, 898, 898, 898,
1866 -509, -509, -509, 898, 1128, 386, -509, -509, 936, 936,
1867 -509, 280, 282, 283, 284, 287, 290, 292, 293, 298,
1868 402, 14, 278, 301, -509, -509, 382, -509, -509, 898,
1869 299, 1128, -509, -509, -509, 303, -509, -509, 307, 308,
1870 936, -509, 936, 936, -509, -509, -509, -509, -509, 1128,
1871 -509, 1217, 27, 425, -509, -509, 309, -509, -509, -509,
1872 311, 315, 316, -509, 320, -509, 1217, 459, -509, -509,
1873 -509, -509, 460, 325, 1128, 1128, 463, 211, -509, 1128,
1874 464, -509, 1128, -509
1877 /* YYPGOTO[NTERM-NUM]. */
1878 static const short int yypgoto[] =
1880 -509, -509, 257, 376, 378, 379, 231, 226, 383, 385,
1881 -98, -97, -505, -509, 438, 469, -143, -509, -302, 75,
1882 -509, -219, -509, -46, -509, -38, -509, -68, 38, -509,
1883 130, 286, -140, 154, -509, -509, -509, -509, 450, -509,
1884 -509, -509, -509, 1, -509, 104, -509, -509, 496, -509,
1885 -509, -509, -509, -509, 523, -509, -508, -106, -3, -88,
1886 -509, 486, -509, -48, -509, -509, -509, -509, 86, 28,
1887 -509, -509, 109, -509, -509
1890 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1891 positive, shift that token. If negative, reduce the rule which
1892 number is the opposite. If zero, do what YYDEFACT says.
1893 If YYTABLE_NINF, syntax error. */
1894 #define YYTABLE_NINF -178
1895 static const short int yytable[] =
1897 86, 330, 146, 147, 25, 115, 385, 91, 124, 278,
1898 135, 40, 441, 86, 128, 94, 551, 347, 348, 138,
1899 139, 140, 141, 142, 143, 144, 145, 19, 272, 20,
1900 272, 272, 138, 139, 140, 141, 142, 143, 144, 145,
1901 443, 403, 272, 564, 25, 136, -112, 566, 44, 45,
1902 46, 414, 242, 4, 132, 132, 137, 128, 573, 442,
1903 134, 404, 243, 128, 323, 242, 413, 30, 47, 429,
1904 49, 132, 98, 99, 100, 352, 101, 102, 103, 466,
1905 219, 220, 429, 237, 40, 130, 429, 442, 50, 309,
1906 430, 27, 313, 28, 465, 326, 429, 314, 315, 316,
1907 317, 327, 464, 126, 64, 65, 66, 67, 68, 69,
1908 70, 71, 72, 73, 74, 75, 76, 321, 322, 77,
1909 78, 31, 32, 33, 34, 35, 36, 37, 19, 346,
1910 20, 116, 117, 274, 275, 58, 92, 307, 308, 134,
1911 310, 311, 134, 60, 95, 276, 62, 134, 134, 134,
1912 134, 125, -177, 138, 139, 140, 141, 142, 143, 144,
1913 145, 51, 108, 241, 318, 319, 320, 134, 134, 246,
1914 349, 350, 550, 19, 353, 20, 7, 8, 9, 52,
1915 11, 53, 13, 5, 54, 565, 6, 463, 527, 112,
1916 528, 109, 55, 110, 7, 8, 9, 10, 11, 12,
1917 13, 408, 409, 411, 272, 111, 355, 119, 212, 213,
1918 120, 121, 272, 272, 272, 14, -113, 126, 64, 65,
1919 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1920 76, 131, 379, 77, 78, 324, 325, 401, 331, 332,
1921 86, 122, 19, 123, 20, -72, -72, -76, -76, 211,
1922 236, 380, 215, 79, 245, 238, 80, -71, -71, 81,
1923 239, 82, 127, -75, -75, -70, -70, 216, 381, -74,
1924 -74, -69, -69, 272, 272, 272, 244, 399, -73, -73,
1925 217, 272, 333, 334, 277, 86, 400, 134, 101, 102,
1926 328, 353, -79, 272, 272, 279, 280, 281, 282, 283,
1927 284, 448, -80, 450, 451, 452, 337, 386, 359, 456,
1928 351, 285, 286, 287, 288, 394, 395, 396, 360, 361,
1929 365, 366, 367, 368, 369, 372, 373, 374, 375, 376,
1930 272, 272, 377, 378, 382, 272, 384, 272, 388, 387,
1931 389, 272, 390, 391, 392, 398, 393, 272, 272, 272,
1932 397, 134, 449, 134, 134, 134, 416, 402, 412, 134,
1933 457, 415, 418, 419, 421, 436, 422, 79, 437, 423,
1934 80, 461, 444, 81, 447, 82, 438, 439, 440, 453,
1935 355, 454, 272, 272, 446, 455, 462, 460, 403, 272,
1936 471, 475, 491, 476, 477, 478, 458, 459, 272, 480,
1937 484, 481, 505, 482, 537, 483, 134, 507, 488, 532,
1938 533, 534, 487, 503, 489, 495, 497, 549, 498, 499,
1939 508, 509, 504, 146, 147, 272, 520, 510, 526, 521,
1940 529, 531, 540, 485, 486, 542, 543, 541, 490, 442,
1941 492, 554, 544, 272, 496, 545, 519, 546, 547, 134,
1942 500, 501, 502, 548, 146, 147, 553, 555, 557, 134,
1943 134, 134, 558, 559, 567, 134, 569, 568, 272, 272,
1944 570, 571, 572, 272, 574, 575, 272, 576, 579, 582,
1945 202, 104, 203, 204, 364, 524, 525, 205, 363, 206,
1946 336, 134, 530, 56, 469, 424, 425, 426, 427, 428,
1947 114, 536, 431, 432, 433, 434, 435, 126, 64, 65,
1948 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1949 76, 345, 468, 77, 78, 59, 26, 97, 556, 580,
1950 494, 535, 19, 474, 20, 0, 0, 0, 0, 0,
1951 0, 0, 0, 0, 0, 0, 563, 0, 0, 0,
1952 0, 0, 472, 473, 0, 0, 0, 0, 0, 479,
1953 290, 291, 0, 0, 0, 0, -82, 19, 0, 20,
1954 0, 577, 578, 6, -82, -82, 581, 0, 0, 583,
1955 0, -82, -82, -82, -82, -82, -82, -82, 0, -82,
1956 21, 0, 0, 0, 0, 0, 0, -82, 22, 0,
1957 0, 0, 23, 0, 0, 511, 512, 513, 514, 0,
1958 515, 516, 517, 518, 0, 126, 221, 222, 223, 224,
1959 225, 226, 227, 228, 229, 230, 231, 75, 76, 0,
1960 0, 77, 78, 0, 0, 0, 0, 0, 538, 539,
1961 19, 0, 20, 292, 293, 294, 295, 296, 297, 298,
1962 299, 300, 301, 302, 303, 304, 305, 79, 0, 0,
1963 80, 0, 0, 81, 0, 82, 240, 0, 0, 0,
1964 560, 0, 561, 562, 126, 64, 65, 66, 67, 68,
1965 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1966 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1967 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1968 0, 354, 126, 221, 222, 223, 224, 225, 226, 227,
1969 228, 229, 230, 231, 75, 76, 0, 0, 77, 78,
1970 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1971 0, 0, 126, 64, 65, 66, 67, 68, 69, 70,
1972 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1973 0, 0, 0, 0, 0, 79, 0, 19, 80, 20,
1974 0, 81, 0, 82, 410, 0, 0, 0, 0, 420,
1975 126, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1976 73, 74, 75, 76, 0, 0, 77, 78, 0, 0,
1977 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
1978 0, 0, 0, 0, 0, 0, 0, 467, 0, 0,
1979 0, 0, 0, 0, 79, 0, 0, 80, 0, 0,
1980 81, 0, 82, 63, 64, 65, 66, 67, 68, 69,
1981 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
1982 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1983 20, 0, 79, 0, 0, 80, 0, 407, 81, 0,
1984 82, 0, 133, 64, 65, 66, 67, 68, 69, 70,
1985 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1986 0, 0, 79, 0, 0, 80, 0, 19, 81, 20,
1987 82, 126, 64, 65, 66, 67, 68, 69, 70, 71,
1988 72, 73, 74, 75, 76, 0, 0, 77, 78, 0,
1989 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
1990 79, 0, 0, 80, 0, 0, 81, 0, 82, 126,
1991 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
1992 231, 75, 76, 0, 0, 77, 78, 0, 0, 0,
1993 0, 0, 0, 0, 19, 0, 20, 0, 0, 0,
1994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1995 0, 0, 0, 79, 0, 0, 80, 0, 0, 81,
1996 0, 82, 0, 0, 0, 0, 0, 0, 0, 77,
1997 78, 0, 338, 339, 340, 0, 0, 0, 19, 0,
1998 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1999 0, 0, 79, 0, 0, 80, 0, 0, 81, 0,
2000 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2001 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2002 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
2003 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
2004 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
2005 257, 258, 0, 0, 0, 0, 0, 0, 0, 79,
2006 0, 0, 80, 0, 0, 81, 0, 82, 0, 0,
2007 0, 0, 0, 0, 0, 0, 0, 259, 0, 260,
2008 181, 182, 183, 184, 0, 261, 262, 263, 189, 190,
2009 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
2010 201, 0, 0, 0, 0, 0, 341, 0, 0, 342,
2011 0, 343, 0, 0, 344, 248, 249, 77, 78, 250,
2012 251, 252, 253, 254, 255, 0, 19, 0, 20, 0,
2013 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2014 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2015 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2016 256, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2017 0, 0, 0, 0, 0, 0, 0, 0, 153, 154,
2018 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
2019 165, 166, 167, 168, 169, 170, 171, 172, 257, 258,
2020 0, 0, 0, 0, 248, 249, 0, 0, 250, 251,
2021 252, 253, 254, 255, 0, 0, 0, 0, 0, 0,
2022 0, 0, 0, 0, 0, 259, 0, 260, 181, 182,
2023 183, 184, 0, 261, 262, 263, 189, 190, 191, 192,
2024 193, 194, 195, 196, 197, 198, 199, 200, 201, 256,
2025 0, 0, 0, 0, 0, 0, 0, 264, 0, 0,
2026 0, 0, 0, 0, 0, 0, 0, 153, 154, 155,
2027 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
2028 166, 167, 168, 169, 170, 171, 172, 257, 258, 0,
2029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2030 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2031 0, 0, 0, 0, 259, 0, 260, 181, 182, 183,
2032 184, 149, 261, 262, 263, 189, 190, 191, 192, 193,
2033 194, 195, 196, 197, 198, 199, 200, 201, 0, 0,
2034 0, 0, 0, 150, 151, 0, 264, 0, 0, 0,
2035 0, 0, 0, 0, 0, 0, 0, 0, 0, 152,
2036 0, 0, 0, 153, 154, 155, 156, 157, 158, 159,
2037 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
2038 170, 171, 172, 173, 174, 0, 0, 0, 0, 0,
2039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2040 0, 0, 0, 0, 0, 175, 176, 177, 0, 0,
2041 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2042 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
2046 static const short int yycheck[] =
2048 38, 220, 100, 100, 3, 51, 308, 32, 18, 152,
2049 98, 29, 10, 51, 82, 33, 521, 236, 237, 5,
2050 6, 7, 8, 9, 10, 11, 12, 28, 134, 30,
2051 136, 137, 5, 6, 7, 8, 9, 10, 11, 12,
2052 10, 37, 148, 551, 43, 4, 154, 552, 52, 53,
2053 54, 160, 152, 0, 163, 163, 15, 125, 566, 57,
2054 98, 57, 162, 131, 207, 152, 158, 62, 72, 152,
2055 151, 163, 73, 74, 75, 162, 77, 78, 79, 162,
2056 118, 119, 152, 121, 29, 84, 152, 57, 62, 177,
2057 160, 45, 180, 47, 160, 152, 152, 185, 186, 187,
2058 188, 158, 158, 3, 4, 5, 6, 7, 8, 9,
2059 10, 11, 12, 13, 14, 15, 16, 205, 206, 19,
2060 20, 65, 66, 67, 68, 69, 70, 71, 28, 235,
2061 30, 35, 36, 136, 137, 151, 161, 175, 176, 177,
2062 178, 179, 180, 30, 162, 148, 18, 185, 186, 187,
2063 188, 161, 0, 5, 6, 7, 8, 9, 10, 11,
2064 12, 27, 151, 125, 202, 203, 204, 205, 206, 131,
2065 238, 239, 158, 28, 242, 30, 42, 43, 44, 45,
2066 46, 47, 48, 31, 50, 158, 34, 406, 490, 156,
2067 492, 151, 58, 151, 42, 43, 44, 45, 46, 47,
2068 48, 341, 342, 343, 310, 151, 244, 53, 55, 56,
2069 56, 57, 318, 319, 320, 63, 154, 3, 4, 5,
2070 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2071 16, 154, 278, 19, 20, 125, 126, 325, 25, 26,
2072 278, 18, 28, 18, 30, 17, 18, 17, 18, 30,
2073 120, 289, 18, 153, 40, 157, 156, 17, 18, 159,
2074 157, 161, 162, 17, 18, 17, 18, 30, 306, 17,
2075 18, 17, 18, 379, 380, 381, 154, 323, 17, 18,
2076 30, 387, 17, 18, 60, 323, 324, 325, 77, 78,
2077 152, 359, 21, 399, 400, 102, 103, 104, 105, 106,
2078 107, 389, 21, 391, 392, 393, 21, 310, 152, 397,
2079 160, 118, 119, 120, 121, 318, 319, 320, 155, 64,
2080 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
2081 436, 437, 152, 152, 152, 441, 152, 443, 152, 156,
2082 152, 447, 152, 152, 152, 39, 152, 453, 454, 455,
2083 152, 389, 390, 391, 392, 393, 355, 30, 30, 397,
2084 398, 160, 152, 155, 30, 15, 154, 153, 15, 154,
2085 156, 30, 152, 159, 156, 161, 379, 380, 381, 152,
2086 418, 152, 488, 489, 387, 152, 18, 152, 37, 495,
2087 152, 152, 18, 152, 152, 152, 399, 400, 504, 152,
2088 39, 152, 57, 152, 18, 152, 444, 30, 152, 497,
2089 498, 499, 154, 154, 152, 152, 152, 15, 152, 152,
2090 152, 152, 460, 521, 521, 531, 152, 155, 152, 156,
2091 152, 152, 152, 436, 437, 152, 152, 155, 441, 57,
2092 443, 529, 155, 549, 447, 155, 484, 155, 155, 487,
2093 453, 454, 455, 155, 552, 552, 155, 158, 155, 497,
2094 498, 499, 155, 155, 39, 503, 155, 158, 574, 575,
2095 155, 155, 152, 579, 15, 15, 582, 152, 15, 15,
2096 104, 43, 104, 104, 258, 488, 489, 104, 257, 104,
2097 233, 529, 495, 24, 419, 365, 366, 367, 368, 369,
2098 50, 504, 372, 373, 374, 375, 376, 3, 4, 5,
2099 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2100 16, 235, 418, 19, 20, 29, 3, 41, 531, 577,
2101 444, 503, 28, 424, 30, -1, -1, -1, -1, -1,
2102 -1, -1, -1, -1, -1, -1, 549, -1, -1, -1,
2103 -1, -1, 422, 423, -1, -1, -1, -1, -1, 429,
2104 25, 26, -1, -1, -1, -1, 27, 28, -1, 30,
2105 -1, 574, 575, 34, 35, 36, 579, -1, -1, 582,
2106 -1, 42, 43, 44, 45, 46, 47, 48, -1, 50,
2107 51, -1, -1, -1, -1, -1, -1, 58, 59, -1,
2108 -1, -1, 63, -1, -1, 475, 476, 477, 478, -1,
2109 480, 481, 482, 483, -1, 3, 4, 5, 6, 7,
2110 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
2111 -1, 19, 20, -1, -1, -1, -1, -1, 508, 509,
2112 28, -1, 30, 108, 109, 110, 111, 112, 113, 114,
2113 115, 116, 117, 118, 119, 120, 121, 153, -1, -1,
2114 156, -1, -1, 159, -1, 161, 162, -1, -1, -1,
2115 540, -1, 542, 543, 3, 4, 5, 6, 7, 8,
2116 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2117 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2118 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
2119 -1, 40, 3, 4, 5, 6, 7, 8, 9, 10,
2120 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
2121 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
2122 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
2123 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
2124 -1, -1, -1, -1, -1, 153, -1, 28, 156, 30,
2125 -1, 159, -1, 161, 162, -1, -1, -1, -1, 40,
2126 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
2127 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
2128 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
2129 -1, -1, -1, -1, -1, -1, -1, 40, -1, -1,
2130 -1, -1, -1, -1, 153, -1, -1, 156, -1, -1,
2131 159, -1, 161, 3, 4, 5, 6, 7, 8, 9,
2132 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
2133 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
2134 30, -1, 153, -1, -1, 156, -1, 158, 159, -1,
2135 161, -1, 3, 4, 5, 6, 7, 8, 9, 10,
2136 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
2137 -1, -1, 153, -1, -1, 156, -1, 28, 159, 30,
2138 161, 3, 4, 5, 6, 7, 8, 9, 10, 11,
2139 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
2140 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
2141 153, -1, -1, 156, -1, -1, 159, -1, 161, 3,
2142 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2143 14, 15, 16, -1, -1, 19, 20, -1, -1, -1,
2144 -1, -1, -1, -1, 28, -1, 30, -1, -1, -1,
2145 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2146 -1, -1, -1, 153, -1, -1, 156, -1, -1, 159,
2147 -1, 161, -1, -1, -1, -1, -1, -1, -1, 19,
2148 20, -1, 22, 23, 24, -1, -1, -1, 28, -1,
2149 30, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2150 -1, -1, 153, -1, -1, 156, -1, -1, 159, -1,
2151 161, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2152 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2153 -1, 153, -1, -1, 156, -1, -1, 159, -1, 161,
2154 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2155 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
2156 100, 101, -1, -1, -1, -1, -1, -1, -1, 153,
2157 -1, -1, 156, -1, -1, 159, -1, 161, -1, -1,
2158 -1, -1, -1, -1, -1, -1, -1, 127, -1, 129,
2159 130, 131, 132, 133, -1, 135, 136, 137, 138, 139,
2160 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
2161 150, -1, -1, -1, -1, -1, 156, -1, -1, 159,
2162 -1, 161, -1, -1, 164, 17, 18, 19, 20, 21,
2163 22, 23, 24, 25, 26, -1, 28, -1, 30, -1,
2164 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2165 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2166 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2167 62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2168 -1, -1, -1, -1, -1, -1, -1, -1, 80, 81,
2169 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2170 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
2171 -1, -1, -1, -1, 17, 18, -1, -1, 21, 22,
2172 23, 24, 25, 26, -1, -1, -1, -1, -1, -1,
2173 -1, -1, -1, -1, -1, 127, -1, 129, 130, 131,
2174 132, 133, -1, 135, 136, 137, 138, 139, 140, 141,
2175 142, 143, 144, 145, 146, 147, 148, 149, 150, 62,
2176 -1, -1, -1, -1, -1, -1, -1, 159, -1, -1,
2177 -1, -1, -1, -1, -1, -1, -1, 80, 81, 82,
2178 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2179 93, 94, 95, 96, 97, 98, 99, 100, 101, -1,
2180 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2182 -1, -1, -1, -1, 127, -1, 129, 130, 131, 132,
2183 133, 38, 135, 136, 137, 138, 139, 140, 141, 142,
2184 143, 144, 145, 146, 147, 148, 149, 150, -1, -1,
2185 -1, -1, -1, 60, 61, -1, 159, -1, -1, -1,
2186 -1, -1, -1, -1, -1, -1, -1, -1, -1, 76,
2187 -1, -1, -1, 80, 81, 82, 83, 84, 85, 86,
2188 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2189 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
2190 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2191 -1, -1, -1, -1, -1, 122, 123, 124, -1, -1,
2192 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2193 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2197 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2198 symbol of state STATE-NUM. */
2199 static const unsigned char yystos[] =
2201 0, 199, 200, 202, 0, 31, 34, 42, 43, 44,
2202 45, 46, 47, 48, 63, 180, 215, 217, 219, 28,
2203 30, 51, 59, 63, 179, 208, 219, 45, 47, 218,
2204 62, 65, 66, 67, 68, 69, 70, 71, 181, 213,
2205 29, 225, 226, 227, 52, 53, 54, 72, 205, 151,
2206 62, 27, 45, 47, 50, 58, 180, 201, 151, 213,
2207 30, 203, 18, 3, 4, 5, 6, 7, 8, 9,
2208 10, 11, 12, 13, 14, 15, 16, 19, 20, 153,
2209 156, 159, 161, 166, 188, 189, 190, 191, 192, 208,
2210 222, 32, 161, 214, 33, 162, 216, 226, 73, 74,
2211 75, 77, 78, 79, 179, 228, 229, 231, 151, 151,
2212 151, 151, 156, 206, 203, 188, 35, 36, 198, 198,
2213 198, 198, 18, 18, 18, 161, 3, 162, 192, 193,
2214 208, 154, 163, 3, 190, 224, 4, 15, 5, 6,
2215 7, 8, 9, 10, 11, 12, 175, 176, 177, 38,
2216 60, 61, 76, 80, 81, 82, 83, 84, 85, 86,
2217 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2218 97, 98, 99, 100, 101, 122, 123, 124, 127, 128,
2219 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
2220 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
2221 149, 150, 168, 169, 170, 173, 174, 235, 236, 238,
2222 239, 30, 55, 56, 204, 18, 30, 30, 207, 190,
2223 190, 4, 5, 6, 7, 8, 9, 10, 11, 12,
2224 13, 14, 175, 176, 178, 190, 195, 190, 157, 157,
2225 162, 193, 152, 162, 154, 40, 193, 194, 17, 18,
2226 21, 22, 23, 24, 25, 26, 62, 100, 101, 127,
2227 129, 135, 136, 137, 159, 168, 169, 170, 173, 174,
2228 196, 221, 222, 223, 223, 223, 223, 60, 181, 102,
2229 103, 104, 105, 106, 107, 118, 119, 120, 121, 171,
2230 25, 26, 108, 109, 110, 111, 112, 113, 114, 115,
2231 116, 117, 118, 119, 120, 121, 172, 190, 190, 224,
2232 190, 190, 232, 224, 224, 224, 224, 224, 190, 190,
2233 190, 224, 224, 181, 125, 126, 152, 158, 152, 186,
2234 186, 25, 26, 17, 18, 167, 167, 21, 22, 23,
2235 24, 156, 159, 161, 164, 196, 222, 186, 186, 192,
2236 192, 160, 162, 192, 40, 190, 210, 211, 212, 152,
2237 155, 64, 220, 171, 172, 154, 154, 154, 154, 154,
2238 195, 197, 154, 154, 154, 154, 154, 152, 152, 188,
2239 190, 190, 152, 183, 152, 183, 223, 156, 152, 152,
2240 152, 152, 152, 152, 223, 223, 223, 152, 39, 188,
2241 190, 224, 30, 37, 57, 184, 187, 158, 197, 197,
2242 162, 197, 30, 158, 160, 160, 208, 209, 152, 155,
2243 40, 30, 154, 154, 195, 195, 195, 195, 195, 152,
2244 160, 195, 195, 195, 195, 195, 15, 15, 223, 223,
2245 223, 10, 57, 10, 152, 237, 223, 156, 224, 190,
2246 224, 224, 224, 152, 152, 152, 224, 190, 223, 223,
2247 152, 30, 18, 186, 158, 160, 162, 40, 210, 184,
2248 185, 152, 195, 195, 237, 152, 152, 152, 152, 195,
2249 152, 152, 152, 152, 39, 223, 223, 154, 152, 152,
2250 223, 18, 223, 224, 233, 152, 223, 152, 152, 152,
2251 223, 223, 223, 154, 190, 57, 182, 30, 152, 152,
2252 155, 195, 195, 195, 195, 195, 195, 195, 195, 190,
2253 152, 156, 233, 234, 223, 223, 152, 183, 183, 152,
2254 223, 152, 224, 224, 224, 234, 223, 18, 195, 195,
2255 152, 155, 152, 152, 155, 155, 155, 155, 155, 15,
2256 158, 177, 230, 155, 224, 158, 223, 155, 155, 155,
2257 195, 195, 195, 223, 221, 158, 177, 39, 158, 155,
2258 155, 155, 152, 221, 15, 15, 152, 223, 223, 15,
2262 #define yyerrok (yyerrstatus = 0)
2263 #define yyclearin (yychar = YYEMPTY)
2264 #define YYEMPTY (-2)
2267 #define YYACCEPT goto yyacceptlab
2268 #define YYABORT goto yyabortlab
2269 #define YYERROR goto yyerrorlab
2272 /* Like YYERROR except do call yyerror. This remains here temporarily
2273 to ease the transition to the new meaning of YYERROR, for GCC.
2274 Once GCC version 2 has supplanted version 1, this can go. */
2276 #define YYFAIL goto yyerrlab
2278 #define YYRECOVERING() (!!yyerrstatus)
2280 #define YYBACKUP(Token, Value) \
2282 if (yychar == YYEMPTY && yylen == 1) \
2286 yytoken = YYTRANSLATE (yychar); \
2292 yyerror (YY_("syntax error: cannot back up")); \
2299 #define YYERRCODE 256
2302 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2303 If N is 0, then set CURRENT to the empty location which ends
2304 the previous symbol: RHS[0] (always defined). */
2306 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2307 #ifndef YYLLOC_DEFAULT
2308 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2312 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2313 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2314 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2315 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2319 (Current).first_line = (Current).last_line = \
2320 YYRHSLOC (Rhs, 0).last_line; \
2321 (Current).first_column = (Current).last_column = \
2322 YYRHSLOC (Rhs, 0).last_column; \
2328 /* YY_LOCATION_PRINT -- Print the location on the stream.
2329 This macro was not mandated originally: define only if we know
2330 we won't break user code: when these are the locations we know. */
2332 #ifndef YY_LOCATION_PRINT
2333 # if YYLTYPE_IS_TRIVIAL
2334 # define YY_LOCATION_PRINT(File, Loc) \
2335 fprintf (File, "%d.%d-%d.%d", \
2336 (Loc).first_line, (Loc).first_column, \
2337 (Loc).last_line, (Loc).last_column)
2339 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2344 /* YYLEX -- calling `yylex' with the right arguments. */
2347 # define YYLEX yylex (YYLEX_PARAM)
2349 # define YYLEX yylex ()
2352 /* Enable debugging if requested. */
2356 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2357 # define YYFPRINTF fprintf
2360 # define YYDPRINTF(Args) \
2366 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2370 YYFPRINTF (stderr, "%s ", Title); \
2371 yysymprint (stderr, \
2373 YYFPRINTF (stderr, "\n"); \
2377 /*------------------------------------------------------------------.
2378 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2380 `------------------------------------------------------------------*/
2382 #if defined (__STDC__) || defined (__cplusplus)
2384 yy_stack_print (short int *bottom, short int *top)
2387 yy_stack_print (bottom, top)
2392 YYFPRINTF (stderr, "Stack now");
2393 for (/* Nothing. */; bottom <= top; ++bottom)
2394 YYFPRINTF (stderr, " %d", *bottom);
2395 YYFPRINTF (stderr, "\n");
2398 # define YY_STACK_PRINT(Bottom, Top) \
2401 yy_stack_print ((Bottom), (Top)); \
2405 /*------------------------------------------------.
2406 | Report that the YYRULE is going to be reduced. |
2407 `------------------------------------------------*/
2409 #if defined (__STDC__) || defined (__cplusplus)
2411 yy_reduce_print (int yyrule)
2414 yy_reduce_print (yyrule)
2419 unsigned long int yylno = yyrline[yyrule];
2420 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2422 /* Print the symbols being reduced, and their result. */
2423 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2424 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2425 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2428 # define YY_REDUCE_PRINT(Rule) \
2431 yy_reduce_print (Rule); \
2434 /* Nonzero means print parse trace. It is left uninitialized so that
2435 multiple parsers can coexist. */
2437 #else /* !YYDEBUG */
2438 # define YYDPRINTF(Args)
2439 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2440 # define YY_STACK_PRINT(Bottom, Top)
2441 # define YY_REDUCE_PRINT(Rule)
2442 #endif /* !YYDEBUG */
2445 /* YYINITDEPTH -- initial size of the parser's stacks. */
2447 # define YYINITDEPTH 200
2450 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2451 if the built-in stack extension method is used).
2453 Do not make this value too large; the results are undefined if
2454 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2455 evaluated with infinite-precision integer arithmetic. */
2458 # define YYMAXDEPTH 10000
2466 # if defined (__GLIBC__) && defined (_STRING_H)
2467 # define yystrlen strlen
2469 /* Return the length of YYSTR. */
2471 # if defined (__STDC__) || defined (__cplusplus)
2472 yystrlen (const char *yystr)
2478 const char *yys = yystr;
2480 while (*yys++ != '\0')
2483 return yys - yystr - 1;
2489 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2490 # define yystpcpy stpcpy
2492 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2495 # if defined (__STDC__) || defined (__cplusplus)
2496 yystpcpy (char *yydest, const char *yysrc)
2498 yystpcpy (yydest, yysrc)
2504 const char *yys = yysrc;
2506 while ((*yyd++ = *yys++) != '\0')
2515 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2516 quotes and backslashes, so that it's suitable for yyerror. The
2517 heuristic is that double-quoting is unnecessary unless the string
2518 contains an apostrophe, a comma, or backslash (other than
2519 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2520 null, do not copy; instead, return the length of what the result
2523 yytnamerr (char *yyres, const char *yystr)
2528 char const *yyp = yystr;
2535 goto do_not_strip_quotes;
2539 goto do_not_strip_quotes;
2552 do_not_strip_quotes: ;
2556 return yystrlen (yystr);
2558 return yystpcpy (yyres, yystr) - yyres;
2562 #endif /* YYERROR_VERBOSE */
2567 /*--------------------------------.
2568 | Print this symbol on YYOUTPUT. |
2569 `--------------------------------*/
2571 #if defined (__STDC__) || defined (__cplusplus)
2573 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2576 yysymprint (yyoutput, yytype, yyvaluep)
2582 /* Pacify ``unused variable'' warnings. */
2585 if (yytype < YYNTOKENS)
2586 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2588 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2592 if (yytype < YYNTOKENS)
2593 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2600 YYFPRINTF (yyoutput, ")");
2603 #endif /* ! YYDEBUG */
2604 /*-----------------------------------------------.
2605 | Release the memory associated to this symbol. |
2606 `-----------------------------------------------*/
2608 #if defined (__STDC__) || defined (__cplusplus)
2610 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2613 yydestruct (yymsg, yytype, yyvaluep)
2619 /* Pacify ``unused variable'' warnings. */
2624 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2635 /* Prevent warnings from -Wmissing-prototypes. */
2637 #ifdef YYPARSE_PARAM
2638 # if defined (__STDC__) || defined (__cplusplus)
2639 int yyparse (void *YYPARSE_PARAM);
2643 #else /* ! YYPARSE_PARAM */
2644 #if defined (__STDC__) || defined (__cplusplus)
2649 #endif /* ! YYPARSE_PARAM */
2653 /* The look-ahead symbol. */
2656 /* The semantic value of the look-ahead symbol. */
2659 /* Number of syntax errors so far. */
2668 #ifdef YYPARSE_PARAM
2669 # if defined (__STDC__) || defined (__cplusplus)
2670 int yyparse (void *YYPARSE_PARAM)
2672 int yyparse (YYPARSE_PARAM)
2673 void *YYPARSE_PARAM;
2675 #else /* ! YYPARSE_PARAM */
2676 #if defined (__STDC__) || defined (__cplusplus)
2690 /* Number of tokens to shift before error messages enabled. */
2692 /* Look-ahead token as an internal (translated) token number. */
2695 /* Three stacks and their tools:
2696 `yyss': related to states,
2697 `yyvs': related to semantic values,
2698 `yyls': related to locations.
2700 Refer to the stacks thru separate pointers, to allow yyoverflow
2701 to reallocate them elsewhere. */
2703 /* The state stack. */
2704 short int yyssa[YYINITDEPTH];
2705 short int *yyss = yyssa;
2708 /* The semantic value stack. */
2709 YYSTYPE yyvsa[YYINITDEPTH];
2710 YYSTYPE *yyvs = yyvsa;
2715 #define YYPOPSTACK (yyvsp--, yyssp--)
2717 YYSIZE_T yystacksize = YYINITDEPTH;
2719 /* The variables used to return semantic value and location from the
2724 /* When reducing, the number of symbols on the RHS of the reduced
2728 YYDPRINTF ((stderr, "Starting parse\n"));
2733 yychar = YYEMPTY; /* Cause a token to be read. */
2735 /* Initialize stack pointers.
2736 Waste one element of value and location stack
2737 so that they stay on the same level as the state stack.
2738 The wasted elements are never initialized. */
2745 /*------------------------------------------------------------.
2746 | yynewstate -- Push a new state, which is found in yystate. |
2747 `------------------------------------------------------------*/
2749 /* In all cases, when you get here, the value and location stacks
2750 have just been pushed. so pushing a state here evens the stacks.
2757 if (yyss + yystacksize - 1 <= yyssp)
2759 /* Get the current used size of the three stacks, in elements. */
2760 YYSIZE_T yysize = yyssp - yyss + 1;
2764 /* Give user a chance to reallocate the stack. Use copies of
2765 these so that the &'s don't force the real ones into
2767 YYSTYPE *yyvs1 = yyvs;
2768 short int *yyss1 = yyss;
2771 /* Each stack pointer address is followed by the size of the
2772 data in use in that stack, in bytes. This used to be a
2773 conditional around just the two extra args, but that might
2774 be undefined if yyoverflow is a macro. */
2775 yyoverflow (YY_("memory exhausted"),
2776 &yyss1, yysize * sizeof (*yyssp),
2777 &yyvs1, yysize * sizeof (*yyvsp),
2784 #else /* no yyoverflow */
2785 # ifndef YYSTACK_RELOCATE
2786 goto yyexhaustedlab;
2788 /* Extend the stack our own way. */
2789 if (YYMAXDEPTH <= yystacksize)
2790 goto yyexhaustedlab;
2792 if (YYMAXDEPTH < yystacksize)
2793 yystacksize = YYMAXDEPTH;
2796 short int *yyss1 = yyss;
2797 union yyalloc *yyptr =
2798 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2800 goto yyexhaustedlab;
2801 YYSTACK_RELOCATE (yyss);
2802 YYSTACK_RELOCATE (yyvs);
2804 # undef YYSTACK_RELOCATE
2806 YYSTACK_FREE (yyss1);
2809 #endif /* no yyoverflow */
2811 yyssp = yyss + yysize - 1;
2812 yyvsp = yyvs + yysize - 1;
2815 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2816 (unsigned long int) yystacksize));
2818 if (yyss + yystacksize - 1 <= yyssp)
2822 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2831 /* Do appropriate processing given the current state. */
2832 /* Read a look-ahead token if we need one and don't already have one. */
2835 /* First try to decide what to do without reference to look-ahead token. */
2837 yyn = yypact[yystate];
2838 if (yyn == YYPACT_NINF)
2841 /* Not known => get a look-ahead token if don't already have one. */
2843 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2844 if (yychar == YYEMPTY)
2846 YYDPRINTF ((stderr, "Reading a token: "));
2850 if (yychar <= YYEOF)
2852 yychar = yytoken = YYEOF;
2853 YYDPRINTF ((stderr, "Now at end of input.\n"));
2857 yytoken = YYTRANSLATE (yychar);
2858 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2861 /* If the proper action on seeing token YYTOKEN is to reduce or to
2862 detect an error, take that action. */
2864 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2869 if (yyn == 0 || yyn == YYTABLE_NINF)
2878 /* Shift the look-ahead token. */
2879 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2881 /* Discard the token being shifted unless it is eof. */
2882 if (yychar != YYEOF)
2888 /* Count tokens shifted since error; after three, turn off error
2897 /*-----------------------------------------------------------.
2898 | yydefault -- do the default action for the current state. |
2899 `-----------------------------------------------------------*/
2901 yyn = yydefact[yystate];
2907 /*-----------------------------.
2908 | yyreduce -- Do a reduction. |
2909 `-----------------------------*/
2911 /* yyn is the number of a rule to reduce with. */
2914 /* If YYLEN is nonzero, implement the default value of the action:
2917 Otherwise, the following line sets YYVAL to garbage.
2918 This behavior is undocumented and Bison
2919 users should not rely upon it. Assigning to YYVAL
2920 unconditionally makes the parser a bit smaller, and it avoids a
2921 GCC warning that YYVAL may be used uninitialized. */
2922 yyval = yyvsp[1-yylen];
2925 YY_REDUCE_PRINT (yyn);
2929 #line 892 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2931 (yyval.String) = (yyvsp[-1].String);
2936 #line 895 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2938 (yyval.String) = new std::string("");
2943 #line 902 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2944 { (yyval.String) = new std::string(""); ;}
2948 #line 907 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2950 *(yyvsp[-1].String) += *(yyvsp[0].String);
2951 delete (yyvsp[0].String);
2952 (yyval.String) = (yyvsp[-1].String);
2957 #line 912 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2958 { (yyval.String) = new std::string(""); ;}
2962 #line 917 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2963 { (yyval.String) = new std::string(); ;}
2967 #line 918 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2968 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2972 #line 921 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2973 { (yyval.String) = new std::string(); ;}
2977 #line 922 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2979 (yyvsp[-1].String)->insert(0, ", ");
2980 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2981 delete (yyvsp[0].String);
2982 (yyval.String) = (yyvsp[-1].String);
2987 #line 930 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2989 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2990 delete (yyvsp[0].String);
2991 (yyval.String) = (yyvsp[-1].String);
2996 #line 936 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2997 { (yyval.String) = new std::string(); ;}
3001 #line 940 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3002 { (yyval.String) = new std::string(); ;}
3006 #line 941 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3008 (yyvsp[-1].String)->insert(0, ", ");
3009 if (!(yyvsp[0].String)->empty())
3010 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3011 delete (yyvsp[0].String);
3012 (yyval.String) = (yyvsp[-1].String);
3017 #line 951 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3019 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3020 delete (yyvsp[0].String);
3021 (yyval.String) = (yyvsp[-1].String);
3026 #line 973 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3028 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), OpaqueTy);
3033 #line 976 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3035 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UnresolvedTy);
3040 #line 979 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3042 (yyval.Type) = (yyvsp[0].Type);
3047 #line 982 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3048 { // Type UpReference
3049 (yyvsp[0].String)->insert(0, "\\");
3050 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UpRefTy);
3055 #line 986 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3056 { // Function derived type?
3057 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
3058 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3061 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
3064 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3067 (yyval.Type) = TypeInfo::get(newTy, (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
3072 #line 999 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3073 { // Sized array type?
3074 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3075 (yyvsp[-3].String)->insert(0,"[ ");
3076 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
3077 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
3082 #line 1005 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3083 { // Packed array type?
3084 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3085 (yyvsp[-3].String)->insert(0,"< ");
3086 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
3087 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
3092 #line 1011 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3093 { // Structure type?
3094 std::string newTy("{");
3095 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3098 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3101 (yyval.Type) = TypeInfo::get(newTy, StructTy, (yyvsp[-1].TypeVec));
3106 #line 1021 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3107 { // Empty structure type?
3108 (yyval.Type) = TypeInfo::get("{}", StructTy, new TypeList());
3113 #line 1024 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3114 { // Packed Structure type?
3115 std::string newTy("<{");
3116 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
3119 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
3122 (yyval.Type) = TypeInfo::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
3127 #line 1034 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3128 { // Empty packed structure type?
3129 (yyval.Type) = TypeInfo::get("<{}>", PackedStructTy, new TypeList());
3134 #line 1037 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3136 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
3141 #line 1045 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3143 (yyval.TypeVec) = new TypeList();
3144 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3149 #line 1049 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3151 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3152 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3157 #line 1057 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3159 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3160 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3161 delete (yyvsp[0].String);
3166 #line 1062 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3168 (yyval.TypeVec) = new TypeList();
3169 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3170 delete (yyvsp[0].String);
3175 #line 1067 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3177 (yyval.TypeVec) = new TypeList();
3182 #line 1077 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3183 { // Nonempty unsized arr
3184 (yyval.Const).type = (yyvsp[-3].Type);
3185 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3186 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
3187 delete (yyvsp[-1].String);
3192 #line 1083 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3194 (yyval.Const).type = (yyvsp[-2].Type);
3195 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3196 *(yyval.Const).cnst += "[ ]";
3201 #line 1088 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3203 (yyval.Const).type = (yyvsp[-2].Type);
3204 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3205 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
3206 delete (yyvsp[0].String);
3211 #line 1094 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3212 { // Nonempty unsized arr
3213 (yyval.Const).type = (yyvsp[-3].Type);
3214 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3215 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
3216 delete (yyvsp[-1].String);
3221 #line 1100 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3223 (yyval.Const).type = (yyvsp[-3].Type);
3224 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3225 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
3226 delete (yyvsp[-1].String);
3231 #line 1106 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3233 (yyval.Const).type = (yyvsp[-2].Type);
3234 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3235 *(yyval.Const).cnst += " {}";
3240 #line 1111 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3242 (yyval.Const).type = (yyvsp[-1].Type);
3243 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3244 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3245 delete (yyvsp[0].String);
3250 #line 1117 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3252 (yyval.Const).type = (yyvsp[-1].Type);
3253 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3254 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3255 delete (yyvsp[0].String);
3260 #line 1123 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3262 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve(), true);
3263 (yyval.Const).type = (yyvsp[-1].Type);
3264 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3265 *(yyval.Const).cnst += " " + Name;
3266 delete (yyvsp[0].String);
3271 #line 1130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3273 (yyval.Const).type = (yyvsp[-1].Type);
3274 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3275 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3276 delete (yyvsp[0].String);
3281 #line 1136 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3283 (yyval.Const).type = (yyvsp[-1].Type);
3284 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3285 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3286 delete (yyvsp[0].String);
3291 #line 1142 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3292 { // integral constants
3293 (yyval.Const).type = (yyvsp[-1].Type);
3294 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3295 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3296 delete (yyvsp[0].String);
3301 #line 1148 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3302 { // integral constants
3303 (yyval.Const).type = (yyvsp[-1].Type);
3304 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3305 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3306 delete (yyvsp[0].String);
3311 #line 1154 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3312 { // Boolean constants
3313 (yyval.Const).type = (yyvsp[-1].Type);
3314 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3315 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3316 delete (yyvsp[0].String);
3321 #line 1160 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3322 { // Boolean constants
3323 (yyval.Const).type = (yyvsp[-1].Type);
3324 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3325 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3326 delete (yyvsp[0].String);
3331 #line 1166 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3332 { // Float & Double constants
3333 (yyval.Const).type = (yyvsp[-1].Type);
3334 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3335 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3336 delete (yyvsp[0].String);
3341 #line 1174 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3343 std::string source = *(yyvsp[-3].Const).cnst;
3344 const TypeInfo* SrcTy = (yyvsp[-3].Const).type->resolve();
3345 const TypeInfo* DstTy = (yyvsp[-1].Type)->resolve();
3346 if (*(yyvsp[-5].String) == "cast") {
3347 // Call getCastUpgrade to upgrade the old cast
3348 (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
3350 // Nothing to upgrade, just create the cast constant expr
3351 (yyval.String) = new std::string(*(yyvsp[-5].String));
3352 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
3354 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String);
3359 #line 1188 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3361 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
3362 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3363 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3364 *(yyvsp[-4].String) += ", " + *VI.val;
3367 *(yyvsp[-4].String) += ")";
3368 (yyval.String) = (yyvsp[-4].String);
3369 (yyvsp[-2].Const).destroy();
3370 delete (yyvsp[-1].ValList);
3375 #line 1200 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3377 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3378 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3379 (yyval.String) = (yyvsp[-7].String);
3384 #line 1205 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3386 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3387 (yyval.String) = new std::string(op);
3388 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3389 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3394 #line 1211 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3396 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3397 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3398 (yyval.String) = (yyvsp[-5].String);
3403 #line 1216 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3405 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3406 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3407 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3408 (yyval.String) = (yyvsp[-5].String);
3413 #line 1222 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3415 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3416 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3417 (yyval.String) = (yyvsp[-6].String);
3422 #line 1227 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3424 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3425 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3426 (yyval.String) = (yyvsp[-6].String);
3431 #line 1232 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3433 const char* shiftop = (yyvsp[-5].String)->c_str();
3434 if (*(yyvsp[-5].String) == "shr")
3435 shiftop = ((yyvsp[-3].Const).type->isUnsigned()) ? "lshr" : "ashr";
3436 (yyval.String) = new std::string(shiftop);
3437 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3438 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3443 #line 1240 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3445 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3446 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3447 (yyval.String) = (yyvsp[-5].String);
3452 #line 1245 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3454 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3455 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3456 (yyval.String) = (yyvsp[-7].String);
3461 #line 1250 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3463 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3464 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3465 (yyval.String) = (yyvsp[-7].String);
3470 #line 1260 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3472 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
3473 (yyvsp[0].Const).destroy();
3474 (yyval.String) = (yyvsp[-2].String);
3479 #line 1265 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3480 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
3484 #line 1280 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3490 #line 1285 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3497 #line 1288 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3499 *O << *(yyvsp[0].String) << '\n';
3500 delete (yyvsp[0].String);
3506 #line 1293 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3508 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3514 #line 1297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3516 *O << "implementation\n";
3522 #line 1301 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3523 { (yyval.String) = 0; ;}
3527 #line 1303 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3528 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3532 #line 1306 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3534 EnumeratedTypes.push_back((yyvsp[0].Type));
3535 if (!(yyvsp[-2].String)->empty()) {
3536 NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Type);
3537 *O << *(yyvsp[-2].String) << " = ";
3539 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3540 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
3546 #line 1316 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3547 { // Function prototypes can be in const pool
3548 *O << *(yyvsp[0].String) << '\n';
3549 delete (yyvsp[0].String);
3555 #line 1321 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3556 { // Asm blocks can be in the const pool
3557 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3558 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3564 #line 1326 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3566 if (!(yyvsp[-4].String)->empty()) {
3567 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const).type->getPointerType(),
3568 *(yyvsp[-2].String) == "constant");
3569 *O << Name << " = ";
3571 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
3572 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3578 #line 1336 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3580 if (!(yyvsp[-4].String)->empty()) {
3581 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3582 *(yyvsp[-2].String) == "constant");
3583 *O << Name << " = ";
3585 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3586 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3592 #line 1346 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3594 if (!(yyvsp[-4].String)->empty()) {
3595 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3596 *(yyvsp[-2].String) == "constant");
3597 *O << Name << " = ";
3599 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3600 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3606 #line 1356 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3608 if (!(yyvsp[-4].String)->empty()) {
3609 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3610 *(yyvsp[-2].String) == "constant");
3611 *O << Name << " = ";
3613 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3614 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3620 #line 1366 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3622 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3623 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3629 #line 1371 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3631 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3632 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3638 #line 1376 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3645 #line 1386 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3647 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3648 delete (yyvsp[0].String);
3649 (yyval.String) = (yyvsp[-2].String);
3654 #line 1391 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3656 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3657 if (*(yyvsp[0].String) == "64")
3659 delete (yyvsp[0].String);
3660 (yyval.String) = (yyvsp[-2].String);
3665 #line 1398 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3667 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3668 delete (yyvsp[0].String);
3669 (yyval.String) = (yyvsp[-2].String);
3674 #line 1403 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3676 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3677 delete (yyvsp[0].String);
3678 (yyval.String) = (yyvsp[-2].String);
3683 #line 1410 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3685 (yyvsp[-1].String)->insert(0, "[ ");
3686 *(yyvsp[-1].String) += " ]";
3687 (yyval.String) = (yyvsp[-1].String);
3692 #line 1417 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3694 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3695 delete (yyvsp[0].String);
3696 (yyval.String) = (yyvsp[-2].String);
3701 #line 1423 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3703 (yyval.String) = new std::string();
3708 #line 1432 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3709 { (yyval.String) = new std::string(); ;}
3713 #line 1434 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3715 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3716 if (!(yyvsp[0].String)->empty()) {
3717 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve());
3718 *(yyval.String) += " " + Name;
3720 delete (yyvsp[0].String);
3725 #line 1443 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3727 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3728 delete (yyvsp[0].String);
3733 #line 1447 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3735 (yyval.String) = (yyvsp[0].String);
3740 #line 1451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3742 (yyval.String) = (yyvsp[0].String);
3747 #line 1454 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3749 *(yyvsp[-2].String) += ", ...";
3750 (yyval.String) = (yyvsp[-2].String);
3751 delete (yyvsp[0].String);
3756 #line 1459 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3758 (yyval.String) = (yyvsp[0].String);
3763 #line 1462 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3764 { (yyval.String) = new std::string(); ;}
3768 #line 1465 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3770 if (!(yyvsp[-7].String)->empty()) {
3771 *(yyvsp[-7].String) += " ";
3773 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3774 if (!(yyvsp[-1].String)->empty()) {
3775 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3777 if (!(yyvsp[0].String)->empty()) {
3778 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3780 delete (yyvsp[-5].String);
3781 delete (yyvsp[-3].String);
3782 delete (yyvsp[-1].String);
3783 delete (yyvsp[0].String);
3784 (yyval.String) = (yyvsp[-7].String);
3789 #line 1483 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3790 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3794 #line 1484 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3795 { (yyval.String) = new std::string ("{"); ;}
3799 #line 1487 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3802 if (!(yyvsp[-2].String)->empty()) {
3803 *O << *(yyvsp[-2].String) << ' ';
3805 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3806 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3812 #line 1498 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3813 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3817 #line 1499 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3818 { (yyval.String) = new std::string("}"); ;}
3822 #line 1501 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3824 if ((yyvsp[-1].String))
3825 *O << *(yyvsp[-1].String);
3826 *O << *(yyvsp[0].String) << "\n\n";
3827 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3833 #line 1510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3834 { (yyval.String) = new std::string(); ;}
3838 #line 1516 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3840 if (!(yyvsp[-1].String)->empty())
3841 *(yyvsp[-2].String) += " " + *(yyvsp[-1].String);
3842 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
3843 delete (yyvsp[-1].String);
3844 delete (yyvsp[0].String);
3845 (yyval.String) = (yyvsp[-2].String);
3850 #line 1529 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3851 { (yyval.String) = new std::string(); ;}
3855 #line 1535 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3857 (yyvsp[-1].String)->insert(0, "<");
3858 *(yyvsp[-1].String) += ">";
3859 (yyval.String) = (yyvsp[-1].String);
3864 #line 1541 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3866 if (!(yyvsp[-3].String)->empty()) {
3867 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3869 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3870 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3871 (yyval.String) = (yyvsp[-4].String);
3876 #line 1554 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3878 (yyval.Value).val = (yyvsp[0].String);
3879 (yyval.Value).constant = false;
3880 (yyval.Value).type = 0;
3885 #line 1559 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3887 (yyval.Value).val = (yyvsp[0].String);
3888 (yyval.Value).constant = true;
3889 (yyval.Value).type = 0;
3894 #line 1569 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3896 (yyvsp[-1].Type) = (yyvsp[-1].Type)->resolve();
3897 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
3898 (yyval.Value) = (yyvsp[0].Value);
3899 delete (yyval.Value).val;
3900 (yyval.Value).val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
3901 (yyval.Value).type = (yyvsp[-1].Type);
3906 #line 1578 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3913 #line 1581 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3914 { // Do not allow functions with 0 basic blocks
3920 #line 1589 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3927 #line 1593 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3929 *O << " " << *(yyvsp[0].String) << '\n';
3930 delete (yyvsp[0].String);
3936 #line 1598 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3943 #line 1601 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3945 *O << *(yyvsp[0].String) << '\n';
3946 delete (yyvsp[0].String);
3952 #line 1607 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3953 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3957 #line 1609 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3958 { // Return with a result...
3959 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3960 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3966 #line 1614 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3967 { // Return with no result...
3968 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
3969 delete (yyvsp[-1].String);
3975 #line 1619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3976 { // Unconditional Branch...
3977 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3978 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
3984 #line 1624 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3986 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3987 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
3988 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
3989 << *(yyvsp[0].Value).val << '\n';
3990 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
3996 #line 1632 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3998 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
3999 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4000 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
4001 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy();
4002 delete (yyvsp[-1].String);
4008 #line 1640 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4010 std::string Name = getUniqueName((yyvsp[-5].Value).val, (yyvsp[-6].Type));
4011 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
4012 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value).val << "[]\n";
4013 delete (yyvsp[-7].String); (yyvsp[-5].Value).destroy(); (yyvsp[-2].Value).destroy();
4019 #line 1648 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4021 const TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
4023 if (!(yyvsp[-13].String)->empty()) {
4024 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
4025 *O << Name << " = ";
4027 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value).val << " (";
4028 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
4029 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
4031 if (i+1 < (yyvsp[-7].ValList)->size())
4035 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ' '
4036 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
4037 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
4038 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4044 #line 1669 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4046 *O << " " << *(yyvsp[0].String) << '\n';
4047 delete (yyvsp[0].String);
4053 #line 1674 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4055 *O << " " << *(yyvsp[0].String) << '\n';
4056 delete (yyvsp[0].String);
4062 #line 1680 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4064 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
4065 *(yyvsp[0].Value).val;
4066 delete (yyvsp[-3].String); (yyvsp[0].Value).destroy();
4067 (yyval.String) = (yyvsp[-5].String);
4072 #line 1686 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4074 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
4075 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value).val;
4076 (yyvsp[0].Value).destroy();
4077 (yyval.String) = (yyvsp[-3].String);
4082 #line 1694 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4084 if (!(yyvsp[-1].String)->empty()) {
4085 // Get a unique name for this value, based on its type.
4086 std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value).type);
4087 *(yyvsp[-1].String) = Name + " = ";
4088 if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
4089 // don't actually delete it, just comment it out
4090 (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
4091 delete deleteUselessCastName;
4094 *(yyvsp[-1].String) += *(yyvsp[0].Value).val;
4095 (yyvsp[0].Value).destroy();
4096 deleteUselessCastFlag = false;
4097 (yyval.String) = (yyvsp[-1].String);
4102 #line 1712 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4103 { // Used for PHI nodes
4104 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-5].Type));
4105 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
4106 Name += "," + *(yyvsp[-1].Value).val + "]";
4107 (yyval.Value).val = new std::string(Name);
4108 (yyval.Value).type = (yyvsp[-5].Type);
4109 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4114 #line 1720 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4116 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-6].Value).type);
4117 *(yyvsp[-6].Value).val += ", [" + Name + "," + *(yyvsp[-1].Value).val + "]";
4118 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4119 (yyval.Value) = (yyvsp[-6].Value);
4124 #line 1729 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4126 (yyval.ValList) = new ValueList();
4127 (yyval.ValList)->push_back((yyvsp[0].Value));
4132 #line 1733 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4134 (yyval.ValList) = (yyvsp[-2].ValList);
4135 (yyval.ValList)->push_back((yyvsp[0].Value));
4140 #line 1740 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4141 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4145 #line 1741 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4146 { (yyval.ValList) = new ValueList(); ;}
4150 #line 1745 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4152 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
4153 delete (yyvsp[0].String);
4154 (yyval.String) = (yyvsp[-1].String);
4159 #line 1753 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4161 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
4162 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4163 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4164 (yyval.Value).val = new std::string(op);
4165 *(yyval.Value).val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4166 (yyval.Value).type = (yyvsp[-3].Type);
4167 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4172 #line 1762 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4174 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4175 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4176 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4177 (yyval.Value).val = (yyvsp[-4].String);
4178 (yyval.Value).type = (yyvsp[-3].Type);
4179 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4184 #line 1770 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4186 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4187 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4188 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
4189 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4190 (yyval.Value).val = (yyvsp[-4].String);
4191 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4192 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4197 #line 1779 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4199 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4200 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4201 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4202 (yyval.Value).val = (yyvsp[-5].String);
4203 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4204 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4209 #line 1787 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4211 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4212 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4213 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4214 (yyval.Value).val = (yyvsp[-5].String);
4215 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4216 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4221 #line 1795 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4223 const char* shiftop = (yyvsp[-3].String)->c_str();
4224 if (*(yyvsp[-3].String) == "shr")
4225 shiftop = ((yyvsp[-2].Value).type->isUnsigned()) ? "lshr" : "ashr";
4226 (yyval.Value).val = new std::string(shiftop);
4227 *(yyval.Value).val += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4228 (yyval.Value).type = (yyvsp[-2].Value).type;
4229 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4234 #line 1804 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4236 std::string source = *(yyvsp[-2].Value).val;
4237 const TypeInfo* SrcTy = (yyvsp[-2].Value).type->resolve();
4238 const TypeInfo* DstTy = (yyvsp[0].Type)->resolve();
4239 (yyval.Value).val = new std::string();
4240 (yyval.Value).type = DstTy;
4241 if (*(yyvsp[-3].String) == "cast") {
4242 *(yyval.Value).val += getCastUpgrade(source, SrcTy, DstTy, false);
4244 *(yyval.Value).val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
4246 // Check to see if this is a useless cast of a value to the same name
4247 // and the same type. Such casts will probably cause redefinition errors
4248 // when assembled and perform no code gen action so just remove them.
4249 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
4250 if (SrcTy->isInteger() && DstTy->isInteger() &&
4251 SrcTy->getBitWidth() == DstTy->getBitWidth()) {
4252 deleteUselessCastFlag = true; // Flag the "Inst" rule
4253 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
4254 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
4255 if (pos != std::string::npos) {
4256 // remove the type portion before val
4257 deleteUselessCastName->erase(0, pos);
4260 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
4261 delete (yyvsp[-1].String);
4266 #line 1832 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4268 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4269 (yyval.Value).val = (yyvsp[-5].String);
4270 (yyval.Value).type = (yyvsp[-2].Value).type;
4271 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4276 #line 1838 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4278 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + (yyvsp[0].Type)->getNewTy();
4279 (yyval.Value).val = (yyvsp[-3].String);
4280 (yyval.Value).type = (yyvsp[0].Type);
4281 (yyvsp[-2].Value).destroy();
4286 #line 1844 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4288 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4289 (yyval.Value).val = (yyvsp[-3].String);
4290 (yyvsp[-2].Value).type = (yyvsp[-2].Value).type->resolve();;
4291 (yyval.Value).type = (yyvsp[-2].Value).type->getElementType();
4292 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4297 #line 1851 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4299 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4300 (yyval.Value).val = (yyvsp[-5].String);
4301 (yyval.Value).type = (yyvsp[-4].Value).type;
4302 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4307 #line 1857 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4309 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4310 (yyval.Value).val = (yyvsp[-5].String);
4311 (yyval.Value).type = (yyvsp[-4].Value).type;
4312 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4317 #line 1863 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4319 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4320 (yyval.Value).val = (yyvsp[-1].String);
4321 (yyval.Value).type = (yyvsp[0].Value).type;
4322 delete (yyvsp[0].Value).val;
4327 #line 1869 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4329 // map llvm.isunordered to "fcmp uno"
4330 if (*(yyvsp[-3].Value).val == "%llvm.isunordered.f32" ||
4331 *(yyvsp[-3].Value).val == "%llvm.isunordered.f64") {
4332 (yyval.Value).val = new std::string( "fcmp uno " + *(*(yyvsp[-1].ValList))[0].val + ", ");
4333 size_t pos = (*(yyvsp[-1].ValList))[1].val->find(' ');
4334 assert(pos != std::string::npos && "no space?");
4335 *(yyval.Value).val += (*(yyvsp[-1].ValList))[1].val->substr(pos+1);
4336 (yyval.Value).type = TypeInfo::get("bool", BoolTy);
4338 if (!(yyvsp[-5].String)->empty())
4339 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
4340 if (!(yyvsp[-6].String)->empty())
4341 *(yyvsp[-6].String) += " ";
4342 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value).val + "(";
4343 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
4344 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
4345 *(yyvsp[-6].String) += *VI.val;
4346 if (i+1 < (yyvsp[-1].ValList)->size())
4347 *(yyvsp[-6].String) += ", ";
4350 *(yyvsp[-6].String) += ")";
4351 (yyval.Value).val = (yyvsp[-6].String);
4352 (yyval.Value).type = getFunctionReturnType((yyvsp[-4].Type));
4354 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
4359 #line 1902 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4360 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4364 #line 1903 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4365 { (yyval.ValList) = new ValueList(); ;}
4369 #line 1908 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4370 { (yyval.String) = new std::string(); ;}
4374 #line 1911 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4376 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4377 if (!(yyvsp[0].String)->empty())
4378 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4379 (yyval.Value).val = (yyvsp[-2].String);
4380 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4381 delete (yyvsp[0].String);
4386 #line 1919 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4388 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4389 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4390 if (!(yyvsp[0].String)->empty())
4391 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4392 (yyval.Value).val = (yyvsp[-5].String);
4393 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4394 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4399 #line 1928 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4401 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4402 if (!(yyvsp[0].String)->empty())
4403 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4404 (yyval.Value).val = (yyvsp[-2].String);
4405 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4406 delete (yyvsp[0].String);
4411 #line 1936 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4413 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4414 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4415 if (!(yyvsp[0].String)->empty())
4416 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4417 (yyval.Value).val = (yyvsp[-5].String);
4418 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4419 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4424 #line 1945 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4426 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4427 (yyval.Value).val = (yyvsp[-1].String);
4428 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4429 (yyvsp[0].Value).destroy();
4434 #line 1951 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4436 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4437 if (!(yyvsp[-3].String)->empty())
4438 *(yyvsp[-3].String) += " ";
4439 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4440 (yyval.Value).val = (yyvsp[-3].String);
4441 (yyval.Value).type = (yyvsp[-1].Type)->getElementType();
4442 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4447 #line 1960 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4449 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4450 if (!(yyvsp[-5].String)->empty())
4451 *(yyvsp[-5].String) += " ";
4452 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4453 (yyval.Value).val = (yyvsp[-5].String);
4454 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4455 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4460 #line 1969 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4462 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4463 // Upgrade the indices
4464 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4465 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4466 if (VI.type->isUnsigned() && !VI.isConstant() &&
4467 VI.type->getBitWidth() < 64) {
4468 *O << " %gep_upgrade" << unique << " = zext " << *VI.val
4470 *VI.val = "i64 %gep_upgrade" + llvm::utostr(unique++);
4471 VI.type = TypeInfo::get("i64",ULongTy);
4474 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4475 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4476 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4477 *(yyvsp[-3].String) += ", " + *VI.val;
4479 (yyval.Value).val = (yyvsp[-3].String);
4480 (yyval.Value).type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4481 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
4489 /* Line 1126 of yacc.c. */
4490 #line 4491 "UpgradeParser.tab.c"
4496 YY_STACK_PRINT (yyss, yyssp);
4501 /* Now `shift' the result of the reduction. Determine what state
4502 that goes to, based on the state we popped back to and the rule
4503 number reduced by. */
4507 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4508 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4509 yystate = yytable[yystate];
4511 yystate = yydefgoto[yyn - YYNTOKENS];
4516 /*------------------------------------.
4517 | yyerrlab -- here on detecting error |
4518 `------------------------------------*/
4520 /* If not already recovering from an error, report this error. */
4525 yyn = yypact[yystate];
4527 if (YYPACT_NINF < yyn && yyn < YYLAST)
4529 int yytype = YYTRANSLATE (yychar);
4530 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4531 YYSIZE_T yysize = yysize0;
4533 int yysize_overflow = 0;
4535 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4536 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4540 /* This is so xgettext sees the translatable formats that are
4541 constructed on the fly. */
4542 YY_("syntax error, unexpected %s");
4543 YY_("syntax error, unexpected %s, expecting %s");
4544 YY_("syntax error, unexpected %s, expecting %s or %s");
4545 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4546 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4550 static char const yyunexpected[] = "syntax error, unexpected %s";
4551 static char const yyexpecting[] = ", expecting %s";
4552 static char const yyor[] = " or %s";
4553 char yyformat[sizeof yyunexpected
4554 + sizeof yyexpecting - 1
4555 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4556 * (sizeof yyor - 1))];
4557 char const *yyprefix = yyexpecting;
4559 /* Start YYX at -YYN if negative to avoid negative indexes in
4561 int yyxbegin = yyn < 0 ? -yyn : 0;
4563 /* Stay within bounds of both yycheck and yytname. */
4564 int yychecklim = YYLAST - yyn;
4565 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4568 yyarg[0] = yytname[yytype];
4569 yyfmt = yystpcpy (yyformat, yyunexpected);
4571 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4572 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4574 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4578 yyformat[sizeof yyunexpected - 1] = '\0';
4581 yyarg[yycount++] = yytname[yyx];
4582 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4583 yysize_overflow |= yysize1 < yysize;
4585 yyfmt = yystpcpy (yyfmt, yyprefix);
4589 yyf = YY_(yyformat);
4590 yysize1 = yysize + yystrlen (yyf);
4591 yysize_overflow |= yysize1 < yysize;
4594 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4595 yymsg = (char *) YYSTACK_ALLOC (yysize);
4598 /* Avoid sprintf, as that infringes on the user's name space.
4599 Don't have undefined behavior even if the translation
4600 produced a string with the wrong number of "%s"s. */
4603 while ((*yyp = *yyf))
4605 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4607 yyp += yytnamerr (yyp, yyarg[yyi++]);
4617 YYSTACK_FREE (yymsg);
4621 yyerror (YY_("syntax error"));
4622 goto yyexhaustedlab;
4626 #endif /* YYERROR_VERBOSE */
4627 yyerror (YY_("syntax error"));
4632 if (yyerrstatus == 3)
4634 /* If just tried and failed to reuse look-ahead token after an
4635 error, discard it. */
4637 if (yychar <= YYEOF)
4639 /* Return failure if at end of input. */
4640 if (yychar == YYEOF)
4645 yydestruct ("Error: discarding", yytoken, &yylval);
4650 /* Else will try to reuse look-ahead token after shifting the error
4655 /*---------------------------------------------------.
4656 | yyerrorlab -- error raised explicitly by YYERROR. |
4657 `---------------------------------------------------*/
4660 /* Pacify compilers like GCC when the user code never invokes
4661 YYERROR and the label yyerrorlab therefore never appears in user
4672 /*-------------------------------------------------------------.
4673 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4674 `-------------------------------------------------------------*/
4676 yyerrstatus = 3; /* Each real token shifted decrements this. */
4680 yyn = yypact[yystate];
4681 if (yyn != YYPACT_NINF)
4684 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4692 /* Pop the current state because it cannot handle the error token. */
4697 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4700 YY_STACK_PRINT (yyss, yyssp);
4709 /* Shift the error token. */
4710 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4716 /*-------------------------------------.
4717 | yyacceptlab -- YYACCEPT comes here. |
4718 `-------------------------------------*/
4723 /*-----------------------------------.
4724 | yyabortlab -- YYABORT comes here. |
4725 `-----------------------------------*/
4731 /*-------------------------------------------------.
4732 | yyexhaustedlab -- memory exhaustion comes here. |
4733 `-------------------------------------------------*/
4735 yyerror (YY_("memory exhausted"));
4741 if (yychar != YYEOF && yychar != YYEMPTY)
4742 yydestruct ("Cleanup: discarding lookahead",
4744 while (yyssp != yyss)
4746 yydestruct ("Cleanup: popping",
4747 yystos[*yyssp], yyvsp);
4752 YYSTACK_FREE (yyss);
4758 #line 1992 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4761 int yyerror(const char *ErrorMsg) {
4763 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4764 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4765 std::string errMsg = where + "error: " + std::string(ErrorMsg) +
4767 if (yychar == YYEMPTY || yychar == 0)
4768 errMsg += "end-of-file.";
4770 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4771 std::cerr << "llvm-upgrade: " << errMsg << '\n';
4772 *O << "llvm-upgrade parse failed.\n";
4776 static void warning(const std::string& ErrorMsg) {
4778 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4779 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4780 std::string errMsg = where + "warning: " + std::string(ErrorMsg) +
4782 if (yychar == YYEMPTY || yychar == 0)
4783 errMsg += "end-of-file.";
4785 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4786 std::cerr << "llvm-upgrade: " << errMsg << '\n';