diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-08 09:08:52 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-08 09:08:52 +0000 |
commit | ed96d1e78c96f385900ec1accb014d2b89e218cd (patch) | |
tree | cbd3a1038d9360b6c561cb54821fa175b60079b2 /tools/llvm-upgrade | |
parent | 2dcb5834c0db29d2d1e1f6d9b509533df25bd85e (diff) | |
download | external_llvm-ed96d1e78c96f385900ec1accb014d2b89e218cd.zip external_llvm-ed96d1e78c96f385900ec1accb014d2b89e218cd.tar.gz external_llvm-ed96d1e78c96f385900ec1accb014d2b89e218cd.tar.bz2 |
Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-upgrade')
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.cpp.cvs | 2323 | ||||
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.h.cvs | 2 | ||||
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.y.cvs | 574 |
3 files changed, 1504 insertions, 1395 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs index 239f6a4..c93b7e9 100644 --- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs +++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs @@ -531,7 +531,6 @@ static struct PerFunctionInfo { std::map<BasicBlock*, std::pair<ValID, int> > BBForwardRefs; std::vector<BasicBlock*> NumberedBlocks; RenameMapType RenameMap; - unsigned LastCC; unsigned NextBBNum; inline PerFunctionInfo() { @@ -628,6 +627,55 @@ static const Type *getType(const ValID &D, bool DoNotImprovise = false) { return Typ; } +/// This function determines if two function types differ only in their use of +/// the sret parameter attribute in the first argument. If they are identical +/// in all other respects, it returns true. Otherwise, it returns false. +bool FuncTysDifferOnlyBySRet(const FunctionType *F1, + const FunctionType *F2) { + if (F1->getReturnType() != F2->getReturnType() || + F1->getNumParams() != F2->getNumParams() || + F1->getParamAttrs(0) != F2->getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + for (unsigned i = 0; i < F1->getNumParams(); ++i) { + if (F1->getParamType(i) != F2->getParamType(i) || + unsigned(F1->getParamAttrs(i+1)) & SRetMask != + unsigned(F2->getParamAttrs(i+1)) & SRetMask) + return false; + } + return true; +} + +// The upgrade of csretcc to sret param attribute may have caused a function +// to not be found because the param attribute changed the type of the called +// function. This helper function, used in getExistingValue, detects that +// situation and returns V if it occurs and 0 otherwise. +static Value* handleSRetFuncTypeMerge(Value *V, const Type* Ty) { + // Handle degenerate cases + if (!V) + return 0; + if (V->getType() == Ty) + return V; + + Value* Result = 0; + const PointerType *PF1 = dyn_cast<PointerType>(Ty); + const PointerType *PF2 = dyn_cast<PointerType>(V->getType()); + if (PF1 && PF2) { + const FunctionType *FT1 = + dyn_cast<FunctionType>(PF1->getElementType()); + const FunctionType *FT2 = + dyn_cast<FunctionType>(PF2->getElementType()); + if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) + if (FT2->paramHasAttr(1, FunctionType::StructRetAttribute)) + Result = V; + else if (Constant *C = dyn_cast<Constant>(V)) + Result = ConstantExpr::getBitCast(C, PF1); + else + Result = new BitCastInst(V, PF1, "upgrd.cast", CurBB); + } + return Result; +} + // getExistingValue - Look up the value specified by the provided type and // the provided ValID. If the value exists and has already been defined, return // it. Otherwise return null. @@ -674,8 +722,7 @@ static Value *getExistingValue(const Type *Ty, const ValID &D) { LookupName = Name; ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable(); V = SymTab.lookup(LookupName); - if (V && V->getType() != Ty) - V = 0; + V = handleSRetFuncTypeMerge(V, Ty); } if (!V) { RenameMapType::const_iterator I = CurModule.RenameMap.find(Key); @@ -685,8 +732,7 @@ static Value *getExistingValue(const Type *Ty, const ValID &D) { else LookupName = Name; V = CurModule.CurrentModule->getValueSymbolTable().lookup(LookupName); - if (V && V->getType() != Ty) - V = 0; + V = handleSRetFuncTypeMerge(V, Ty); } if (!V) return 0; @@ -789,6 +835,14 @@ static Value *getVal(const Type *Ty, const ValID &ID) { return V; } +/// @brief This just makes any name given to it unique, up to MAX_UINT times. +static std::string makeNameUnique(const std::string& Name) { + static unsigned UniqueNameCounter = 1; + std::string Result(Name); + Result += ".upgrd." + llvm::utostr(UniqueNameCounter++); + return Result; +} + /// getBBVal - This is used for two purposes: /// * If isDefinition is true, a new basic block with the specified ID is being /// defined. @@ -813,9 +867,18 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) { Name = ID.Name; if (Value *N = CurFun.CurrentFunction-> getValueSymbolTable().lookup(Name)) { - if (N->getType() != Type::LabelTy) - error("Name '" + Name + "' does not refer to a BasicBlock"); - BB = cast<BasicBlock>(N); + if (N->getType() != Type::LabelTy) { + // Register names didn't use to conflict with basic block names + // because of type planes. Now they all have to be unique. So, we just + // rename the register and treat this name as if no basic block + // had been found. + RenameMapKey Key = std::make_pair(N->getName(),N->getType()); + N->setName(makeNameUnique(N->getName())); + CurModule.RenameMap[Key] = N->getName(); + BB = 0; + } else { + BB = cast<BasicBlock>(N); + } } break; } @@ -869,25 +932,6 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) { // and back patchs after we are done. // -/// This function determines if two function types differ only in their use of -/// the sret parameter attribute in the first argument. If they are identical -/// in all other respects, it returns true. Otherwise, it returns false. -bool FuncTysDifferOnlyBySRet(const FunctionType *F1, - const FunctionType *F2) { - if (F1->getReturnType() != F2->getReturnType() || - F1->getNumParams() != F2->getNumParams() || - F1->getParamAttrs(0) != F2->getParamAttrs(0)) - return false; - unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); - for (unsigned i = 0; i < F1->getNumParams(); ++i) { - if (F1->getParamType(i) != F2->getParamType(i) || - unsigned(F1->getParamAttrs(i+1)) & SRetMask != - unsigned(F2->getParamAttrs(i+1)) & SRetMask) - return false; - } - return true; -} - // ResolveDefinitions - If we could not resolve some defs at parsing // time (forward branches, phi functions for loops, etc...) resolve the // defs now... @@ -895,9 +939,11 @@ bool FuncTysDifferOnlyBySRet(const FunctionType *F1, static void ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, std::map<const Type*,ValueList> *FutureLateResolvers) { + // Loop over LateResolveDefs fixing up stuff that couldn't be resolved for (std::map<const Type*,ValueList>::iterator LRI = LateResolvers.begin(), E = LateResolvers.end(); LRI != E; ++LRI) { + const Type* Ty = LRI->first; ValueList &List = LRI->second; while (!List.empty()) { Value *V = List.back(); @@ -909,7 +955,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, ValID &DID = PHI->second.first; - Value *TheRealValue = getExistingValue(LRI->first, DID); + Value *TheRealValue = getExistingValue(Ty, DID); if (TheRealValue) { V->replaceAllUsesWith(TheRealValue); delete V; @@ -920,26 +966,10 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) { - // The upgrade of csretcc to sret param attribute may have caused a - // function to not be found because the param attribute changed the - // type of the called function. Detect this situation and insert a - // cast as necessary. - bool fixed = false; - if (const PointerType *PTy = dyn_cast<PointerType>(V->getType())) - if (const FunctionType *FTy = - dyn_cast<FunctionType>(PTy->getElementType())) - if (Function *OtherF = - CurModule.CurrentModule->getFunction(DID.getName())) - if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { - V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); - fixed = true; - } - if (!fixed) { - error("Reference to an invalid definition: '" +DID.getName()+ - "' of type '" + V->getType()->getDescription() + "'", - PHI->second.second); + error("Reference to an invalid definition: '" + DID.getName() + + "' of type '" + V->getType()->getDescription() + "'", + PHI->second.second); return; - } } else { error("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + @@ -970,14 +1000,6 @@ static void ResolveTypeTo(char *Name, const Type *ToTy) { } } -/// @brief This just makes any name given to it unique, up to MAX_UINT times. -static std::string makeNameUnique(const std::string& Name) { - static unsigned UniqueNameCounter = 1; - std::string Result(Name); - Result += ".upgrd." + llvm::utostr(UniqueNameCounter++); - return Result; -} - /// This is the implementation portion of TypeHasInteger. It traverses the /// type given, avoiding recursive types, and returns true as soon as it finds /// an integer type. If no integer type is found, it returns false. @@ -1807,7 +1829,7 @@ using namespace llvm; #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1431 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1453 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1850,7 +1872,7 @@ typedef union YYSTYPE { llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1854 "UpgradeParser.tab.c" +#line 1876 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1862,7 +1884,7 @@ typedef union YYSTYPE { /* Line 219 of yacc.c. */ -#line 1866 "UpgradeParser.tab.c" +#line 1888 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2013,16 +2035,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1736 +#define YYLAST 1762 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 166 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 79 +#define YYNNTS 80 /* YYNRULES -- Number of rules. */ -#define YYNRULES 308 +#define YYNRULES 309 /* YYNRULES -- Number of states. */ -#define YYNSTATES 604 +#define YYNSTATES 605 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -2105,14 +2127,14 @@ static const unsigned short int yyprhs[] = 567, 569, 571, 575, 579, 583, 587, 591, 595, 597, 598, 600, 602, 604, 605, 608, 612, 614, 616, 620, 622, 623, 632, 634, 636, 640, 642, 644, 647, 648, - 650, 652, 653, 658, 659, 661, 663, 665, 667, 669, - 671, 673, 675, 677, 681, 683, 689, 691, 693, 695, - 697, 700, 703, 706, 710, 713, 714, 716, 718, 720, - 723, 726, 730, 740, 750, 759, 773, 775, 777, 784, - 790, 793, 800, 808, 810, 814, 816, 817, 820, 822, - 828, 834, 840, 847, 854, 857, 862, 867, 874, 879, - 884, 889, 894, 901, 908, 911, 919, 921, 924, 925, - 927, 928, 932, 939, 943, 950, 953, 958, 965 + 650, 652, 653, 654, 660, 661, 663, 665, 667, 669, + 671, 673, 675, 677, 679, 683, 685, 691, 693, 695, + 697, 699, 702, 705, 708, 712, 715, 716, 718, 720, + 722, 725, 728, 732, 742, 752, 761, 775, 777, 779, + 786, 792, 795, 802, 810, 812, 816, 818, 819, 822, + 824, 830, 836, 842, 849, 856, 859, 864, 869, 876, + 881, 886, 891, 896, 903, 910, 913, 921, 923, 926, + 927, 929, 930, 934, 941, 945, 952, 955, 960, 967 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -2143,7 +2165,7 @@ static const short int yyrhs[] = -1, 191, -1, 8, -1, 193, -1, 8, -1, 193, -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, - -1, 19, -1, 21, -1, 192, -1, 48, -1, 227, + -1, 19, -1, 21, -1, 192, -1, 48, -1, 228, -1, 154, 4, -1, 190, 155, 195, 156, -1, 157, 4, 158, 193, 159, -1, 160, 4, 158, 193, 161, -1, 162, 194, 163, -1, 162, 163, -1, 160, 162, @@ -2154,10 +2176,10 @@ static const short int yyrhs[] = 191, 160, 198, 161, -1, 191, 162, 198, 163, -1, 191, 162, 163, -1, 191, 160, 162, 198, 163, 161, -1, 191, 160, 162, 163, 161, -1, 191, 38, -1, - 191, 39, -1, 191, 227, -1, 191, 197, -1, 191, + 191, 39, -1, 191, 228, -1, 191, 197, -1, 191, 26, -1, 176, 168, -1, 177, 4, -1, 9, 27, -1, 9, 28, -1, 179, 7, -1, 175, 155, 196, - 36, 191, 156, -1, 110, 155, 196, 242, 156, -1, + 36, 191, 156, -1, 110, 155, 196, 243, 156, -1, 112, 155, 196, 153, 196, 153, 196, 156, -1, 169, 155, 196, 153, 196, 156, -1, 170, 155, 196, 153, 196, 156, -1, 171, 155, 196, 153, 196, 156, -1, @@ -2182,75 +2204,76 @@ static const short int yyrhs[] = 214, -1, 214, -1, 215, -1, 215, 153, 37, -1, 37, -1, -1, 182, 189, 212, 155, 216, 156, 186, 183, -1, 29, -1, 162, -1, 181, 217, 218, -1, - 30, -1, 163, -1, 230, 220, -1, -1, 45, -1, - 47, -1, -1, 31, 224, 222, 217, -1, -1, 63, - -1, 3, -1, 4, -1, 7, -1, 27, -1, 28, - -1, 38, -1, 39, -1, 26, -1, 160, 198, 161, - -1, 197, -1, 61, 225, 24, 153, 24, -1, 167, - -1, 212, -1, 227, -1, 226, -1, 191, 228, -1, - 230, 231, -1, 219, 231, -1, 232, 180, 234, -1, - 232, 236, -1, -1, 23, -1, 77, -1, 78, -1, - 72, 229, -1, 72, 8, -1, 73, 21, 228, -1, - 73, 9, 228, 153, 21, 228, 153, 21, 228, -1, - 74, 178, 228, 153, 21, 228, 157, 235, 159, -1, - 74, 178, 228, 153, 21, 228, 157, 159, -1, 75, - 182, 189, 228, 155, 239, 156, 36, 21, 228, 233, - 21, 228, -1, 233, -1, 76, -1, 235, 178, 226, - 153, 21, 228, -1, 178, 226, 153, 21, 228, -1, - 180, 241, -1, 191, 157, 228, 153, 228, 159, -1, - 237, 153, 157, 228, 153, 228, 159, -1, 229, -1, - 238, 153, 229, -1, 238, -1, -1, 60, 59, -1, - 59, -1, 169, 191, 228, 153, 228, -1, 170, 191, - 228, 153, 228, -1, 171, 191, 228, 153, 228, -1, - 103, 172, 191, 228, 153, 228, -1, 104, 173, 191, - 228, 153, 228, -1, 49, 229, -1, 174, 229, 153, - 229, -1, 175, 229, 36, 191, -1, 112, 229, 153, - 229, 153, 229, -1, 113, 229, 153, 191, -1, 117, - 229, 153, 191, -1, 118, 229, 153, 191, -1, 114, - 229, 153, 229, -1, 115, 229, 153, 229, 153, 229, - -1, 116, 229, 153, 229, 153, 229, -1, 111, 237, - -1, 240, 182, 189, 228, 155, 239, 156, -1, 244, - -1, 153, 238, -1, -1, 35, -1, -1, 105, 191, - 184, -1, 105, 191, 153, 15, 228, 184, -1, 106, - 191, 184, -1, 106, 191, 153, 15, 228, 184, -1, - 107, 229, -1, 243, 108, 191, 228, -1, 243, 109, - 229, 153, 191, 228, -1, 110, 191, 228, 242, -1 + 30, -1, 163, -1, 231, 220, -1, -1, 45, -1, + 47, -1, -1, -1, 31, 224, 222, 225, 217, -1, + -1, 63, -1, 3, -1, 4, -1, 7, -1, 27, + -1, 28, -1, 38, -1, 39, -1, 26, -1, 160, + 198, 161, -1, 197, -1, 61, 226, 24, 153, 24, + -1, 167, -1, 212, -1, 228, -1, 227, -1, 191, + 229, -1, 231, 232, -1, 219, 232, -1, 233, 180, + 235, -1, 233, 237, -1, -1, 23, -1, 77, -1, + 78, -1, 72, 230, -1, 72, 8, -1, 73, 21, + 229, -1, 73, 9, 229, 153, 21, 229, 153, 21, + 229, -1, 74, 178, 229, 153, 21, 229, 157, 236, + 159, -1, 74, 178, 229, 153, 21, 229, 157, 159, + -1, 75, 182, 189, 229, 155, 240, 156, 36, 21, + 229, 234, 21, 229, -1, 234, -1, 76, -1, 236, + 178, 227, 153, 21, 229, -1, 178, 227, 153, 21, + 229, -1, 180, 242, -1, 191, 157, 229, 153, 229, + 159, -1, 238, 153, 157, 229, 153, 229, 159, -1, + 230, -1, 239, 153, 230, -1, 239, -1, -1, 60, + 59, -1, 59, -1, 169, 191, 229, 153, 229, -1, + 170, 191, 229, 153, 229, -1, 171, 191, 229, 153, + 229, -1, 103, 172, 191, 229, 153, 229, -1, 104, + 173, 191, 229, 153, 229, -1, 49, 230, -1, 174, + 230, 153, 230, -1, 175, 230, 36, 191, -1, 112, + 230, 153, 230, 153, 230, -1, 113, 230, 153, 191, + -1, 117, 230, 153, 191, -1, 118, 230, 153, 191, + -1, 114, 230, 153, 230, -1, 115, 230, 153, 230, + 153, 230, -1, 116, 230, 153, 230, 153, 230, -1, + 111, 238, -1, 241, 182, 189, 229, 155, 240, 156, + -1, 245, -1, 153, 239, -1, -1, 35, -1, -1, + 105, 191, 184, -1, 105, 191, 153, 15, 229, 184, + -1, 106, 191, 184, -1, 106, 191, 153, 15, 229, + 184, -1, 107, 230, -1, 244, 108, 191, 229, -1, + 244, 109, 230, 153, 191, 229, -1, 110, 191, 229, + 243, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1571, 1571, 1572, 1580, 1581, 1591, 1591, 1591, 1591, - 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1595, 1595, 1595, - 1599, 1599, 1599, 1599, 1599, 1599, 1603, 1603, 1604, 1604, - 1605, 1605, 1606, 1606, 1607, 1607, 1611, 1611, 1612, 1612, - 1613, 1613, 1614, 1614, 1615, 1615, 1616, 1616, 1617, 1617, - 1618, 1619, 1622, 1622, 1622, 1622, 1626, 1626, 1626, 1626, - 1626, 1626, 1626, 1627, 1627, 1627, 1627, 1627, 1627, 1633, - 1633, 1633, 1633, 1637, 1637, 1637, 1637, 1641, 1641, 1645, - 1645, 1650, 1653, 1658, 1659, 1660, 1661, 1662, 1663, 1664, - 1665, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1686, - 1687, 1695, 1696, 1704, 1713, 1714, 1721, 1722, 1726, 1730, - 1746, 1747, 1754, 1755, 1762, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1771, 1771, 1771, 1771, 1771, 1776, 1780, 1784, - 1789, 1798, 1818, 1824, 1837, 1846, 1850, 1861, 1865, 1878, - 1882, 1889, 1890, 1896, 1903, 1915, 1945, 1958, 1981, 2009, - 2031, 2042, 2064, 2075, 2084, 2089, 2147, 2154, 2162, 2169, - 2176, 2180, 2184, 2193, 2208, 2221, 2230, 2258, 2271, 2280, - 2286, 2292, 2303, 2309, 2315, 2326, 2327, 2336, 2337, 2349, - 2358, 2359, 2360, 2361, 2362, 2378, 2398, 2400, 2402, 2402, - 2409, 2409, 2416, 2416, 2423, 2423, 2431, 2433, 2435, 2440, - 2454, 2455, 2459, 2462, 2470, 2474, 2481, 2485, 2489, 2493, - 2501, 2501, 2506, 2507, 2511, 2519, 2524, 2532, 2533, 2540, - 2547, 2551, 2711, 2711, 2715, 2725, 2725, 2729, 2733, 2735, - 2736, 2740, 2740, 2752, 2753, 2758, 2759, 2760, 2761, 2762, - 2763, 2764, 2765, 2766, 2787, 2790, 2805, 2806, 2811, 2811, - 2819, 2828, 2831, 2840, 2850, 2855, 2864, 2875, 2875, 2878, - 2881, 2884, 2888, 2894, 2909, 2915, 2971, 2974, 2980, 2990, - 3003, 3032, 3040, 3048, 3052, 3059, 3060, 3064, 3067, 3073, - 3090, 3106, 3120, 3132, 3144, 3155, 3173, 3182, 3191, 3198, - 3219, 3243, 3249, 3255, 3261, 3277, 3355, 3363, 3364, 3368, - 3369, 3373, 3379, 3385, 3391, 3397, 3404, 3416, 3430 + 0, 1593, 1593, 1594, 1602, 1603, 1613, 1613, 1613, 1613, + 1613, 1613, 1613, 1613, 1613, 1613, 1613, 1617, 1617, 1617, + 1621, 1621, 1621, 1621, 1621, 1621, 1625, 1625, 1626, 1626, + 1627, 1627, 1628, 1628, 1629, 1629, 1633, 1633, 1634, 1634, + 1635, 1635, 1636, 1636, 1637, 1637, 1638, 1638, 1639, 1639, + 1640, 1641, 1644, 1644, 1644, 1644, 1648, 1648, 1648, 1648, + 1648, 1648, 1648, 1649, 1649, 1649, 1649, 1649, 1649, 1655, + 1655, 1655, 1655, 1659, 1659, 1659, 1659, 1663, 1663, 1667, + 1667, 1672, 1675, 1680, 1681, 1682, 1683, 1684, 1685, 1686, + 1687, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1708, + 1709, 1717, 1718, 1726, 1735, 1736, 1743, 1744, 1748, 1752, + 1768, 1769, 1776, 1777, 1784, 1792, 1792, 1792, 1792, 1792, + 1792, 1792, 1793, 1793, 1793, 1793, 1793, 1798, 1802, 1806, + 1811, 1820, 1837, 1843, 1856, 1865, 1869, 1880, 1884, 1897, + 1901, 1908, 1909, 1915, 1922, 1934, 1964, 1977, 2000, 2028, + 2050, 2061, 2083, 2094, 2103, 2108, 2166, 2173, 2181, 2188, + 2195, 2199, 2203, 2212, 2227, 2240, 2249, 2277, 2290, 2299, + 2305, 2311, 2322, 2328, 2334, 2345, 2346, 2355, 2356, 2368, + 2377, 2378, 2379, 2380, 2381, 2397, 2417, 2419, 2421, 2421, + 2428, 2428, 2435, 2435, 2442, 2442, 2450, 2452, 2454, 2459, + 2473, 2474, 2478, 2481, 2489, 2493, 2500, 2504, 2508, 2512, + 2520, 2520, 2524, 2525, 2529, 2537, 2542, 2550, 2551, 2558, + 2565, 2569, 2745, 2745, 2749, 2759, 2759, 2763, 2768, 2769, + 2770, 2774, 2775, 2774, 2787, 2788, 2793, 2794, 2795, 2796, + 2797, 2798, 2799, 2800, 2801, 2822, 2825, 2840, 2841, 2846, + 2846, 2854, 2863, 2866, 2875, 2885, 2890, 2899, 2910, 2910, + 2913, 2916, 2919, 2923, 2929, 2944, 2950, 3006, 3009, 3015, + 3025, 3038, 3067, 3075, 3083, 3087, 3094, 3095, 3099, 3102, + 3108, 3125, 3141, 3155, 3167, 3179, 3190, 3208, 3217, 3226, + 3233, 3254, 3278, 3284, 3290, 3296, 3312, 3390, 3398, 3399, + 3403, 3404, 3408, 3414, 3420, 3426, 3432, 3439, 3451, 3476 }; #endif @@ -2293,7 +2316,7 @@ static const char *const yytname[] = "@2", "@3", "@4", "AsmBlock", "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FnDeclareLinkage", "FunctionProto", "@5", + "END", "Function", "FnDeclareLinkage", "FunctionProto", "@5", "@6", "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList", "Unwind", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", @@ -2353,14 +2376,14 @@ static const unsigned char yyr1[] = 208, 208, 209, 209, 209, 209, 210, 211, 211, 211, 212, 212, 213, 213, 214, 215, 215, 216, 216, 216, 216, 217, 218, 218, 219, 220, 220, 221, 222, 222, - 222, 224, 223, 225, 225, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 227, 227, 228, 228, - 229, 230, 230, 231, 232, 232, 232, 233, 233, 234, - 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, - 236, 237, 237, 238, 238, 239, 239, 240, 240, 241, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 241, 241, 241, 242, 242, 243, - 243, 244, 244, 244, 244, 244, 244, 244, 244 + 222, 224, 225, 223, 226, 226, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 228, 228, 229, + 229, 230, 231, 231, 232, 233, 233, 233, 234, 234, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 240, 240, 241, 241, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, + 244, 244, 245, 245, 245, 245, 245, 245, 245, 245 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -2389,14 +2412,14 @@ static const unsigned char yyr2[] = 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, 1, 1, 3, 1, 1, 2, 0, 1, - 1, 0, 4, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, - 2, 2, 2, 3, 2, 0, 1, 1, 1, 2, - 2, 3, 9, 9, 8, 13, 1, 1, 6, 5, - 2, 6, 7, 1, 3, 1, 0, 2, 1, 5, - 5, 5, 6, 6, 2, 4, 4, 6, 4, 4, - 4, 4, 6, 6, 2, 7, 1, 2, 0, 1, - 0, 3, 6, 3, 6, 2, 4, 6, 4 + 1, 0, 0, 5, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, + 1, 2, 2, 2, 3, 2, 0, 1, 1, 1, + 2, 2, 3, 9, 9, 8, 13, 1, 1, 6, + 5, 2, 6, 7, 1, 3, 1, 0, 2, 1, + 5, 5, 5, 6, 6, 2, 4, 4, 6, 4, + 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, + 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2405,160 +2428,160 @@ static const unsigned char yyr2[] = static const unsigned short int yydefact[] = { 198, 0, 90, 184, 1, 183, 231, 83, 84, 85, - 86, 87, 88, 89, 0, 91, 255, 180, 181, 255, + 86, 87, 88, 89, 0, 91, 256, 180, 181, 256, 210, 211, 0, 0, 0, 90, 0, 186, 228, 0, - 0, 92, 93, 94, 95, 96, 97, 0, 0, 256, - 252, 82, 225, 226, 227, 251, 0, 0, 0, 0, + 0, 92, 93, 94, 95, 96, 97, 0, 0, 257, + 253, 82, 225, 226, 227, 252, 0, 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, 0, 81, 229, - 230, 91, 199, 182, 98, 2, 3, 111, 115, 116, + 230, 232, 199, 182, 98, 2, 3, 111, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 128, 0, 0, 0, 0, 246, 0, 0, 110, 127, - 114, 247, 129, 222, 223, 224, 300, 254, 0, 0, + 128, 0, 0, 0, 0, 247, 0, 0, 110, 127, + 114, 248, 129, 222, 223, 224, 301, 255, 0, 0, 0, 0, 209, 197, 187, 185, 177, 178, 0, 0, - 0, 0, 232, 130, 0, 0, 0, 113, 135, 139, - 0, 0, 144, 138, 299, 0, 278, 0, 0, 0, - 0, 91, 267, 257, 258, 6, 7, 8, 9, 10, + 0, 0, 91, 130, 0, 0, 0, 113, 135, 139, + 0, 0, 144, 138, 300, 0, 279, 0, 0, 0, + 0, 91, 268, 258, 259, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 52, 53, 54, 55, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, - 0, 266, 253, 91, 270, 0, 296, 204, 201, 200, + 0, 267, 254, 91, 271, 0, 297, 204, 201, 200, 202, 203, 205, 208, 0, 192, 194, 190, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 188, 0, 0, 0, 0, 0, 134, - 220, 143, 141, 0, 0, 284, 277, 260, 259, 0, - 0, 72, 76, 71, 75, 70, 74, 69, 73, 77, - 78, 0, 0, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 0, 50, 51, 46, 47, 48, 49, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 0, 101, 101, 305, 0, 0, 294, 0, 0, 0, + 0, 0, 0, 188, 233, 0, 0, 0, 0, 0, + 134, 220, 143, 141, 0, 0, 285, 278, 261, 260, + 0, 0, 72, 76, 71, 75, 70, 74, 69, 73, + 77, 78, 0, 0, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 50, 51, 46, 47, 48, + 49, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 0, 101, 101, 306, 0, 0, 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 206, 106, 106, 106, 160, 161, 4, - 5, 158, 159, 162, 157, 153, 154, 0, 0, 0, + 0, 0, 0, 0, 206, 106, 106, 106, 160, 161, + 4, 5, 158, 159, 162, 157, 153, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 156, 155, 106, 112, 112, 137, 0, - 140, 219, 213, 216, 217, 0, 0, 131, 235, 236, - 237, 242, 238, 239, 240, 241, 233, 0, 244, 249, - 248, 250, 0, 261, 0, 0, 0, 0, 0, 301, - 0, 303, 298, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 156, 155, 106, 112, 112, 137, + 0, 140, 219, 213, 216, 217, 0, 0, 131, 236, + 237, 238, 243, 239, 240, 241, 242, 234, 0, 245, + 250, 249, 251, 0, 262, 0, 0, 0, 0, 0, + 302, 0, 304, 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 207, 0, 193, 195, 191, 0, 0, 0, 0, 0, - 0, 0, 146, 176, 0, 0, 0, 150, 0, 147, - 0, 0, 0, 0, 0, 189, 132, 133, 136, 212, - 214, 0, 104, 142, 234, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 308, 0, 0, 0, - 288, 291, 0, 0, 289, 290, 0, 0, 0, 285, - 286, 0, 306, 0, 0, 0, 108, 106, 0, 0, - 298, 0, 0, 0, 0, 0, 145, 135, 114, 0, - 148, 149, 0, 0, 0, 0, 0, 218, 215, 105, - 99, 0, 243, 0, 0, 276, 0, 0, 101, 102, - 101, 273, 297, 0, 0, 0, 0, 0, 279, 280, - 281, 276, 0, 103, 109, 107, 0, 0, 0, 0, - 0, 0, 0, 175, 152, 0, 0, 0, 0, 0, - 0, 0, 221, 0, 0, 0, 275, 0, 282, 283, - 0, 302, 304, 0, 0, 0, 287, 292, 293, 0, - 307, 0, 0, 164, 0, 0, 0, 0, 151, 0, - 0, 0, 0, 0, 100, 245, 0, 0, 0, 274, - 271, 0, 295, 0, 0, 0, 172, 0, 0, 166, - 167, 168, 171, 163, 0, 264, 0, 0, 0, 272, - 169, 170, 0, 0, 0, 262, 0, 263, 0, 0, - 165, 173, 174, 0, 0, 0, 0, 0, 0, 269, - 0, 0, 268, 265 + 0, 207, 0, 193, 195, 191, 0, 0, 0, 0, + 0, 0, 0, 146, 176, 0, 0, 0, 150, 0, + 147, 0, 0, 0, 0, 0, 189, 132, 133, 136, + 212, 214, 0, 104, 142, 235, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 309, 0, 0, + 0, 289, 292, 0, 0, 290, 291, 0, 0, 0, + 286, 287, 0, 307, 0, 0, 0, 108, 106, 0, + 0, 299, 0, 0, 0, 0, 0, 145, 135, 114, + 0, 148, 149, 0, 0, 0, 0, 0, 218, 215, + 105, 99, 0, 244, 0, 0, 277, 0, 0, 101, + 102, 101, 274, 298, 0, 0, 0, 0, 0, 280, + 281, 282, 277, 0, 103, 109, 107, 0, 0, 0, + 0, 0, 0, 0, 175, 152, 0, 0, 0, 0, + 0, 0, 0, 221, 0, 0, 0, 276, 0, 283, + 284, 0, 303, 305, 0, 0, 0, 288, 293, 294, + 0, 308, 0, 0, 164, 0, 0, 0, 0, 151, + 0, 0, 0, 0, 0, 100, 246, 0, 0, 0, + 275, 272, 0, 296, 0, 0, 0, 172, 0, 0, + 166, 167, 168, 171, 163, 0, 265, 0, 0, 0, + 273, 169, 170, 0, 0, 0, 263, 0, 264, 0, + 0, 165, 173, 174, 0, 0, 0, 0, 0, 0, + 270, 0, 0, 269, 266 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short int yydefgoto[] = { - -1, 85, 311, 328, 329, 330, 263, 280, 331, 332, - 219, 220, 251, 221, 25, 15, 37, 522, 369, 456, - 480, 392, 457, 86, 87, 222, 89, 90, 120, 233, - 403, 358, 404, 108, 1, 2, 3, 335, 306, 304, - 305, 63, 200, 50, 103, 204, 91, 420, 343, 344, - 345, 38, 95, 16, 44, 17, 61, 18, 28, 425, - 359, 92, 361, 491, 19, 40, 41, 191, 192, 577, - 97, 286, 526, 527, 193, 194, 436, 195, 196 + -1, 85, 312, 329, 330, 331, 264, 281, 332, 333, + 219, 220, 252, 221, 25, 15, 37, 523, 370, 457, + 481, 393, 458, 86, 87, 222, 89, 90, 120, 234, + 404, 359, 405, 108, 1, 2, 3, 336, 307, 305, + 306, 63, 200, 50, 103, 204, 91, 421, 344, 345, + 346, 38, 95, 16, 44, 17, 61, 18, 28, 112, + 426, 360, 92, 362, 492, 19, 40, 41, 191, 192, + 578, 97, 287, 527, 528, 193, 194, 437, 195, 196 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -541 +#define YYPACT_NINF -555 static const short int yypact[] = { - -541, 28, 61, 478, -541, -541, -541, -541, -541, -541, - -541, -541, -541, -541, 23, 152, 45, -541, -541, -9, - -541, -541, -20, -51, 76, 69, 12, -541, 97, 149, - 172, -541, -541, -541, -541, -541, -541, 1331, -19, -541, - -541, 137, -541, -541, -541, -541, 49, 58, 60, 62, - -541, 72, 149, 1331, 88, 88, 88, 88, -541, -541, - -541, 152, -541, -541, -541, -541, -541, 75, -541, -541, - -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, - -541, 227, 228, 3, 691, -541, 137, 79, -541, -541, - -46, -541, -541, -541, -541, -541, 1585, -541, 212, 136, - 233, 214, 216, -541, -541, -541, -541, -541, 1392, 1392, - 1392, 1433, -541, -541, 83, 87, 711, -541, -541, -46, - -70, 89, 777, -541, -541, 1392, -541, 183, 1453, 6, - 309, 152, -541, -541, -541, -541, -541, -541, -541, -541, - -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, - -541, -541, -541, -541, -541, -541, -541, -541, -541, 59, - 142, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, - 1392, 1392, 1392, -541, -541, -541, -541, -541, -541, -541, - -541, -541, -541, -541, -541, -541, 1392, 1392, 1392, 1392, - 1392, -541, -541, 152, -541, 86, -541, -541, -541, -541, - -541, -541, -541, -541, -129, -541, -541, -541, 169, 196, - 242, 200, 246, 203, 252, 205, 253, 251, 258, 221, - 255, 259, 533, -541, 1392, 1392, 99, -63, 1392, -541, - 1173, -541, 128, 126, 894, -541, -541, 75, -541, 894, - 894, -541, -541, -541, -541, -541, -541, -541, -541, -541, - -541, 894, 1331, -541, -541, -541, -541, -541, -541, -541, - -541, -541, -541, 1392, -541, -541, -541, -541, -541, -541, - -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, - 1392, 130, 133, -541, 894, 132, 138, 139, 143, 144, - 151, 155, 156, 157, 894, 894, 894, 163, 254, 1331, - 1392, 1392, 271, -541, 164, 164, 164, -541, -541, -541, - -541, -541, -541, -541, -541, -541, -541, 59, 142, 173, - 174, 175, 176, 177, 1214, 1494, 732, 281, 178, 179, - 180, 182, 190, -541, -541, 164, -42, -135, -541, 166, - -46, -541, 137, -541, 193, 191, 1234, -541, -541, -541, - -541, -541, -541, -541, -541, -541, 290, 1433, -541, -541, - -541, -541, 201, -541, 202, 894, 894, 894, 7, -541, - 10, -541, 204, 894, 199, 1392, 1392, 1392, 1392, 1392, - 1392, 1392, 211, 215, 217, 1392, 1392, 894, 894, 223, - -541, -21, -541, -541, -541, 210, 219, 1433, 1433, 1433, - 1433, 1433, -541, -541, 4, 752, -91, -541, -8, -541, - 1433, 1433, 1433, 1433, 1433, -541, -541, -541, -541, -541, - -541, 1275, 324, -541, -541, 343, 37, 348, 356, 224, - 225, 229, 894, 376, 894, 1392, -541, 230, 894, 232, - -541, -541, 234, 235, -541, -541, 894, 894, 894, -541, - -541, 226, -541, 1392, 362, 385, -541, 164, 1433, 1433, - 204, 238, 239, 240, 241, 1433, -541, 243, -17, -5, - -541, -541, 247, 250, 261, 262, 359, -541, -541, -541, - 339, 268, -541, 894, 894, 1392, 894, 894, 269, -541, - 269, -541, 270, 894, 272, 1392, 1392, 1392, -541, -541, - -541, 1392, 894, -541, -541, -541, 273, 274, 249, 1433, - 1433, 1433, 1433, -541, -541, 245, 1433, 1433, 1433, 1433, - 1392, 395, -541, 383, 275, 267, 270, 279, -541, -541, - 351, -541, -541, 1392, 277, 894, -541, -541, -541, 282, - -541, 1433, 1433, -541, 278, 283, 284, 288, -541, 289, - 291, 295, 296, 297, -541, -541, 423, 43, 410, -541, - -541, 298, -541, 300, 305, 1433, -541, 1433, 1433, -541, - -541, -541, -541, -541, 894, -541, 1020, 64, 441, -541, - -541, -541, 307, 311, 314, -541, 312, -541, 1020, 894, - -541, -541, -541, 450, 319, 150, 894, 452, 453, -541, - 894, 894, -541, -541 + -555, 136, 58, 247, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, 96, 181, 141, -555, -555, -9, + -555, -555, 16, 7, 114, 65, 39, -555, 50, 188, + 210, -555, -555, -555, -555, -555, -555, 1357, -19, -555, + -555, 134, -555, -555, -555, -555, 68, 69, 70, 73, + -555, 60, 188, 1357, 4, 4, 4, 4, -555, -555, + -555, -555, -555, -555, -555, -555, -555, 63, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, 222, 224, 1, 171, -555, 134, 84, -555, -555, + -103, -555, -555, -555, -555, -555, 1611, -555, 216, 66, + 238, 219, 233, -555, -555, -555, -555, -555, 1418, 1418, + 1418, 1459, 181, -555, 100, 101, 737, -555, -555, -103, + -112, 105, 803, -555, -555, 1418, -555, 202, 1479, 13, + 221, 181, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, 77, + 377, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, + 1418, 1418, 1418, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, 1418, 1418, 1418, 1418, + 1418, -555, -555, 181, -555, 33, -555, -555, -555, -555, + -555, -555, -555, -555, -15, -555, -555, -555, 36, 158, + 262, 164, 264, 167, 266, 169, 268, 269, 270, 204, + 271, 274, 579, -555, -555, 1418, 1418, 121, -67, 1418, + -555, 1199, -555, 120, 127, 920, -555, -555, 63, -555, + 920, 920, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, 920, 1357, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, 1418, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, 1418, 142, 143, -555, 920, 147, 153, 154, 155, + 157, 165, 166, 168, 170, 920, 920, 920, 173, 275, + 1357, 1418, 1418, 293, -555, 174, 174, 174, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, 77, 377, + 175, 177, 180, 182, 183, 1240, 1520, 757, 296, 192, + 193, 199, 203, 207, -555, -555, 174, -45, -71, -555, + 161, -103, -555, 134, -555, 176, 209, 1260, -555, -555, + -555, -555, -555, -555, -555, -555, -555, 261, 1459, -555, + -555, -555, -555, 206, -555, 213, 920, 920, 920, -2, + -555, 0, -555, 215, 920, 179, 1418, 1418, 1418, 1418, + 1418, 1418, 1418, 217, 218, 223, 1418, 1418, 920, 920, + 226, -555, -17, -555, -555, -555, 214, 220, 1459, 1459, + 1459, 1459, 1459, -555, -555, -13, 778, -94, -555, -40, + -555, 1459, 1459, 1459, 1459, 1459, -555, -555, -555, -555, + -555, -555, 1301, 346, -555, -555, 357, -69, 361, 362, + 229, 234, 235, 920, 382, 920, 1418, -555, 236, 920, + 237, -555, -555, 239, 240, -555, -555, 920, 920, 920, + -555, -555, 241, -555, 1418, 367, 390, -555, 174, 1459, + 1459, 215, 242, 245, 248, 249, 1459, -555, 254, -16, + -8, -555, -555, 250, 253, 263, 272, 364, -555, -555, + -555, 366, 273, -555, 920, 920, 1418, 920, 920, 276, + -555, 276, -555, 279, 920, 280, 1418, 1418, 1418, -555, + -555, -555, 1418, 920, -555, -555, -555, 281, 282, 283, + 1459, 1459, 1459, 1459, -555, -555, 284, 1459, 1459, 1459, + 1459, 1418, 423, -555, 416, 288, 285, 279, 290, -555, + -555, 391, -555, -555, 1418, 294, 920, -555, -555, -555, + 291, -555, 1459, 1459, -555, 299, 298, 302, 303, -555, + 301, 306, 307, 308, 310, -555, -555, 437, 15, 432, + -555, -555, 312, -555, 316, 319, 1459, -555, 1459, 1459, + -555, -555, -555, -555, -555, 920, -555, 1046, 64, 460, + -555, -555, -555, 326, 329, 331, -555, 335, -555, 1046, + 920, -555, -555, -555, 468, 337, 132, 920, 470, 472, + -555, 920, 920, -555, -555 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { - -541, -541, -541, 379, 380, 381, 161, 162, 386, 388, - -128, -127, -540, -541, 438, 456, -111, -541, -277, 63, - -541, -297, -541, -47, -541, -37, -541, -53, 40, -541, - -99, 264, -307, 84, -541, -541, -541, -541, -541, -541, - -541, 435, -541, -541, -541, -541, 8, -541, 68, -541, - -541, 427, -541, -541, -541, -541, -541, 487, -541, -541, - -489, -199, 67, -124, -541, 472, -541, -103, -541, -541, - -541, -541, 71, -7, -541, -541, 33, -541, -541 + -555, -555, -555, 398, 399, 400, 198, 200, 402, 403, + -128, -127, -525, -555, 476, 493, -111, -555, -276, 97, + -555, -298, -555, -47, -555, -37, -555, -60, -62, -555, + -99, 300, -308, 61, -555, -555, -555, -555, -555, -555, + -555, 469, -555, -555, -555, -555, 8, -555, 102, -555, + -555, 411, -555, -555, -555, -555, -555, 523, -555, -555, + -555, -554, -11, 112, -124, -555, 508, -555, -68, -555, + -555, -555, -555, 93, 28, -555, -555, 71, -555, -555 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -2568,291 +2591,284 @@ static const short int yypgoto[] = #define YYTABLE_NINF -180 static const short int yytable[] = { - 88, 235, 249, 250, 238, 371, 105, 115, 393, 394, - 93, 26, 223, 454, 39, 239, 88, 576, 406, 408, - 252, 42, 432, 334, 302, 434, 417, 240, 4, 123, - 303, 119, 46, 47, 48, 360, 455, 588, 415, 283, - 360, 360, 287, 288, 289, 290, 291, 292, 293, 26, - 426, 49, 360, 241, 242, 243, 244, 245, 246, 247, - 248, -179, 465, 119, 433, 297, 298, 433, 39, 119, - 470, 205, 206, 207, 241, 242, 243, 244, 245, 246, - 247, 248, 299, 228, 29, 360, 5, 586, 234, 53, - 228, 234, 6, 229, 121, 360, 360, 360, 469, 594, - 339, 51, 7, 8, 9, 10, 11, 12, 13, -112, - 7, 8, 9, 10, 54, 12, 55, 416, 123, 56, - 106, 107, 123, 14, 281, 282, 234, 284, 285, 234, - 234, 234, 234, 234, 234, 234, -139, 52, -112, 109, - 110, 111, 59, 94, 60, 465, -139, 123, 465, 294, - 295, 296, 234, 234, 43, 471, 227, 465, 515, 20, - 505, 21, 232, 466, 58, 116, 360, 360, 360, 264, - 265, 336, 337, 62, 360, 340, 64, 389, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 360, 360, - 465, 198, 199, 342, 300, 301, 307, 308, 482, -72, - -72, 98, 575, -71, -71, 365, -70, -70, -69, -69, - 99, 531, 100, 532, 101, 88, 30, 31, 32, 33, - 34, 35, 36, 587, 309, 310, 366, 133, 134, 102, - -113, 113, 114, 360, 122, 360, 197, 201, 202, 360, - 203, 224, 236, 367, 230, 225, -76, 360, 360, 360, - -75, 439, 387, 441, 442, 443, -74, -73, -79, 312, - 338, 449, 88, 388, 234, -80, 313, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 346, 347, 368, 360, 360, 370, 360, 360, 373, - 386, 374, 375, 340, 360, 390, 376, 377, 460, 461, - 462, 463, 464, 360, 378, 409, 362, 363, 379, 380, - 381, 472, 473, 474, 475, 476, 385, 391, 364, 241, - 242, 243, 244, 245, 246, 247, 248, 418, 397, 398, - 399, 400, 401, 410, 411, 412, 360, 413, 234, 440, - 234, 234, 234, 444, 445, 414, 421, 422, 234, 450, - 419, 372, 468, 424, 427, 428, 438, 435, 454, 506, - 507, 382, 383, 384, 446, 458, 513, 481, 447, 483, - 448, 536, 537, 538, 459, 360, 453, 484, 486, 485, - 489, 501, 487, 493, 342, 495, 503, 496, 497, 504, - 360, 509, 510, 511, 512, 520, 521, 360, 234, 554, - 516, 360, 360, 517, 514, 543, 548, 555, 433, 559, - 544, 545, 546, 547, 518, 519, 502, 549, 550, 551, - 552, 523, 530, 533, 557, 535, 541, 542, 556, 249, - 250, 565, 429, 430, 431, 558, 560, 567, 562, 566, - 437, 568, 563, 564, 574, 569, 578, 570, 234, 249, - 250, 571, 572, 573, 451, 452, 580, 579, 234, 234, - 234, 581, 589, 590, 234, 593, 582, 591, 583, 584, - 592, 596, 597, 600, 601, 186, 187, 188, 395, 96, - 396, 57, 189, 553, 190, 479, 333, 104, 112, 478, - 27, 45, 598, 508, 539, 0, 234, 0, -82, 488, - 20, 490, 21, 0, 0, 494, 492, 0, 0, 6, - -82, -82, 0, 498, 499, 500, 0, 0, 0, -82, - -82, -82, -82, -82, -82, -82, 0, 0, -82, 22, - 0, 0, 0, 0, 0, 0, 23, 0, 65, 66, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 524, 525, 0, 528, 529, 20, 0, 21, 0, 314, - 534, 0, 0, 0, 0, 0, 0, 0, 0, 540, - 0, 315, 316, 0, 0, 0, 0, 0, 0, 0, + 88, 236, 250, 251, 239, 115, 105, 372, 394, 395, + 93, 26, 223, 433, 39, 435, 88, 455, 407, 409, + 253, 42, 240, 587, 119, 242, 243, 244, 245, 246, + 247, 248, 249, 577, 241, 595, 106, 107, 416, 284, + 456, 229, 288, 289, 290, 291, 292, 293, 294, 26, + 427, 230, -112, 589, 228, 434, 119, 434, -179, 466, + 233, 123, 119, 308, 309, 298, 299, 471, 46, 47, + 48, 205, 206, 207, 242, 243, 244, 245, 246, 247, + 248, 249, 300, 5, 466, 53, 229, 49, 235, 6, + 418, 235, 483, 123, 121, 59, 340, 60, 470, 7, + 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, + 54, 12, 55, 466, 417, 56, 109, 110, 111, 123, + 14, 198, 199, 472, 282, 283, 235, 285, 286, 235, + 235, 235, 235, 235, 235, 235, 4, -139, 303, -112, + 466, 301, 302, 94, 304, 466, 467, -139, 123, 295, + 296, 297, 235, 235, 43, 516, 20, 29, 21, 51, + 506, -72, -72, 116, 39, 337, 338, -71, -71, 341, + -70, -70, -69, -69, 576, 52, 65, 66, 390, 117, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 58, 79, 20, 343, 21, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 366, 310, 311, 133, + 134, 335, 62, 532, 64, 533, 88, 102, -113, 80, + 98, 99, 100, 588, 361, 101, 113, 367, 114, 361, + 361, 242, 243, 244, 245, 246, 247, 248, 249, 122, + 197, 361, 201, 202, 368, 30, 31, 32, 33, 34, + 35, 36, 440, 388, 442, 443, 444, 203, 225, 226, + 231, 237, 450, 88, 389, 235, -76, -82, -75, 20, + -74, 21, -73, 347, 361, 313, -79, -80, 6, -82, + -82, 314, 339, 348, 361, 361, 361, 341, -82, -82, + -82, -82, -82, -82, -82, 369, 371, -82, 22, 461, + 462, 463, 464, 465, 374, 23, 375, 376, 377, 24, + 378, 387, 473, 474, 475, 476, 477, 391, 379, 380, + 410, 381, 419, 382, 425, 81, 386, 392, 82, 422, + 398, 83, 399, 84, 118, 400, 439, 401, 402, 235, + 441, 235, 235, 235, 445, 446, 469, 411, 412, 235, + 451, 420, 363, 364, 413, 361, 361, 361, 414, 428, + 507, 508, 415, 361, 365, 423, 429, 514, 436, 459, + 447, 448, 537, 538, 539, 460, 449, 361, 361, 454, + 455, 482, 484, 485, 486, 343, 490, 487, 488, 494, + 496, 504, 497, 498, 505, 510, 502, 373, 511, 235, + 521, 512, 513, 517, 265, 266, 518, 383, 384, 385, + 560, 545, 546, 547, 548, 515, 519, 503, 550, 551, + 552, 553, 361, 522, 361, 520, 524, 555, 361, 531, + 250, 251, 534, 536, 542, 543, 361, 361, 361, 544, + 556, 557, 558, 564, 565, 549, 559, 563, 434, 235, + 250, 251, 566, 561, 567, 568, 569, 570, 575, 235, + 235, 235, 571, 572, 573, 235, 574, 583, 579, 584, + 585, 580, 581, 361, 361, 582, 361, 361, 430, 431, + 432, 590, 591, 361, 554, 592, 438, 593, 594, 597, + 598, 601, 361, 602, 186, 187, 188, 235, 189, 190, + 452, 453, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 396, 96, 57, 397, + 480, 104, 334, 224, 479, 361, 27, 45, 599, 493, + 540, 0, 509, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 489, 0, 491, 0, 0, + 0, 495, 0, 0, 0, 0, 0, 0, 0, 499, + 500, 501, 0, 0, 361, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 361, + 0, 0, 0, 0, 65, 66, 361, 0, 0, 0, + 361, 361, 0, 0, 0, 0, 525, 526, 0, 529, + 530, 20, 0, 21, 0, 315, 535, 0, 0, 0, + 0, 0, 0, 0, 0, 541, 0, 316, 317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 561, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 317, 318, 0, 0, - 0, 585, 0, 319, 0, 320, 0, 321, 322, 323, - 0, 0, 0, 0, 0, 0, 595, 0, 0, 0, - 0, 0, 0, 599, 0, 0, 0, 602, 603, 0, - 0, 0, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, - 324, 0, 0, 325, 0, 326, 65, 66, 327, 117, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 79, 20, 0, 21, 65, 66, 0, 117, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 79, 20, 0, 21, 0, 65, 66, 80, - 117, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 0, 79, 20, 0, 21, 65, 66, 80, - 117, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 0, 79, 20, 0, 21, 0, 0, 0, - 80, 0, 65, 66, 0, 117, 68, 69, 70, 71, + 0, 0, 0, 0, 0, 0, 0, 0, 562, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 318, 319, 0, 0, 0, 586, 0, 320, + 0, 321, 0, 322, 323, 324, 0, 0, 0, 0, + 0, 0, 596, 0, 0, 0, 0, 0, 0, 600, + 0, 0, 0, 603, 604, 0, 0, 0, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 0, 0, 0, 0, 0, 325, 0, 0, 326, + 0, 327, 65, 66, 328, 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, - 80, 21, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, + 0, 21, 65, 66, 0, 117, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 0, 79, 20, + 0, 21, 0, 65, 66, 80, 117, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 0, 79, + 20, 0, 21, 0, 0, 80, 0, 0, 65, 66, + 0, 117, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 0, 79, 20, 80, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, - 0, 83, 0, 84, 118, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, - 0, 83, 0, 84, 226, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 81, 0, 0, 82, - 0, 0, 83, 0, 84, 407, 0, 348, 349, 65, - 66, 350, 0, 0, 0, 0, 81, 0, 0, 82, - 0, 0, 83, 0, 84, 467, 20, 0, 21, 0, - 351, 352, 353, 0, 0, 0, 0, 0, 0, 0, - 0, 81, 354, 355, 82, 0, 0, 83, 0, 84, + 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 317, 318, 0, - 0, 0, 0, 0, 319, 0, 320, 0, 321, 322, - 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 348, 349, 0, 0, 350, 0, 0, - 0, 0, 0, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 351, 352, 353, 0, - 0, 0, 0, 0, 357, 0, 0, 0, 354, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 408, 0, 0, 349, 350, 65, 66, 351, 0, 0, + 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, + 84, 468, 20, 0, 21, 0, 352, 353, 354, 0, + 0, 0, 0, 0, 0, 0, 0, 81, 355, 356, + 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 356, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 317, 318, 0, 0, 0, 0, 0, - 319, 0, 320, 0, 321, 322, 323, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, + 156, 157, 158, 318, 319, 0, 0, 0, 0, 0, + 320, 0, 321, 0, 322, 323, 324, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, + 350, 0, 0, 351, 0, 0, 0, 0, 0, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 0, 0, 0, 0, 0, 0, 65, 66, - 357, 117, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, + 184, 185, 352, 353, 354, 0, 0, 0, 0, 0, + 358, 0, 0, 0, 355, 356, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 341, 0, 0, 0, 0, 0, 0, 0, 0, 65, - 66, 80, 117, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 0, 79, 20, 0, 21, 65, - 66, 0, 117, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 0, 79, 20, 0, 21, 0, - 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, - 0, 423, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 66, 80, 117, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, + 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 318, + 319, 0, 0, 0, 0, 0, 320, 0, 321, 0, + 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 477, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 80, 0, 0, 0, 81, 0, 0, - 82, 0, 0, 83, 0, 84, 65, 66, 0, 67, + 0, 0, 0, 0, 0, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, + 0, 0, 0, 0, 65, 66, 358, 117, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, + 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 0, 79, 20, 0, 21, 65, 66, 0, 117, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 0, 79, 20, 0, 21, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, 0, 424, 0, 0, + 0, 0, 0, 0, 0, 0, 65, 66, 80, 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, - 0, 82, 0, 402, 83, 0, 84, 0, 0, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, - 0, 82, 0, 0, 83, 0, 84, 65, 66, 0, - 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 0, 79, 20, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, - 0, 0, 82, 0, 0, 83, 0, 84, 65, 66, - 80, 117, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 0, 79, 20, 0, 21, 65, 66, - 0, 237, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 0, 79, 20, 0, 21, 0, 0, - 0, 80, 0, 0, 0, 81, 0, 0, 82, 0, - 0, 83, 0, 84, 0, 0, 0, 0, 0, 65, - 66, 80, 117, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 0, 79, 20, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 65, 66, 0, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 0, 0, 82, 0, 403, + 83, 0, 84, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 0, 0, 82, 0, 0, + 83, 0, 84, 65, 66, 0, 117, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, + 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, + 0, 83, 0, 84, 65, 66, 80, 117, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, + 79, 20, 0, 21, 65, 66, 0, 238, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, + 79, 20, 0, 21, 0, 0, 0, 80, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 0, 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, + 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, + 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 80, 0, 0, 0, 81, 0, 0, 82, - 0, 0, 83, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 0, 0, 0, 0, 124, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 126, 127, 0, 0, 81, 0, 0, 82, 0, 0, + 83, 0, 406, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 0, + 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, - 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, - 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, - 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 126, 127, 0, 0, 81, 0, - 0, 82, 0, 0, 83, 0, 405, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 0, 0, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185 + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 }; static const short int yycheck[] = { - 37, 125, 130, 130, 128, 282, 53, 4, 305, 306, - 29, 3, 111, 34, 23, 9, 53, 557, 325, 326, - 131, 30, 15, 222, 153, 15, 161, 21, 0, 164, - 159, 84, 52, 53, 54, 234, 57, 577, 335, 163, - 239, 240, 166, 167, 168, 169, 170, 171, 172, 41, - 357, 71, 251, 10, 11, 12, 13, 14, 15, 16, - 17, 0, 153, 116, 57, 189, 190, 57, 23, 122, - 161, 108, 109, 110, 10, 11, 12, 13, 14, 15, - 16, 17, 193, 153, 61, 284, 25, 576, 125, 20, - 153, 128, 31, 163, 86, 294, 295, 296, 405, 588, - 163, 152, 41, 42, 43, 44, 45, 46, 47, 155, - 41, 42, 43, 44, 45, 46, 47, 159, 164, 50, - 32, 33, 164, 62, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 153, 61, 155, 55, - 56, 57, 45, 162, 47, 153, 163, 164, 153, 186, - 187, 188, 189, 190, 163, 163, 116, 153, 163, 22, - 457, 24, 122, 159, 152, 162, 365, 366, 367, 27, - 28, 224, 225, 24, 373, 228, 4, 301, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 387, 388, - 153, 55, 56, 230, 108, 109, 27, 28, 161, 3, - 4, 152, 159, 3, 4, 252, 3, 4, 3, 4, - 152, 488, 152, 490, 152, 252, 64, 65, 66, 67, - 68, 69, 70, 159, 3, 4, 263, 77, 78, 157, - 155, 4, 4, 432, 155, 434, 24, 4, 24, 438, - 24, 158, 59, 280, 155, 158, 4, 446, 447, 448, - 4, 375, 299, 377, 378, 379, 4, 4, 7, 4, - 161, 385, 299, 300, 301, 7, 7, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 153, 156, 153, 483, 484, 153, 486, 487, 157, - 36, 153, 153, 346, 493, 24, 153, 153, 397, 398, - 399, 400, 401, 502, 153, 24, 239, 240, 153, 153, - 153, 410, 411, 412, 413, 414, 153, 153, 251, 10, - 11, 12, 13, 14, 15, 16, 17, 161, 155, 155, - 155, 155, 155, 155, 155, 155, 535, 155, 375, 376, - 377, 378, 379, 380, 381, 155, 153, 156, 385, 386, - 342, 284, 405, 63, 153, 153, 157, 153, 34, 458, - 459, 294, 295, 296, 153, 155, 465, 24, 153, 21, - 153, 495, 496, 497, 155, 574, 153, 21, 153, 155, - 4, 155, 153, 153, 421, 153, 24, 153, 153, 4, - 589, 153, 153, 153, 153, 36, 57, 596, 435, 4, - 153, 600, 601, 153, 161, 156, 161, 24, 57, 533, - 509, 510, 511, 512, 153, 153, 453, 516, 517, 518, - 519, 153, 153, 153, 157, 153, 153, 153, 153, 557, - 557, 153, 365, 366, 367, 156, 159, 153, 156, 156, - 373, 153, 541, 542, 21, 156, 36, 156, 485, 577, - 577, 156, 156, 156, 387, 388, 156, 159, 495, 496, - 497, 156, 21, 156, 501, 153, 565, 156, 567, 568, - 156, 21, 153, 21, 21, 96, 96, 96, 317, 41, - 318, 25, 96, 520, 96, 422, 222, 52, 61, 421, - 3, 19, 595, 460, 501, -1, 533, -1, 20, 432, - 22, 434, 24, -1, -1, 438, 435, -1, -1, 31, - 32, 33, -1, 446, 447, 448, -1, -1, -1, 41, - 42, 43, 44, 45, 46, 47, -1, -1, 50, 51, - -1, -1, -1, -1, -1, -1, 58, -1, 5, 6, - 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 483, 484, -1, 486, 487, 22, -1, 24, -1, 26, - 493, -1, -1, -1, -1, -1, -1, -1, -1, 502, - -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, + 37, 125, 130, 130, 128, 4, 53, 283, 306, 307, + 29, 3, 111, 15, 23, 15, 53, 34, 326, 327, + 131, 30, 9, 577, 84, 10, 11, 12, 13, 14, + 15, 16, 17, 558, 21, 589, 32, 33, 336, 163, + 57, 153, 166, 167, 168, 169, 170, 171, 172, 41, + 358, 163, 155, 578, 116, 57, 116, 57, 0, 153, + 122, 164, 122, 27, 28, 189, 190, 161, 52, 53, + 54, 108, 109, 110, 10, 11, 12, 13, 14, 15, + 16, 17, 193, 25, 153, 20, 153, 71, 125, 31, + 161, 128, 161, 164, 86, 45, 163, 47, 406, 41, + 42, 43, 44, 45, 46, 47, 41, 42, 43, 44, + 45, 46, 47, 153, 159, 50, 55, 56, 57, 164, + 62, 55, 56, 163, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 153, 153, 155, + 153, 108, 109, 162, 159, 153, 159, 163, 164, 186, + 187, 188, 189, 190, 163, 163, 22, 61, 24, 152, + 458, 3, 4, 162, 23, 225, 226, 3, 4, 229, + 3, 4, 3, 4, 159, 61, 5, 6, 302, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 152, 21, 22, 231, 24, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 253, 3, 4, 77, + 78, 222, 24, 489, 4, 491, 253, 157, 155, 48, + 152, 152, 152, 159, 235, 152, 4, 264, 4, 240, + 241, 10, 11, 12, 13, 14, 15, 16, 17, 155, + 24, 252, 4, 24, 281, 64, 65, 66, 67, 68, + 69, 70, 376, 300, 378, 379, 380, 24, 158, 158, + 155, 59, 386, 300, 301, 302, 4, 20, 4, 22, + 4, 24, 4, 153, 285, 4, 7, 7, 31, 32, + 33, 7, 161, 156, 295, 296, 297, 347, 41, 42, + 43, 44, 45, 46, 47, 153, 153, 50, 51, 398, + 399, 400, 401, 402, 157, 58, 153, 153, 153, 62, + 153, 36, 411, 412, 413, 414, 415, 24, 153, 153, + 24, 153, 161, 153, 63, 154, 153, 153, 157, 153, + 155, 160, 155, 162, 163, 155, 157, 155, 155, 376, + 377, 378, 379, 380, 381, 382, 406, 155, 155, 386, + 387, 343, 240, 241, 155, 366, 367, 368, 155, 153, + 459, 460, 155, 374, 252, 156, 153, 466, 153, 155, + 153, 153, 496, 497, 498, 155, 153, 388, 389, 153, + 34, 24, 21, 21, 155, 422, 4, 153, 153, 153, + 153, 24, 153, 153, 4, 153, 155, 285, 153, 436, + 36, 153, 153, 153, 27, 28, 153, 295, 296, 297, + 534, 510, 511, 512, 513, 161, 153, 454, 517, 518, + 519, 520, 433, 57, 435, 153, 153, 4, 439, 153, + 558, 558, 153, 153, 153, 153, 447, 448, 449, 156, + 24, 153, 157, 542, 543, 161, 156, 156, 57, 486, + 578, 578, 153, 159, 156, 153, 153, 156, 21, 496, + 497, 498, 156, 156, 156, 502, 156, 566, 36, 568, + 569, 159, 156, 484, 485, 156, 487, 488, 366, 367, + 368, 21, 156, 494, 521, 156, 374, 156, 153, 21, + 153, 21, 503, 21, 96, 96, 96, 534, 96, 96, + 388, 389, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 318, 41, 25, 319, + 423, 52, 222, 112, 422, 536, 3, 19, 596, 436, + 502, -1, 461, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 433, -1, 435, -1, -1, + -1, 439, -1, -1, -1, -1, -1, -1, -1, 447, + 448, 449, -1, -1, 575, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 590, + -1, -1, -1, -1, 5, 6, 597, -1, -1, -1, + 601, 602, -1, -1, -1, -1, 484, 485, -1, 487, + 488, 22, -1, 24, -1, 26, 494, -1, -1, -1, + -1, -1, -1, -1, -1, 503, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 535, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, -1, -1, - -1, 574, -1, 110, -1, 112, -1, 114, 115, 116, - -1, -1, -1, -1, -1, -1, 589, -1, -1, -1, - -1, -1, -1, 596, -1, -1, -1, 600, 601, -1, - -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, -1, -1, -1, -1, -1, - 157, -1, -1, 160, -1, 162, 5, 6, 165, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, -1, 21, 22, -1, 24, 5, 6, -1, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, -1, 21, 22, -1, 24, -1, 5, 6, 48, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, -1, 21, 22, -1, 24, 5, 6, 48, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, - 48, -1, 5, 6, -1, 8, 9, 10, 11, 12, + -1, -1, -1, -1, -1, -1, -1, -1, 536, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, -1, -1, -1, 575, -1, 110, + -1, 112, -1, 114, 115, 116, -1, -1, -1, -1, + -1, -1, 590, -1, -1, -1, -1, -1, -1, 597, + -1, -1, -1, 601, 602, -1, -1, -1, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, -1, -1, -1, -1, -1, 157, -1, -1, 160, + -1, 162, 5, 6, 165, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - 48, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, + -1, 24, -1, 5, 6, 48, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, 48, -1, -1, 5, 6, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, -1, 21, 22, 48, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, - -1, 160, -1, 162, 163, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, - -1, 160, -1, 162, 163, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 154, -1, -1, 157, - -1, -1, 160, -1, 162, 163, -1, 3, 4, 5, - 6, 7, -1, -1, -1, -1, 154, -1, -1, 157, - -1, -1, 160, -1, 162, 163, 22, -1, 24, -1, - 26, 27, 28, -1, -1, -1, -1, -1, -1, -1, - -1, 154, 38, 39, 157, -1, -1, 160, -1, 162, + 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, - -1, -1, -1, -1, 110, -1, 112, -1, 114, 115, - 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, -1, -1, 7, -1, -1, - -1, -1, -1, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 26, 27, 28, -1, - -1, -1, -1, -1, 160, -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + 163, -1, -1, 3, 4, 5, 6, 7, -1, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, 163, 22, -1, 24, -1, 26, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, 154, 38, 39, + 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, @@ -2860,66 +2876,79 @@ static const short int yycheck[] = 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, -1, -1, -1, -1, 110, -1, 112, -1, 114, 115, 116, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, -1, -1, 7, -1, -1, -1, -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, -1, -1, -1, -1, -1, -1, 5, 6, - 160, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, + 150, 151, 26, 27, 28, -1, -1, -1, -1, -1, + 160, -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 37, -1, -1, -1, -1, -1, -1, -1, -1, 5, - 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, -1, 21, 22, -1, 24, 5, - 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, - -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, - -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, - 5, 6, 48, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, + -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 48, -1, -1, -1, 154, -1, -1, - 157, -1, -1, 160, -1, 162, 5, 6, -1, 8, + -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, -1, -1, -1, -1, -1, 110, -1, 112, -1, + 114, 115, 116, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, -1, -1, + -1, -1, -1, -1, 5, 6, 160, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, + -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, 5, 6, -1, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, -1, -1, -1, 48, -1, + -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 154, -1, - -1, 157, -1, 159, 160, -1, 162, -1, -1, 48, - -1, -1, -1, -1, -1, -1, -1, -1, 154, -1, - -1, 157, -1, -1, 160, -1, 162, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, -1, 21, 22, -1, 24, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 154, - -1, -1, 157, -1, -1, 160, -1, 162, 5, 6, - 48, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, -1, 21, 22, -1, 24, 5, 6, - -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, -1, 21, 22, -1, 24, -1, -1, - -1, 48, -1, -1, -1, 154, -1, -1, 157, -1, - -1, 160, -1, 162, -1, -1, -1, -1, -1, 5, - 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, -1, 21, 22, -1, 24, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 154, -1, -1, 157, -1, 159, + 160, -1, 162, -1, -1, 48, -1, -1, -1, -1, + -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, + 160, -1, 162, 5, 6, -1, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, + -1, 160, -1, 162, 5, 6, 48, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 48, -1, -1, -1, 154, -1, -1, 157, - -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 154, -1, -1, - 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 154, -1, -1, - 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, 60, -1, -1, 154, -1, - -1, 157, -1, -1, 160, -1, 162, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, -1, -1, 110, 111, 112, 113, 114, - 115, 116, 117, 118, -1, -1, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, -1, -1, 154, -1, -1, 157, -1, -1, + 160, -1, 162, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, -1, + -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2927,17 +2956,17 @@ static const short int yycheck[] = static const unsigned char yystos[] = { 0, 200, 201, 202, 0, 25, 31, 41, 42, 43, - 44, 45, 46, 47, 62, 181, 219, 221, 223, 230, + 44, 45, 46, 47, 62, 181, 219, 221, 223, 231, 22, 24, 51, 58, 62, 180, 212, 223, 224, 61, 64, 65, 66, 67, 68, 69, 70, 182, 217, 23, - 231, 232, 30, 163, 220, 231, 52, 53, 54, 71, + 232, 233, 30, 163, 220, 232, 52, 53, 54, 71, 209, 152, 61, 20, 45, 47, 50, 181, 152, 45, 47, 222, 24, 207, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 48, 154, 157, 160, 162, 167, 189, 190, 191, 192, - 193, 212, 227, 29, 162, 218, 180, 236, 152, 152, + 193, 212, 228, 29, 162, 218, 180, 237, 152, 152, 152, 152, 157, 210, 207, 189, 32, 33, 199, 199, - 199, 199, 217, 4, 4, 4, 162, 8, 163, 193, + 199, 199, 225, 4, 4, 4, 162, 8, 163, 193, 194, 212, 155, 164, 35, 49, 59, 60, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, @@ -2945,48 +2974,48 @@ static const unsigned char yystos[] = 104, 105, 106, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 169, 170, 171, 174, - 175, 233, 234, 240, 241, 243, 244, 24, 55, 56, + 175, 234, 235, 241, 242, 244, 245, 24, 55, 56, 208, 4, 24, 24, 211, 191, 191, 191, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 176, - 177, 179, 191, 196, 158, 158, 163, 194, 153, 163, - 155, 37, 194, 195, 191, 229, 59, 8, 229, 9, - 21, 10, 11, 12, 13, 14, 15, 16, 17, 176, - 177, 178, 182, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 172, 27, 28, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 173, 191, 191, 229, 191, 191, 237, 229, 229, 229, - 229, 229, 229, 229, 191, 191, 191, 229, 229, 182, - 108, 109, 153, 159, 205, 206, 204, 27, 28, 3, - 4, 168, 4, 7, 26, 38, 39, 103, 104, 110, - 112, 114, 115, 116, 157, 160, 162, 165, 169, 170, - 171, 174, 175, 197, 227, 203, 193, 193, 161, 163, - 193, 37, 191, 214, 215, 216, 153, 156, 3, 4, - 7, 26, 27, 28, 38, 39, 61, 160, 197, 226, - 227, 228, 228, 228, 228, 189, 191, 191, 153, 184, - 153, 184, 228, 157, 153, 153, 153, 153, 153, 153, - 153, 153, 228, 228, 228, 153, 36, 189, 191, 229, - 24, 153, 187, 187, 187, 172, 173, 155, 155, 155, - 155, 155, 159, 196, 198, 162, 198, 163, 198, 24, - 155, 155, 155, 155, 155, 187, 159, 161, 161, 212, - 213, 153, 156, 37, 63, 225, 198, 153, 153, 228, - 228, 228, 15, 57, 15, 153, 242, 228, 157, 229, - 191, 229, 229, 229, 191, 191, 153, 153, 153, 229, - 191, 228, 228, 153, 34, 57, 185, 188, 155, 155, - 196, 196, 196, 196, 196, 153, 159, 163, 193, 198, - 161, 163, 196, 196, 196, 196, 196, 37, 214, 185, - 186, 24, 161, 21, 21, 155, 153, 153, 228, 4, - 228, 229, 238, 153, 228, 153, 153, 153, 228, 228, - 228, 155, 191, 24, 4, 187, 196, 196, 242, 153, - 153, 153, 153, 196, 161, 163, 153, 153, 153, 153, - 36, 57, 183, 153, 228, 228, 238, 239, 228, 228, - 153, 184, 184, 153, 228, 153, 229, 229, 229, 239, - 228, 153, 153, 156, 196, 196, 196, 196, 161, 196, - 196, 196, 196, 191, 4, 24, 153, 157, 156, 229, - 159, 228, 156, 196, 196, 153, 156, 153, 153, 156, - 156, 156, 156, 156, 21, 159, 178, 235, 36, 159, - 156, 156, 196, 196, 196, 228, 226, 159, 178, 21, - 156, 156, 156, 153, 226, 228, 21, 153, 233, 228, - 21, 21, 228, 228 + 177, 179, 191, 196, 217, 158, 158, 163, 194, 153, + 163, 155, 37, 194, 195, 191, 230, 59, 8, 230, + 9, 21, 10, 11, 12, 13, 14, 15, 16, 17, + 176, 177, 178, 182, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 172, 27, 28, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 173, 191, 191, 230, 191, 191, 238, 230, 230, + 230, 230, 230, 230, 230, 191, 191, 191, 230, 230, + 182, 108, 109, 153, 159, 205, 206, 204, 27, 28, + 3, 4, 168, 4, 7, 26, 38, 39, 103, 104, + 110, 112, 114, 115, 116, 157, 160, 162, 165, 169, + 170, 171, 174, 175, 197, 228, 203, 193, 193, 161, + 163, 193, 37, 191, 214, 215, 216, 153, 156, 3, + 4, 7, 26, 27, 28, 38, 39, 61, 160, 197, + 227, 228, 229, 229, 229, 229, 189, 191, 191, 153, + 184, 153, 184, 229, 157, 153, 153, 153, 153, 153, + 153, 153, 153, 229, 229, 229, 153, 36, 189, 191, + 230, 24, 153, 187, 187, 187, 172, 173, 155, 155, + 155, 155, 155, 159, 196, 198, 162, 198, 163, 198, + 24, 155, 155, 155, 155, 155, 187, 159, 161, 161, + 212, 213, 153, 156, 37, 63, 226, 198, 153, 153, + 229, 229, 229, 15, 57, 15, 153, 243, 229, 157, + 230, 191, 230, 230, 230, 191, 191, 153, 153, 153, + 230, 191, 229, 229, 153, 34, 57, 185, 188, 155, + 155, 196, 196, 196, 196, 196, 153, 159, 163, 193, + 198, 161, 163, 196, 196, 196, 196, 196, 37, 214, + 185, 186, 24, 161, 21, 21, 155, 153, 153, 229, + 4, 229, 230, 239, 153, 229, 153, 153, 153, 229, + 229, 229, 155, 191, 24, 4, 187, 196, 196, 243, + 153, 153, 153, 153, 196, 161, 163, 153, 153, 153, + 153, 36, 57, 183, 153, 229, 229, 239, 240, 229, + 229, 153, 184, 184, 153, 229, 153, 230, 230, 230, + 240, 229, 153, 153, 156, 196, 196, 196, 196, 161, + 196, 196, 196, 196, 191, 4, 24, 153, 157, 156, + 230, 159, 229, 156, 196, 196, 153, 156, 153, 153, + 156, 156, 156, 156, 156, 21, 159, 178, 236, 36, + 159, 156, 156, 196, 196, 196, 229, 227, 159, 178, + 21, 156, 156, 156, 153, 227, 229, 21, 153, 234, + 229, 21, 21, 229, 229 }; #define yyerrok (yyerrstatus = 0) @@ -3656,7 +3685,7 @@ yyreduce: switch (yyn) { case 3: -#line 1572 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1594 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3665,7 +3694,7 @@ yyreduce: break; case 5: -#line 1581 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1603 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -3674,226 +3703,226 @@ yyreduce: break; case 26: -#line 1603 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1625 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1603 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1625 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1604 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1626 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1604 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1626 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1605 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1627 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1605 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1627 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1606 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1628 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1606 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1628 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1607 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1629 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1607 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1629 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1611 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1633 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1611 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1633 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1612 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1634 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1612 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1634 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1613 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1635 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1613 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1635 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1614 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1636 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1614 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1636 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1615 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1637 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1615 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1637 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1616 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1638 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1616 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1638 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1617 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1639 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1617 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1639 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1618 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1640 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1619 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1641 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1650 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1672 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1653 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1675 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1658 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1680 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1659 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1681 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1660 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1682 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 1661 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1683 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 1662 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1684 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 1663 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1685 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 1664 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1686 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1665 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1687 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1669 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} +#line 1691 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 92: -#line 1670 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;} +#line 1692 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 93: -#line 1671 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::CSRet; ;} +#line 1693 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 1672 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Fast; ;} +#line 1694 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 1673 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Cold; ;} +#line 1695 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 1674 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} +#line 1696 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 1675 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} +#line 1697 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 1676 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1698 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -3902,12 +3931,12 @@ yyreduce: break; case 99: -#line 1686 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1708 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 1687 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1709 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3916,12 +3945,12 @@ yyreduce: break; case 101: -#line 1695 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1717 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 1696 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1718 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3930,7 +3959,7 @@ yyreduce: break; case 103: -#line 1704 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1726 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -3940,27 +3969,27 @@ yyreduce: break; case 104: -#line 1713 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1735 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 1714 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1736 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 1721 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1743 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 107: -#line 1722 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1744 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 108: -#line 1726 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1748 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3968,7 +3997,7 @@ yyreduce: break; case 109: -#line 1730 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1752 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -3978,176 +4007,173 @@ yyreduce: break; case 111: -#line 1747 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1769 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; ;} break; case 113: -#line 1755 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1777 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = Signless; ;} break; case 114: -#line 1762 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1784 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) - error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).T)->getDescription()); + error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).PAT)->getDescription()); (yyval.TypeVal) = (yyvsp[0].TypeVal); ;} break; case 127: -#line 1776 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1798 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - (yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T); + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S = (yyvsp[0].PrimType).S; ;} break; case 128: -#line 1780 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1802 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - (yyval.TypeVal).T = new PATypeHolder(OpaqueType::get()); + (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S = Signless; ;} break; case 129: -#line 1784 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1806 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... const Type* tmp = getType((yyvsp[0].ValIDVal)); - (yyval.TypeVal).T = new PATypeHolder(tmp); + (yyval.TypeVal).PAT = new PATypeHolder(tmp); (yyval.TypeVal).S = Signless; // FIXME: what if its signed? ;} break; case 130: -#line 1789 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1811 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal).T = new PATypeHolder(OT); + (yyval.TypeVal).PAT = new PATypeHolder(OT); (yyval.TypeVal).S = Signless; UR_OUT("New Upreference!\n"); ;} break; case 131: -#line 1798 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1820 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? std::vector<const Type*> Params; for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(), E = (yyvsp[-1].TypeList)->end(); I != E; ++I) { - Params.push_back(I->T->get()); + Params.push_back(I->PAT->get()); } FunctionType::ParamAttrsList ParamAttrs; - if (CurFun.LastCC == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); - } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - (yyval.TypeVal).T = new PATypeHolder( - HandleUpRefs(FunctionType::get((yyvsp[-3].TypeVal).T->get(),Params,isVarArg, ParamAttrs))); + (yyval.TypeVal).PAT = new PATypeHolder( + HandleUpRefs(FunctionType::get((yyvsp[-3].TypeVal).PAT->get(), Params, isVarArg, + ParamAttrs))); (yyval.TypeVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; // Delete the return type handle + delete (yyvsp[-3].TypeVal).PAT; // Delete the return type handle delete (yyvsp[-1].TypeList); // Delete the argument list ;} break; case 132: -#line 1818 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1837 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? - (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).T->get(), + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).PAT->get(), (unsigned)(yyvsp[-3].UInt64Val)))); (yyval.TypeVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 133: -#line 1824 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1843 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).T->get(); + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).PAT->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) error("Unsigned result not equal to signed result"); if (!(ElemTy->isInteger() || ElemTy->isFloatingPoint())) error("Elements of a PackedType must be integer or floating point"); if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) error("PackedType length should be a power of 2"); - (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, (unsigned)(yyvsp[-3].UInt64Val)))); (yyval.TypeVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 134: -#line 1837 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1856 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector<const Type*> Elements; for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(), E = (yyvsp[-1].TypeList)->end(); I != E; ++I) - Elements.push_back(I->T->get()); - (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + Elements.push_back(I->PAT->get()); + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); (yyval.TypeVal).S = Signless; delete (yyvsp[-1].TypeList); ;} break; case 135: -#line 1846 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1865 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? - (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector<const Type*>())); + (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector<const Type*>())); (yyval.TypeVal).S = Signless; ;} break; case 136: -#line 1850 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1869 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? std::vector<const Type*> Elements; for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-2].TypeList)->begin(), E = (yyvsp[-2].TypeList)->end(); I != E; ++I) { - Elements.push_back(I->T->get()); - delete I->T; + Elements.push_back(I->PAT->get()); + delete I->PAT; } - (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); (yyval.TypeVal).S = Signless; delete (yyvsp[-2].TypeList); ;} break; case 137: -#line 1861 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1880 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? - (yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector<const Type*>(),true)); + (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector<const Type*>(),true)); (yyval.TypeVal).S = Signless; ;} break; case 138: -#line 1865 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1884 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? - if ((yyvsp[-1].TypeVal).T->get() == Type::LabelTy) + if ((yyvsp[-1].TypeVal).PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); - (yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[-1].TypeVal).T->get()))); + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[-1].TypeVal).PAT->get()))); (yyval.TypeVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 139: -#line 1878 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1897 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list<PATypeInfo>(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4155,47 +4181,47 @@ yyreduce: break; case 140: -#line 1882 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1901 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 1890 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1909 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(VoidTI); ;} break; case 143: -#line 1896 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1915 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list<PATypeInfo>(); PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; (yyval.TypeList)->push_back(VoidTI); ;} break; case 144: -#line 1903 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1922 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list<PATypeInfo>(); ;} break; case 145: -#line 1915 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1934 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal).T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[-3].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-3].TypeVal).PAT->get()->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); @@ -4218,35 +4244,35 @@ yyreduce: } (yyval.ConstVal).C = ConstantArray::get(ATy, Elems); (yyval.ConstVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; delete (yyvsp[-1].ConstVector); ;} break; case 146: -#line 1945 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1964 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[-2].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-2].TypeVal).PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) error("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); (yyval.ConstVal).C = ConstantArray::get(ATy, std::vector<Constant*>()); (yyval.ConstVal).S = (yyvsp[-2].TypeVal).S; - delete (yyvsp[-2].TypeVal).T; + delete (yyvsp[-2].TypeVal).PAT; ;} break; case 147: -#line 1958 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1977 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[-2].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-2].TypeVal).PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = dyn_cast<IntegerType>(ATy->getElementType()); if (!ETy || cast<IntegerType>(ETy)->getBitWidth() != 8) @@ -4263,17 +4289,17 @@ yyreduce: free((yyvsp[0].StrVal)); (yyval.ConstVal).C = ConstantArray::get(ATy, Vals); (yyval.ConstVal).S = (yyvsp[-2].TypeVal).S; - delete (yyvsp[-2].TypeVal).T; + delete (yyvsp[-2].TypeVal).PAT; ;} break; case 148: -#line 1981 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2000 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr - const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal).T->get()); + const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal).PAT->get()); if (PTy == 0) error("Cannot make packed constant with type: '" + - (yyvsp[-3].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-3].TypeVal).PAT->get()->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... @@ -4294,18 +4320,18 @@ yyreduce: } (yyval.ConstVal).C = ConstantPacked::get(PTy, Elems); (yyval.ConstVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; delete (yyvsp[-1].ConstVector); ;} break; case 149: -#line 2009 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2028 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal).T->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal).PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - (yyvsp[-3].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-3].TypeVal).PAT->get()->getDescription() + "'"); if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for structure type"); @@ -4320,33 +4346,33 @@ yyreduce: } (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); (yyval.ConstVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; delete (yyvsp[-1].ConstVector); ;} break; case 150: -#line 2031 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2050 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal).T->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal).PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - (yyvsp[-2].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-2].TypeVal).PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for structure type"); (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector<Constant*>()); (yyval.ConstVal).S = (yyvsp[-2].TypeVal).S; - delete (yyvsp[-2].TypeVal).T; + delete (yyvsp[-2].TypeVal).PAT; ;} break; case 151: -#line 2042 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2061 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-5].TypeVal).T->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-5].TypeVal).PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - (yyvsp[-5].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-5].TypeVal).PAT->get()->getDescription() + "'"); if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for packed structure type"); @@ -4361,55 +4387,55 @@ yyreduce: } (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); (yyval.ConstVal).S = (yyvsp[-5].TypeVal).S; - delete (yyvsp[-5].TypeVal).T; + delete (yyvsp[-5].TypeVal).PAT; delete (yyvsp[-2].ConstVector); ;} break; case 152: -#line 2064 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2083 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-4].TypeVal).T->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-4].TypeVal).PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - (yyvsp[-4].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-4].TypeVal).PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for packed structure type"); (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector<Constant*>()); (yyval.ConstVal).S = (yyvsp[-4].TypeVal).S; - delete (yyvsp[-4].TypeVal).T; + delete (yyvsp[-4].TypeVal).PAT; ;} break; case 153: -#line 2075 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2094 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get()); + const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).PAT->get()); if (PTy == 0) error("Cannot make null pointer constant with type: '" + - (yyvsp[-1].TypeVal).T->get()->getDescription() + "'"); + (yyvsp[-1].TypeVal).PAT->get()->getDescription() + "'"); (yyval.ConstVal).C = ConstantPointerNull::get(PTy); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 154: -#line 2084 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2103 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).T->get()); + (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).PAT->get()); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 155: -#line 2089 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2108 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get()); + const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal).PAT->get()); if (Ty == 0) error("Global const reference must be a pointer type, not" + - (yyvsp[-1].TypeVal).T->get()->getDescription()); + (yyvsp[-1].TypeVal).PAT->get()->getDescription()); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -4461,35 +4487,35 @@ yyreduce: } (yyval.ConstVal).C = cast<GlobalValue>(V); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; // Free the type handle + delete (yyvsp[-1].TypeVal).PAT; // Free the type handle ;} break; case 156: -#line 2147 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2166 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - if ((yyvsp[-1].TypeVal).T->get() != (yyvsp[0].ConstVal).C->getType()) + if ((yyvsp[-1].TypeVal).PAT->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); (yyval.ConstVal) = (yyvsp[0].ConstVal); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 157: -#line 2154 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2173 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-1].TypeVal).T->get(); + const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty)) error("Cannot create a null initialized value of this type"); (yyval.ConstVal).C = Constant::getNullValue(Ty); (yyval.ConstVal).S = (yyvsp[-1].TypeVal).S; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 158: -#line 2162 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2181 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4500,7 +4526,7 @@ yyreduce: break; case 159: -#line 2169 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2188 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4511,7 +4537,7 @@ yyreduce: break; case 160: -#line 2176 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2195 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S = Unsigned; @@ -4519,7 +4545,7 @@ yyreduce: break; case 161: -#line 2180 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2199 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S = Unsigned; @@ -4527,7 +4553,7 @@ yyreduce: break; case 162: -#line 2184 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2203 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4537,10 +4563,10 @@ yyreduce: break; case 163: -#line 2193 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2212 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); - const Type* DstTy = (yyvsp[-1].TypeVal).T->get(); + const Type* DstTy = (yyvsp[-1].TypeVal).PAT->get(); Signedness SrcSign = (yyvsp[-3].ConstVal).S; Signedness DstSign = (yyvsp[-1].TypeVal).S; if (!SrcTy->isFirstClassType()) @@ -4551,12 +4577,12 @@ yyreduce: DstTy->getDescription() + "'"); (yyval.ConstVal).C = cast<Constant>(getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal).C, SrcSign, DstTy, DstSign)); (yyval.ConstVal).S = DstSign; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; case 164: -#line 2208 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2227 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa<PointerType>(Ty)) @@ -4573,7 +4599,7 @@ yyreduce: break; case 165: -#line 2221 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2240 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast<IntegerType>((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4586,7 +4612,7 @@ yyreduce: break; case 166: -#line 2230 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2249 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4618,7 +4644,7 @@ yyreduce: break; case 167: -#line 2258 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2277 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4635,7 +4661,7 @@ yyreduce: break; case 168: -#line 2271 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2290 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4648,7 +4674,7 @@ yyreduce: break; case 169: -#line 2280 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2299 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4658,7 +4684,7 @@ yyreduce: break; case 170: -#line 2286 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2305 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4668,7 +4694,7 @@ yyreduce: break; case 171: -#line 2292 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2311 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast<IntegerType>((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) @@ -4683,7 +4709,7 @@ yyreduce: break; case 172: -#line 2303 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2322 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -4693,7 +4719,7 @@ yyreduce: break; case 173: -#line 2309 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2328 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -4703,7 +4729,7 @@ yyreduce: break; case 174: -#line 2315 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2334 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -4713,12 +4739,12 @@ yyreduce: break; case 175: -#line 2326 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2345 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2327 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2346 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector<ConstInfo>(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -4726,17 +4752,17 @@ yyreduce: break; case 177: -#line 2336 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2355 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2337 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2356 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2349 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2368 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -4744,27 +4770,27 @@ yyreduce: break; case 180: -#line 2358 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2377 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2359 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2378 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2360 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2379 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2361 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2380 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2362 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2381 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -4780,7 +4806,7 @@ yyreduce: break; case 185: -#line 2378 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2397 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -4791,7 +4817,7 @@ yyreduce: // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - const Type* Ty = (yyvsp[0].TypeVal).T->get(); + const Type* Ty = (yyvsp[0].TypeVal).PAT->get(); ResolveTypeTo((yyvsp[-2].StrVal), Ty); if (!setTypeName(Ty, (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { @@ -4799,24 +4825,24 @@ yyreduce: // table. CurModule.Types.push_back(Ty); } - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; case 186: -#line 2398 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2417 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2400 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2419 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2402 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2421 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -4825,81 +4851,81 @@ yyreduce: break; case 189: -#line 2406 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2425 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2409 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2428 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[0].TypeVal).T->get(); + const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0); - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; case 191: -#line 2413 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2432 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2416 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2435 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[0].TypeVal).T->get(); + const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0); - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; case 193: -#line 2420 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2439 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2423 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2442 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[0].TypeVal).T->get(); + const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), Ty, 0); - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; case 195: -#line 2428 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2447 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2431 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2450 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2433 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2452 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2435 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2454 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2440 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2459 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4914,24 +4940,24 @@ yyreduce: break; case 200: -#line 2454 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2473 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2455 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2474 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2459 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2478 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2462 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2481 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -4943,7 +4969,7 @@ yyreduce: break; case 204: -#line 2470 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2489 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4951,7 +4977,7 @@ yyreduce: break; case 205: -#line 2474 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2493 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4959,7 +4985,7 @@ yyreduce: break; case 207: -#line 2485 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2504 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4967,7 +4993,7 @@ yyreduce: break; case 208: -#line 2489 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2508 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4975,26 +5001,26 @@ yyreduce: break; case 209: -#line 2493 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2512 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2507 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2525 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2511 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2529 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - if ((yyvsp[-1].TypeVal).T->get() == Type::VoidTy) + if ((yyvsp[-1].TypeVal).PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); (yyval.ArgVal) = new std::pair<PATypeInfo, char*>((yyvsp[-1].TypeVal), (yyvsp[0].StrVal)); ;} break; case 215: -#line 2519 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2537 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5003,7 +5029,7 @@ yyreduce: break; case 216: -#line 2524 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2542 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5012,45 +5038,45 @@ yyreduce: break; case 217: -#line 2532 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2550 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2533 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2551 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; (yyval.ArgList)->push_back(std::pair<PATypeInfo, char*>(VoidTI, 0)); ;} break; case 219: -#line 2540 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2558 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >(); PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; (yyval.ArgList)->push_back(std::pair<PATypeInfo, char*>(VoidTI, 0)); ;} break; case 220: -#line 2547 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2565 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2551 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2569 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); free((yyvsp[-5].StrVal)); // Free strdup'd memory! - const Type* RetTy = (yyvsp[-6].TypeVal).T->get(); + const Type* RetTy = (yyvsp[-6].TypeVal).PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("LLVM functions cannot return aggregate types"); @@ -5068,7 +5094,7 @@ yyreduce: } else if ((yyvsp[-3].ArgList)) { // If there are arguments... for (std::vector<std::pair<PATypeInfo,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(), E = (yyvsp[-3].ArgList)->end(); I != E; ++I) { - const Type *Ty = I->first.T->get(); + const Type *Ty = I->first.PAT->get(); ParamTyList.push_back(Ty); } } @@ -5088,7 +5114,7 @@ yyreduce: const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[-6].TypeVal).T; + delete (yyvsp[-6].TypeVal).PAT; ValID ID; if (!FunctionName.empty()) { @@ -5098,73 +5124,89 @@ yyreduce: } Function *Fn = 0; + Module* M = CurModule.CurrentModule; + // See if this function was forward referenced. If so, recycle the object. if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) { // Move the function to the end of the list, from whereever it was // previously inserted. Fn = cast<Function>(FWRef); - CurModule.CurrentModule->getFunctionList().remove(Fn); - CurModule.CurrentModule->getFunctionList().push_back(Fn); - } else if (!FunctionName.empty() && // Merge with an earlier prototype? - (Fn = CurModule.CurrentModule->getFunction(FunctionName))) { - if (Fn->getFunctionType() != FT ) { - // The existing function doesn't have the same type. Previously this was - // permitted because the symbol tables had "type planes" and names were - // distinct within a type plane. After PR411 was fixed, this is no - // longer the case. To resolve this we must rename this function. - // However, renaming it can cause problems if its linkage is external - // because it could cause a link failure. We warn about this. - std::string NewName = makeNameUnique(FunctionName); - warning("Renaming function '" + FunctionName + "' as '" + NewName + - "' may cause linkage errors"); - - Fn = new Function(FT, GlobalValue::ExternalLinkage, NewName, - CurModule.CurrentModule); - InsertValue(Fn, CurModule.Values); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = NewName; - } else if (Fn->hasInternalLinkage()) { - // The function we are creating conflicts in name with another function - // that has internal linkage. We'll rename that one quietly to get rid - // of the conflict. - Fn->setName(makeNameUnique(Fn->getName())); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = Fn->getName(); - - Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName, - CurModule.CurrentModule); - - InsertValue(Fn, CurModule.Values); - } else if (CurFun.Linkage == GlobalValue::InternalLinkage) { - // The function we are creating has internal linkage and conflicts with - // another function of the same name. We'll just rename this one - // quietly because its internal linkage can't conflict with anything - // else. - std::string NewName = makeNameUnique(FunctionName); - Fn = new Function(FT, GlobalValue::ExternalLinkage, NewName, - CurModule.CurrentModule); - InsertValue(Fn, CurModule.Values); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = NewName; + M->getFunctionList().remove(Fn); + M->getFunctionList().push_back(Fn); + } else if (!FunctionName.empty()) { + GlobalValue *Conflict = M->getFunction(FunctionName); + if (!Conflict) + Conflict = M->getNamedGlobal(FunctionName); + if (Conflict && PFT == Conflict->getType()) { + if (!CurFun.isDeclare && !Conflict->isDeclaration()) { + // We have two function definitions that conflict, same type, same + // name. We should really check to make sure that this is the result + // of integer type planes collapsing and generate an error if it is + // not, but we'll just rename on the assumption that it is. However, + // let's do it intelligently and rename the internal linkage one + // if there is one. + std::string NewName(makeNameUnique(FunctionName)); + if (Conflict->hasInternalLinkage()) { + Conflict->setName(NewName); + RenameMapKey Key = std::make_pair(FunctionName,Conflict->getType()); + CurModule.RenameMap[Key] = NewName; + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); + } else { + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } + } else { + // If they are not both definitions, then just use the function we + // found since the types are the same. + Fn = cast<Function>(Conflict); + + // Make sure to strip off any argument names so we can't get + // conflicts. + if (Fn->isDeclaration()) + for (Function::arg_iterator AI = Fn->arg_begin(), + AE = Fn->arg_end(); AI != AE; ++AI) + AI->setName(""); + } + } else if (Conflict) { + // We have two globals with the same name and different types. + // Previously, this was permitted because the symbol table had + // "type planes" and names only needed to be distinct within a + // type plane. After PR411 was fixed, this is no loner the case. + // To resolve this we must rename one of the two. + if (Conflict->hasInternalLinkage()) { + // We can safely renamed the Conflict. + Conflict->setName(makeNameUnique(Conflict->getName())); + RenameMapKey Key = std::make_pair(FunctionName,Conflict->getType()); + CurModule.RenameMap[Key] = Conflict->getName(); + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); + } else if (CurFun.Linkage == GlobalValue::InternalLinkage) { + // We can safely rename the function we're defining + std::string NewName = makeNameUnique(FunctionName); + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } else { + // We can't quietly rename either of these things, but we must + // rename one of them. Generate a warning about the renaming and + // elect to rename the thing we're now defining. + std::string NewName = makeNameUnique(FunctionName); + warning("Renaming function '" + FunctionName + "' as '" + NewName + + "' may cause linkage errors"); + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } } else { - // The types are the same and they are both external linkage. Either - // the existing or the current function needs to be a forward - // declaration. If not, they're attempting to redefine two external - // functions. This wasn't allowed in llvm 1.9 and it isn't allowed now. - if (!CurFun.isDeclare && !Fn->isDeclaration()) - error("Redefinition of function '" + FunctionName + "'"); - - // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isDeclaration()) - for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); - AI != AE; ++AI) - AI->setName(""); + // There's no conflict, just define the function + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); } - } else { // Not already defined? - Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName, - CurModule.CurrentModule); - - InsertValue(Fn, CurModule.Values); } CurFun.FunctionStart(Fn); @@ -5185,9 +5227,9 @@ yyreduce: // Add all of the arguments we parsed to the function... if ((yyvsp[-3].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[-3].ArgList)->back().first.T->get() == Type::VoidTy && + assert((yyvsp[-3].ArgList)->back().first.PAT->get() == Type::VoidTy && (yyvsp[-3].ArgList)->back().second == 0 && "Not a varargs marker"); - delete (yyvsp[-3].ArgList)->back().first.T; + delete (yyvsp[-3].ArgList)->back().first.PAT; (yyvsp[-3].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); @@ -5195,7 +5237,7 @@ yyreduce: std::vector<std::pair<PATypeInfo,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(); std::vector<std::pair<PATypeInfo,char*> >::iterator E = (yyvsp[-3].ArgList)->end(); for ( ; I != E && ArgIt != ArgEnd; ++I, ++ArgIt) { - delete I->first.T; // Delete the typeholder... + delete I->first.PAT; // Delete the typeholder... setValueName(ArgIt, I->second); // Insert arg into symtab... InsertValue(ArgIt); } @@ -5205,7 +5247,7 @@ yyreduce: break; case 224: -#line 2715 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2749 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5216,29 +5258,39 @@ yyreduce: break; case 227: -#line 2729 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2763 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; + case 228: +#line 2768 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + case 229: -#line 2735 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} +#line 2769 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 230: -#line 2736 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;} +#line 2770 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 231: -#line 2740 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2774 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 232: -#line 2740 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 2775 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + { CurFun.Linkage = (yyvsp[0].Linkage); ;} + break; + + case 233: +#line 2775 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5246,58 +5298,58 @@ yyreduce: ;} break; - case 233: -#line 2752 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 234: +#line 2787 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; - case 234: -#line 2753 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 235: +#line 2788 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; - case 235: -#line 2758 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 236: +#line 2793 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; - case 236: -#line 2759 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 237: +#line 2794 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; - case 237: -#line 2760 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 238: +#line 2795 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; - case 238: -#line 2761 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 239: +#line 2796 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;} break; - case 239: -#line 2762 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 240: +#line 2797 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;} break; - case 240: -#line 2763 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 241: +#line 2798 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; - case 241: -#line 2764 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 242: +#line 2799 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; - case 242: -#line 2765 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 243: +#line 2800 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; - case 243: -#line 2766 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 244: +#line 2801 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5321,15 +5373,15 @@ yyreduce: ;} break; - case 244: -#line 2787 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 245: +#line 2822 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); ;} break; - case 245: -#line 2790 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 246: +#line 2825 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5341,42 +5393,42 @@ yyreduce: ;} break; - case 246: -#line 2805 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 247: +#line 2840 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); ;} break; - case 247: -#line 2806 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 248: +#line 2841 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); ;} break; - case 250: -#line 2819 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 251: +#line 2854 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-1].TypeVal).T->get(); + const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.ValueVal).S = (yyvsp[-1].TypeVal).S; (yyval.ValueVal).V = getVal(Ty, (yyvsp[0].ValIDVal)); - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; - case 251: -#line 2828 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 252: +#line 2863 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; - case 252: -#line 2831 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 253: +#line 2866 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; - case 253: -#line 2840 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 254: +#line 2875 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); InsertValue((yyvsp[0].TermInstVal)); @@ -5386,8 +5438,8 @@ yyreduce: ;} break; - case 254: -#line 2850 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 255: +#line 2885 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5395,8 +5447,8 @@ yyreduce: ;} break; - case 255: -#line 2855 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 256: +#line 2890 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the @@ -5408,8 +5460,8 @@ yyreduce: ;} break; - case 256: -#line 2864 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 257: +#line 2899 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5421,30 +5473,30 @@ yyreduce: ;} break; - case 259: -#line 2878 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 260: +#line 2913 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).V); ;} break; - case 260: -#line 2881 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 261: +#line 2916 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); ;} break; - case 261: -#line 2884 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 262: +#line 2919 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal) = new BranchInst(tmpBB); ;} break; - case 262: -#line 2888 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 263: +#line 2923 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); @@ -5453,8 +5505,8 @@ yyreduce: ;} break; - case 263: -#line 2894 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 264: +#line 2929 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); @@ -5472,8 +5524,8 @@ yyreduce: ;} break; - case 264: -#line 2909 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 265: +#line 2944 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); @@ -5482,13 +5534,13 @@ yyreduce: ;} break; - case 265: -#line 2916 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 266: +#line 2951 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast<PointerType>((yyvsp[-10].TypeVal).T->get())) || + if (!(PFTy = dyn_cast<PointerType>((yyvsp[-10].TypeVal).PAT->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; @@ -5504,7 +5556,7 @@ yyreduce: } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get((yyvsp[-10].TypeVal).T->get(), ParamTypes, isVarArg, ParamAttrs); + Ty = FunctionType::get((yyvsp[-10].TypeVal).PAT->get(), ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(Ty); } Value *V = getVal(PFTy, (yyvsp[-9].ValIDVal)); // Get the function we're calling... @@ -5536,27 +5588,27 @@ yyreduce: (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, Args); } cast<InvokeInst>((yyval.TermInstVal))->setCallingConv(upgradeCallingConv((yyvsp[-11].UIntVal))); - delete (yyvsp[-10].TypeVal).T; + delete (yyvsp[-10].TypeVal).PAT; delete (yyvsp[-7].ValueList); ;} break; - case 266: -#line 2971 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 267: +#line 3006 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnwindInst(); ;} break; - case 267: -#line 2974 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 268: +#line 3009 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal) = new UnreachableInst(); ;} break; - case 268: -#line 2980 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 269: +#line 3015 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast<Constant>(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5569,8 +5621,8 @@ yyreduce: ;} break; - case 269: -#line 2990 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 270: +#line 3025 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >(); Constant *V = cast<Constant>(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal))); @@ -5583,8 +5635,8 @@ yyreduce: ;} break; - case 270: -#line 3003 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 271: +#line 3038 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -5615,20 +5667,20 @@ yyreduce: ;} break; - case 271: -#line 3032 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 272: +#line 3067 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list<std::pair<Value*, BasicBlock*> >(); (yyval.PHIList).S = (yyvsp[-5].TypeVal).S; - Value* tmpVal = getVal((yyvsp[-5].TypeVal).T->get(), (yyvsp[-3].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-5].TypeVal).PAT->get(), (yyvsp[-3].ValIDVal)); BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); (yyval.PHIList).P->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[-5].TypeVal).T; + delete (yyvsp[-5].TypeVal).PAT; ;} break; - case 272: -#line 3040 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 273: +#line 3075 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList).P->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -5637,45 +5689,45 @@ yyreduce: ;} break; - case 273: -#line 3048 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 274: +#line 3083 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector<ValueInfo>(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); ;} break; - case 274: -#line 3052 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 275: +#line 3087 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); ;} break; - case 276: -#line 3060 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 277: +#line 3095 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; - case 277: -#line 3064 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 278: +#line 3099 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; - case 278: -#line 3067 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 279: +#line 3102 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; - case 279: -#line 3073 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 280: +#line 3108 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type* Ty = (yyvsp[-3].TypeVal).T->get(); + const Type* Ty = (yyvsp[-3].TypeVal).PAT->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa<PackedType>(Ty)) error("Arithmetic operator requires integer, FP, or packed operands"); if (isa<PackedType>(Ty) && @@ -5689,14 +5741,14 @@ yyreduce: if ((yyval.InstVal).I == 0) error("binary operator returned null"); (yyval.InstVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; ;} break; - case 280: -#line 3090 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 281: +#line 3125 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-3].TypeVal).T->get(); + const Type *Ty = (yyvsp[-3].TypeVal).PAT->get(); if (!Ty->isInteger()) { if (!isa<PackedType>(Ty) || !cast<PackedType>(Ty)->getElementType()->isInteger()) @@ -5709,14 +5761,14 @@ yyreduce: if ((yyval.InstVal).I == 0) error("binary operator returned null"); (yyval.InstVal).S = (yyvsp[-3].TypeVal).S; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; ;} break; - case 281: -#line 3106 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 282: +#line 3141 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type* Ty = (yyvsp[-3].TypeVal).T->get(); + const Type* Ty = (yyvsp[-3].TypeVal).PAT->get(); if(isa<PackedType>(Ty)) error("PackedTypes currently not supported in setcc instructions"); unsigned short pred; @@ -5727,14 +5779,14 @@ yyreduce: if ((yyval.InstVal).I == 0) error("binary operator returned null"); (yyval.InstVal).S = Unsigned; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; ;} break; - case 282: -#line 3120 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 283: +#line 3155 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-3].TypeVal).T->get(); + const Type *Ty = (yyvsp[-3].TypeVal).PAT->get(); if (isa<PackedType>(Ty)) error("PackedTypes currently not supported in icmp instructions"); else if (!Ty->isInteger() && !isa<PointerType>(Ty)) @@ -5743,14 +5795,14 @@ yyreduce: Value* tmpVal2 = getVal(Ty, (yyvsp[0].ValIDVal)); (yyval.InstVal).I = new ICmpInst((yyvsp[-4].IPred), tmpVal1, tmpVal2); (yyval.InstVal).S = Unsigned; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; ;} break; - case 283: -#line 3132 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 284: +#line 3167 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-3].TypeVal).T->get(); + const Type *Ty = (yyvsp[-3].TypeVal).PAT->get(); if (isa<PackedType>(Ty)) error("PackedTypes currently not supported in fcmp instructions"); else if (!Ty->isFloatingPoint()) @@ -5759,12 +5811,12 @@ yyreduce: Value* tmpVal2 = getVal(Ty, (yyvsp[0].ValIDVal)); (yyval.InstVal).I = new FCmpInst((yyvsp[-4].FPred), tmpVal1, tmpVal2); (yyval.InstVal).S = Unsigned; - delete (yyvsp[-3].TypeVal).T; + delete (yyvsp[-3].TypeVal).PAT; ;} break; - case 284: -#line 3144 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 285: +#line 3179 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -5778,8 +5830,8 @@ yyreduce: ;} break; - case 285: -#line 3155 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 286: +#line 3190 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast<IntegerType>((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) @@ -5800,21 +5852,21 @@ yyreduce: ;} break; - case 286: -#line 3173 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 287: +#line 3208 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *DstTy = (yyvsp[0].TypeVal).T->get(); + const Type *DstTy = (yyvsp[0].TypeVal).PAT->get(); if (!DstTy->isFirstClassType()) error("cast instruction to a non-primitive type: '" + DstTy->getDescription() + "'"); (yyval.InstVal).I = cast<Instruction>(getCast((yyvsp[-3].CastOpVal), (yyvsp[-2].ValueVal).V, (yyvsp[-2].ValueVal).S, DstTy, (yyvsp[0].TypeVal).S, true)); (yyval.InstVal).S = (yyvsp[0].TypeVal).S; - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; - case 287: -#line 3182 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 288: +#line 3217 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast<IntegerType>((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -5826,22 +5878,22 @@ yyreduce: ;} break; - case 288: -#line 3191 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 289: +#line 3226 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[0].TypeVal).T->get(); + const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); NewVarArgs = true; (yyval.InstVal).I = new VAArgInst((yyvsp[-2].ValueVal).V, Ty); (yyval.InstVal).S = (yyvsp[0].TypeVal).S; - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; - case 289: -#line 3198 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 290: +#line 3233 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); - const Type* DstTy = (yyvsp[0].TypeVal).T->get(); + const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); ObsoleteVarArgs = true; Function* NF = cast<Function>(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -5858,15 +5910,15 @@ yyreduce: CurBB->getInstList().push_back(new StoreInst(bar, foo)); (yyval.InstVal).I = new VAArgInst(foo, DstTy); (yyval.InstVal).S = (yyvsp[0].TypeVal).S; - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; - case 290: -#line 3219 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 291: +#line 3254 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); - const Type* DstTy = (yyvsp[0].TypeVal).T->get(); + const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); ObsoleteVarArgs = true; Function* NF = cast<Function>(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -5886,12 +5938,12 @@ yyreduce: CurBB->getInstList().push_back(tmp); (yyval.InstVal).I = new LoadInst(foo); (yyval.InstVal).S = (yyvsp[0].TypeVal).S; - delete (yyvsp[0].TypeVal).T; + delete (yyvsp[0].TypeVal).PAT; ;} break; - case 291: -#line 3243 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 292: +#line 3278 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -5900,8 +5952,8 @@ yyreduce: ;} break; - case 292: -#line 3249 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 293: +#line 3284 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -5910,8 +5962,8 @@ yyreduce: ;} break; - case 293: -#line 3255 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 294: +#line 3290 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -5920,8 +5972,8 @@ yyreduce: ;} break; - case 294: -#line 3261 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 295: +#line 3296 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5940,14 +5992,14 @@ yyreduce: ;} break; - case 295: -#line 3277 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 296: +#line 3312 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; - if (!(PFTy = dyn_cast<PointerType>((yyvsp[-4].TypeVal).T->get())) || + if (!(PFTy = dyn_cast<PointerType>((yyvsp[-4].TypeVal).PAT->get())) || !(FTy = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; @@ -5965,7 +6017,7 @@ yyreduce: bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - const Type *RetTy = (yyvsp[-4].TypeVal).T->get(); + const Type *RetTy = (yyvsp[-4].TypeVal).PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); @@ -6017,80 +6069,80 @@ yyreduce: (yyval.InstVal).I = CI; (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; } - delete (yyvsp[-4].TypeVal).T; + delete (yyvsp[-4].TypeVal).PAT; delete (yyvsp[-1].ValueList); ;} break; - case 296: -#line 3355 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 297: +#line 3390 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; - case 297: -#line 3363 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 298: +#line 3398 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; - case 298: -#line 3364 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 299: +#line 3399 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector<ValueInfo>(); ;} break; - case 299: -#line 3368 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 300: +#line 3403 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; - case 300: -#line 3369 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 301: +#line 3404 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; - case 301: -#line 3373 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 302: +#line 3408 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-1].TypeVal).T->get(); + const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; (yyval.InstVal).I = new MallocInst(Ty, 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; - case 302: -#line 3379 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 303: +#line 3414 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-4].TypeVal).T->get(); + const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; (yyval.InstVal).I = new MallocInst(Ty, getVal((yyvsp[-2].PrimType).T, (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal).T; + delete (yyvsp[-4].TypeVal).PAT; ;} break; - case 303: -#line 3385 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 304: +#line 3420 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-1].TypeVal).T->get(); + const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; (yyval.InstVal).I = new AllocaInst(Ty, 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; - case 304: -#line 3391 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 305: +#line 3426 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type *Ty = (yyvsp[-4].TypeVal).T->get(); + const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyval.InstVal).S = (yyvsp[-4].TypeVal).S; (yyval.InstVal).I = new AllocaInst(Ty, getVal((yyvsp[-2].PrimType).T, (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal).T; + delete (yyvsp[-4].TypeVal).PAT; ;} break; - case 305: -#line 3397 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 306: +#line 3432 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa<PointerType>(PTy)) @@ -6100,10 +6152,10 @@ yyreduce: ;} break; - case 306: -#line 3404 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 307: +#line 3439 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type* Ty = (yyvsp[-1].TypeVal).T->get(); + const Type* Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S = (yyvsp[-1].TypeVal).S; if (!isa<PointerType>(Ty)) error("Can't load from nonpointer type: " + Ty->getDescription()); @@ -6112,32 +6164,43 @@ yyreduce: Ty->getDescription()); Value* tmpVal = getVal(Ty, (yyvsp[0].ValIDVal)); (yyval.InstVal).I = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; - case 307: -#line 3416 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 308: +#line 3451 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get()); + const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).PAT->get()); if (!PTy) error("Can't store to a nonpointer type: " + - (yyvsp[-1].TypeVal).T->get()->getDescription()); + (yyvsp[-1].TypeVal).PAT->get()->getDescription()); const Type *ElTy = PTy->getElementType(); - if (ElTy != (yyvsp[-3].ValueVal).V->getType()) - error("Can't store '" + (yyvsp[-3].ValueVal).V->getType()->getDescription() + - "' into space of type '" + ElTy->getDescription() + "'"); + Value *StoreVal = (yyvsp[-3].ValueVal).V; Value* tmpVal = getVal(PTy, (yyvsp[0].ValIDVal)); - (yyval.InstVal).I = new StoreInst((yyvsp[-3].ValueVal).V, tmpVal, (yyvsp[-5].BoolVal)); + if (ElTy != (yyvsp[-3].ValueVal).V->getType()) { + StoreVal = handleSRetFuncTypeMerge((yyvsp[-3].ValueVal).V, ElTy); + if (!StoreVal) + error("Can't store '" + (yyvsp[-3].ValueVal).V->getType()->getDescription() + + "' into space of type '" + ElTy->getDescription() + "'"); + else { + PTy = PointerType::get(StoreVal->getType()); + if (Constant *C = dyn_cast<Constant>(tmpVal)) + tmpVal = ConstantExpr::getBitCast(C, PTy); + else + tmpVal = new BitCastInst(tmpVal, PTy, "upgrd.cast", CurBB); + } + } + (yyval.InstVal).I = new StoreInst(StoreVal, tmpVal, (yyvsp[-5].BoolVal)); (yyval.InstVal).S = Signless; - delete (yyvsp[-1].TypeVal).T; + delete (yyvsp[-1].TypeVal).PAT; ;} break; - case 308: -#line 3430 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" + case 309: +#line 3476 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { - const Type* Ty = (yyvsp[-2].TypeVal).T->get(); + const Type* Ty = (yyvsp[-2].TypeVal).PAT->get(); if (!isa<PointerType>(Ty)) error("getelementptr insn requires pointer operand"); @@ -6147,7 +6210,7 @@ yyreduce: Value* tmpVal = getVal(Ty, (yyvsp[-1].ValIDVal)); (yyval.InstVal).I = new GetElementPtrInst(tmpVal, VIndices); (yyval.InstVal).S = Signless; - delete (yyvsp[-2].TypeVal).T; + delete (yyvsp[-2].TypeVal).PAT; delete (yyvsp[0].ValueList); ;} break; @@ -6157,7 +6220,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 6161 "UpgradeParser.tab.c" +#line 6224 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6425,13 +6488,13 @@ yyreturn: } -#line 3446 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 3492 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename) - + ":" + llvm::utostr((unsigned) Upgradelineno-1) + ": "; + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; std::string errMsg = where + "error: " + std::string(ErrorMsg); if (yychar != YYEMPTY && yychar != 0) errMsg += " while reading token '" + std::string(Upgradetext, Upgradeleng) + @@ -6444,7 +6507,7 @@ int yyerror(const char *ErrorMsg) { void warning(const std::string& ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename) - + ":" + llvm::utostr((unsigned) Upgradelineno-1) + ": "; + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; std::string errMsg = where + "warning: " + std::string(ErrorMsg); if (yychar != YYEMPTY && yychar != 0) errMsg += " while reading token '" + std::string(Upgradetext, Upgradeleng) + diff --git a/tools/llvm-upgrade/UpgradeParser.h.cvs b/tools/llvm-upgrade/UpgradeParser.h.cvs index cf708c6..3233335 100644 --- a/tools/llvm-upgrade/UpgradeParser.h.cvs +++ b/tools/llvm-upgrade/UpgradeParser.h.cvs @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1431 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" +#line 1453 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; diff --git a/tools/llvm-upgrade/UpgradeParser.y.cvs b/tools/llvm-upgrade/UpgradeParser.y.cvs index ba9fe6d..ad72b39 100644 --- a/tools/llvm-upgrade/UpgradeParser.y.cvs +++ b/tools/llvm-upgrade/UpgradeParser.y.cvs @@ -171,7 +171,6 @@ static struct PerFunctionInfo { std::map<BasicBlock*, std::pair<ValID, int> > BBForwardRefs; std::vector<BasicBlock*> NumberedBlocks; RenameMapType RenameMap; - unsigned LastCC; unsigned NextBBNum; inline PerFunctionInfo() { @@ -268,6 +267,55 @@ static const Type *getType(const ValID &D, bool DoNotImprovise = false) { return Typ; } +/// This function determines if two function types differ only in their use of +/// the sret parameter attribute in the first argument. If they are identical +/// in all other respects, it returns true. Otherwise, it returns false. +bool FuncTysDifferOnlyBySRet(const FunctionType *F1, + const FunctionType *F2) { + if (F1->getReturnType() != F2->getReturnType() || + F1->getNumParams() != F2->getNumParams() || + F1->getParamAttrs(0) != F2->getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + for (unsigned i = 0; i < F1->getNumParams(); ++i) { + if (F1->getParamType(i) != F2->getParamType(i) || + unsigned(F1->getParamAttrs(i+1)) & SRetMask != + unsigned(F2->getParamAttrs(i+1)) & SRetMask) + return false; + } + return true; +} + +// The upgrade of csretcc to sret param attribute may have caused a function +// to not be found because the param attribute changed the type of the called +// function. This helper function, used in getExistingValue, detects that +// situation and returns V if it occurs and 0 otherwise. +static Value* handleSRetFuncTypeMerge(Value *V, const Type* Ty) { + // Handle degenerate cases + if (!V) + return 0; + if (V->getType() == Ty) + return V; + + Value* Result = 0; + const PointerType *PF1 = dyn_cast<PointerType>(Ty); + const PointerType *PF2 = dyn_cast<PointerType>(V->getType()); + if (PF1 && PF2) { + const FunctionType *FT1 = + dyn_cast<FunctionType>(PF1->getElementType()); + const FunctionType *FT2 = + dyn_cast<FunctionType>(PF2->getElementType()); + if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) + if (FT2->paramHasAttr(1, FunctionType::StructRetAttribute)) + Result = V; + else if (Constant *C = dyn_cast<Constant>(V)) + Result = ConstantExpr::getBitCast(C, PF1); + else + Result = new BitCastInst(V, PF1, "upgrd.cast", CurBB); + } + return Result; +} + // getExistingValue - Look up the value specified by the provided type and // the provided ValID. If the value exists and has already been defined, return // it. Otherwise return null. @@ -314,8 +362,7 @@ static Value *getExistingValue(const Type *Ty, const ValID &D) { LookupName = Name; ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable(); V = SymTab.lookup(LookupName); - if (V && V->getType() != Ty) - V = 0; + V = handleSRetFuncTypeMerge(V, Ty); } if (!V) { RenameMapType::const_iterator I = CurModule.RenameMap.find(Key); @@ -325,8 +372,7 @@ static Value *getExistingValue(const Type *Ty, const ValID &D) { else LookupName = Name; V = CurModule.CurrentModule->getValueSymbolTable().lookup(LookupName); - if (V && V->getType() != Ty) - V = 0; + V = handleSRetFuncTypeMerge(V, Ty); } if (!V) return 0; @@ -429,6 +475,14 @@ static Value *getVal(const Type *Ty, const ValID &ID) { return V; } +/// @brief This just makes any name given to it unique, up to MAX_UINT times. +static std::string makeNameUnique(const std::string& Name) { + static unsigned UniqueNameCounter = 1; + std::string Result(Name); + Result += ".upgrd." + llvm::utostr(UniqueNameCounter++); + return Result; +} + /// getBBVal - This is used for two purposes: /// * If isDefinition is true, a new basic block with the specified ID is being /// defined. @@ -453,9 +507,18 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) { Name = ID.Name; if (Value *N = CurFun.CurrentFunction-> getValueSymbolTable().lookup(Name)) { - if (N->getType() != Type::LabelTy) - error("Name '" + Name + "' does not refer to a BasicBlock"); - BB = cast<BasicBlock>(N); + if (N->getType() != Type::LabelTy) { + // Register names didn't use to conflict with basic block names + // because of type planes. Now they all have to be unique. So, we just + // rename the register and treat this name as if no basic block + // had been found. + RenameMapKey Key = std::make_pair(N->getName(),N->getType()); + N->setName(makeNameUnique(N->getName())); + CurModule.RenameMap[Key] = N->getName(); + BB = 0; + } else { + BB = cast<BasicBlock>(N); + } } break; } @@ -509,25 +572,6 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) { // and back patchs after we are done. // -/// This function determines if two function types differ only in their use of -/// the sret parameter attribute in the first argument. If they are identical -/// in all other respects, it returns true. Otherwise, it returns false. -bool FuncTysDifferOnlyBySRet(const FunctionType *F1, - const FunctionType *F2) { - if (F1->getReturnType() != F2->getReturnType() || - F1->getNumParams() != F2->getNumParams() || - F1->getParamAttrs(0) != F2->getParamAttrs(0)) - return false; - unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); - for (unsigned i = 0; i < F1->getNumParams(); ++i) { - if (F1->getParamType(i) != F2->getParamType(i) || - unsigned(F1->getParamAttrs(i+1)) & SRetMask != - unsigned(F2->getParamAttrs(i+1)) & SRetMask) - return false; - } - return true; -} - // ResolveDefinitions - If we could not resolve some defs at parsing // time (forward branches, phi functions for loops, etc...) resolve the // defs now... @@ -535,9 +579,11 @@ bool FuncTysDifferOnlyBySRet(const FunctionType *F1, static void ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, std::map<const Type*,ValueList> *FutureLateResolvers) { + // Loop over LateResolveDefs fixing up stuff that couldn't be resolved for (std::map<const Type*,ValueList>::iterator LRI = LateResolvers.begin(), E = LateResolvers.end(); LRI != E; ++LRI) { + const Type* Ty = LRI->first; ValueList &List = LRI->second; while (!List.empty()) { Value *V = List.back(); @@ -549,7 +595,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, ValID &DID = PHI->second.first; - Value *TheRealValue = getExistingValue(LRI->first, DID); + Value *TheRealValue = getExistingValue(Ty, DID); if (TheRealValue) { V->replaceAllUsesWith(TheRealValue); delete V; @@ -560,26 +606,10 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) { - // The upgrade of csretcc to sret param attribute may have caused a - // function to not be found because the param attribute changed the - // type of the called function. Detect this situation and insert a - // cast as necessary. - bool fixed = false; - if (const PointerType *PTy = dyn_cast<PointerType>(V->getType())) - if (const FunctionType *FTy = - dyn_cast<FunctionType>(PTy->getElementType())) - if (Function *OtherF = - CurModule.CurrentModule->getFunction(DID.getName())) - if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { - V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); - fixed = true; - } - if (!fixed) { - error("Reference to an invalid definition: '" +DID.getName()+ - "' of type '" + V->getType()->getDescription() + "'", - PHI->second.second); + error("Reference to an invalid definition: '" + DID.getName() + + "' of type '" + V->getType()->getDescription() + "'", + PHI->second.second); return; - } } else { error("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + @@ -610,14 +640,6 @@ static void ResolveTypeTo(char *Name, const Type *ToTy) { } } -/// @brief This just makes any name given to it unique, up to MAX_UINT times. -static std::string makeNameUnique(const std::string& Name) { - static unsigned UniqueNameCounter = 1; - std::string Result(Name); - Result += ".upgrd." + llvm::utostr(UniqueNameCounter++); - return Result; -} - /// This is the implementation portion of TypeHasInteger. It traverses the /// type given, avoiding recursive types, and returns true as soon as it finds /// an integer type. If no integer type is found, it returns false. @@ -1488,7 +1510,7 @@ using namespace llvm; %type <BoolVal> OptVolatile // 'volatile' or not %type <BoolVal> OptTailCall // TAIL CALL or plain CALL. %type <BoolVal> OptSideEffect // 'sideeffect' or not. -%type <Linkage> OptLinkage +%type <Linkage> OptLinkage FnDeclareLinkage %type <Endianness> BigOrLittle // ValueRef - Unresolved reference to a definition or BB @@ -1666,13 +1688,13 @@ OptLinkage ; OptCallingConv - : /*empty*/ { CurFun.LastCC = $$ = OldCallingConv::C; } - | CCC_TOK { CurFun.LastCC = $$ = OldCallingConv::C; } - | CSRETCC_TOK { CurFun.LastCC = $$ = OldCallingConv::CSRet; } - | FASTCC_TOK { CurFun.LastCC = $$ = OldCallingConv::Fast; } - | COLDCC_TOK { CurFun.LastCC = $$ = OldCallingConv::Cold; } - | X86_STDCALLCC_TOK { CurFun.LastCC = $$ = OldCallingConv::X86_StdCall; } - | X86_FASTCALLCC_TOK { CurFun.LastCC = $$ = OldCallingConv::X86_FastCall; } + : /*empty*/ { $$ = OldCallingConv::C; } + | CCC_TOK { $$ = OldCallingConv::C; } + | CSRETCC_TOK { $$ = OldCallingConv::CSRet; } + | FASTCC_TOK { $$ = OldCallingConv::Fast; } + | COLDCC_TOK { $$ = OldCallingConv::Cold; } + | X86_STDCALLCC_TOK { $$ = OldCallingConv::X86_StdCall; } + | X86_FASTCALLCC_TOK { $$ = OldCallingConv::X86_FastCall; } | CC_TOK EUINT64VAL { if ((unsigned)$2 != $2) error("Calling conv too large"); @@ -1745,7 +1767,7 @@ GlobalVarAttribute TypesV : Types | VOID { - $$.T = new PATypeHolder($1.T); + $$.PAT = new PATypeHolder($1.T); $$.S = Signless; } ; @@ -1753,7 +1775,7 @@ TypesV UpRTypesV : UpRTypes | VOID { - $$.T = new PATypeHolder($1.T); + $$.PAT = new PATypeHolder($1.T); $$.S = Signless; } ; @@ -1761,7 +1783,7 @@ UpRTypesV Types : UpRTypes { if (!UpRefs.empty()) - error("Invalid upreference in type: " + (*$1.T)->getDescription()); + error("Invalid upreference in type: " + (*$1.PAT)->getDescription()); $$ = $1; } ; @@ -1774,16 +1796,16 @@ PrimType // Derived types are added later... UpRTypes : PrimType { - $$.T = new PATypeHolder($1.T); + $$.PAT = new PATypeHolder($1.T); $$.S = $1.S; } | OPAQUE { - $$.T = new PATypeHolder(OpaqueType::get()); + $$.PAT = new PATypeHolder(OpaqueType::get()); $$.S = Signless; } | SymbolicValueRef { // Named types are also simple types... const Type* tmp = getType($1); - $$.T = new PATypeHolder(tmp); + $$.PAT = new PATypeHolder(tmp); $$.S = Signless; // FIXME: what if its signed? } | '\\' EUINT64VAL { // Type UpReference @@ -1791,7 +1813,7 @@ UpRTypes error("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector... - $$.T = new PATypeHolder(OT); + $$.PAT = new PATypeHolder(OT); $$.S = Signless; UR_OUT("New Upreference!\n"); } @@ -1799,75 +1821,72 @@ UpRTypes std::vector<const Type*> Params; for (std::list<llvm::PATypeInfo>::iterator I = $3->begin(), E = $3->end(); I != E; ++I) { - Params.push_back(I->T->get()); + Params.push_back(I->PAT->get()); } FunctionType::ParamAttrsList ParamAttrs; - if (CurFun.LastCC == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); - } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - $$.T = new PATypeHolder( - HandleUpRefs(FunctionType::get($1.T->get(),Params,isVarArg, ParamAttrs))); + $$.PAT = new PATypeHolder( + HandleUpRefs(FunctionType::get($1.PAT->get(), Params, isVarArg, + ParamAttrs))); $$.S = $1.S; - delete $1.T; // Delete the return type handle + delete $1.PAT; // Delete the return type handle delete $3; // Delete the argument list } | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? - $$.T = new PATypeHolder(HandleUpRefs(ArrayType::get($4.T->get(), + $$.PAT = new PATypeHolder(HandleUpRefs(ArrayType::get($4.PAT->get(), (unsigned)$2))); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? - const llvm::Type* ElemTy = $4.T->get(); + const llvm::Type* ElemTy = $4.PAT->get(); if ((unsigned)$2 != $2) error("Unsigned result not equal to signed result"); if (!(ElemTy->isInteger() || ElemTy->isFloatingPoint())) error("Elements of a PackedType must be integer or floating point"); if (!isPowerOf2_32($2)) error("PackedType length should be a power of 2"); - $$.T = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, + $$.PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, (unsigned)$2))); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | '{' TypeListI '}' { // Structure type? std::vector<const Type*> Elements; for (std::list<llvm::PATypeInfo>::iterator I = $2->begin(), E = $2->end(); I != E; ++I) - Elements.push_back(I->T->get()); - $$.T = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + Elements.push_back(I->PAT->get()); + $$.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); $$.S = Signless; delete $2; } | '{' '}' { // Empty structure type? - $$.T = new PATypeHolder(StructType::get(std::vector<const Type*>())); + $$.PAT = new PATypeHolder(StructType::get(std::vector<const Type*>())); $$.S = Signless; } | '<' '{' TypeListI '}' '>' { // Packed Structure type? std::vector<const Type*> Elements; for (std::list<llvm::PATypeInfo>::iterator I = $3->begin(), E = $3->end(); I != E; ++I) { - Elements.push_back(I->T->get()); - delete I->T; + Elements.push_back(I->PAT->get()); + delete I->PAT; } - $$.T = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + $$.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); $$.S = Signless; delete $3; } | '<' '{' '}' '>' { // Empty packed structure type? - $$.T = new PATypeHolder(StructType::get(std::vector<const Type*>(),true)); + $$.PAT = new PATypeHolder(StructType::get(std::vector<const Type*>(),true)); $$.S = Signless; } | UpRTypes '*' { // Pointer type? - if ($1.T->get() == Type::LabelTy) + if ($1.PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); - $$.T = new PATypeHolder(HandleUpRefs(PointerType::get($1.T->get()))); + $$.PAT = new PATypeHolder(HandleUpRefs(PointerType::get($1.PAT->get()))); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } ; @@ -1889,14 +1908,14 @@ ArgTypeListI : TypeListI | TypeListI ',' DOTDOTDOT { PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; ($$=$1)->push_back(VoidTI); } | DOTDOTDOT { $$ = new std::list<PATypeInfo>(); PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; $$->push_back(VoidTI); } @@ -1913,10 +1932,10 @@ ArgTypeListI // ConstVal : Types '[' ConstVector ']' { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast<ArrayType>($1.T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); @@ -1939,27 +1958,27 @@ ConstVal } $$.C = ConstantArray::get(ATy, Elems); $$.S = $1.S; - delete $1.T; + delete $1.PAT; delete $3; } | Types '[' ']' { - const ArrayType *ATy = dyn_cast<ArrayType>($1.T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) error("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); $$.C = ConstantArray::get(ATy, std::vector<Constant*>()); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types 'c' STRINGCONSTANT { - const ArrayType *ATy = dyn_cast<ArrayType>($1.T->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = dyn_cast<IntegerType>(ATy->getElementType()); if (!ETy || cast<IntegerType>(ETy)->getBitWidth() != 8) @@ -1976,13 +1995,13 @@ ConstVal free($3); $$.C = ConstantArray::get(ATy, Vals); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types '<' ConstVector '>' { // Nonempty unsized arr - const PackedType *PTy = dyn_cast<PackedType>($1.T->get()); + const PackedType *PTy = dyn_cast<PackedType>($1.PAT->get()); if (PTy == 0) error("Cannot make packed constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... @@ -2003,14 +2022,14 @@ ConstVal } $$.C = ConstantPacked::get(PTy, Elems); $$.S = $1.S; - delete $1.T; + delete $1.PAT; delete $3; } | Types '{' ConstVector '}' { - const StructType *STy = dyn_cast<StructType>($1.T->get()); + const StructType *STy = dyn_cast<StructType>($1.PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); if ($3->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for structure type"); @@ -2025,25 +2044,25 @@ ConstVal } $$.C = ConstantStruct::get(STy, Fields); $$.S = $1.S; - delete $1.T; + delete $1.PAT; delete $3; } | Types '{' '}' { - const StructType *STy = dyn_cast<StructType>($1.T->get()); + const StructType *STy = dyn_cast<StructType>($1.PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for structure type"); $$.C = ConstantStruct::get(STy, std::vector<Constant*>()); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types '<' '{' ConstVector '}' '>' { - const StructType *STy = dyn_cast<StructType>($1.T->get()); + const StructType *STy = dyn_cast<StructType>($1.PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); if ($4->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for packed structure type"); @@ -2058,39 +2077,39 @@ ConstVal } $$.C = ConstantStruct::get(STy, Fields); $$.S = $1.S; - delete $1.T; + delete $1.PAT; delete $4; } | Types '<' '{' '}' '>' { - const StructType *STy = dyn_cast<StructType>($1.T->get()); + const StructType *STy = dyn_cast<StructType>($1.PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for packed structure type"); $$.C = ConstantStruct::get(STy, std::vector<Constant*>()); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types NULL_TOK { - const PointerType *PTy = dyn_cast<PointerType>($1.T->get()); + const PointerType *PTy = dyn_cast<PointerType>($1.PAT->get()); if (PTy == 0) error("Cannot make null pointer constant with type: '" + - $1.T->get()->getDescription() + "'"); + $1.PAT->get()->getDescription() + "'"); $$.C = ConstantPointerNull::get(PTy); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types UNDEF { - $$.C = UndefValue::get($1.T->get()); + $$.C = UndefValue::get($1.PAT->get()); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types SymbolicValueRef { - const PointerType *Ty = dyn_cast<PointerType>($1.T->get()); + const PointerType *Ty = dyn_cast<PointerType>($1.PAT->get()); if (Ty == 0) error("Global const reference must be a pointer type, not" + - $1.T->get()->getDescription()); + $1.PAT->get()->getDescription()); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -2142,22 +2161,22 @@ ConstVal } $$.C = cast<GlobalValue>(V); $$.S = $1.S; - delete $1.T; // Free the type handle + delete $1.PAT; // Free the type handle } | Types ConstExpr { - if ($1.T->get() != $2.C->getType()) + if ($1.PAT->get() != $2.C->getType()) error("Mismatched types for constant expression"); $$ = $2; $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | Types ZEROINITIALIZER { - const Type *Ty = $1.T->get(); + const Type *Ty = $1.PAT->get(); if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty)) error("Cannot create a null initialized value of this type"); $$.C = Constant::getNullValue(Ty); $$.S = $1.S; - delete $1.T; + delete $1.PAT; } | SIntType EINT64VAL { // integral constants const Type *Ty = $1.T; @@ -2192,7 +2211,7 @@ ConstVal ConstExpr : CastOps '(' ConstVal TO Types ')' { const Type* SrcTy = $3.C->getType(); - const Type* DstTy = $5.T->get(); + const Type* DstTy = $5.PAT->get(); Signedness SrcSign = $3.S; Signedness DstSign = $5.S; if (!SrcTy->isFirstClassType()) @@ -2203,7 +2222,7 @@ ConstExpr DstTy->getDescription() + "'"); $$.C = cast<Constant>(getCast($1, $3.C, SrcSign, DstTy, DstSign)); $$.S = DstSign; - delete $5.T; + delete $5.PAT; } | GETELEMENTPTR '(' ConstVal IndexList ')' { const Type *Ty = $3.C->getType(); @@ -2385,7 +2404,7 @@ ConstPool // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - const Type* Ty = $4.T->get(); + const Type* Ty = $4.PAT->get(); ResolveTypeTo($2, Ty); if (!setTypeName(Ty, $2) && !$2) { @@ -2393,7 +2412,7 @@ ConstPool // table. CurModule.Types.push_back(Ty); } - delete $4.T; + delete $4.PAT; } | ConstPool FunctionProto { // Function prototypes can be in const pool } @@ -2407,24 +2426,24 @@ ConstPool CurGV = 0; } | ConstPool OptAssign EXTERNAL GlobalType Types { - const Type *Ty = $5.T->get(); + const Type *Ty = $5.PAT->get(); CurGV = ParseGlobalVariable($2, GlobalValue::ExternalLinkage, $4, Ty, 0); - delete $5.T; + delete $5.PAT; } GlobalVarAttributes { CurGV = 0; } | ConstPool OptAssign DLLIMPORT GlobalType Types { - const Type *Ty = $5.T->get(); + const Type *Ty = $5.PAT->get(); CurGV = ParseGlobalVariable($2, GlobalValue::DLLImportLinkage, $4, Ty, 0); - delete $5.T; + delete $5.PAT; } GlobalVarAttributes { CurGV = 0; } | ConstPool OptAssign EXTERN_WEAK GlobalType Types { - const Type *Ty = $5.T->get(); + const Type *Ty = $5.PAT->get(); CurGV = ParseGlobalVariable($2, GlobalValue::ExternalWeakLinkage, $4, Ty, 0); - delete $5.T; + delete $5.PAT; } GlobalVarAttributes { CurGV = 0; } @@ -2499,7 +2518,6 @@ LibList Name : VAR_ID | STRINGCONSTANT - //| '@' STRINGCONSTANT { $$ = $2; } ; OptName @@ -2509,7 +2527,7 @@ OptName ArgVal : Types OptName { - if ($1.T->get() == Type::VoidTy) + if ($1.PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); $$ = new std::pair<PATypeInfo, char*>($1, $2); } @@ -2533,14 +2551,14 @@ ArgList | ArgListH ',' DOTDOTDOT { $$ = $1; PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; $$->push_back(std::pair<PATypeInfo, char*>(VoidTI, 0)); } | DOTDOTDOT { $$ = new std::vector<std::pair<PATypeInfo,char*> >(); PATypeInfo VoidTI; - VoidTI.T = new PATypeHolder(Type::VoidTy); + VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; $$->push_back(std::pair<PATypeInfo, char*>(VoidTI, 0)); } @@ -2553,7 +2571,7 @@ FunctionHeaderH std::string FunctionName($3); free($3); // Free strdup'd memory! - const Type* RetTy = $2.T->get(); + const Type* RetTy = $2.PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("LLVM functions cannot return aggregate types"); @@ -2571,7 +2589,7 @@ FunctionHeaderH } else if ($5) { // If there are arguments... for (std::vector<std::pair<PATypeInfo,char*> >::iterator I = $5->begin(), E = $5->end(); I != E; ++I) { - const Type *Ty = I->first.T->get(); + const Type *Ty = I->first.PAT->get(); ParamTyList.push_back(Ty); } } @@ -2591,7 +2609,7 @@ FunctionHeaderH const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete $2.T; + delete $2.PAT; ValID ID; if (!FunctionName.empty()) { @@ -2601,73 +2619,89 @@ FunctionHeaderH } Function *Fn = 0; + Module* M = CurModule.CurrentModule; + // See if this function was forward referenced. If so, recycle the object. if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) { // Move the function to the end of the list, from whereever it was // previously inserted. Fn = cast<Function>(FWRef); - CurModule.CurrentModule->getFunctionList().remove(Fn); - CurModule.CurrentModule->getFunctionList().push_back(Fn); - } else if (!FunctionName.empty() && // Merge with an earlier prototype? - (Fn = CurModule.CurrentModule->getFunction(FunctionName))) { - if (Fn->getFunctionType() != FT ) { - // The existing function doesn't have the same type. Previously this was - // permitted because the symbol tables had "type planes" and names were - // distinct within a type plane. After PR411 was fixed, this is no - // longer the case. To resolve this we must rename this function. - // However, renaming it can cause problems if its linkage is external - // because it could cause a link failure. We warn about this. - std::string NewName = makeNameUnique(FunctionName); - warning("Renaming function '" + FunctionName + "' as '" + NewName + - "' may cause linkage errors"); - - Fn = new Function(FT, GlobalValue::ExternalLinkage, NewName, - CurModule.CurrentModule); - InsertValue(Fn, CurModule.Values); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = NewName; - } else if (Fn->hasInternalLinkage()) { - // The function we are creating conflicts in name with another function - // that has internal linkage. We'll rename that one quietly to get rid - // of the conflict. - Fn->setName(makeNameUnique(Fn->getName())); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = Fn->getName(); - - Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName, - CurModule.CurrentModule); - - InsertValue(Fn, CurModule.Values); - } else if (CurFun.Linkage == GlobalValue::InternalLinkage) { - // The function we are creating has internal linkage and conflicts with - // another function of the same name. We'll just rename this one - // quietly because its internal linkage can't conflict with anything - // else. - std::string NewName = makeNameUnique(FunctionName); - Fn = new Function(FT, GlobalValue::ExternalLinkage, NewName, - CurModule.CurrentModule); - InsertValue(Fn, CurModule.Values); - RenameMapKey Key = std::make_pair(FunctionName,PFT); - CurModule.RenameMap[Key] = NewName; + M->getFunctionList().remove(Fn); + M->getFunctionList().push_back(Fn); + } else if (!FunctionName.empty()) { + GlobalValue *Conflict = M->getFunction(FunctionName); + if (!Conflict) + Conflict = M->getNamedGlobal(FunctionName); + if (Conflict && PFT == Conflict->getType()) { + if (!CurFun.isDeclare && !Conflict->isDeclaration()) { + // We have two function definitions that conflict, same type, same + // name. We should really check to make sure that this is the result + // of integer type planes collapsing and generate an error if it is + // not, but we'll just rename on the assumption that it is. However, + // let's do it intelligently and rename the internal linkage one + // if there is one. + std::string NewName(makeNameUnique(FunctionName)); + if (Conflict->hasInternalLinkage()) { + Conflict->setName(NewName); + RenameMapKey Key = std::make_pair(FunctionName,Conflict->getType()); + CurModule.RenameMap[Key] = NewName; + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); + } else { + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } + } else { + // If they are not both definitions, then just use the function we + // found since the types are the same. + Fn = cast<Function>(Conflict); + + // Make sure to strip off any argument names so we can't get + // conflicts. + if (Fn->isDeclaration()) + for (Function::arg_iterator AI = Fn->arg_begin(), + AE = Fn->arg_end(); AI != AE; ++AI) + AI->setName(""); + } + } else if (Conflict) { + // We have two globals with the same name and different types. + // Previously, this was permitted because the symbol table had + // "type planes" and names only needed to be distinct within a + // type plane. After PR411 was fixed, this is no loner the case. + // To resolve this we must rename one of the two. + if (Conflict->hasInternalLinkage()) { + // We can safely renamed the Conflict. + Conflict->setName(makeNameUnique(Conflict->getName())); + RenameMapKey Key = std::make_pair(FunctionName,Conflict->getType()); + CurModule.RenameMap[Key] = Conflict->getName(); + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); + } else if (CurFun.Linkage == GlobalValue::InternalLinkage) { + // We can safely rename the function we're defining + std::string NewName = makeNameUnique(FunctionName); + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } else { + // We can't quietly rename either of these things, but we must + // rename one of them. Generate a warning about the renaming and + // elect to rename the thing we're now defining. + std::string NewName = makeNameUnique(FunctionName); + warning("Renaming function '" + FunctionName + "' as '" + NewName + + "' may cause linkage errors"); + Fn = new Function(FT, CurFun.Linkage, NewName, M); + InsertValue(Fn, CurModule.Values); + RenameMapKey Key = std::make_pair(FunctionName,PFT); + CurModule.RenameMap[Key] = NewName; + } } else { - // The types are the same and they are both external linkage. Either - // the existing or the current function needs to be a forward - // declaration. If not, they're attempting to redefine two external - // functions. This wasn't allowed in llvm 1.9 and it isn't allowed now. - if (!CurFun.isDeclare && !Fn->isDeclaration()) - error("Redefinition of function '" + FunctionName + "'"); - - // Make sure to strip off any argument names so we can't get conflicts. - if (Fn->isDeclaration()) - for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end(); - AI != AE; ++AI) - AI->setName(""); + // There's no conflict, just define the function + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); } - } else { // Not already defined? - Fn = new Function(FT, GlobalValue::ExternalLinkage, FunctionName, - CurModule.CurrentModule); - - InsertValue(Fn, CurModule.Values); } CurFun.FunctionStart(Fn); @@ -2688,9 +2722,9 @@ FunctionHeaderH // Add all of the arguments we parsed to the function... if ($5) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert($5->back().first.T->get() == Type::VoidTy && + assert($5->back().first.PAT->get() == Type::VoidTy && $5->back().second == 0 && "Not a varargs marker"); - delete $5->back().first.T; + delete $5->back().first.PAT; $5->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); @@ -2698,7 +2732,7 @@ FunctionHeaderH std::vector<std::pair<PATypeInfo,char*> >::iterator I = $5->begin(); std::vector<std::pair<PATypeInfo,char*> >::iterator E = $5->end(); for ( ; I != E && ArgIt != ArgEnd; ++I, ++ArgIt) { - delete I->first.T; // Delete the typeholder... + delete I->first.PAT; // Delete the typeholder... setValueName(ArgIt, I->second); // Insert arg into symtab... InsertValue(ArgIt); } @@ -2731,13 +2765,14 @@ Function }; FnDeclareLinkage - : /*default*/ - | DLLIMPORT { CurFun.Linkage = GlobalValue::DLLImportLinkage; } - | EXTERN_WEAK { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; } + : /*default*/ { $$ = GlobalValue::ExternalLinkage; } + | DLLIMPORT { $$ = GlobalValue::DLLImportLinkage; } + | EXTERN_WEAK { $$ = GlobalValue::ExternalWeakLinkage; } ; FunctionProto - : DECLARE { CurFun.isDeclare = true; } FnDeclareLinkage FunctionHeaderH { + : DECLARE { CurFun.isDeclare = true; } + FnDeclareLinkage { CurFun.Linkage = $3; } FunctionHeaderH { $$ = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -2817,10 +2852,10 @@ ValueRef // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { - const Type *Ty = $1.T->get(); + const Type *Ty = $1.PAT->get(); $$.S = $1.S; $$.V = getVal(Ty, $2); - delete $1.T; + delete $1.PAT; } ; @@ -2917,7 +2952,7 @@ BBTerminatorInst const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast<PointerType>($3.T->get())) || + if (!(PFTy = dyn_cast<PointerType>($3.PAT->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; @@ -2933,7 +2968,7 @@ BBTerminatorInst } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get($3.T->get(), ParamTypes, isVarArg, ParamAttrs); + Ty = FunctionType::get($3.PAT->get(), ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(Ty); } Value *V = getVal(PFTy, $4); // Get the function we're calling... @@ -2965,7 +3000,7 @@ BBTerminatorInst $$ = new InvokeInst(V, Normal, Except, Args); } cast<InvokeInst>($$)->setCallingConv(upgradeCallingConv($2)); - delete $3.T; + delete $3.PAT; delete $6; } | Unwind { @@ -3032,10 +3067,10 @@ Inst PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes $$.P = new std::list<std::pair<Value*, BasicBlock*> >(); $$.S = $1.S; - Value* tmpVal = getVal($1.T->get(), $3); + Value* tmpVal = getVal($1.PAT->get(), $3); BasicBlock* tmpBB = getBBVal($5); $$.P->push_back(std::make_pair(tmpVal, tmpBB)); - delete $1.T; + delete $1.PAT; } | PHIList ',' '[' ValueRef ',' ValueRef ']' { $$ = $1; @@ -3071,7 +3106,7 @@ OptTailCall InstVal : ArithmeticOps Types ValueRef ',' ValueRef { - const Type* Ty = $2.T->get(); + const Type* Ty = $2.PAT->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa<PackedType>(Ty)) error("Arithmetic operator requires integer, FP, or packed operands"); if (isa<PackedType>(Ty) && @@ -3085,10 +3120,10 @@ InstVal if ($$.I == 0) error("binary operator returned null"); $$.S = $2.S; - delete $2.T; + delete $2.PAT; } | LogicalOps Types ValueRef ',' ValueRef { - const Type *Ty = $2.T->get(); + const Type *Ty = $2.PAT->get(); if (!Ty->isInteger()) { if (!isa<PackedType>(Ty) || !cast<PackedType>(Ty)->getElementType()->isInteger()) @@ -3101,10 +3136,10 @@ InstVal if ($$.I == 0) error("binary operator returned null"); $$.S = $2.S; - delete $2.T; + delete $2.PAT; } | SetCondOps Types ValueRef ',' ValueRef { - const Type* Ty = $2.T->get(); + const Type* Ty = $2.PAT->get(); if(isa<PackedType>(Ty)) error("PackedTypes currently not supported in setcc instructions"); unsigned short pred; @@ -3115,10 +3150,10 @@ InstVal if ($$.I == 0) error("binary operator returned null"); $$.S = Unsigned; - delete $2.T; + delete $2.PAT; } | ICMP IPredicates Types ValueRef ',' ValueRef { - const Type *Ty = $3.T->get(); + const Type *Ty = $3.PAT->get(); if (isa<PackedType>(Ty)) error("PackedTypes currently not supported in icmp instructions"); else if (!Ty->isInteger() && !isa<PointerType>(Ty)) @@ -3127,10 +3162,10 @@ InstVal Value* tmpVal2 = getVal(Ty, $6); $$.I = new ICmpInst($2, tmpVal1, tmpVal2); $$.S = Unsigned; - delete $3.T; + delete $3.PAT; } | FCMP FPredicates Types ValueRef ',' ValueRef { - const Type *Ty = $3.T->get(); + const Type *Ty = $3.PAT->get(); if (isa<PackedType>(Ty)) error("PackedTypes currently not supported in fcmp instructions"); else if (!Ty->isFloatingPoint()) @@ -3139,7 +3174,7 @@ InstVal Value* tmpVal2 = getVal(Ty, $6); $$.I = new FCmpInst($2, tmpVal1, tmpVal2); $$.S = Unsigned; - delete $3.T; + delete $3.PAT; } | NOT ResolvedVal { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); @@ -3171,13 +3206,13 @@ InstVal $$.S = $2.S; } | CastOps ResolvedVal TO Types { - const Type *DstTy = $4.T->get(); + const Type *DstTy = $4.PAT->get(); if (!DstTy->isFirstClassType()) error("cast instruction to a non-primitive type: '" + DstTy->getDescription() + "'"); $$.I = cast<Instruction>(getCast($1, $2.V, $2.S, DstTy, $4.S, true)); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { if (!$2.V->getType()->isInteger() || @@ -3189,15 +3224,15 @@ InstVal $$.S = $2.S; } | VAARG ResolvedVal ',' Types { - const Type *Ty = $4.T->get(); + const Type *Ty = $4.PAT->get(); NewVarArgs = true; $$.I = new VAArgInst($2.V, Ty); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | VAARG_old ResolvedVal ',' Types { const Type* ArgTy = $2.V->getType(); - const Type* DstTy = $4.T->get(); + const Type* DstTy = $4.PAT->get(); ObsoleteVarArgs = true; Function* NF = cast<Function>(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -3214,11 +3249,11 @@ InstVal CurBB->getInstList().push_back(new StoreInst(bar, foo)); $$.I = new VAArgInst(foo, DstTy); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | VANEXT_old ResolvedVal ',' Types { const Type* ArgTy = $2.V->getType(); - const Type* DstTy = $4.T->get(); + const Type* DstTy = $4.PAT->get(); ObsoleteVarArgs = true; Function* NF = cast<Function>(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -3238,7 +3273,7 @@ InstVal CurBB->getInstList().push_back(tmp); $$.I = new LoadInst(foo); $$.S = $4.S; - delete $4.T; + delete $4.PAT; } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { if (!ExtractElementInst::isValidOperands($2.V, $4.V)) @@ -3279,7 +3314,7 @@ InstVal // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; - if (!(PFTy = dyn_cast<PointerType>($3.T->get())) || + if (!(PFTy = dyn_cast<PointerType>($3.PAT->get())) || !(FTy = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; @@ -3297,7 +3332,7 @@ InstVal bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - const Type *RetTy = $3.T->get(); + const Type *RetTy = $3.PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); @@ -3349,7 +3384,7 @@ InstVal $$.I = CI; $$.S = $3.S; } - delete $3.T; + delete $3.PAT; delete $6; } | MemoryInst { @@ -3371,28 +3406,28 @@ OptVolatile MemoryInst : MALLOC Types OptCAlign { - const Type *Ty = $2.T->get(); + const Type *Ty = $2.PAT->get(); $$.S = $2.S; $$.I = new MallocInst(Ty, 0, $3); - delete $2.T; + delete $2.PAT; } | MALLOC Types ',' UINT ValueRef OptCAlign { - const Type *Ty = $2.T->get(); + const Type *Ty = $2.PAT->get(); $$.S = $2.S; $$.I = new MallocInst(Ty, getVal($4.T, $5), $6); - delete $2.T; + delete $2.PAT; } | ALLOCA Types OptCAlign { - const Type *Ty = $2.T->get(); + const Type *Ty = $2.PAT->get(); $$.S = $2.S; $$.I = new AllocaInst(Ty, 0, $3); - delete $2.T; + delete $2.PAT; } | ALLOCA Types ',' UINT ValueRef OptCAlign { - const Type *Ty = $2.T->get(); + const Type *Ty = $2.PAT->get(); $$.S = $2.S; $$.I = new AllocaInst(Ty, getVal($4.T, $5), $6); - delete $2.T; + delete $2.PAT; } | FREE ResolvedVal { const Type *PTy = $2.V->getType(); @@ -3402,7 +3437,7 @@ MemoryInst $$.S = Signless; } | OptVolatile LOAD Types ValueRef { - const Type* Ty = $3.T->get(); + const Type* Ty = $3.PAT->get(); $$.S = $3.S; if (!isa<PointerType>(Ty)) error("Can't load from nonpointer type: " + Ty->getDescription()); @@ -3411,24 +3446,35 @@ MemoryInst Ty->getDescription()); Value* tmpVal = getVal(Ty, $4); $$.I = new LoadInst(tmpVal, "", $1); - delete $3.T; + delete $3.PAT; } | OptVolatile STORE ResolvedVal ',' Types ValueRef { - const PointerType *PTy = dyn_cast<PointerType>($5.T->get()); + const PointerType *PTy = dyn_cast<PointerType>($5.PAT->get()); if (!PTy) error("Can't store to a nonpointer type: " + - $5.T->get()->getDescription()); + $5.PAT->get()->getDescription()); const Type *ElTy = PTy->getElementType(); - if (ElTy != $3.V->getType()) - error("Can't store '" + $3.V->getType()->getDescription() + - "' into space of type '" + ElTy->getDescription() + "'"); + Value *StoreVal = $3.V; Value* tmpVal = getVal(PTy, $6); - $$.I = new StoreInst($3.V, tmpVal, $1); + if (ElTy != $3.V->getType()) { + StoreVal = handleSRetFuncTypeMerge($3.V, ElTy); + if (!StoreVal) + error("Can't store '" + $3.V->getType()->getDescription() + + "' into space of type '" + ElTy->getDescription() + "'"); + else { + PTy = PointerType::get(StoreVal->getType()); + if (Constant *C = dyn_cast<Constant>(tmpVal)) + tmpVal = ConstantExpr::getBitCast(C, PTy); + else + tmpVal = new BitCastInst(tmpVal, PTy, "upgrd.cast", CurBB); + } + } + $$.I = new StoreInst(StoreVal, tmpVal, $1); $$.S = Signless; - delete $5.T; + delete $5.PAT; } | GETELEMENTPTR Types ValueRef IndexList { - const Type* Ty = $2.T->get(); + const Type* Ty = $2.PAT->get(); if (!isa<PointerType>(Ty)) error("getelementptr insn requires pointer operand"); @@ -3438,7 +3484,7 @@ MemoryInst Value* tmpVal = getVal(Ty, $3); $$.I = new GetElementPtrInst(tmpVal, VIndices); $$.S = Signless; - delete $2.T; + delete $2.PAT; delete $4; }; @@ -3448,7 +3494,7 @@ MemoryInst int yyerror(const char *ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename) - + ":" + llvm::utostr((unsigned) Upgradelineno-1) + ": "; + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; std::string errMsg = where + "error: " + std::string(ErrorMsg); if (yychar != YYEMPTY && yychar != 0) errMsg += " while reading token '" + std::string(Upgradetext, Upgradeleng) + @@ -3461,7 +3507,7 @@ int yyerror(const char *ErrorMsg) { void warning(const std::string& ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("<stdin>") : CurFilename) - + ":" + llvm::utostr((unsigned) Upgradelineno-1) + ": "; + + ":" + llvm::utostr((unsigned) Upgradelineno) + ": "; std::string errMsg = where + "warning: " + std::string(ErrorMsg); if (yychar != YYEMPTY && yychar != 0) errMsg += " while reading token '" + std::string(Upgradetext, Upgradeleng) + |