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,
133 X86_STDCALLCC_TOK = 324,
134 X86_FASTCALLCC_TOK = 325,
198 EXTRACTELEMENT = 389,
231 #define ESINT64VAL 272
232 #define EUINT64VAL 273
238 #define ZEROINITIALIZER 279
244 #define STRINGCONSTANT 285
245 #define IMPLEMENTATION 286
254 #define DOTDOTDOT 295
259 #define DLLIMPORT 300
260 #define DLLEXPORT 301
261 #define EXTERN_WEAK 302
262 #define APPENDING 303
267 #define POINTERSIZE 308
271 #define UNINITIALIZED 312
277 #define SIDEEFFECT 318
280 #define CSRETCC_TOK 321
281 #define FASTCC_TOK 322
282 #define COLDCC_TOK 323
283 #define X86_STDCALLCC_TOK 324
284 #define X86_FASTCALLCC_TOK 325
285 #define DATALAYOUT 326
292 #define UNREACHABLE 333
340 #define GETELEMENTPTR 381
348 #define EXTRACTELEMENT 389
349 #define INSERTELEMENT 390
350 #define SHUFFLEVECTOR 391
368 /* Copy the first part of user declarations. */
369 #line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
371 #include "UpgradeInternals.h"
377 #define YYERROR_VERBOSE 1
378 #define YYINCLUDED_STDLIB_H
381 int yylex(); // declaration" of xxx warnings.
385 static std::string CurFilename;
386 static std::ostream *O = 0;
387 std::istream* LexInput = 0;
388 unsigned SizeOfPointer = 32;
389 static uint64_t unique = 1;
391 // This bool controls whether attributes are ever added to function declarations
392 // definitions and calls.
393 static bool AddAttributes = false;
395 // This is set when a DECLARE keyword is recognized so that subsequent parsing
396 // of a function prototype can know if its a declaration or definition.
397 static bool isDeclare = false;
399 // This bool is used to communicate between the InstVal and Inst rules about
400 // whether or not a cast should be deleted. When the flag is set, InstVal has
401 // determined that the cast is a candidate. However, it can only be deleted if
402 // the value being casted is the same value name as the instruction. The Inst
403 // rule makes that comparison if the flag is set and comments out the
404 // instruction if they match.
405 static bool deleteUselessCastFlag = false;
406 static std::string* deleteUselessCastName = 0;
408 typedef std::vector<const TypeInfo*> TypeVector;
409 static TypeVector EnumeratedTypes;
410 typedef std::map<std::string,const TypeInfo*> TypeMap;
411 static TypeMap NamedTypes;
412 typedef std::map<const TypeInfo*,std::string> TypePlaneMap;
413 typedef std::map<std::string,TypePlaneMap> GlobalsTypeMap;
414 static GlobalsTypeMap Globals;
416 static void warning(const std::string& msg);
418 void destroy(ValueList* VL) {
419 while (!VL->empty()) {
420 ValueInfo& VI = VL->back();
427 void UpgradeAssembly(const std::string &infile, std::istream& in,
428 std::ostream &out, bool debug, bool addAttrs)
431 CurFilename = infile;
434 AddAttributes = addAttrs;
438 std::cerr << "Parse failed.\n";
439 out << "llvm-upgrade parse failed.\n";
444 TypeInfo::TypeRegMap TypeInfo::registry;
446 const TypeInfo* TypeInfo::get(const std::string &newType, Types oldType) {
447 TypeInfo* Ty = new TypeInfo();
450 return add_new_type(Ty);
453 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
454 const TypeInfo* eTy, const TypeInfo* rTy) {
455 TypeInfo* Ty= new TypeInfo();
458 Ty->elemTy = const_cast<TypeInfo*>(eTy);
459 Ty->resultTy = const_cast<TypeInfo*>(rTy);
460 return add_new_type(Ty);
463 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
464 const TypeInfo *eTy, uint64_t elems) {
465 TypeInfo* Ty = new TypeInfo();
468 Ty->elemTy = const_cast<TypeInfo*>(eTy);
470 return add_new_type(Ty);
473 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
475 TypeInfo* Ty = new TypeInfo();
479 return add_new_type(Ty);
482 const TypeInfo* TypeInfo::get(const std::string& newType, const TypeInfo* resTy,
484 TypeInfo* Ty = new TypeInfo();
486 Ty->oldTy = FunctionTy;
487 Ty->resultTy = const_cast<TypeInfo*>(resTy);
489 return add_new_type(Ty);
492 const TypeInfo* TypeInfo::resolve() const {
493 if (isUnresolved()) {
494 if (getNewTy()[0] == '%' && isdigit(newTy[1])) {
495 unsigned ref = atoi(&((newTy.c_str())[1])); // skip the %
496 if (ref < EnumeratedTypes.size()) {
497 return EnumeratedTypes[ref];
499 std::string msg("Can't resolve numbered type: ");
501 yyerror(msg.c_str());
504 TypeMap::iterator I = NamedTypes.find(newTy);
505 if (I != NamedTypes.end()) {
508 std::string msg("Cannot resolve type: ");
510 yyerror(msg.c_str());
514 // otherwise its already resolved.
518 bool TypeInfo::operator<(const TypeInfo& that) const {
521 if (oldTy != that.oldTy)
522 return oldTy < that.oldTy;
525 unsigned thisUp = this->getUpRefNum();
526 unsigned thatUp = that.getUpRefNum();
527 return thisUp < thatUp;
531 if (this->nelems != that.nelems)
532 return nelems < that.nelems;
534 const TypeInfo* thisTy = this->elemTy;
535 const TypeInfo* thatTy = that.elemTy;
536 return *thisTy < *thatTy;
539 const TypeInfo* thisTy = this->resultTy;
540 const TypeInfo* thatTy = that.resultTy;
541 if (!thisTy->sameOldTyAs(thatTy))
542 return *thisTy < *thatTy;
546 case PackedStructTy: {
547 if (elements->size() != that.elements->size())
548 return elements->size() < that.elements->size();
549 for (unsigned i = 0; i < elements->size(); i++) {
550 const TypeInfo* thisTy = (*this->elements)[i];
551 const TypeInfo* thatTy = (*that.elements)[i];
552 if (!thisTy->sameOldTyAs(thatTy))
553 return *thisTy < *thatTy;
558 return this->newTy < that.newTy;
565 bool TypeInfo::sameOldTyAs(const TypeInfo* that) const {
570 if (oldTy != that->oldTy)
575 if (nelems != that->nelems)
579 const TypeInfo* thisTy = this->elemTy;
580 const TypeInfo* thatTy = that->elemTy;
581 return thisTy->sameOldTyAs(thatTy);
584 const TypeInfo* thisTy = this->resultTy;
585 const TypeInfo* thatTy = that->resultTy;
586 if (!thisTy->sameOldTyAs(thatTy))
591 case PackedStructTy: {
592 if (elements->size() != that->elements->size())
594 for (unsigned i = 0; i < elements->size(); i++) {
595 const TypeInfo* thisTy = (*this->elements)[i];
596 const TypeInfo* thatTy = (*that->elements)[i];
597 if (!thisTy->sameOldTyAs(thatTy))
603 return this->newTy == that->newTy;
605 return true; // for all others oldTy == that->oldTy is sufficient
610 bool TypeInfo::isUnresolvedDeep() const {
617 return elemTy->isUnresolvedDeep();
620 for (unsigned i = 0; i < elements->size(); i++)
621 if ((*elements)[i]->isUnresolvedDeep())
629 unsigned TypeInfo::getBitWidth() const {
633 case VoidTy : return 0;
634 case BoolTy : return 1;
635 case SByteTy: case UByteTy : return 8;
636 case ShortTy: case UShortTy : return 16;
637 case IntTy: case UIntTy: case FloatTy: return 32;
638 case LongTy: case ULongTy: case DoubleTy : return 64;
639 case PointerTy: return SizeOfPointer; // global var
642 return nelems * elemTy->getBitWidth();
644 case PackedStructTy: {
646 for (unsigned i = 0; i < elements->size(); i++) {
647 size += (*elements)[i]->getBitWidth();
654 const TypeInfo* TypeInfo::getIndexedType(const ValueInfo& VI) const {
656 if (VI.isConstant() && VI.type->isInteger()) {
657 size_t pos = VI.val->find(' ') + 1;
658 if (pos < VI.val->size()) {
659 uint64_t idx = atoi(VI.val->substr(pos).c_str());
660 return (*elements)[idx];
662 yyerror("Invalid value for constant integer");
666 yyerror("Structure requires constant index");
670 if (isArray() || isPacked() || isPointer())
672 yyerror("Invalid type for getIndexedType");
676 void TypeInfo::getSignedness(unsigned &sNum, unsigned &uNum,
677 UpRefStack& stack) const {
680 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy:
681 case FloatTy : case DoubleTy: case UpRefTy:
683 case SByteTy: case ShortTy: case LongTy: case IntTy:
686 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
692 stack.push_back(this);
693 elemTy->getSignedness(sNum, uNum, stack);
696 case PackedStructTy: {
697 stack.push_back(this);
698 for (unsigned i = 0; i < elements->size(); i++) {
699 (*elements)[i]->getSignedness(sNum, uNum, stack);
704 const TypeInfo* Ty = this->resolve();
705 // Let's not recurse.
706 UpRefStack::const_iterator I = stack.begin(), E = stack.end();
707 for ( ; I != E && *I != Ty; ++I)
710 Ty->getSignedness(sNum, uNum, stack);
716 std::string AddSuffix(const std::string& Name, const std::string& Suffix) {
717 if (Name[Name.size()-1] == '"') {
718 std::string Result = Name;
719 Result.insert(Result.size()-1, Suffix);
722 return Name + Suffix;
725 std::string TypeInfo::makeUniqueName(const std::string& BaseName) const {
726 if (BaseName == "\"alloca point\"")
731 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy: case UpRefTy:
732 case FloatTy : case DoubleTy: case UnresolvedTy:
734 case SByteTy: case ShortTy: case LongTy: case IntTy:
735 return AddSuffix(BaseName, ".s");
736 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
737 return AddSuffix(BaseName, ".u");
740 unsigned uNum = 0, sNum = 0;
746 TypeInfo::UpRefStack stack;
747 elemTy->resolve()->getSignedness(sNum, uNum, stack);
751 case PackedStructTy: {
752 for (unsigned i = 0; i < elements->size(); i++) {
753 TypeInfo::UpRefStack stack;
754 (*elements)[i]->resolve()->getSignedness(sNum, uNum, stack);
759 assert(0 && "Invalid Type");
763 if (sNum == 0 && uNum == 0)
767 default: Suffix += ".nada"; break;
768 case PointerTy: Suffix += ".pntr"; break;
769 case PackedTy: Suffix += ".pckd"; break;
770 case ArrayTy: Suffix += ".arry"; break;
771 case StructTy: Suffix += ".strc"; break;
772 case PackedStructTy: Suffix += ".pstr"; break;
775 Suffix += ".s" + llvm::utostr(sNum);
776 Suffix += ".u" + llvm::utostr(uNum);
777 return AddSuffix(BaseName, Suffix);
780 TypeInfo& TypeInfo::operator=(const TypeInfo& that) {
782 nelems = that.nelems;
784 elemTy = that.elemTy;
785 resultTy = that.resultTy;
787 elements = new TypeList(that.elements->size());
788 *elements = *that.elements;
795 const TypeInfo* TypeInfo::add_new_type(TypeInfo* newTy) {
796 TypeRegMap::iterator I = registry.find(newTy);
797 if (I != registry.end()) {
801 registry.insert(newTy);
805 static const char* getCastOpcode(
806 std::string& Source, const TypeInfo* SrcTy, const TypeInfo* DstTy)
808 unsigned SrcBits = SrcTy->getBitWidth();
809 unsigned DstBits = DstTy->getBitWidth();
810 const char* opcode = "bitcast";
811 // Run through the possibilities ...
812 if (DstTy->isIntegral()) { // Casting to integral
813 if (SrcTy->isIntegral()) { // Casting from integral
814 if (DstBits < SrcBits)
816 else if (DstBits > SrcBits) { // its an extension
817 if (SrcTy->isSigned())
818 opcode ="sext"; // signed -> SEXT
820 opcode = "zext"; // unsigned -> ZEXT
822 opcode = "bitcast"; // Same size, No-op cast
824 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
825 if (DstTy->isSigned())
826 opcode = "fptosi"; // FP -> sint
828 opcode = "fptoui"; // FP -> uint
829 } else if (SrcTy->isPacked()) {
830 assert(DstBits == SrcTy->getBitWidth() &&
831 "Casting packed to integer of different width");
832 opcode = "bitcast"; // same size, no-op cast
834 assert(SrcTy->isPointer() &&
835 "Casting from a value that is not first-class type");
836 opcode = "ptrtoint"; // ptr -> int
838 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
839 if (SrcTy->isIntegral()) { // Casting from integral
840 if (SrcTy->isSigned())
841 opcode = "sitofp"; // sint -> FP
843 opcode = "uitofp"; // uint -> FP
844 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
845 if (DstBits < SrcBits) {
846 opcode = "fptrunc"; // FP -> smaller FP
847 } else if (DstBits > SrcBits) {
848 opcode = "fpext"; // FP -> larger FP
850 opcode ="bitcast"; // same size, no-op cast
852 } else if (SrcTy->isPacked()) {
853 assert(DstBits == SrcTy->getBitWidth() &&
854 "Casting packed to floating point of different width");
855 opcode = "bitcast"; // same size, no-op cast
857 assert(0 && "Casting pointer or non-first class to float");
859 } else if (DstTy->isPacked()) {
860 if (SrcTy->isPacked()) {
861 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
862 "Casting packed to packed of different widths");
863 opcode = "bitcast"; // packed -> packed
864 } else if (DstTy->getBitWidth() == SrcBits) {
865 opcode = "bitcast"; // float/int -> packed
867 assert(!"Illegal cast to packed (wrong type or size)");
869 } else if (DstTy->isPointer()) {
870 if (SrcTy->isPointer()) {
871 opcode = "bitcast"; // ptr -> ptr
872 } else if (SrcTy->isIntegral()) {
873 opcode = "inttoptr"; // int -> ptr
875 assert(!"Casting invalid type to pointer");
878 assert(!"Casting to type that is not first-class");
883 static std::string getCastUpgrade(const std::string& Src, const TypeInfo* SrcTy,
884 const TypeInfo* DstTy, bool isConst)
887 std::string Source = Src;
888 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
889 // fp -> ptr cast is no longer supported but we must upgrade this
890 // by doing a double cast: fp -> int -> ptr
892 Source = "i64 fptoui(" + Source + " to i64)";
894 *O << " %cast_upgrade" << unique << " = fptoui " << Source
896 Source = "i64 %cast_upgrade" + llvm::utostr(unique);
898 // Update the SrcTy for the getCastOpcode call below
899 SrcTy = TypeInfo::get("i64", ULongTy);
900 } else if (DstTy->isBool()) {
901 // cast type %x to bool was previously defined as setne type %x, null
902 // The cast semantic is now to truncate, not compare so we must retain
903 // the original intent by replacing the cast with a setne
904 const char* comparator = SrcTy->isPointer() ? ", null" :
905 (SrcTy->isFloatingPoint() ? ", 0.0" :
906 (SrcTy->isBool() ? ", false" : ", 0"));
907 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
909 Result = "(" + Source + comparator + ")";
910 Result = compareOp + Result;
912 Result = compareOp + Source + comparator;
913 return Result; // skip cast processing below
915 SrcTy = SrcTy->resolve();
916 DstTy = DstTy->resolve();
917 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
919 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
921 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
925 const char* getDivRemOpcode(const std::string& opcode, const TypeInfo* TI) {
926 const char* op = opcode.c_str();
927 const TypeInfo* Ty = TI->resolve();
929 Ty = Ty->getElementType();
931 if (Ty->isFloatingPoint())
933 else if (Ty->isUnsigned())
935 else if (Ty->isSigned())
938 yyerror("Invalid type for div instruction");
939 else if (opcode == "rem")
940 if (Ty->isFloatingPoint())
942 else if (Ty->isUnsigned())
944 else if (Ty->isSigned())
947 yyerror("Invalid type for rem instruction");
952 getCompareOp(const std::string& setcc, const TypeInfo* TI) {
953 assert(setcc.length() == 5);
956 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
957 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
958 std::string result("xcmp xxx");
961 if (TI->isFloatingPoint()) {
965 result[5] = 'u'; // NE maps to unordered
967 result[5] = 'o'; // everything else maps to ordered
968 } else if (TI->isIntegral() || TI->isPointer()) {
970 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
972 else if (TI->isSigned())
974 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
977 yyerror("Invalid integral type for setcc");
982 static const TypeInfo* getFunctionReturnType(const TypeInfo* PFTy) {
983 PFTy = PFTy->resolve();
984 if (PFTy->isPointer()) {
985 const TypeInfo* ElemTy = PFTy->getElementType();
986 ElemTy = ElemTy->resolve();
987 if (ElemTy->isFunction())
988 return ElemTy->getResultType();
989 } else if (PFTy->isFunction()) {
990 return PFTy->getResultType();
995 static const TypeInfo* ResolveUpReference(const TypeInfo* Ty,
996 TypeInfo::UpRefStack* stack) {
997 assert(Ty->isUpReference() && "Can't resolve a non-upreference");
998 unsigned upref = Ty->getUpRefNum();
999 assert(upref < stack->size() && "Invalid up reference");
1000 return (*stack)[upref - stack->size() - 1];
1003 static const TypeInfo* getGEPIndexedType(const TypeInfo* PTy, ValueList* idxs) {
1004 const TypeInfo* Result = PTy = PTy->resolve();
1005 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
1006 TypeInfo::UpRefStack stack;
1007 for (unsigned i = 0; i < idxs->size(); ++i) {
1008 if (Result->isComposite()) {
1009 Result = Result->getIndexedType((*idxs)[i]);
1010 Result = Result->resolve();
1011 stack.push_back(Result);
1013 yyerror("Invalid type for index");
1015 // Resolve upreferences so we can return a more natural type
1016 if (Result->isPointer()) {
1017 if (Result->getElementType()->isUpReference()) {
1018 stack.push_back(Result);
1019 Result = ResolveUpReference(Result->getElementType(), &stack);
1021 } else if (Result->isUpReference()) {
1022 Result = ResolveUpReference(Result->getElementType(), &stack);
1024 return Result->getPointerType();
1028 // This function handles appending .u or .s to integer value names that
1029 // were previously unsigned or signed, respectively. This avoids name
1030 // collisions since the unsigned and signed type planes have collapsed
1031 // into a single signless type plane.
1032 static std::string getUniqueName(const std::string *Name, const TypeInfo* Ty,
1033 bool isGlobal = false, bool isDef = false) {
1035 // If its not a symbolic name, don't modify it, probably a constant val.
1036 if ((*Name)[0] != '%' && (*Name)[0] != '"')
1039 // If its a numeric reference, just leave it alone.
1040 if (isdigit((*Name)[1]))
1046 // If its a global name, get its uniquified name, if any
1047 GlobalsTypeMap::iterator GI = Globals.find(*Name);
1048 if (GI != Globals.end()) {
1049 TypePlaneMap::iterator TPI = GI->second.begin();
1050 TypePlaneMap::iterator TPE = GI->second.end();
1051 for ( ; TPI != TPE ; ++TPI) {
1052 if (TPI->first->sameNewTyAs(Ty))
1058 // We didn't find a global name, but if its supposed to be global then all
1059 // we can do is return the name. This is probably a forward reference of a
1060 // global value that hasn't been defined yet. Since we have no definition
1061 // we don't know its linkage class. Just assume its an external and the name
1062 // shouldn't change.
1066 // Default the result to the current name
1067 std::string Result = Ty->makeUniqueName(*Name);
1072 static unsigned UniqueNameCounter = 0;
1074 std::string getGlobalName(const std::string* Name, const std::string Linkage,
1075 const TypeInfo* Ty, bool isConstant) {
1076 // Default to given name
1077 std::string Result = *Name;
1078 // Look up the name in the Globals Map
1079 GlobalsTypeMap::iterator GI = Globals.find(*Name);
1080 // Did we see this global name before?
1081 if (GI != Globals.end()) {
1082 if (Ty->isUnresolvedDeep()) {
1083 // The Gval's type is unresolved. Consequently, we can't disambiguate it
1084 // by type. We'll just change its name and emit a warning.
1085 warning("Cannot disambiguate global value '" + *Name +
1086 "' because type '" + Ty->getNewTy() + "'is unresolved.\n");
1087 Result = *Name + ".unique";
1088 UniqueNameCounter++;
1089 Result += llvm::utostr(UniqueNameCounter);
1092 TypePlaneMap::iterator TPI = GI->second.find(Ty);
1093 if (TPI != GI->second.end()) {
1094 // We found an existing name of the same old type. This isn't allowed
1095 // in LLVM 2.0. Consequently, we must alter the name of the global so it
1096 // can at least compile. References to the global will yield the first
1097 // definition, which is okay. We also must warn about this.
1098 Result = *Name + ".unique";
1099 UniqueNameCounter++;
1100 Result += llvm::utostr(UniqueNameCounter);
1101 warning(std::string("Global variable '") + *Name + "' was renamed to '"+
1104 // There isn't an existing definition for this name according to the
1105 // old types. Now search the TypePlanMap for types with the same new
1107 TypePlaneMap::iterator TPI = GI->second.begin();
1108 TypePlaneMap::iterator TPE = GI->second.end();
1109 for ( ; TPI != TPE; ++TPI) {
1110 if (TPI->first->sameNewTyAs(Ty)) {
1111 // The new types are the same but the old types are different so
1112 // this is a global name collision resulting from type planes
1114 if (Linkage == "external" || Linkage == "dllimport" ||
1115 Linkage == "extern_weak" || Linkage == "") {
1116 // The linkage of this gval is external so we can't reliably
1117 // rename it because it could potentially create a linking
1118 // problem. However, we can't leave the name conflict in the
1119 // output either or it won't assemble with LLVM 2.0. So, all we
1120 // can do is rename this one to something unique and emit a
1121 // warning about the problem.
1122 Result = *Name + ".unique";
1123 UniqueNameCounter++;
1124 Result += llvm::utostr(UniqueNameCounter);
1125 warning("Renaming global value '" + *Name + "' to '" + Result +
1126 "' may cause linkage errors.");
1129 // Its linkage is internal and its type is known so we can
1130 // disambiguate the name collision successfully based on the type.
1131 Result = getUniqueName(Name, Ty);
1132 TPI->second = Result;
1137 // We didn't find an entry in the type plane with the same new type and
1138 // the old types differ so this is a new type plane for this global
1139 // variable. We just fall through to the logic below which inserts
1145 // Its a new global name, if it is external we can't change it
1146 if (isConstant || Linkage == "external" || Linkage == "dllimport" ||
1147 Linkage == "extern_weak" || Linkage == "") {
1148 Globals[Result][Ty] = Result;
1152 // Its a new global name, and it is internal, change the name to make it
1153 // unique for its type.
1154 // Result = getUniqueName(Name, Ty);
1155 Globals[*Name][Ty] = Result;
1160 /* Enabling traces. */
1165 /* Enabling verbose error messages. */
1166 #ifdef YYERROR_VERBOSE
1167 # undef YYERROR_VERBOSE
1168 # define YYERROR_VERBOSE 1
1170 # define YYERROR_VERBOSE 0
1173 /* Enabling the token table. */
1174 #ifndef YYTOKEN_TABLE
1175 # define YYTOKEN_TABLE 0
1178 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1179 #line 806 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
1180 typedef union YYSTYPE {
1181 std::string* String;
1182 const TypeInfo* Type;
1188 /* Line 196 of yacc.c. */
1189 #line 1190 "UpgradeParser.tab.c"
1190 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1191 # define YYSTYPE_IS_DECLARED 1
1192 # define YYSTYPE_IS_TRIVIAL 1
1197 /* Copy the second part of user declarations. */
1200 /* Line 219 of yacc.c. */
1201 #line 1202 "UpgradeParser.tab.c"
1203 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1204 # define YYSIZE_T __SIZE_TYPE__
1206 #if ! defined (YYSIZE_T) && defined (size_t)
1207 # define YYSIZE_T size_t
1209 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1210 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1211 # define YYSIZE_T size_t
1213 #if ! defined (YYSIZE_T)
1214 # define YYSIZE_T unsigned int
1220 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1221 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1225 # define YY_(msgid) msgid
1229 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1231 /* The parser invokes alloca or malloc; define the necessary symbols. */
1233 # ifdef YYSTACK_USE_ALLOCA
1234 # if YYSTACK_USE_ALLOCA
1236 # define YYSTACK_ALLOC __builtin_alloca
1238 # define YYSTACK_ALLOC alloca
1239 # if defined (__STDC__) || defined (__cplusplus)
1240 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1241 # define YYINCLUDED_STDLIB_H
1247 # ifdef YYSTACK_ALLOC
1248 /* Pacify GCC's `empty if-body' warning. */
1249 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1250 # ifndef YYSTACK_ALLOC_MAXIMUM
1251 /* The OS might guarantee only one guard page at the bottom of the stack,
1252 and a page size can be as small as 4096 bytes. So we cannot safely
1253 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1254 to allow for a few compiler-allocated temporary stack slots. */
1255 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1258 # define YYSTACK_ALLOC YYMALLOC
1259 # define YYSTACK_FREE YYFREE
1260 # ifndef YYSTACK_ALLOC_MAXIMUM
1261 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1267 # define YYMALLOC malloc
1268 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1269 && (defined (__STDC__) || defined (__cplusplus)))
1270 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1274 # define YYFREE free
1275 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1276 && (defined (__STDC__) || defined (__cplusplus)))
1277 void free (void *); /* INFRINGES ON USER NAME SPACE */
1284 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1287 #if (! defined (yyoverflow) \
1288 && (! defined (__cplusplus) \
1289 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1291 /* A type that is properly aligned for any stack member. */
1298 /* The size of the maximum gap between one aligned stack and the next. */
1299 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1301 /* The size of an array large to enough to hold all stacks, each with
1303 # define YYSTACK_BYTES(N) \
1304 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
1305 + YYSTACK_GAP_MAXIMUM)
1307 /* Copy COUNT objects from FROM to TO. The source and destination do
1310 # if defined (__GNUC__) && 1 < __GNUC__
1311 # define YYCOPY(To, From, Count) \
1312 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1314 # define YYCOPY(To, From, Count) \
1318 for (yyi = 0; yyi < (Count); yyi++) \
1319 (To)[yyi] = (From)[yyi]; \
1325 /* Relocate STACK from its old location to the new one. The
1326 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1327 elements in the stack, and YYPTR gives the new location of the
1328 stack. Advance YYPTR to a properly aligned location for the next
1330 # define YYSTACK_RELOCATE(Stack) \
1333 YYSIZE_T yynewbytes; \
1334 YYCOPY (&yyptr->Stack, Stack, yysize); \
1335 Stack = &yyptr->Stack; \
1336 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1337 yyptr += yynewbytes / sizeof (*yyptr); \
1343 #if defined (__STDC__) || defined (__cplusplus)
1344 typedef signed char yysigned_char;
1346 typedef short int yysigned_char;
1349 /* YYFINAL -- State number of the termination state. */
1351 /* YYLAST -- Last index in YYTABLE. */
1354 /* YYNTOKENS -- Number of terminals. */
1355 #define YYNTOKENS 164
1356 /* YYNNTS -- Number of nonterminals. */
1358 /* YYNRULES -- Number of rules. */
1359 #define YYNRULES 301
1360 /* YYNRULES -- Number of states. */
1361 #define YYNSTATES 585
1363 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1364 #define YYUNDEFTOK 2
1365 #define YYMAXUTOK 404
1367 #define YYTRANSLATE(YYX) \
1368 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1370 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1371 static const unsigned char yytranslate[] =
1373 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1377 153, 154, 162, 2, 151, 2, 2, 2, 2, 2,
1378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1379 158, 150, 159, 2, 2, 2, 2, 2, 2, 2,
1380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1382 2, 155, 152, 157, 2, 2, 2, 2, 2, 163,
1383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1385 156, 2, 2, 160, 2, 161, 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, 2, 2, 2, 2,
1397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1398 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1399 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1400 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1401 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1402 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1403 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1404 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1405 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1406 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1407 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1408 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1409 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1410 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1411 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1412 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1413 145, 146, 147, 148, 149
1417 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1419 static const unsigned short int yyprhs[] =
1421 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1422 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1423 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1424 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1425 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1426 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1427 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
1428 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
1429 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
1430 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
1431 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
1432 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
1433 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
1434 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
1435 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
1436 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
1437 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
1438 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
1439 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
1440 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
1441 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
1442 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
1443 619, 623, 625, 627, 631, 632, 634, 636, 637, 642,
1444 643, 645, 647, 649, 651, 653, 655, 657, 659, 661,
1445 665, 667, 673, 675, 677, 679, 681, 684, 687, 689,
1446 692, 695, 696, 698, 700, 702, 705, 708, 712, 722,
1447 732, 741, 756, 758, 760, 767, 773, 776, 783, 791,
1448 793, 797, 799, 800, 803, 805, 811, 817, 823, 830,
1449 837, 842, 847, 854, 859, 864, 871, 878, 881, 889,
1450 891, 894, 895, 897, 898, 902, 909, 913, 920, 923,
1454 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1455 static const short int yyrhs[] =
1457 198, 0, -1, 19, -1, 20, -1, 17, -1, 18,
1458 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1459 -1, 84, -1, 85, -1, 86, -1, 87, -1, 88,
1460 -1, 89, -1, 90, -1, 91, -1, 92, -1, 93,
1461 -1, 94, -1, 95, -1, 96, -1, 97, -1, 98,
1462 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1463 -1, 106, -1, 117, -1, 118, -1, 119, -1, 120,
1464 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1465 -1, 112, -1, 113, -1, 114, -1, 115, -1, 116,
1466 -1, 117, -1, 118, -1, 119, -1, 120, -1, 25,
1467 -1, 26, -1, 129, -1, 130, -1, 131, -1, 132,
1468 -1, 138, -1, 139, -1, 140, -1, 141, -1, 142,
1469 -1, 143, -1, 144, -1, 145, -1, 146, -1, 147,
1470 -1, 148, -1, 149, -1, 137, -1, 11, -1, 9,
1471 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
1472 -1, 6, -1, 174, -1, 175, -1, 13, -1, 14,
1473 -1, 207, 150, -1, -1, 42, -1, 43, -1, 44,
1474 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
1475 65, -1, 66, -1, 67, -1, 68, -1, 69, -1,
1476 70, -1, 64, 18, -1, -1, -1, 56, 18, -1,
1477 -1, 151, 56, 18, -1, 37, 30, -1, -1, 183,
1478 -1, -1, 151, 186, 185, -1, 183, -1, 56, 18,
1479 -1, 189, -1, 3, -1, 191, -1, 3, -1, 191,
1480 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
1481 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
1482 -1, 14, -1, 15, -1, 16, -1, 222, -1, 190,
1483 -1, 152, 18, -1, 188, 153, 193, 154, -1, 155,
1484 18, 156, 191, 157, -1, 158, 18, 156, 191, 159,
1485 -1, 160, 192, 161, -1, 160, 161, -1, 158, 160,
1486 192, 161, 159, -1, 158, 160, 161, 159, -1, 191,
1487 162, -1, 191, -1, 192, 151, 191, -1, 192, -1,
1488 192, 151, 40, -1, 40, -1, -1, 189, 155, 196,
1489 157, -1, 189, 155, 157, -1, 189, 163, 30, -1,
1490 189, 158, 196, 159, -1, 189, 160, 196, 161, -1,
1491 189, 160, 161, -1, 189, 22, -1, 189, 23, -1,
1492 189, 222, -1, 189, 195, -1, 189, 24, -1, 174,
1493 166, -1, 175, 166, -1, 4, 25, -1, 4, 26,
1494 -1, 177, 21, -1, 173, 153, 194, 39, 189, 154,
1495 -1, 126, 153, 194, 237, 154, -1, 128, 153, 194,
1496 151, 194, 151, 194, 154, -1, 167, 153, 194, 151,
1497 194, 154, -1, 168, 153, 194, 151, 194, 154, -1,
1498 169, 153, 194, 151, 194, 154, -1, 99, 170, 153,
1499 194, 151, 194, 154, -1, 100, 171, 153, 194, 151,
1500 194, 154, -1, 172, 153, 194, 151, 194, 154, -1,
1501 134, 153, 194, 151, 194, 154, -1, 135, 153, 194,
1502 151, 194, 151, 194, 154, -1, 136, 153, 194, 151,
1503 194, 151, 194, 154, -1, 196, 151, 194, -1, 194,
1504 -1, 35, -1, 36, -1, 199, -1, 199, 216, -1,
1505 199, 218, -1, 199, 62, 61, 202, -1, 199, 31,
1506 -1, 201, -1, 49, -1, 57, -1, 201, 178, 27,
1507 187, -1, 201, 218, -1, 201, 62, 61, 202, -1,
1508 201, 178, 179, 197, 194, 185, -1, 201, 178, 200,
1509 197, 189, 185, -1, 201, 178, 45, 197, 189, 185,
1510 -1, 201, 178, 47, 197, 189, 185, -1, 201, 50,
1511 204, -1, 201, 58, 150, 205, -1, -1, 30, -1,
1512 55, -1, 54, -1, 52, 150, 203, -1, 53, 150,
1513 18, -1, 51, 150, 30, -1, 71, 150, 30, -1,
1514 155, 206, 157, -1, 206, 151, 30, -1, 30, -1,
1515 -1, 28, -1, 30, -1, 207, -1, -1, 189, 208,
1516 -1, 210, 151, 209, -1, 209, -1, 210, -1, 210,
1517 151, 40, -1, 40, -1, -1, 180, 187, 207, 153,
1518 211, 154, 184, 181, -1, 32, -1, 160, -1, 179,
1519 212, 213, -1, 33, -1, 161, -1, 214, 225, 215,
1520 -1, -1, 45, -1, 47, -1, -1, 34, 219, 217,
1521 212, -1, -1, 63, -1, 17, -1, 18, -1, 21,
1522 -1, 25, -1, 26, -1, 22, -1, 23, -1, 24,
1523 -1, 158, 196, 159, -1, 195, -1, 61, 220, 30,
1524 151, 30, -1, 165, -1, 207, -1, 222, -1, 221,
1525 -1, 189, 223, -1, 225, 226, -1, 226, -1, 227,
1526 229, -1, 227, 231, -1, -1, 29, -1, 77, -1,
1527 76, -1, 72, 224, -1, 72, 3, -1, 73, 15,
1528 223, -1, 73, 4, 223, 151, 15, 223, 151, 15,
1529 223, -1, 74, 176, 223, 151, 15, 223, 155, 230,
1530 157, -1, 74, 176, 223, 151, 15, 223, 155, 157,
1531 -1, 178, 75, 180, 187, 223, 153, 234, 154, 39,
1532 15, 223, 228, 15, 223, -1, 228, -1, 78, -1,
1533 230, 176, 221, 151, 15, 223, -1, 176, 221, 151,
1534 15, 223, -1, 178, 236, -1, 189, 155, 223, 151,
1535 223, 157, -1, 232, 151, 155, 223, 151, 223, 157,
1536 -1, 224, -1, 233, 151, 224, -1, 233, -1, -1,
1537 60, 59, -1, 59, -1, 167, 189, 223, 151, 223,
1538 -1, 168, 189, 223, 151, 223, -1, 169, 189, 223,
1539 151, 223, -1, 99, 170, 189, 223, 151, 223, -1,
1540 100, 171, 189, 223, 151, 223, -1, 172, 224, 151,
1541 224, -1, 173, 224, 39, 189, -1, 128, 224, 151,
1542 224, 151, 224, -1, 133, 224, 151, 189, -1, 134,
1543 224, 151, 224, -1, 135, 224, 151, 224, 151, 224,
1544 -1, 136, 224, 151, 224, 151, 224, -1, 127, 232,
1545 -1, 235, 180, 187, 223, 153, 234, 154, -1, 239,
1546 -1, 151, 233, -1, -1, 38, -1, -1, 121, 189,
1547 182, -1, 121, 189, 151, 10, 223, 182, -1, 122,
1548 189, 182, -1, 122, 189, 151, 10, 223, 182, -1,
1549 123, 224, -1, 238, 124, 189, 223, -1, 238, 125,
1550 224, 151, 189, 223, -1, 126, 189, 223, 237, -1
1553 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1554 static const unsigned short int yyrline[] =
1556 0, 871, 871, 871, 872, 872, 876, 876, 876, 876,
1557 876, 876, 876, 877, 877, 877, 877, 878, 878, 878,
1558 879, 879, 879, 879, 879, 879, 880, 880, 880, 880,
1559 880, 880, 880, 880, 880, 880, 881, 881, 881, 881,
1560 881, 881, 881, 881, 881, 881, 882, 882, 882, 882,
1561 882, 882, 883, 883, 883, 883, 884, 884, 884, 884,
1562 884, 884, 884, 885, 885, 885, 885, 885, 885, 890,
1563 890, 890, 890, 891, 891, 891, 891, 892, 892, 893,
1564 893, 896, 899, 904, 904, 904, 904, 904, 904, 905,
1565 906, 909, 909, 909, 909, 909, 910, 911, 916, 921,
1566 922, 925, 926, 934, 940, 941, 944, 945, 954, 955,
1567 968, 968, 969, 969, 970, 974, 974, 974, 974, 974,
1568 974, 974, 975, 975, 975, 975, 975, 977, 980, 983,
1569 986, 990, 1003, 1009, 1015, 1025, 1028, 1038, 1041, 1049,
1570 1053, 1060, 1061, 1066, 1071, 1081, 1087, 1092, 1098, 1104,
1571 1110, 1115, 1121, 1127, 1134, 1140, 1146, 1152, 1158, 1164,
1572 1170, 1178, 1192, 1204, 1209, 1215, 1220, 1226, 1231, 1236,
1573 1244, 1249, 1254, 1264, 1269, 1274, 1274, 1284, 1289, 1292,
1574 1297, 1301, 1305, 1307, 1307, 1310, 1320, 1325, 1330, 1340,
1575 1350, 1360, 1370, 1375, 1380, 1385, 1387, 1387, 1390, 1395,
1576 1402, 1407, 1414, 1421, 1426, 1427, 1435, 1435, 1436, 1436,
1577 1438, 1447, 1451, 1455, 1458, 1463, 1466, 1469, 1492, 1493,
1578 1496, 1507, 1508, 1510, 1519, 1520, 1521, 1525, 1525, 1539,
1579 1540, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1544, 1545,
1580 1550, 1551, 1560, 1560, 1564, 1569, 1579, 1588, 1591, 1599,
1581 1603, 1608, 1611, 1617, 1617, 1619, 1624, 1629, 1634, 1642,
1582 1650, 1657, 1679, 1684, 1690, 1696, 1704, 1722, 1730, 1739,
1583 1743, 1750, 1751, 1755, 1760, 1763, 1772, 1780, 1789, 1797,
1584 1805, 1814, 1842, 1848, 1854, 1861, 1867, 1873, 1879, 1926,
1585 1931, 1932, 1936, 1937, 1940, 1948, 1957, 1965, 1974, 1980,
1590 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1591 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1592 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1593 static const char *const yytname[] =
1595 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1596 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1597 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1598 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1599 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1600 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1601 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1602 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "EXTERNAL",
1603 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1604 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1605 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1606 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1607 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1608 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1609 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1610 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1611 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1612 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1613 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1614 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1615 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1616 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1617 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1618 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1619 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1620 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1621 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1622 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1623 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1624 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1625 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1626 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1627 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1628 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1629 "FunctionProto", "@1", "OptSideEffect", "ConstValueRef",
1630 "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
1631 "BasicBlock", "InstructionList", "Unwind", "BBTerminatorInst",
1632 "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE",
1633 "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0
1638 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1640 static const unsigned short int yytoknum[] =
1642 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1643 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1644 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1645 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1646 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1647 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1648 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1649 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1650 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1651 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1652 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1653 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1654 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1655 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1656 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1657 61, 44, 92, 40, 41, 91, 120, 93, 60, 62,
1662 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1663 static const unsigned char yyr1[] =
1665 0, 164, 165, 165, 166, 166, 167, 167, 167, 167,
1666 167, 167, 167, 167, 167, 167, 167, 168, 168, 168,
1667 169, 169, 169, 169, 169, 169, 170, 170, 170, 170,
1668 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1669 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1670 171, 171, 172, 172, 172, 172, 173, 173, 173, 173,
1671 173, 173, 173, 173, 173, 173, 173, 173, 173, 174,
1672 174, 174, 174, 175, 175, 175, 175, 176, 176, 177,
1673 177, 178, 178, 179, 179, 179, 179, 179, 179, 179,
1674 179, 180, 180, 180, 180, 180, 180, 180, 180, 181,
1675 181, 182, 182, 183, 184, 184, 185, 185, 186, 186,
1676 187, 187, 188, 188, 189, 190, 190, 190, 190, 190,
1677 190, 190, 190, 190, 190, 190, 190, 191, 191, 191,
1678 191, 191, 191, 191, 191, 191, 191, 191, 191, 192,
1679 192, 193, 193, 193, 193, 194, 194, 194, 194, 194,
1680 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
1681 194, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1682 195, 195, 195, 196, 196, 197, 197, 198, 199, 199,
1683 199, 199, 199, 200, 200, 201, 201, 201, 201, 201,
1684 201, 201, 201, 201, 201, 202, 203, 203, 204, 204,
1685 204, 204, 205, 206, 206, 206, 207, 207, 208, 208,
1686 209, 210, 210, 211, 211, 211, 211, 212, 213, 213,
1687 214, 215, 215, 216, 217, 217, 217, 219, 218, 220,
1688 220, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1689 221, 221, 222, 222, 223, 223, 224, 225, 225, 226,
1690 227, 227, 227, 228, 228, 229, 229, 229, 229, 229,
1691 229, 229, 229, 229, 230, 230, 231, 232, 232, 233,
1692 233, 234, 234, 235, 235, 236, 236, 236, 236, 236,
1693 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1694 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1698 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1699 static const unsigned char yyr2[] =
1701 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1702 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1703 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1704 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1705 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1706 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1707 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1708 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1709 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1710 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1711 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1712 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1713 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1714 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1715 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1716 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1717 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1718 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1719 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1720 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1721 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1722 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1723 3, 1, 1, 3, 0, 1, 1, 0, 4, 0,
1724 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1725 1, 5, 1, 1, 1, 1, 2, 2, 1, 2,
1726 2, 0, 1, 1, 1, 2, 2, 3, 9, 9,
1727 8, 14, 1, 1, 6, 5, 2, 6, 7, 1,
1728 3, 1, 0, 2, 1, 5, 5, 5, 6, 6,
1729 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1730 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1734 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1735 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1736 means the default is an error. */
1737 static const unsigned short int yydefact[] =
1739 194, 0, 90, 182, 1, 181, 227, 83, 84, 85,
1740 87, 88, 89, 86, 0, 98, 251, 178, 179, 206,
1741 207, 0, 0, 0, 90, 0, 186, 224, 0, 0,
1742 91, 92, 93, 94, 95, 96, 0, 0, 252, 251,
1743 248, 82, 0, 0, 0, 0, 192, 0, 0, 0,
1744 0, 0, 183, 184, 0, 0, 81, 225, 226, 98,
1745 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1746 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1747 0, 0, 0, 242, 0, 0, 110, 129, 114, 243,
1748 128, 218, 219, 220, 221, 222, 223, 247, 0, 0,
1749 0, 254, 253, 263, 293, 262, 249, 250, 0, 0,
1750 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1751 0, 0, 228, 130, 0, 0, 0, 113, 135, 139,
1752 0, 0, 144, 138, 256, 0, 255, 0, 0, 72,
1753 76, 71, 75, 70, 74, 69, 73, 77, 78, 0,
1754 292, 274, 0, 98, 6, 7, 8, 9, 10, 11,
1755 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1756 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1757 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1758 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1759 65, 66, 67, 0, 0, 0, 0, 0, 98, 266,
1760 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1761 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1762 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1763 0, 0, 0, 0, 134, 216, 143, 141, 0, 231,
1764 232, 233, 236, 237, 238, 234, 235, 229, 0, 0,
1765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1766 0, 240, 245, 244, 246, 0, 257, 0, 273, 0,
1767 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1768 0, 50, 51, 36, 37, 38, 39, 40, 41, 42,
1769 43, 44, 45, 46, 47, 48, 49, 0, 101, 101,
1770 298, 0, 0, 287, 0, 0, 0, 0, 0, 0,
1771 0, 0, 0, 0, 0, 0, 0, 0, 202, 0,
1772 190, 191, 158, 159, 4, 5, 156, 157, 160, 151,
1773 152, 155, 0, 0, 0, 0, 154, 153, 188, 189,
1774 112, 112, 137, 0, 140, 215, 209, 212, 213, 0,
1775 0, 131, 230, 0, 0, 0, 0, 0, 0, 0,
1776 0, 174, 0, 0, 0, 0, 0, 0, 0, 0,
1777 0, 0, 0, 0, 294, 0, 296, 291, 0, 0,
1778 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1779 0, 0, 0, 203, 0, 0, 108, 106, 146, 0,
1780 0, 150, 0, 147, 132, 133, 136, 208, 210, 0,
1781 104, 142, 0, 0, 0, 291, 0, 0, 0, 0,
1782 0, 239, 0, 0, 0, 0, 0, 0, 0, 0,
1783 0, 0, 0, 0, 0, 0, 301, 0, 0, 0,
1784 283, 284, 0, 0, 0, 0, 0, 280, 281, 0,
1785 299, 0, 103, 109, 107, 145, 148, 149, 214, 211,
1786 105, 99, 0, 0, 0, 0, 0, 0, 0, 0,
1787 173, 0, 0, 0, 0, 0, 0, 0, 272, 0,
1788 0, 101, 102, 101, 269, 290, 0, 0, 0, 0,
1789 0, 275, 276, 277, 272, 0, 0, 217, 241, 0,
1790 0, 162, 0, 0, 0, 0, 0, 0, 0, 0,
1791 0, 0, 0, 271, 0, 278, 279, 0, 295, 297,
1792 0, 0, 0, 282, 285, 286, 0, 300, 100, 0,
1793 0, 0, 170, 0, 0, 164, 165, 166, 169, 161,
1794 0, 260, 0, 0, 0, 270, 267, 0, 288, 167,
1795 168, 0, 0, 0, 258, 0, 259, 0, 0, 268,
1796 163, 171, 172, 0, 0, 0, 0, 0, 0, 265,
1800 /* YYDEFGOTO[NTERM-NUM]. */
1801 static const short int yydefgoto[] =
1803 -1, 83, 336, 266, 267, 268, 290, 307, 269, 270,
1804 233, 234, 149, 235, 24, 15, 36, 507, 384, 406,
1805 471, 330, 407, 84, 85, 236, 87, 88, 130, 248,
1806 371, 271, 372, 118, 1, 2, 55, 3, 61, 215,
1807 46, 113, 219, 89, 418, 357, 358, 359, 37, 93,
1808 16, 96, 17, 59, 18, 27, 363, 272, 90, 274,
1809 494, 39, 40, 41, 105, 106, 553, 107, 313, 523,
1810 524, 208, 209, 446, 210, 211
1813 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1815 #define YYPACT_NINF -537
1816 static const short int yypact[] =
1818 -537, 75, 61, 1145, -537, -537, -537, -537, -537, -537,
1819 -537, -537, -537, -537, 18, 180, 55, -537, -537, -537,
1820 -537, -28, -61, 33, 130, -40, -537, 102, 87, 117,
1821 -537, -537, -537, -537, -537, -537, 838, -24, -537, -15,
1822 -537, 48, -11, -2, 6, 12, -537, 11, 87, 838,
1823 -9, -9, -537, -537, -9, -9, -537, -537, -537, 180,
1824 -537, -537, -537, 32, -537, -537, -537, -537, -537, -537,
1825 -537, -537, -537, -537, -537, -537, -537, -537, -537, 164,
1826 171, -6, 512, -537, 135, 41, -537, -537, -103, -537,
1827 -537, -537, -537, -537, -537, -537, -537, -537, 883, 45,
1828 192, -537, -537, -537, 1324, -537, -537, -537, 175, 126,
1829 190, 188, 203, -537, -537, -537, -537, -537, 911, 911,
1830 957, 911, -537, -537, 81, 97, 561, -537, -537, -103,
1831 -109, 121, 641, -537, 32, 1140, -537, 1140, 1140, -537,
1832 -537, -537, -537, -537, -537, -537, -537, -537, -537, 1140,
1833 -537, -537, 219, 180, -537, -537, -537, -537, -537, -537,
1834 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1835 -537, -537, -537, -537, 10, 112, 911, 911, 911, 911,
1836 911, 911, -537, -537, -537, -537, 911, 911, 911, 911,
1837 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1838 -537, -537, -537, 911, 911, 911, 911, 911, 180, -537,
1839 59, -537, -537, -537, -537, -537, -537, -537, -537, -71,
1840 129, 129, 167, 193, 195, 218, 222, 224, 234, 243,
1841 250, 261, 263, 252, 252, 264, 993, 129, 129, 911,
1842 911, 127, -97, 911, -537, 680, -537, 136, 137, -537,
1843 -537, -537, -537, -537, -537, -537, -537, 229, 10, 112,
1844 140, 141, 144, 145, 146, 957, 147, 148, 150, 154,
1845 155, -537, -537, -537, -537, 158, -537, 160, -537, 838,
1846 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1847 911, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1848 -537, -537, -537, -537, -537, -537, -537, 911, 163, 165,
1849 -537, 1140, 162, 169, 170, 172, 173, 174, 176, 1140,
1850 1140, 1140, 177, 276, 838, 911, 911, 288, -537, -8,
1851 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1852 -537, -537, 724, 957, 590, 292, -537, -537, -537, -537,
1853 -106, -104, -537, 179, -103, -537, 135, -537, 178, 181,
1854 752, -537, -537, 296, 183, 187, 957, 957, 957, 957,
1855 957, -537, -131, 957, 957, 957, 957, 957, 315, 316,
1856 1140, 1140, 1140, 1, -537, 7, -537, 191, 1140, 186,
1857 911, 911, 911, 911, 911, 194, 197, 201, 911, 911,
1858 1140, 1140, 202, -537, 304, 326, -537, 129, -537, -60,
1859 -78, -537, -74, -537, -537, -537, -537, -537, -537, 799,
1860 309, -537, 208, 957, 957, 191, 210, 213, 223, 225,
1861 957, -537, 230, 231, 235, 236, 308, 1140, 1140, 227,
1862 237, 238, 1140, 357, 1140, 911, -537, 239, 1140, 241,
1863 -537, -537, 242, 244, 1140, 1140, 1140, -537, -537, 248,
1864 -537, 911, -537, -537, -537, -537, -537, -537, -537, -537,
1865 -537, 338, 366, 246, 251, 249, 957, 957, 957, 957,
1866 -537, 957, 957, 957, 957, 911, 253, 258, 911, 1140,
1867 1140, 254, -537, 254, -537, 255, 1140, 256, 911, 911,
1868 911, -537, -537, -537, 911, 1140, 390, -537, -537, 957,
1869 957, -537, 265, 260, 266, 267, 268, 272, 274, 275,
1870 277, 400, 29, 255, 280, -537, -537, 363, -537, -537,
1871 911, 278, 1140, -537, -537, -537, 282, -537, -537, 283,
1872 287, 957, -537, 957, 957, -537, -537, -537, -537, -537,
1873 1140, -537, 1229, 60, 381, -537, -537, 286, -537, -537,
1874 -537, 290, 293, 294, -537, 270, -537, 1229, 435, -537,
1875 -537, -537, -537, 436, 302, 1140, 1140, 441, 196, -537,
1876 1140, 442, -537, 1140, -537
1879 /* YYPGOTO[NTERM-NUM]. */
1880 static const short int yypgoto[] =
1882 -537, -537, 226, 361, 362, 365, 209, 214, 368, 370,
1883 -99, -98, -507, -537, 420, 452, -134, -537, -303, 57,
1884 -537, -216, -537, -45, -537, -36, -537, -79, -30, -537,
1885 -111, 245, -210, 104, -537, -537, -537, -537, 431, -537,
1886 -537, -537, -537, 4, -537, 63, -537, -537, 421, -537,
1887 -537, -537, -537, -537, 480, -537, -537, -536, -105, 58,
1888 -88, -537, 445, -537, -93, -537, -537, -537, -537, 42,
1889 -18, -537, -537, 64, -537, -537
1892 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1893 positive, shift that token. If negative, reduce the rule which
1894 number is the opposite. If zero, do what YYDEFACT says.
1895 If YYTABLE_NINF, syntax error. */
1896 #define YYTABLE_NINF -178
1897 static const short int yytable[] =
1899 86, 147, 148, 129, 115, 331, 386, 25, 91, 237,
1900 136, 442, 125, 86, 38, 552, 565, 444, 94, 279,
1901 430, 348, 349, 42, 43, 44, 116, 117, 431, 404,
1902 273, 574, 273, 273, 139, 140, 141, 142, 143, 144,
1903 145, 146, 243, 45, 273, 25, 567, 129, 405, 137,
1904 -112, 414, 244, 129, 243, 415, 133, 443, 133, 133,
1905 138, -177, 135, 443, 353, 139, 140, 141, 142, 143,
1906 144, 145, 146, 430, 324, 4, 19, 430, 20, 28,
1907 327, 466, 220, 221, 38, 238, 328, 467, 131, 47,
1908 310, 430, 5, 314, 48, 6, 242, 465, 315, 316,
1909 317, 318, 247, 7, 8, 9, 10, 11, 12, 13,
1910 56, 280, 281, 282, 283, 284, 285, 60, 322, 323,
1911 98, 99, 100, 14, 101, 102, 103, 286, 287, 288,
1912 289, 347, 409, 410, 412, 62, 92, 291, 292, 108,
1913 308, 309, 135, 311, 312, 135, 95, 57, 109, 58,
1914 135, 135, 135, 135, 126, 119, 110, 49, 120, 121,
1915 350, 351, 111, 19, 354, 20, 112, 319, 320, 321,
1916 135, 135, 7, 8, 9, 50, 11, 51, 13, 52,
1917 213, 214, 123, 325, 326, -113, 551, 53, 528, 124,
1918 529, 464, 332, 333, 132, 275, 276, 139, 140, 141,
1919 142, 143, 144, 145, 146, 212, 273, 277, 216, 356,
1920 -72, -72, -76, -76, 273, 273, 273, 566, 217, 293,
1921 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,
1922 304, 305, 306, 218, 380, -71, -71, 239, 402, -75,
1923 -75, -70, -70, 86, 29, 30, 31, 32, 33, 34,
1924 35, -74, -74, 240, 381, 425, 426, 427, 428, 429,
1925 -69, -69, 432, 433, 434, 435, 436, -73, -73, 334,
1926 335, 382, 101, 102, 245, 273, 273, 273, 278, 400,
1927 329, 354, -79, 273, -80, 338, 352, 360, 86, 401,
1928 135, 361, 362, 366, 367, 273, 273, 368, 369, 370,
1929 373, 374, 449, 375, 451, 452, 453, 376, 377, 378,
1930 457, 379, 473, 474, 383, 399, 385, 388, 403, 480,
1931 389, 390, 413, 391, 392, 393, 422, 394, 398, 419,
1932 437, 438, 273, 273, 462, 420, 423, 273, 416, 273,
1933 424, 448, 445, 273, 463, 454, 404, 485, 455, 273,
1934 273, 273, 456, 461, 135, 450, 135, 135, 135, 472,
1935 417, 476, 135, 458, 477, 512, 513, 514, 515, 387,
1936 516, 517, 518, 519, 478, 492, 479, 395, 396, 397,
1937 488, 481, 482, 356, 273, 273, 483, 484, 489, 490,
1938 496, 273, 498, 499, 506, 500, 508, 509, 539, 540,
1939 273, 504, 510, 511, 521, 527, 530, 532, 538, 135,
1940 533, 534, 535, 522, 542, 550, 541, 543, 544, 443,
1941 568, 573, 545, 147, 148, 505, 546, 273, 547, 548,
1942 561, 549, 562, 563, 554, 556, 558, 559, 439, 440,
1943 441, 560, 555, 569, 570, 273, 447, 571, 572, 520,
1944 575, 576, 135, 577, 147, 148, 580, 583, 459, 460,
1945 337, 104, 135, 135, 135, 203, 204, 364, 135, 205,
1946 273, 273, 206, 365, 207, 273, 54, 470, 273, 114,
1947 122, 346, 469, 26, 97, 581, 536, 495, 0, 475,
1948 0, 0, 0, 0, 135, 486, 487, 0, 0, 0,
1949 491, 0, 493, 0, 0, 0, 497, 0, 0, 0,
1950 0, 0, 501, 502, 503, 127, 64, 65, 66, 67,
1951 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
1952 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
1953 19, 0, 20, 0, 0, 0, 0, 525, 526, 0,
1954 0, 0, 0, 0, 531, 0, 0, 0, 0, 0,
1955 0, 0, 0, 537, 127, 64, 65, 66, 67, 68,
1956 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1957 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1958 557, 20, 0, 127, 222, 223, 224, 225, 226, 227,
1959 228, 229, 230, 231, 232, 75, 76, 0, 564, 77,
1960 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1961 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1962 0, 0, 0, 578, 579, 0, 0, 0, 582, 0,
1963 0, 584, 0, 0, 127, 64, 65, 66, 67, 68,
1964 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1965 77, 78, 0, 0, 79, 0, 0, 80, 0, 19,
1966 81, 20, 82, 128, 0, 0, 0, 0, 0, 0,
1967 0, 246, 0, 127, 64, 65, 66, 67, 68, 69,
1968 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
1969 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
1970 20, 0, 0, 79, 0, 0, 80, 0, 0, 81,
1971 355, 82, 241, 0, 0, 0, 0, 127, 222, 223,
1972 224, 225, 226, 227, 228, 229, 230, 231, 232, 75,
1973 76, 0, 79, 77, 78, 80, 0, 0, 81, 0,
1974 82, 411, 19, 0, 20, 127, 64, 65, 66, 67,
1975 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
1976 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
1977 19, 0, 20, 0, 0, 0, 0, 0, 0, 0,
1978 0, 0, 421, 79, 0, 0, 80, 0, 0, 81,
1979 0, 82, 127, 64, 65, 66, 67, 68, 69, 70,
1980 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
1981 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
1982 0, 0, 79, 0, 0, 80, 0, 0, 81, 468,
1983 82, 63, 64, 65, 66, 67, 68, 69, 70, 71,
1984 72, 73, 74, 75, 76, 0, 0, 77, 78, 0,
1985 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
1986 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
1987 0, 408, 81, 0, 82, 0, 134, 64, 65, 66,
1988 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1989 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
1990 81, 19, 82, 20, 127, 64, 65, 66, 67, 68,
1991 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
1992 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
1993 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
1994 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
1995 127, 222, 223, 224, 225, 226, 227, 228, 229, 230,
1996 231, 232, 75, 76, 0, 0, 77, 78, 0, 0,
1997 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
1998 79, 0, 0, 80, 0, 0, 81, 0, 82, 0,
1999 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2000 0, 0, 77, 78, 0, 339, 340, 341, 0, 0,
2001 0, 19, 0, 20, 0, 0, 0, 0, 0, 0,
2002 0, 0, 0, 0, 0, 79, 0, 0, 80, 0,
2003 0, 81, 0, 82, 0, 0, 0, 0, 0, 0,
2004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2005 0, 0, 0, 79, 0, 0, 80, 0, 0, 81,
2006 0, 82, 154, 155, 156, 157, 158, 159, 160, 161,
2007 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
2008 172, 173, 258, 259, 0, 0, 0, 0, 0, 0,
2009 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
2010 0, 0, 80, 0, 0, 81, 0, 82, 0, 260,
2011 0, 261, 182, 183, 184, 185, 0, 262, 263, 264,
2012 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
2013 200, 201, 202, 0, 0, 0, 0, 0, 342, 0,
2014 0, 343, 0, 344, 0, 0, 345, 249, 250, 77,
2015 78, 251, 252, 253, 254, 255, 256, 0, 19, 0,
2016 20, 0, -82, 19, 0, 20, 0, 0, 0, 6,
2017 -82, -82, 0, 0, 0, 0, 0, -82, -82, -82,
2018 -82, -82, -82, -82, -82, 21, 0, 0, 0, 0,
2019 0, 257, -82, 22, 0, 0, 0, 23, 0, 0,
2020 0, 0, 0, 0, 0, 0, 0, 0, 0, 154,
2021 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
2022 165, 166, 167, 168, 169, 170, 171, 172, 173, 258,
2023 259, 0, 0, 0, 0, 0, 249, 250, 0, 0,
2024 251, 252, 253, 254, 255, 256, 0, 0, 0, 0,
2025 0, 0, 0, 0, 0, 0, 260, 0, 261, 182,
2026 183, 184, 185, 0, 262, 263, 264, 190, 191, 192,
2027 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
2028 257, 0, 0, 0, 0, 0, 0, 0, 265, 0,
2029 0, 0, 0, 0, 0, 0, 0, 0, 154, 155,
2030 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
2031 166, 167, 168, 169, 170, 171, 172, 173, 258, 259,
2032 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2034 0, 0, 0, 0, 0, 260, 0, 261, 182, 183,
2035 184, 185, 150, 262, 263, 264, 190, 191, 192, 193,
2036 194, 195, 196, 197, 198, 199, 200, 201, 202, 0,
2037 0, 0, 0, 151, 152, 0, 0, 265, 0, 0,
2038 0, 0, 0, 0, 0, 0, 0, 0, 0, 153,
2039 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
2040 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
2041 171, 172, 173, 174, 175, 0, 0, 0, 0, 0,
2042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2043 0, 0, 0, 0, 0, 176, 177, 178, 0, 0,
2044 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
2045 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
2049 static const short int yycheck[] =
2051 36, 100, 100, 82, 49, 221, 309, 3, 32, 120,
2052 98, 10, 18, 49, 29, 522, 552, 10, 33, 153,
2053 151, 237, 238, 51, 52, 53, 35, 36, 159, 37,
2054 135, 567, 137, 138, 5, 6, 7, 8, 9, 10,
2055 11, 12, 151, 71, 149, 41, 553, 126, 56, 4,
2056 153, 157, 161, 132, 151, 159, 162, 56, 162, 162,
2057 15, 0, 98, 56, 161, 5, 6, 7, 8, 9,
2058 10, 11, 12, 151, 208, 0, 28, 151, 30, 61,
2059 151, 159, 118, 119, 29, 121, 157, 161, 84, 150,
2060 178, 151, 31, 181, 61, 34, 126, 157, 186, 187,
2061 188, 189, 132, 42, 43, 44, 45, 46, 47, 48,
2062 150, 101, 102, 103, 104, 105, 106, 30, 206, 207,
2063 72, 73, 74, 62, 76, 77, 78, 117, 118, 119,
2064 120, 236, 342, 343, 344, 18, 160, 25, 26, 150,
2065 176, 177, 178, 179, 180, 181, 161, 45, 150, 47,
2066 186, 187, 188, 189, 160, 51, 150, 27, 54, 55,
2067 239, 240, 150, 28, 243, 30, 155, 203, 204, 205,
2068 206, 207, 42, 43, 44, 45, 46, 47, 48, 49,
2069 54, 55, 18, 124, 125, 153, 157, 57, 491, 18,
2070 493, 407, 25, 26, 153, 137, 138, 5, 6, 7,
2071 8, 9, 10, 11, 12, 30, 311, 149, 18, 245,
2072 17, 18, 17, 18, 319, 320, 321, 157, 30, 107,
2073 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
2074 118, 119, 120, 30, 279, 17, 18, 156, 326, 17,
2075 18, 17, 18, 279, 64, 65, 66, 67, 68, 69,
2076 70, 17, 18, 156, 290, 366, 367, 368, 369, 370,
2077 17, 18, 373, 374, 375, 376, 377, 17, 18, 17,
2078 18, 307, 76, 77, 153, 380, 381, 382, 59, 324,
2079 151, 360, 21, 388, 21, 21, 159, 151, 324, 325,
2080 326, 154, 63, 153, 153, 400, 401, 153, 153, 153,
2081 153, 153, 390, 153, 392, 393, 394, 153, 153, 151,
2082 398, 151, 423, 424, 151, 39, 151, 155, 30, 430,
2083 151, 151, 30, 151, 151, 151, 30, 151, 151, 151,
2084 15, 15, 437, 438, 30, 154, 153, 442, 159, 444,
2085 153, 155, 151, 448, 18, 151, 37, 39, 151, 454,
2086 455, 456, 151, 151, 390, 391, 392, 393, 394, 151,
2087 356, 151, 398, 399, 151, 476, 477, 478, 479, 311,
2088 481, 482, 483, 484, 151, 18, 151, 319, 320, 321,
2089 153, 151, 151, 419, 489, 490, 151, 151, 151, 151,
2090 151, 496, 151, 151, 56, 151, 30, 151, 509, 510,
2091 505, 153, 151, 154, 151, 151, 151, 151, 18, 445,
2092 498, 499, 500, 155, 154, 15, 151, 151, 151, 56,
2093 39, 151, 154, 522, 522, 461, 154, 532, 154, 154,
2094 541, 154, 543, 544, 154, 157, 154, 154, 380, 381,
2095 382, 154, 530, 157, 154, 550, 388, 154, 154, 485,
2096 15, 15, 488, 151, 553, 553, 15, 15, 400, 401,
2097 234, 41, 498, 499, 500, 104, 104, 258, 504, 104,
2098 575, 576, 104, 259, 104, 580, 24, 420, 583, 48,
2099 59, 236, 419, 3, 39, 578, 504, 445, -1, 425,
2100 -1, -1, -1, -1, 530, 437, 438, -1, -1, -1,
2101 442, -1, 444, -1, -1, -1, 448, -1, -1, -1,
2102 -1, -1, 454, 455, 456, 3, 4, 5, 6, 7,
2103 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
2104 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
2105 28, -1, 30, -1, -1, -1, -1, 489, 490, -1,
2106 -1, -1, -1, -1, 496, -1, -1, -1, -1, -1,
2107 -1, -1, -1, 505, 3, 4, 5, 6, 7, 8,
2108 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2109 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2110 532, 30, -1, 3, 4, 5, 6, 7, 8, 9,
2111 10, 11, 12, 13, 14, 15, 16, -1, 550, 19,
2112 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
2113 30, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2114 -1, -1, -1, 575, 576, -1, -1, -1, 580, -1,
2115 -1, 583, -1, -1, 3, 4, 5, 6, 7, 8,
2116 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2117 19, 20, -1, -1, 152, -1, -1, 155, -1, 28,
2118 158, 30, 160, 161, -1, -1, -1, -1, -1, -1,
2119 -1, 40, -1, 3, 4, 5, 6, 7, 8, 9,
2120 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
2121 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
2122 30, -1, -1, 152, -1, -1, 155, -1, -1, 158,
2123 40, 160, 161, -1, -1, -1, -1, 3, 4, 5,
2124 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2125 16, -1, 152, 19, 20, 155, -1, -1, 158, -1,
2126 160, 161, 28, -1, 30, 3, 4, 5, 6, 7,
2127 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
2128 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
2129 28, -1, 30, -1, -1, -1, -1, -1, -1, -1,
2130 -1, -1, 40, 152, -1, -1, 155, -1, -1, 158,
2131 -1, 160, 3, 4, 5, 6, 7, 8, 9, 10,
2132 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
2133 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
2134 -1, -1, 152, -1, -1, 155, -1, -1, 158, 40,
2135 160, 3, 4, 5, 6, 7, 8, 9, 10, 11,
2136 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
2137 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
2138 -1, -1, -1, -1, -1, -1, 152, -1, -1, 155,
2139 -1, 157, 158, -1, 160, -1, 3, 4, 5, 6,
2140 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2141 -1, -1, 19, 20, 152, -1, -1, 155, -1, -1,
2142 158, 28, 160, 30, 3, 4, 5, 6, 7, 8,
2143 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2144 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2145 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
2146 -1, 152, -1, -1, 155, -1, -1, 158, -1, 160,
2147 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
2148 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
2149 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
2150 152, -1, -1, 155, -1, -1, 158, -1, 160, -1,
2151 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2152 -1, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2153 -1, 28, -1, 30, -1, -1, -1, -1, -1, -1,
2154 -1, -1, -1, -1, -1, 152, -1, -1, 155, -1,
2155 -1, 158, -1, 160, -1, -1, -1, -1, -1, -1,
2156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2157 -1, -1, -1, 152, -1, -1, 155, -1, -1, 158,
2158 -1, 160, 79, 80, 81, 82, 83, 84, 85, 86,
2159 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2160 97, 98, 99, 100, -1, -1, -1, -1, -1, -1,
2161 -1, -1, -1, -1, -1, -1, -1, -1, -1, 152,
2162 -1, -1, 155, -1, -1, 158, -1, 160, -1, 126,
2163 -1, 128, 129, 130, 131, 132, -1, 134, 135, 136,
2164 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2165 147, 148, 149, -1, -1, -1, -1, -1, 155, -1,
2166 -1, 158, -1, 160, -1, -1, 163, 17, 18, 19,
2167 20, 21, 22, 23, 24, 25, 26, -1, 28, -1,
2168 30, -1, 27, 28, -1, 30, -1, -1, -1, 34,
2169 35, 36, -1, -1, -1, -1, -1, 42, 43, 44,
2170 45, 46, 47, 48, 49, 50, -1, -1, -1, -1,
2171 -1, 61, 57, 58, -1, -1, -1, 62, -1, -1,
2172 -1, -1, -1, -1, -1, -1, -1, -1, -1, 79,
2173 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2174 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
2175 100, -1, -1, -1, -1, -1, 17, 18, -1, -1,
2176 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
2177 -1, -1, -1, -1, -1, -1, 126, -1, 128, 129,
2178 130, 131, 132, -1, 134, 135, 136, 137, 138, 139,
2179 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
2180 61, -1, -1, -1, -1, -1, -1, -1, 158, -1,
2181 -1, -1, -1, -1, -1, -1, -1, -1, 79, 80,
2182 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2183 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
2184 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2185 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2186 -1, -1, -1, -1, -1, 126, -1, 128, 129, 130,
2187 131, 132, 38, 134, 135, 136, 137, 138, 139, 140,
2188 141, 142, 143, 144, 145, 146, 147, 148, 149, -1,
2189 -1, -1, -1, 59, 60, -1, -1, 158, -1, -1,
2190 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
2191 -1, -1, -1, 79, 80, 81, 82, 83, 84, 85,
2192 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2193 96, 97, 98, 99, 100, -1, -1, -1, -1, -1,
2194 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2195 -1, -1, -1, -1, -1, 121, 122, 123, -1, -1,
2196 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
2197 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
2201 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2202 symbol of state STATE-NUM. */
2203 static const unsigned char yystos[] =
2205 0, 198, 199, 201, 0, 31, 34, 42, 43, 44,
2206 45, 46, 47, 48, 62, 179, 214, 216, 218, 28,
2207 30, 50, 58, 62, 178, 207, 218, 219, 61, 64,
2208 65, 66, 67, 68, 69, 70, 180, 212, 29, 225,
2209 226, 227, 51, 52, 53, 71, 204, 150, 61, 27,
2210 45, 47, 49, 57, 179, 200, 150, 45, 47, 217,
2211 30, 202, 18, 3, 4, 5, 6, 7, 8, 9,
2212 10, 11, 12, 13, 14, 15, 16, 19, 20, 152,
2213 155, 158, 160, 165, 187, 188, 189, 190, 191, 207,
2214 222, 32, 160, 213, 33, 161, 215, 226, 72, 73,
2215 74, 76, 77, 78, 178, 228, 229, 231, 150, 150,
2216 150, 150, 155, 205, 202, 187, 35, 36, 197, 197,
2217 197, 197, 212, 18, 18, 18, 160, 3, 161, 191,
2218 192, 207, 153, 162, 3, 189, 224, 4, 15, 5,
2219 6, 7, 8, 9, 10, 11, 12, 174, 175, 176,
2220 38, 59, 60, 75, 79, 80, 81, 82, 83, 84,
2221 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2222 95, 96, 97, 98, 99, 100, 121, 122, 123, 126,
2223 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2224 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2225 147, 148, 149, 167, 168, 169, 172, 173, 235, 236,
2226 238, 239, 30, 54, 55, 203, 18, 30, 30, 206,
2227 189, 189, 4, 5, 6, 7, 8, 9, 10, 11,
2228 12, 13, 14, 174, 175, 177, 189, 194, 189, 156,
2229 156, 161, 192, 151, 161, 153, 40, 192, 193, 17,
2230 18, 21, 22, 23, 24, 25, 26, 61, 99, 100,
2231 126, 128, 134, 135, 136, 158, 167, 168, 169, 172,
2232 173, 195, 221, 222, 223, 223, 223, 223, 59, 180,
2233 101, 102, 103, 104, 105, 106, 117, 118, 119, 120,
2234 170, 25, 26, 107, 108, 109, 110, 111, 112, 113,
2235 114, 115, 116, 117, 118, 119, 120, 171, 189, 189,
2236 224, 189, 189, 232, 224, 224, 224, 224, 224, 189,
2237 189, 189, 224, 224, 180, 124, 125, 151, 157, 151,
2238 185, 185, 25, 26, 17, 18, 166, 166, 21, 22,
2239 23, 24, 155, 158, 160, 163, 195, 222, 185, 185,
2240 191, 191, 159, 161, 191, 40, 189, 209, 210, 211,
2241 151, 154, 63, 220, 170, 171, 153, 153, 153, 153,
2242 153, 194, 196, 153, 153, 153, 153, 153, 151, 151,
2243 187, 189, 189, 151, 182, 151, 182, 223, 155, 151,
2244 151, 151, 151, 151, 151, 223, 223, 223, 151, 39,
2245 187, 189, 224, 30, 37, 56, 183, 186, 157, 196,
2246 196, 161, 196, 30, 157, 159, 159, 207, 208, 151,
2247 154, 40, 30, 153, 153, 194, 194, 194, 194, 194,
2248 151, 159, 194, 194, 194, 194, 194, 15, 15, 223,
2249 223, 223, 10, 56, 10, 151, 237, 223, 155, 224,
2250 189, 224, 224, 224, 151, 151, 151, 224, 189, 223,
2251 223, 151, 30, 18, 185, 157, 159, 161, 40, 209,
2252 183, 184, 151, 194, 194, 237, 151, 151, 151, 151,
2253 194, 151, 151, 151, 151, 39, 223, 223, 153, 151,
2254 151, 223, 18, 223, 224, 233, 151, 223, 151, 151,
2255 151, 223, 223, 223, 153, 189, 56, 181, 30, 151,
2256 151, 154, 194, 194, 194, 194, 194, 194, 194, 194,
2257 189, 151, 155, 233, 234, 223, 223, 151, 182, 182,
2258 151, 223, 151, 224, 224, 224, 234, 223, 18, 194,
2259 194, 151, 154, 151, 151, 154, 154, 154, 154, 154,
2260 15, 157, 176, 230, 154, 224, 157, 223, 154, 154,
2261 154, 194, 194, 194, 223, 221, 157, 176, 39, 157,
2262 154, 154, 154, 151, 221, 15, 15, 151, 223, 223,
2263 15, 228, 223, 15, 223
2266 #define yyerrok (yyerrstatus = 0)
2267 #define yyclearin (yychar = YYEMPTY)
2268 #define YYEMPTY (-2)
2271 #define YYACCEPT goto yyacceptlab
2272 #define YYABORT goto yyabortlab
2273 #define YYERROR goto yyerrorlab
2276 /* Like YYERROR except do call yyerror. This remains here temporarily
2277 to ease the transition to the new meaning of YYERROR, for GCC.
2278 Once GCC version 2 has supplanted version 1, this can go. */
2280 #define YYFAIL goto yyerrlab
2282 #define YYRECOVERING() (!!yyerrstatus)
2284 #define YYBACKUP(Token, Value) \
2286 if (yychar == YYEMPTY && yylen == 1) \
2290 yytoken = YYTRANSLATE (yychar); \
2296 yyerror (YY_("syntax error: cannot back up")); \
2303 #define YYERRCODE 256
2306 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2307 If N is 0, then set CURRENT to the empty location which ends
2308 the previous symbol: RHS[0] (always defined). */
2310 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2311 #ifndef YYLLOC_DEFAULT
2312 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2316 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2317 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2318 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2319 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2323 (Current).first_line = (Current).last_line = \
2324 YYRHSLOC (Rhs, 0).last_line; \
2325 (Current).first_column = (Current).last_column = \
2326 YYRHSLOC (Rhs, 0).last_column; \
2332 /* YY_LOCATION_PRINT -- Print the location on the stream.
2333 This macro was not mandated originally: define only if we know
2334 we won't break user code: when these are the locations we know. */
2336 #ifndef YY_LOCATION_PRINT
2337 # if YYLTYPE_IS_TRIVIAL
2338 # define YY_LOCATION_PRINT(File, Loc) \
2339 fprintf (File, "%d.%d-%d.%d", \
2340 (Loc).first_line, (Loc).first_column, \
2341 (Loc).last_line, (Loc).last_column)
2343 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2348 /* YYLEX -- calling `yylex' with the right arguments. */
2351 # define YYLEX yylex (YYLEX_PARAM)
2353 # define YYLEX yylex ()
2356 /* Enable debugging if requested. */
2360 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2361 # define YYFPRINTF fprintf
2364 # define YYDPRINTF(Args) \
2370 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2374 YYFPRINTF (stderr, "%s ", Title); \
2375 yysymprint (stderr, \
2377 YYFPRINTF (stderr, "\n"); \
2381 /*------------------------------------------------------------------.
2382 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2384 `------------------------------------------------------------------*/
2386 #if defined (__STDC__) || defined (__cplusplus)
2388 yy_stack_print (short int *bottom, short int *top)
2391 yy_stack_print (bottom, top)
2396 YYFPRINTF (stderr, "Stack now");
2397 for (/* Nothing. */; bottom <= top; ++bottom)
2398 YYFPRINTF (stderr, " %d", *bottom);
2399 YYFPRINTF (stderr, "\n");
2402 # define YY_STACK_PRINT(Bottom, Top) \
2405 yy_stack_print ((Bottom), (Top)); \
2409 /*------------------------------------------------.
2410 | Report that the YYRULE is going to be reduced. |
2411 `------------------------------------------------*/
2413 #if defined (__STDC__) || defined (__cplusplus)
2415 yy_reduce_print (int yyrule)
2418 yy_reduce_print (yyrule)
2423 unsigned long int yylno = yyrline[yyrule];
2424 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2426 /* Print the symbols being reduced, and their result. */
2427 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2428 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2429 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2432 # define YY_REDUCE_PRINT(Rule) \
2435 yy_reduce_print (Rule); \
2438 /* Nonzero means print parse trace. It is left uninitialized so that
2439 multiple parsers can coexist. */
2441 #else /* !YYDEBUG */
2442 # define YYDPRINTF(Args)
2443 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2444 # define YY_STACK_PRINT(Bottom, Top)
2445 # define YY_REDUCE_PRINT(Rule)
2446 #endif /* !YYDEBUG */
2449 /* YYINITDEPTH -- initial size of the parser's stacks. */
2451 # define YYINITDEPTH 200
2454 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2455 if the built-in stack extension method is used).
2457 Do not make this value too large; the results are undefined if
2458 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2459 evaluated with infinite-precision integer arithmetic. */
2462 # define YYMAXDEPTH 10000
2470 # if defined (__GLIBC__) && defined (_STRING_H)
2471 # define yystrlen strlen
2473 /* Return the length of YYSTR. */
2475 # if defined (__STDC__) || defined (__cplusplus)
2476 yystrlen (const char *yystr)
2482 const char *yys = yystr;
2484 while (*yys++ != '\0')
2487 return yys - yystr - 1;
2493 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2494 # define yystpcpy stpcpy
2496 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2499 # if defined (__STDC__) || defined (__cplusplus)
2500 yystpcpy (char *yydest, const char *yysrc)
2502 yystpcpy (yydest, yysrc)
2508 const char *yys = yysrc;
2510 while ((*yyd++ = *yys++) != '\0')
2519 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2520 quotes and backslashes, so that it's suitable for yyerror. The
2521 heuristic is that double-quoting is unnecessary unless the string
2522 contains an apostrophe, a comma, or backslash (other than
2523 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2524 null, do not copy; instead, return the length of what the result
2527 yytnamerr (char *yyres, const char *yystr)
2532 char const *yyp = yystr;
2539 goto do_not_strip_quotes;
2543 goto do_not_strip_quotes;
2556 do_not_strip_quotes: ;
2560 return yystrlen (yystr);
2562 return yystpcpy (yyres, yystr) - yyres;
2566 #endif /* YYERROR_VERBOSE */
2571 /*--------------------------------.
2572 | Print this symbol on YYOUTPUT. |
2573 `--------------------------------*/
2575 #if defined (__STDC__) || defined (__cplusplus)
2577 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2580 yysymprint (yyoutput, yytype, yyvaluep)
2586 /* Pacify ``unused variable'' warnings. */
2589 if (yytype < YYNTOKENS)
2590 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2592 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2596 if (yytype < YYNTOKENS)
2597 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2604 YYFPRINTF (yyoutput, ")");
2607 #endif /* ! YYDEBUG */
2608 /*-----------------------------------------------.
2609 | Release the memory associated to this symbol. |
2610 `-----------------------------------------------*/
2612 #if defined (__STDC__) || defined (__cplusplus)
2614 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2617 yydestruct (yymsg, yytype, yyvaluep)
2623 /* Pacify ``unused variable'' warnings. */
2628 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2639 /* Prevent warnings from -Wmissing-prototypes. */
2641 #ifdef YYPARSE_PARAM
2642 # if defined (__STDC__) || defined (__cplusplus)
2643 int yyparse (void *YYPARSE_PARAM);
2647 #else /* ! YYPARSE_PARAM */
2648 #if defined (__STDC__) || defined (__cplusplus)
2653 #endif /* ! YYPARSE_PARAM */
2657 /* The look-ahead symbol. */
2660 /* The semantic value of the look-ahead symbol. */
2663 /* Number of syntax errors so far. */
2672 #ifdef YYPARSE_PARAM
2673 # if defined (__STDC__) || defined (__cplusplus)
2674 int yyparse (void *YYPARSE_PARAM)
2676 int yyparse (YYPARSE_PARAM)
2677 void *YYPARSE_PARAM;
2679 #else /* ! YYPARSE_PARAM */
2680 #if defined (__STDC__) || defined (__cplusplus)
2694 /* Number of tokens to shift before error messages enabled. */
2696 /* Look-ahead token as an internal (translated) token number. */
2699 /* Three stacks and their tools:
2700 `yyss': related to states,
2701 `yyvs': related to semantic values,
2702 `yyls': related to locations.
2704 Refer to the stacks thru separate pointers, to allow yyoverflow
2705 to reallocate them elsewhere. */
2707 /* The state stack. */
2708 short int yyssa[YYINITDEPTH];
2709 short int *yyss = yyssa;
2712 /* The semantic value stack. */
2713 YYSTYPE yyvsa[YYINITDEPTH];
2714 YYSTYPE *yyvs = yyvsa;
2719 #define YYPOPSTACK (yyvsp--, yyssp--)
2721 YYSIZE_T yystacksize = YYINITDEPTH;
2723 /* The variables used to return semantic value and location from the
2728 /* When reducing, the number of symbols on the RHS of the reduced
2732 YYDPRINTF ((stderr, "Starting parse\n"));
2737 yychar = YYEMPTY; /* Cause a token to be read. */
2739 /* Initialize stack pointers.
2740 Waste one element of value and location stack
2741 so that they stay on the same level as the state stack.
2742 The wasted elements are never initialized. */
2749 /*------------------------------------------------------------.
2750 | yynewstate -- Push a new state, which is found in yystate. |
2751 `------------------------------------------------------------*/
2753 /* In all cases, when you get here, the value and location stacks
2754 have just been pushed. so pushing a state here evens the stacks.
2761 if (yyss + yystacksize - 1 <= yyssp)
2763 /* Get the current used size of the three stacks, in elements. */
2764 YYSIZE_T yysize = yyssp - yyss + 1;
2768 /* Give user a chance to reallocate the stack. Use copies of
2769 these so that the &'s don't force the real ones into
2771 YYSTYPE *yyvs1 = yyvs;
2772 short int *yyss1 = yyss;
2775 /* Each stack pointer address is followed by the size of the
2776 data in use in that stack, in bytes. This used to be a
2777 conditional around just the two extra args, but that might
2778 be undefined if yyoverflow is a macro. */
2779 yyoverflow (YY_("memory exhausted"),
2780 &yyss1, yysize * sizeof (*yyssp),
2781 &yyvs1, yysize * sizeof (*yyvsp),
2788 #else /* no yyoverflow */
2789 # ifndef YYSTACK_RELOCATE
2790 goto yyexhaustedlab;
2792 /* Extend the stack our own way. */
2793 if (YYMAXDEPTH <= yystacksize)
2794 goto yyexhaustedlab;
2796 if (YYMAXDEPTH < yystacksize)
2797 yystacksize = YYMAXDEPTH;
2800 short int *yyss1 = yyss;
2801 union yyalloc *yyptr =
2802 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2804 goto yyexhaustedlab;
2805 YYSTACK_RELOCATE (yyss);
2806 YYSTACK_RELOCATE (yyvs);
2808 # undef YYSTACK_RELOCATE
2810 YYSTACK_FREE (yyss1);
2813 #endif /* no yyoverflow */
2815 yyssp = yyss + yysize - 1;
2816 yyvsp = yyvs + yysize - 1;
2819 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2820 (unsigned long int) yystacksize));
2822 if (yyss + yystacksize - 1 <= yyssp)
2826 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2835 /* Do appropriate processing given the current state. */
2836 /* Read a look-ahead token if we need one and don't already have one. */
2839 /* First try to decide what to do without reference to look-ahead token. */
2841 yyn = yypact[yystate];
2842 if (yyn == YYPACT_NINF)
2845 /* Not known => get a look-ahead token if don't already have one. */
2847 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2848 if (yychar == YYEMPTY)
2850 YYDPRINTF ((stderr, "Reading a token: "));
2854 if (yychar <= YYEOF)
2856 yychar = yytoken = YYEOF;
2857 YYDPRINTF ((stderr, "Now at end of input.\n"));
2861 yytoken = YYTRANSLATE (yychar);
2862 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2865 /* If the proper action on seeing token YYTOKEN is to reduce or to
2866 detect an error, take that action. */
2868 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2873 if (yyn == 0 || yyn == YYTABLE_NINF)
2882 /* Shift the look-ahead token. */
2883 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2885 /* Discard the token being shifted unless it is eof. */
2886 if (yychar != YYEOF)
2892 /* Count tokens shifted since error; after three, turn off error
2901 /*-----------------------------------------------------------.
2902 | yydefault -- do the default action for the current state. |
2903 `-----------------------------------------------------------*/
2905 yyn = yydefact[yystate];
2911 /*-----------------------------.
2912 | yyreduce -- Do a reduction. |
2913 `-----------------------------*/
2915 /* yyn is the number of a rule to reduce with. */
2918 /* If YYLEN is nonzero, implement the default value of the action:
2921 Otherwise, the following line sets YYVAL to garbage.
2922 This behavior is undocumented and Bison
2923 users should not rely upon it. Assigning to YYVAL
2924 unconditionally makes the parser a bit smaller, and it avoids a
2925 GCC warning that YYVAL may be used uninitialized. */
2926 yyval = yyvsp[1-yylen];
2929 YY_REDUCE_PRINT (yyn);
2933 #line 896 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2935 (yyval.String) = (yyvsp[-1].String);
2940 #line 899 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2942 (yyval.String) = new std::string("");
2947 #line 906 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2948 { (yyval.String) = new std::string(""); ;}
2952 #line 911 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2954 *(yyvsp[-1].String) += *(yyvsp[0].String);
2955 delete (yyvsp[0].String);
2956 (yyval.String) = (yyvsp[-1].String);
2961 #line 916 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2962 { (yyval.String) = new std::string(""); ;}
2966 #line 921 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2967 { (yyval.String) = new std::string(); ;}
2971 #line 922 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2972 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
2976 #line 925 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2977 { (yyval.String) = new std::string(); ;}
2981 #line 926 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2983 (yyvsp[-1].String)->insert(0, ", ");
2984 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2985 delete (yyvsp[0].String);
2986 (yyval.String) = (yyvsp[-1].String);
2991 #line 934 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
2993 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
2994 delete (yyvsp[0].String);
2995 (yyval.String) = (yyvsp[-1].String);
3000 #line 940 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3001 { (yyval.String) = new std::string(); ;}
3005 #line 944 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3006 { (yyval.String) = new std::string(); ;}
3010 #line 945 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3012 (yyvsp[-1].String)->insert(0, ", ");
3013 if (!(yyvsp[0].String)->empty())
3014 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3015 delete (yyvsp[0].String);
3016 (yyval.String) = (yyvsp[-1].String);
3021 #line 955 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3023 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3024 delete (yyvsp[0].String);
3025 (yyval.String) = (yyvsp[-1].String);
3030 #line 977 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3032 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), OpaqueTy);
3037 #line 980 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3039 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UnresolvedTy);
3044 #line 983 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3046 (yyval.Type) = (yyvsp[0].Type);
3051 #line 986 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3052 { // Type UpReference
3053 (yyvsp[0].String)->insert(0, "\\");
3054 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UpRefTy);
3059 #line 990 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3060 { // Function derived type?
3061 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
3062 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3065 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
3068 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3071 (yyval.Type) = TypeInfo::get(newTy, (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
3076 #line 1003 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3077 { // Sized array type?
3078 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3079 (yyvsp[-3].String)->insert(0,"[ ");
3080 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
3081 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
3086 #line 1009 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3087 { // Packed array type?
3088 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3089 (yyvsp[-3].String)->insert(0,"< ");
3090 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
3091 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
3096 #line 1015 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3097 { // Structure type?
3098 std::string newTy("{");
3099 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3102 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3105 (yyval.Type) = TypeInfo::get(newTy, StructTy, (yyvsp[-1].TypeVec));
3110 #line 1025 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3111 { // Empty structure type?
3112 (yyval.Type) = TypeInfo::get("{}", StructTy, new TypeList());
3117 #line 1028 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3118 { // Packed Structure type?
3119 std::string newTy("<{");
3120 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
3123 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
3126 (yyval.Type) = TypeInfo::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
3131 #line 1038 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3132 { // Empty packed structure type?
3133 (yyval.Type) = TypeInfo::get("<{}>", PackedStructTy, new TypeList());
3138 #line 1041 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3140 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
3145 #line 1049 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3147 (yyval.TypeVec) = new TypeList();
3148 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3153 #line 1053 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3155 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3156 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3161 #line 1061 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3163 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3164 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3165 delete (yyvsp[0].String);
3170 #line 1066 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3172 (yyval.TypeVec) = new TypeList();
3173 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3174 delete (yyvsp[0].String);
3179 #line 1071 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3181 (yyval.TypeVec) = new TypeList();
3186 #line 1081 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3187 { // Nonempty unsized arr
3188 (yyval.Const).type = (yyvsp[-3].Type);
3189 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3190 *(yyval.Const).cnst += " [ " + *(yyvsp[-1].String) + " ]";
3191 delete (yyvsp[-1].String);
3196 #line 1087 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3198 (yyval.Const).type = (yyvsp[-2].Type);
3199 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3200 *(yyval.Const).cnst += "[ ]";
3205 #line 1092 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3207 (yyval.Const).type = (yyvsp[-2].Type);
3208 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3209 *(yyval.Const).cnst += " c" + *(yyvsp[0].String);
3210 delete (yyvsp[0].String);
3215 #line 1098 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3216 { // Nonempty unsized arr
3217 (yyval.Const).type = (yyvsp[-3].Type);
3218 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3219 *(yyval.Const).cnst += " < " + *(yyvsp[-1].String) + " >";
3220 delete (yyvsp[-1].String);
3225 #line 1104 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3227 (yyval.Const).type = (yyvsp[-3].Type);
3228 (yyval.Const).cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3229 *(yyval.Const).cnst += " { " + *(yyvsp[-1].String) + " }";
3230 delete (yyvsp[-1].String);
3235 #line 1110 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3237 (yyval.Const).type = (yyvsp[-2].Type);
3238 (yyval.Const).cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3239 *(yyval.Const).cnst += " {}";
3244 #line 1115 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3246 (yyval.Const).type = (yyvsp[-1].Type);
3247 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3248 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3249 delete (yyvsp[0].String);
3254 #line 1121 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3256 (yyval.Const).type = (yyvsp[-1].Type);
3257 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3258 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3259 delete (yyvsp[0].String);
3264 #line 1127 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3266 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve(), true);
3267 (yyval.Const).type = (yyvsp[-1].Type);
3268 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3269 *(yyval.Const).cnst += " " + Name;
3270 delete (yyvsp[0].String);
3275 #line 1134 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3277 (yyval.Const).type = (yyvsp[-1].Type);
3278 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3279 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3280 delete (yyvsp[0].String);
3285 #line 1140 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3287 (yyval.Const).type = (yyvsp[-1].Type);
3288 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3289 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3290 delete (yyvsp[0].String);
3295 #line 1146 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3296 { // integral constants
3297 (yyval.Const).type = (yyvsp[-1].Type);
3298 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3299 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3300 delete (yyvsp[0].String);
3305 #line 1152 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3306 { // integral constants
3307 (yyval.Const).type = (yyvsp[-1].Type);
3308 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3309 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3310 delete (yyvsp[0].String);
3315 #line 1158 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3316 { // Boolean constants
3317 (yyval.Const).type = (yyvsp[-1].Type);
3318 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3319 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3320 delete (yyvsp[0].String);
3325 #line 1164 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3326 { // Boolean constants
3327 (yyval.Const).type = (yyvsp[-1].Type);
3328 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3329 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3330 delete (yyvsp[0].String);
3335 #line 1170 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3336 { // Float & Double constants
3337 (yyval.Const).type = (yyvsp[-1].Type);
3338 (yyval.Const).cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3339 *(yyval.Const).cnst += " " + *(yyvsp[0].String);
3340 delete (yyvsp[0].String);
3345 #line 1178 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3347 std::string source = *(yyvsp[-3].Const).cnst;
3348 const TypeInfo* SrcTy = (yyvsp[-3].Const).type->resolve();
3349 const TypeInfo* DstTy = (yyvsp[-1].Type)->resolve();
3350 if (*(yyvsp[-5].String) == "cast") {
3351 // Call getCastUpgrade to upgrade the old cast
3352 (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
3354 // Nothing to upgrade, just create the cast constant expr
3355 (yyval.String) = new std::string(*(yyvsp[-5].String));
3356 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
3358 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); delete (yyvsp[-2].String);
3363 #line 1192 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3365 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const).cnst;
3366 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3367 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
3368 *(yyvsp[-4].String) += ", " + *VI.val;
3371 *(yyvsp[-4].String) += ")";
3372 (yyval.String) = (yyvsp[-4].String);
3373 (yyvsp[-2].Const).destroy();
3374 delete (yyvsp[-1].ValList);
3379 #line 1204 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3381 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3382 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3383 (yyval.String) = (yyvsp[-7].String);
3388 #line 1209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3390 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3391 (yyval.String) = new std::string(op);
3392 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3393 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3398 #line 1215 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3400 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3401 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3402 (yyval.String) = (yyvsp[-5].String);
3407 #line 1220 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3409 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const).type);
3410 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3411 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3412 (yyval.String) = (yyvsp[-5].String);
3417 #line 1226 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3419 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3420 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3421 (yyval.String) = (yyvsp[-6].String);
3426 #line 1231 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3428 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3429 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3430 (yyval.String) = (yyvsp[-6].String);
3435 #line 1236 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3437 const char* shiftop = (yyvsp[-5].String)->c_str();
3438 if (*(yyvsp[-5].String) == "shr")
3439 shiftop = ((yyvsp[-3].Const).type->isUnsigned()) ? "lshr" : "ashr";
3440 (yyval.String) = new std::string(shiftop);
3441 *(yyval.String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3442 delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3447 #line 1244 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3449 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3450 (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3451 (yyval.String) = (yyvsp[-5].String);
3456 #line 1249 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3458 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3459 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3460 (yyval.String) = (yyvsp[-7].String);
3465 #line 1254 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3467 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const).cnst + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")";
3468 (yyvsp[-5].Const).destroy(); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy();
3469 (yyval.String) = (yyvsp[-7].String);
3474 #line 1264 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3476 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const).cnst;
3477 (yyvsp[0].Const).destroy();
3478 (yyval.String) = (yyvsp[-2].String);
3483 #line 1269 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3484 { (yyval.String) = new std::string(*(yyvsp[0].Const).cnst); (yyvsp[0].Const).destroy(); ;}
3488 #line 1284 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3494 #line 1289 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3501 #line 1292 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3503 *O << *(yyvsp[0].String) << '\n';
3504 delete (yyvsp[0].String);
3510 #line 1297 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3512 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3518 #line 1301 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3520 *O << "implementation\n";
3526 #line 1305 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3527 { (yyval.String) = 0; ;}
3531 #line 1307 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3532 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3536 #line 1310 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3538 EnumeratedTypes.push_back((yyvsp[0].Type));
3539 if (!(yyvsp[-2].String)->empty()) {
3540 NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Type);
3541 *O << *(yyvsp[-2].String) << " = ";
3543 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3544 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
3550 #line 1320 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3551 { // Function prototypes can be in const pool
3552 *O << *(yyvsp[0].String) << '\n';
3553 delete (yyvsp[0].String);
3559 #line 1325 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3560 { // Asm blocks can be in the const pool
3561 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3562 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3568 #line 1330 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3570 if (!(yyvsp[-4].String)->empty()) {
3571 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const).type->getPointerType(),
3572 *(yyvsp[-2].String) == "constant");
3573 *O << Name << " = ";
3575 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const).cnst << ' ' << *(yyvsp[0].String) << '\n';
3576 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3582 #line 1340 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3584 if (!(yyvsp[-4].String)->empty()) {
3585 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3586 *(yyvsp[-2].String) == "constant");
3587 *O << Name << " = ";
3589 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3590 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3596 #line 1350 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3598 if (!(yyvsp[-4].String)->empty()) {
3599 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3600 *(yyvsp[-2].String) == "constant");
3601 *O << Name << " = ";
3603 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3604 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3610 #line 1360 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3612 if (!(yyvsp[-4].String)->empty()) {
3613 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3614 *(yyvsp[-2].String) == "constant");
3615 *O << Name << " = ";
3617 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3618 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3624 #line 1370 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3626 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3627 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3633 #line 1375 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3635 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3636 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3642 #line 1380 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3649 #line 1390 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3651 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3652 delete (yyvsp[0].String);
3653 (yyval.String) = (yyvsp[-2].String);
3658 #line 1395 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3660 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3661 if (*(yyvsp[0].String) == "64")
3663 delete (yyvsp[0].String);
3664 (yyval.String) = (yyvsp[-2].String);
3669 #line 1402 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3671 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3672 delete (yyvsp[0].String);
3673 (yyval.String) = (yyvsp[-2].String);
3678 #line 1407 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3680 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3681 delete (yyvsp[0].String);
3682 (yyval.String) = (yyvsp[-2].String);
3687 #line 1414 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3689 (yyvsp[-1].String)->insert(0, "[ ");
3690 *(yyvsp[-1].String) += " ]";
3691 (yyval.String) = (yyvsp[-1].String);
3696 #line 1421 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3698 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3699 delete (yyvsp[0].String);
3700 (yyval.String) = (yyvsp[-2].String);
3705 #line 1427 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3707 (yyval.String) = new std::string();
3712 #line 1436 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3713 { (yyval.String) = new std::string(); ;}
3717 #line 1438 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3719 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3720 if (!(yyvsp[0].String)->empty()) {
3721 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve());
3722 *(yyval.String) += " " + Name;
3724 delete (yyvsp[0].String);
3729 #line 1447 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3731 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3732 delete (yyvsp[0].String);
3737 #line 1451 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3739 (yyval.String) = (yyvsp[0].String);
3744 #line 1455 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3746 (yyval.String) = (yyvsp[0].String);
3751 #line 1458 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3753 *(yyvsp[-2].String) += ", ...";
3754 (yyval.String) = (yyvsp[-2].String);
3755 delete (yyvsp[0].String);
3760 #line 1463 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3762 (yyval.String) = (yyvsp[0].String);
3767 #line 1466 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3768 { (yyval.String) = new std::string(); ;}
3772 #line 1469 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3774 if (*(yyvsp[-5].String) == "%llvm.va_start" || *(yyvsp[-5].String) == "%llvm.va_end") {
3775 *(yyvsp[-3].String) = "i8*";
3776 } else if (*(yyvsp[-5].String) == "%llvm.va_copy") {
3777 *(yyvsp[-3].String) = "i8*, i8*";
3779 if (!(yyvsp[-7].String)->empty()) {
3780 *(yyvsp[-7].String) += " ";
3782 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3783 if (!(yyvsp[-1].String)->empty()) {
3784 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3786 if (!(yyvsp[0].String)->empty()) {
3787 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3789 delete (yyvsp[-5].String);
3790 delete (yyvsp[-3].String);
3791 delete (yyvsp[-1].String);
3792 delete (yyvsp[0].String);
3793 (yyval.String) = (yyvsp[-7].String);
3798 #line 1492 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3799 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3803 #line 1493 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3804 { (yyval.String) = new std::string ("{"); ;}
3808 #line 1496 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3811 if (!(yyvsp[-2].String)->empty()) {
3812 *O << *(yyvsp[-2].String) << ' ';
3814 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3815 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3821 #line 1507 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3822 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
3826 #line 1508 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3827 { (yyval.String) = new std::string("}"); ;}
3831 #line 1510 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3833 if ((yyvsp[-1].String))
3834 *O << *(yyvsp[-1].String);
3835 *O << *(yyvsp[0].String) << "\n\n";
3836 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3842 #line 1519 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3843 { (yyval.String) = new std::string(); ;}
3847 #line 1525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3848 { isDeclare = true; ;}
3852 #line 1525 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3854 if (!(yyvsp[-1].String)->empty())
3855 *(yyvsp[-3].String) += " " + *(yyvsp[-1].String);
3856 *(yyvsp[-3].String) += " " + *(yyvsp[0].String);
3857 delete (yyvsp[-1].String);
3858 delete (yyvsp[0].String);
3859 (yyval.String) = (yyvsp[-3].String);
3865 #line 1539 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3866 { (yyval.String) = new std::string(); ;}
3870 #line 1545 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3872 (yyvsp[-1].String)->insert(0, "<");
3873 *(yyvsp[-1].String) += ">";
3874 (yyval.String) = (yyvsp[-1].String);
3879 #line 1551 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3881 if (!(yyvsp[-3].String)->empty()) {
3882 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
3884 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
3885 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3886 (yyval.String) = (yyvsp[-4].String);
3891 #line 1564 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3893 (yyval.Value).val = (yyvsp[0].String);
3894 (yyval.Value).constant = false;
3895 (yyval.Value).type = 0;
3900 #line 1569 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3902 (yyval.Value).val = (yyvsp[0].String);
3903 (yyval.Value).constant = true;
3904 (yyval.Value).type = 0;
3909 #line 1579 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3911 (yyvsp[-1].Type) = (yyvsp[-1].Type)->resolve();
3912 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
3913 (yyval.Value) = (yyvsp[0].Value);
3914 delete (yyval.Value).val;
3915 (yyval.Value).val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
3916 (yyval.Value).type = (yyvsp[-1].Type);
3921 #line 1588 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3928 #line 1591 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3929 { // Do not allow functions with 0 basic blocks
3935 #line 1599 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3942 #line 1603 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3944 *O << " " << *(yyvsp[0].String) << '\n';
3945 delete (yyvsp[0].String);
3951 #line 1608 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3958 #line 1611 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3960 *O << *(yyvsp[0].String) << '\n';
3961 delete (yyvsp[0].String);
3967 #line 1617 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3968 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
3972 #line 1619 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3973 { // Return with a result...
3974 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value).val << '\n';
3975 delete (yyvsp[-1].String); (yyvsp[0].Value).destroy();
3981 #line 1624 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3982 { // Return with no result...
3983 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
3984 delete (yyvsp[-1].String);
3990 #line 1629 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
3991 { // Unconditional Branch...
3992 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
3993 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
3999 #line 1634 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4001 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
4002 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4003 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
4004 << *(yyvsp[0].Value).val << '\n';
4005 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4011 #line 1642 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4013 std::string Name = getUniqueName((yyvsp[-6].Value).val, (yyvsp[-7].Type));
4014 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4015 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << " [" << *(yyvsp[-1].String) << " ]\n";
4016 delete (yyvsp[-8].String); (yyvsp[-6].Value).destroy(); (yyvsp[-3].Value).destroy();
4017 delete (yyvsp[-1].String);
4023 #line 1650 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4025 std::string Name = getUniqueName((yyvsp[-5].Value).val, (yyvsp[-6].Type));
4026 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
4027 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value).val << "[]\n";
4028 delete (yyvsp[-7].String); (yyvsp[-5].Value).destroy(); (yyvsp[-2].Value).destroy();
4034 #line 1658 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4036 const TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
4038 if (!(yyvsp[-13].String)->empty()) {
4039 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
4040 *O << Name << " = ";
4042 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value).val << " (";
4043 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
4044 ValueInfo& VI = (*(yyvsp[-7].ValList))[i];
4046 if (i+1 < (yyvsp[-7].ValList)->size())
4050 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value).val << ' '
4051 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value).val << '\n';
4052 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); (yyvsp[-9].Value).destroy(); delete (yyvsp[-7].ValList);
4053 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4059 #line 1679 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4061 *O << " " << *(yyvsp[0].String) << '\n';
4062 delete (yyvsp[0].String);
4068 #line 1684 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4070 *O << " " << *(yyvsp[0].String) << '\n';
4071 delete (yyvsp[0].String);
4077 #line 1690 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4079 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
4080 *(yyvsp[0].Value).val;
4081 delete (yyvsp[-3].String); (yyvsp[0].Value).destroy();
4082 (yyval.String) = (yyvsp[-5].String);
4087 #line 1696 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4089 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
4090 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value).val;
4091 (yyvsp[0].Value).destroy();
4092 (yyval.String) = (yyvsp[-3].String);
4097 #line 1704 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4099 if (!(yyvsp[-1].String)->empty()) {
4100 // Get a unique name for this value, based on its type.
4101 std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value).type);
4102 *(yyvsp[-1].String) = Name + " = ";
4103 if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
4104 // don't actually delete it, just comment it out
4105 (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
4106 delete deleteUselessCastName;
4109 *(yyvsp[-1].String) += *(yyvsp[0].Value).val;
4110 (yyvsp[0].Value).destroy();
4111 deleteUselessCastFlag = false;
4112 (yyval.String) = (yyvsp[-1].String);
4117 #line 1722 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4118 { // Used for PHI nodes
4119 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-5].Type));
4120 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
4121 Name += "," + *(yyvsp[-1].Value).val + "]";
4122 (yyval.Value).val = new std::string(Name);
4123 (yyval.Value).type = (yyvsp[-5].Type);
4124 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4129 #line 1730 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4131 std::string Name = getUniqueName((yyvsp[-3].Value).val, (yyvsp[-6].Value).type);
4132 *(yyvsp[-6].Value).val += ", [" + Name + "," + *(yyvsp[-1].Value).val + "]";
4133 (yyvsp[-3].Value).destroy(); (yyvsp[-1].Value).destroy();
4134 (yyval.Value) = (yyvsp[-6].Value);
4139 #line 1739 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4141 (yyval.ValList) = new ValueList();
4142 (yyval.ValList)->push_back((yyvsp[0].Value));
4147 #line 1743 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4149 (yyval.ValList) = (yyvsp[-2].ValList);
4150 (yyval.ValList)->push_back((yyvsp[0].Value));
4155 #line 1750 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4156 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4160 #line 1751 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4161 { (yyval.ValList) = new ValueList(); ;}
4165 #line 1755 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4167 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
4168 delete (yyvsp[0].String);
4169 (yyval.String) = (yyvsp[-1].String);
4174 #line 1763 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4176 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
4177 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4178 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4179 (yyval.Value).val = new std::string(op);
4180 *(yyval.Value).val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4181 (yyval.Value).type = (yyvsp[-3].Type);
4182 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4187 #line 1772 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4189 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4190 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4191 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4192 (yyval.Value).val = (yyvsp[-4].String);
4193 (yyval.Value).type = (yyvsp[-3].Type);
4194 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4199 #line 1780 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4201 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4202 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4203 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
4204 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4205 (yyval.Value).val = (yyvsp[-4].String);
4206 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4207 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4212 #line 1789 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4214 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4215 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4216 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4217 (yyval.Value).val = (yyvsp[-5].String);
4218 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4219 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4224 #line 1797 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4226 std::string Name1 = getUniqueName((yyvsp[-2].Value).val, (yyvsp[-3].Type));
4227 std::string Name2 = getUniqueName((yyvsp[0].Value).val, (yyvsp[-3].Type));
4228 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4229 (yyval.Value).val = (yyvsp[-5].String);
4230 (yyval.Value).type = TypeInfo::get("bool",BoolTy);
4231 delete (yyvsp[-4].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4236 #line 1805 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4238 const char* shiftop = (yyvsp[-3].String)->c_str();
4239 if (*(yyvsp[-3].String) == "shr")
4240 shiftop = ((yyvsp[-2].Value).type->isUnsigned()) ? "lshr" : "ashr";
4241 (yyval.Value).val = new std::string(shiftop);
4242 *(yyval.Value).val += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4243 (yyval.Value).type = (yyvsp[-2].Value).type;
4244 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4249 #line 1814 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4251 std::string source = *(yyvsp[-2].Value).val;
4252 const TypeInfo* SrcTy = (yyvsp[-2].Value).type->resolve();
4253 const TypeInfo* DstTy = (yyvsp[0].Type)->resolve();
4254 (yyval.Value).val = new std::string();
4255 (yyval.Value).type = DstTy;
4256 if (*(yyvsp[-3].String) == "cast") {
4257 *(yyval.Value).val += getCastUpgrade(source, SrcTy, DstTy, false);
4259 *(yyval.Value).val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
4261 // Check to see if this is a useless cast of a value to the same name
4262 // and the same type. Such casts will probably cause redefinition errors
4263 // when assembled and perform no code gen action so just remove them.
4264 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
4265 if (SrcTy->isInteger() && DstTy->isInteger() &&
4266 SrcTy->getBitWidth() == DstTy->getBitWidth()) {
4267 deleteUselessCastFlag = true; // Flag the "Inst" rule
4268 deleteUselessCastName = new std::string(*(yyvsp[-2].Value).val); // save the name
4269 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
4270 if (pos != std::string::npos) {
4271 // remove the type portion before val
4272 deleteUselessCastName->erase(0, pos);
4275 delete (yyvsp[-3].String); (yyvsp[-2].Value).destroy();
4276 delete (yyvsp[-1].String);
4281 #line 1842 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4283 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4284 (yyval.Value).val = (yyvsp[-5].String);
4285 (yyval.Value).type = (yyvsp[-2].Value).type;
4286 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4291 #line 1848 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4293 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + (yyvsp[0].Type)->getNewTy();
4294 (yyval.Value).val = (yyvsp[-3].String);
4295 (yyval.Value).type = (yyvsp[0].Type);
4296 (yyvsp[-2].Value).destroy();
4301 #line 1854 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4303 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4304 (yyval.Value).val = (yyvsp[-3].String);
4305 (yyvsp[-2].Value).type = (yyvsp[-2].Value).type->resolve();;
4306 (yyval.Value).type = (yyvsp[-2].Value).type->getElementType();
4307 (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4312 #line 1861 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4314 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4315 (yyval.Value).val = (yyvsp[-5].String);
4316 (yyval.Value).type = (yyvsp[-4].Value).type;
4317 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4322 #line 1867 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4324 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value).val + ", " + *(yyvsp[-2].Value).val + ", " + *(yyvsp[0].Value).val;
4325 (yyval.Value).val = (yyvsp[-5].String);
4326 (yyval.Value).type = (yyvsp[-4].Value).type;
4327 (yyvsp[-4].Value).destroy(); (yyvsp[-2].Value).destroy(); (yyvsp[0].Value).destroy();
4332 #line 1873 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4334 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4335 (yyval.Value).val = (yyvsp[-1].String);
4336 (yyval.Value).type = (yyvsp[0].Value).type;
4337 delete (yyvsp[0].Value).val;
4342 #line 1879 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4344 // map llvm.isunordered to "fcmp uno"
4345 if (*(yyvsp[-3].Value).val == "%llvm.isunordered.f32" ||
4346 *(yyvsp[-3].Value).val == "%llvm.isunordered.f64") {
4347 (yyval.Value).val = new std::string( "fcmp uno " + *(*(yyvsp[-1].ValList))[0].val + ", ");
4348 size_t pos = (*(yyvsp[-1].ValList))[1].val->find(' ');
4349 assert(pos != std::string::npos && "no space?");
4350 *(yyval.Value).val += (*(yyvsp[-1].ValList))[1].val->substr(pos+1);
4351 (yyval.Value).type = TypeInfo::get("bool", BoolTy);
4353 static unsigned upgradeCount = 1;
4354 if (*(yyvsp[-3].Value).val == "%llvm.va_start" || *(yyvsp[-3].Value).val == "%llvm.va_end") {
4355 std::string name("%va_upgrade");
4356 name += llvm::utostr(upgradeCount++);
4357 (yyvsp[-6].String)->insert(0, name + " = bitcast " + *(*(yyvsp[-1].ValList))[0].val + " to i8*\n ");
4358 *(*(yyvsp[-1].ValList))[0].val = "i8* " + name;
4359 (*(yyvsp[-1].ValList))[0].type = TypeInfo::get("i8", UByteTy)->getPointerType();
4360 } else if (*(yyvsp[-3].Value).val == "%llvm.va_copy") {
4361 std::string name0("%va_upgrade");
4362 name0 += llvm::utostr(upgradeCount++);
4363 std::string name1("%va_upgrade");
4364 name1 += llvm::utostr(upgradeCount++);
4365 (yyvsp[-6].String)->insert(0, name0 + " = bitcast " + *(*(yyvsp[-1].ValList))[0].val + " to i8*\n " +
4366 name1 + " = bitcast " + *(*(yyvsp[-1].ValList))[1].val + " to i8*\n ");
4367 *(*(yyvsp[-1].ValList))[0].val = "i8* " + name0;
4368 (*(yyvsp[-1].ValList))[0].type = TypeInfo::get("i8", UByteTy)->getPointerType();
4369 *(*(yyvsp[-1].ValList))[1].val = "i8* " + name1;
4370 (*(yyvsp[-1].ValList))[0].type = TypeInfo::get("i8", UByteTy)->getPointerType();
4372 if (!(yyvsp[-5].String)->empty())
4373 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
4374 if (!(yyvsp[-6].String)->empty())
4375 *(yyvsp[-6].String) += " ";
4376 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value).val + "(";
4377 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
4378 ValueInfo& VI = (*(yyvsp[-1].ValList))[i];
4379 *(yyvsp[-6].String) += *VI.val;
4380 if (i+1 < (yyvsp[-1].ValList)->size())
4381 *(yyvsp[-6].String) += ", ";
4384 *(yyvsp[-6].String) += ")";
4385 (yyval.Value).val = (yyvsp[-6].String);
4386 (yyval.Value).type = getFunctionReturnType((yyvsp[-4].Type));
4388 delete (yyvsp[-5].String); (yyvsp[-3].Value).destroy(); delete (yyvsp[-1].ValList);
4393 #line 1931 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4394 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4398 #line 1932 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4399 { (yyval.ValList) = new ValueList(); ;}
4403 #line 1937 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4404 { (yyval.String) = new std::string(); ;}
4408 #line 1940 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4410 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4411 if (!(yyvsp[0].String)->empty())
4412 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4413 (yyval.Value).val = (yyvsp[-2].String);
4414 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4415 delete (yyvsp[0].String);
4420 #line 1948 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4422 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4423 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4424 if (!(yyvsp[0].String)->empty())
4425 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4426 (yyval.Value).val = (yyvsp[-5].String);
4427 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4428 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4433 #line 1957 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4435 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4436 if (!(yyvsp[0].String)->empty())
4437 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4438 (yyval.Value).val = (yyvsp[-2].String);
4439 (yyval.Value).type = (yyvsp[-1].Type)->getPointerType();
4440 delete (yyvsp[0].String);
4445 #line 1965 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4447 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4448 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4449 if (!(yyvsp[0].String)->empty())
4450 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4451 (yyval.Value).val = (yyvsp[-5].String);
4452 (yyval.Value).type = (yyvsp[-4].Type)->getPointerType();
4453 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].String);
4458 #line 1974 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4460 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value).val;
4461 (yyval.Value).val = (yyvsp[-1].String);
4462 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4463 (yyvsp[0].Value).destroy();
4468 #line 1980 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4470 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4471 if (!(yyvsp[-3].String)->empty())
4472 *(yyvsp[-3].String) += " ";
4473 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4474 (yyval.Value).val = (yyvsp[-3].String);
4475 (yyval.Value).type = (yyvsp[-1].Type)->getElementType();
4476 delete (yyvsp[-2].String); (yyvsp[0].Value).destroy();
4481 #line 1989 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4483 std::string Name = getUniqueName((yyvsp[0].Value).val, (yyvsp[-1].Type));
4484 if (!(yyvsp[-5].String)->empty())
4485 *(yyvsp[-5].String) += " ";
4486 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value).val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4487 (yyval.Value).val = (yyvsp[-5].String);
4488 (yyval.Value).type = TypeInfo::get("void", VoidTy);
4489 delete (yyvsp[-4].String); (yyvsp[-3].Value).destroy(); (yyvsp[0].Value).destroy();
4494 #line 1998 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4496 std::string Name = getUniqueName((yyvsp[-1].Value).val, (yyvsp[-2].Type));
4497 // Upgrade the indices
4498 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4499 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4500 if (VI.type->isUnsigned() && !VI.isConstant() &&
4501 VI.type->getBitWidth() < 64) {
4502 *O << " %gep_upgrade" << unique << " = zext " << *VI.val
4504 *VI.val = "i64 %gep_upgrade" + llvm::utostr(unique++);
4505 VI.type = TypeInfo::get("i64",ULongTy);
4508 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4509 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4510 ValueInfo& VI = (*(yyvsp[0].ValList))[i];
4511 *(yyvsp[-3].String) += ", " + *VI.val;
4513 (yyval.Value).val = (yyvsp[-3].String);
4514 (yyval.Value).type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4515 (yyvsp[-1].Value).destroy(); delete (yyvsp[0].ValList);
4523 /* Line 1126 of yacc.c. */
4524 #line 4525 "UpgradeParser.tab.c"
4530 YY_STACK_PRINT (yyss, yyssp);
4535 /* Now `shift' the result of the reduction. Determine what state
4536 that goes to, based on the state we popped back to and the rule
4537 number reduced by. */
4541 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4542 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4543 yystate = yytable[yystate];
4545 yystate = yydefgoto[yyn - YYNTOKENS];
4550 /*------------------------------------.
4551 | yyerrlab -- here on detecting error |
4552 `------------------------------------*/
4554 /* If not already recovering from an error, report this error. */
4559 yyn = yypact[yystate];
4561 if (YYPACT_NINF < yyn && yyn < YYLAST)
4563 int yytype = YYTRANSLATE (yychar);
4564 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4565 YYSIZE_T yysize = yysize0;
4567 int yysize_overflow = 0;
4569 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4570 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4574 /* This is so xgettext sees the translatable formats that are
4575 constructed on the fly. */
4576 YY_("syntax error, unexpected %s");
4577 YY_("syntax error, unexpected %s, expecting %s");
4578 YY_("syntax error, unexpected %s, expecting %s or %s");
4579 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4580 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4584 static char const yyunexpected[] = "syntax error, unexpected %s";
4585 static char const yyexpecting[] = ", expecting %s";
4586 static char const yyor[] = " or %s";
4587 char yyformat[sizeof yyunexpected
4588 + sizeof yyexpecting - 1
4589 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4590 * (sizeof yyor - 1))];
4591 char const *yyprefix = yyexpecting;
4593 /* Start YYX at -YYN if negative to avoid negative indexes in
4595 int yyxbegin = yyn < 0 ? -yyn : 0;
4597 /* Stay within bounds of both yycheck and yytname. */
4598 int yychecklim = YYLAST - yyn;
4599 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4602 yyarg[0] = yytname[yytype];
4603 yyfmt = yystpcpy (yyformat, yyunexpected);
4605 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4606 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4608 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4612 yyformat[sizeof yyunexpected - 1] = '\0';
4615 yyarg[yycount++] = yytname[yyx];
4616 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4617 yysize_overflow |= yysize1 < yysize;
4619 yyfmt = yystpcpy (yyfmt, yyprefix);
4623 yyf = YY_(yyformat);
4624 yysize1 = yysize + yystrlen (yyf);
4625 yysize_overflow |= yysize1 < yysize;
4628 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4629 yymsg = (char *) YYSTACK_ALLOC (yysize);
4632 /* Avoid sprintf, as that infringes on the user's name space.
4633 Don't have undefined behavior even if the translation
4634 produced a string with the wrong number of "%s"s. */
4637 while ((*yyp = *yyf))
4639 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4641 yyp += yytnamerr (yyp, yyarg[yyi++]);
4651 YYSTACK_FREE (yymsg);
4655 yyerror (YY_("syntax error"));
4656 goto yyexhaustedlab;
4660 #endif /* YYERROR_VERBOSE */
4661 yyerror (YY_("syntax error"));
4666 if (yyerrstatus == 3)
4668 /* If just tried and failed to reuse look-ahead token after an
4669 error, discard it. */
4671 if (yychar <= YYEOF)
4673 /* Return failure if at end of input. */
4674 if (yychar == YYEOF)
4679 yydestruct ("Error: discarding", yytoken, &yylval);
4684 /* Else will try to reuse look-ahead token after shifting the error
4689 /*---------------------------------------------------.
4690 | yyerrorlab -- error raised explicitly by YYERROR. |
4691 `---------------------------------------------------*/
4694 /* Pacify compilers like GCC when the user code never invokes
4695 YYERROR and the label yyerrorlab therefore never appears in user
4706 /*-------------------------------------------------------------.
4707 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4708 `-------------------------------------------------------------*/
4710 yyerrstatus = 3; /* Each real token shifted decrements this. */
4714 yyn = yypact[yystate];
4715 if (yyn != YYPACT_NINF)
4718 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4726 /* Pop the current state because it cannot handle the error token. */
4731 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4734 YY_STACK_PRINT (yyss, yyssp);
4743 /* Shift the error token. */
4744 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4750 /*-------------------------------------.
4751 | yyacceptlab -- YYACCEPT comes here. |
4752 `-------------------------------------*/
4757 /*-----------------------------------.
4758 | yyabortlab -- YYABORT comes here. |
4759 `-----------------------------------*/
4765 /*-------------------------------------------------.
4766 | yyexhaustedlab -- memory exhaustion comes here. |
4767 `-------------------------------------------------*/
4769 yyerror (YY_("memory exhausted"));
4775 if (yychar != YYEOF && yychar != YYEMPTY)
4776 yydestruct ("Cleanup: discarding lookahead",
4778 while (yyssp != yyss)
4780 yydestruct ("Cleanup: popping",
4781 yystos[*yyssp], yyvsp);
4786 YYSTACK_FREE (yyss);
4792 #line 2021 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
4795 int yyerror(const char *ErrorMsg) {
4797 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4798 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4799 std::string errMsg = where + "error: " + std::string(ErrorMsg) +
4801 if (yychar == YYEMPTY || yychar == 0)
4802 errMsg += "end-of-file.";
4804 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4805 std::cerr << "llvm-upgrade: " << errMsg << '\n';
4806 *O << "llvm-upgrade parse failed.\n";
4810 static void warning(const std::string& ErrorMsg) {
4812 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
4813 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
4814 std::string errMsg = where + "warning: " + std::string(ErrorMsg) +
4816 if (yychar == YYEMPTY || yychar == 0)
4817 errMsg += "end-of-file.";
4819 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
4820 std::cerr << "llvm-upgrade: " << errMsg << '\n';