[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y.cvs
Reid Spencer
reid at x10sys.com
Mon Jan 29 11:09:02 PST 2007
Changes in directory llvm/tools/llvm-upgrade:
UpgradeParser.cpp.cvs updated: 1.51 -> 1.52
UpgradeParser.h.cvs updated: 1.38 -> 1.39
UpgradeParser.y.cvs updated: 1.50 -> 1.51
---
Log message:
Regenerate.
---
Diffs of the changes: (+342 -272)
UpgradeParser.cpp.cvs | 569 ++++++++++++++++++++++++++------------------------
UpgradeParser.h.cvs | 2
UpgradeParser.y.cvs | 43 +++
3 files changed, 342 insertions(+), 272 deletions(-)
Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs
diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.51 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.52
--- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.51 Sun Jan 28 23:41:34 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Mon Jan 29 13:08:46 2007
@@ -865,6 +865,25 @@
// 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...
@@ -897,10 +916,26 @@
InsertValue(V, *FutureLateResolvers);
} else {
if (DID.Type == ValID::NameVal) {
- error("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
+ // 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->getNamedFunction(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);
+ return;
+ }
} else {
error("Reference to an invalid definition: #" +
itostr(DID.Num) + " of type '" +
@@ -1781,7 +1816,7 @@
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 1405 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
typedef union YYSTYPE {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -1824,7 +1859,7 @@
llvm::Module::Endianness Endianness;
} YYSTYPE;
/* Line 196 of yacc.c. */
-#line 1828 "UpgradeParser.tab.c"
+#line 1863 "UpgradeParser.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@@ -1836,7 +1871,7 @@
/* Line 219 of yacc.c. */
-#line 1840 "UpgradeParser.tab.c"
+#line 1875 "UpgradeParser.tab.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
@@ -2194,37 +2229,37 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
- 0, 1545, 1545, 1546, 1554, 1555, 1565, 1565, 1565, 1565,
- 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1569, 1569, 1569,
- 1573, 1573, 1573, 1573, 1573, 1573, 1577, 1577, 1578, 1578,
- 1579, 1579, 1580, 1580, 1581, 1581, 1585, 1585, 1586, 1586,
- 1587, 1587, 1588, 1588, 1589, 1589, 1590, 1590, 1591, 1591,
- 1592, 1593, 1596, 1596, 1596, 1596, 1600, 1600, 1600, 1600,
- 1600, 1600, 1600, 1601, 1601, 1601, 1601, 1601, 1601, 1607,
- 1607, 1607, 1607, 1611, 1611, 1611, 1611, 1615, 1615, 1619,
- 1619, 1624, 1627, 1632, 1633, 1634, 1635, 1636, 1637, 1638,
- 1639, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1660,
- 1661, 1669, 1670, 1678, 1687, 1688, 1695, 1696, 1700, 1704,
- 1720, 1721, 1728, 1729, 1736, 1744, 1744, 1744, 1744, 1744,
- 1744, 1744, 1745, 1745, 1745, 1745, 1745, 1750, 1754, 1758,
- 1763, 1772, 1793, 1799, 1812, 1821, 1825, 1836, 1840, 1853,
- 1857, 1864, 1865, 1871, 1878, 1890, 1920, 1933, 1956, 1984,
- 2006, 2017, 2039, 2050, 2059, 2064, 2122, 2129, 2137, 2144,
- 2151, 2155, 2159, 2168, 2183, 2196, 2205, 2233, 2246, 2255,
- 2261, 2267, 2276, 2282, 2288, 2299, 2300, 2309, 2310, 2322,
- 2331, 2332, 2333, 2334, 2335, 2351, 2371, 2373, 2375, 2375,
- 2382, 2382, 2389, 2389, 2396, 2396, 2404, 2406, 2408, 2413,
- 2427, 2428, 2432, 2435, 2443, 2447, 2454, 2458, 2462, 2466,
- 2474, 2474, 2478, 2479, 2483, 2491, 2496, 2504, 2505, 2512,
- 2519, 2523, 2638, 2638, 2642, 2652, 2652, 2656, 2660, 2662,
- 2663, 2667, 2667, 2679, 2680, 2685, 2686, 2687, 2688, 2689,
- 2690, 2691, 2692, 2693, 2714, 2717, 2732, 2733, 2738, 2738,
- 2746, 2755, 2758, 2767, 2777, 2782, 2791, 2802, 2802, 2805,
- 2808, 2811, 2815, 2821, 2836, 2842, 2898, 2901, 2907, 2917,
- 2930, 2959, 2967, 2975, 2979, 2986, 2987, 2991, 2994, 3000,
- 3017, 3033, 3047, 3059, 3071, 3082, 3091, 3100, 3109, 3116,
- 3137, 3161, 3167, 3173, 3179, 3195, 3273, 3281, 3282, 3286,
- 3287, 3291, 3297, 3303, 3309, 3315, 3322, 3334, 3348
+ 0, 1580, 1580, 1581, 1589, 1590, 1600, 1600, 1600, 1600,
+ 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1604, 1604, 1604,
+ 1608, 1608, 1608, 1608, 1608, 1608, 1612, 1612, 1613, 1613,
+ 1614, 1614, 1615, 1615, 1616, 1616, 1620, 1620, 1621, 1621,
+ 1622, 1622, 1623, 1623, 1624, 1624, 1625, 1625, 1626, 1626,
+ 1627, 1628, 1631, 1631, 1631, 1631, 1635, 1635, 1635, 1635,
+ 1635, 1635, 1635, 1636, 1636, 1636, 1636, 1636, 1636, 1642,
+ 1642, 1642, 1642, 1646, 1646, 1646, 1646, 1650, 1650, 1654,
+ 1654, 1659, 1662, 1667, 1668, 1669, 1670, 1671, 1672, 1673,
+ 1674, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1695,
+ 1696, 1704, 1705, 1713, 1722, 1723, 1730, 1731, 1735, 1739,
+ 1755, 1756, 1763, 1764, 1771, 1779, 1779, 1779, 1779, 1779,
+ 1779, 1779, 1780, 1780, 1780, 1780, 1780, 1785, 1789, 1793,
+ 1798, 1807, 1828, 1834, 1847, 1856, 1860, 1871, 1875, 1888,
+ 1892, 1899, 1900, 1906, 1913, 1925, 1955, 1968, 1991, 2019,
+ 2041, 2052, 2074, 2085, 2094, 2099, 2157, 2164, 2172, 2179,
+ 2186, 2190, 2194, 2203, 2218, 2231, 2240, 2268, 2281, 2290,
+ 2296, 2302, 2311, 2317, 2323, 2334, 2335, 2344, 2345, 2357,
+ 2366, 2367, 2368, 2369, 2370, 2386, 2406, 2408, 2410, 2410,
+ 2417, 2417, 2424, 2424, 2431, 2431, 2439, 2441, 2443, 2448,
+ 2462, 2463, 2467, 2470, 2478, 2482, 2489, 2493, 2497, 2501,
+ 2509, 2509, 2513, 2514, 2518, 2526, 2531, 2539, 2540, 2547,
+ 2554, 2558, 2673, 2673, 2677, 2687, 2687, 2691, 2695, 2697,
+ 2698, 2702, 2702, 2714, 2715, 2720, 2721, 2722, 2723, 2724,
+ 2725, 2726, 2727, 2728, 2749, 2752, 2767, 2768, 2773, 2773,
+ 2781, 2790, 2793, 2802, 2812, 2817, 2826, 2837, 2837, 2840,
+ 2843, 2846, 2850, 2856, 2871, 2877, 2933, 2936, 2942, 2952,
+ 2965, 2994, 3002, 3010, 3014, 3021, 3022, 3026, 3029, 3035,
+ 3052, 3068, 3082, 3094, 3106, 3117, 3126, 3135, 3144, 3151,
+ 3172, 3196, 3202, 3208, 3214, 3230, 3308, 3316, 3317, 3321,
+ 3322, 3326, 3332, 3338, 3344, 3350, 3357, 3369, 3383
};
#endif
@@ -3626,7 +3661,7 @@
switch (yyn)
{
case 3:
-#line 1546 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range!
error("Value too large for type");
@@ -3635,7 +3670,7 @@
break;
case 5:
-#line 1555 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range!
error("Value too large for type");
@@ -3644,226 +3679,226 @@
break;
case 26:
-#line 1577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_EQ; ;}
break;
case 27:
-#line 1577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1612 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_NE; ;}
break;
case 28:
-#line 1578 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SLT; ;}
break;
case 29:
-#line 1578 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SGT; ;}
break;
case 30:
-#line 1579 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SLE; ;}
break;
case 31:
-#line 1579 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SGE; ;}
break;
case 32:
-#line 1580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_ULT; ;}
break;
case 33:
-#line 1580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1615 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_UGT; ;}
break;
case 34:
-#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_ULE; ;}
break;
case 35:
-#line 1581 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1616 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_UGE; ;}
break;
case 36:
-#line 1585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OEQ; ;}
break;
case 37:
-#line 1585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1620 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ONE; ;}
break;
case 38:
-#line 1586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OLT; ;}
break;
case 39:
-#line 1586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1621 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OGT; ;}
break;
case 40:
-#line 1587 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OLE; ;}
break;
case 41:
-#line 1587 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OGE; ;}
break;
case 42:
-#line 1588 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ORD; ;}
break;
case 43:
-#line 1588 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UNO; ;}
break;
case 44:
-#line 1589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UEQ; ;}
break;
case 45:
-#line 1589 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UNE; ;}
break;
case 46:
-#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ULT; ;}
break;
case 47:
-#line 1590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UGT; ;}
break;
case 48:
-#line 1591 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ULE; ;}
break;
case 49:
-#line 1591 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1626 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UGE; ;}
break;
case 50:
-#line 1592 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1627 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_TRUE; ;}
break;
case 51:
-#line 1593 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1628 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_FALSE; ;}
break;
case 81:
-#line 1624 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.StrVal) = (yyvsp[-1].StrVal);
;}
break;
case 82:
-#line 1627 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.StrVal) = 0;
;}
break;
case 83:
-#line 1632 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 84:
-#line 1633 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1668 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 85:
-#line 1634 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1669 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 86:
-#line 1635 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
break;
case 87:
-#line 1636 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1671 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 88:
-#line 1637 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 89:
-#line 1638 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1673 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 90:
-#line 1639 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1674 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 91:
-#line 1643 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1678 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;}
break;
case 92:
-#line 1644 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1679 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::C; ;}
break;
case 93:
-#line 1645 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1680 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::CSRet; ;}
break;
case 94:
-#line 1646 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1681 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Fast; ;}
break;
case 95:
-#line 1647 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1682 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::Cold; ;}
break;
case 96:
-#line 1648 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1683 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;}
break;
case 97:
-#line 1649 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1684 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.LastCC = (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;}
break;
case 98:
-#line 1650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1685 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val))
error("Calling conv too large");
@@ -3872,12 +3907,12 @@
break;
case 99:
-#line 1660 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1695 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 100:
-#line 1661 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1696 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.UIntVal) = (yyvsp[0].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3886,12 +3921,12 @@
break;
case 101:
-#line 1669 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 102:
-#line 1670 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1705 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.UIntVal) = (yyvsp[0].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3900,7 +3935,7 @@
break;
case 103:
-#line 1678 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1713 "/proj/llvm/llvm-1/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] == '\\')
@@ -3910,27 +3945,27 @@
break;
case 104:
-#line 1687 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 105:
-#line 1688 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = (yyvsp[0].StrVal); ;}
break;
case 106:
-#line 1695 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1730 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{;}
break;
case 107:
-#line 1696 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{;}
break;
case 108:
-#line 1700 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1735 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV->setSection((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -3938,7 +3973,7 @@
break;
case 109:
-#line 1704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1739 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val)))
error("Alignment must be a power of two");
@@ -3948,7 +3983,7 @@
break;
case 111:
-#line 1721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1756 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T);
(yyval.TypeVal).S = Signless;
@@ -3956,7 +3991,7 @@
break;
case 113:
-#line 1729 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T);
(yyval.TypeVal).S = Signless;
@@ -3964,7 +3999,7 @@
break;
case 114:
-#line 1736 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!UpRefs.empty())
error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).T)->getDescription());
@@ -3973,7 +4008,7 @@
break;
case 127:
-#line 1750 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1785 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).T = new PATypeHolder((yyvsp[0].PrimType).T);
(yyval.TypeVal).S = (yyvsp[0].PrimType).S;
@@ -3981,7 +4016,7 @@
break;
case 128:
-#line 1754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1789 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).T = new PATypeHolder(OpaqueType::get());
(yyval.TypeVal).S = Signless;
@@ -3989,7 +4024,7 @@
break;
case 129:
-#line 1758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Named types are also simple types...
const Type* tmp = getType((yyvsp[0].ValIDVal));
(yyval.TypeVal).T = new PATypeHolder(tmp);
@@ -3998,7 +4033,7 @@
break;
case 130:
-#line 1763 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1798 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Type UpReference
if ((yyvsp[0].UInt64Val) > (uint64_t)~0U)
error("Value out of range");
@@ -4011,7 +4046,7 @@
break;
case 131:
-#line 1772 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1807 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Function derived type?
std::vector<const Type*> Params;
for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(),
@@ -4036,7 +4071,7 @@
break;
case 132:
-#line 1793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1828 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Sized array type?
(yyval.TypeVal).T = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).T->get(),
(unsigned)(yyvsp[-3].UInt64Val))));
@@ -4046,7 +4081,7 @@
break;
case 133:
-#line 1799 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1834 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Packed array type?
const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).T->get();
if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val))
@@ -4063,7 +4098,7 @@
break;
case 134:
-#line 1812 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1847 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Structure type?
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(),
@@ -4076,7 +4111,7 @@
break;
case 135:
-#line 1821 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Empty structure type?
(yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector<const Type*>()));
(yyval.TypeVal).S = Signless;
@@ -4084,7 +4119,7 @@
break;
case 136:
-#line 1825 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1860 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Packed Structure type?
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeInfo>::iterator I = (yyvsp[-2].TypeList)->begin(),
@@ -4099,7 +4134,7 @@
break;
case 137:
-#line 1836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Empty packed structure type?
(yyval.TypeVal).T = new PATypeHolder(StructType::get(std::vector<const Type*>(),true));
(yyval.TypeVal).S = Signless;
@@ -4107,7 +4142,7 @@
break;
case 138:
-#line 1840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1875 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Pointer type?
if ((yyvsp[-1].TypeVal).T->get() == Type::LabelTy)
error("Cannot form a pointer to a basic block");
@@ -4118,7 +4153,7 @@
break;
case 139:
-#line 1853 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1888 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
(yyval.TypeList)->push_back((yyvsp[0].TypeVal));
@@ -4126,14 +4161,14 @@
break;
case 140:
-#line 1857 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1892 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal));
;}
break;
case 142:
-#line 1865 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1900 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
PATypeInfo VoidTI;
VoidTI.T = new PATypeHolder(Type::VoidTy);
@@ -4143,7 +4178,7 @@
break;
case 143:
-#line 1871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1906 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
PATypeInfo VoidTI;
@@ -4154,14 +4189,14 @@
break;
case 144:
-#line 1878 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
;}
break;
case 145:
-#line 1890 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized arr
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal).T->get());
if (ATy == 0)
@@ -4195,7 +4230,7 @@
break;
case 146:
-#line 1920 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1955 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).T->get());
if (ATy == 0)
@@ -4212,7 +4247,7 @@
break;
case 147:
-#line 1933 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1968 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).T->get());
if (ATy == 0)
@@ -4239,7 +4274,7 @@
break;
case 148:
-#line 1956 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1991 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized arr
const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal).T->get());
if (PTy == 0)
@@ -4271,7 +4306,7 @@
break;
case 149:
-#line 1984 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2019 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal).T->get());
if (STy == 0)
@@ -4297,7 +4332,7 @@
break;
case 150:
-#line 2006 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2041 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal).T->get());
if (STy == 0)
@@ -4312,7 +4347,7 @@
break;
case 151:
-#line 2017 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-5].TypeVal).T->get());
if (STy == 0)
@@ -4338,7 +4373,7 @@
break;
case 152:
-#line 2039 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2074 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-4].TypeVal).T->get());
if (STy == 0)
@@ -4353,7 +4388,7 @@
break;
case 153:
-#line 2050 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2085 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get());
if (PTy == 0)
@@ -4366,7 +4401,7 @@
break;
case 154:
-#line 2059 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).T->get());
(yyval.ConstVal).S = (yyvsp[-1].TypeVal).S;
@@ -4375,7 +4410,7 @@
break;
case 155:
-#line 2064 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get());
if (Ty == 0)
@@ -4437,7 +4472,7 @@
break;
case 156:
-#line 2122 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2157 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[-1].TypeVal).T->get() != (yyvsp[0].ConstVal).C->getType())
error("Mismatched types for constant expression");
@@ -4448,7 +4483,7 @@
break;
case 157:
-#line 2129 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2164 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).T->get();
if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
@@ -4460,7 +4495,7 @@
break;
case 158:
-#line 2137 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // integral constants
const Type *Ty = (yyvsp[-1].PrimType).T;
if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val)))
@@ -4471,7 +4506,7 @@
break;
case 159:
-#line 2144 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2179 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // integral constants
const Type *Ty = (yyvsp[-1].PrimType).T;
if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val)))
@@ -4482,7 +4517,7 @@
break;
case 160:
-#line 2151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Boolean constants
(yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true);
(yyval.ConstVal).S = Unsigned;
@@ -4490,7 +4525,7 @@
break;
case 161:
-#line 2155 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2190 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Boolean constants
(yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false);
(yyval.ConstVal).S = Unsigned;
@@ -4498,7 +4533,7 @@
break;
case 162:
-#line 2159 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2194 "/proj/llvm/llvm-1/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");
@@ -4508,7 +4543,7 @@
break;
case 163:
-#line 2168 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2203 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType();
const Type* DstTy = (yyvsp[-1].TypeVal).T->get();
@@ -4527,7 +4562,7 @@
break;
case 164:
-#line 2183 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2218 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-2].ConstVal).C->getType();
if (!isa<PointerType>(Ty))
@@ -4544,7 +4579,7 @@
break;
case 165:
-#line 2196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2231 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() ||
cast<IntegerType>((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1)
@@ -4557,7 +4592,7 @@
break;
case 166:
-#line 2205 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2240 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-3].ConstVal).C->getType();
if (Ty != (yyvsp[-1].ConstVal).C->getType())
@@ -4589,7 +4624,7 @@
break;
case 167:
-#line 2233 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2268 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-3].ConstVal).C->getType();
if (Ty != (yyvsp[-1].ConstVal).C->getType())
@@ -4606,7 +4641,7 @@
break;
case 168:
-#line 2246 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2281 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-3].ConstVal).C->getType();
if (Ty != (yyvsp[-1].ConstVal).C->getType())
@@ -4619,7 +4654,7 @@
break;
case 169:
-#line 2255 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2290 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType())
error("icmp operand types must match");
@@ -4629,7 +4664,7 @@
break;
case 170:
-#line 2261 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2296 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType())
error("fcmp operand types must match");
@@ -4639,7 +4674,7 @@
break;
case 171:
-#line 2267 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2302 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() ||
cast<IntegerType>((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8)
@@ -4652,7 +4687,7 @@
break;
case 172:
-#line 2276 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2311 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C))
error("Invalid extractelement operands");
@@ -4662,7 +4697,7 @@
break;
case 173:
-#line 2282 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C))
error("Invalid insertelement operands");
@@ -4672,7 +4707,7 @@
break;
case 174:
-#line 2288 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2323 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C))
error("Invalid shufflevector operands");
@@ -4682,12 +4717,12 @@
break;
case 175:
-#line 2299 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;}
break;
case 176:
-#line 2300 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ConstVector) = new std::vector<ConstInfo>();
(yyval.ConstVector)->push_back((yyvsp[0].ConstVal));
@@ -4695,17 +4730,17 @@
break;
case 177:
-#line 2309 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 178:
-#line 2310 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 179:
-#line 2322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal);
CurModule.ModuleDone();
@@ -4713,27 +4748,27 @@
break;
case 180:
-#line 2331 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2366 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;}
break;
case 181:
-#line 2332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;}
break;
case 182:
-#line 2333 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;}
break;
case 183:
-#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;}
break;
case 184:
-#line 2335 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ModuleVal) = CurModule.CurrentModule;
// Emit an error if there are any unresolved types left.
@@ -4749,7 +4784,7 @@
break;
case 185:
-#line 2351 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2386 "/proj/llvm/llvm-1/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:
@@ -4773,19 +4808,19 @@
break;
case 186:
-#line 2371 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2406 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Function prototypes can be in const pool
;}
break;
case 187:
-#line 2373 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2408 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Asm blocks can be in the const pool
;}
break;
case 188:
-#line 2375 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2410 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].ConstVal).C == 0)
error("Global value initializer is not a constant");
@@ -4794,14 +4829,14 @@
break;
case 189:
-#line 2379 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2414 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 190:
-#line 2382 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2417 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].TypeVal).T->get();
CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0);
@@ -4810,14 +4845,14 @@
break;
case 191:
-#line 2386 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2421 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 192:
-#line 2389 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2424 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].TypeVal).T->get();
CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0);
@@ -4826,14 +4861,14 @@
break;
case 193:
-#line 2393 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2428 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 194:
-#line 2396 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2431 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].TypeVal).T->get();
CurGV =
@@ -4843,32 +4878,32 @@
break;
case 195:
-#line 2401 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 196:
-#line 2404 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2439 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 197:
-#line 2406 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2441 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 198:
-#line 2408 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2443 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 199:
-#line 2413 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2448 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
@@ -4883,24 +4918,24 @@
break;
case 200:
-#line 2427 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2462 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Endianness) = Module::BigEndian; ;}
break;
case 201:
-#line 2428 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2463 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Endianness) = Module::LittleEndian; ;}
break;
case 202:
-#line 2432 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2467 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.setEndianness((yyvsp[0].Endianness));
;}
break;
case 203:
-#line 2435 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2470 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].UInt64Val) == 32)
CurModule.setPointerSize(Module::Pointer32);
@@ -4912,7 +4947,7 @@
break;
case 204:
-#line 2443 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2478 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4920,7 +4955,7 @@
break;
case 205:
-#line 2447 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4928,7 +4963,7 @@
break;
case 207:
-#line 2458 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2493 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4936,7 +4971,7 @@
break;
case 208:
-#line 2462 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2497 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4944,17 +4979,17 @@
break;
case 209:
-#line 2466 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2501 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ ;}
break;
case 213:
-#line 2479 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2514 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 214:
-#line 2483 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2518 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[-1].TypeVal).T->get() == Type::VoidTy)
error("void typed arguments are invalid");
@@ -4963,7 +4998,7 @@
break;
case 215:
-#line 2491 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2526 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = (yyvsp[-2].ArgList);
(yyval.ArgList)->push_back(*(yyvsp[0].ArgVal));
@@ -4972,7 +5007,7 @@
break;
case 216:
-#line 2496 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2531 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >();
(yyval.ArgList)->push_back(*(yyvsp[0].ArgVal));
@@ -4981,12 +5016,12 @@
break;
case 217:
-#line 2504 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2539 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ArgList) = (yyvsp[0].ArgList); ;}
break;
case 218:
-#line 2505 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2540 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = (yyvsp[-2].ArgList);
PATypeInfo VoidTI;
@@ -4997,7 +5032,7 @@
break;
case 219:
-#line 2512 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2547 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >();
PATypeInfo VoidTI;
@@ -5008,12 +5043,12 @@
break;
case 220:
-#line 2519 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2554 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ArgList) = 0; ;}
break;
case 221:
-#line 2523 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2558 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
UnEscapeLexed((yyvsp[-5].StrVal));
std::string FunctionName((yyvsp[-5].StrVal));
@@ -5129,7 +5164,7 @@
break;
case 224:
-#line 2642 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2677 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
@@ -5140,29 +5175,29 @@
break;
case 227:
-#line 2656 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2691 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
;}
break;
case 229:
-#line 2662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2697 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.Linkage = GlobalValue::DLLImportLinkage; ;}
break;
case 230:
-#line 2663 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2698 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;}
break;
case 231:
-#line 2667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.isDeclare = true; ;}
break;
case 232:
-#line 2667 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
CurFun.FunctionDone();
@@ -5171,57 +5206,57 @@
break;
case 233:
-#line 2679 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 234:
-#line 2680 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2715 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 235:
-#line 2685 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2720 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;}
break;
case 236:
-#line 2686 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;}
break;
case 237:
-#line 2687 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2722 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;}
break;
case 238:
-#line 2688 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;}
break;
case 239:
-#line 2689 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2724 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;}
break;
case 240:
-#line 2690 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2725 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createNull(); ;}
break;
case 241:
-#line 2691 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2726 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createUndef(); ;}
break;
case 242:
-#line 2692 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2727 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createZeroInit(); ;}
break;
case 243:
-#line 2693 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2728 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType();
int NumElements = (yyvsp[-1].ConstVector)->size();
@@ -5246,14 +5281,14 @@
break;
case 244:
-#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2749 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C);
;}
break;
case 245:
-#line 2717 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2752 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
char *End = UnEscapeLexed((yyvsp[-2].StrVal), true);
std::string AsmStr = std::string((yyvsp[-2].StrVal), End);
@@ -5266,17 +5301,17 @@
break;
case 246:
-#line 2732 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); ;}
break;
case 247:
-#line 2733 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2768 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); ;}
break;
case 250:
-#line 2746 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2781 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).T->get();
(yyval.ValueVal).S = (yyvsp[-1].TypeVal).S;
@@ -5286,21 +5321,21 @@
break;
case 251:
-#line 2755 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2790 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
;}
break;
case 252:
-#line 2758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Do not allow functions with 0 basic blocks
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
;}
break;
case 253:
-#line 2767 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal));
InsertValue((yyvsp[0].TermInstVal));
@@ -5311,7 +5346,7 @@
break;
case 254:
-#line 2777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2812 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[0].InstVal).I)
(yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I);
@@ -5320,7 +5355,7 @@
break;
case 255:
-#line 2782 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2817 "/proj/llvm/llvm-1/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
@@ -5333,7 +5368,7 @@
break;
case 256:
-#line 2791 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2826 "/proj/llvm/llvm-1/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
@@ -5346,21 +5381,21 @@
break;
case 259:
-#line 2805 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Return with a result...
(yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).V);
;}
break;
case 260:
-#line 2808 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2843 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Return with no result...
(yyval.TermInstVal) = new ReturnInst();
;}
break;
case 261:
-#line 2811 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2846 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal));
(yyval.TermInstVal) = new BranchInst(tmpBB);
@@ -5368,7 +5403,7 @@
break;
case 262:
-#line 2815 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2850 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal));
BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal));
@@ -5378,7 +5413,7 @@
break;
case 263:
-#line 2821 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal));
BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal));
@@ -5397,7 +5432,7 @@
break;
case 264:
-#line 2836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2871 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal));
BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal));
@@ -5407,7 +5442,7 @@
break;
case 265:
-#line 2843 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2878 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *PFTy;
const FunctionType *Ty;
@@ -5466,21 +5501,21 @@
break;
case 266:
-#line 2898 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2933 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal) = new UnwindInst();
;}
break;
case 267:
-#line 2901 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2936 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal) = new UnreachableInst();
;}
break;
case 268:
-#line 2907 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2942 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.JumpTable) = (yyvsp[-5].JumpTable);
Constant *V = cast<Constant>(getExistingValue((yyvsp[-4].PrimType).T, (yyvsp[-3].ValIDVal)));
@@ -5494,7 +5529,7 @@
break;
case 269:
-#line 2917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2952 "/proj/llvm/llvm-1/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)));
@@ -5508,7 +5543,7 @@
break;
case 270:
-#line 2930 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2965 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
bool omit = false;
if ((yyvsp[-1].StrVal))
@@ -5540,7 +5575,7 @@
break;
case 271:
-#line 2959 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 2994 "/proj/llvm/llvm-1/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;
@@ -5552,7 +5587,7 @@
break;
case 272:
-#line 2967 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3002 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.PHIList) = (yyvsp[-6].PHIList);
Value* tmpVal = getVal((yyvsp[-6].PHIList).P->front().first->getType(), (yyvsp[-3].ValIDVal));
@@ -5562,7 +5597,7 @@
break;
case 273:
-#line 2975 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3010 "/proj/llvm/llvm-1/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));
@@ -5570,7 +5605,7 @@
break;
case 274:
-#line 2979 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValueList) = (yyvsp[-2].ValueList);
(yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal));
@@ -5578,26 +5613,26 @@
break;
case 276:
-#line 2987 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3022 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = 0; ;}
break;
case 277:
-#line 2991 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3026 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = true;
;}
break;
case 278:
-#line 2994 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3029 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = false;
;}
break;
case 279:
-#line 3000 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3035 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-3].TypeVal).T->get();
if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa<PackedType>(Ty))
@@ -5618,7 +5653,7 @@
break;
case 280:
-#line 3017 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3052 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-3].TypeVal).T->get();
if (!Ty->isInteger()) {
@@ -5638,7 +5673,7 @@
break;
case 281:
-#line 3033 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3068 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-3].TypeVal).T->get();
if(isa<PackedType>(Ty))
@@ -5656,7 +5691,7 @@
break;
case 282:
-#line 3047 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3082 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-3].TypeVal).T->get();
if (isa<PackedType>(Ty))
@@ -5672,7 +5707,7 @@
break;
case 283:
-#line 3059 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-3].TypeVal).T->get();
if (isa<PackedType>(Ty))
@@ -5688,7 +5723,7 @@
break;
case 284:
-#line 3071 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3106 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
warning("Use of obsolete 'not' instruction: Replacing with 'xor");
const Type *Ty = (yyvsp[0].ValueVal).V->getType();
@@ -5703,7 +5738,7 @@
break;
case 285:
-#line 3082 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3117 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[0].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8)
@@ -5716,7 +5751,7 @@
break;
case 286:
-#line 3091 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3126 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *DstTy = (yyvsp[0].TypeVal).T->get();
if (!DstTy->isFirstClassType())
@@ -5729,7 +5764,7 @@
break;
case 287:
-#line 3100 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3135 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1)
@@ -5742,7 +5777,7 @@
break;
case 288:
-#line 3109 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3144 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].TypeVal).T->get();
NewVarArgs = true;
@@ -5753,7 +5788,7 @@
break;
case 289:
-#line 3116 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType();
const Type* DstTy = (yyvsp[0].TypeVal).T->get();
@@ -5778,7 +5813,7 @@
break;
case 290:
-#line 3137 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3172 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType();
const Type* DstTy = (yyvsp[0].TypeVal).T->get();
@@ -5806,7 +5841,7 @@
break;
case 291:
-#line 3161 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3196 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid extractelement operands");
@@ -5816,7 +5851,7 @@
break;
case 292:
-#line 3167 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3202 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid insertelement operands");
@@ -5826,7 +5861,7 @@
break;
case 293:
-#line 3173 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3208 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid shufflevector operands");
@@ -5836,7 +5871,7 @@
break;
case 294:
-#line 3179 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3214 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType();
if (!Ty->isFirstClassType())
@@ -5856,7 +5891,7 @@
break;
case 295:
-#line 3195 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3230 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
// Handle the short call syntax
@@ -5938,34 +5973,34 @@
break;
case 296:
-#line 3273 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3308 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.InstVal) = (yyvsp[0].InstVal);
;}
break;
case 297:
-#line 3281 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3316 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = (yyvsp[0].ValueList); ;}
break;
case 298:
-#line 3282 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3317 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = new std::vector<ValueInfo>(); ;}
break;
case 299:
-#line 3286 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3321 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 300:
-#line 3287 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 301:
-#line 3291 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3326 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).T->get();
(yyval.InstVal).S = (yyvsp[-1].TypeVal).S;
@@ -5975,7 +6010,7 @@
break;
case 302:
-#line 3297 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-4].TypeVal).T->get();
(yyval.InstVal).S = (yyvsp[-4].TypeVal).S;
@@ -5985,7 +6020,7 @@
break;
case 303:
-#line 3303 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3338 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).T->get();
(yyval.InstVal).S = (yyvsp[-1].TypeVal).S;
@@ -5995,7 +6030,7 @@
break;
case 304:
-#line 3309 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-4].TypeVal).T->get();
(yyval.InstVal).S = (yyvsp[-4].TypeVal).S;
@@ -6005,7 +6040,7 @@
break;
case 305:
-#line 3315 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3350 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *PTy = (yyvsp[0].ValueVal).V->getType();
if (!isa<PointerType>(PTy))
@@ -6016,7 +6051,7 @@
break;
case 306:
-#line 3322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3357 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-1].TypeVal).T->get();
(yyval.InstVal).S = (yyvsp[-1].TypeVal).S;
@@ -6032,7 +6067,7 @@
break;
case 307:
-#line 3334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3369 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).T->get());
if (!PTy)
@@ -6050,7 +6085,7 @@
break;
case 308:
-#line 3348 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-2].TypeVal).T->get();
if (!isa<PointerType>(Ty))
@@ -6072,7 +6107,7 @@
}
/* Line 1126 of yacc.c. */
-#line 6076 "UpgradeParser.tab.c"
+#line 6111 "UpgradeParser.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@@ -6340,7 +6375,7 @@
}
-#line 3364 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3399 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
int yyerror(const char *ErrorMsg) {
Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs
diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.38 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.39
--- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.38 Sun Jan 28 23:41:34 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Mon Jan 29 13:08:46 2007
@@ -335,7 +335,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 1405 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 1440 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
typedef union YYSTYPE {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.50 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.51
--- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.50 Sun Jan 28 23:41:34 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Mon Jan 29 13:08:46 2007
@@ -505,6 +505,25 @@
// 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...
@@ -537,10 +556,26 @@
InsertValue(V, *FutureLateResolvers);
} else {
if (DID.Type == ValID::NameVal) {
- error("Reference to an invalid definition: '" +DID.getName()+
- "' of type '" + V->getType()->getDescription() + "'",
- PHI->second.second);
- return;
+ // 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->getNamedFunction(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);
+ return;
+ }
} else {
error("Reference to an invalid definition: #" +
itostr(DID.Num) + " of type '" +
More information about the llvm-commits
mailing list