[llvm-commits] [SignlessTypes] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l Lexer.l.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs
Zhou Sheng
zhousheng00 at gmail.com
Sun Oct 29 00:36:14 PDT 2006
Changes in directory llvm/lib/AsmParser:
Lexer.cpp.cvs updated: 1.10.2.7 -> 1.10.2.8
Lexer.l updated: 1.78.2.6 -> 1.78.2.7
Lexer.l.cvs updated: 1.8.2.6 -> 1.8.2.7
llvmAsmParser.cpp.cvs updated: 1.18.2.8 -> 1.18.2.9
llvmAsmParser.h.cvs updated: 1.13.2.8 -> 1.13.2.9
llvmAsmParser.y updated: 1.266.2.9 -> 1.266.2.10
llvmAsmParser.y.cvs updated: 1.18.2.8 -> 1.18.2.9
---
Log message:
---
Diffs of the changes: (+340 -330)
Lexer.cpp.cvs | 2
Lexer.l | 2
Lexer.l.cvs | 2
llvmAsmParser.cpp.cvs | 546 +++++++++++++++++++++++++-------------------------
llvmAsmParser.h.cvs | 14 -
llvmAsmParser.y | 6
llvmAsmParser.y.cvs | 98 ++++----
7 files changed, 340 insertions(+), 330 deletions(-)
Index: llvm/lib/AsmParser/Lexer.cpp.cvs
diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.10.2.7 llvm/lib/AsmParser/Lexer.cpp.cvs:1.10.2.8
--- llvm/lib/AsmParser/Lexer.cpp.cvs:1.10.2.7 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/Lexer.cpp.cvs Sun Oct 29 01:35:49 2006
@@ -20,7 +20,7 @@
/* A lexical scanner generated by flex*/
/* Scanner skeleton version:
- * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.10.2.7 2006/10/23 18:13:26 sheng Exp $
+ * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.10.2.8 2006/10/29 07:35:49 sheng Exp $
*/
#define FLEX_SCANNER
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.78.2.6 llvm/lib/AsmParser/Lexer.l:1.78.2.7
--- llvm/lib/AsmParser/Lexer.l:1.78.2.6 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/Lexer.l Sun Oct 29 01:35:49 2006
@@ -220,7 +220,7 @@
deplibs { return DEPLIBS; }
endian { return ENDIAN; }
pointersize { return POINTERSIZE; }
-data { return DATA; }
+data { return DATA; }
little { return LITTLE; }
big { return BIG; }
volatile { return VOLATILE; }
Index: llvm/lib/AsmParser/Lexer.l.cvs
diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.8.2.6 llvm/lib/AsmParser/Lexer.l.cvs:1.8.2.7
--- llvm/lib/AsmParser/Lexer.l.cvs:1.8.2.6 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/Lexer.l.cvs Sun Oct 29 01:35:49 2006
@@ -220,7 +220,7 @@
deplibs { return DEPLIBS; }
endian { return ENDIAN; }
pointersize { return POINTERSIZE; }
-data { return DATA; }
+data { return DATA; }
little { return LITTLE; }
big { return BIG; }
volatile { return VOLATILE; }
Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs
diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.18.2.8 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.18.2.9
--- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.18.2.8 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Sun Oct 29 01:35:49 2006
@@ -1095,50 +1095,48 @@
return Ty;
}
-// This template function is used to obtain the correct opcode for an
-// instruction when an obsolete opcode is encountered. The OpcodeInfo template
-// keeps track of the opcode and the "obsolete" flag. These are generated by
-// the lexer and obsolete will be true when the lexer encounters the token for
+// This function is used to obtain the correct opcode for an instruction when
+// an obsolete opcode is encountered. The OI parameter (OpcodeInfo) has both
+// an opcode and an "obsolete" flag. These are generated by the lexer and
+// the "obsolete" member will be true when the lexer encounters the token for
// an obsolete opcode. For example, "div" was replaced by [usf]div but we need
// to maintain backwards compatibility for asm files that still have the "div"
// instruction. This function handles converting div -> [usf]div appropriately.
-template <class EnumKind>
-static void sanitizeOpCode(OpcodeInfo<EnumKind> &OI, const PATypeHolder& Ty) {
- if (OI.obsolete) {
- switch (OI.opcode) {
- default:
- GenerateError("Invalid Obsolete OpCode");
- break;
- case Instruction::UDiv:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FDiv;
- else if (Ty->isSigned())
- OI.opcode = Instruction::SDiv;
- break;
- case Instruction::SDiv:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FDiv;
- else if (Ty->isUnsigned())
- OI.opcode = Instruction::UDiv;
- break;
- case Instruction::URem:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FRem;
- else if (Ty->isSigned())
- OI.opcode = Instruction::SRem;
- break;
- case Instruction::SRem:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FRem;
- else if (Ty->isUnsigned())
- OI.opcode = Instruction::URem;
- break;
- }
- OI.obsolete = false;
+static void
+sanitizeOpCode(OpcodeInfo<Instruction::BinaryOps> &OI, const PATypeHolder& PATy)
+{
+ // If its not obsolete, don't do anything
+ if (!OI.obsolete)
+ return;
+
+ // If its a packed type we want to use the element type
+ const Type* Ty = PATy;
+ if (const PackedType* PTy = dyn_cast<PackedType>(Ty))
+ Ty = PTy->getElementType();
+
+ // Depending on the opcode ..
+ switch (OI.opcode) {
+ default:
+ GenerateError("Invalid Obsolete OpCode");
+ break;
+ case Instruction::UDiv:
+ // Handle cases where the opcode needs to change
+ if (Ty->isFloatingPoint())
+ OI.opcode = Instruction::FDiv;
+ else if (Ty->isSigned())
+ OI.opcode = Instruction::SDiv;
+ break;
+ case Instruction::URem:
+ if (Ty->isFloatingPoint())
+ OI.opcode = Instruction::FRem;
+ else if (Ty->isSigned())
+ OI.opcode = Instruction::SRem;
+ break;
}
+ // Its not obsolete any more, we fixed it.
+ OI.obsolete = false;
}
-
-
+
// common code from the two 'RunVMAsmParser' functions
static Module* RunParser(Module * M) {
@@ -1315,7 +1313,7 @@
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 1017 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1015 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
typedef union YYSTYPE {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -1347,16 +1345,16 @@
bool BoolVal;
char *StrVal; // This memory is strdup'd!
- llvm::ValID ValIDVal; // strdup'd memory maybe!
+ llvm::ValID ValIDVal; // strdup'd memory maybe!
- BinaryOpInfo BinaryOpVal;
- TermOpInfo TermOpVal;
- MemOpInfo MemOpVal;
- OtherOpInfo OtherOpVal;
- llvm::Module::Endianness Endianness;
+ BinaryOpInfo BinaryOpVal;
+ TermOpInfo TermOpVal;
+ MemOpInfo MemOpVal;
+ OtherOpInfo OtherOpVal;
+ llvm::Module::Endianness Endianness;
} YYSTYPE;
/* Line 196 of yacc.c. */
-#line 1360 "llvmAsmParser.tab.c"
+#line 1358 "llvmAsmParser.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@@ -1368,7 +1366,7 @@
/* Line 219 of yacc.c. */
-#line 1372 "llvmAsmParser.tab.c"
+#line 1370 "llvmAsmParser.tab.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
@@ -1703,32 +1701,32 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
- 0, 1140, 1140, 1141, 1149, 1150, 1160, 1160, 1160, 1160,
- 1160, 1160, 1160, 1160, 1160, 1161, 1161, 1161, 1162, 1162,
- 1162, 1162, 1162, 1162, 1164, 1164, 1168, 1168, 1168, 1168,
- 1169, 1169, 1169, 1169, 1170, 1170, 1171, 1171, 1174, 1178,
- 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1192, 1193,
- 1194, 1195, 1196, 1197, 1198, 1199, 1208, 1209, 1215, 1216,
- 1224, 1232, 1233, 1238, 1239, 1240, 1245, 1259, 1259, 1260,
- 1260, 1262, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1273,
- 1273, 1273, 1273, 1273, 1273, 1274, 1278, 1282, 1290, 1298,
- 1311, 1316, 1328, 1338, 1342, 1353, 1358, 1364, 1365, 1369,
- 1373, 1384, 1410, 1424, 1454, 1480, 1501, 1514, 1524, 1529,
- 1590, 1597, 1606, 1612, 1618, 1622, 1626, 1634, 1645, 1677,
- 1685, 1709, 1720, 1726, 1734, 1740, 1746, 1755, 1759, 1767,
- 1767, 1777, 1785, 1790, 1794, 1798, 1802, 1817, 1839, 1842,
- 1845, 1845, 1853, 1853, 1861, 1861, 1869, 1869, 1878, 1881,
- 1884, 1888, 1901, 1902, 1904, 1908, 1917, 1922, 1928, 1930,
- 1935, 1940, 1949, 1949, 1950, 1950, 1952, 1959, 1965, 1972,
- 1976, 1982, 1987, 1992, 2087, 2087, 2089, 2097, 2097, 2099,
- 2104, 2105, 2106, 2108, 2108, 2118, 2122, 2127, 2131, 2135,
- 2139, 2143, 2147, 2151, 2155, 2159, 2184, 2188, 2202, 2206,
- 2212, 2212, 2218, 2223, 2227, 2236, 2247, 2252, 2264, 2277,
- 2281, 2285, 2290, 2299, 2318, 2327, 2383, 2387, 2394, 2405,
- 2418, 2427, 2436, 2446, 2450, 2457, 2457, 2459, 2463, 2468,
- 2487, 2502, 2516, 2529, 2537, 2545, 2553, 2559, 2579, 2602,
- 2608, 2614, 2620, 2635, 2694, 2701, 2704, 2709, 2713, 2720,
- 2725, 2731, 2736, 2742, 2750, 2762, 2777
+ 0, 1138, 1138, 1139, 1147, 1148, 1158, 1158, 1158, 1158,
+ 1158, 1158, 1158, 1158, 1158, 1159, 1159, 1159, 1160, 1160,
+ 1160, 1160, 1160, 1160, 1162, 1162, 1166, 1166, 1166, 1166,
+ 1167, 1167, 1167, 1167, 1168, 1168, 1169, 1169, 1172, 1176,
+ 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1190, 1191,
+ 1192, 1193, 1194, 1195, 1196, 1197, 1206, 1207, 1213, 1214,
+ 1222, 1230, 1231, 1236, 1237, 1238, 1243, 1257, 1257, 1258,
+ 1258, 1260, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1271,
+ 1271, 1271, 1271, 1271, 1271, 1272, 1276, 1280, 1288, 1296,
+ 1309, 1314, 1326, 1336, 1340, 1351, 1356, 1362, 1363, 1367,
+ 1371, 1382, 1408, 1422, 1452, 1478, 1499, 1512, 1522, 1527,
+ 1588, 1595, 1604, 1610, 1616, 1620, 1624, 1632, 1643, 1675,
+ 1683, 1710, 1721, 1727, 1735, 1741, 1747, 1756, 1760, 1768,
+ 1768, 1778, 1786, 1791, 1795, 1799, 1803, 1818, 1840, 1843,
+ 1846, 1846, 1854, 1854, 1862, 1862, 1870, 1870, 1879, 1882,
+ 1885, 1889, 1902, 1903, 1905, 1909, 1918, 1923, 1929, 1931,
+ 1936, 1941, 1950, 1950, 1951, 1951, 1953, 1960, 1966, 1973,
+ 1977, 1983, 1988, 1993, 2088, 2088, 2090, 2098, 2098, 2100,
+ 2105, 2106, 2107, 2109, 2109, 2119, 2123, 2128, 2132, 2136,
+ 2140, 2144, 2148, 2152, 2156, 2160, 2185, 2189, 2203, 2207,
+ 2213, 2213, 2219, 2224, 2228, 2237, 2248, 2253, 2265, 2278,
+ 2282, 2286, 2291, 2300, 2319, 2328, 2384, 2388, 2395, 2406,
+ 2419, 2428, 2437, 2447, 2451, 2458, 2458, 2460, 2464, 2469,
+ 2491, 2506, 2520, 2533, 2541, 2549, 2557, 2563, 2583, 2606,
+ 2612, 2618, 2624, 2639, 2698, 2705, 2708, 2713, 2717, 2724,
+ 2729, 2735, 2740, 2746, 2754, 2766, 2781
};
#endif
@@ -3015,7 +3013,7 @@
switch (yyn)
{
case 3:
-#line 1141 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1139 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range!
GEN_ERROR("Value too large for type!");
@@ -3025,7 +3023,7 @@
break;
case 5:
-#line 1150 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1148 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range!
GEN_ERROR("Value too large for type!");
@@ -3035,7 +3033,7 @@
break;
case 38:
-#line 1174 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1172 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[-1].StrVal);
CHECK_FOR_ERROR
@@ -3043,7 +3041,7 @@
break;
case 39:
-#line 1178 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1176 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = 0;
CHECK_FOR_ERROR
@@ -3051,82 +3049,82 @@
break;
case 40:
-#line 1183 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1181 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 41:
-#line 1184 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1182 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 42:
-#line 1185 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1183 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 43:
-#line 1186 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1184 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
break;
case 44:
-#line 1187 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1185 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 45:
-#line 1188 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1186 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 46:
-#line 1189 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1187 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 47:
-#line 1190 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1188 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 48:
-#line 1192 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1190 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 49:
-#line 1193 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1191 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 50:
-#line 1194 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1192 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::CSRet; ;}
break;
case 51:
-#line 1195 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1193 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Fast; ;}
break;
case 52:
-#line 1196 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1194 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Cold; ;}
break;
case 53:
-#line 1197 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1195 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
break;
case 54:
-#line 1198 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1196 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
break;
case 55:
-#line 1199 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1197 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val))
GEN_ERROR("Calling conv too large!");
@@ -3136,12 +3134,12 @@
break;
case 56:
-#line 1208 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1206 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 57:
-#line 1209 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1207 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[0].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3151,12 +3149,12 @@
break;
case 58:
-#line 1215 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1213 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 59:
-#line 1216 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1214 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[0].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3166,7 +3164,7 @@
break;
case 60:
-#line 1224 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1222 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i)
if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\')
@@ -3177,27 +3175,27 @@
break;
case 61:
-#line 1232 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1230 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 62:
-#line 1233 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1231 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = (yyvsp[0].StrVal); ;}
break;
case 63:
-#line 1238 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1236 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 64:
-#line 1239 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1237 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 65:
-#line 1240 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1238 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV->setSection((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -3206,7 +3204,7 @@
break;
case 66:
-#line 1245 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1243 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val)))
GEN_ERROR("Alignment must be a power of two!");
@@ -3216,17 +3214,17 @@
break;
case 68:
-#line 1259 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1257 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
break;
case 70:
-#line 1260 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1258 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
break;
case 71:
-#line 1262 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1260 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
@@ -3236,7 +3234,7 @@
break;
case 85:
-#line 1274 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1272 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
CHECK_FOR_ERROR
@@ -3244,7 +3242,7 @@
break;
case 86:
-#line 1278 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1276 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType));
CHECK_FOR_ERROR
@@ -3252,7 +3250,7 @@
break;
case 87:
-#line 1282 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1280 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Named types are also simple types...
const Type* tmp = getTypeVal((yyvsp[0].ValIDVal));
CHECK_FOR_ERROR
@@ -3261,7 +3259,7 @@
break;
case 88:
-#line 1290 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1288 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Type UpReference
if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
@@ -3273,7 +3271,7 @@
break;
case 89:
-#line 1298 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1296 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Function derived type?
std::vector<const Type*> Params;
for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(),
@@ -3290,7 +3288,7 @@
break;
case 90:
-#line 1311 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1309 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Sized array type?
(yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val))));
delete (yyvsp[-1].TypeVal);
@@ -3299,7 +3297,7 @@
break;
case 91:
-#line 1316 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1314 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Packed array type?
const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get();
if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val))
@@ -3315,7 +3313,7 @@
break;
case 92:
-#line 1328 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1326 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Structure type?
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(),
@@ -3329,7 +3327,7 @@
break;
case 93:
-#line 1338 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1336 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
(yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
CHECK_FOR_ERROR
@@ -3337,7 +3335,7 @@
break;
case 94:
-#line 1342 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1340 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Pointer type?
if (*(yyvsp[-1].TypeVal) == Type::LabelTy)
GEN_ERROR("Cannot form a pointer to a basic block");
@@ -3348,7 +3346,7 @@
break;
case 95:
-#line 1353 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1351 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeList) = new std::list<PATypeHolder>();
(yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
@@ -3357,7 +3355,7 @@
break;
case 96:
-#line 1358 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1356 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
CHECK_FOR_ERROR
@@ -3365,7 +3363,7 @@
break;
case 98:
-#line 1365 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1363 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy);
CHECK_FOR_ERROR
@@ -3373,7 +3371,7 @@
break;
case 99:
-#line 1369 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1367 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeList) = new std::list<PATypeHolder>())->push_back(Type::VoidTy);
CHECK_FOR_ERROR
@@ -3381,7 +3379,7 @@
break;
case 100:
-#line 1373 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1371 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeList) = new std::list<PATypeHolder>();
CHECK_FOR_ERROR
@@ -3389,7 +3387,7 @@
break;
case 101:
-#line 1384 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1382 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal)->get());
if (ATy == 0)
@@ -3419,7 +3417,7 @@
break;
case 102:
-#line 1410 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1408 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get());
if (ATy == 0)
@@ -3437,7 +3435,7 @@
break;
case 103:
-#line 1424 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1422 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get());
if (ATy == 0)
@@ -3471,7 +3469,7 @@
break;
case 104:
-#line 1454 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1452 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal)->get());
if (PTy == 0)
@@ -3501,7 +3499,7 @@
break;
case 105:
-#line 1480 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1478 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal)->get());
if (STy == 0)
@@ -3526,7 +3524,7 @@
break;
case 106:
-#line 1501 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1499 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal)->get());
if (STy == 0)
@@ -3543,7 +3541,7 @@
break;
case 107:
-#line 1514 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1512 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
if (PTy == 0)
@@ -3557,7 +3555,7 @@
break;
case 108:
-#line 1524 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1522 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get());
delete (yyvsp[-1].TypeVal);
@@ -3566,7 +3564,7 @@
break;
case 109:
-#line 1529 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1527 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
if (Ty == 0)
@@ -3631,7 +3629,7 @@
break;
case 110:
-#line 1590 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1588 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType())
GEN_ERROR("Mismatched types for constant expression!");
@@ -3642,7 +3640,7 @@
break;
case 111:
-#line 1597 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1595 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal)->get();
if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
@@ -3654,7 +3652,7 @@
break;
case 112:
-#line 1606 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1604 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)))
GEN_ERROR("Constant value doesn't fit in type!");
@@ -3664,7 +3662,7 @@
break;
case 113:
-#line 1612 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1610 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)))
GEN_ERROR("Constant value doesn't fit in type!");
@@ -3674,7 +3672,7 @@
break;
case 114:
-#line 1618 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1616 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
(yyval.ConstVal) = ConstantBool::getTrue();
CHECK_FOR_ERROR
@@ -3682,7 +3680,7 @@
break;
case 115:
-#line 1622 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1620 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
(yyval.ConstVal) = ConstantBool::getFalse();
CHECK_FOR_ERROR
@@ -3690,7 +3688,7 @@
break;
case 116:
-#line 1626 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1624 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Float & Double constants
if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal)))
GEN_ERROR("Floating point constant invalid for type!!");
@@ -3700,7 +3698,7 @@
break;
case 117:
-#line 1634 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1632 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!(yyvsp[-3].ConstVal)->getType()->isFirstClassType())
GEN_ERROR("cast constant expression from a non-primitive type: '" +
@@ -3715,7 +3713,7 @@
break;
case 118:
-#line 1645 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1643 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[-2].ConstVal)->getType()))
GEN_ERROR("GetElementPtr requires a pointer operand!");
@@ -3751,7 +3749,7 @@
break;
case 119:
-#line 1677 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1675 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy)
GEN_ERROR("Select condition must be of boolean type!");
@@ -3763,12 +3761,15 @@
break;
case 120:
-#line 1685 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1683 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
GEN_ERROR("Binary operator types must match!");
+ // First, make sure we're dealing with the right opcode by upgrading from
+ // obsolete versions.
sanitizeOpCode((yyvsp[-5].BinaryOpVal),(yyvsp[-3].ConstVal)->getType());
CHECK_FOR_ERROR;
+
// HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs.
// To retain backward compatibility with these early compilers, we emit a
// cast to the appropriate integer type automatically if we are in the
@@ -3791,7 +3792,7 @@
break;
case 121:
-#line 1709 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1710 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
GEN_ERROR("Logical operator types must match!");
@@ -3806,7 +3807,7 @@
break;
case 122:
-#line 1720 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1721 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
GEN_ERROR("setcc operand types must match!");
@@ -3816,7 +3817,7 @@
break;
case 123:
-#line 1726 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1727 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy)
GEN_ERROR("Shift count for shift constant must be unsigned byte!");
@@ -3828,7 +3829,7 @@
break;
case 124:
-#line 1734 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1735 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
GEN_ERROR("Invalid extractelement operands!");
@@ -3838,7 +3839,7 @@
break;
case 125:
-#line 1740 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1741 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
GEN_ERROR("Invalid insertelement operands!");
@@ -3848,7 +3849,7 @@
break;
case 126:
-#line 1746 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1747 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
GEN_ERROR("Invalid shufflevector operands!");
@@ -3858,7 +3859,7 @@
break;
case 127:
-#line 1755 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1756 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal));
CHECK_FOR_ERROR
@@ -3866,7 +3867,7 @@
break;
case 128:
-#line 1759 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1760 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ConstVector) = new std::vector<Constant*>();
(yyval.ConstVector)->push_back((yyvsp[0].ConstVal));
@@ -3875,17 +3876,17 @@
break;
case 129:
-#line 1767 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1768 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 130:
-#line 1767 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1768 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 131:
-#line 1777 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1778 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal);
CurModule.ModuleDone();
@@ -3894,7 +3895,7 @@
break;
case 132:
-#line 1785 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1786 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
CurFun.FunctionDone();
@@ -3903,7 +3904,7 @@
break;
case 133:
-#line 1790 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1791 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
CHECK_FOR_ERROR
@@ -3911,7 +3912,7 @@
break;
case 134:
-#line 1794 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1795 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = (yyvsp[-3].ModuleVal);
CHECK_FOR_ERROR
@@ -3919,7 +3920,7 @@
break;
case 135:
-#line 1798 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1799 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = (yyvsp[-1].ModuleVal);
CHECK_FOR_ERROR
@@ -3927,7 +3928,7 @@
break;
case 136:
-#line 1802 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1803 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = CurModule.CurrentModule;
// Emit an error if there are any unresolved types left.
@@ -3944,7 +3945,7 @@
break;
case 137:
-#line 1817 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1818 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Eagerly resolve types. This is not an optimization, this is a
// requirement that is due to the fact that we could have this:
@@ -3970,21 +3971,21 @@
break;
case 138:
-#line 1839 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1840 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Function prototypes can be in const pool
CHECK_FOR_ERROR
;}
break;
case 139:
-#line 1842 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1843 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Asm blocks can be in the const pool
CHECK_FOR_ERROR
;}
break;
case 140:
-#line 1845 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1846 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].ConstVal) == 0)
GEN_ERROR("Global value initializer is not a constant!");
@@ -3994,14 +3995,14 @@
break;
case 141:
-#line 1850 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1851 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;}
break;
case 142:
-#line 1853 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1854 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
CHECK_FOR_ERROR
@@ -4010,7 +4011,7 @@
break;
case 143:
-#line 1857 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1858 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
@@ -4018,7 +4019,7 @@
break;
case 144:
-#line 1861 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1862 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
CHECK_FOR_ERROR
@@ -4027,7 +4028,7 @@
break;
case 145:
-#line 1865 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1866 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
@@ -4035,7 +4036,7 @@
break;
case 146:
-#line 1869 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1870 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV =
ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
@@ -4045,7 +4046,7 @@
break;
case 147:
-#line 1874 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1875 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
@@ -4053,27 +4054,27 @@
break;
case 148:
-#line 1878 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1879 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 149:
-#line 1881 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1882 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 150:
-#line 1884 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1885 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
;}
break;
case 151:
-#line 1888 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1889 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
@@ -4089,17 +4090,17 @@
break;
case 152:
-#line 1901 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1902 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Endianness) = Module::BigEndian; ;}
break;
case 153:
-#line 1902 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1903 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Endianness) = Module::LittleEndian; ;}
break;
case 154:
-#line 1904 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1905 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness));
CHECK_FOR_ERROR
@@ -4107,7 +4108,7 @@
break;
case 155:
-#line 1908 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1909 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].UInt64Val) == 32)
CurModule.CurrentModule->setPointerSize(Module::Pointer32);
@@ -4120,7 +4121,7 @@
break;
case 156:
-#line 1917 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1918 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4129,7 +4130,7 @@
break;
case 157:
-#line 1922 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1923 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4138,7 +4139,7 @@
break;
case 159:
-#line 1930 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1931 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4147,7 +4148,7 @@
break;
case 160:
-#line 1935 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1936 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
free((yyvsp[0].StrVal));
@@ -4156,19 +4157,19 @@
break;
case 161:
-#line 1940 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1941 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 165:
-#line 1950 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1951 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 166:
-#line 1952 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1953 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (*(yyvsp[-1].TypeVal) == Type::VoidTy)
GEN_ERROR("void typed arguments are invalid!");
@@ -4178,7 +4179,7 @@
break;
case 167:
-#line 1959 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1960 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[-2].ArgList);
(yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal));
@@ -4188,7 +4189,7 @@
break;
case 168:
-#line 1965 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1966 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >();
(yyval.ArgList)->push_back(*(yyvsp[0].ArgVal));
@@ -4198,7 +4199,7 @@
break;
case 169:
-#line 1972 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1973 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[0].ArgList);
CHECK_FOR_ERROR
@@ -4206,7 +4207,7 @@
break;
case 170:
-#line 1976 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1977 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[-2].ArgList);
(yyval.ArgList)->push_back(std::pair<PATypeHolder*,
@@ -4216,7 +4217,7 @@
break;
case 171:
-#line 1982 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1983 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >();
(yyval.ArgList)->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0));
@@ -4225,7 +4226,7 @@
break;
case 172:
-#line 1987 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1988 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = 0;
CHECK_FOR_ERROR
@@ -4233,7 +4234,7 @@
break;
case 173:
-#line 1993 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1994 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
UnEscapeLexed((yyvsp[-5].StrVal));
std::string FunctionName((yyvsp[-5].StrVal));
@@ -4330,7 +4331,7 @@
break;
case 176:
-#line 2089 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2090 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
@@ -4341,7 +4342,7 @@
break;
case 179:
-#line 2099 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2100 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
CHECK_FOR_ERROR
@@ -4349,22 +4350,22 @@
break;
case 181:
-#line 2105 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2106 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.Linkage = GlobalValue::DLLImportLinkage ;}
break;
case 182:
-#line 2106 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2107 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.Linkage = GlobalValue::DLLImportLinkage ;}
break;
case 183:
-#line 2108 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2109 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.isDeclare = true; ;}
break;
case 184:
-#line 2108 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2109 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
CurFun.FunctionDone();
@@ -4373,7 +4374,7 @@
break;
case 185:
-#line 2118 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2119 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -4381,7 +4382,7 @@
break;
case 186:
-#line 2122 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2123 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -4389,7 +4390,7 @@
break;
case 187:
-#line 2127 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2128 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A reference to a direct constant
(yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val));
CHECK_FOR_ERROR
@@ -4397,7 +4398,7 @@
break;
case 188:
-#line 2131 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2132 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val));
CHECK_FOR_ERROR
@@ -4405,7 +4406,7 @@
break;
case 189:
-#line 2135 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2136 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Perhaps it's an FP constant?
(yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal));
CHECK_FOR_ERROR
@@ -4413,7 +4414,7 @@
break;
case 190:
-#line 2139 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2140 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantBool::getTrue());
CHECK_FOR_ERROR
@@ -4421,7 +4422,7 @@
break;
case 191:
-#line 2143 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2144 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantBool::getFalse());
CHECK_FOR_ERROR
@@ -4429,7 +4430,7 @@
break;
case 192:
-#line 2147 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2148 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createNull();
CHECK_FOR_ERROR
@@ -4437,7 +4438,7 @@
break;
case 193:
-#line 2151 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2152 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createUndef();
CHECK_FOR_ERROR
@@ -4445,7 +4446,7 @@
break;
case 194:
-#line 2155 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2156 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A vector zero constant.
(yyval.ValIDVal) = ValID::createZeroInit();
CHECK_FOR_ERROR
@@ -4453,7 +4454,7 @@
break;
case 195:
-#line 2159 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2160 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType();
int NumElements = (yyvsp[-1].ConstVector)->size();
@@ -4482,7 +4483,7 @@
break;
case 196:
-#line 2184 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2185 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal));
CHECK_FOR_ERROR
@@ -4490,7 +4491,7 @@
break;
case 197:
-#line 2188 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2189 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
char *End = UnEscapeLexed((yyvsp[-2].StrVal), true);
std::string AsmStr = std::string((yyvsp[-2].StrVal), End);
@@ -4504,7 +4505,7 @@
break;
case 198:
-#line 2202 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2203 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it an integer reference...?
(yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal));
CHECK_FOR_ERROR
@@ -4512,7 +4513,7 @@
break;
case 199:
-#line 2206 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2207 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
(yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal));
CHECK_FOR_ERROR
@@ -4520,7 +4521,7 @@
break;
case 202:
-#line 2218 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2219 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal);
CHECK_FOR_ERROR
@@ -4528,7 +4529,7 @@
break;
case 203:
-#line 2223 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2224 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
CHECK_FOR_ERROR
@@ -4536,7 +4537,7 @@
break;
case 204:
-#line 2227 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2228 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Do not allow functions with 0 basic blocks
(yyval.FunctionVal) = (yyvsp[-1].FunctionVal);
CHECK_FOR_ERROR
@@ -4544,7 +4545,7 @@
break;
case 205:
-#line 2236 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2237 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal));
CHECK_FOR_ERROR
@@ -4558,7 +4559,7 @@
break;
case 206:
-#line 2247 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2248 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal));
(yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal);
@@ -4567,7 +4568,7 @@
break;
case 207:
-#line 2252 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2253 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
CHECK_FOR_ERROR
@@ -4583,7 +4584,7 @@
break;
case 208:
-#line 2264 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2265 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true);
CHECK_FOR_ERROR
@@ -4599,7 +4600,7 @@
break;
case 209:
-#line 2277 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2278 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with a result...
(yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal));
CHECK_FOR_ERROR
@@ -4607,7 +4608,7 @@
break;
case 210:
-#line 2281 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2282 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with no result...
(yyval.TermInstVal) = new ReturnInst();
CHECK_FOR_ERROR
@@ -4615,7 +4616,7 @@
break;
case 211:
-#line 2285 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2286 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal));
CHECK_FOR_ERROR
@@ -4624,7 +4625,7 @@
break;
case 212:
-#line 2290 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2291 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal));
CHECK_FOR_ERROR
@@ -4637,7 +4638,7 @@
break;
case 213:
-#line 2299 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2300 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal));
CHECK_FOR_ERROR
@@ -4660,7 +4661,7 @@
break;
case 214:
-#line 2318 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2319 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal));
CHECK_FOR_ERROR
@@ -4673,7 +4674,7 @@
break;
case 215:
-#line 2328 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2329 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const PointerType *PFTy;
const FunctionType *Ty;
@@ -4732,7 +4733,7 @@
break;
case 216:
-#line 2383 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2384 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnwindInst();
CHECK_FOR_ERROR
@@ -4740,7 +4741,7 @@
break;
case 217:
-#line 2387 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2388 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnreachableInst();
CHECK_FOR_ERROR
@@ -4748,7 +4749,7 @@
break;
case 218:
-#line 2394 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2395 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = (yyvsp[-5].JumpTable);
Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal)));
@@ -4763,7 +4764,7 @@
break;
case 219:
-#line 2405 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2406 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal)));
@@ -4779,7 +4780,7 @@
break;
case 220:
-#line 2418 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2419 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Is this definition named?? if so, assign the name...
setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal));
@@ -4791,7 +4792,7 @@
break;
case 221:
-#line 2427 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2428 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Used for PHI nodes
(yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal));
@@ -4804,7 +4805,7 @@
break;
case 222:
-#line 2436 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2437 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.PHIList) = (yyvsp[-6].PHIList);
Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal));
@@ -4816,7 +4817,7 @@
break;
case 223:
-#line 2446 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2447 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Used for call statements, and memory insts...
(yyval.ValueList) = new std::vector<Value*>();
(yyval.ValueList)->push_back((yyvsp[0].ValueVal));
@@ -4824,7 +4825,7 @@
break;
case 224:
-#line 2450 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2451 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = (yyvsp[-2].ValueList);
(yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal));
@@ -4833,12 +4834,12 @@
break;
case 226:
-#line 2457 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2458 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ValueList) = 0; ;}
break;
case 227:
-#line 2459 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2460 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -4846,7 +4847,7 @@
break;
case 228:
-#line 2463 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2464 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -4854,15 +4855,18 @@
break;
case 229:
-#line 2468 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2469 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() &&
!isa<PackedType>((*(yyvsp[-3].TypeVal)).get()))
GEN_ERROR(
"Arithmetic operator requires integer, FP, or packed operands!");
if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get()) &&
- ((yyvsp[-4].BinaryOpVal).opcode == Instruction::URem || (yyvsp[-4].BinaryOpVal).opcode == Instruction::SRem))
- GEN_ERROR("URem and SRem not supported on packed types!");
+ ((yyvsp[-4].BinaryOpVal).opcode == Instruction::URem ||
+ (yyvsp[-4].BinaryOpVal).opcode == Instruction::SRem ||
+ (yyvsp[-4].BinaryOpVal).opcode == Instruction::FRem))
+ GEN_ERROR("U/S/FRem not supported on packed types!");
+ // Upgrade the opcode from obsolete versions before we do anything with it.
sanitizeOpCode((yyvsp[-4].BinaryOpVal),*(yyvsp[-3].TypeVal));
CHECK_FOR_ERROR;
Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal));
@@ -4877,7 +4881,7 @@
break;
case 230:
-#line 2487 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2491 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!(*(yyvsp[-3].TypeVal))->isIntegral()) {
if (!isa<PackedType>((yyvsp[-3].TypeVal)->get()) ||
@@ -4896,7 +4900,7 @@
break;
case 231:
-#line 2502 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2506 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if(isa<PackedType>((*(yyvsp[-3].TypeVal)).get())) {
GEN_ERROR(
@@ -4914,7 +4918,7 @@
break;
case 232:
-#line 2516 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2520 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::cerr << "WARNING: Use of eliminated 'not' instruction:"
<< " Replacing with 'xor'.\n";
@@ -4931,7 +4935,7 @@
break;
case 233:
-#line 2529 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2533 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy)
GEN_ERROR("Shift amount must be ubyte!");
@@ -4943,7 +4947,7 @@
break;
case 234:
-#line 2537 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2541 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!(yyvsp[0].TypeVal)->get()->isFirstClassType())
GEN_ERROR("cast instruction to a non-primitive type: '" +
@@ -4955,7 +4959,7 @@
break;
case 235:
-#line 2545 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2549 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy)
GEN_ERROR("select condition must be boolean!");
@@ -4967,7 +4971,7 @@
break;
case 236:
-#line 2553 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2557 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
NewVarArgs = true;
(yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal));
@@ -4977,7 +4981,7 @@
break;
case 237:
-#line 2559 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2563 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
ObsoleteVarArgs = true;
const Type* ArgTy = (yyvsp[-2].ValueVal)->getType();
@@ -5001,7 +5005,7 @@
break;
case 238:
-#line 2579 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2583 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
ObsoleteVarArgs = true;
const Type* ArgTy = (yyvsp[-2].ValueVal)->getType();
@@ -5028,7 +5032,7 @@
break;
case 239:
-#line 2602 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2606 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
GEN_ERROR("Invalid extractelement operands!");
@@ -5038,7 +5042,7 @@
break;
case 240:
-#line 2608 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2612 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
GEN_ERROR("Invalid insertelement operands!");
@@ -5048,7 +5052,7 @@
break;
case 241:
-#line 2614 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2618 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)))
GEN_ERROR("Invalid shufflevector operands!");
@@ -5058,7 +5062,7 @@
break;
case 242:
-#line 2620 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2624 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type *Ty = (yyvsp[0].PHIList)->front().first->getType();
if (!Ty->isFirstClassType())
@@ -5077,7 +5081,7 @@
break;
case 243:
-#line 2635 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2639 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const PointerType *PFTy;
const FunctionType *Ty;
@@ -5140,7 +5144,7 @@
break;
case 244:
-#line 2694 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2698 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.InstVal) = (yyvsp[0].InstVal);
CHECK_FOR_ERROR
@@ -5148,7 +5152,7 @@
break;
case 245:
-#line 2701 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2705 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = (yyvsp[0].ValueList);
CHECK_FOR_ERROR
@@ -5156,7 +5160,7 @@
break;
case 246:
-#line 2704 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2708 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = new std::vector<Value*>();
CHECK_FOR_ERROR
@@ -5164,7 +5168,7 @@
break;
case 247:
-#line 2709 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2713 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -5172,7 +5176,7 @@
break;
case 248:
-#line 2713 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2717 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -5180,7 +5184,7 @@
break;
case 249:
-#line 2720 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2724 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal));
delete (yyvsp[-1].TypeVal);
@@ -5189,7 +5193,7 @@
break;
case 250:
-#line 2725 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2729 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal));
CHECK_FOR_ERROR
@@ -5199,7 +5203,7 @@
break;
case 251:
-#line 2731 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2735 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal));
delete (yyvsp[-1].TypeVal);
@@ -5208,7 +5212,7 @@
break;
case 252:
-#line 2736 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2740 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal));
CHECK_FOR_ERROR
@@ -5218,7 +5222,7 @@
break;
case 253:
-#line 2742 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2746 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[0].ValueVal)->getType()))
GEN_ERROR("Trying to free nonpointer type " +
@@ -5229,7 +5233,7 @@
break;
case 254:
-#line 2750 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2754 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[-1].TypeVal)->get()))
GEN_ERROR("Can't load from nonpointer type: " +
@@ -5245,7 +5249,7 @@
break;
case 255:
-#line 2762 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2766 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
const PointerType *PT = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get());
if (!PT)
@@ -5264,7 +5268,7 @@
break;
case 256:
-#line 2777 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2781 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[-2].TypeVal)->get()))
GEN_ERROR("getelementptr insn requires pointer operand!");
@@ -5296,7 +5300,7 @@
}
/* Line 1126 of yacc.c. */
-#line 5300 "llvmAsmParser.tab.c"
+#line 5304 "llvmAsmParser.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@@ -5564,7 +5568,7 @@
}
-#line 2803 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 2807 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
void llvm::GenerateError(const std::string &message, int LineNo) {
Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs
diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.13.2.8 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.13.2.9
--- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.13.2.8 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Sun Oct 29 01:35:49 2006
@@ -257,7 +257,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 1017 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
+#line 1015 "/developer/zsth/llvm-gcc-dev/BAT/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
typedef union YYSTYPE {
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -289,13 +289,13 @@
bool BoolVal;
char *StrVal; // This memory is strdup'd!
- llvm::ValID ValIDVal; // strdup'd memory maybe!
+ llvm::ValID ValIDVal; // strdup'd memory maybe!
- BinaryOpInfo BinaryOpVal;
- TermOpInfo TermOpVal;
- MemOpInfo MemOpVal;
- OtherOpInfo OtherOpVal;
- llvm::Module::Endianness Endianness;
+ BinaryOpInfo BinaryOpVal;
+ TermOpInfo TermOpVal;
+ MemOpInfo MemOpVal;
+ OtherOpInfo OtherOpVal;
+ llvm::Module::Endianness Endianness;
} YYSTYPE;
/* Line 1447 of yacc.c. */
#line 302 "llvmAsmParser.tab.h"
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.9 llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.10
--- llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.9 Wed Oct 25 20:58:05 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y Sun Oct 29 01:35:49 2006
@@ -2472,8 +2472,10 @@
GEN_ERROR(
"Arithmetic operator requires integer, FP, or packed operands!");
if (isa<PackedType>((*$2).get()) &&
- ($1.opcode == Instruction::URem || $1.opcode == Instruction::SRem))
- GEN_ERROR("URem and SRem not supported on packed types!");
+ ($1.opcode == Instruction::URem ||
+ $1.opcode == Instruction::SRem ||
+ $1.opcode == Instruction::FRem))
+ GEN_ERROR("U/S/FRem not supported on packed types!");
// Upgrade the opcode from obsolete versions before we do anything with it.
sanitizeOpCode($1,*$2);
CHECK_FOR_ERROR;
Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs
diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.18.2.8 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.18.2.9
--- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.18.2.8 Mon Oct 23 13:13:26 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Sun Oct 29 01:35:49 2006
@@ -813,50 +813,48 @@
return Ty;
}
-// This template function is used to obtain the correct opcode for an
-// instruction when an obsolete opcode is encountered. The OpcodeInfo template
-// keeps track of the opcode and the "obsolete" flag. These are generated by
-// the lexer and obsolete will be true when the lexer encounters the token for
+// This function is used to obtain the correct opcode for an instruction when
+// an obsolete opcode is encountered. The OI parameter (OpcodeInfo) has both
+// an opcode and an "obsolete" flag. These are generated by the lexer and
+// the "obsolete" member will be true when the lexer encounters the token for
// an obsolete opcode. For example, "div" was replaced by [usf]div but we need
// to maintain backwards compatibility for asm files that still have the "div"
// instruction. This function handles converting div -> [usf]div appropriately.
-template <class EnumKind>
-static void sanitizeOpCode(OpcodeInfo<EnumKind> &OI, const PATypeHolder& Ty) {
- if (OI.obsolete) {
- switch (OI.opcode) {
- default:
- GenerateError("Invalid Obsolete OpCode");
- break;
- case Instruction::UDiv:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FDiv;
- else if (Ty->isSigned())
- OI.opcode = Instruction::SDiv;
- break;
- case Instruction::SDiv:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FDiv;
- else if (Ty->isUnsigned())
- OI.opcode = Instruction::UDiv;
- break;
- case Instruction::URem:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FRem;
- else if (Ty->isSigned())
- OI.opcode = Instruction::SRem;
- break;
- case Instruction::SRem:
- if (Ty->isFloatingPoint())
- OI.opcode = Instruction::FRem;
- else if (Ty->isUnsigned())
- OI.opcode = Instruction::URem;
- break;
- }
- OI.obsolete = false;
+static void
+sanitizeOpCode(OpcodeInfo<Instruction::BinaryOps> &OI, const PATypeHolder& PATy)
+{
+ // If its not obsolete, don't do anything
+ if (!OI.obsolete)
+ return;
+
+ // If its a packed type we want to use the element type
+ const Type* Ty = PATy;
+ if (const PackedType* PTy = dyn_cast<PackedType>(Ty))
+ Ty = PTy->getElementType();
+
+ // Depending on the opcode ..
+ switch (OI.opcode) {
+ default:
+ GenerateError("Invalid Obsolete OpCode");
+ break;
+ case Instruction::UDiv:
+ // Handle cases where the opcode needs to change
+ if (Ty->isFloatingPoint())
+ OI.opcode = Instruction::FDiv;
+ else if (Ty->isSigned())
+ OI.opcode = Instruction::SDiv;
+ break;
+ case Instruction::URem:
+ if (Ty->isFloatingPoint())
+ OI.opcode = Instruction::FRem;
+ else if (Ty->isSigned())
+ OI.opcode = Instruction::SRem;
+ break;
}
+ // Its not obsolete any more, we fixed it.
+ OI.obsolete = false;
}
-
-
+
// common code from the two 'RunVMAsmParser' functions
static Module* RunParser(Module * M) {
@@ -1045,13 +1043,13 @@
bool BoolVal;
char *StrVal; // This memory is strdup'd!
- llvm::ValID ValIDVal; // strdup'd memory maybe!
+ llvm::ValID ValIDVal; // strdup'd memory maybe!
- BinaryOpInfo BinaryOpVal;
- TermOpInfo TermOpVal;
- MemOpInfo MemOpVal;
- OtherOpInfo OtherOpVal;
- llvm::Module::Endianness Endianness;
+ BinaryOpInfo BinaryOpVal;
+ TermOpInfo TermOpVal;
+ MemOpInfo MemOpVal;
+ OtherOpInfo OtherOpVal;
+ llvm::Module::Endianness Endianness;
}
%type <ModuleVal> Module FunctionList
@@ -1685,8 +1683,11 @@
| ArithmeticOps '(' ConstVal ',' ConstVal ')' {
if ($3->getType() != $5->getType())
GEN_ERROR("Binary operator types must match!");
+ // First, make sure we're dealing with the right opcode by upgrading from
+ // obsolete versions.
sanitizeOpCode($1,$3->getType());
CHECK_FOR_ERROR;
+
// HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs.
// To retain backward compatibility with these early compilers, we emit a
// cast to the appropriate integer type automatically if we are in the
@@ -2471,8 +2472,11 @@
GEN_ERROR(
"Arithmetic operator requires integer, FP, or packed operands!");
if (isa<PackedType>((*$2).get()) &&
- ($1.opcode == Instruction::URem || $1.opcode == Instruction::SRem))
- GEN_ERROR("URem and SRem not supported on packed types!");
+ ($1.opcode == Instruction::URem ||
+ $1.opcode == Instruction::SRem ||
+ $1.opcode == Instruction::FRem))
+ GEN_ERROR("U/S/FRem not supported on packed types!");
+ // Upgrade the opcode from obsolete versions before we do anything with it.
sanitizeOpCode($1,*$2);
CHECK_FOR_ERROR;
Value* val1 = getVal(*$2, $3);
More information about the llvm-commits
mailing list