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-2/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;
391 // This bool controls whether attributes are ever added to function declarations
392 // definitions and calls.
393 static bool AddAttributes = false;
395 static void warning(const std::string& msg);
397 void UpgradeAssembly(const std::string &infile, std::istream& in,
398 std::ostream &out, bool debug, bool addAttrs)
401 CurFilename = infile;
404 AddAttributes = addAttrs;
408 std::cerr << "llvm-upgrade: parse failed.\n";
409 out << "llvm-upgrade: parse failed.\n";
414 namespace { // Anonymous namespace to keep our implementation local
417 /// This type is used to keep track of the signedness of values. Instead
418 /// of creating llvm::Value directly, the parser will create ValueInfo which
419 /// associates a Value* with a Signedness indication.
422 const TypeInfo* type;
424 bool isConstant() const { return constant; }
425 ~ValueInfo() { delete val; }
429 /// This type is used to keep track of the signedness of the obsolete
430 /// integer types. Instead of creating an llvm::Type directly, the Lexer will
431 /// create instances of TypeInfo which retains the signedness indication so
432 /// it can be used by the parser for upgrade decisions.
433 /// For example if "uint" is encountered then the "first" field will be set
434 /// to "int32" and the "second" field will be set to "isUnsigned". If the
435 /// type is not obsolete then "second" will be set to "isSignless".
438 static const TypeInfo* get(const std::string &newType, Types oldType);
439 static const TypeInfo* get(const std::string& newType, Types oldType,
440 const TypeInfo* eTy, const TypeInfo* rTy);
442 static const TypeInfo* get(const std::string& newType, Types oldType,
443 const TypeInfo *eTy, uint64_t elems);
445 static const TypeInfo* get(const std::string& newType, Types oldType,
448 static const TypeInfo* get(const std::string& newType, const TypeInfo* resTy,
451 const TypeInfo* resolve() const;
452 bool operator<(const TypeInfo& that) const;
454 bool sameNewTyAs(const TypeInfo* that) const {
455 return this->newTy == that->newTy;
458 bool sameOldTyAs(const TypeInfo* that) const;
460 Types getElementTy() const {
462 return elemTy->oldTy;
467 unsigned getUpRefNum() const {
468 assert(oldTy == UpRefTy && "Can't getUpRefNum on non upreference");
469 return atoi(&((getNewTy().c_str())[1])); // skip the slash
472 typedef std::vector<const TypeInfo*> UpRefStack;
473 void getSignedness(unsigned &sNum, unsigned &uNum, UpRefStack& stk) const;
474 std::string makeUniqueName(const std::string& BaseName) const;
476 const std::string& getNewTy() const { return newTy; }
477 const TypeInfo* getResultType() const { return resultTy; }
478 const TypeInfo* getElementType() const { return elemTy; }
480 const TypeInfo* getPointerType() const {
481 return get(newTy + "*", PointerTy, this, (TypeInfo*)0);
484 bool isUnresolved() const { return oldTy == UnresolvedTy; }
485 bool isUpReference() const { return oldTy == UpRefTy; }
486 bool isVoid() const { return oldTy == VoidTy; }
487 bool isBool() const { return oldTy == BoolTy; }
488 bool isSigned() const {
489 return oldTy == SByteTy || oldTy == ShortTy ||
490 oldTy == IntTy || oldTy == LongTy;
493 bool isUnsigned() const {
494 return oldTy == UByteTy || oldTy == UShortTy ||
495 oldTy == UIntTy || oldTy == ULongTy;
497 bool isSignless() const { return !isSigned() && !isUnsigned(); }
498 bool isInteger() const { return isSigned() || isUnsigned(); }
499 bool isIntegral() const { return oldTy == BoolTy || isInteger(); }
500 bool isFloatingPoint() const { return oldTy == DoubleTy || oldTy == FloatTy; }
501 bool isPacked() const { return oldTy == PackedTy; }
502 bool isPointer() const { return oldTy == PointerTy; }
503 bool isStruct() const { return oldTy == StructTy || oldTy == PackedStructTy; }
504 bool isArray() const { return oldTy == ArrayTy; }
505 bool isOther() const {
506 return !isPacked() && !isPointer() && !isFloatingPoint() && !isIntegral(); }
507 bool isFunction() const { return oldTy == FunctionTy; }
508 bool isComposite() const {
509 return isStruct() || isPointer() || isArray() || isPacked();
512 bool isAttributeCandidate() const {
513 return isIntegral() && getBitWidth() < 32;
516 bool isUnresolvedDeep() const;
518 unsigned getBitWidth() const;
520 const TypeInfo* getIndexedType(const ValueInfo* VI) const;
522 unsigned getNumStructElements() const {
523 return (elements ? elements->size() : 0);
526 const TypeInfo* getElement(unsigned idx) const {
528 if (idx < elements->size())
529 return (*elements)[idx];
535 : newTy(), oldTy(UnresolvedTy), elemTy(0), resultTy(0), elements(0),
539 TypeInfo(const TypeInfo& that); // do not implement
540 TypeInfo& operator=(const TypeInfo& that); // do not implement
542 ~TypeInfo() { delete elements; }
546 bool operator()(const TypeInfo* X, const TypeInfo* Y) const {
547 assert(X && "Can't compare null pointer");
548 assert(Y && "Can't compare null pointer");
553 typedef std::set<const TypeInfo*, ltfunctor> TypeRegMap;
555 static const TypeInfo* add_new_type(TypeInfo* existing);
563 static TypeRegMap registry;
565 typedef std::vector<const TypeInfo*> TypeVector;
566 typedef std::map<std::string,const TypeInfo*> TypeMap;
567 typedef std::map<const TypeInfo*,std::string> TypePlaneMap;
568 typedef std::map<std::string,TypePlaneMap> GlobalsTypeMap;
569 static TypeVector EnumeratedTypes;
570 static TypeMap NamedTypes;
571 static GlobalsTypeMap Globals;
574 TypeInfo::TypeRegMap TypeInfo::registry;
575 TypeInfo::TypeVector TypeInfo::EnumeratedTypes;
576 TypeInfo::TypeMap TypeInfo::NamedTypes;
577 TypeInfo::GlobalsTypeMap TypeInfo::Globals;
579 const TypeInfo* TypeInfo::get(const std::string &newType, Types oldType) {
580 TypeInfo* Ty = new TypeInfo();
583 return add_new_type(Ty);
586 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
587 const TypeInfo* eTy, const TypeInfo* rTy) {
588 TypeInfo* Ty= new TypeInfo();
591 Ty->elemTy = const_cast<TypeInfo*>(eTy);
592 Ty->resultTy = const_cast<TypeInfo*>(rTy);
593 return add_new_type(Ty);
596 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
597 const TypeInfo *eTy, uint64_t elems) {
598 TypeInfo* Ty = new TypeInfo();
601 Ty->elemTy = const_cast<TypeInfo*>(eTy);
603 return add_new_type(Ty);
606 const TypeInfo* TypeInfo::get(const std::string& newType, Types oldType,
608 TypeInfo* Ty = new TypeInfo();
612 return add_new_type(Ty);
615 const TypeInfo* TypeInfo::get(const std::string& newType, const TypeInfo* resTy,
617 TypeInfo* Ty = new TypeInfo();
619 Ty->oldTy = FunctionTy;
620 Ty->resultTy = const_cast<TypeInfo*>(resTy);
622 return add_new_type(Ty);
625 const TypeInfo* TypeInfo::resolve() const {
626 if (isUnresolved()) {
627 if (getNewTy()[0] == '%' && isdigit(newTy[1])) {
628 unsigned ref = atoi(&((newTy.c_str())[1])); // skip the %
629 if (ref < EnumeratedTypes.size()) {
630 return EnumeratedTypes[ref];
632 std::string msg("Can't resolve numbered type: ");
634 yyerror(msg.c_str());
637 TypeInfo::TypeMap::iterator I = NamedTypes.find(newTy);
638 if (I != NamedTypes.end()) {
641 std::string msg("Cannot resolve type: ");
643 yyerror(msg.c_str());
647 // otherwise its already resolved.
651 bool TypeInfo::operator<(const TypeInfo& that) const {
654 if (oldTy != that.oldTy)
655 return oldTy < that.oldTy;
658 unsigned thisUp = this->getUpRefNum();
659 unsigned thatUp = that.getUpRefNum();
660 return thisUp < thatUp;
664 if (this->nelems != that.nelems)
665 return nelems < that.nelems;
667 const TypeInfo* thisTy = this->elemTy;
668 const TypeInfo* thatTy = that.elemTy;
669 return *thisTy < *thatTy;
672 const TypeInfo* thisTy = this->resultTy;
673 const TypeInfo* thatTy = that.resultTy;
674 if (!thisTy->sameOldTyAs(thatTy))
675 return *thisTy < *thatTy;
679 case PackedStructTy: {
680 if (elements->size() != that.elements->size())
681 return elements->size() < that.elements->size();
682 for (unsigned i = 0; i < elements->size(); i++) {
683 const TypeInfo* thisTy = (*this->elements)[i];
684 const TypeInfo* thatTy = (*that.elements)[i];
685 if (!thisTy->sameOldTyAs(thatTy))
686 return *thisTy < *thatTy;
691 return this->newTy < that.newTy;
698 bool TypeInfo::sameOldTyAs(const TypeInfo* that) const {
703 if (oldTy != that->oldTy)
708 if (nelems != that->nelems)
712 const TypeInfo* thisTy = this->elemTy;
713 const TypeInfo* thatTy = that->elemTy;
714 return thisTy->sameOldTyAs(thatTy);
717 const TypeInfo* thisTy = this->resultTy;
718 const TypeInfo* thatTy = that->resultTy;
719 if (!thisTy->sameOldTyAs(thatTy))
724 case PackedStructTy: {
725 if (elements->size() != that->elements->size())
727 for (unsigned i = 0; i < elements->size(); i++) {
728 const TypeInfo* thisTy = (*this->elements)[i];
729 const TypeInfo* thatTy = (*that->elements)[i];
730 if (!thisTy->sameOldTyAs(thatTy))
736 return this->newTy == that->newTy;
738 return true; // for all others oldTy == that->oldTy is sufficient
743 bool TypeInfo::isUnresolvedDeep() const {
750 return elemTy->isUnresolvedDeep();
753 for (unsigned i = 0; i < elements->size(); i++)
754 if ((*elements)[i]->isUnresolvedDeep())
762 unsigned TypeInfo::getBitWidth() const {
766 case VoidTy : return 0;
767 case BoolTy : return 1;
768 case SByteTy: case UByteTy : return 8;
769 case ShortTy: case UShortTy : return 16;
770 case IntTy: case UIntTy: case FloatTy: return 32;
771 case LongTy: case ULongTy: case DoubleTy : return 64;
772 case PointerTy: return SizeOfPointer; // global var
775 return nelems * elemTy->getBitWidth();
777 case PackedStructTy: {
779 for (unsigned i = 0; i < elements->size(); i++) {
780 size += (*elements)[i]->getBitWidth();
787 const TypeInfo* TypeInfo::getIndexedType(const ValueInfo* VI) const {
789 if (VI->isConstant() && VI->type->isInteger()) {
790 size_t pos = VI->val->find(' ') + 1;
791 if (pos < VI->val->size()) {
792 uint64_t idx = atoi(VI->val->substr(pos).c_str());
793 return (*elements)[idx];
795 yyerror("Invalid value for constant integer");
799 yyerror("Structure requires constant index");
803 if (isArray() || isPacked() || isPointer())
805 yyerror("Invalid type for getIndexedType");
809 void TypeInfo::getSignedness(unsigned &sNum, unsigned &uNum,
810 UpRefStack& stack) const {
813 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy:
814 case FloatTy : case DoubleTy: case UpRefTy:
816 case SByteTy: case ShortTy: case LongTy: case IntTy:
819 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
825 stack.push_back(this);
826 elemTy->getSignedness(sNum, uNum, stack);
829 case PackedStructTy: {
830 stack.push_back(this);
831 for (unsigned i = 0; i < elements->size(); i++) {
832 (*elements)[i]->getSignedness(sNum, uNum, stack);
837 const TypeInfo* Ty = this->resolve();
838 // Let's not recurse.
839 UpRefStack::const_iterator I = stack.begin(), E = stack.end();
840 for ( ; I != E && *I != Ty; ++I)
843 Ty->getSignedness(sNum, uNum, stack);
849 std::string AddSuffix(const std::string& Name, const std::string& Suffix) {
850 if (Name[Name.size()-1] == '"') {
851 std::string Result = Name;
852 Result.insert(Result.size()-1, Suffix);
855 return Name + Suffix;
858 std::string TypeInfo::makeUniqueName(const std::string& BaseName) const {
859 if (BaseName == "\"alloca point\"")
864 case OpaqueTy: case LabelTy: case VoidTy: case BoolTy: case UpRefTy:
865 case FloatTy : case DoubleTy: case UnresolvedTy:
867 case SByteTy: case ShortTy: case LongTy: case IntTy:
868 return AddSuffix(BaseName, ".s");
869 case UByteTy: case UShortTy: case UIntTy: case ULongTy:
870 return AddSuffix(BaseName, ".u");
873 unsigned uNum = 0, sNum = 0;
879 TypeInfo::UpRefStack stack;
880 elemTy->resolve()->getSignedness(sNum, uNum, stack);
884 case PackedStructTy: {
885 for (unsigned i = 0; i < elements->size(); i++) {
886 TypeInfo::UpRefStack stack;
887 (*elements)[i]->resolve()->getSignedness(sNum, uNum, stack);
892 assert(0 && "Invalid Type");
896 if (sNum == 0 && uNum == 0)
900 default: Suffix += ".nada"; break;
901 case PointerTy: Suffix += ".pntr"; break;
902 case PackedTy: Suffix += ".pckd"; break;
903 case ArrayTy: Suffix += ".arry"; break;
904 case StructTy: Suffix += ".strc"; break;
905 case PackedStructTy: Suffix += ".pstr"; break;
908 Suffix += ".s" + llvm::utostr(sNum);
909 Suffix += ".u" + llvm::utostr(uNum);
910 return AddSuffix(BaseName, Suffix);
913 TypeInfo& TypeInfo::operator=(const TypeInfo& that) {
915 nelems = that.nelems;
917 elemTy = that.elemTy;
918 resultTy = that.resultTy;
920 elements = new TypeList(that.elements->size());
921 *elements = *that.elements;
928 const TypeInfo* TypeInfo::add_new_type(TypeInfo* newTy) {
929 TypeRegMap::iterator I = registry.find(newTy);
930 if (I != registry.end()) {
934 registry.insert(newTy);
938 /// This type is used to keep track of the signedness of constants.
941 const TypeInfo *type;
942 ~ConstInfo() { delete cnst; }
945 /// This variable provides a counter for unique names. It is used in various
946 /// productions to ensure a unique name is generated.
947 static uint64_t UniqueNameCounter = 1;
949 // This is set when a DECLARE keyword is recognized so that subsequent parsing
950 // of a function prototype can know if its a declaration or definition.
951 static bool isDeclare = false;
953 // This bool is used to communicate between the InstVal and Inst rules about
954 // whether or not a cast should be deleted. When the flag is set, InstVal has
955 // determined that the cast is a candidate. However, it can only be deleted if
956 // the value being casted is the same value name as the instruction. The Inst
957 // rule makes that comparison if the flag is set and comments out the
958 // instruction if they match.
959 static bool deleteUselessCastFlag = false;
960 static std::string* deleteUselessCastName = 0;
964 const char* getCastOpcode(std::string& Source, const TypeInfo* SrcTy,
965 const TypeInfo* DstTy) {
966 unsigned SrcBits = SrcTy->getBitWidth();
967 unsigned DstBits = DstTy->getBitWidth();
968 const char* opcode = "bitcast";
969 // Run through the possibilities ...
970 if (DstTy->isIntegral()) { // Casting to integral
971 if (SrcTy->isIntegral()) { // Casting from integral
972 if (DstBits < SrcBits)
974 else if (DstBits > SrcBits) { // its an extension
975 if (SrcTy->isSigned())
976 opcode ="sext"; // signed -> SEXT
978 opcode = "zext"; // unsigned -> ZEXT
980 opcode = "bitcast"; // Same size, No-op cast
982 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
983 if (DstTy->isSigned())
984 opcode = "fptosi"; // FP -> sint
986 opcode = "fptoui"; // FP -> uint
987 } else if (SrcTy->isPacked()) {
988 assert(DstBits == SrcTy->getBitWidth() &&
989 "Casting packed to integer of different width");
990 opcode = "bitcast"; // same size, no-op cast
992 assert(SrcTy->isPointer() &&
993 "Casting from a value that is not first-class type");
994 opcode = "ptrtoint"; // ptr -> int
996 } else if (DstTy->isFloatingPoint()) { // Casting to floating pt
997 if (SrcTy->isIntegral()) { // Casting from integral
998 if (SrcTy->isSigned())
999 opcode = "sitofp"; // sint -> FP
1001 opcode = "uitofp"; // uint -> FP
1002 } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
1003 if (DstBits < SrcBits) {
1004 opcode = "fptrunc"; // FP -> smaller FP
1005 } else if (DstBits > SrcBits) {
1006 opcode = "fpext"; // FP -> larger FP
1008 opcode ="bitcast"; // same size, no-op cast
1010 } else if (SrcTy->isPacked()) {
1011 assert(DstBits == SrcTy->getBitWidth() &&
1012 "Casting packed to floating point of different width");
1013 opcode = "bitcast"; // same size, no-op cast
1015 assert(0 && "Casting pointer or non-first class to float");
1017 } else if (DstTy->isPacked()) {
1018 if (SrcTy->isPacked()) {
1019 assert(DstTy->getBitWidth() == SrcTy->getBitWidth() &&
1020 "Casting packed to packed of different widths");
1021 opcode = "bitcast"; // packed -> packed
1022 } else if (DstTy->getBitWidth() == SrcBits) {
1023 opcode = "bitcast"; // float/int -> packed
1025 assert(!"Illegal cast to packed (wrong type or size)");
1027 } else if (DstTy->isPointer()) {
1028 if (SrcTy->isPointer()) {
1029 opcode = "bitcast"; // ptr -> ptr
1030 } else if (SrcTy->isIntegral()) {
1031 opcode = "inttoptr"; // int -> ptr
1033 assert(!"Casting invalid type to pointer");
1036 assert(!"Casting to type that is not first-class");
1041 std::string getCastUpgrade(const std::string& Src, const TypeInfo* SrcTy,
1042 const TypeInfo* DstTy, bool isConst) {
1044 std::string Source = Src;
1045 if (SrcTy->isFloatingPoint() && DstTy->isPointer()) {
1046 // fp -> ptr cast is no longer supported but we must upgrade this
1047 // by doing a double cast: fp -> int -> ptr
1049 Source = "i64 fptoui(" + Source + " to i64)";
1051 *O << " %cast_upgrade" << UniqueNameCounter++ << " = fptoui "
1052 << Source << " to i64\n";
1053 Source = "i64 %cast_upgrade" + llvm::utostr(UniqueNameCounter);
1055 // Update the SrcTy for the getCastOpcode call below
1056 SrcTy = TypeInfo::get("i64", ULongTy);
1057 } else if (DstTy->isBool()) {
1058 // cast type %x to bool was previously defined as setne type %x, null
1059 // The cast semantic is now to truncate, not compare so we must retain
1060 // the original intent by replacing the cast with a setne
1061 const char* comparator = SrcTy->isPointer() ? ", null" :
1062 (SrcTy->isFloatingPoint() ? ", 0.0" :
1063 (SrcTy->isBool() ? ", false" : ", 0"));
1064 const char* compareOp = SrcTy->isFloatingPoint() ? "fcmp one " : "icmp ne ";
1066 Result = "(" + Source + comparator + ")";
1067 Result = compareOp + Result;
1069 Result = compareOp + Source + comparator;
1070 return Result; // skip cast processing below
1072 SrcTy = SrcTy->resolve();
1073 DstTy = DstTy->resolve();
1074 std::string Opcode(getCastOpcode(Source, SrcTy, DstTy));
1076 Result += Opcode + "( " + Source + " to " + DstTy->getNewTy() + ")";
1078 Result += Opcode + " " + Source + " to " + DstTy->getNewTy();
1082 const char* getDivRemOpcode(const std::string& opcode, const TypeInfo* TI) {
1083 const char* op = opcode.c_str();
1084 const TypeInfo* Ty = TI->resolve();
1086 Ty = Ty->getElementType();
1087 if (opcode == "div")
1088 if (Ty->isFloatingPoint())
1090 else if (Ty->isUnsigned())
1092 else if (Ty->isSigned())
1095 yyerror("Invalid type for div instruction");
1096 else if (opcode == "rem")
1097 if (Ty->isFloatingPoint())
1099 else if (Ty->isUnsigned())
1101 else if (Ty->isSigned())
1104 yyerror("Invalid type for rem instruction");
1108 std::string getCompareOp(const std::string& setcc, const TypeInfo* TI) {
1109 assert(setcc.length() == 5);
1110 char cc1 = setcc[3];
1111 char cc2 = setcc[4];
1112 assert(cc1 == 'e' || cc1 == 'n' || cc1 == 'l' || cc1 == 'g');
1113 assert(cc2 == 'q' || cc2 == 'e' || cc2 == 'e' || cc2 == 't');
1114 std::string result("xcmp xxx");
1117 if (TI->isFloatingPoint()) {
1121 result[5] = 'u'; // NE maps to unordered
1123 result[5] = 'o'; // everything else maps to ordered
1124 } else if (TI->isIntegral() || TI->isPointer()) {
1126 if ((cc1 == 'e' && cc2 == 'q') || (cc1 == 'n' && cc2 == 'e'))
1128 else if (TI->isSigned())
1130 else if (TI->isUnsigned() || TI->isPointer() || TI->isBool())
1133 yyerror("Invalid integral type for setcc");
1138 const TypeInfo* getFunctionReturnType(const TypeInfo* PFTy) {
1139 PFTy = PFTy->resolve();
1140 if (PFTy->isPointer()) {
1141 const TypeInfo* ElemTy = PFTy->getElementType();
1142 ElemTy = ElemTy->resolve();
1143 if (ElemTy->isFunction())
1144 return ElemTy->getResultType();
1145 } else if (PFTy->isFunction()) {
1146 return PFTy->getResultType();
1151 const TypeInfo* ResolveUpReference(const TypeInfo* Ty,
1152 TypeInfo::UpRefStack* stack) {
1153 assert(Ty->isUpReference() && "Can't resolve a non-upreference");
1154 unsigned upref = Ty->getUpRefNum();
1155 assert(upref < stack->size() && "Invalid up reference");
1156 return (*stack)[upref - stack->size() - 1];
1159 const TypeInfo* getGEPIndexedType(const TypeInfo* PTy, ValueList* idxs) {
1160 const TypeInfo* Result = PTy = PTy->resolve();
1161 assert(PTy->isPointer() && "GEP Operand is not a pointer?");
1162 TypeInfo::UpRefStack stack;
1163 for (unsigned i = 0; i < idxs->size(); ++i) {
1164 if (Result->isComposite()) {
1165 Result = Result->getIndexedType((*idxs)[i]);
1166 Result = Result->resolve();
1167 stack.push_back(Result);
1169 yyerror("Invalid type for index");
1171 // Resolve upreferences so we can return a more natural type
1172 if (Result->isPointer()) {
1173 if (Result->getElementType()->isUpReference()) {
1174 stack.push_back(Result);
1175 Result = ResolveUpReference(Result->getElementType(), &stack);
1177 } else if (Result->isUpReference()) {
1178 Result = ResolveUpReference(Result->getElementType(), &stack);
1180 return Result->getPointerType();
1183 // This function handles appending .u or .s to integer value names that
1184 // were previously unsigned or signed, respectively. This avoids name
1185 // collisions since the unsigned and signed type planes have collapsed
1186 // into a single signless type plane.
1187 std::string getUniqueName(const std::string *Name, const TypeInfo* Ty,
1188 bool isGlobal = false, bool isDef = false) {
1190 // If its not a symbolic name, don't modify it, probably a constant val.
1191 if ((*Name)[0] != '%' && (*Name)[0] != '"')
1194 // If its a numeric reference, just leave it alone.
1195 if (isdigit((*Name)[1]))
1201 // If its a global name, get its uniquified name, if any
1202 TypeInfo::GlobalsTypeMap::iterator GI = TypeInfo::Globals.find(*Name);
1203 if (GI != TypeInfo::Globals.end()) {
1204 TypeInfo::TypePlaneMap::iterator TPI = GI->second.begin();
1205 TypeInfo::TypePlaneMap::iterator TPE = GI->second.end();
1206 for ( ; TPI != TPE ; ++TPI) {
1207 if (TPI->first->sameNewTyAs(Ty))
1213 // We didn't find a global name, but if its supposed to be global then all
1214 // we can do is return the name. This is probably a forward reference of a
1215 // global value that hasn't been defined yet. Since we have no definition
1216 // we don't know its linkage class. Just assume its an external and the name
1217 // shouldn't change.
1221 // Default the result to the current name
1222 std::string Result = Ty->makeUniqueName(*Name);
1227 std::string getGlobalName(const std::string* Name, const std::string Linkage,
1228 const TypeInfo* Ty, bool isConstant) {
1229 // Default to given name
1230 std::string Result = *Name;
1231 // Look up the name in the Globals Map
1232 TypeInfo::GlobalsTypeMap::iterator GI = TypeInfo::Globals.find(*Name);
1233 // Did we see this global name before?
1234 if (GI != TypeInfo::Globals.end()) {
1235 if (Ty->isUnresolvedDeep()) {
1236 // The Gval's type is unresolved. Consequently, we can't disambiguate it
1237 // by type. We'll just change its name and emit a warning.
1238 warning("Cannot disambiguate global value '" + *Name +
1239 "' because type '" + Ty->getNewTy() + "'is unresolved.\n");
1240 Result = *Name + ".unique";
1241 UniqueNameCounter++;
1242 Result += llvm::utostr(UniqueNameCounter);
1245 TypeInfo::TypePlaneMap::iterator TPI = GI->second.find(Ty);
1246 if (TPI != GI->second.end()) {
1247 // We found an existing name of the same old type. This isn't allowed
1248 // in LLVM 2.0. Consequently, we must alter the name of the global so it
1249 // can at least compile. References to the global will yield the first
1250 // definition, which is okay. We also must warn about this.
1251 Result = *Name + ".unique";
1252 UniqueNameCounter++;
1253 Result += llvm::utostr(UniqueNameCounter);
1254 warning(std::string("Global variable '") + *Name + "' was renamed to '"+
1257 // There isn't an existing definition for this name according to the
1258 // old types. Now search the TypePlanMap for types with the same new
1260 TypeInfo::TypePlaneMap::iterator TPI = GI->second.begin();
1261 TypeInfo::TypePlaneMap::iterator TPE = GI->second.end();
1262 for ( ; TPI != TPE; ++TPI) {
1263 if (TPI->first->sameNewTyAs(Ty)) {
1264 // The new types are the same but the old types are different so
1265 // this is a global name collision resulting from type planes
1267 if (Linkage == "external" || Linkage == "dllimport" ||
1268 Linkage == "extern_weak" || Linkage == "") {
1269 // The linkage of this gval is external so we can't reliably
1270 // rename it because it could potentially create a linking
1271 // problem. However, we can't leave the name conflict in the
1272 // output either or it won't assemble with LLVM 2.0. So, all we
1273 // can do is rename this one to something unique and emit a
1274 // warning about the problem.
1275 Result = *Name + ".unique";
1276 UniqueNameCounter++;
1277 Result += llvm::utostr(UniqueNameCounter);
1278 warning("Renaming global value '" + *Name + "' to '" + Result +
1279 "' may cause linkage errors.");
1282 // Its linkage is internal and its type is known so we can
1283 // disambiguate the name collision successfully based on the type.
1284 Result = getUniqueName(Name, Ty);
1285 TPI->second = Result;
1290 // We didn't find an entry in the type plane with the same new type and
1291 // the old types differ so this is a new type plane for this global
1292 // variable. We just fall through to the logic below which inserts
1298 // Its a new global name, if it is external we can't change it
1299 if (isConstant || Linkage == "external" || Linkage == "dllimport" ||
1300 Linkage == "extern_weak" || Linkage == "") {
1301 TypeInfo::Globals[Result][Ty] = Result;
1305 // Its a new global name, and it is internal, change the name to make it
1306 // unique for its type.
1307 // Result = getUniqueName(Name, Ty);
1308 TypeInfo::Globals[*Name][Ty] = Result;
1312 } // End anonymous namespace
1314 // This function is used by the Lexer to create a TypeInfo. It can't be
1315 // in the anonymous namespace.
1316 const TypeInfo* getTypeInfo(const std::string& newTy, Types oldTy) {
1317 return TypeInfo::get(newTy, oldTy);
1322 /* Enabling traces. */
1327 /* Enabling verbose error messages. */
1328 #ifdef YYERROR_VERBOSE
1329 # undef YYERROR_VERBOSE
1330 # define YYERROR_VERBOSE 1
1332 # define YYERROR_VERBOSE 0
1335 /* Enabling the token table. */
1336 #ifndef YYTOKEN_TABLE
1337 # define YYTOKEN_TABLE 0
1340 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1341 #line 968 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
1342 typedef union YYSTYPE {
1343 std::string* String;
1344 const TypeInfo* Type;
1350 /* Line 196 of yacc.c. */
1351 #line 1352 "UpgradeParser.tab.c"
1352 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1353 # define YYSTYPE_IS_DECLARED 1
1354 # define YYSTYPE_IS_TRIVIAL 1
1359 /* Copy the second part of user declarations. */
1362 /* Line 219 of yacc.c. */
1363 #line 1364 "UpgradeParser.tab.c"
1365 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1366 # define YYSIZE_T __SIZE_TYPE__
1368 #if ! defined (YYSIZE_T) && defined (size_t)
1369 # define YYSIZE_T size_t
1371 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1372 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1373 # define YYSIZE_T size_t
1375 #if ! defined (YYSIZE_T)
1376 # define YYSIZE_T unsigned int
1382 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1383 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1387 # define YY_(msgid) msgid
1391 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1393 /* The parser invokes alloca or malloc; define the necessary symbols. */
1395 # ifdef YYSTACK_USE_ALLOCA
1396 # if YYSTACK_USE_ALLOCA
1398 # define YYSTACK_ALLOC __builtin_alloca
1400 # define YYSTACK_ALLOC alloca
1401 # if defined (__STDC__) || defined (__cplusplus)
1402 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1403 # define YYINCLUDED_STDLIB_H
1409 # ifdef YYSTACK_ALLOC
1410 /* Pacify GCC's `empty if-body' warning. */
1411 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1412 # ifndef YYSTACK_ALLOC_MAXIMUM
1413 /* The OS might guarantee only one guard page at the bottom of the stack,
1414 and a page size can be as small as 4096 bytes. So we cannot safely
1415 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1416 to allow for a few compiler-allocated temporary stack slots. */
1417 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1420 # define YYSTACK_ALLOC YYMALLOC
1421 # define YYSTACK_FREE YYFREE
1422 # ifndef YYSTACK_ALLOC_MAXIMUM
1423 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1429 # define YYMALLOC malloc
1430 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1431 && (defined (__STDC__) || defined (__cplusplus)))
1432 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1436 # define YYFREE free
1437 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1438 && (defined (__STDC__) || defined (__cplusplus)))
1439 void free (void *); /* INFRINGES ON USER NAME SPACE */
1446 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1449 #if (! defined (yyoverflow) \
1450 && (! defined (__cplusplus) \
1451 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1453 /* A type that is properly aligned for any stack member. */
1460 /* The size of the maximum gap between one aligned stack and the next. */
1461 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1463 /* The size of an array large to enough to hold all stacks, each with
1465 # define YYSTACK_BYTES(N) \
1466 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
1467 + YYSTACK_GAP_MAXIMUM)
1469 /* Copy COUNT objects from FROM to TO. The source and destination do
1472 # if defined (__GNUC__) && 1 < __GNUC__
1473 # define YYCOPY(To, From, Count) \
1474 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1476 # define YYCOPY(To, From, Count) \
1480 for (yyi = 0; yyi < (Count); yyi++) \
1481 (To)[yyi] = (From)[yyi]; \
1487 /* Relocate STACK from its old location to the new one. The
1488 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1489 elements in the stack, and YYPTR gives the new location of the
1490 stack. Advance YYPTR to a properly aligned location for the next
1492 # define YYSTACK_RELOCATE(Stack) \
1495 YYSIZE_T yynewbytes; \
1496 YYCOPY (&yyptr->Stack, Stack, yysize); \
1497 Stack = &yyptr->Stack; \
1498 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1499 yyptr += yynewbytes / sizeof (*yyptr); \
1505 #if defined (__STDC__) || defined (__cplusplus)
1506 typedef signed char yysigned_char;
1508 typedef short int yysigned_char;
1511 /* YYFINAL -- State number of the termination state. */
1513 /* YYLAST -- Last index in YYTABLE. */
1516 /* YYNTOKENS -- Number of terminals. */
1517 #define YYNTOKENS 164
1518 /* YYNNTS -- Number of nonterminals. */
1520 /* YYNRULES -- Number of rules. */
1521 #define YYNRULES 301
1522 /* YYNRULES -- Number of states. */
1523 #define YYNSTATES 585
1525 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1526 #define YYUNDEFTOK 2
1527 #define YYMAXUTOK 404
1529 #define YYTRANSLATE(YYX) \
1530 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1532 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1533 static const unsigned char yytranslate[] =
1535 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1539 153, 154, 162, 2, 151, 2, 2, 2, 2, 2,
1540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1541 158, 150, 159, 2, 2, 2, 2, 2, 2, 2,
1542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1544 2, 155, 152, 157, 2, 2, 2, 2, 2, 163,
1545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1547 156, 2, 2, 160, 2, 161, 2, 2, 2, 2,
1548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1560 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1561 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1562 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1563 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1564 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1565 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1566 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1567 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1568 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1569 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1570 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1571 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1572 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1573 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1574 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1575 145, 146, 147, 148, 149
1579 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1581 static const unsigned short int yyprhs[] =
1583 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1584 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1585 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1586 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1587 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1588 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1589 119, 121, 123, 125, 127, 129, 131, 133, 135, 137,
1590 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
1591 159, 161, 164, 165, 167, 169, 171, 173, 175, 177,
1592 179, 180, 182, 184, 186, 188, 190, 192, 195, 196,
1593 197, 200, 201, 205, 208, 209, 211, 212, 216, 218,
1594 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,
1595 241, 243, 245, 247, 249, 251, 253, 255, 257, 259,
1596 261, 264, 269, 275, 281, 285, 288, 294, 299, 302,
1597 304, 308, 310, 314, 316, 317, 322, 326, 330, 335,
1598 340, 344, 347, 350, 353, 356, 359, 362, 365, 368,
1599 371, 374, 381, 387, 396, 403, 410, 417, 425, 433,
1600 440, 447, 456, 465, 469, 471, 473, 475, 477, 480,
1601 483, 488, 491, 493, 495, 497, 502, 505, 510, 517,
1602 524, 531, 538, 542, 547, 548, 550, 552, 554, 558,
1603 562, 566, 570, 574, 578, 580, 581, 583, 585, 587,
1604 588, 591, 595, 597, 599, 603, 605, 606, 615, 617,
1605 619, 623, 625, 627, 631, 632, 634, 636, 637, 642,
1606 643, 645, 647, 649, 651, 653, 655, 657, 659, 661,
1607 665, 667, 673, 675, 677, 679, 681, 684, 687, 689,
1608 692, 695, 696, 698, 700, 702, 705, 708, 712, 722,
1609 732, 741, 756, 758, 760, 767, 773, 776, 783, 791,
1610 793, 797, 799, 800, 803, 805, 811, 817, 823, 830,
1611 837, 842, 847, 854, 859, 864, 871, 878, 881, 889,
1612 891, 894, 895, 897, 898, 902, 909, 913, 920, 923,
1616 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1617 static const short int yyrhs[] =
1619 198, 0, -1, 19, -1, 20, -1, 17, -1, 18,
1620 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1621 -1, 84, -1, 85, -1, 86, -1, 87, -1, 88,
1622 -1, 89, -1, 90, -1, 91, -1, 92, -1, 93,
1623 -1, 94, -1, 95, -1, 96, -1, 97, -1, 98,
1624 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1625 -1, 106, -1, 117, -1, 118, -1, 119, -1, 120,
1626 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1627 -1, 112, -1, 113, -1, 114, -1, 115, -1, 116,
1628 -1, 117, -1, 118, -1, 119, -1, 120, -1, 25,
1629 -1, 26, -1, 129, -1, 130, -1, 131, -1, 132,
1630 -1, 138, -1, 139, -1, 140, -1, 141, -1, 142,
1631 -1, 143, -1, 144, -1, 145, -1, 146, -1, 147,
1632 -1, 148, -1, 149, -1, 137, -1, 11, -1, 9,
1633 -1, 7, -1, 5, -1, 12, -1, 10, -1, 8,
1634 -1, 6, -1, 174, -1, 175, -1, 13, -1, 14,
1635 -1, 207, 150, -1, -1, 42, -1, 43, -1, 44,
1636 -1, 48, -1, 45, -1, 46, -1, 47, -1, -1,
1637 65, -1, 66, -1, 67, -1, 68, -1, 69, -1,
1638 70, -1, 64, 18, -1, -1, -1, 56, 18, -1,
1639 -1, 151, 56, 18, -1, 37, 30, -1, -1, 183,
1640 -1, -1, 151, 186, 185, -1, 183, -1, 56, 18,
1641 -1, 189, -1, 3, -1, 191, -1, 3, -1, 191,
1642 -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
1643 -1, 9, -1, 10, -1, 11, -1, 12, -1, 13,
1644 -1, 14, -1, 15, -1, 16, -1, 222, -1, 190,
1645 -1, 152, 18, -1, 188, 153, 193, 154, -1, 155,
1646 18, 156, 191, 157, -1, 158, 18, 156, 191, 159,
1647 -1, 160, 192, 161, -1, 160, 161, -1, 158, 160,
1648 192, 161, 159, -1, 158, 160, 161, 159, -1, 191,
1649 162, -1, 191, -1, 192, 151, 191, -1, 192, -1,
1650 192, 151, 40, -1, 40, -1, -1, 189, 155, 196,
1651 157, -1, 189, 155, 157, -1, 189, 163, 30, -1,
1652 189, 158, 196, 159, -1, 189, 160, 196, 161, -1,
1653 189, 160, 161, -1, 189, 22, -1, 189, 23, -1,
1654 189, 222, -1, 189, 195, -1, 189, 24, -1, 174,
1655 166, -1, 175, 166, -1, 4, 25, -1, 4, 26,
1656 -1, 177, 21, -1, 173, 153, 194, 39, 189, 154,
1657 -1, 126, 153, 194, 237, 154, -1, 128, 153, 194,
1658 151, 194, 151, 194, 154, -1, 167, 153, 194, 151,
1659 194, 154, -1, 168, 153, 194, 151, 194, 154, -1,
1660 169, 153, 194, 151, 194, 154, -1, 99, 170, 153,
1661 194, 151, 194, 154, -1, 100, 171, 153, 194, 151,
1662 194, 154, -1, 172, 153, 194, 151, 194, 154, -1,
1663 134, 153, 194, 151, 194, 154, -1, 135, 153, 194,
1664 151, 194, 151, 194, 154, -1, 136, 153, 194, 151,
1665 194, 151, 194, 154, -1, 196, 151, 194, -1, 194,
1666 -1, 35, -1, 36, -1, 199, -1, 199, 216, -1,
1667 199, 218, -1, 199, 62, 61, 202, -1, 199, 31,
1668 -1, 201, -1, 49, -1, 57, -1, 201, 178, 27,
1669 187, -1, 201, 218, -1, 201, 62, 61, 202, -1,
1670 201, 178, 179, 197, 194, 185, -1, 201, 178, 200,
1671 197, 189, 185, -1, 201, 178, 45, 197, 189, 185,
1672 -1, 201, 178, 47, 197, 189, 185, -1, 201, 50,
1673 204, -1, 201, 58, 150, 205, -1, -1, 30, -1,
1674 55, -1, 54, -1, 52, 150, 203, -1, 53, 150,
1675 18, -1, 51, 150, 30, -1, 71, 150, 30, -1,
1676 155, 206, 157, -1, 206, 151, 30, -1, 30, -1,
1677 -1, 28, -1, 30, -1, 207, -1, -1, 189, 208,
1678 -1, 210, 151, 209, -1, 209, -1, 210, -1, 210,
1679 151, 40, -1, 40, -1, -1, 180, 187, 207, 153,
1680 211, 154, 184, 181, -1, 32, -1, 160, -1, 179,
1681 212, 213, -1, 33, -1, 161, -1, 214, 225, 215,
1682 -1, -1, 45, -1, 47, -1, -1, 34, 219, 217,
1683 212, -1, -1, 63, -1, 17, -1, 18, -1, 21,
1684 -1, 25, -1, 26, -1, 22, -1, 23, -1, 24,
1685 -1, 158, 196, 159, -1, 195, -1, 61, 220, 30,
1686 151, 30, -1, 165, -1, 207, -1, 222, -1, 221,
1687 -1, 189, 223, -1, 225, 226, -1, 226, -1, 227,
1688 229, -1, 227, 231, -1, -1, 29, -1, 77, -1,
1689 76, -1, 72, 224, -1, 72, 3, -1, 73, 15,
1690 223, -1, 73, 4, 223, 151, 15, 223, 151, 15,
1691 223, -1, 74, 176, 223, 151, 15, 223, 155, 230,
1692 157, -1, 74, 176, 223, 151, 15, 223, 155, 157,
1693 -1, 178, 75, 180, 187, 223, 153, 234, 154, 39,
1694 15, 223, 228, 15, 223, -1, 228, -1, 78, -1,
1695 230, 176, 221, 151, 15, 223, -1, 176, 221, 151,
1696 15, 223, -1, 178, 236, -1, 189, 155, 223, 151,
1697 223, 157, -1, 232, 151, 155, 223, 151, 223, 157,
1698 -1, 224, -1, 233, 151, 224, -1, 233, -1, -1,
1699 60, 59, -1, 59, -1, 167, 189, 223, 151, 223,
1700 -1, 168, 189, 223, 151, 223, -1, 169, 189, 223,
1701 151, 223, -1, 99, 170, 189, 223, 151, 223, -1,
1702 100, 171, 189, 223, 151, 223, -1, 172, 224, 151,
1703 224, -1, 173, 224, 39, 189, -1, 128, 224, 151,
1704 224, 151, 224, -1, 133, 224, 151, 189, -1, 134,
1705 224, 151, 224, -1, 135, 224, 151, 224, 151, 224,
1706 -1, 136, 224, 151, 224, 151, 224, -1, 127, 232,
1707 -1, 235, 180, 187, 223, 153, 234, 154, -1, 239,
1708 -1, 151, 233, -1, -1, 38, -1, -1, 121, 189,
1709 182, -1, 121, 189, 151, 10, 223, 182, -1, 122,
1710 189, 182, -1, 122, 189, 151, 10, 223, 182, -1,
1711 123, 224, -1, 238, 124, 189, 223, -1, 238, 125,
1712 224, 151, 189, 223, -1, 126, 189, 223, 237, -1
1715 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1716 static const unsigned short int yyrline[] =
1718 0, 1033, 1033, 1033, 1034, 1034, 1038, 1038, 1038, 1038,
1719 1038, 1038, 1038, 1039, 1039, 1039, 1039, 1040, 1040, 1040,
1720 1041, 1041, 1041, 1041, 1041, 1041, 1042, 1042, 1042, 1042,
1721 1042, 1042, 1042, 1042, 1042, 1042, 1043, 1043, 1043, 1043,
1722 1043, 1043, 1043, 1043, 1043, 1043, 1044, 1044, 1044, 1044,
1723 1044, 1044, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1046,
1724 1046, 1046, 1046, 1047, 1047, 1047, 1047, 1047, 1047, 1052,
1725 1052, 1052, 1052, 1053, 1053, 1053, 1053, 1054, 1054, 1055,
1726 1055, 1058, 1061, 1066, 1066, 1066, 1066, 1066, 1066, 1067,
1727 1068, 1071, 1071, 1071, 1071, 1071, 1072, 1073, 1078, 1083,
1728 1084, 1087, 1088, 1096, 1102, 1103, 1106, 1107, 1116, 1117,
1729 1130, 1130, 1131, 1131, 1132, 1136, 1136, 1136, 1136, 1136,
1730 1136, 1136, 1137, 1137, 1137, 1137, 1137, 1139, 1142, 1145,
1731 1148, 1152, 1165, 1171, 1177, 1187, 1190, 1200, 1203, 1211,
1732 1215, 1222, 1223, 1228, 1233, 1243, 1250, 1256, 1263, 1270,
1733 1277, 1283, 1290, 1297, 1305, 1312, 1319, 1326, 1333, 1340,
1734 1347, 1355, 1369, 1381, 1386, 1392, 1397, 1403, 1408, 1413,
1735 1421, 1426, 1431, 1441, 1446, 1451, 1451, 1461, 1466, 1469,
1736 1474, 1478, 1482, 1484, 1484, 1487, 1497, 1502, 1507, 1517,
1737 1527, 1537, 1547, 1552, 1557, 1562, 1564, 1564, 1567, 1572,
1738 1579, 1584, 1591, 1598, 1603, 1604, 1612, 1612, 1613, 1613,
1739 1615, 1624, 1628, 1632, 1635, 1640, 1643, 1646, 1669, 1670,
1740 1673, 1684, 1685, 1687, 1696, 1697, 1698, 1702, 1702, 1716,
1741 1717, 1720, 1720, 1720, 1720, 1720, 1720, 1720, 1721, 1722,
1742 1727, 1728, 1737, 1737, 1741, 1747, 1758, 1767, 1770, 1778,
1743 1782, 1787, 1790, 1796, 1796, 1798, 1803, 1808, 1813, 1821,
1744 1831, 1840, 1862, 1867, 1873, 1879, 1887, 1905, 1914, 1924,
1745 1928, 1935, 1936, 1940, 1945, 1948, 1959, 1969, 1980, 1990,
1746 2000, 2011, 2041, 2050, 2057, 2066, 2073, 2080, 2086, 2137,
1747 2142, 2143, 2147, 2148, 2151, 2160, 2170, 2179, 2190, 2197,
1752 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1753 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1754 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1755 static const char *const yytname[] =
1757 "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
1758 "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
1759 "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
1760 "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
1761 "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
1762 "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
1763 "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
1764 "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "EXTERNAL",
1765 "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
1766 "UNINITIALIZED", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
1767 "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
1768 "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
1769 "RET", "BR", "SWITCH", "INVOKE", "EXCEPT", "UNWIND", "UNREACHABLE",
1770 "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
1771 "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
1772 "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1773 "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
1774 "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1775 "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
1776 "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
1777 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
1778 "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
1779 "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1780 "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
1781 "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
1782 "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
1783 "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
1784 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
1785 "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
1786 "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1787 "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
1788 "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
1789 "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
1790 "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
1791 "FunctionProto", "@1", "OptSideEffect", "ConstValueRef",
1792 "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
1793 "BasicBlock", "InstructionList", "Unwind", "BBTerminatorInst",
1794 "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE",
1795 "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0
1800 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1802 static const unsigned short int yytoknum[] =
1804 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1805 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1806 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1807 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1808 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1809 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1810 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1811 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1812 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1813 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1814 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1815 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1816 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1817 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1818 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1819 61, 44, 92, 40, 41, 91, 120, 93, 60, 62,
1824 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1825 static const unsigned char yyr1[] =
1827 0, 164, 165, 165, 166, 166, 167, 167, 167, 167,
1828 167, 167, 167, 167, 167, 167, 167, 168, 168, 168,
1829 169, 169, 169, 169, 169, 169, 170, 170, 170, 170,
1830 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
1831 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1832 171, 171, 172, 172, 172, 172, 173, 173, 173, 173,
1833 173, 173, 173, 173, 173, 173, 173, 173, 173, 174,
1834 174, 174, 174, 175, 175, 175, 175, 176, 176, 177,
1835 177, 178, 178, 179, 179, 179, 179, 179, 179, 179,
1836 179, 180, 180, 180, 180, 180, 180, 180, 180, 181,
1837 181, 182, 182, 183, 184, 184, 185, 185, 186, 186,
1838 187, 187, 188, 188, 189, 190, 190, 190, 190, 190,
1839 190, 190, 190, 190, 190, 190, 190, 191, 191, 191,
1840 191, 191, 191, 191, 191, 191, 191, 191, 191, 192,
1841 192, 193, 193, 193, 193, 194, 194, 194, 194, 194,
1842 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
1843 194, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1844 195, 195, 195, 196, 196, 197, 197, 198, 199, 199,
1845 199, 199, 199, 200, 200, 201, 201, 201, 201, 201,
1846 201, 201, 201, 201, 201, 202, 203, 203, 204, 204,
1847 204, 204, 205, 206, 206, 206, 207, 207, 208, 208,
1848 209, 210, 210, 211, 211, 211, 211, 212, 213, 213,
1849 214, 215, 215, 216, 217, 217, 217, 219, 218, 220,
1850 220, 221, 221, 221, 221, 221, 221, 221, 221, 221,
1851 221, 221, 222, 222, 223, 223, 224, 225, 225, 226,
1852 227, 227, 227, 228, 228, 229, 229, 229, 229, 229,
1853 229, 229, 229, 229, 230, 230, 231, 232, 232, 233,
1854 233, 234, 234, 235, 235, 236, 236, 236, 236, 236,
1855 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
1856 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1860 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1861 static const unsigned char yyr2[] =
1863 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1864 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1865 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1866 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1867 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1868 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1869 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1870 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1871 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1872 0, 1, 1, 1, 1, 1, 1, 2, 0, 0,
1873 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
1874 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1875 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1876 2, 4, 5, 5, 3, 2, 5, 4, 2, 1,
1877 3, 1, 3, 1, 0, 4, 3, 3, 4, 4,
1878 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1879 2, 6, 5, 8, 6, 6, 6, 7, 7, 6,
1880 6, 8, 8, 3, 1, 1, 1, 1, 2, 2,
1881 4, 2, 1, 1, 1, 4, 2, 4, 6, 6,
1882 6, 6, 3, 4, 0, 1, 1, 1, 3, 3,
1883 3, 3, 3, 3, 1, 0, 1, 1, 1, 0,
1884 2, 3, 1, 1, 3, 1, 0, 8, 1, 1,
1885 3, 1, 1, 3, 0, 1, 1, 0, 4, 0,
1886 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1887 1, 5, 1, 1, 1, 1, 2, 2, 1, 2,
1888 2, 0, 1, 1, 1, 2, 2, 3, 9, 9,
1889 8, 14, 1, 1, 6, 5, 2, 6, 7, 1,
1890 3, 1, 0, 2, 1, 5, 5, 5, 6, 6,
1891 4, 4, 6, 4, 4, 6, 6, 2, 7, 1,
1892 2, 0, 1, 0, 3, 6, 3, 6, 2, 4,
1896 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1897 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1898 means the default is an error. */
1899 static const unsigned short int yydefact[] =
1901 194, 0, 90, 182, 1, 181, 227, 83, 84, 85,
1902 87, 88, 89, 86, 0, 98, 251, 178, 179, 206,
1903 207, 0, 0, 0, 90, 0, 186, 224, 0, 0,
1904 91, 92, 93, 94, 95, 96, 0, 0, 252, 251,
1905 248, 82, 0, 0, 0, 0, 192, 0, 0, 0,
1906 0, 0, 183, 184, 0, 0, 81, 225, 226, 98,
1907 195, 180, 97, 111, 115, 116, 117, 118, 119, 120,
1908 121, 122, 123, 124, 125, 126, 127, 2, 3, 0,
1909 0, 0, 0, 242, 0, 0, 110, 129, 114, 243,
1910 128, 218, 219, 220, 221, 222, 223, 247, 0, 0,
1911 0, 254, 253, 263, 293, 262, 249, 250, 0, 0,
1912 0, 0, 205, 193, 187, 185, 175, 176, 0, 0,
1913 0, 0, 228, 130, 0, 0, 0, 113, 135, 139,
1914 0, 0, 144, 138, 256, 0, 255, 0, 0, 72,
1915 76, 71, 75, 70, 74, 69, 73, 77, 78, 0,
1916 292, 274, 0, 98, 6, 7, 8, 9, 10, 11,
1917 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1918 22, 23, 24, 25, 0, 0, 0, 0, 0, 0,
1919 0, 0, 52, 53, 54, 55, 0, 0, 0, 0,
1920 68, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1921 65, 66, 67, 0, 0, 0, 0, 0, 98, 266,
1922 0, 289, 200, 197, 196, 198, 199, 201, 204, 0,
1923 106, 106, 115, 116, 117, 118, 119, 120, 121, 122,
1924 123, 124, 125, 0, 0, 0, 0, 106, 106, 0,
1925 0, 0, 0, 0, 134, 216, 143, 141, 0, 231,
1926 232, 233, 236, 237, 238, 234, 235, 229, 0, 0,
1927 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1928 0, 240, 245, 244, 246, 0, 257, 0, 273, 0,
1929 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1930 0, 50, 51, 36, 37, 38, 39, 40, 41, 42,
1931 43, 44, 45, 46, 47, 48, 49, 0, 101, 101,
1932 298, 0, 0, 287, 0, 0, 0, 0, 0, 0,
1933 0, 0, 0, 0, 0, 0, 0, 0, 202, 0,
1934 190, 191, 158, 159, 4, 5, 156, 157, 160, 151,
1935 152, 155, 0, 0, 0, 0, 154, 153, 188, 189,
1936 112, 112, 137, 0, 140, 215, 209, 212, 213, 0,
1937 0, 131, 230, 0, 0, 0, 0, 0, 0, 0,
1938 0, 174, 0, 0, 0, 0, 0, 0, 0, 0,
1939 0, 0, 0, 0, 294, 0, 296, 291, 0, 0,
1940 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1941 0, 0, 0, 203, 0, 0, 108, 106, 146, 0,
1942 0, 150, 0, 147, 132, 133, 136, 208, 210, 0,
1943 104, 142, 0, 0, 0, 291, 0, 0, 0, 0,
1944 0, 239, 0, 0, 0, 0, 0, 0, 0, 0,
1945 0, 0, 0, 0, 0, 0, 301, 0, 0, 0,
1946 283, 284, 0, 0, 0, 0, 0, 280, 281, 0,
1947 299, 0, 103, 109, 107, 145, 148, 149, 214, 211,
1948 105, 99, 0, 0, 0, 0, 0, 0, 0, 0,
1949 173, 0, 0, 0, 0, 0, 0, 0, 272, 0,
1950 0, 101, 102, 101, 269, 290, 0, 0, 0, 0,
1951 0, 275, 276, 277, 272, 0, 0, 217, 241, 0,
1952 0, 162, 0, 0, 0, 0, 0, 0, 0, 0,
1953 0, 0, 0, 271, 0, 278, 279, 0, 295, 297,
1954 0, 0, 0, 282, 285, 286, 0, 300, 100, 0,
1955 0, 0, 170, 0, 0, 164, 165, 166, 169, 161,
1956 0, 260, 0, 0, 0, 270, 267, 0, 288, 167,
1957 168, 0, 0, 0, 258, 0, 259, 0, 0, 268,
1958 163, 171, 172, 0, 0, 0, 0, 0, 0, 265,
1962 /* YYDEFGOTO[NTERM-NUM]. */
1963 static const short int yydefgoto[] =
1965 -1, 83, 336, 266, 267, 268, 290, 307, 269, 270,
1966 233, 234, 149, 235, 24, 15, 36, 507, 384, 406,
1967 471, 330, 407, 84, 85, 236, 87, 88, 130, 248,
1968 371, 271, 372, 118, 1, 2, 55, 3, 61, 215,
1969 46, 113, 219, 89, 418, 357, 358, 359, 37, 93,
1970 16, 96, 17, 59, 18, 27, 363, 272, 90, 274,
1971 494, 39, 40, 41, 105, 106, 553, 107, 313, 523,
1972 524, 208, 209, 446, 210, 211
1975 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1977 #define YYPACT_NINF -537
1978 static const short int yypact[] =
1980 -537, 75, 61, 1145, -537, -537, -537, -537, -537, -537,
1981 -537, -537, -537, -537, 18, 180, 55, -537, -537, -537,
1982 -537, -28, -61, 33, 130, -40, -537, 102, 87, 117,
1983 -537, -537, -537, -537, -537, -537, 838, -24, -537, -15,
1984 -537, 48, -11, -2, 6, 12, -537, 11, 87, 838,
1985 -9, -9, -537, -537, -9, -9, -537, -537, -537, 180,
1986 -537, -537, -537, 32, -537, -537, -537, -537, -537, -537,
1987 -537, -537, -537, -537, -537, -537, -537, -537, -537, 164,
1988 171, -6, 512, -537, 135, 41, -537, -537, -103, -537,
1989 -537, -537, -537, -537, -537, -537, -537, -537, 883, 45,
1990 192, -537, -537, -537, 1324, -537, -537, -537, 175, 126,
1991 190, 188, 203, -537, -537, -537, -537, -537, 911, 911,
1992 957, 911, -537, -537, 81, 97, 561, -537, -537, -103,
1993 -109, 121, 641, -537, 32, 1140, -537, 1140, 1140, -537,
1994 -537, -537, -537, -537, -537, -537, -537, -537, -537, 1140,
1995 -537, -537, 219, 180, -537, -537, -537, -537, -537, -537,
1996 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
1997 -537, -537, -537, -537, 10, 112, 911, 911, 911, 911,
1998 911, 911, -537, -537, -537, -537, 911, 911, 911, 911,
1999 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
2000 -537, -537, -537, 911, 911, 911, 911, 911, 180, -537,
2001 59, -537, -537, -537, -537, -537, -537, -537, -537, -71,
2002 129, 129, 167, 193, 195, 218, 222, 224, 234, 243,
2003 250, 261, 263, 252, 252, 264, 993, 129, 129, 911,
2004 911, 127, -97, 911, -537, 680, -537, 136, 137, -537,
2005 -537, -537, -537, -537, -537, -537, -537, 229, 10, 112,
2006 140, 141, 144, 145, 146, 957, 147, 148, 150, 154,
2007 155, -537, -537, -537, -537, 158, -537, 160, -537, 838,
2008 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
2009 911, -537, -537, -537, -537, -537, -537, -537, -537, -537,
2010 -537, -537, -537, -537, -537, -537, -537, 911, 163, 165,
2011 -537, 1140, 162, 169, 170, 172, 173, 174, 176, 1140,
2012 1140, 1140, 177, 276, 838, 911, 911, 288, -537, -8,
2013 -537, -537, -537, -537, -537, -537, -537, -537, -537, -537,
2014 -537, -537, 724, 957, 590, 292, -537, -537, -537, -537,
2015 -106, -104, -537, 179, -103, -537, 135, -537, 178, 181,
2016 752, -537, -537, 296, 183, 187, 957, 957, 957, 957,
2017 957, -537, -131, 957, 957, 957, 957, 957, 315, 316,
2018 1140, 1140, 1140, 1, -537, 7, -537, 191, 1140, 186,
2019 911, 911, 911, 911, 911, 194, 197, 201, 911, 911,
2020 1140, 1140, 202, -537, 304, 326, -537, 129, -537, -60,
2021 -78, -537, -74, -537, -537, -537, -537, -537, -537, 799,
2022 309, -537, 208, 957, 957, 191, 210, 213, 223, 225,
2023 957, -537, 230, 231, 235, 236, 308, 1140, 1140, 227,
2024 237, 238, 1140, 357, 1140, 911, -537, 239, 1140, 241,
2025 -537, -537, 242, 244, 1140, 1140, 1140, -537, -537, 248,
2026 -537, 911, -537, -537, -537, -537, -537, -537, -537, -537,
2027 -537, 338, 366, 246, 251, 249, 957, 957, 957, 957,
2028 -537, 957, 957, 957, 957, 911, 253, 258, 911, 1140,
2029 1140, 254, -537, 254, -537, 255, 1140, 256, 911, 911,
2030 911, -537, -537, -537, 911, 1140, 390, -537, -537, 957,
2031 957, -537, 265, 260, 266, 267, 268, 272, 274, 275,
2032 277, 400, 29, 255, 280, -537, -537, 363, -537, -537,
2033 911, 278, 1140, -537, -537, -537, 282, -537, -537, 283,
2034 287, 957, -537, 957, 957, -537, -537, -537, -537, -537,
2035 1140, -537, 1229, 60, 381, -537, -537, 286, -537, -537,
2036 -537, 290, 293, 294, -537, 270, -537, 1229, 435, -537,
2037 -537, -537, -537, 436, 302, 1140, 1140, 441, 196, -537,
2038 1140, 442, -537, 1140, -537
2041 /* YYPGOTO[NTERM-NUM]. */
2042 static const short int yypgoto[] =
2044 -537, -537, 226, 361, 362, 365, 209, 214, 368, 370,
2045 -99, -98, -507, -537, 420, 452, -134, -537, -303, 57,
2046 -537, -216, -537, -45, -537, -36, -537, -79, -30, -537,
2047 -111, 245, -210, 104, -537, -537, -537, -537, 431, -537,
2048 -537, -537, -537, 4, -537, 63, -537, -537, 421, -537,
2049 -537, -537, -537, -537, 480, -537, -537, -536, -105, 58,
2050 -88, -537, 445, -537, -93, -537, -537, -537, -537, 42,
2051 -18, -537, -537, 64, -537, -537
2054 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2055 positive, shift that token. If negative, reduce the rule which
2056 number is the opposite. If zero, do what YYDEFACT says.
2057 If YYTABLE_NINF, syntax error. */
2058 #define YYTABLE_NINF -178
2059 static const short int yytable[] =
2061 86, 147, 148, 129, 115, 331, 386, 25, 91, 237,
2062 136, 442, 125, 86, 38, 552, 565, 444, 94, 279,
2063 430, 348, 349, 42, 43, 44, 116, 117, 431, 404,
2064 273, 574, 273, 273, 139, 140, 141, 142, 143, 144,
2065 145, 146, 243, 45, 273, 25, 567, 129, 405, 137,
2066 -112, 414, 244, 129, 243, 415, 133, 443, 133, 133,
2067 138, -177, 135, 443, 353, 139, 140, 141, 142, 143,
2068 144, 145, 146, 430, 324, 4, 19, 430, 20, 28,
2069 327, 466, 220, 221, 38, 238, 328, 467, 131, 47,
2070 310, 430, 5, 314, 48, 6, 242, 465, 315, 316,
2071 317, 318, 247, 7, 8, 9, 10, 11, 12, 13,
2072 56, 280, 281, 282, 283, 284, 285, 60, 322, 323,
2073 98, 99, 100, 14, 101, 102, 103, 286, 287, 288,
2074 289, 347, 409, 410, 412, 62, 92, 291, 292, 108,
2075 308, 309, 135, 311, 312, 135, 95, 57, 109, 58,
2076 135, 135, 135, 135, 126, 119, 110, 49, 120, 121,
2077 350, 351, 111, 19, 354, 20, 112, 319, 320, 321,
2078 135, 135, 7, 8, 9, 50, 11, 51, 13, 52,
2079 213, 214, 123, 325, 326, -113, 551, 53, 528, 124,
2080 529, 464, 332, 333, 132, 275, 276, 139, 140, 141,
2081 142, 143, 144, 145, 146, 212, 273, 277, 216, 356,
2082 -72, -72, -76, -76, 273, 273, 273, 566, 217, 293,
2083 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,
2084 304, 305, 306, 218, 380, -71, -71, 239, 402, -75,
2085 -75, -70, -70, 86, 29, 30, 31, 32, 33, 34,
2086 35, -74, -74, 240, 381, 425, 426, 427, 428, 429,
2087 -69, -69, 432, 433, 434, 435, 436, -73, -73, 334,
2088 335, 382, 101, 102, 245, 273, 273, 273, 278, 400,
2089 329, 354, -79, 273, -80, 338, 352, 360, 86, 401,
2090 135, 361, 362, 366, 367, 273, 273, 368, 369, 370,
2091 373, 374, 449, 375, 451, 452, 453, 376, 377, 378,
2092 457, 379, 473, 474, 383, 399, 385, 388, 403, 480,
2093 389, 390, 413, 391, 392, 393, 422, 394, 398, 419,
2094 437, 438, 273, 273, 462, 420, 423, 273, 416, 273,
2095 424, 448, 445, 273, 463, 454, 404, 485, 455, 273,
2096 273, 273, 456, 461, 135, 450, 135, 135, 135, 472,
2097 417, 476, 135, 458, 477, 512, 513, 514, 515, 387,
2098 516, 517, 518, 519, 478, 492, 479, 395, 396, 397,
2099 488, 481, 482, 356, 273, 273, 483, 484, 489, 490,
2100 496, 273, 498, 499, 506, 500, 508, 509, 539, 540,
2101 273, 504, 510, 511, 521, 527, 530, 532, 538, 135,
2102 533, 534, 535, 522, 542, 550, 541, 543, 544, 443,
2103 568, 573, 545, 147, 148, 505, 546, 273, 547, 548,
2104 561, 549, 562, 563, 554, 556, 558, 559, 439, 440,
2105 441, 560, 555, 569, 570, 273, 447, 571, 572, 520,
2106 575, 576, 135, 577, 147, 148, 580, 583, 459, 460,
2107 337, 104, 135, 135, 135, 203, 204, 364, 135, 205,
2108 273, 273, 206, 365, 207, 273, 54, 470, 273, 114,
2109 122, 346, 469, 26, 97, 581, 536, 495, 0, 475,
2110 0, 0, 0, 0, 135, 486, 487, 0, 0, 0,
2111 491, 0, 493, 0, 0, 0, 497, 0, 0, 0,
2112 0, 0, 501, 502, 503, 127, 64, 65, 66, 67,
2113 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
2114 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
2115 19, 0, 20, 0, 0, 0, 0, 525, 526, 0,
2116 0, 0, 0, 0, 531, 0, 0, 0, 0, 0,
2117 0, 0, 0, 537, 127, 64, 65, 66, 67, 68,
2118 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
2119 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
2120 557, 20, 0, 127, 222, 223, 224, 225, 226, 227,
2121 228, 229, 230, 231, 232, 75, 76, 0, 564, 77,
2122 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
2123 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2124 0, 0, 0, 578, 579, 0, 0, 0, 582, 0,
2125 0, 584, 0, 0, 127, 64, 65, 66, 67, 68,
2126 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
2127 77, 78, 0, 0, 79, 0, 0, 80, 0, 19,
2128 81, 20, 82, 128, 0, 0, 0, 0, 0, 0,
2129 0, 246, 0, 127, 64, 65, 66, 67, 68, 69,
2130 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
2131 78, 0, 0, 0, 0, 0, 0, 0, 19, 0,
2132 20, 0, 0, 79, 0, 0, 80, 0, 0, 81,
2133 355, 82, 241, 0, 0, 0, 0, 127, 222, 223,
2134 224, 225, 226, 227, 228, 229, 230, 231, 232, 75,
2135 76, 0, 79, 77, 78, 80, 0, 0, 81, 0,
2136 82, 411, 19, 0, 20, 127, 64, 65, 66, 67,
2137 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
2138 0, 77, 78, 0, 0, 0, 0, 0, 0, 0,
2139 19, 0, 20, 0, 0, 0, 0, 0, 0, 0,
2140 0, 0, 421, 79, 0, 0, 80, 0, 0, 81,
2141 0, 82, 127, 64, 65, 66, 67, 68, 69, 70,
2142 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
2143 0, 0, 0, 0, 0, 0, 0, 19, 0, 20,
2144 0, 0, 79, 0, 0, 80, 0, 0, 81, 468,
2145 82, 63, 64, 65, 66, 67, 68, 69, 70, 71,
2146 72, 73, 74, 75, 76, 0, 0, 77, 78, 0,
2147 0, 0, 0, 0, 0, 0, 19, 0, 20, 0,
2148 0, 0, 0, 0, 0, 0, 79, 0, 0, 80,
2149 0, 408, 81, 0, 82, 0, 134, 64, 65, 66,
2150 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
2151 0, 0, 77, 78, 79, 0, 0, 80, 0, 0,
2152 81, 19, 82, 20, 127, 64, 65, 66, 67, 68,
2153 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
2154 77, 78, 0, 0, 0, 0, 0, 0, 0, 19,
2155 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
2156 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
2157 127, 222, 223, 224, 225, 226, 227, 228, 229, 230,
2158 231, 232, 75, 76, 0, 0, 77, 78, 0, 0,
2159 0, 0, 0, 0, 0, 19, 0, 20, 0, 0,
2160 79, 0, 0, 80, 0, 0, 81, 0, 82, 0,
2161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2162 0, 0, 77, 78, 0, 339, 340, 341, 0, 0,
2163 0, 19, 0, 20, 0, 0, 0, 0, 0, 0,
2164 0, 0, 0, 0, 0, 79, 0, 0, 80, 0,
2165 0, 81, 0, 82, 0, 0, 0, 0, 0, 0,
2166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2167 0, 0, 0, 79, 0, 0, 80, 0, 0, 81,
2168 0, 82, 154, 155, 156, 157, 158, 159, 160, 161,
2169 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
2170 172, 173, 258, 259, 0, 0, 0, 0, 0, 0,
2171 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
2172 0, 0, 80, 0, 0, 81, 0, 82, 0, 260,
2173 0, 261, 182, 183, 184, 185, 0, 262, 263, 264,
2174 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
2175 200, 201, 202, 0, 0, 0, 0, 0, 342, 0,
2176 0, 343, 0, 344, 0, 0, 345, 249, 250, 77,
2177 78, 251, 252, 253, 254, 255, 256, 0, 19, 0,
2178 20, 0, -82, 19, 0, 20, 0, 0, 0, 6,
2179 -82, -82, 0, 0, 0, 0, 0, -82, -82, -82,
2180 -82, -82, -82, -82, -82, 21, 0, 0, 0, 0,
2181 0, 257, -82, 22, 0, 0, 0, 23, 0, 0,
2182 0, 0, 0, 0, 0, 0, 0, 0, 0, 154,
2183 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
2184 165, 166, 167, 168, 169, 170, 171, 172, 173, 258,
2185 259, 0, 0, 0, 0, 0, 249, 250, 0, 0,
2186 251, 252, 253, 254, 255, 256, 0, 0, 0, 0,
2187 0, 0, 0, 0, 0, 0, 260, 0, 261, 182,
2188 183, 184, 185, 0, 262, 263, 264, 190, 191, 192,
2189 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
2190 257, 0, 0, 0, 0, 0, 0, 0, 265, 0,
2191 0, 0, 0, 0, 0, 0, 0, 0, 154, 155,
2192 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
2193 166, 167, 168, 169, 170, 171, 172, 173, 258, 259,
2194 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2196 0, 0, 0, 0, 0, 260, 0, 261, 182, 183,
2197 184, 185, 150, 262, 263, 264, 190, 191, 192, 193,
2198 194, 195, 196, 197, 198, 199, 200, 201, 202, 0,
2199 0, 0, 0, 151, 152, 0, 0, 265, 0, 0,
2200 0, 0, 0, 0, 0, 0, 0, 0, 0, 153,
2201 0, 0, 0, 154, 155, 156, 157, 158, 159, 160,
2202 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
2203 171, 172, 173, 174, 175, 0, 0, 0, 0, 0,
2204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2205 0, 0, 0, 0, 0, 176, 177, 178, 0, 0,
2206 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
2207 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
2211 static const short int yycheck[] =
2213 36, 100, 100, 82, 49, 221, 309, 3, 32, 120,
2214 98, 10, 18, 49, 29, 522, 552, 10, 33, 153,
2215 151, 237, 238, 51, 52, 53, 35, 36, 159, 37,
2216 135, 567, 137, 138, 5, 6, 7, 8, 9, 10,
2217 11, 12, 151, 71, 149, 41, 553, 126, 56, 4,
2218 153, 157, 161, 132, 151, 159, 162, 56, 162, 162,
2219 15, 0, 98, 56, 161, 5, 6, 7, 8, 9,
2220 10, 11, 12, 151, 208, 0, 28, 151, 30, 61,
2221 151, 159, 118, 119, 29, 121, 157, 161, 84, 150,
2222 178, 151, 31, 181, 61, 34, 126, 157, 186, 187,
2223 188, 189, 132, 42, 43, 44, 45, 46, 47, 48,
2224 150, 101, 102, 103, 104, 105, 106, 30, 206, 207,
2225 72, 73, 74, 62, 76, 77, 78, 117, 118, 119,
2226 120, 236, 342, 343, 344, 18, 160, 25, 26, 150,
2227 176, 177, 178, 179, 180, 181, 161, 45, 150, 47,
2228 186, 187, 188, 189, 160, 51, 150, 27, 54, 55,
2229 239, 240, 150, 28, 243, 30, 155, 203, 204, 205,
2230 206, 207, 42, 43, 44, 45, 46, 47, 48, 49,
2231 54, 55, 18, 124, 125, 153, 157, 57, 491, 18,
2232 493, 407, 25, 26, 153, 137, 138, 5, 6, 7,
2233 8, 9, 10, 11, 12, 30, 311, 149, 18, 245,
2234 17, 18, 17, 18, 319, 320, 321, 157, 30, 107,
2235 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
2236 118, 119, 120, 30, 279, 17, 18, 156, 326, 17,
2237 18, 17, 18, 279, 64, 65, 66, 67, 68, 69,
2238 70, 17, 18, 156, 290, 366, 367, 368, 369, 370,
2239 17, 18, 373, 374, 375, 376, 377, 17, 18, 17,
2240 18, 307, 76, 77, 153, 380, 381, 382, 59, 324,
2241 151, 360, 21, 388, 21, 21, 159, 151, 324, 325,
2242 326, 154, 63, 153, 153, 400, 401, 153, 153, 153,
2243 153, 153, 390, 153, 392, 393, 394, 153, 153, 151,
2244 398, 151, 423, 424, 151, 39, 151, 155, 30, 430,
2245 151, 151, 30, 151, 151, 151, 30, 151, 151, 151,
2246 15, 15, 437, 438, 30, 154, 153, 442, 159, 444,
2247 153, 155, 151, 448, 18, 151, 37, 39, 151, 454,
2248 455, 456, 151, 151, 390, 391, 392, 393, 394, 151,
2249 356, 151, 398, 399, 151, 476, 477, 478, 479, 311,
2250 481, 482, 483, 484, 151, 18, 151, 319, 320, 321,
2251 153, 151, 151, 419, 489, 490, 151, 151, 151, 151,
2252 151, 496, 151, 151, 56, 151, 30, 151, 509, 510,
2253 505, 153, 151, 154, 151, 151, 151, 151, 18, 445,
2254 498, 499, 500, 155, 154, 15, 151, 151, 151, 56,
2255 39, 151, 154, 522, 522, 461, 154, 532, 154, 154,
2256 541, 154, 543, 544, 154, 157, 154, 154, 380, 381,
2257 382, 154, 530, 157, 154, 550, 388, 154, 154, 485,
2258 15, 15, 488, 151, 553, 553, 15, 15, 400, 401,
2259 234, 41, 498, 499, 500, 104, 104, 258, 504, 104,
2260 575, 576, 104, 259, 104, 580, 24, 420, 583, 48,
2261 59, 236, 419, 3, 39, 578, 504, 445, -1, 425,
2262 -1, -1, -1, -1, 530, 437, 438, -1, -1, -1,
2263 442, -1, 444, -1, -1, -1, 448, -1, -1, -1,
2264 -1, -1, 454, 455, 456, 3, 4, 5, 6, 7,
2265 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
2266 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
2267 28, -1, 30, -1, -1, -1, -1, 489, 490, -1,
2268 -1, -1, -1, -1, 496, -1, -1, -1, -1, -1,
2269 -1, -1, -1, 505, 3, 4, 5, 6, 7, 8,
2270 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2271 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2272 532, 30, -1, 3, 4, 5, 6, 7, 8, 9,
2273 10, 11, 12, 13, 14, 15, 16, -1, 550, 19,
2274 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
2275 30, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2276 -1, -1, -1, 575, 576, -1, -1, -1, 580, -1,
2277 -1, 583, -1, -1, 3, 4, 5, 6, 7, 8,
2278 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2279 19, 20, -1, -1, 152, -1, -1, 155, -1, 28,
2280 158, 30, 160, 161, -1, -1, -1, -1, -1, -1,
2281 -1, 40, -1, 3, 4, 5, 6, 7, 8, 9,
2282 10, 11, 12, 13, 14, 15, 16, -1, -1, 19,
2283 20, -1, -1, -1, -1, -1, -1, -1, 28, -1,
2284 30, -1, -1, 152, -1, -1, 155, -1, -1, 158,
2285 40, 160, 161, -1, -1, -1, -1, 3, 4, 5,
2286 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2287 16, -1, 152, 19, 20, 155, -1, -1, 158, -1,
2288 160, 161, 28, -1, 30, 3, 4, 5, 6, 7,
2289 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
2290 -1, 19, 20, -1, -1, -1, -1, -1, -1, -1,
2291 28, -1, 30, -1, -1, -1, -1, -1, -1, -1,
2292 -1, -1, 40, 152, -1, -1, 155, -1, -1, 158,
2293 -1, 160, 3, 4, 5, 6, 7, 8, 9, 10,
2294 11, 12, 13, 14, 15, 16, -1, -1, 19, 20,
2295 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
2296 -1, -1, 152, -1, -1, 155, -1, -1, 158, 40,
2297 160, 3, 4, 5, 6, 7, 8, 9, 10, 11,
2298 12, 13, 14, 15, 16, -1, -1, 19, 20, -1,
2299 -1, -1, -1, -1, -1, -1, 28, -1, 30, -1,
2300 -1, -1, -1, -1, -1, -1, 152, -1, -1, 155,
2301 -1, 157, 158, -1, 160, -1, 3, 4, 5, 6,
2302 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
2303 -1, -1, 19, 20, 152, -1, -1, 155, -1, -1,
2304 158, 28, 160, 30, 3, 4, 5, 6, 7, 8,
2305 9, 10, 11, 12, 13, 14, 15, 16, -1, -1,
2306 19, 20, -1, -1, -1, -1, -1, -1, -1, 28,
2307 -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
2308 -1, 152, -1, -1, 155, -1, -1, 158, -1, 160,
2309 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
2310 13, 14, 15, 16, -1, -1, 19, 20, -1, -1,
2311 -1, -1, -1, -1, -1, 28, -1, 30, -1, -1,
2312 152, -1, -1, 155, -1, -1, 158, -1, 160, -1,
2313 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2314 -1, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2315 -1, 28, -1, 30, -1, -1, -1, -1, -1, -1,
2316 -1, -1, -1, -1, -1, 152, -1, -1, 155, -1,
2317 -1, 158, -1, 160, -1, -1, -1, -1, -1, -1,
2318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2319 -1, -1, -1, 152, -1, -1, 155, -1, -1, 158,
2320 -1, 160, 79, 80, 81, 82, 83, 84, 85, 86,
2321 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
2322 97, 98, 99, 100, -1, -1, -1, -1, -1, -1,
2323 -1, -1, -1, -1, -1, -1, -1, -1, -1, 152,
2324 -1, -1, 155, -1, -1, 158, -1, 160, -1, 126,
2325 -1, 128, 129, 130, 131, 132, -1, 134, 135, 136,
2326 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2327 147, 148, 149, -1, -1, -1, -1, -1, 155, -1,
2328 -1, 158, -1, 160, -1, -1, 163, 17, 18, 19,
2329 20, 21, 22, 23, 24, 25, 26, -1, 28, -1,
2330 30, -1, 27, 28, -1, 30, -1, -1, -1, 34,
2331 35, 36, -1, -1, -1, -1, -1, 42, 43, 44,
2332 45, 46, 47, 48, 49, 50, -1, -1, -1, -1,
2333 -1, 61, 57, 58, -1, -1, -1, 62, -1, -1,
2334 -1, -1, -1, -1, -1, -1, -1, -1, -1, 79,
2335 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2336 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
2337 100, -1, -1, -1, -1, -1, 17, 18, -1, -1,
2338 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
2339 -1, -1, -1, -1, -1, -1, 126, -1, 128, 129,
2340 130, 131, 132, -1, 134, 135, 136, 137, 138, 139,
2341 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
2342 61, -1, -1, -1, -1, -1, -1, -1, 158, -1,
2343 -1, -1, -1, -1, -1, -1, -1, -1, 79, 80,
2344 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2345 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
2346 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2347 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2348 -1, -1, -1, -1, -1, 126, -1, 128, 129, 130,
2349 131, 132, 38, 134, 135, 136, 137, 138, 139, 140,
2350 141, 142, 143, 144, 145, 146, 147, 148, 149, -1,
2351 -1, -1, -1, 59, 60, -1, -1, 158, -1, -1,
2352 -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
2353 -1, -1, -1, 79, 80, 81, 82, 83, 84, 85,
2354 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2355 96, 97, 98, 99, 100, -1, -1, -1, -1, -1,
2356 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2357 -1, -1, -1, -1, -1, 121, 122, 123, -1, -1,
2358 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
2359 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
2363 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2364 symbol of state STATE-NUM. */
2365 static const unsigned char yystos[] =
2367 0, 198, 199, 201, 0, 31, 34, 42, 43, 44,
2368 45, 46, 47, 48, 62, 179, 214, 216, 218, 28,
2369 30, 50, 58, 62, 178, 207, 218, 219, 61, 64,
2370 65, 66, 67, 68, 69, 70, 180, 212, 29, 225,
2371 226, 227, 51, 52, 53, 71, 204, 150, 61, 27,
2372 45, 47, 49, 57, 179, 200, 150, 45, 47, 217,
2373 30, 202, 18, 3, 4, 5, 6, 7, 8, 9,
2374 10, 11, 12, 13, 14, 15, 16, 19, 20, 152,
2375 155, 158, 160, 165, 187, 188, 189, 190, 191, 207,
2376 222, 32, 160, 213, 33, 161, 215, 226, 72, 73,
2377 74, 76, 77, 78, 178, 228, 229, 231, 150, 150,
2378 150, 150, 155, 205, 202, 187, 35, 36, 197, 197,
2379 197, 197, 212, 18, 18, 18, 160, 3, 161, 191,
2380 192, 207, 153, 162, 3, 189, 224, 4, 15, 5,
2381 6, 7, 8, 9, 10, 11, 12, 174, 175, 176,
2382 38, 59, 60, 75, 79, 80, 81, 82, 83, 84,
2383 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2384 95, 96, 97, 98, 99, 100, 121, 122, 123, 126,
2385 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2386 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2387 147, 148, 149, 167, 168, 169, 172, 173, 235, 236,
2388 238, 239, 30, 54, 55, 203, 18, 30, 30, 206,
2389 189, 189, 4, 5, 6, 7, 8, 9, 10, 11,
2390 12, 13, 14, 174, 175, 177, 189, 194, 189, 156,
2391 156, 161, 192, 151, 161, 153, 40, 192, 193, 17,
2392 18, 21, 22, 23, 24, 25, 26, 61, 99, 100,
2393 126, 128, 134, 135, 136, 158, 167, 168, 169, 172,
2394 173, 195, 221, 222, 223, 223, 223, 223, 59, 180,
2395 101, 102, 103, 104, 105, 106, 117, 118, 119, 120,
2396 170, 25, 26, 107, 108, 109, 110, 111, 112, 113,
2397 114, 115, 116, 117, 118, 119, 120, 171, 189, 189,
2398 224, 189, 189, 232, 224, 224, 224, 224, 224, 189,
2399 189, 189, 224, 224, 180, 124, 125, 151, 157, 151,
2400 185, 185, 25, 26, 17, 18, 166, 166, 21, 22,
2401 23, 24, 155, 158, 160, 163, 195, 222, 185, 185,
2402 191, 191, 159, 161, 191, 40, 189, 209, 210, 211,
2403 151, 154, 63, 220, 170, 171, 153, 153, 153, 153,
2404 153, 194, 196, 153, 153, 153, 153, 153, 151, 151,
2405 187, 189, 189, 151, 182, 151, 182, 223, 155, 151,
2406 151, 151, 151, 151, 151, 223, 223, 223, 151, 39,
2407 187, 189, 224, 30, 37, 56, 183, 186, 157, 196,
2408 196, 161, 196, 30, 157, 159, 159, 207, 208, 151,
2409 154, 40, 30, 153, 153, 194, 194, 194, 194, 194,
2410 151, 159, 194, 194, 194, 194, 194, 15, 15, 223,
2411 223, 223, 10, 56, 10, 151, 237, 223, 155, 224,
2412 189, 224, 224, 224, 151, 151, 151, 224, 189, 223,
2413 223, 151, 30, 18, 185, 157, 159, 161, 40, 209,
2414 183, 184, 151, 194, 194, 237, 151, 151, 151, 151,
2415 194, 151, 151, 151, 151, 39, 223, 223, 153, 151,
2416 151, 223, 18, 223, 224, 233, 151, 223, 151, 151,
2417 151, 223, 223, 223, 153, 189, 56, 181, 30, 151,
2418 151, 154, 194, 194, 194, 194, 194, 194, 194, 194,
2419 189, 151, 155, 233, 234, 223, 223, 151, 182, 182,
2420 151, 223, 151, 224, 224, 224, 234, 223, 18, 194,
2421 194, 151, 154, 151, 151, 154, 154, 154, 154, 154,
2422 15, 157, 176, 230, 154, 224, 157, 223, 154, 154,
2423 154, 194, 194, 194, 223, 221, 157, 176, 39, 157,
2424 154, 154, 154, 151, 221, 15, 15, 151, 223, 223,
2425 15, 228, 223, 15, 223
2428 #define yyerrok (yyerrstatus = 0)
2429 #define yyclearin (yychar = YYEMPTY)
2430 #define YYEMPTY (-2)
2433 #define YYACCEPT goto yyacceptlab
2434 #define YYABORT goto yyabortlab
2435 #define YYERROR goto yyerrorlab
2438 /* Like YYERROR except do call yyerror. This remains here temporarily
2439 to ease the transition to the new meaning of YYERROR, for GCC.
2440 Once GCC version 2 has supplanted version 1, this can go. */
2442 #define YYFAIL goto yyerrlab
2444 #define YYRECOVERING() (!!yyerrstatus)
2446 #define YYBACKUP(Token, Value) \
2448 if (yychar == YYEMPTY && yylen == 1) \
2452 yytoken = YYTRANSLATE (yychar); \
2458 yyerror (YY_("syntax error: cannot back up")); \
2465 #define YYERRCODE 256
2468 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2469 If N is 0, then set CURRENT to the empty location which ends
2470 the previous symbol: RHS[0] (always defined). */
2472 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2473 #ifndef YYLLOC_DEFAULT
2474 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2478 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2479 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2480 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2481 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2485 (Current).first_line = (Current).last_line = \
2486 YYRHSLOC (Rhs, 0).last_line; \
2487 (Current).first_column = (Current).last_column = \
2488 YYRHSLOC (Rhs, 0).last_column; \
2494 /* YY_LOCATION_PRINT -- Print the location on the stream.
2495 This macro was not mandated originally: define only if we know
2496 we won't break user code: when these are the locations we know. */
2498 #ifndef YY_LOCATION_PRINT
2499 # if YYLTYPE_IS_TRIVIAL
2500 # define YY_LOCATION_PRINT(File, Loc) \
2501 fprintf (File, "%d.%d-%d.%d", \
2502 (Loc).first_line, (Loc).first_column, \
2503 (Loc).last_line, (Loc).last_column)
2505 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2510 /* YYLEX -- calling `yylex' with the right arguments. */
2513 # define YYLEX yylex (YYLEX_PARAM)
2515 # define YYLEX yylex ()
2518 /* Enable debugging if requested. */
2522 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2523 # define YYFPRINTF fprintf
2526 # define YYDPRINTF(Args) \
2532 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2536 YYFPRINTF (stderr, "%s ", Title); \
2537 yysymprint (stderr, \
2539 YYFPRINTF (stderr, "\n"); \
2543 /*------------------------------------------------------------------.
2544 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2546 `------------------------------------------------------------------*/
2548 #if defined (__STDC__) || defined (__cplusplus)
2550 yy_stack_print (short int *bottom, short int *top)
2553 yy_stack_print (bottom, top)
2558 YYFPRINTF (stderr, "Stack now");
2559 for (/* Nothing. */; bottom <= top; ++bottom)
2560 YYFPRINTF (stderr, " %d", *bottom);
2561 YYFPRINTF (stderr, "\n");
2564 # define YY_STACK_PRINT(Bottom, Top) \
2567 yy_stack_print ((Bottom), (Top)); \
2571 /*------------------------------------------------.
2572 | Report that the YYRULE is going to be reduced. |
2573 `------------------------------------------------*/
2575 #if defined (__STDC__) || defined (__cplusplus)
2577 yy_reduce_print (int yyrule)
2580 yy_reduce_print (yyrule)
2585 unsigned long int yylno = yyrline[yyrule];
2586 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2588 /* Print the symbols being reduced, and their result. */
2589 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2590 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2591 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2594 # define YY_REDUCE_PRINT(Rule) \
2597 yy_reduce_print (Rule); \
2600 /* Nonzero means print parse trace. It is left uninitialized so that
2601 multiple parsers can coexist. */
2603 #else /* !YYDEBUG */
2604 # define YYDPRINTF(Args)
2605 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2606 # define YY_STACK_PRINT(Bottom, Top)
2607 # define YY_REDUCE_PRINT(Rule)
2608 #endif /* !YYDEBUG */
2611 /* YYINITDEPTH -- initial size of the parser's stacks. */
2613 # define YYINITDEPTH 200
2616 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2617 if the built-in stack extension method is used).
2619 Do not make this value too large; the results are undefined if
2620 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2621 evaluated with infinite-precision integer arithmetic. */
2624 # define YYMAXDEPTH 10000
2632 # if defined (__GLIBC__) && defined (_STRING_H)
2633 # define yystrlen strlen
2635 /* Return the length of YYSTR. */
2637 # if defined (__STDC__) || defined (__cplusplus)
2638 yystrlen (const char *yystr)
2644 const char *yys = yystr;
2646 while (*yys++ != '\0')
2649 return yys - yystr - 1;
2655 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2656 # define yystpcpy stpcpy
2658 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2661 # if defined (__STDC__) || defined (__cplusplus)
2662 yystpcpy (char *yydest, const char *yysrc)
2664 yystpcpy (yydest, yysrc)
2670 const char *yys = yysrc;
2672 while ((*yyd++ = *yys++) != '\0')
2681 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2682 quotes and backslashes, so that it's suitable for yyerror. The
2683 heuristic is that double-quoting is unnecessary unless the string
2684 contains an apostrophe, a comma, or backslash (other than
2685 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2686 null, do not copy; instead, return the length of what the result
2689 yytnamerr (char *yyres, const char *yystr)
2694 char const *yyp = yystr;
2701 goto do_not_strip_quotes;
2705 goto do_not_strip_quotes;
2718 do_not_strip_quotes: ;
2722 return yystrlen (yystr);
2724 return yystpcpy (yyres, yystr) - yyres;
2728 #endif /* YYERROR_VERBOSE */
2733 /*--------------------------------.
2734 | Print this symbol on YYOUTPUT. |
2735 `--------------------------------*/
2737 #if defined (__STDC__) || defined (__cplusplus)
2739 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2742 yysymprint (yyoutput, yytype, yyvaluep)
2748 /* Pacify ``unused variable'' warnings. */
2751 if (yytype < YYNTOKENS)
2752 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2754 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2758 if (yytype < YYNTOKENS)
2759 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2766 YYFPRINTF (yyoutput, ")");
2769 #endif /* ! YYDEBUG */
2770 /*-----------------------------------------------.
2771 | Release the memory associated to this symbol. |
2772 `-----------------------------------------------*/
2774 #if defined (__STDC__) || defined (__cplusplus)
2776 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2779 yydestruct (yymsg, yytype, yyvaluep)
2785 /* Pacify ``unused variable'' warnings. */
2790 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2801 /* Prevent warnings from -Wmissing-prototypes. */
2803 #ifdef YYPARSE_PARAM
2804 # if defined (__STDC__) || defined (__cplusplus)
2805 int yyparse (void *YYPARSE_PARAM);
2809 #else /* ! YYPARSE_PARAM */
2810 #if defined (__STDC__) || defined (__cplusplus)
2815 #endif /* ! YYPARSE_PARAM */
2819 /* The look-ahead symbol. */
2822 /* The semantic value of the look-ahead symbol. */
2825 /* Number of syntax errors so far. */
2834 #ifdef YYPARSE_PARAM
2835 # if defined (__STDC__) || defined (__cplusplus)
2836 int yyparse (void *YYPARSE_PARAM)
2838 int yyparse (YYPARSE_PARAM)
2839 void *YYPARSE_PARAM;
2841 #else /* ! YYPARSE_PARAM */
2842 #if defined (__STDC__) || defined (__cplusplus)
2856 /* Number of tokens to shift before error messages enabled. */
2858 /* Look-ahead token as an internal (translated) token number. */
2861 /* Three stacks and their tools:
2862 `yyss': related to states,
2863 `yyvs': related to semantic values,
2864 `yyls': related to locations.
2866 Refer to the stacks thru separate pointers, to allow yyoverflow
2867 to reallocate them elsewhere. */
2869 /* The state stack. */
2870 short int yyssa[YYINITDEPTH];
2871 short int *yyss = yyssa;
2874 /* The semantic value stack. */
2875 YYSTYPE yyvsa[YYINITDEPTH];
2876 YYSTYPE *yyvs = yyvsa;
2881 #define YYPOPSTACK (yyvsp--, yyssp--)
2883 YYSIZE_T yystacksize = YYINITDEPTH;
2885 /* The variables used to return semantic value and location from the
2890 /* When reducing, the number of symbols on the RHS of the reduced
2894 YYDPRINTF ((stderr, "Starting parse\n"));
2899 yychar = YYEMPTY; /* Cause a token to be read. */
2901 /* Initialize stack pointers.
2902 Waste one element of value and location stack
2903 so that they stay on the same level as the state stack.
2904 The wasted elements are never initialized. */
2911 /*------------------------------------------------------------.
2912 | yynewstate -- Push a new state, which is found in yystate. |
2913 `------------------------------------------------------------*/
2915 /* In all cases, when you get here, the value and location stacks
2916 have just been pushed. so pushing a state here evens the stacks.
2923 if (yyss + yystacksize - 1 <= yyssp)
2925 /* Get the current used size of the three stacks, in elements. */
2926 YYSIZE_T yysize = yyssp - yyss + 1;
2930 /* Give user a chance to reallocate the stack. Use copies of
2931 these so that the &'s don't force the real ones into
2933 YYSTYPE *yyvs1 = yyvs;
2934 short int *yyss1 = yyss;
2937 /* Each stack pointer address is followed by the size of the
2938 data in use in that stack, in bytes. This used to be a
2939 conditional around just the two extra args, but that might
2940 be undefined if yyoverflow is a macro. */
2941 yyoverflow (YY_("memory exhausted"),
2942 &yyss1, yysize * sizeof (*yyssp),
2943 &yyvs1, yysize * sizeof (*yyvsp),
2950 #else /* no yyoverflow */
2951 # ifndef YYSTACK_RELOCATE
2952 goto yyexhaustedlab;
2954 /* Extend the stack our own way. */
2955 if (YYMAXDEPTH <= yystacksize)
2956 goto yyexhaustedlab;
2958 if (YYMAXDEPTH < yystacksize)
2959 yystacksize = YYMAXDEPTH;
2962 short int *yyss1 = yyss;
2963 union yyalloc *yyptr =
2964 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2966 goto yyexhaustedlab;
2967 YYSTACK_RELOCATE (yyss);
2968 YYSTACK_RELOCATE (yyvs);
2970 # undef YYSTACK_RELOCATE
2972 YYSTACK_FREE (yyss1);
2975 #endif /* no yyoverflow */
2977 yyssp = yyss + yysize - 1;
2978 yyvsp = yyvs + yysize - 1;
2981 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2982 (unsigned long int) yystacksize));
2984 if (yyss + yystacksize - 1 <= yyssp)
2988 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2997 /* Do appropriate processing given the current state. */
2998 /* Read a look-ahead token if we need one and don't already have one. */
3001 /* First try to decide what to do without reference to look-ahead token. */
3003 yyn = yypact[yystate];
3004 if (yyn == YYPACT_NINF)
3007 /* Not known => get a look-ahead token if don't already have one. */
3009 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3010 if (yychar == YYEMPTY)
3012 YYDPRINTF ((stderr, "Reading a token: "));
3016 if (yychar <= YYEOF)
3018 yychar = yytoken = YYEOF;
3019 YYDPRINTF ((stderr, "Now at end of input.\n"));
3023 yytoken = YYTRANSLATE (yychar);
3024 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3027 /* If the proper action on seeing token YYTOKEN is to reduce or to
3028 detect an error, take that action. */
3030 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3035 if (yyn == 0 || yyn == YYTABLE_NINF)
3044 /* Shift the look-ahead token. */
3045 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3047 /* Discard the token being shifted unless it is eof. */
3048 if (yychar != YYEOF)
3054 /* Count tokens shifted since error; after three, turn off error
3063 /*-----------------------------------------------------------.
3064 | yydefault -- do the default action for the current state. |
3065 `-----------------------------------------------------------*/
3067 yyn = yydefact[yystate];
3073 /*-----------------------------.
3074 | yyreduce -- Do a reduction. |
3075 `-----------------------------*/
3077 /* yyn is the number of a rule to reduce with. */
3080 /* If YYLEN is nonzero, implement the default value of the action:
3083 Otherwise, the following line sets YYVAL to garbage.
3084 This behavior is undocumented and Bison
3085 users should not rely upon it. Assigning to YYVAL
3086 unconditionally makes the parser a bit smaller, and it avoids a
3087 GCC warning that YYVAL may be used uninitialized. */
3088 yyval = yyvsp[1-yylen];
3091 YY_REDUCE_PRINT (yyn);
3095 #line 1058 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3097 (yyval.String) = (yyvsp[-1].String);
3102 #line 1061 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3104 (yyval.String) = new std::string("");
3109 #line 1068 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3110 { (yyval.String) = new std::string(""); ;}
3114 #line 1073 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3116 *(yyvsp[-1].String) += *(yyvsp[0].String);
3117 delete (yyvsp[0].String);
3118 (yyval.String) = (yyvsp[-1].String);
3123 #line 1078 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3124 { (yyval.String) = new std::string(""); ;}
3128 #line 1083 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3129 { (yyval.String) = new std::string(); ;}
3133 #line 1084 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3134 { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
3138 #line 1087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3139 { (yyval.String) = new std::string(); ;}
3143 #line 1088 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3145 (yyvsp[-1].String)->insert(0, ", ");
3146 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3147 delete (yyvsp[0].String);
3148 (yyval.String) = (yyvsp[-1].String);
3153 #line 1096 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3155 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3156 delete (yyvsp[0].String);
3157 (yyval.String) = (yyvsp[-1].String);
3162 #line 1102 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3163 { (yyval.String) = new std::string(); ;}
3167 #line 1106 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3168 { (yyval.String) = new std::string(); ;}
3172 #line 1107 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3174 (yyvsp[-1].String)->insert(0, ", ");
3175 if (!(yyvsp[0].String)->empty())
3176 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3177 delete (yyvsp[0].String);
3178 (yyval.String) = (yyvsp[-1].String);
3183 #line 1117 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3185 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
3186 delete (yyvsp[0].String);
3187 (yyval.String) = (yyvsp[-1].String);
3192 #line 1139 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3194 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), OpaqueTy);
3199 #line 1142 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3201 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UnresolvedTy);
3206 #line 1145 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3208 (yyval.Type) = (yyvsp[0].Type);
3213 #line 1148 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3214 { // Type UpReference
3215 (yyvsp[0].String)->insert(0, "\\");
3216 (yyval.Type) = TypeInfo::get(*(yyvsp[0].String), UpRefTy);
3221 #line 1152 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3222 { // Function derived type?
3223 std::string newTy( (yyvsp[-3].Type)->getNewTy() + "(");
3224 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3227 if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
3230 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3233 (yyval.Type) = TypeInfo::get(newTy, (yyvsp[-3].Type), (yyvsp[-1].TypeVec));
3238 #line 1165 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3239 { // Sized array type?
3240 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3241 (yyvsp[-3].String)->insert(0,"[ ");
3242 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " ]";
3243 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Type), elems);
3248 #line 1171 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3249 { // Packed array type?
3250 uint64_t elems = atoi((yyvsp[-3].String)->c_str());
3251 (yyvsp[-3].String)->insert(0,"< ");
3252 *(yyvsp[-3].String) += " x " + (yyvsp[-1].Type)->getNewTy() + " >";
3253 (yyval.Type) = TypeInfo::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Type), elems);
3258 #line 1177 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3259 { // Structure type?
3260 std::string newTy("{");
3261 for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
3264 newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
3267 (yyval.Type) = TypeInfo::get(newTy, StructTy, (yyvsp[-1].TypeVec));
3272 #line 1187 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3273 { // Empty structure type?
3274 (yyval.Type) = TypeInfo::get("{}", StructTy, new TypeList());
3279 #line 1190 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3280 { // Packed Structure type?
3281 std::string newTy("<{");
3282 for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
3285 newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
3288 (yyval.Type) = TypeInfo::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
3293 #line 1200 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3294 { // Empty packed structure type?
3295 (yyval.Type) = TypeInfo::get("<{}>", PackedStructTy, new TypeList());
3300 #line 1203 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3302 (yyval.Type) = (yyvsp[-1].Type)->getPointerType();
3307 #line 1211 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3309 (yyval.TypeVec) = new TypeList();
3310 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3315 #line 1215 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3317 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3318 (yyval.TypeVec)->push_back((yyvsp[0].Type));
3323 #line 1223 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3325 (yyval.TypeVec) = (yyvsp[-2].TypeVec);
3326 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3327 delete (yyvsp[0].String);
3332 #line 1228 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3334 (yyval.TypeVec) = new TypeList();
3335 (yyval.TypeVec)->push_back(TypeInfo::get("void",VoidTy));
3336 delete (yyvsp[0].String);
3341 #line 1233 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3343 (yyval.TypeVec) = new TypeList();
3348 #line 1243 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3349 { // Nonempty unsized arr
3350 (yyval.Const) = new ConstInfo;
3351 (yyval.Const)->type = (yyvsp[-3].Type);
3352 (yyval.Const)->cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3353 *(yyval.Const)->cnst += " [ " + *(yyvsp[-1].String) + " ]";
3354 delete (yyvsp[-1].String);
3359 #line 1250 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3361 (yyval.Const) = new ConstInfo;
3362 (yyval.Const)->type = (yyvsp[-2].Type);
3363 (yyval.Const)->cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3364 *(yyval.Const)->cnst += "[ ]";
3369 #line 1256 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3371 (yyval.Const) = new ConstInfo;
3372 (yyval.Const)->type = (yyvsp[-2].Type);
3373 (yyval.Const)->cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3374 *(yyval.Const)->cnst += " c" + *(yyvsp[0].String);
3375 delete (yyvsp[0].String);
3380 #line 1263 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3381 { // Nonempty unsized arr
3382 (yyval.Const) = new ConstInfo;
3383 (yyval.Const)->type = (yyvsp[-3].Type);
3384 (yyval.Const)->cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3385 *(yyval.Const)->cnst += " < " + *(yyvsp[-1].String) + " >";
3386 delete (yyvsp[-1].String);
3391 #line 1270 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3393 (yyval.Const) = new ConstInfo;
3394 (yyval.Const)->type = (yyvsp[-3].Type);
3395 (yyval.Const)->cnst = new std::string((yyvsp[-3].Type)->getNewTy());
3396 *(yyval.Const)->cnst += " { " + *(yyvsp[-1].String) + " }";
3397 delete (yyvsp[-1].String);
3402 #line 1277 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3404 (yyval.Const) = new ConstInfo;
3405 (yyval.Const)->type = (yyvsp[-2].Type);
3406 (yyval.Const)->cnst = new std::string((yyvsp[-2].Type)->getNewTy());
3407 *(yyval.Const)->cnst += " {}";
3412 #line 1283 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3414 (yyval.Const) = new ConstInfo;
3415 (yyval.Const)->type = (yyvsp[-1].Type);
3416 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3417 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3418 delete (yyvsp[0].String);
3423 #line 1290 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3425 (yyval.Const) = new ConstInfo;
3426 (yyval.Const)->type = (yyvsp[-1].Type);
3427 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3428 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3429 delete (yyvsp[0].String);
3434 #line 1297 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3436 (yyval.Const) = new ConstInfo;
3437 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve(), true);
3438 (yyval.Const)->type = (yyvsp[-1].Type);
3439 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3440 *(yyval.Const)->cnst += " " + Name;
3441 delete (yyvsp[0].String);
3446 #line 1305 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3448 (yyval.Const) = new ConstInfo;
3449 (yyval.Const)->type = (yyvsp[-1].Type);
3450 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3451 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3452 delete (yyvsp[0].String);
3457 #line 1312 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3459 (yyval.Const) = new ConstInfo;
3460 (yyval.Const)->type = (yyvsp[-1].Type);
3461 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3462 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3463 delete (yyvsp[0].String);
3468 #line 1319 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3469 { // integral constants
3470 (yyval.Const) = new ConstInfo;
3471 (yyval.Const)->type = (yyvsp[-1].Type);
3472 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3473 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3474 delete (yyvsp[0].String);
3479 #line 1326 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3480 { // integral constants
3481 (yyval.Const) = new ConstInfo;
3482 (yyval.Const)->type = (yyvsp[-1].Type);
3483 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3484 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3485 delete (yyvsp[0].String);
3490 #line 1333 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3491 { // Boolean constants
3492 (yyval.Const) = new ConstInfo;
3493 (yyval.Const)->type = (yyvsp[-1].Type);
3494 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3495 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3496 delete (yyvsp[0].String);
3501 #line 1340 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3502 { // Boolean constants
3503 (yyval.Const) = new ConstInfo;
3504 (yyval.Const)->type = (yyvsp[-1].Type);
3505 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3506 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3507 delete (yyvsp[0].String);
3512 #line 1347 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3513 { // Float & Double constants
3514 (yyval.Const) = new ConstInfo;
3515 (yyval.Const)->type = (yyvsp[-1].Type);
3516 (yyval.Const)->cnst = new std::string((yyvsp[-1].Type)->getNewTy());
3517 *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
3518 delete (yyvsp[0].String);
3523 #line 1355 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3525 std::string source = *(yyvsp[-3].Const)->cnst;
3526 const TypeInfo* SrcTy = (yyvsp[-3].Const)->type->resolve();
3527 const TypeInfo* DstTy = (yyvsp[-1].Type)->resolve();
3528 if (*(yyvsp[-5].String) == "cast") {
3529 // Call getCastUpgrade to upgrade the old cast
3530 (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
3532 // Nothing to upgrade, just create the cast constant expr
3533 (yyval.String) = new std::string(*(yyvsp[-5].String));
3534 *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Type)->getNewTy() + ")";
3536 delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-2].String);
3541 #line 1369 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3543 *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const)->cnst;
3544 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
3545 ValueInfo* VI = (*(yyvsp[-1].ValList))[i];
3546 *(yyvsp[-4].String) += ", " + *VI->val;
3549 *(yyvsp[-4].String) += ")";
3550 (yyval.String) = (yyvsp[-4].String);
3551 delete (yyvsp[-2].Const);
3552 delete (yyvsp[-1].ValList);
3557 #line 1381 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3559 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3560 delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3561 (yyval.String) = (yyvsp[-7].String);
3566 #line 1386 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3568 const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const)->type);
3569 (yyval.String) = new std::string(op);
3570 *(yyval.String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3571 delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3576 #line 1392 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3578 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3579 delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3580 (yyval.String) = (yyvsp[-5].String);
3585 #line 1397 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3587 *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const)->type);
3588 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3589 delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3590 (yyval.String) = (yyvsp[-5].String);
3595 #line 1403 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3597 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3598 delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3599 (yyval.String) = (yyvsp[-6].String);
3604 #line 1408 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3606 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3607 delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3608 (yyval.String) = (yyvsp[-6].String);
3613 #line 1413 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3615 const char* shiftop = (yyvsp[-5].String)->c_str();
3616 if (*(yyvsp[-5].String) == "shr")
3617 shiftop = ((yyvsp[-3].Const)->type->isUnsigned()) ? "lshr" : "ashr";
3618 (yyval.String) = new std::string(shiftop);
3619 *(yyval.String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3620 delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3625 #line 1421 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3627 *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3628 delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3629 (yyval.String) = (yyvsp[-5].String);
3634 #line 1426 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3636 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3637 delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3638 (yyval.String) = (yyvsp[-7].String);
3643 #line 1431 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3645 *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
3646 delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
3647 (yyval.String) = (yyvsp[-7].String);
3652 #line 1441 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3654 *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const)->cnst;
3655 delete (yyvsp[0].Const);
3656 (yyval.String) = (yyvsp[-2].String);
3661 #line 1446 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3662 { (yyval.String) = new std::string(*(yyvsp[0].Const)->cnst); delete (yyvsp[0].Const); ;}
3666 #line 1461 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3672 #line 1466 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3679 #line 1469 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3681 *O << *(yyvsp[0].String) << '\n';
3682 delete (yyvsp[0].String);
3688 #line 1474 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3690 *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
3696 #line 1478 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3698 *O << "implementation\n";
3704 #line 1482 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3705 { (yyval.String) = 0; ;}
3709 #line 1484 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3710 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
3714 #line 1487 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3716 TypeInfo::EnumeratedTypes.push_back((yyvsp[0].Type));
3717 if (!(yyvsp[-2].String)->empty()) {
3718 TypeInfo::NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Type);
3719 *O << *(yyvsp[-2].String) << " = ";
3721 *O << "type " << (yyvsp[0].Type)->getNewTy() << '\n';
3722 delete (yyvsp[-2].String); delete (yyvsp[-1].String);
3728 #line 1497 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3729 { // Function prototypes can be in const pool
3730 *O << *(yyvsp[0].String) << '\n';
3731 delete (yyvsp[0].String);
3737 #line 1502 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3738 { // Asm blocks can be in the const pool
3739 *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3740 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3746 #line 1507 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3748 if (!(yyvsp[-4].String)->empty()) {
3749 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const)->type->getPointerType(),
3750 *(yyvsp[-2].String) == "constant");
3751 *O << Name << " = ";
3753 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const)->cnst << ' ' << *(yyvsp[0].String) << '\n';
3754 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3760 #line 1517 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3762 if (!(yyvsp[-4].String)->empty()) {
3763 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3764 *(yyvsp[-2].String) == "constant");
3765 *O << Name << " = ";
3767 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3768 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3774 #line 1527 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3776 if (!(yyvsp[-4].String)->empty()) {
3777 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3778 *(yyvsp[-2].String) == "constant");
3779 *O << Name << " = ";
3781 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3782 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3788 #line 1537 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3790 if (!(yyvsp[-4].String)->empty()) {
3791 std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Type)->getPointerType(),
3792 *(yyvsp[-2].String) == "constant");
3793 *O << Name << " = ";
3795 *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
3796 delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
3802 #line 1547 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3804 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3805 delete (yyvsp[-1].String); delete (yyvsp[0].String);
3811 #line 1552 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3813 *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
3814 delete (yyvsp[-2].String); delete (yyvsp[0].String);
3820 #line 1557 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3827 #line 1567 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3829 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3830 delete (yyvsp[0].String);
3831 (yyval.String) = (yyvsp[-2].String);
3836 #line 1572 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3838 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3839 if (*(yyvsp[0].String) == "64")
3841 delete (yyvsp[0].String);
3842 (yyval.String) = (yyvsp[-2].String);
3847 #line 1579 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3849 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3850 delete (yyvsp[0].String);
3851 (yyval.String) = (yyvsp[-2].String);
3856 #line 1584 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3858 *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
3859 delete (yyvsp[0].String);
3860 (yyval.String) = (yyvsp[-2].String);
3865 #line 1591 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3867 (yyvsp[-1].String)->insert(0, "[ ");
3868 *(yyvsp[-1].String) += " ]";
3869 (yyval.String) = (yyvsp[-1].String);
3874 #line 1598 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3876 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3877 delete (yyvsp[0].String);
3878 (yyval.String) = (yyvsp[-2].String);
3883 #line 1604 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3885 (yyval.String) = new std::string();
3890 #line 1613 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3891 { (yyval.String) = new std::string(); ;}
3895 #line 1615 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3897 (yyval.String) = new std::string((yyvsp[-1].Type)->getNewTy());
3898 if (!(yyvsp[0].String)->empty()) {
3899 std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Type)->resolve());
3900 *(yyval.String) += " " + Name;
3902 delete (yyvsp[0].String);
3907 #line 1624 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3909 *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
3910 delete (yyvsp[0].String);
3915 #line 1628 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3917 (yyval.String) = (yyvsp[0].String);
3922 #line 1632 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3924 (yyval.String) = (yyvsp[0].String);
3929 #line 1635 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3931 *(yyvsp[-2].String) += ", ...";
3932 (yyval.String) = (yyvsp[-2].String);
3933 delete (yyvsp[0].String);
3938 #line 1640 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3940 (yyval.String) = (yyvsp[0].String);
3945 #line 1643 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3946 { (yyval.String) = new std::string(); ;}
3950 #line 1646 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3952 if (*(yyvsp[-5].String) == "%llvm.va_start" || *(yyvsp[-5].String) == "%llvm.va_end") {
3953 *(yyvsp[-3].String) = "i8*";
3954 } else if (*(yyvsp[-5].String) == "%llvm.va_copy") {
3955 *(yyvsp[-3].String) = "i8*, i8*";
3957 if (!(yyvsp[-7].String)->empty()) {
3958 *(yyvsp[-7].String) += " ";
3960 *(yyvsp[-7].String) += (yyvsp[-6].Type)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
3961 if (!(yyvsp[-1].String)->empty()) {
3962 *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
3964 if (!(yyvsp[0].String)->empty()) {
3965 *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
3967 delete (yyvsp[-5].String);
3968 delete (yyvsp[-3].String);
3969 delete (yyvsp[-1].String);
3970 delete (yyvsp[0].String);
3971 (yyval.String) = (yyvsp[-7].String);
3976 #line 1669 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3977 { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
3981 #line 1670 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3982 { (yyval.String) = new std::string ("{"); ;}
3986 #line 1673 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
3989 if (!(yyvsp[-2].String)->empty()) {
3990 *O << *(yyvsp[-2].String) << ' ';
3992 *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
3993 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
3999 #line 1684 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4000 { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
4004 #line 1685 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4005 { (yyval.String) = new std::string("}"); ;}
4009 #line 1687 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4011 if ((yyvsp[-1].String))
4012 *O << *(yyvsp[-1].String);
4013 *O << *(yyvsp[0].String) << "\n\n";
4014 delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
4020 #line 1696 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4021 { (yyval.String) = new std::string(); ;}
4025 #line 1702 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4026 { isDeclare = true; ;}
4030 #line 1702 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4032 if (!(yyvsp[-1].String)->empty())
4033 *(yyvsp[-3].String) += " " + *(yyvsp[-1].String);
4034 *(yyvsp[-3].String) += " " + *(yyvsp[0].String);
4035 delete (yyvsp[-1].String);
4036 delete (yyvsp[0].String);
4037 (yyval.String) = (yyvsp[-3].String);
4043 #line 1716 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4044 { (yyval.String) = new std::string(); ;}
4048 #line 1722 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4050 (yyvsp[-1].String)->insert(0, "<");
4051 *(yyvsp[-1].String) += ">";
4052 (yyval.String) = (yyvsp[-1].String);
4057 #line 1728 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4059 if (!(yyvsp[-3].String)->empty()) {
4060 *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
4062 *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
4063 delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
4064 (yyval.String) = (yyvsp[-4].String);
4069 #line 1741 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4071 (yyval.Value) = new ValueInfo;
4072 (yyval.Value)->val = (yyvsp[0].String);
4073 (yyval.Value)->constant = false;
4074 (yyval.Value)->type = 0;
4079 #line 1747 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4081 (yyval.Value) = new ValueInfo;
4082 (yyval.Value)->val = (yyvsp[0].String);
4083 (yyval.Value)->constant = true;
4084 (yyval.Value)->type = 0;
4089 #line 1758 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4091 (yyvsp[-1].Type) = (yyvsp[-1].Type)->resolve();
4092 std::string Name = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-1].Type));
4093 (yyval.Value) = (yyvsp[0].Value);
4094 delete (yyval.Value)->val;
4095 (yyval.Value)->val = new std::string((yyvsp[-1].Type)->getNewTy() + " " + Name);
4096 (yyval.Value)->type = (yyvsp[-1].Type);
4101 #line 1767 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4108 #line 1770 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4109 { // Do not allow functions with 0 basic blocks
4115 #line 1778 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4122 #line 1782 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4124 *O << " " << *(yyvsp[0].String) << '\n';
4125 delete (yyvsp[0].String);
4131 #line 1787 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4138 #line 1790 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4140 *O << *(yyvsp[0].String) << '\n';
4141 delete (yyvsp[0].String);
4147 #line 1796 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4148 { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
4152 #line 1798 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4153 { // Return with a result...
4154 *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Value)->val << '\n';
4155 delete (yyvsp[-1].String); delete (yyvsp[0].Value);
4161 #line 1803 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4162 { // Return with no result...
4163 *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Type)->getNewTy() << '\n';
4164 delete (yyvsp[-1].String);
4170 #line 1808 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4171 { // Unconditional Branch...
4172 *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value)->val << '\n';
4173 delete (yyvsp[-2].String); delete (yyvsp[0].Value);
4179 #line 1813 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4181 std::string Name = getUniqueName((yyvsp[-6].Value)->val, (yyvsp[-7].Type));
4182 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4183 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value)->val << ", " << (yyvsp[-1].Type)->getNewTy() << ' '
4184 << *(yyvsp[0].Value)->val << '\n';
4185 delete (yyvsp[-8].String); delete (yyvsp[-6].Value); delete (yyvsp[-3].Value); delete (yyvsp[0].Value);
4191 #line 1821 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4193 std::string Name = getUniqueName((yyvsp[-6].Value)->val, (yyvsp[-7].Type));
4194 *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Type)->getNewTy() << ' ' << Name << ", "
4195 << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value)->val << " [" << *(yyvsp[-1].String) << " ]\n";
4196 delete (yyvsp[-8].String);
4197 delete (yyvsp[-6].Value);
4198 delete (yyvsp[-3].Value);
4199 delete (yyvsp[-1].String);
4205 #line 1831 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4207 std::string Name = getUniqueName((yyvsp[-5].Value)->val, (yyvsp[-6].Type));
4208 *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Type)->getNewTy() << ' ' << Name << ", "
4209 << (yyvsp[-3].Type)->getNewTy() << ' ' << *(yyvsp[-2].Value)->val << "[]\n";
4210 delete (yyvsp[-7].String);
4211 delete (yyvsp[-5].Value);
4212 delete (yyvsp[-2].Value);
4218 #line 1841 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4220 const TypeInfo* ResTy = getFunctionReturnType((yyvsp[-10].Type));
4222 if (!(yyvsp[-13].String)->empty()) {
4223 std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
4224 *O << Name << " = ";
4226 *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Type)->getNewTy() << ' ' << *(yyvsp[-9].Value)->val << " (";
4227 for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
4228 ValueInfo* VI = (*(yyvsp[-7].ValList))[i];
4230 if (i+1 < (yyvsp[-7].ValList)->size())
4234 *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Type)->getNewTy() << ' ' << *(yyvsp[-3].Value)->val << ' '
4235 << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Type)->getNewTy() << ' ' << *(yyvsp[0].Value)->val << '\n';
4236 delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); delete (yyvsp[-9].Value); delete (yyvsp[-7].ValList);
4237 delete (yyvsp[-5].String); delete (yyvsp[-3].Value); delete (yyvsp[-2].String); delete (yyvsp[0].Value);
4243 #line 1862 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4245 *O << " " << *(yyvsp[0].String) << '\n';
4246 delete (yyvsp[0].String);
4252 #line 1867 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4254 *O << " " << *(yyvsp[0].String) << '\n';
4255 delete (yyvsp[0].String);
4261 #line 1873 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4263 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Type)->getNewTy() + " " +
4264 *(yyvsp[0].Value)->val;
4265 delete (yyvsp[-3].String); delete (yyvsp[0].Value);
4266 (yyval.String) = (yyvsp[-5].String);
4271 #line 1879 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4273 (yyvsp[-3].String)->insert(0, (yyvsp[-4].Type)->getNewTy() + " " );
4274 *(yyvsp[-3].String) += ", " + (yyvsp[-1].Type)->getNewTy() + " " + *(yyvsp[0].Value)->val;
4275 delete (yyvsp[0].Value);
4276 (yyval.String) = (yyvsp[-3].String);
4281 #line 1887 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4283 if (!(yyvsp[-1].String)->empty()) {
4284 // Get a unique name for this value, based on its type.
4285 std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Value)->type);
4286 *(yyvsp[-1].String) = Name + " = ";
4287 if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
4288 // don't actually delete it, just comment it out
4289 (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
4290 delete deleteUselessCastName;
4293 *(yyvsp[-1].String) += *(yyvsp[0].Value)->val;
4294 delete (yyvsp[0].Value);
4295 deleteUselessCastFlag = false;
4296 (yyval.String) = (yyvsp[-1].String);
4301 #line 1905 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4302 { // Used for PHI nodes
4303 std::string Name = getUniqueName((yyvsp[-3].Value)->val, (yyvsp[-5].Type));
4304 Name.insert(0, (yyvsp[-5].Type)->getNewTy() + "[");
4305 Name += "," + *(yyvsp[-1].Value)->val + "]";
4306 (yyval.Value) = new ValueInfo;
4307 (yyval.Value)->val = new std::string(Name);
4308 (yyval.Value)->type = (yyvsp[-5].Type);
4309 delete (yyvsp[-3].Value); delete (yyvsp[-1].Value);
4314 #line 1914 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4316 std::string Name = getUniqueName((yyvsp[-3].Value)->val, (yyvsp[-6].Value)->type);
4317 *(yyvsp[-6].Value)->val += ", [" + Name + "," + *(yyvsp[-1].Value)->val + "]";
4318 delete (yyvsp[-3].Value);
4319 delete (yyvsp[-1].Value);
4320 (yyval.Value) = (yyvsp[-6].Value);
4325 #line 1924 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4327 (yyval.ValList) = new ValueList();
4328 (yyval.ValList)->push_back((yyvsp[0].Value));
4333 #line 1928 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4335 (yyval.ValList) = (yyvsp[-2].ValList);
4336 (yyval.ValList)->push_back((yyvsp[0].Value));
4341 #line 1935 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4342 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4346 #line 1936 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4347 { (yyval.ValList) = new ValueList(); ;}
4351 #line 1940 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4353 *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
4354 delete (yyvsp[0].String);
4355 (yyval.String) = (yyvsp[-1].String);
4360 #line 1948 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4362 const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Type));
4363 std::string Name1 = getUniqueName((yyvsp[-2].Value)->val, (yyvsp[-3].Type));
4364 std::string Name2 = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-3].Type));
4365 (yyval.Value) = (yyvsp[-2].Value);
4366 delete (yyval.Value)->val;
4367 (yyval.Value)->val = new std::string(op);
4368 *(yyval.Value)->val += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4369 (yyval.Value)->type = (yyvsp[-3].Type);
4370 delete (yyvsp[-4].String); delete (yyvsp[0].Value);
4375 #line 1959 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4377 std::string Name1 = getUniqueName((yyvsp[-2].Value)->val, (yyvsp[-3].Type));
4378 std::string Name2 = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-3].Type));
4379 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4380 (yyval.Value) = (yyvsp[-2].Value);
4381 delete (yyval.Value)->val;
4382 (yyval.Value)->val = (yyvsp[-4].String);
4383 (yyval.Value)->type = (yyvsp[-3].Type);
4384 delete (yyvsp[0].Value);
4389 #line 1969 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4391 std::string Name1 = getUniqueName((yyvsp[-2].Value)->val, (yyvsp[-3].Type));
4392 std::string Name2 = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-3].Type));
4393 *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Type));
4394 *(yyvsp[-4].String) += " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + ", " + Name2;
4395 (yyval.Value) = (yyvsp[-2].Value);
4396 delete (yyval.Value)->val;
4397 (yyval.Value)->val = (yyvsp[-4].String);
4398 (yyval.Value)->type = TypeInfo::get("i1",BoolTy);
4399 delete (yyvsp[0].Value);
4404 #line 1980 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4406 std::string Name1 = getUniqueName((yyvsp[-2].Value)->val, (yyvsp[-3].Type));
4407 std::string Name2 = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-3].Type));
4408 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4409 (yyval.Value) = (yyvsp[-2].Value);
4410 delete (yyval.Value)->val;
4411 (yyval.Value)->val = (yyvsp[-5].String);
4412 (yyval.Value)->type = TypeInfo::get("i1",BoolTy);
4413 delete (yyvsp[-4].String); delete (yyvsp[0].Value);
4418 #line 1990 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4420 std::string Name1 = getUniqueName((yyvsp[-2].Value)->val, (yyvsp[-3].Type));
4421 std::string Name2 = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-3].Type));
4422 *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Type)->getNewTy() + " " + Name1 + "," + Name2;
4423 (yyval.Value) = (yyvsp[-2].Value);
4424 delete (yyval.Value)->val;
4425 (yyval.Value)->val = (yyvsp[-5].String);
4426 (yyval.Value)->type = TypeInfo::get("i1",BoolTy);
4427 delete (yyvsp[-4].String); delete (yyvsp[0].Value);
4432 #line 2000 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4434 const char* shiftop = (yyvsp[-3].String)->c_str();
4435 if (*(yyvsp[-3].String) == "shr")
4436 shiftop = ((yyvsp[-2].Value)->type->isUnsigned()) ? "lshr" : "ashr";
4437 std::string *val = new std::string(shiftop);
4438 *val += " " + *(yyvsp[-2].Value)->val + ", " + *(yyvsp[0].Value)->val;
4439 (yyval.Value) = (yyvsp[-2].Value);
4440 delete (yyval.Value)->val;
4441 (yyval.Value)->val = val;
4442 delete (yyvsp[-3].String); delete (yyvsp[0].Value);
4447 #line 2011 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4449 std::string source = *(yyvsp[-2].Value)->val;
4450 const TypeInfo* SrcTy = (yyvsp[-2].Value)->type->resolve();
4451 const TypeInfo* DstTy = (yyvsp[0].Type)->resolve();
4452 (yyval.Value) = (yyvsp[-2].Value);
4453 delete (yyval.Value)->val;
4454 (yyval.Value)->val = new std::string();
4455 (yyval.Value)->type = DstTy;
4456 if (*(yyvsp[-3].String) == "cast") {
4457 *(yyval.Value)->val += getCastUpgrade(source, SrcTy, DstTy, false);
4459 *(yyval.Value)->val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
4461 // Check to see if this is a useless cast of a value to the same name
4462 // and the same type. Such casts will probably cause redefinition errors
4463 // when assembled and perform no code gen action so just remove them.
4464 if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
4465 if (SrcTy->isInteger() && DstTy->isInteger() &&
4466 SrcTy->getBitWidth() == DstTy->getBitWidth()) {
4467 deleteUselessCastFlag = true; // Flag the "Inst" rule
4468 deleteUselessCastName = new std::string(*(yyvsp[-2].Value)->val); // save the name
4469 size_t pos = deleteUselessCastName->find_first_of("%\"",0);
4470 if (pos != std::string::npos) {
4471 // remove the type portion before val
4472 deleteUselessCastName->erase(0, pos);
4475 delete (yyvsp[-3].String);
4476 delete (yyvsp[-1].String);
4481 #line 2041 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4483 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value)->val + ", " + *(yyvsp[-2].Value)->val + ", " + *(yyvsp[0].Value)->val;
4484 (yyval.Value) = (yyvsp[-4].Value);
4485 delete (yyval.Value)->val;
4486 (yyval.Value)->val = (yyvsp[-5].String);
4487 (yyval.Value)->type = (yyvsp[-2].Value)->type;
4488 delete (yyvsp[-2].Value);
4489 delete (yyvsp[0].Value);
4494 #line 2050 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4496 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value)->val + ", " + (yyvsp[0].Type)->getNewTy();
4497 (yyval.Value) = (yyvsp[-2].Value);
4498 delete (yyval.Value)->val;
4499 (yyval.Value)->val = (yyvsp[-3].String);
4500 (yyval.Value)->type = (yyvsp[0].Type);
4505 #line 2057 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4507 *(yyvsp[-3].String) += " " + *(yyvsp[-2].Value)->val + ", " + *(yyvsp[0].Value)->val;
4508 (yyval.Value) = (yyvsp[-2].Value);
4509 delete (yyval.Value)->val;
4510 (yyval.Value)->val = (yyvsp[-3].String);
4511 (yyval.Value)->type = (yyval.Value)->type->resolve();
4512 (yyval.Value)->type = (yyval.Value)->type->getElementType();
4513 delete (yyvsp[0].Value);
4518 #line 2066 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4520 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value)->val + ", " + *(yyvsp[-2].Value)->val + ", " + *(yyvsp[0].Value)->val;
4521 (yyval.Value) = (yyvsp[-4].Value);
4522 delete (yyval.Value)->val;
4523 (yyval.Value)->val = (yyvsp[-5].String);
4524 delete (yyvsp[-2].Value); delete (yyvsp[0].Value);
4529 #line 2073 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4531 *(yyvsp[-5].String) += " " + *(yyvsp[-4].Value)->val + ", " + *(yyvsp[-2].Value)->val + ", " + *(yyvsp[0].Value)->val;
4532 (yyval.Value) = (yyvsp[-4].Value);
4533 delete (yyval.Value)->val;
4534 (yyval.Value)->val = (yyvsp[-5].String);
4535 delete (yyvsp[-2].Value); delete (yyvsp[0].Value);
4540 #line 2080 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4542 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value)->val;
4543 (yyval.Value) = (yyvsp[0].Value);
4544 delete (yyvsp[0].Value)->val;
4545 (yyval.Value)->val = (yyvsp[-1].String);
4550 #line 2086 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4552 // map llvm.isunordered to "fcmp uno"
4553 (yyval.Value) = new ValueInfo;
4554 if (*(yyvsp[-3].Value)->val == "%llvm.isunordered.f32" ||
4555 *(yyvsp[-3].Value)->val == "%llvm.isunordered.f64") {
4556 (yyval.Value)->val = new std::string( "fcmp uno " + *(*(yyvsp[-1].ValList))[0]->val + ", ");
4557 size_t pos = (*(yyvsp[-1].ValList))[1]->val->find(' ');
4558 assert(pos != std::string::npos && "no space?");
4559 *(yyval.Value)->val += (*(yyvsp[-1].ValList))[1]->val->substr(pos+1);
4560 (yyval.Value)->type = TypeInfo::get("i1", BoolTy);
4562 static unsigned upgradeCount = 1;
4563 if (*(yyvsp[-3].Value)->val == "%llvm.va_start" || *(yyvsp[-3].Value)->val == "%llvm.va_end") {
4564 if (!(yyvsp[-1].ValList)->empty()) {
4565 std::string name("%va_upgrade");
4566 name += llvm::utostr(upgradeCount++);
4567 (yyvsp[-6].String)->insert(0, name + " = bitcast " + *(*(yyvsp[-1].ValList))[0]->val + " to i8*\n ");
4568 *(*(yyvsp[-1].ValList))[0]->val = "i8* " + name;
4569 (*(yyvsp[-1].ValList))[0]->type = TypeInfo::get("i8", UByteTy)->getPointerType();
4571 } else if (*(yyvsp[-3].Value)->val == "%llvm.va_copy") {
4572 std::string name0("%va_upgrade");
4573 name0 += llvm::utostr(upgradeCount++);
4574 std::string name1("%va_upgrade");
4575 name1 += llvm::utostr(upgradeCount++);
4576 (yyvsp[-6].String)->insert(0, name0 + " = bitcast " + *(*(yyvsp[-1].ValList))[0]->val + " to i8*\n " +
4577 name1 + " = bitcast " + *(*(yyvsp[-1].ValList))[1]->val + " to i8*\n ");
4578 *(*(yyvsp[-1].ValList))[0]->val = "i8* " + name0;
4579 (*(yyvsp[-1].ValList))[0]->type = TypeInfo::get("i8", UByteTy)->getPointerType();
4580 *(*(yyvsp[-1].ValList))[1]->val = "i8* " + name1;
4581 (*(yyvsp[-1].ValList))[0]->type = TypeInfo::get("i8", UByteTy)->getPointerType();
4583 if (!(yyvsp[-5].String)->empty())
4584 *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
4585 if (!(yyvsp[-6].String)->empty())
4586 *(yyvsp[-6].String) += " ";
4587 *(yyvsp[-6].String) += (yyvsp[-4].Type)->getNewTy() + " " + *(yyvsp[-3].Value)->val + "(";
4588 for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
4589 ValueInfo* VI = (*(yyvsp[-1].ValList))[i];
4590 *(yyvsp[-6].String) += *VI->val;
4591 if (i+1 < (yyvsp[-1].ValList)->size())
4592 *(yyvsp[-6].String) += ", ";
4595 *(yyvsp[-6].String) += ")";
4596 (yyval.Value) = new ValueInfo;
4597 (yyval.Value)->val = (yyvsp[-6].String);
4598 (yyval.Value)->type = getFunctionReturnType((yyvsp[-4].Type));
4600 delete (yyvsp[-5].String); delete (yyvsp[-3].Value); delete (yyvsp[-1].ValList);
4605 #line 2142 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4606 { (yyval.ValList) = (yyvsp[0].ValList); ;}
4610 #line 2143 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4611 { (yyval.ValList) = new ValueList(); ;}
4615 #line 2148 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4616 { (yyval.String) = new std::string(); ;}
4620 #line 2151 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4622 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4623 if (!(yyvsp[0].String)->empty())
4624 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4625 (yyval.Value) = new ValueInfo;
4626 (yyval.Value)->val = (yyvsp[-2].String);
4627 (yyval.Value)->type = (yyvsp[-1].Type)->getPointerType();
4628 delete (yyvsp[0].String);
4633 #line 2160 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4635 std::string Name = getUniqueName((yyvsp[-1].Value)->val, (yyvsp[-2].Type));
4636 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4637 if (!(yyvsp[0].String)->empty())
4638 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4639 (yyval.Value) = new ValueInfo;
4640 (yyval.Value)->val = (yyvsp[-5].String);
4641 (yyval.Value)->type = (yyvsp[-4].Type)->getPointerType();
4642 delete (yyvsp[-1].Value); delete (yyvsp[0].String);
4647 #line 2170 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4649 *(yyvsp[-2].String) += " " + (yyvsp[-1].Type)->getNewTy();
4650 if (!(yyvsp[0].String)->empty())
4651 *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
4652 (yyval.Value) = new ValueInfo;
4653 (yyval.Value)->val = (yyvsp[-2].String);
4654 (yyval.Value)->type = (yyvsp[-1].Type)->getPointerType();
4655 delete (yyvsp[0].String);
4660 #line 2179 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4662 std::string Name = getUniqueName((yyvsp[-1].Value)->val, (yyvsp[-2].Type));
4663 *(yyvsp[-5].String) += " " + (yyvsp[-4].Type)->getNewTy() + ", " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4664 if (!(yyvsp[0].String)->empty())
4665 *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
4666 (yyval.Value) = (yyvsp[-1].Value);
4667 delete (yyval.Value)->val;
4668 (yyval.Value)->val = (yyvsp[-5].String);
4669 (yyval.Value)->type = (yyvsp[-4].Type)->getPointerType();
4670 delete (yyvsp[0].String);
4675 #line 2190 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4677 *(yyvsp[-1].String) += " " + *(yyvsp[0].Value)->val;
4678 (yyval.Value) = (yyvsp[0].Value);
4679 delete (yyvsp[0].Value)->val;
4680 (yyval.Value)->val = (yyvsp[-1].String);
4681 (yyval.Value)->type = TypeInfo::get("void", VoidTy);
4686 #line 2197 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4688 std::string Name = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-1].Type));
4689 if (!(yyvsp[-3].String)->empty())
4690 *(yyvsp[-3].String) += " ";
4691 *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4692 (yyval.Value) = (yyvsp[0].Value);
4693 delete (yyval.Value)->val;
4694 (yyval.Value)->val = (yyvsp[-3].String);
4695 (yyval.Value)->type = (yyvsp[-1].Type)->getElementType();
4696 delete (yyvsp[-2].String);
4701 #line 2208 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4703 std::string Name = getUniqueName((yyvsp[0].Value)->val, (yyvsp[-1].Type));
4704 if (!(yyvsp[-5].String)->empty())
4705 *(yyvsp[-5].String) += " ";
4706 *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Value)->val + ", " + (yyvsp[-1].Type)->getNewTy() + " " + Name;
4707 (yyval.Value) = (yyvsp[-3].Value);
4708 delete (yyval.Value)->val;
4709 (yyval.Value)->val = (yyvsp[-5].String);
4710 (yyval.Value)->type = TypeInfo::get("void", VoidTy);
4711 delete (yyvsp[-4].String); delete (yyvsp[0].Value);
4716 #line 2219 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
4718 std::string Name = getUniqueName((yyvsp[-1].Value)->val, (yyvsp[-2].Type));
4719 // Upgrade the indices
4720 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4721 ValueInfo* VI = (*(yyvsp[0].ValList))[i];
4722 if (VI->type->isUnsigned() && !VI->isConstant() &&
4723 VI->type->getBitWidth() < 64) {
4724 *O << " %gep_upgrade" << UniqueNameCounter << " = zext " << *VI->val
4726 *VI->val = "i64 %gep_upgrade" + llvm::utostr(UniqueNameCounter++);
4727 VI->type = TypeInfo::get("i64",ULongTy);
4730 *(yyvsp[-3].String) += " " + (yyvsp[-2].Type)->getNewTy() + " " + Name;
4731 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
4732 ValueInfo* VI = (*(yyvsp[0].ValList))[i];
4733 *(yyvsp[-3].String) += ", " + *VI->val;
4735 (yyval.Value) = (yyvsp[-1].Value);
4736 delete (yyval.Value)->val;
4737 (yyval.Value)->val = (yyvsp[-3].String);
4738 (yyval.Value)->type = getGEPIndexedType((yyvsp[-2].Type),(yyvsp[0].ValList));
4739 for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i)
4740 delete (*(yyvsp[0].ValList))[i];
4741 delete (yyvsp[0].ValList);
4749 /* Line 1126 of yacc.c. */
4750 #line 4751 "UpgradeParser.tab.c"
4756 YY_STACK_PRINT (yyss, yyssp);
4761 /* Now `shift' the result of the reduction. Determine what state
4762 that goes to, based on the state we popped back to and the rule
4763 number reduced by. */
4767 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4768 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4769 yystate = yytable[yystate];
4771 yystate = yydefgoto[yyn - YYNTOKENS];
4776 /*------------------------------------.
4777 | yyerrlab -- here on detecting error |
4778 `------------------------------------*/
4780 /* If not already recovering from an error, report this error. */
4785 yyn = yypact[yystate];
4787 if (YYPACT_NINF < yyn && yyn < YYLAST)
4789 int yytype = YYTRANSLATE (yychar);
4790 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4791 YYSIZE_T yysize = yysize0;
4793 int yysize_overflow = 0;
4795 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4796 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4800 /* This is so xgettext sees the translatable formats that are
4801 constructed on the fly. */
4802 YY_("syntax error, unexpected %s");
4803 YY_("syntax error, unexpected %s, expecting %s");
4804 YY_("syntax error, unexpected %s, expecting %s or %s");
4805 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4806 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4810 static char const yyunexpected[] = "syntax error, unexpected %s";
4811 static char const yyexpecting[] = ", expecting %s";
4812 static char const yyor[] = " or %s";
4813 char yyformat[sizeof yyunexpected
4814 + sizeof yyexpecting - 1
4815 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4816 * (sizeof yyor - 1))];
4817 char const *yyprefix = yyexpecting;
4819 /* Start YYX at -YYN if negative to avoid negative indexes in
4821 int yyxbegin = yyn < 0 ? -yyn : 0;
4823 /* Stay within bounds of both yycheck and yytname. */
4824 int yychecklim = YYLAST - yyn;
4825 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4828 yyarg[0] = yytname[yytype];
4829 yyfmt = yystpcpy (yyformat, yyunexpected);
4831 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4832 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4834 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4838 yyformat[sizeof yyunexpected - 1] = '\0';
4841 yyarg[yycount++] = yytname[yyx];
4842 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4843 yysize_overflow |= yysize1 < yysize;
4845 yyfmt = yystpcpy (yyfmt, yyprefix);
4849 yyf = YY_(yyformat);
4850 yysize1 = yysize + yystrlen (yyf);
4851 yysize_overflow |= yysize1 < yysize;
4854 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4855 yymsg = (char *) YYSTACK_ALLOC (yysize);
4858 /* Avoid sprintf, as that infringes on the user's name space.
4859 Don't have undefined behavior even if the translation
4860 produced a string with the wrong number of "%s"s. */
4863 while ((*yyp = *yyf))
4865 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4867 yyp += yytnamerr (yyp, yyarg[yyi++]);
4877 YYSTACK_FREE (yymsg);
4881 yyerror (YY_("syntax error"));
4882 goto yyexhaustedlab;
4886 #endif /* YYERROR_VERBOSE */
4887 yyerror (YY_("syntax error"));
4892 if (yyerrstatus == 3)
4894 /* If just tried and failed to reuse look-ahead token after an
4895 error, discard it. */
4897 if (yychar <= YYEOF)
4899 /* Return failure if at end of input. */
4900 if (yychar == YYEOF)
4905 yydestruct ("Error: discarding", yytoken, &yylval);
4910 /* Else will try to reuse look-ahead token after shifting the error
4915 /*---------------------------------------------------.
4916 | yyerrorlab -- error raised explicitly by YYERROR. |
4917 `---------------------------------------------------*/
4920 /* Pacify compilers like GCC when the user code never invokes
4921 YYERROR and the label yyerrorlab therefore never appears in user
4932 /*-------------------------------------------------------------.
4933 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4934 `-------------------------------------------------------------*/
4936 yyerrstatus = 3; /* Each real token shifted decrements this. */
4940 yyn = yypact[yystate];
4941 if (yyn != YYPACT_NINF)
4944 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4952 /* Pop the current state because it cannot handle the error token. */
4957 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4960 YY_STACK_PRINT (yyss, yyssp);
4969 /* Shift the error token. */
4970 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4976 /*-------------------------------------.
4977 | yyacceptlab -- YYACCEPT comes here. |
4978 `-------------------------------------*/
4983 /*-----------------------------------.
4984 | yyabortlab -- YYABORT comes here. |
4985 `-----------------------------------*/
4991 /*-------------------------------------------------.
4992 | yyexhaustedlab -- memory exhaustion comes here. |
4993 `-------------------------------------------------*/
4995 yyerror (YY_("memory exhausted"));
5001 if (yychar != YYEOF && yychar != YYEMPTY)
5002 yydestruct ("Cleanup: discarding lookahead",
5004 while (yyssp != yyss)
5006 yydestruct ("Cleanup: popping",
5007 yystos[*yyssp], yyvsp);
5012 YYSTACK_FREE (yyss);
5018 #line 2246 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
5021 int yyerror(const char *ErrorMsg) {
5023 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
5024 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
5025 std::string errMsg = where + "error: " + std::string(ErrorMsg) +
5027 if (yychar == YYEMPTY || yychar == 0)
5028 errMsg += "end-of-file.";
5030 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
5031 std::cerr << "llvm-upgrade: " << errMsg << '\n';
5032 *O << "llvm-upgrade parse failed.\n";
5036 void warning(const std::string& ErrorMsg) {
5038 = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename)
5039 + ":" + llvm::utostr((unsigned) Upgradelineno) + ": ";
5040 std::string errMsg = where + "warning: " + std::string(ErrorMsg) +
5042 if (yychar == YYEMPTY || yychar == 0)
5043 errMsg += "end-of-file.";
5045 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
5046 std::cerr << "llvm-upgrade: " << errMsg << '\n';