llvm.org GIT mirror llvm / 041e2eb
IR support for extractvalue and insertvalue instructions. Also, begin moving toward making structs and arrays first-class types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
15 changed file(s) with 947 addition(s) and 361 deletion(s). Raw diff Collapse all Expand all
574574 Constant *Elt, Constant *Idx);
575575 static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1,
576576 Constant *V2, Constant *Mask);
577 static Constant *getExtractValueTy(const Type *Ty, Constant *Agg,
578 Constant * const *Idxs, unsigned NumIdxs);
579 static Constant *getInsertValueTy(const Type *Ty, Constant *Agg,
580 Constant *Val,
581 Constant * const *Idxs, unsigned NumIdxs);
577582
578583 public:
579584 // Static methods to construct a ConstantExpr of different kinds. Note that
705710 static Constant *getExtractElement(Constant *Vec, Constant *Idx);
706711 static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);
707712 static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
713 static Constant *getExtractValue(Constant *Agg,
714 Constant* const *IdxList, unsigned NumIdx);
715 static Constant *getInsertValue(Constant *Agg, Constant *Val,
716 Constant* const *IdxList, unsigned NumIdx);
708717
709718 /// Floating point negation must be implemented with f(x) = -0.0 - x. This
710719 /// method returns the negative zero constant for floating point or vector
160160 HANDLE_OTHER_INST(45, UserOp1, Instruction) // May be used internally in a pass
161161 HANDLE_OTHER_INST(46, UserOp2, Instruction) // Internal to passes only
162162 HANDLE_OTHER_INST(47, VAArg , VAArgInst ) // vaarg instruction
163 HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector.
163 HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector
164164 HANDLE_OTHER_INST(49, InsertElement, InsertElementInst) // insert into vector
165165 HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
166166 HANDLE_OTHER_INST(51, GetResult, GetResultInst) // Extract individual value
167167 //from aggregate result
168 HANDLE_OTHER_INST(52, VICmp , VICmpInst ) // Vec Int comparison instruction.
169 HANDLE_OTHER_INST(53, VFCmp , VFCmpInst ) // Vec FP point comparison instr.
168 HANDLE_OTHER_INST(52, ExtractValue, ExtractValueInst)// extract from aggregate
169 HANDLE_OTHER_INST(53, InsertValue, InsertValueInst) // insert into aggregate
170 HANDLE_OTHER_INST(54, VICmp , VICmpInst ) // Vec Int comparison instruction.
171 HANDLE_OTHER_INST(55, VFCmp , VFCmpInst ) // Vec FP point comparison instr.
170172
171 LAST_OTHER_INST(53)
173 LAST_OTHER_INST(55)
172174
173175 #undef FIRST_TERM_INST
174176 #undef HANDLE_TERM_INST
407407 /// pointer type.
408408 ///
409409 static const Type *getIndexedType(const Type *Ptr,
410 Value* const *Idx, unsigned NumIdx,
411 bool AllowStructLeaf = false);
410 Value* const *Idx, unsigned NumIdx);
412411
413412 template
414413 static const Type *getIndexedType(const Type *Ptr,
415414 InputIterator IdxBegin,
416415 InputIterator IdxEnd,
417 bool AllowStructLeaf,
418416 // This argument ensures that we
419417 // have an iterator we can do
420418 // arithmetic on in constant time
421419 std::random_access_iterator_tag) {
422420 unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd));
423421
424 if (NumIdx > 0) {
422 if (NumIdx > 0)
425423 // This requires that the iterator points to contiguous memory.
426 return(getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx,
427 AllowStructLeaf));
428 }
429 else {
430 return(getIndexedType(Ptr, (Value *const*)0, NumIdx, AllowStructLeaf));
431 }
424 return getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx);
425 else
426 return getIndexedType(Ptr, (Value *const*)0, NumIdx);
432427 }
433428
434429 /// Constructors - Create a getelementptr instruction with a base pointer an
507502 template
508503 static const Type *getIndexedType(const Type *Ptr,
509504 InputIterator IdxBegin,
510 InputIterator IdxEnd,
511 bool AllowStructLeaf = false) {
512 return(getIndexedType(Ptr, IdxBegin, IdxEnd, AllowStructLeaf,
505 InputIterator IdxEnd) {
506 return getIndexedType(Ptr, IdxBegin, IdxEnd,
513507 typename std::iterator_traits::
514 iterator_category()));
508 iterator_category());
515509 }
516510 static const Type *getIndexedType(const Type *Ptr, Value *Idx);
517511
572566 Instruction *InsertBefore)
573567 : Instruction(PointerType::get(checkType(
574568 getIndexedType(Ptr->getType(),
575 IdxBegin, IdxEnd, true)),
569 IdxBegin, IdxEnd)),
576570 cast(Ptr->getType())
577571 ->getAddressSpace()),
578572 GetElementPtr,
590584 BasicBlock *InsertAtEnd)
591585 : Instruction(PointerType::get(checkType(
592586 getIndexedType(Ptr->getType(),
593 IdxBegin, IdxEnd, true)),
587 IdxBegin, IdxEnd)),
594588 cast(Ptr->getType())
595589 ->getAddressSpace()),
596590 GetElementPtr,
14951489 };
14961490
14971491 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorInst, Value)
1492
1493 //===----------------------------------------------------------------------===//
1494 // ExtractValueInst Class
1495 //===----------------------------------------------------------------------===//
1496
1497 /// ExtractValueInst - This instruction extracts a value
1498 /// from an aggregate value
1499 ///
1500 class ExtractValueInst : public Instruction {
1501 ExtractValueInst(const ExtractValueInst &EVI);
1502 void init(Value *Agg, Value* const *Idx, unsigned NumIdx);
1503 void init(Value *Agg, Value *Idx);
1504
1505 template
1506 void init(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd,
1507 const std::string &Name,
1508 // This argument ensures that we have an iterator we can
1509 // do arithmetic on in constant time
1510 std::random_access_iterator_tag) {
1511 unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd));
1512
1513 if (NumIdx > 0) {
1514 // This requires that the iterator points to contiguous memory.
1515 init(Agg, &*IdxBegin, NumIdx); // FIXME: for the general case
1516 // we have to build an array here
1517 }
1518 else {
1519 init(Agg, 0, NumIdx);
1520 }
1521
1522 setName(Name);
1523 }
1524
1525 /// getIndexedType - Returns the type of the element that would be extracted
1526 /// with an extractvalue instruction with the specified parameters.
1527 ///
1528 /// A null type is returned if the indices are invalid for the specified
1529 /// pointer type.
1530 ///
1531 static const Type *getIndexedType(const Type *Agg,
1532 Value* const *Idx, unsigned NumIdx);
1533
1534 template
1535 static const Type *getIndexedType(const Type *Ptr,
1536 InputIterator IdxBegin,
1537 InputIterator IdxEnd,
1538 // This argument ensures that we
1539 // have an iterator we can do
1540 // arithmetic on in constant time
1541 std::random_access_iterator_tag) {
1542 unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd));
1543
1544 if (NumIdx > 0)
1545 // This requires that the iterator points to contiguous memory.
1546 return getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx);
1547 else
1548 return getIndexedType(Ptr, (Value *const*)0, NumIdx);
1549 }
1550
1551 /// Constructors - Create a extractvalue instruction with a base pointer an
1552 /// list of indices. The first ctor can optionally insert before an existing
1553 /// instruction, the second appends the new instruction to the specified
1554 /// BasicBlock.
1555 template
1556 inline ExtractValueInst(Value *Agg, InputIterator IdxBegin,
1557 InputIterator IdxEnd,
1558 unsigned Values,
1559 const std::string &Name,
1560 Instruction *InsertBefore);
1561 template
1562 inline ExtractValueInst(Value *Agg,
1563 InputIterator IdxBegin, InputIterator IdxEnd,
1564 unsigned Values,
1565 const std::string &Name, BasicBlock *InsertAtEnd);
1566
1567 /// Constructors - These two constructors are convenience methods because one
1568 /// and two index extractvalue instructions are so common.
1569 ExtractValueInst(Value *Agg, Value *Idx, const std::string &Name = "",
1570 Instruction *InsertBefore = 0);
1571 ExtractValueInst(Value *Agg, Value *Idx,
1572 const std::string &Name, BasicBlock *InsertAtEnd);
1573 public:
1574 template
1575 static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin,
1576 InputIterator IdxEnd,
1577 const std::string &Name = "",
1578 Instruction *InsertBefore = 0) {
1579 typename std::iterator_traits::difference_type Values =
1580 1 + std::distance(IdxBegin, IdxEnd);
1581 return new(Values)
1582 ExtractValueInst(Agg, IdxBegin, IdxEnd, Values, Name, InsertBefore);
1583 }
1584 template
1585 static ExtractValueInst *Create(Value *Agg,
1586 InputIterator IdxBegin, InputIterator IdxEnd,
1587 const std::string &Name,
1588 BasicBlock *InsertAtEnd) {
1589 typename std::iterator_traits::difference_type Values =
1590 1 + std::distance(IdxBegin, IdxEnd);
1591 return new(Values)
1592 ExtractValueInst(Agg, IdxBegin, IdxEnd, Values, Name, InsertAtEnd);
1593 }
1594
1595 /// Constructors - These two creators are convenience methods because one
1596 /// index extractvalue instructions are much more common than those with
1597 /// more than one.
1598 static ExtractValueInst *Create(Value *Agg, Value *Idx,
1599 const std::string &Name = "",
1600 Instruction *InsertBefore = 0) {
1601 return new(2) ExtractValueInst(Agg, Idx, Name, InsertBefore);
1602 }
1603 static ExtractValueInst *Create(Value *Agg, Value *Idx,
1604 const std::string &Name,
1605 BasicBlock *InsertAtEnd) {
1606 return new(2) ExtractValueInst(Agg, Idx, Name, InsertAtEnd);
1607 }
1608
1609 virtual ExtractValueInst *clone() const;
1610
1611 /// Transparently provide more efficient getOperand methods.
1612 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
1613
1614 // getType - Overload to return most specific pointer type...
1615 const PointerType *getType() const {
1616 return reinterpret_cast(Instruction::getType());
1617 }
1618
1619 /// getIndexedType - Returns the type of the element that would be extracted
1620 /// with an extractvalue instruction with the specified parameters.
1621 ///
1622 /// A null type is returned if the indices are invalid for the specified
1623 /// pointer type.
1624 ///
1625 template
1626 static const Type *getIndexedType(const Type *Ptr,
1627 InputIterator IdxBegin,
1628 InputIterator IdxEnd) {
1629 return getIndexedType(Ptr, IdxBegin, IdxEnd,
1630 typename std::iterator_traits::
1631 iterator_category());
1632 }
1633 static const Type *getIndexedType(const Type *Ptr, Value *Idx);
1634
1635 inline op_iterator idx_begin() { return op_begin()+1; }
1636 inline const_op_iterator idx_begin() const { return op_begin()+1; }
1637 inline op_iterator idx_end() { return op_end(); }
1638 inline const_op_iterator idx_end() const { return op_end(); }
1639
1640 Value *getAggregateOperand() {
1641 return getOperand(0);
1642 }
1643 const Value *getAggregateOperand() const {
1644 return getOperand(0);
1645 }
1646 static unsigned getAggregateOperandIndex() {
1647 return 0U; // get index for modifying correct operand
1648 }
1649
1650 unsigned getNumIndices() const { // Note: always non-negative
1651 return getNumOperands() - 1;
1652 }
1653
1654 bool hasIndices() const {
1655 return getNumOperands() > 1;
1656 }
1657
1658 // Methods for support type inquiry through isa, cast, and dyn_cast:
1659 static inline bool classof(const ExtractValueInst *) { return true; }
1660 static inline bool classof(const Instruction *I) {
1661 return I->getOpcode() == Instruction::ExtractValue;
1662 }
1663 static inline bool classof(const Value *V) {
1664 return isa(V) && classof(cast(V));
1665 }
1666 };
1667
1668 template <>
1669 struct OperandTraits : VariadicOperandTraits<1> {
1670 };
1671
1672 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueInst, Value)
1673
1674 //===----------------------------------------------------------------------===//
1675 // InsertValueInst Class
1676 //===----------------------------------------------------------------------===//
1677
1678 /// InsertValueInst - This instruction extracts a value
1679 /// from an aggregate value
1680 ///
1681 class InsertValueInst : public Instruction {
1682 InsertValueInst(const InsertValueInst &IVI);
1683 void init(Value *Agg, Value *Val, Value* const *Idx, unsigned NumIdx);
1684 void init(Value *Agg, Value *Val, Value *Idx);
1685
1686 template
1687 void init(Value *Agg, Value *Val,
1688 InputIterator IdxBegin, InputIterator IdxEnd,
1689 const std::string &Name,
1690 // This argument ensures that we have an iterator we can
1691 // do arithmetic on in constant time
1692 std::random_access_iterator_tag) {
1693 unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd));
1694
1695 if (NumIdx > 0) {
1696 // This requires that the iterator points to contiguous memory.
1697 init(Agg, Val, &*IdxBegin, NumIdx); // FIXME: for the general case
1698 // we have to build an array here
1699 }
1700 else {
1701 init(Agg, Val, 0, NumIdx);
1702 }
1703
1704 setName(Name);
1705 }
1706
1707 /// Constructors - Create a insertvalue instruction with a base pointer an
1708 /// list of indices. The first ctor can optionally insert before an existing
1709 /// instruction, the second appends the new instruction to the specified
1710 /// BasicBlock.
1711 template
1712 inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin,
1713 InputIterator IdxEnd,
1714 unsigned Values,
1715 const std::string &Name,
1716 Instruction *InsertBefore);
1717 template
1718 inline InsertValueInst(Value *Agg, Value *Val,
1719 InputIterator IdxBegin, InputIterator IdxEnd,
1720 unsigned Values,
1721 const std::string &Name, BasicBlock *InsertAtEnd);
1722
1723 /// Constructors - These two constructors are convenience methods because one
1724 /// and two index insertvalue instructions are so common.
1725 InsertValueInst(Value *Agg, Value *Val,
1726 Value *Idx, const std::string &Name = "",
1727 Instruction *InsertBefore = 0);
1728 InsertValueInst(Value *Agg, Value *Val, Value *Idx,
1729 const std::string &Name, BasicBlock *InsertAtEnd);
1730 public:
1731 template
1732 static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin,
1733 InputIterator IdxEnd,
1734 const std::string &Name = "",
1735 Instruction *InsertBefore = 0) {
1736 typename std::iterator_traits::difference_type Values =
1737 1 + std::distance(IdxBegin, IdxEnd);
1738 return new(Values)
1739 InsertValueInst(Agg, Val, IdxBegin, IdxEnd, Values, Name, InsertBefore);
1740 }
1741 template
1742 static InsertValueInst *Create(Value *Agg, Value *Val,
1743 InputIterator IdxBegin, InputIterator IdxEnd,
1744 const std::string &Name,
1745 BasicBlock *InsertAtEnd) {
1746 typename std::iterator_traits::difference_type Values =
1747 1 + std::distance(IdxBegin, IdxEnd);
1748 return new(Values)
1749 InsertValueInst(Agg, Val, IdxBegin, IdxEnd, Values, Name, InsertAtEnd);
1750 }
1751
1752 /// Constructors - These two creators are convenience methods because one
1753 /// index insertvalue instructions are much more common than those with
1754 /// more than one.
1755 static InsertValueInst *Create(Value *Agg, Value *Val, Value *Idx,
1756 const std::string &Name = "",
1757 Instruction *InsertBefore = 0) {
1758 return new(3) InsertValueInst(Agg, Val, Idx, Name, InsertBefore);
1759 }
1760 static InsertValueInst *Create(Value *Agg, Value *Val, Value *Idx,
1761 const std::string &Name,
1762 BasicBlock *InsertAtEnd) {
1763 return new(3) InsertValueInst(Agg, Val, Idx, Name, InsertAtEnd);
1764 }
1765
1766 virtual InsertValueInst *clone() const;
1767
1768 /// Transparently provide more efficient getOperand methods.
1769 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
1770
1771 // getType - Overload to return most specific pointer type...
1772 const PointerType *getType() const {
1773 return reinterpret_cast(Instruction::getType());
1774 }
1775
1776 inline op_iterator idx_begin() { return op_begin()+1; }
1777 inline const_op_iterator idx_begin() const { return op_begin()+1; }
1778 inline op_iterator idx_end() { return op_end(); }
1779 inline const_op_iterator idx_end() const { return op_end(); }
1780
1781 Value *getAggregateOperand() {
1782 return getOperand(0);
1783 }
1784 const Value *getAggregateOperand() const {
1785 return getOperand(0);
1786 }
1787 static unsigned getAggregateOperandIndex() {
1788 return 0U; // get index for modifying correct operand
1789 }
1790
1791 Value *getInsertedValueOperand() {
1792 return getOperand(1);
1793 }
1794 const Value *getInsertedValueOperand() const {
1795 return getOperand(1);
1796 }
1797 static unsigned getInsertedValueOperandIndex() {
1798 return 1U; // get index for modifying correct operand
1799 }
1800
1801 unsigned getNumIndices() const { // Note: always non-negative
1802 return getNumOperands() - 2;
1803 }
1804
1805 bool hasIndices() const {
1806 return getNumOperands() > 2;
1807 }
1808
1809 // Methods for support type inquiry through isa, cast, and dyn_cast:
1810 static inline bool classof(const InsertValueInst *) { return true; }
1811 static inline bool classof(const Instruction *I) {
1812 return I->getOpcode() == Instruction::InsertValue;
1813 }
1814 static inline bool classof(const Value *V) {
1815 return isa(V) && classof(cast(V));
1816 }
1817 };
1818
1819 template <>
1820 struct OperandTraits : VariadicOperandTraits<2> {
1821 };
1822
1823 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueInst, Value)
14981824
14991825 //===----------------------------------------------------------------------===//
15001826 // PHINode Class
196196 RetTy visitInsertElementInst(InsertElementInst &I) { DELEGATE(Instruction); }
197197 RetTy visitShuffleVectorInst(ShuffleVectorInst &I) { DELEGATE(Instruction); }
198198 RetTy visitGetResultInst(GetResultInst &I) { DELEGATE(Instruction); }
199 RetTy visitExtractValueInst(ExtractValueInst &I) { DELEGATE(Instruction);}
200 RetTy visitInsertValueInst(InsertValueInst &I) { DELEGATE(Instruction); }
199201
200202 // Next level propagators... if the user does not overload a specific
201203 // instruction type, they can overload one of these to get the whole class
383383
384384
385385 /* Copy the first part of user declarations. */
386 #line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
386 #line 14 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
387387
388388 #include "ParserInternals.h"
389389 #include "llvm/CallingConv.h"
13391339
13401340 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
13411341 typedef union YYSTYPE
1342 #line 949 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
1342 #line 949 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
13431343 {
13441344 llvm::Module *ModuleVal;
13451345 llvm::Function *FunctionVal;
18511851 1458, 1465, 1470, 1475, 1482, 1483, 1490, 1497, 1505, 1511,
18521852 1523, 1551, 1567, 1594, 1622, 1648, 1668, 1694, 1714, 1726,
18531853 1733, 1799, 1809, 1819, 1825, 1835, 1841, 1851, 1856, 1861,
1854 1874, 1886, 1908, 1916, 1922, 1933, 1938, 1943, 1948, 1953,
1855 1959, 1965, 1974, 1978, 1986, 1986, 1989, 1989, 1992, 2004,
1856 2025, 2030, 2038, 2039, 2043, 2043, 2047, 2047, 2050, 2053,
1857 2077, 2089, 2088, 2100, 2099, 2109, 2108, 2119, 2159, 2162,
1858 2168, 2178, 2182, 2187, 2189, 2194, 2199, 2208, 2218, 2229,
1859 2233, 2242, 2251, 2256, 2385, 2385, 2387, 2396, 2396, 2398,
1860 2403, 2415, 2419, 2424, 2428, 2432, 2436, 2440, 2444, 2448,
1861 2452, 2456, 2481, 2485, 2495, 2499, 2503, 2508, 2515, 2515,
1862 2521, 2530, 2535, 2540, 2544, 2553, 2562, 2571, 2575, 2583,
1863 2590, 2594, 2599, 2609, 2628, 2637, 2722, 2726, 2733, 2744,
1854 1874, 1886, 1907, 1915, 1921, 1932, 1937, 1942, 1947, 1952,
1855 1958, 1964, 1973, 1977, 1985, 1985, 1988, 1988, 1991, 2003,
1856 2024, 2029, 2037, 2038, 2042, 2042, 2046, 2046, 2049, 2052,
1857 2076, 2088, 2087, 2099, 2098, 2108, 2107, 2118, 2158, 2161,
1858 2167, 2177, 2181, 2186, 2188, 2193, 2198, 2207, 2217, 2228,
1859 2232, 2241, 2250, 2255, 2384, 2384, 2386, 2395, 2395, 2397,
1860 2402, 2414, 2418, 2423, 2427, 2431, 2435, 2439, 2443, 2447,
1861 2451, 2455, 2480, 2484, 2494, 2498, 2502, 2507, 2514, 2514,
1862 2520, 2529, 2534, 2539, 2543, 2552, 2561, 2570, 2574, 2582,
1863 2589, 2593, 2598, 2608, 2627, 2636, 2722, 2726, 2733, 2744,
18641864 2757, 2767, 2778, 2788, 2799, 2807, 2817, 2824, 2827, 2828,
18651865 2835, 2839, 2844, 2860, 2877, 2891, 2905, 2919, 2933, 2945,
18661866 2953, 2960, 2966, 2972, 2978, 2993, 3083, 3088, 3092, 3099,
35023502 switch (yyn)
35033503 {
35043504 case 29:
3505 #line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3505 #line 1117 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35063506 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
35073507 break;
35083508
35093509 case 30:
3510 #line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3510 #line 1117 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35113511 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
35123512 break;
35133513
35143514 case 31:
3515 #line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3515 #line 1118 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35163516 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
35173517 break;
35183518
35193519 case 32:
3520 #line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3520 #line 1118 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35213521 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
35223522 break;
35233523
35243524 case 33:
3525 #line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3525 #line 1119 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35263526 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
35273527 break;
35283528
35293529 case 34:
3530 #line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3530 #line 1119 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35313531 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
35323532 break;
35333533
35343534 case 35:
3535 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3535 #line 1120 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35363536 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
35373537 break;
35383538
35393539 case 36:
3540 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3540 #line 1120 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35413541 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
35423542 break;
35433543
35443544 case 37:
3545 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3545 #line 1121 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35463546 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
35473547 break;
35483548
35493549 case 38:
3550 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3550 #line 1121 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35513551 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
35523552 break;
35533553
35543554 case 39:
3555 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3555 #line 1125 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35563556 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
35573557 break;
35583558
35593559 case 40:
3560 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3560 #line 1125 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35613561 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
35623562 break;
35633563
35643564 case 41:
3565 #line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3565 #line 1126 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35663566 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
35673567 break;
35683568
35693569 case 42:
3570 #line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3570 #line 1126 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35713571 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
35723572 break;
35733573
35743574 case 43:
3575 #line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3575 #line 1127 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35763576 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
35773577 break;
35783578
35793579 case 44:
3580 #line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3580 #line 1127 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35813581 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
35823582 break;
35833583
35843584 case 45:
3585 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3585 #line 1128 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35863586 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
35873587 break;
35883588
35893589 case 46:
3590 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3590 #line 1128 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35913591 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
35923592 break;
35933593
35943594 case 47:
3595 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3595 #line 1129 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
35963596 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
35973597 break;
35983598
35993599 case 48:
3600 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3600 #line 1129 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36013601 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
36023602 break;
36033603
36043604 case 49:
3605 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3605 #line 1130 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36063606 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
36073607 break;
36083608
36093609 case 50:
3610 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3610 #line 1130 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36113611 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
36123612 break;
36133613
36143614 case 51:
3615 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3615 #line 1131 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36163616 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
36173617 break;
36183618
36193619 case 52:
3620 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3620 #line 1131 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36213621 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
36223622 break;
36233623
36243624 case 53:
3625 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3625 #line 1132 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36263626 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
36273627 break;
36283628
36293629 case 54:
3630 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3630 #line 1133 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36313631 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
36323632 break;
36333633
36343634 case 65:
3635 #line 1142 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3635 #line 1142 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36363636 { (yyval.StrVal) = 0; ;}
36373637 break;
36383638
36393639 case 66:
3640 #line 1144 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3640 #line 1144 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36413641 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
36423642 break;
36433643
36443644 case 67:
3645 #line 1145 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3645 #line 1145 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36463646 { (yyval.UIntVal)=0; ;}
36473647 break;
36483648
36493649 case 68:
3650 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3650 #line 1149 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36513651 {
36523652 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
36533653 CHECK_FOR_ERROR
36553655 break;
36563656
36573657 case 69:
3658 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3658 #line 1153 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36593659 {
36603660 (yyval.StrVal) = 0;
36613661 CHECK_FOR_ERROR
36633663 break;
36643664
36653665 case 73:
3666 #line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3666 #line 1161 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36673667 {
36683668 (yyval.StrVal) = 0;
36693669 CHECK_FOR_ERROR
36713671 break;
36723672
36733673 case 74:
3674 #line 1166 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3674 #line 1166 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36753675 {
36763676 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
36773677 CHECK_FOR_ERROR
36793679 break;
36803680
36813681 case 75:
3682 #line 1172 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3682 #line 1172 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36833683 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
36843684 break;
36853685
36863686 case 76:
3687 #line 1173 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3687 #line 1173 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36883688 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
36893689 break;
36903690
36913691 case 77:
3692 #line 1174 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3692 #line 1174 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36933693 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
36943694 break;
36953695
36963696 case 78:
3697 #line 1175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3697 #line 1175 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
36983698 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
36993699 break;
37003700
37013701 case 79:
3702 #line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3702 #line 1176 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37033703 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
37043704 break;
37053705
37063706 case 80:
3707 #line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3707 #line 1177 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37083708 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
37093709 break;
37103710
37113711 case 81:
3712 #line 1181 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3712 #line 1181 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37133713 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
37143714 break;
37153715
37163716 case 82:
3717 #line 1182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3717 #line 1182 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37183718 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
37193719 break;
37203720
37213721 case 83:
3722 #line 1183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3722 #line 1183 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37233723 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37243724 break;
37253725
37263726 case 84:
3727 #line 1187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3727 #line 1187 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37283728 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
37293729 break;
37303730
37313731 case 85:
3732 #line 1188 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3732 #line 1188 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37333733 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
37343734 break;
37353735
37363736 case 86:
3737 #line 1189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3737 #line 1189 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37383738 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
37393739 break;
37403740
37413741 case 87:
3742 #line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3742 #line 1190 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37433743 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
37443744 break;
37453745
37463746 case 88:
3747 #line 1194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3747 #line 1194 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37483748 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37493749 break;
37503750
37513751 case 89:
3752 #line 1195 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3752 #line 1195 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37533753 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
37543754 break;
37553755
37563756 case 90:
3757 #line 1196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3757 #line 1196 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37583758 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
37593759 break;
37603760
37613761 case 91:
3762 #line 1200 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3762 #line 1200 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37633763 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37643764 break;
37653765
37663766 case 92:
3767 #line 1201 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3767 #line 1201 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37683768 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
37693769 break;
37703770
37713771 case 93:
3772 #line 1202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3772 #line 1202 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37733773 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
37743774 break;
37753775
37763776 case 94:
3777 #line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3777 #line 1203 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37783778 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
37793779 break;
37803780
37813781 case 95:
3782 #line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3782 #line 1204 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37833783 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
37843784 break;
37853785
37863786 case 96:
3787 #line 1208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3787 #line 1208 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37883788 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37893789 break;
37903790
37913791 case 97:
3792 #line 1209 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3792 #line 1209 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37933793 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
37943794 break;
37953795
37963796 case 98:
3797 #line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3797 #line 1210 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
37983798 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
37993799 break;
38003800
38013801 case 99:
3802 #line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3802 #line 1213 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38033803 { (yyval.UIntVal) = CallingConv::C; ;}
38043804 break;
38053805
38063806 case 100:
3807 #line 1214 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3807 #line 1214 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38083808 { (yyval.UIntVal) = CallingConv::C; ;}
38093809 break;
38103810
38113811 case 101:
3812 #line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3812 #line 1215 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38133813 { (yyval.UIntVal) = CallingConv::Fast; ;}
38143814 break;
38153815
38163816 case 102:
3817 #line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3817 #line 1216 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38183818 { (yyval.UIntVal) = CallingConv::Cold; ;}
38193819 break;
38203820
38213821 case 103:
3822 #line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3822 #line 1217 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38233823 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
38243824 break;
38253825
38263826 case 104:
3827 #line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3827 #line 1218 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38283828 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
38293829 break;
38303830
38313831 case 105:
3832 #line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3832 #line 1219 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38333833 {
38343834 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
38353835 GEN_ERROR("Calling conv too large");
38393839 break;
38403840
38413841 case 106:
3842 #line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3842 #line 1226 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38433843 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
38443844 break;
38453845
38463846 case 107:
3847 #line 1227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3847 #line 1227 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38483848 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
38493849 break;
38503850
38513851 case 108:
3852 #line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3852 #line 1228 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38533853 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
38543854 break;
38553855
38563856 case 109:
3857 #line 1229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3857 #line 1229 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38583858 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
38593859 break;
38603860
38613861 case 110:
3862 #line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3862 #line 1230 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38633863 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
38643864 break;
38653865
38663866 case 111:
3867 #line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3867 #line 1231 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38683868 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
38693869 break;
38703870
38713871 case 112:
3872 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3872 #line 1232 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38733873 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
38743874 break;
38753875
38763876 case 113:
3877 #line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3877 #line 1233 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38783878 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
38793879 break;
38803880
38813881 case 114:
3882 #line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3882 #line 1234 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38833883 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
38843884 break;
38853885
38863886 case 115:
3887 #line 1235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3887 #line 1235 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38883888 { (yyval.ParamAttrs) =
38893889 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
38903890 break;
38913891
38923892 case 116:
3893 #line 1239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3893 #line 1239 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38943894 { (yyval.ParamAttrs) = ParamAttr::None; ;}
38953895 break;
38963896
38973897 case 117:
3898 #line 1240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3898 #line 1240 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
38993899 {
39003900 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
39013901 ;}
39023902 break;
39033903
39043904 case 118:
3905 #line 1245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3905 #line 1245 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39063906 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
39073907 break;
39083908
39093909 case 119:
3910 #line 1246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3910 #line 1246 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39113911 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
39123912 break;
39133913
39143914 case 120:
3915 #line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3915 #line 1247 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39163916 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
39173917 break;
39183918
39193919 case 121:
3920 #line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3920 #line 1248 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39213921 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
39223922 break;
39233923
39243924 case 122:
3925 #line 1249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3925 #line 1249 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39263926 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
39273927 break;
39283928
39293929 case 123:
3930 #line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3930 #line 1250 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39313931 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
39323932 break;
39333933
39343934 case 124:
3935 #line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3935 #line 1253 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39363936 { (yyval.ParamAttrs) = ParamAttr::None; ;}
39373937 break;
39383938
39393939 case 125:
3940 #line 1254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3940 #line 1254 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39413941 {
39423942 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
39433943 ;}
39443944 break;
39453945
39463946 case 126:
3947 #line 1259 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3947 #line 1259 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39483948 { (yyval.StrVal) = 0; ;}
39493949 break;
39503950
39513951 case 127:
3952 #line 1260 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3952 #line 1260 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39533953 {
39543954 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
39553955 ;}
39563956 break;
39573957
39583958 case 128:
3959 #line 1267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3959 #line 1267 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39603960 { (yyval.UIntVal) = 0; ;}
39613961 break;
39623962
39633963 case 129:
3964 #line 1268 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3964 #line 1268 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39653965 {
39663966 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
39673967 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
39713971 break;
39723972
39733973 case 130:
3974 #line 1274 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3974 #line 1274 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39753975 { (yyval.UIntVal) = 0; ;}
39763976 break;
39773977
39783978 case 131:
3979 #line 1275 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3979 #line 1275 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39803980 {
39813981 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
39823982 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
39863986 break;
39873987
39883988 case 132:
3989 #line 1284 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3989 #line 1284 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
39903990 {
39913991 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
39923992 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
39973997 break;
39983998
39993999 case 133:
4000 #line 1292 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4000 #line 1292 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40014001 { (yyval.StrVal) = 0; ;}
40024002 break;
40034003
40044004 case 134:
4005 #line 1293 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4005 #line 1293 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40064006 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
40074007 break;
40084008
40094009 case 135:
4010 #line 1298 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4010 #line 1298 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40114011 {;}
40124012 break;
40134013
40144014 case 136:
4015 #line 1299 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4015 #line 1299 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40164016 {;}
40174017 break;
40184018
40194019 case 137:
4020 #line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4020 #line 1300 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40214021 {
40224022 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
40234023 delete (yyvsp[(1) - (1)].StrVal);
40264026 break;
40274027
40284028 case 138:
4029 #line 1305 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4029 #line 1305 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40304030 {
40314031 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
40324032 GEN_ERROR("Alignment must be a power of two");
40364036 break;
40374037
40384038 case 146:
4039 #line 1321 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4039 #line 1321 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40404040 {
40414041 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
40424042 CHECK_FOR_ERROR
40444044 break;
40454045
40464046 case 147:
4047 #line 1325 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4047 #line 1325 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40484048 {
40494049 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
40504050 CHECK_FOR_ERROR
40524052 break;
40534053
40544054 case 148:
4055 #line 1329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4055 #line 1329 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40564056 { // Pointer type?
40574057 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
40584058 GEN_ERROR("Cannot form a pointer to a basic block");
40634063 break;
40644064
40654065 case 149:
4066 #line 1336 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4066 #line 1336 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40674067 { // Named types are also simple types...
40684068 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
40694069 CHECK_FOR_ERROR
40724072 break;
40734073
40744074 case 150:
4075 #line 1341 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4075 #line 1341 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40764076 { // Type UpReference
40774077 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
40784078 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
40844084 break;
40854085
40864086 case 151:
4087 #line 1349 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4087 #line 1349 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
40884088 {
40894089 // Allow but ignore attributes on function types; this permits auto-upgrade.
40904090 // FIXME: remove in LLVM 3.0.
41174117 break;
41184118
41194119 case 152:
4120 #line 1378 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4120 #line 1378 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41214121 {
41224122 // Allow but ignore attributes on function types; this permits auto-upgrade.
41234123 // FIXME: remove in LLVM 3.0.
41454145 break;
41464146
41474147 case 153:
4148 #line 1403 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4148 #line 1403 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41494149 { // Sized array type?
41504150 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
41514151 delete (yyvsp[(4) - (5)].TypeVal);
41544154 break;
41554155
41564156 case 154:
4157 #line 1408 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4157 #line 1408 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41584158 { // Vector type?
41594159 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
41604160 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
41684168 break;
41694169
41704170 case 155:
4171 #line 1418 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4171 #line 1418 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41724172 { // Structure type?
41734173 std::vector Elements;
41744174 for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
41824182 break;
41834183
41844184 case 156:
4185 #line 1428 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4185 #line 1428 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41864186 { // Empty structure type?
41874187 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector()));
41884188 CHECK_FOR_ERROR
41904190 break;
41914191
41924192 case 157:
4193 #line 1432 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4193 #line 1432 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
41944194 {
41954195 std::vector Elements;
41964196 for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
42044204 break;
42054205
42064206 case 158:
4207 #line 1442 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4207 #line 1442 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42084208 { // Empty structure type?
42094209 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true));
42104210 CHECK_FOR_ERROR
42124212 break;
42134213
42144214 case 159:
4215 #line 1449 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4215 #line 1449 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42164216 {
42174217 // Allow but ignore attributes on function types; this permits auto-upgrade.
42184218 // FIXME: remove in LLVM 3.0.
42224222 break;
42234223
42244224 case 160:
4225 #line 1458 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4225 #line 1458 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42264226 {
42274227 if (!UpRefs.empty())
42284228 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
42334233 break;
42344234
42354235 case 161:
4236 #line 1465 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4236 #line 1465 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42374237 {
42384238 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
42394239 ;}
42404240 break;
42414241
42424242 case 162:
4243 #line 1470 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4243 #line 1470 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42444244 {
42454245 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
42464246 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
42494249 break;
42504250
42514251 case 163:
4252 #line 1475 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4252 #line 1475 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42534253 {
42544254 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
42554255 CHECK_FOR_ERROR
42574257 break;
42584258
42594259 case 165:
4260 #line 1483 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4260 #line 1483 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42614261 {
42624262 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
42634263 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
42684268 break;
42694269
42704270 case 166:
4271 #line 1490 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4271 #line 1490 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42724272 {
42734273 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
42744274 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
42794279 break;
42804280
42814281 case 167:
4282 #line 1497 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4282 #line 1497 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42834283 {
42844284 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
42854285 CHECK_FOR_ERROR
42874287 break;
42884288
42894289 case 168:
4290 #line 1505 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4290 #line 1505 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
42914291 {
42924292 (yyval.TypeList) = new std::list();
42934293 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
42974297 break;
42984298
42994299 case 169:
4300 #line 1511 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4300 #line 1511 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
43014301 {
43024302 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
43034303 delete (yyvsp[(3) - (3)].TypeVal);
43064306 break;
43074307
43084308 case 170:
4309 #line 1523 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4309 #line 1523 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
43104310 { // Nonempty unsized arr
43114311 if (!UpRefs.empty())
43124312 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
43384338 break;
43394339
43404340 case 171:
4341 #line 1551 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4341 #line 1551 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
43424342 {
43434343 if (!UpRefs.empty())
43444344 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
43584358 break;
43594359
43604360 case 172:
4361 #line 1567 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4361 #line 1567 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
43624362 {
43634363 if (!UpRefs.empty())
43644364 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
43894389 break;
43904390
43914391 case 173:
4392 #line 1594 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4392 #line 1594 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
43934393 { // Nonempty unsized arr
43944394 if (!UpRefs.empty())
43954395 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
44214421 break;
44224422
44234423 case 174:
4424 #line 1622 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4424 #line 1622 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
44254425 {
44264426 const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
44274427 if (STy == 0)
44514451 break;
44524452
44534453 case 175:
4454 #line 1648 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4454 #line 1648 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
44554455 {
44564456 if (!UpRefs.empty())
44574457 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
44754475 break;
44764476
44774477 case 176:
4478 #line 1668 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4478 #line 1668 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
44794479 {
44804480 const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get());
44814481 if (STy == 0)
45054505 break;
45064506
45074507 case 177:
4508 #line 1694 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4508 #line 1694 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
45094509 {
45104510 if (!UpRefs.empty())
45114511 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
45294529 break;
45304530
45314531 case 178:
4532 #line 1714 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4532 #line 1714 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
45334533 {
45344534 if (!UpRefs.empty())
45354535 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
45454545 break;
45464546
45474547 case 179:
4548 #line 1726 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4548 #line 1726 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
45494549 {
45504550 if (!UpRefs.empty())
45514551 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
45564556 break;
45574557
45584558 case 180:
4559 #line 1733 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4559 #line 1733 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
45604560 {
45614561 if (!UpRefs.empty())
45624562 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46264626 break;
46274627
46284628 case 181:
4629 #line 1799 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4629 #line 1799 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46304630 {
46314631 if (!UpRefs.empty())
46324632 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46404640 break;
46414641
46424642 case 182:
4643 #line 1809 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4643 #line 1809 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46444644 {
46454645 if (!UpRefs.empty())
46464646 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46544654 break;
46554655
46564656 case 183:
4657 #line 1819 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4657 #line 1819 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46584658 { // integral constants
46594659 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
46604660 GEN_ERROR("Constant value doesn't fit in type");
46644664 break;
46654665
46664666 case 184:
4667 #line 1825 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4667 #line 1825 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46684668 { // arbitrary precision integer constants
46694669 uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
46704670 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
46784678 break;
46794679
46804680 case 185:
4681 #line 1835 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4681 #line 1835 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46824682 { // integral constants
46834683 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
46844684 GEN_ERROR("Constant value doesn't fit in type");
46884688 break;
46894689
46904690 case 186:
4691 #line 1841 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4691 #line 1841 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
46924692 { // arbitrary precision integer constants
46934693 uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
46944694 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
47024702 break;
47034703
47044704 case 187:
4705 #line 1851 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4705 #line 1851 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47064706 { // Boolean constants
47074707 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
47084708 (yyval.ConstVal) = ConstantInt::getTrue();
47114711 break;
47124712
47134713 case 188:
4714 #line 1856 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4714 #line 1856 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47154715 { // Boolean constants
47164716 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
47174717 (yyval.ConstVal) = ConstantInt::getFalse();
47204720 break;
47214721
47224722 case 189:
4723 #line 1861 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4723 #line 1861 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47244724 { // Floating point constants
47254725 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
47264726 GEN_ERROR("Floating point constant invalid for type");
47354735 break;
47364736
47374737 case 190:
4738 #line 1874 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4738 #line 1874 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47394739 {
47404740 if (!UpRefs.empty())
47414741 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
47514751 break;
47524752
47534753 case 191:
4754 #line 1886 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4754 #line 1886 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47554755 {
47564756 if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()))
47574757 GEN_ERROR("GetElementPtr requires a pointer operand");
47584758
47594759 const Type *IdxTy =
4760 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
4761 true);
4760 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
47624761 if (!IdxTy)
47634762 GEN_ERROR("Index list invalid for constant getelementptr");
47644763
47774776 break;
47784777
47794778 case 192:
4780 #line 1908 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4779 #line 1907 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47814780 {
47824781 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
47834782 GEN_ERROR("Select condition must be of boolean type");
47894788 break;
47904789
47914790 case 193:
4792 #line 1916 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4791 #line 1915 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
47934792 {
47944793 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
47954794 GEN_ERROR("Binary operator types must match");
47994798 break;
48004799
48014800 case 194:
4802 #line 1922 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4801 #line 1921 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48034802 {
48044803 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
48054804 GEN_ERROR("Logical operator types must match");
48144813 break;
48154814
48164815 case 195:
4817 #line 1933 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4816 #line 1932 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48184817 {
48194818 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48204819 GEN_ERROR("icmp operand types must match");
48234822 break;
48244823
48254824 case 196:
4826 #line 1938 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4825 #line 1937 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48274826 {
48284827 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48294828 GEN_ERROR("fcmp operand types must match");
48324831 break;
48334832
48344833 case 197:
4835 #line 1943 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4834 #line 1942 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48364835 {
48374836 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48384837 GEN_ERROR("vicmp operand types must match");
48414840 break;
48424841
48434842 case 198:
4844 #line 1948 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4843 #line 1947 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48454844 {
48464845 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48474846 GEN_ERROR("vfcmp operand types must match");
48504849 break;
48514850
48524851 case 199:
4853 #line 1953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4852 #line 1952 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48544853 {
48554854 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
48564855 GEN_ERROR("Invalid extractelement operands");
48604859 break;
48614860
48624861 case 200:
4863 #line 1959 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4862 #line 1958 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48644863 {
48654864 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
48664865 GEN_ERROR("Invalid insertelement operands");
48704869 break;
48714870
48724871 case 201:
4873 #line 1965 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4872 #line 1964 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48744873 {
48754874 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
48764875 GEN_ERROR("Invalid shufflevector operands");
48804879 break;
48814880
48824881 case 202:
4883 #line 1974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4882 #line 1973 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48844883 {
48854884 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
48864885 CHECK_FOR_ERROR
48884887 break;
48894888
48904889 case 203:
4891 #line 1978 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4890 #line 1977 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
48924891 {
48934892 (yyval.ConstVector) = new std::vector();
48944893 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
48974896 break;
48984897
48994898 case 204:
4900 #line 1986 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4899 #line 1985 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49014900 { (yyval.BoolVal) = false; ;}
49024901 break;
49034902
49044903 case 205:
4905 #line 1986 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4904 #line 1985 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49064905 { (yyval.BoolVal) = true; ;}
49074906 break;
49084907
49094908 case 206:
4910 #line 1989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4909 #line 1988 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49114910 { (yyval.BoolVal) = true; ;}
49124911 break;
49134912
49144913 case 207:
4915 #line 1989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4914 #line 1988 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49164915 { (yyval.BoolVal) = false; ;}
49174916 break;
49184917
49194918 case 208:
4920 #line 1992 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4919 #line 1991 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49214920 {
49224921 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
49234922 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
49334932 break;
49344933
49354934 case 209:
4936 #line 2004 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4935 #line 2003 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49374936 {
49384937 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
49394938 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
49494948 break;
49504949
49514950 case 210:
4952 #line 2025 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4951 #line 2024 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49534952 {
49544953 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
49554954 CurModule.ModuleDone();
49584957 break;
49594958
49604959 case 211:
4961 #line 2030 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4960 #line 2029 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49624961 {
49634962 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
49644963 CurModule.ModuleDone();
49674966 break;
49684967
49694968 case 214:
4970 #line 2043 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4969 #line 2042 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49714970 { CurFun.isDeclare = false; ;}
49724971 break;
49734972
49744973 case 215:
4975 #line 2043 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4974 #line 2042 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49764975 {
49774976 CurFun.FunctionDone();
49784977 CHECK_FOR_ERROR
49804979 break;
49814980
49824981 case 216:
4983 #line 2047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4982 #line 2046 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49844983 { CurFun.isDeclare = true; ;}
49854984 break;
49864985
49874986 case 217:
4988 #line 2047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4987 #line 2046 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49894988 {
49904989 CHECK_FOR_ERROR
49914990 ;}
49924991 break;
49934992
49944993 case 218:
4995 #line 2050 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4994 #line 2049 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
49964995 {
49974996 CHECK_FOR_ERROR
49984997 ;}
49994998 break;
50004999
50015000 case 219:
5002 #line 2053 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5001 #line 2052 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50035002 {
50045003 if (!UpRefs.empty())
50055004 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
50275026 break;
50285027
50295028 case 220:
5030 #line 2077 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5029 #line 2076 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50315030 {
50325031 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
50335032
50425041 break;
50435042
50445043 case 221:
5045 #line 2089 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5044 #line 2088 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50465045 {
50475046 /* "Externally Visible" Linkage */
50485047 if ((yyvsp[(5) - (6)].ConstVal) == 0)
50545053 break;
50555054
50565055 case 222:
5057 #line 2096 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5056 #line 2095 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50585057 {
50595058 CurGV = 0;
50605059 ;}
50615060 break;
50625061
50635062 case 223:
5064 #line 2100 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5063 #line 2099 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50655064 {
50665065 if ((yyvsp[(6) - (7)].ConstVal) == 0)
50675066 GEN_ERROR("Global value initializer is not a constant");
50715070 break;
50725071
50735072 case 224:
5074 #line 2105 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5073 #line 2104 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50755074 {
50765075 CurGV = 0;
50775076 ;}
50785077 break;
50795078
50805079 case 225:
5081 #line 2109 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5080 #line 2108 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50825081 {
50835082 if (!UpRefs.empty())
50845083 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
50895088 break;
50905089
50915090 case 226:
5092 #line 2115 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5091 #line 2114 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
50935092 {
50945093 CurGV = 0;
50955094 CHECK_FOR_ERROR
50975096 break;
50985097
50995098 case 227:
5100 #line 2119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5099 #line 2118 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51015100 {
51025101 std::string Name;
51035102 if ((yyvsp[(1) - (5)].StrVal)) {
51415140 break;
51425141
51435142 case 228:
5144 #line 2159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5143 #line 2158 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51455144 {
51465145 CHECK_FOR_ERROR
51475146 ;}
51485147 break;
51495148
51505149 case 229:
5151 #line 2162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5150 #line 2161 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51525151 {
51535152 CHECK_FOR_ERROR
51545153 ;}
51555154 break;
51565155
51575156 case 230:
5158 #line 2168 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5157 #line 2167 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51595158 {
51605159 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
51615160 if (AsmSoFar.empty())
51685167 break;
51695168
51705169 case 231:
5171 #line 2178 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5170 #line 2177 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51725171 {
51735172 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
51745173 delete (yyvsp[(3) - (3)].StrVal);
51765175 break;
51775176
51785177 case 232:
5179 #line 2182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5178 #line 2181 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51805179 {
51815180 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
51825181 delete (yyvsp[(3) - (3)].StrVal);
51845183 break;
51855184
51865185 case 234:
5187 #line 2189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5186 #line 2188 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51885187 {
51895188 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
51905189 delete (yyvsp[(3) - (3)].StrVal);
51935192 break;
51945193
51955194 case 235:
5196 #line 2194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5195 #line 2193 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
51975196 {
51985197 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
51995198 delete (yyvsp[(1) - (1)].StrVal);
52025201 break;
52035202
52045203 case 236:
5205 #line 2199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5204 #line 2198 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52065205 {
52075206 CHECK_FOR_ERROR
52085207 ;}
52095208 break;
52105209
52115210 case 237:
5212 #line 2208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5211 #line 2207 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52135212 {
52145213 if (!UpRefs.empty())
52155214 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
52235222 break;
52245223
52255224 case 238:
5226 #line 2218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5225 #line 2217 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52275226 {
52285227 if (!UpRefs.empty())
52295228 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
52375236 break;
52385237
52395238 case 239:
5240 #line 2229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5239 #line 2228 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52415240 {
52425241 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
52435242 CHECK_FOR_ERROR
52455244 break;
52465245
52475246 case 240:
5248 #line 2233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5247 #line 2232 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52495248 {
52505249 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
52515250 struct ArgListEntry E;
52585257 break;
52595258
52605259 case 241:
5261 #line 2242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5260 #line 2241 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52625261 {
52635262 (yyval.ArgList) = new ArgListType;
52645263 struct ArgListEntry E;
52715270 break;
52725271
52735272 case 242:
5274 #line 2251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5273 #line 2250 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52755274 {
52765275 (yyval.ArgList) = 0;
52775276 CHECK_FOR_ERROR
52795278 break;
52805279
52815280 case 243:
5282 #line 2257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5281 #line 2256 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
52835282 {
52845283 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
52855284 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
54105409 break;
54115410
54125411 case 246:
5413 #line 2387 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5412 #line 2386 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54145413 {
54155414 (yyval.FunctionVal) = CurFun.CurrentFunction;
54165415
54225421 break;
54235422
54245423 case 249:
5425 #line 2398 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5424 #line 2397 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54265425 {
54275426 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
54285427 CHECK_FOR_ERROR
54305429 break;
54315430
54325431 case 250:
5433 #line 2403 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5432 #line 2402 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54345433 {
54355434 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
54365435 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
54415440 break;
54425441
54435442 case 251:
5444 #line 2415 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5443 #line 2414 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54455444 {
54465445 (yyval.BoolVal) = false;
54475446 CHECK_FOR_ERROR
54495448 break;
54505449
54515450 case 252:
5452 #line 2419 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5451 #line 2418 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54535452 {
54545453 (yyval.BoolVal) = true;
54555454 CHECK_FOR_ERROR
54575456 break;
54585457
54595458 case 253:
5460 #line 2424 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5459 #line 2423 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54615460 { // A reference to a direct constant
54625461 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
54635462 CHECK_FOR_ERROR
54655464 break;
54665465
54675466 case 254:
5468 #line 2428 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5467 #line 2427 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54695468 {
54705469 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
54715470 CHECK_FOR_ERROR
54735472 break;
54745473
54755474 case 255:
5476 #line 2432 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5475 #line 2431 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54775476 { // Perhaps it's an FP constant?
54785477 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
54795478 CHECK_FOR_ERROR
54815480 break;
54825481
54835482 case 256:
5484 #line 2436 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5483 #line 2435 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54855484 {
54865485 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
54875486 CHECK_FOR_ERROR
54895488 break;
54905489
54915490 case 257:
5492 #line 2440 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5491 #line 2439 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
54935492 {
54945493 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
54955494 CHECK_FOR_ERROR
54975496 break;
54985497
54995498 case 258:
5500 #line 2444 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5499 #line 2443 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55015500 {
55025501 (yyval.ValIDVal) = ValID::createNull();
55035502 CHECK_FOR_ERROR
55055504 break;
55065505
55075506 case 259:
5508 #line 2448 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5507 #line 2447 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55095508 {
55105509 (yyval.ValIDVal) = ValID::createUndef();
55115510 CHECK_FOR_ERROR
55135512 break;
55145513
55155514 case 260:
5516 #line 2452 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5515 #line 2451 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55175516 { // A vector zero constant.
55185517 (yyval.ValIDVal) = ValID::createZeroInit();
55195518 CHECK_FOR_ERROR
55215520 break;
55225521
55235522 case 261:
5524 #line 2456 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5523 #line 2455 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55255524 { // Nonempty unsized packed vector
55265525 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
55275526 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
55505549 break;
55515550
55525551 case 262:
5553 #line 2481 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5552 #line 2480 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55545553 {
55555554 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
55565555 CHECK_FOR_ERROR
55585557 break;
55595558
55605559 case 263:
5561 #line 2485 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5560 #line 2484 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55625561 {
55635562 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
55645563 delete (yyvsp[(3) - (5)].StrVal);
55685567 break;
55695568
55705569 case 264:
5571 #line 2495 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5570 #line 2494 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55725571 { // Is it an integer reference...?
55735572 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
55745573 CHECK_FOR_ERROR
55765575 break;
55775576
55785577 case 265:
5579 #line 2499 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5578 #line 2498 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55805579 {
55815580 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
55825581 CHECK_FOR_ERROR
55845583 break;
55855584
55865585 case 266:
5587 #line 2503 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5586 #line 2502 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55885587 { // Is it a named reference...?
55895588 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
55905589 delete (yyvsp[(1) - (1)].StrVal);
55935592 break;
55945593
55955594 case 267:
5596 #line 2508 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5595 #line 2507 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
55975596 { // Is it a named reference...?
55985597 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
55995598 delete (yyvsp[(1) - (1)].StrVal);
56025601 break;
56035602
56045603 case 270:
5605 #line 2521 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5604 #line 2520 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56065605 {
56075606 if (!UpRefs.empty())
56085607 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
56135612 break;
56145613
56155614 case 271:
5616 #line 2530 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5615 #line 2529 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56175616 {
56185617 (yyval.ValueList) = new std::vector();
56195618 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
56225621 break;
56235622
56245623 case 272:
5625 #line 2535 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5624 #line 2534 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56265625 {
56275626 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
56285627 CHECK_FOR_ERROR
56305629 break;
56315630
56325631 case 273:
5633 #line 2540 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5632 #line 2539 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56345633 {
56355634 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
56365635 CHECK_FOR_ERROR
56385637 break;
56395638
56405639 case 274:
5641 #line 2544 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5640 #line 2543 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56425641 { // Do not allow functions with 0 basic blocks
56435642 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
56445643 CHECK_FOR_ERROR
56465645 break;
56475646
56485647 case 275:
5649 #line 2553 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5648 #line 2552 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56505649 {
56515650 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
56525651 CHECK_FOR_ERROR
56585657 break;
56595658
56605659 case 276:
5661 #line 2562 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5660 #line 2561 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56625661 {
56635662 if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal)))
56645663 if (CastInst *CI2 = dyn_cast(CI1->getOperand(0)))
56715670 break;
56725671
56735672 case 277:
5674 #line 2571 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5673 #line 2570 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56755674 { // Empty space between instruction lists
56765675 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
56775676 CHECK_FOR_ERROR
56795678 break;
56805679
56815680 case 278:
5682 #line 2575 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5681 #line 2574 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56835682 { // Labelled (named) basic block
56845683 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
56855684 delete (yyvsp[(1) - (1)].StrVal);
56895688 break;
56905689
56915690 case 279:
5692 #line 2583 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5691 #line 2582 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
56935692 { // Return with a result...
56945693 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
56955694 assert(!VL.empty() && "Invalid ret operands!");
57005699 break;
57015700
57025701 case 280:
5703 #line 2590 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5702 #line 2589 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57045703 { // Return with no result...
57055704 (yyval.TermInstVal) = ReturnInst::Create();
57065705 CHECK_FOR_ERROR
57085707 break;
57095708
57105709 case 281:
5711 #line 2594 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5710 #line 2593 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57125711 { // Unconditional Branch...
57135712 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
57145713 CHECK_FOR_ERROR
57175716 break;
57185717
57195718 case 282:
5720 #line 2599 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5719 #line 2598 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57215720 {
57225721 assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
57235722 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
57315730 break;
57325731
57335732 case 283:
5734 #line 2609 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5733 #line 2608 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57355734 {
57365735 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
57375736 CHECK_FOR_ERROR
57545753 break;
57555754
57565755 case 284:
5757 #line 2628 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5756 #line 2627 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57585757 {
57595758 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
57605759 CHECK_FOR_ERROR
57675766 break;
57685767
57695768 case 285:
5770 #line 2638 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5769 #line 2637 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
57715770 {
57725771
57735772 // Handle the short syntax
58455844 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
58465845
58475846 // Create the InvokeInst
5848 InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
5847 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
5848 Args.begin(), Args.end());
58495849 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
58505850 II->setParamAttrs(PAL);
58515851 (yyval.TermInstVal) = II;
58555855 break;
58565856
58575857 case 286:
5858 #line 2722 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5858 #line 2722 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
58595859 {
58605860 (yyval.TermInstVal) = new UnwindInst();
58615861 CHECK_FOR_ERROR
58635863 break;
58645864
58655865 case 287:
5866 #line 2726 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5866 #line 2726 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
58675867 {
58685868 (yyval.TermInstVal) = new UnreachableInst();
58695869 CHECK_FOR_ERROR
58715871 break;
58725872
58735873 case 288:
5874 #line 2733 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5874 #line 2733 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
58755875 {
58765876 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
58775877 Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
58865886 break;
58875887
58885888 case 289:
5889 #line 2744 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5889 #line 2744 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
58905890 {
58915891 (yyval.JumpTable) = new std::vector >();
58925892 Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
59025902 break;
59035903
59045904 case 290:
5905 #line 2757 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5905 #line 2757 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59065906 {
59075907 // Is this definition named?? if so, assign the name...
59085908 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
59145914 break;
59155915
59165916 case 291:
5917 #line 2767 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5917 #line 2767 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59185918 { // Used for PHI nodes
59195919 if (!UpRefs.empty())
59205920 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
59295929 break;
59305930
59315931 case 292:
5932 #line 2778 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5932 #line 2778 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59335933 {
59345934 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
59355935 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
59415941 break;
59425942
59435943 case 293:
5944 #line 2788 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5944 #line 2788 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59455945 {
59465946 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59475947 if (!UpRefs.empty())
59565956 break;
59575957
59585958 case 294:
5959 #line 2799 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5959 #line 2799 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59605960 {
59615961 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59625962 // Labels are only valid in ASMs
59685968 break;
59695969
59705970 case 295:
5971 #line 2807 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5971 #line 2807 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59725972 {
59735973 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59745974 if (!UpRefs.empty())
59825982 break;
59835983
59845984 case 296:
5985 #line 2817 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5985 #line 2817 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59865986 {
59875987 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59885988 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
59935993 break;
59945994
59955995 case 297:
5996 #line 2824 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5996 #line 2824 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
59975997 { (yyval.ParamList) = new ParamList(); ;}
59985998 break;
59995999
60006000 case 298:
6001 #line 2827 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6001 #line 2827 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60026002 { (yyval.ValueList) = new std::vector(); ;}
60036003 break;
60046004
60056005 case 299:
6006 #line 2828 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6006 #line 2828 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60076007 {
60086008 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
60096009 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
60126012 break;
60136013
60146014 case 300:
6015 #line 2835 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6015 #line 2835 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60166016 {
60176017 (yyval.BoolVal) = true;
60186018 CHECK_FOR_ERROR
60206020 break;
60216021
60226022 case 301:
6023 #line 2839 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6023 #line 2839 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60246024 {
60256025 (yyval.BoolVal) = false;
60266026 CHECK_FOR_ERROR
60286028 break;
60296029
60306030 case 302:
6031 #line 2844 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6031 #line 2844 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60326032 {
60336033 if (!UpRefs.empty())
60346034 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
60486048 break;
60496049
60506050 case 303:
6051 #line 2860 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6051 #line 2860 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60526052 {
60536053 if (!UpRefs.empty())
60546054 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
60696069 break;
60706070
60716071 case 304:
6072 #line 2877 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6072 #line 2877 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60736073 {
60746074 if (!UpRefs.empty())
60756075 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
60876087 break;
60886088
60896089 case 305:
6090 #line 2891 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6090 #line 2891 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
60916091 {
60926092 if (!UpRefs.empty())
60936093 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
61056105 break;
61066106
61076107 case 306:
6108 #line 2905 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6108 #line 2905 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61096109 {
61106110 if (!UpRefs.empty())
61116111 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
61236123 break;
61246124
61256125 case 307:
6126 #line 2919 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6126 #line 2919 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61276127 {
61286128 if (!UpRefs.empty())
61296129 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
61416141 break;
61426142
61436143 case 308:
6144 #line 2933 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6144 #line 2933 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61456145 {
61466146 if (!UpRefs.empty())
61476147 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
61576157 break;
61586158
61596159 case 309:
6160 #line 2945 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6160 #line 2945 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61616161 {
61626162 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
61636163 GEN_ERROR("select condition must be boolean");
61696169 break;
61706170
61716171 case 310:
6172 #line 2953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6172 #line 2953 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61736173 {
61746174 if (!UpRefs.empty())
61756175 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
61806180 break;
61816181
61826182 case 311:
6183 #line 2960 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6183 #line 2960 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61846184 {
61856185 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
61866186 GEN_ERROR("Invalid extractelement operands");
61906190 break;
61916191
61926192 case 312:
6193 #line 2966 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6193 #line 2966 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
61946194 {
61956195 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
61966196 GEN_ERROR("Invalid insertelement operands");
62006200 break;
62016201
62026202 case 313:
6203 #line 2972 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6203 #line 2972 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
62046204 {
62056205 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
62066206 GEN_ERROR("Invalid shufflevector operands");
62106210 break;
62116211
62126212 case 314:
6213 #line 2978 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6213 #line 2978 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
62146214 {
62156215 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
62166216 if (!Ty->isFirstClassType())
62296229 break;
62306230
62316231 case 315:
6232 #line 2994 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6232 #line 2994 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
62336233 {
62346234
62356235 // Handle the short syntax
63226322 break;
63236323
63246324 case 316:
6325 #line 3083 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6325 #line 3083 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63266326 {
63276327 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
63286328 CHECK_FOR_ERROR
63306330 break;
63316331
63326332 case 317:
6333 #line 3088 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6333 #line 3088 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63346334 {
63356335 (yyval.BoolVal) = true;
63366336 CHECK_FOR_ERROR
63386338 break;
63396339
63406340 case 318:
6341 #line 3092 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6341 #line 3092 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63426342 {
63436343 (yyval.BoolVal) = false;
63446344 CHECK_FOR_ERROR
63466346 break;
63476347
63486348 case 319:
6349 #line 3099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6349 #line 3099 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63506350 {
63516351 if (!UpRefs.empty())
63526352 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
63576357 break;
63586358
63596359 case 320:
6360 #line 3106 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6360 #line 3106 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63616361 {
63626362 if (!UpRefs.empty())
63636363 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
63696369 break;
63706370
63716371 case 321:
6372 #line 3114 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6372 #line 3114 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63736373 {
63746374 if (!UpRefs.empty())
63756375 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
63806380 break;
63816381
63826382 case 322:
6383 #line 3121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6383 #line 3121 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63846384 {
63856385 if (!UpRefs.empty())
63866386 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
63926392 break;
63936393
63946394 case 323:
6395 #line 3129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6395 #line 3129 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
63966396 {
63976397 if (!isa((yyvsp[(2) - (2)].ValueVal)->getType()))
63986398 GEN_ERROR("Trying to free nonpointer type " +
64036403 break;
64046404
64056405 case 324:
6406 #line 3137 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6406 #line 3137 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
64076407 {
64086408 if (!UpRefs.empty())
64096409 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
64216421 break;
64226422
64236423 case 325:
6424 #line 3151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6424 #line 3151 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
64256425 {
64266426 if (!UpRefs.empty())
64276427 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
64426442 break;
64436443
64446444 case 326:
6445 #line 3168 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6445 #line 3168 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
64466446 {
64476447 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
64486448 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
64546454 break;
64556455
64566456 case 327:
6457 #line 3176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6457 #line 3176 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
64586458 {
64596459 if (!UpRefs.empty())
64606460 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
64616461 if (!isa((yyvsp[(2) - (4)].TypeVal)->get()))
64626462 GEN_ERROR("getelementptr insn requires pointer operand");
64636463
6464 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true))
6464 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
64656465 GEN_ERROR("Invalid getelementptr indices for type '" +
64666466 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
64676467 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
66886688 }
66896689
66906690
6691 #line 3193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6691 #line 3193 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
66926692
66936693
66946694 // common code from the two 'RunVMAsmParser' functions
349349
350350 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
351351 typedef union YYSTYPE
352 #line 949 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
352 #line 949 "/Volumes/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
353353 {
354354 llvm::Module *ModuleVal;
355355 llvm::Function *FunctionVal;
18871887 GEN_ERROR("GetElementPtr requires a pointer operand");
18881888
18891889 const Type *IdxTy =
1890 GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end(),
1891 true);
1890 GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end());
18921891 if (!IdxTy)
18931892 GEN_ERROR("Index list invalid for constant getelementptr");
18941893
31793178 if (!isa($2->get()))
31803179 GEN_ERROR("getelementptr insn requires pointer operand");
31813180
3182 if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end(), true))
3181 if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end()))
31833182 GEN_ERROR("Invalid getelementptr indices for type '" +
31843183 (*$2)->getDescription()+ "'");
31853184 Value* tmpVal = getVal(*$2, $3);
18871887 GEN_ERROR("GetElementPtr requires a pointer operand");
18881888
18891889 const Type *IdxTy =
1890 GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end(),
1891 true);
1890 GetElementPtrInst::getIndexedType($3->getType(), $4->begin(), $4->end());
18921891 if (!IdxTy)
18931892 GEN_ERROR("Index list invalid for constant getelementptr");
18941893
27112710 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
27122711
27132712 // Create the InvokeInst
2714 InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
2713 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
2714 Args.begin(), Args.end());
27152715 II->setCallingConv($2);
27162716 II->setParamAttrs(PAL);
27172717 $$ = II;
31783178 if (!isa($2->get()))
31793179 GEN_ERROR("getelementptr insn requires pointer operand");
31803180
3181 if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end(), true))
3181 if (!GetElementPtrInst::getIndexedType(*$2, $4->begin(), $4->end()))
31823182 GEN_ERROR("Invalid getelementptr indices for type '" +
31833183 (*$2)->getDescription()+ "'");
31843184 Value* tmpVal = getVal(*$2, $3);
701701 void visitExtractElement(User &I);
702702 void visitInsertElement(User &I);
703703 void visitShuffleVector(User &I);
704
705 void visitExtractValue(User &I);
706 void visitInsertValue(User &I);
704707
705708 void visitGetElementPtr(User &I);
706709 void visitSelect(User &I);
25522555 setValue(&I, DAG.getNode(ISD::VECTOR_SHUFFLE,
25532556 TLI.getValueType(I.getType()),
25542557 V1, V2, Mask));
2558 }
2559
2560 void SelectionDAGLowering::visitInsertValue(User &I) {
2561 assert(0 && "insertvalue instruction not implemented");
2562 abort();
2563 }
2564
2565 void SelectionDAGLowering::visitExtractValue(User &I) {
2566 assert(0 && "extractvalue instruction not implemented");
2567 abort();
25552568 }
25562569
25572570
444444 }
445445
446446 return ConstantVector::get(&Result[0], Result.size());
447 }
448
449 Constant *llvm::ConstantFoldExtractValue(const Constant *Agg,
450 Constant* const *Idxs,
451 unsigned NumIdx) {
452 // FIXME: implement some constant folds
453 return 0;
454 }
455
456 Constant *llvm::ConstantFoldInsertValue(const Constant *Agg,
457 const Constant *Val,
458 Constant* const *Idxs,
459 unsigned NumIdx) {
460 // FIXME: implement some constant folds
461 return 0;
447462 }
448463
449464 /// EvalVectorOp - Given two vector constants and a function pointer, apply the
14071422 const PointerType *Ptr = cast(C->getType());
14081423 const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
14091424 (Value **)Idxs,
1410 (Value **)Idxs+NumIdx,
1411 true);
1425 (Value **)Idxs+NumIdx);
14121426 assert(Ty != 0 && "Invalid indices for GEP!");
14131427 return UndefValue::get(PointerType::get(Ty, Ptr->getAddressSpace()));
14141428 }
14251439 const PointerType *Ptr = cast(C->getType());
14261440 const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
14271441 (Value**)Idxs,
1428 (Value**)Idxs+NumIdx,
1429 true);
1442 (Value**)Idxs+NumIdx);
14301443 assert(Ty != 0 && "Invalid indices for GEP!");
14311444 return
14321445 ConstantPointerNull::get(PointerType::get(Ty,Ptr->getAddressSpace()));
4040 Constant *ConstantFoldShuffleVectorInstruction(const Constant *V1,
4141 const Constant *V2,
4242 const Constant *Mask);
43 Constant *ConstantFoldExtractValue(const Constant *Agg,
44 Constant* const *Idxs, unsigned NumIdx);
45 Constant *ConstantFoldInsertValue(const Constant *Agg, const Constant *Val,
46 Constant* const *Idxs, unsigned NumIdx);
4347 Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1,
4448 const Constant *V2);
4549 Constant *ConstantFoldCompareInstruction(unsigned short predicate,
532532 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
533533 };
534534
535 /// ExtractValueConstantExpr - This class is private to
536 /// Constants.cpp, and is used behind the scenes to implement
537 /// extractvalue constant exprs.
538 class VISIBILITY_HIDDEN ExtractValueConstantExpr : public ConstantExpr {
539 ExtractValueConstantExpr(Constant *Agg, const std::vector &IdxList,
540 const Type *DestTy);
541 public:
542 static ExtractValueConstantExpr *Create(Constant *Agg,
543 const std::vector &IdxList,
544 const Type *DestTy) {
545 return
546 new(IdxList.size() + 1) ExtractValueConstantExpr(Agg, IdxList, DestTy);
547 }
548 /// Transparently provide more efficient getOperand methods.
549 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
550 };
551
552 /// InsertValueConstantExpr - This class is private to
553 /// Constants.cpp, and is used behind the scenes to implement
554 /// insertvalue constant exprs.
555 class VISIBILITY_HIDDEN InsertValueConstantExpr : public ConstantExpr {
556 InsertValueConstantExpr(Constant *Agg, Constant *Val,
557 const std::vector &IdxList,
558 const Type *DestTy);
559 public:
560 static InsertValueConstantExpr *Create(Constant *Agg, Constant *Val,
561 const std::vector &IdxList,
562 const Type *DestTy) {
563 return
564 new(IdxList.size() + 2) InsertValueConstantExpr(Agg, Val,
565 IdxList, DestTy);
566 }
567 /// Transparently provide more efficient getOperand methods.
568 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
569 };
570
571
535572 /// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
536573 /// used behind the scenes to implement getelementpr constant exprs.
537574 class VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr {
599636 struct OperandTraits : FixedNumOperandTraits<3> {
600637 };
601638 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorConstantExpr, Value)
639
640 template <>
641 struct OperandTraits : VariadicOperandTraits<1> {
642 };
643
644 ExtractValueConstantExpr::ExtractValueConstantExpr
645 (Constant *Agg,
646 const std::vector &IdxList,
647 const Type *DestTy)
648 : ConstantExpr(DestTy, Instruction::ExtractValue,
649 OperandTraits::op_end(this)
650 - (IdxList.size()+1),
651 IdxList.size()+1) {
652 OperandList[0].init(Agg, this);
653 for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
654 OperandList[i+1].init(IdxList[i], this);
655 }
656
657 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueConstantExpr, Value)
658
659 template <>
660 struct OperandTraits : VariadicOperandTraits<2> {
661 };
662
663 InsertValueConstantExpr::InsertValueConstantExpr
664 (Constant *Agg, Constant *Val,
665 const std::vector &IdxList,
666 const Type *DestTy)
667 : ConstantExpr(DestTy, Instruction::InsertValue,
668 OperandTraits::op_end(this)
669 - (IdxList.size()+2),
670 IdxList.size()+2) {
671 OperandList[0].init(Agg, this);
672 OperandList[1].init(Val, this);
673 for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
674 OperandList[i+2].init(IdxList[i], this);
675 }
676
677 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueConstantExpr, Value)
602678
603679
604680 template <>
751827 Op1 = (OpNo == 1) ? Op : getOperand(1);
752828 Op2 = (OpNo == 2) ? Op : getOperand(2);
753829 return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
830 case Instruction::InsertValue: {
831 SmallVector Ops;
832 Ops.resize(getNumOperands()-2);
833 for (unsigned i = 2, e = getNumOperands(); i != e; ++i)
834 Ops[i-2] = getOperand(i);
835 if (OpNo == 0)
836 return ConstantExpr::getInsertValue(Op, getOperand(1),
837 &Ops[0], Ops.size());
838 if (OpNo == 1)
839 return ConstantExpr::getInsertValue(getOperand(0), Op,
840 &Ops[0], Ops.size());
841 Ops[OpNo-2] = Op;
842 return ConstantExpr::getInsertValue(getOperand(0), getOperand(1),
843 &Ops[0], Ops.size());
844 }
845 case Instruction::ExtractValue: {
846 SmallVector Ops;
847 Ops.resize(getNumOperands()-1);
848 for (unsigned i = 1, e = getNumOperands(); i != e; ++i)
849 Ops[i-1] = getOperand(i);
850 if (OpNo == 0)
851 return ConstantExpr::getExtractValue(Op, &Ops[0], Ops.size());
852 Ops[OpNo-1] = Op;
853 return ConstantExpr::getExtractValue(getOperand(0), &Ops[0], Ops.size());
854 }
754855 case Instruction::GetElementPtr: {
755856 SmallVector Ops;
756 Ops.resize(getNumOperands());
857 Ops.resize(getNumOperands()-1);
757858 for (unsigned i = 1, e = getNumOperands(); i != e; ++i)
758 Ops[i] = getOperand(i);
859 Ops[i-1] = getOperand(i);
759860 if (OpNo == 0)
760861 return ConstantExpr::getGetElementPtr(Op, &Ops[0], Ops.size());
761862 Ops[OpNo-1] = Op;
806907 return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
807908 case Instruction::ShuffleVector:
808909 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
910 case Instruction::InsertValue:
911 return ConstantExpr::getInsertValue(Ops[0], Ops[1], &Ops[2], Ops.size()-2);
912 case Instruction::ExtractValue:
913 return ConstantExpr::getExtractValue(Ops[0], &Ops[1], Ops.size()-1);
809914 case Instruction::GetElementPtr:
810915 return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1);
811916 case Instruction::ICmp:
15631668 if (V.opcode == Instruction::ShuffleVector)
15641669 return new ShuffleVectorConstantExpr(V.operands[0], V.operands[1],
15651670 V.operands[2]);
1671 if (V.opcode == Instruction::InsertValue) {
1672 std::vector IdxList(V.operands.begin()+2, V.operands.end());
1673 return InsertValueConstantExpr::Create(V.operands[0], V.operands[1],
1674 IdxList, Ty);
1675 }
1676 if (V.opcode == Instruction::ExtractValue) {
1677 std::vector IdxList(V.operands.begin()+1, V.operands.end());
1678 return ExtractValueConstantExpr::Create(V.operands[0], IdxList, Ty);
1679 }
15661680 if (V.opcode == Instruction::GetElementPtr) {
15671681 std::vector IdxList(V.operands.begin()+1, V.operands.end());
15681682 return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty);
19742088 Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C,
19752089 Value* const *Idxs,
19762090 unsigned NumIdx) {
1977 assert(GetElementPtrInst::getIndexedType(C->getType(),
1978 Idxs, Idxs+NumIdx, true)
1979 && "GEP indices invalid!");
2091 assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs,
2092 Idxs+NumIdx) ==
2093 cast(ReqTy)->getElementType() &&
2094 "GEP indices invalid!");
19802095
19812096 if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx))
19822097 return FC; // Fold a few common cases...
19972112 unsigned NumIdx) {
19982113 // Get the result type of the getelementptr!
19992114 const Type *Ty =
2000 GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true);
2115 GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx);
20012116 assert(Ty && "GEP indices invalid!");
20022117 unsigned As = cast(C->getType())->getAddressSpace();
20032118 return getGetElementPtrTy(PointerType::get(Ty, As), C, Idxs, NumIdx);
21782293 assert(ShuffleVectorInst::isValidOperands(V1, V2, Mask) &&
21792294 "Invalid shuffle vector constant expr operands!");
21802295 return getShuffleVectorTy(V1->getType(), V1, V2, Mask);
2296 }
2297
2298 Constant *ConstantExpr::getInsertValueTy(const Type *ReqTy, Constant *Agg,
2299 Constant *Val,
2300 Constant *const *Idxs, unsigned NumIdx) {
2301 assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs,
2302 Idxs+NumIdx) == Val->getType() &&
2303 "insertvalue indices invalid!");
2304 assert(Agg->getType() == ReqTy &&
2305 "insertvalue type invalid!");
2306
2307 if (Constant *FC = ConstantFoldInsertValue(Agg, Val, Idxs, NumIdx))
2308 return FC; // Fold a few common cases...
2309
2310 assert(isa(Agg->getType()) &&
2311 "Non-pointer type for constant InsertValue expression");
2312 // Look up the constant in the table first to ensure uniqueness
2313 std::vector ArgVec;
2314 ArgVec.reserve(NumIdx+2);
2315 ArgVec.push_back(Agg);
2316 ArgVec.push_back(Val);
2317 for (unsigned i = 0; i != NumIdx; ++i)
2318 ArgVec.push_back(cast(Idxs[i]));
2319 const ExprMapKeyType Key(Instruction::InsertValue, ArgVec);
2320 return ExprConstants->getOrCreate(ReqTy, Key);
2321 }
2322
2323 Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val,
2324 Constant* const *IdxList, unsigned NumIdx) {
2325 assert((isa(Agg->getType()) || isa(Agg->getType()) ||
2326 isa(Agg->getType())) &&
2327 "Tried to create insertelement operation on non-aggregate type!");
2328
2329 const Type *ReqTy =
2330 ExtractValueInst::getIndexedType(Agg->getType(), IdxList, IdxList+NumIdx);
2331 assert(ReqTy && "insertvalue indices invalid!");
2332 return getInsertValueTy(ReqTy, Agg, Val, IdxList, NumIdx);
2333 }
2334
2335 Constant *ConstantExpr::getExtractValueTy(const Type *ReqTy, Constant *Agg,
2336 Constant *const *Idxs, unsigned NumIdx) {
2337 assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs,
2338 Idxs+NumIdx) == ReqTy &&
2339 "extractvalue indices invalid!");
2340
2341 if (Constant *FC = ConstantFoldExtractValue(Agg, Idxs, NumIdx))
2342 return FC; // Fold a few common cases...
2343
2344 assert(isa(Agg->getType()) &&
2345 "Non-pointer type for constant ExtractValue expression");
2346 // Look up the constant in the table first to ensure uniqueness
2347 std::vector ArgVec;
2348 ArgVec.reserve(NumIdx+1);
2349 ArgVec.push_back(Agg);
2350 for (unsigned i = 0; i != NumIdx; ++i)
2351 ArgVec.push_back(cast(Idxs[i]));
2352 const ExprMapKeyType Key(Instruction::ExtractValue, ArgVec);
2353 return ExprConstants->getOrCreate(ReqTy, Key);
2354 }
2355
2356 Constant *ConstantExpr::getExtractValue(Constant *Agg,
2357 Constant* const *IdxList, unsigned NumIdx) {
2358 assert((isa(Agg->getType()) || isa(Agg->getType()) ||
2359 isa(Agg->getType())) &&
2360 "Tried to create extractelement operation on non-aggregate type!");
2361
2362 const Type *ReqTy =
2363 ExtractValueInst::getIndexedType(Agg->getType(), IdxList, IdxList+NumIdx);
2364 assert(ReqTy && "extractvalue indices invalid!");
2365 return getExtractValueTy(ReqTy, Agg, IdxList, NumIdx);
21812366 }
21822367
21832368 Constant *ConstantExpr::getZeroValueForNegationExpr(const Type *Ty) {
24052590 }
24062591 Replacement = ConstantExpr::getGetElementPtr(Pointer,
24072592 &Indices[0], Indices.size());
2593 } else if (getOpcode() == Instruction::ExtractValue) {
2594 SmallVector Indices;
2595 Constant *Agg = getOperand(0);
2596 Indices.reserve(getNumOperands()-1);
2597 if (Agg == From) Agg = To;
2598
2599 for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
2600 Constant *Val = getOperand(i);
2601 if (Val == From) Val = To;
2602 Indices.push_back(Val);
2603 }
2604 Replacement = ConstantExpr::getExtractValue(Agg,
2605 &Indices[0], Indices.size());
2606 } else if (getOpcode() == Instruction::InsertValue) {
2607 SmallVector Indices;
2608 Constant *Agg = getOperand(0);
2609 Constant *Val = getOperand(1);
2610 Indices.reserve(getNumOperands()-2);
2611 if (Agg == From) Agg = To;
2612 if (Val == From) Val = To;
2613
2614 for (unsigned i = 2, e = getNumOperands(); i != e; ++i) {
2615 Constant *Val = getOperand(i);
2616 if (Val == From) Val = To;
2617 Indices.push_back(Val);
2618 }
2619 Replacement = ConstantExpr::getInsertValue(Agg, Val,
2620 &Indices[0], Indices.size());
24082621 } else if (isCast()) {
24092622 assert(getOperand(0) == From && "Cast only has one use!");
24102623 Replacement = ConstantExpr::getCast(getOpcode(), To, getType());
10371037 //
10381038 const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
10391039 Value* const *Idxs,
1040 unsigned NumIdx,
1041 bool AllowCompositeLeaf) {
1042 if (!isa(Ptr)) return 0; // Type isn't a pointer type!
1040 unsigned NumIdx) {
1041 const PointerType *PTy = dyn_cast(Ptr);
1042 if (!PTy) return 0; // Type isn't a pointer type!
1043 const Type *Agg = PTy->getElementType();
10431044
10441045 // Handle the special case of the empty set index set...
1045 if (NumIdx == 0) {
1046 if (AllowCompositeLeaf ||
1047 cast(Ptr)->getElementType()->isFirstClassType())
1048 return cast(Ptr)->getElementType();
1049 else
1050 return 0;
1051 }
1052
1053 unsigned CurIdx = 0;
1054 while (const CompositeType *CT = dyn_cast(Ptr)) {
1055 if (NumIdx == CurIdx) {
1056 if (AllowCompositeLeaf || CT->isFirstClassType()) return Ptr;
1057 return 0; // Can't load a whole structure or array!?!?
1058 }
1059
1060 Value *Index = Idxs[CurIdx++];
1061 if (isa(CT) && CurIdx != 1)
1062 return 0; // Can only index into pointer types at the first index!
1063 if (!CT->indexValid(Index)) return 0;
1064 Ptr = CT->getTypeAtIndex(Index);
1065
1066 // If the new type forwards to another type, then it is in the middle
1067 // of being refined to another type (and hence, may have dropped all
1068 // references to what it was using before). So, use the new forwarded
1069 // type.
1070 if (const Type * Ty = Ptr->getForwardedType()) {
1071 Ptr = Ty;
1072 }
1073 }
1074 return CurIdx == NumIdx ? Ptr : 0;
1046 if (NumIdx == 0)
1047 return Agg;
1048
1049 return ExtractValueInst::getIndexedType(Agg, Idxs+1, Idxs+NumIdx);
10751050 }
10761051
10771052 const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) {
13441319 return cast(MaskCV->getOperand(i))->getZExtValue();
13451320 }
13461321
1322 //===----------------------------------------------------------------------===//
1323 // ExtractValueInst Class
1324 //===----------------------------------------------------------------------===//
1325
1326 // getIndexedType - Returns the type of the element that would be extracted
1327 // with an extractvalue instruction with the specified parameters.
1328 //
1329 // A null type is returned if the indices are invalid for the specified
1330 // pointer type.
1331 //
1332 const Type* ExtractValueInst::getIndexedType(const Type *Agg,
1333 Value* const *Idxs,
1334 unsigned NumIdx) {
1335 unsigned CurIdx = 0;
1336 for (; CurIdx != NumIdx; ++CurIdx) {
1337 const CompositeType *CT = dyn_cast(Agg);
1338 if (!CT) return 0;
1339 Value *Index = Idxs[CurIdx];
1340 if (!CT->indexValid(Index)) return 0;
1341 Agg = CT->getTypeAtIndex(Index);
1342
1343 // If the new type forwards to another type, then it is in the middle
1344 // of being refined to another type (and hence, may have dropped all
1345 // references to what it was using before). So, use the new forwarded
1346 // type.
1347 if (const Type *Ty = Agg->getForwardedType())
1348 Agg = Ty;
1349 }
1350 return CurIdx == NumIdx ? Agg : 0;
1351 }
13471352
13481353 //===----------------------------------------------------------------------===//
13491354 // BinaryOperator Class
10441044 SmallVector Idxs(GEP.idx_begin(), GEP.idx_end());
10451045 const Type *ElTy =
10461046 GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
1047 Idxs.begin(), Idxs.end(), true);
1047 Idxs.begin(), Idxs.end());
10481048 Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP);
10491049 Assert2(isa(GEP.getType()) &&
10501050 cast(GEP.getType())->getElementType() == ElTy,
None ; RUN: not llvm-as < %s |& grep {Invalid getelementptr indices}
0 ; RUN: llvm-as < %s
11
2 ; This testcase is invalid because we are indexing into a pointer that is
3 ; contained WITHIN a structure.
2 ; This testcase was previously considered invalid for indexing into a pointer
3 ; that is contained WITHIN a structure, but this is now valid.
44
55 define void @test({i32, i32*} * %X) {
66 getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0