diff options
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/Lexer.cpp.cvs | 1591 | ||||
-rw-r--r-- | lib/AsmParser/Lexer.l.cvs | 75 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.cpp.cvs | 3187 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.h.cvs | 205 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y.cvs | 899 |
5 files changed, 2981 insertions, 2976 deletions
diff --git a/lib/AsmParser/Lexer.cpp.cvs b/lib/AsmParser/Lexer.cpp.cvs index 826275f..0d4fdc6 100644 --- a/lib/AsmParser/Lexer.cpp.cvs +++ b/lib/AsmParser/Lexer.cpp.cvs @@ -317,37 +317,38 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 134 -#define YY_END_OF_BUFFER 135 -static yyconst short int yy_acclist[212] = +#define YY_NUM_RULES 151 +#define YY_END_OF_BUFFER 152 +static yyconst short int yy_acclist[229] = { 0, - 135, 133, 134, 132, 133, 134, 132, 134, 133, 134, - 133, 134, 133, 134, 133, 134, 133, 134, 133, 134, - 125, 133, 134, 125, 133, 134, 1, 133, 134, 133, - 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, - 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, - 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, - 134, 133, 134, 133, 134, 133, 134, 133, 134, 133, - 134, 124, 122, 121, 121, 128, 126, 130, 125, 1, - 107, 41, 75, 23, 124, 121, 121, 129, 130, 20, - 130, 131, 63, 74, 39, 34, 42, 66, 3, 54, - - 65, 25, 83, 70, 106, 99, 100, 64, 76, 123, - 130, 130, 102, 49, 84, 85, 69, 114, 73, 115, - 56, 101, 22, 127, 68, 88, 72, 26, 4, 61, - 67, 55, 71, 48, 11, 87, 130, 36, 2, 5, - 58, 90, 60, 50, 78, 82, 80, 81, 79, 77, - 52, 116, 86, 51, 57, 21, 104, 113, 45, 59, - 30, 24, 44, 94, 93, 7, 109, 33, 112, 38, - 62, 98, 92, 108, 27, 28, 91, 110, 53, 105, - 103, 97, 43, 6, 29, 89, 37, 8, 17, 9, - 95, 10, 96, 35, 12, 14, 13, 32, 40, 15, - - 31, 111, 117, 119, 120, 16, 46, 118, 18, 47, - 19 + 152, 150, 151, 149, 150, 151, 149, 151, 150, 151, + 150, 151, 150, 151, 150, 151, 150, 151, 150, 151, + 142, 150, 151, 142, 150, 151, 1, 150, 151, 150, + 151, 150, 151, 150, 151, 150, 151, 150, 151, 150, + 151, 150, 151, 150, 151, 150, 151, 150, 151, 150, + 151, 150, 151, 150, 151, 150, 151, 150, 151, 150, + 151, 150, 151, 150, 151, 150, 151, 150, 151, 150, + 151, 141, 139, 138, 138, 145, 143, 147, 142, 1, + 124, 38, 80, 81, 70, 22, 141, 138, 138, 146, + 147, 19, 147, 148, 60, 69, 36, 31, 39, 3, + + 51, 62, 96, 104, 123, 85, 83, 119, 84, 82, + 61, 89, 87, 88, 86, 97, 71, 140, 147, 147, + 121, 46, 105, 79, 65, 131, 68, 78, 132, 53, + 120, 21, 144, 64, 108, 67, 23, 4, 58, 63, + 52, 66, 45, 11, 107, 147, 33, 2, 5, 55, + 110, 57, 90, 95, 93, 94, 92, 91, 47, 73, + 77, 75, 76, 74, 72, 49, 133, 106, 48, 54, + 20, 98, 103, 101, 102, 100, 99, 130, 42, 56, + 27, 41, 114, 113, 7, 126, 30, 129, 35, 59, + 118, 112, 125, 24, 25, 111, 127, 50, 122, 117, + + 40, 6, 26, 109, 34, 8, 16, 9, 115, 10, + 116, 32, 12, 14, 13, 29, 37, 15, 28, 128, + 134, 136, 137, 43, 135, 17, 44, 18 } ; -static yyconst short int yy_accept[577] = +static yyconst short int yy_accept[588] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, @@ -355,63 +356,64 @@ static yyconst short int yy_accept[577] = 60, 62, 64, 66, 68, 70, 72, 72, 73, 73, 74, 75, 76, 77, 77, 78, 78, 79, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, - 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 82, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - - 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 86, 87, 89, 90, 91, 92, 92, 93, - 94, 94, 94, 95, 95, 95, 96, 96, 97, 97, - 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, - 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 102, 103, 103, - 103, 104, 104, 104, 105, 106, 106, 106, 106, 106, - 106, 106, 106, 107, 107, 108, 108, 108, 108, 108, - - 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 110, 110, 110, 111, - 112, 112, 112, 112, 113, 113, 113, 113, 114, 114, - 114, 115, 116, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, - 118, 118, 118, 118, 119, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 121, 122, 123, 123, - 123, 124, 124, 124, 124, 125, 125, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, 127, 128, - - 128, 128, 129, 129, 129, 130, 130, 131, 131, 132, - 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, - 134, 134, 135, 135, 136, 136, 136, 137, 138, 139, - 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 141, 141, 142, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 144, 144, 144, 144, 144, 144, 144, 144, 145, - 145, 145, 146, 147, 148, 149, 150, 151, 152, 152, - 152, 152, 153, 153, 153, 153, 154, 155, 155, 156, - 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, - - 158, 158, 159, 159, 159, 160, 160, 160, 160, 160, - 160, 160, 160, 161, 162, 163, 163, 163, 164, 165, - 166, 166, 166, 167, 167, 167, 167, 167, 168, 168, - 169, 170, 171, 172, 172, 172, 172, 173, 173, 173, - 174, 175, 176, 177, 178, 178, 178, 179, 180, 181, - 182, 182, 182, 182, 182, 182, 183, 183, 184, 184, - 185, 186, 186, 186, 186, 186, 186, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, - 189, 190, 190, 190, 190, 190, 191, 192, 193, 193, - - 194, 194, 194, 194, 194, 195, 195, 195, 195, 196, - 196, 197, 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 199, 199, 199, 199, - 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, - 201, 201, 201, 201, 201, 202, 202, 202, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 204, 204, 205, 206, 207, 207, 208, 208, - 209, 210, 211, 211, 212, 212 + 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, + 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 88, 89, 91, + 92, 93, 94, 94, 95, 96, 96, 96, 97, 97, + 97, 98, 98, 99, 99, 99, 99, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 103, 103, 104, 105, 105, 105, 106, 106, + 106, 106, 106, 106, 106, 106, 107, 108, 109, 109, + + 109, 109, 109, 110, 111, 111, 111, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 113, 114, 114, 114, + 115, 115, 116, 116, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 118, 118, 118, 119, 120, 120, + 120, 120, 121, 121, 121, 121, 122, 122, 122, 123, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 125, 126, 126, 126, 126, + 126, 127, 128, 128, 128, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 130, 131, 132, 132, 132, 133, + 133, 133, 133, 133, 133, 133, 133, 134, 134, 135, + + 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, + 136, 137, 137, 137, 138, 138, 138, 139, 139, 140, + 140, 141, 142, 142, 142, 142, 142, 142, 142, 142, + 142, 142, 143, 143, 143, 144, 144, 145, 145, 145, + 146, 147, 148, 148, 148, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, + 150, 151, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 153, 153, 153, 153, 153, 153, 154, + 155, 156, 157, 158, 159, 159, 159, 160, 160, 160, + 161, 162, 163, 164, 165, 166, 167, 167, 167, 167, + + 168, 168, 168, 168, 169, 170, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 179, 179, 179, 180, 180, 180, 180, + 180, 180, 180, 180, 181, 182, 182, 182, 183, 184, + 185, 185, 185, 186, 186, 186, 186, 186, 187, 187, + 188, 189, 190, 191, 191, 191, 191, 192, 192, 192, + 193, 194, 195, 196, 197, 197, 198, 199, 200, 200, + 200, 200, 200, 200, 201, 201, 202, 202, 203, 204, + 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, + + 206, 206, 206, 207, 207, 207, 207, 207, 208, 208, + 208, 208, 208, 209, 210, 211, 211, 212, 212, 212, + 212, 213, 213, 213, 213, 214, 214, 215, 216, 216, + 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, + 216, 217, 217, 217, 217, 217, 217, 217, 217, 218, + 218, 218, 218, 218, 219, 219, 219, 219, 219, 220, + 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 222, 222, 223, 224, 224, 225, + 225, 226, 227, 228, 228, 229, 229 } ; static yyconst int yy_ec[256] = @@ -455,268 +457,274 @@ static yyconst int yy_meta[44] = 3, 3, 3 } ; -static yyconst short int yy_base[581] = +static yyconst short int yy_base[592] = { 0, - 0, 0, 1240, 1241, 1241, 1241, 1235, 1224, 36, 40, + 0, 0, 1262, 1263, 1263, 1263, 1257, 1246, 36, 40, 44, 50, 56, 62, 0, 63, 66, 81, 89, 47, - 100, 97, 76, 96, 111, 49, 113, 110, 68, 140, - 126, 171, 120, 130, 124, 141, 1233, 1241, 1222, 1241, - 0, 159, 176, 199, 204, 70, 209, 224, 229, 0, - 137, 165, 143, 72, 169, 159, 230, 215, 1221, 168, - 182, 31, 69, 187, 240, 191, 242, 243, 244, 248, - 246, 245, 251, 254, 256, 249, 260, 262, 264, 211, - 273, 274, 270, 280, 275, 284, 285, 288, 292, 1220, - 293, 294, 298, 300, 301, 276, 302, 310, 311, 313, - - 305, 309, 312, 330, 331, 1219, 334, 320, 322, 338, - 340, 324, 341, 346, 348, 361, 356, 359, 162, 353, - 368, 1218, 0, 383, 387, 1217, 401, 418, 0, 1216, - 376, 370, 1215, 393, 373, 1214, 392, 1213, 406, 407, - 408, 403, 1212, 419, 95, 420, 372, 409, 421, 1211, - 425, 431, 428, 430, 433, 435, 432, 440, 443, 444, - 445, 451, 447, 446, 449, 450, 453, 461, 468, 458, - 469, 470, 473, 474, 475, 480, 1210, 1209, 481, 482, - 1208, 483, 485, 1207, 1206, 513, 491, 488, 494, 489, - 524, 503, 1205, 486, 1204, 487, 525, 527, 250, 528, - - 1203, 506, 531, 532, 536, 542, 538, 530, 537, 540, - 548, 544, 556, 550, 560, 557, 375, 554, 568, 558, - 571, 493, 576, 564, 582, 1202, 574, 552, 1241, 591, - 605, 609, 613, 618, 619, 577, 620, 1201, 621, 591, - 1200, 1199, 1198, 622, 623, 624, 625, 626, 628, 627, - 632, 630, 634, 633, 635, 644, 642, 643, 1197, 653, - 655, 657, 658, 1196, 1195, 659, 660, 661, 662, 663, - 667, 583, 671, 669, 673, 1194, 1193, 1192, 672, 677, - 1191, 675, 666, 680, 0, 691, 1190, 693, 694, 695, - 696, 702, 703, 1189, 697, 585, 704, 707, 1188, 709, - - 714, 1187, 722, 708, 1186, 726, 1185, 727, 1184, 1183, - 724, 728, 730, 716, 732, 735, 1182, 738, 741, 742, - 743, 1181, 744, 1180, 746, 745, 1179, 751, 1178, 755, - 757, 1177, 751, 754, 764, 771, 772, 763, 499, 766, - 774, 779, 775, 776, 780, 782, 1176, 783, 1175, 1174, - 781, 787, 786, 795, 791, 796, 798, 801, 805, 802, - 1173, 808, 807, 810, 813, 814, 819, 820, 1172, 809, - 815, 1171, 1170, 1169, 1168, 1167, 1166, 1165, 826, 829, - 830, 1164, 831, 832, 835, 1163, 1162, 834, 1161, 1160, - 836, 840, 837, 842, 846, 1159, 848, 850, 851, 852, - - 860, 1158, 854, 858, 1157, 861, 862, 864, 870, 866, - 868, 872, 1156, 1155, 1154, 880, 873, 1153, 1152, 1151, - 876, 882, 1150, 891, 893, 889, 874, 1149, 899, 1148, - 1147, 1146, 1145, 887, 895, 901, 1144, 904, 905, 1143, - 1142, 1141, 1140, 1139, 903, 907, 1138, 1137, 1136, 1135, - 909, 910, 914, 917, 911, 1134, 920, 1133, 921, 1132, - 1131, 923, 925, 926, 927, 929, 1130, 931, 933, 934, - 936, 935, 945, 937, 941, 1129, 947, 948, 953, 955, - 961, 962, 966, 963, 965, 1128, 967, 969, 971, 968, - 1127, 974, 978, 975, 979, 1126, 1123, 1113, 980, 1112, - - 981, 996, 982, 999, 1111, 1000, 1001, 1002, 1109, 987, - 1108, 1107, 1004, 1008, 1011, 1013, 1012, 1014, 1016, 1019, - 1020, 1021, 1022, 1024, 1025, 1104, 1026, 1029, 1031, 1032, - 1035, 1037, 1038, 1101, 1041, 1047, 1048, 1049, 1051, 1100, - 1053, 1052, 1054, 1057, 1098, 1058, 1059, 1096, 1065, 1071, - 1060, 1069, 1072, 1077, 1079, 1082, 1081, 1083, 1084, 1085, - 1087, 984, 1088, 983, 710, 668, 1092, 664, 1097, 593, - 345, 214, 1094, 213, 1241, 1129, 1131, 187, 1135, 138 + 108, 91, 95, 92, 72, 109, 49, 119, 117, 147, + 120, 178, 134, 121, 136, 140, 1255, 1263, 1244, 1263, + 0, 167, 183, 206, 211, 150, 216, 231, 236, 0, + 65, 172, 93, 132, 176, 146, 237, 222, 1243, 31, + 69, 247, 169, 144, 249, 183, 194, 250, 1242, 197, + 251, 161, 252, 253, 254, 261, 255, 257, 267, 269, + 259, 122, 272, 274, 280, 285, 286, 287, 1241, 290, + 293, 296, 297, 299, 175, 301, 276, 306, 307, 308, + + 309, 321, 314, 317, 316, 311, 217, 328, 330, 1240, + 333, 319, 327, 347, 344, 342, 352, 348, 349, 350, + 364, 363, 372, 373, 379, 380, 1239, 0, 385, 389, + 1238, 412, 429, 0, 1237, 391, 395, 1236, 390, 393, + 1235, 403, 1234, 389, 404, 405, 1233, 424, 417, 397, + 430, 418, 431, 434, 436, 437, 440, 438, 441, 444, + 445, 448, 451, 454, 457, 456, 452, 455, 462, 459, + 467, 469, 471, 479, 481, 483, 484, 482, 485, 486, + 1232, 492, 488, 502, 1231, 489, 497, 1230, 525, 514, + 501, 515, 496, 536, 516, 1229, 1228, 1227, 525, 499, + + 540, 494, 1226, 1225, 541, 529, 1224, 542, 543, 544, + 548, 552, 554, 556, 559, 1223, 1222, 560, 562, 1221, + 564, 1220, 566, 576, 568, 573, 572, 571, 590, 570, + 592, 582, 594, 1219, 599, 600, 1263, 605, 613, 622, + 628, 633, 605, 634, 635, 1218, 636, 637, 1217, 1216, + 638, 616, 640, 643, 644, 646, 647, 648, 650, 651, + 654, 655, 657, 661, 1215, 1214, 662, 667, 669, 670, + 1213, 1212, 671, 672, 1211, 673, 676, 678, 680, 681, + 687, 683, 688, 1210, 1209, 1208, 689, 696, 1207, 684, + 498, 700, 704, 705, 692, 706, 0, 710, 1206, 712, + + 721, 716, 717, 720, 722, 1205, 718, 732, 730, 734, + 1204, 737, 738, 1203, 747, 733, 1202, 750, 1201, 749, + 1200, 1199, 751, 752, 754, 735, 753, 759, 760, 765, + 766, 1198, 767, 771, 1197, 772, 1196, 774, 773, 1195, + 781, 1194, 785, 781, 1193, 775, 787, 793, 799, 800, + 791, 801, 802, 803, 804, 808, 809, 810, 1192, 811, + 1191, 1190, 814, 815, 816, 820, 819, 823, 824, 831, + 830, 832, 1189, 835, 836, 837, 842, 846, 1188, 1187, + 1186, 1185, 1184, 1183, 850, 840, 1182, 838, 843, 1181, + 1180, 1179, 1178, 1177, 1176, 1175, 854, 857, 858, 1174, + + 860, 861, 862, 1173, 1172, 863, 1171, 1170, 1169, 1168, + 1167, 1166, 1165, 1164, 868, 865, 864, 870, 876, 874, + 878, 880, 1163, 883, 885, 1162, 886, 888, 890, 891, + 892, 893, 894, 1161, 1160, 902, 898, 1159, 1158, 1157, + 909, 899, 1156, 904, 910, 917, 905, 1155, 920, 1154, + 1153, 1152, 1151, 923, 924, 925, 1150, 926, 929, 1149, + 1148, 1147, 1146, 1145, 931, 1144, 1143, 1142, 930, 932, + 938, 934, 933, 1141, 936, 1140, 937, 1139, 1138, 940, + 948, 949, 951, 953, 1137, 956, 957, 952, 958, 960, + 963, 964, 968, 1136, 970, 971, 977, 976, 978, 983, + + 979, 987, 1135, 984, 988, 989, 994, 1132, 992, 993, + 996, 997, 1123, 1122, 1121, 1000, 1120, 1005, 1009, 1015, + 1119, 1017, 999, 1018, 1116, 1020, 1114, 1113, 1022, 1023, + 1025, 1028, 1026, 1029, 1030, 1034, 1035, 1036, 1038, 1039, + 1112, 1040, 1045, 1046, 1047, 1051, 1055, 1049, 1111, 1059, + 1052, 1056, 1062, 1110, 1066, 1063, 1069, 1073, 1105, 1074, + 679, 1076, 1078, 1080, 1079, 1081, 1083, 1084, 1087, 1088, + 1097, 1089, 1094, 615, 1098, 613, 574, 1099, 394, 1100, + 354, 313, 224, 1103, 221, 1263, 1138, 1140, 135, 1144, + 59 + } ; -static yyconst short int yy_def[581] = +static yyconst short int yy_def[592] = { 0, - 575, 1, 575, 575, 575, 575, 576, 577, 578, 575, - 577, 577, 577, 577, 579, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 576, 575, 577, 575, - 580, 580, 575, 575, 577, 577, 577, 577, 577, 579, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 575, 580, 580, 575, 577, 577, 577, 49, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 49, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 575, 575, - 575, 575, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 186, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 575, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 0, 575, 575, 575, 575, 575 + 586, 1, 586, 586, 586, 586, 587, 588, 589, 586, + 588, 588, 588, 588, 590, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 587, 586, 588, 586, + 591, 591, 586, 586, 588, 588, 588, 588, 588, 590, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 586, 591, 591, 586, + 588, 588, 588, 49, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 49, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 586, 586, 586, 586, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 189, 588, 588, 588, + + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 586, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, + 588, 588, 588, 588, 588, 0, 586, 586, 586, 586, + 586 + } ; -static yyconst short int yy_nxt[1285] = +static yyconst short int yy_nxt[1307] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 4, 15, 8, 8, 8, 16, 17, 18, 19, 20, 21, 22, 8, 23, 8, 24, 25, 26, 27, 28, 8, 29, 30, 31, 32, 33, 34, 35, 8, 36, 42, 40, 43, 43, 43, 43, 44, - 44, 44, 44, 45, 45, 45, 45, 40, 46, 144, - 40, 145, 40, 40, 47, 48, 48, 48, 48, 40, - 47, 48, 48, 48, 48, 40, 40, 69, 126, 40, - 87, 40, 40, 40, 51, 40, 88, 70, 56, 40, - 94, 52, 57, 53, 40, 54, 49, 58, 55, 60, - - 59, 61, 40, 146, 134, 78, 79, 64, 40, 40, - 40, 65, 62, 40, 80, 66, 63, 67, 71, 76, - 68, 72, 81, 40, 40, 77, 40, 82, 73, 84, - 245, 83, 74, 40, 75, 91, 119, 40, 116, 40, - 123, 92, 85, 40, 105, 89, 93, 90, 86, 95, - 40, 117, 118, 40, 40, 120, 40, 106, 130, 96, - 107, 97, 98, 121, 133, 99, 100, 108, 124, 124, - 124, 124, 40, 225, 101, 40, 102, 103, 40, 104, - 95, 40, 40, 137, 40, 43, 43, 43, 43, 41, - 109, 131, 110, 132, 135, 40, 141, 111, 136, 112, - - 40, 113, 143, 142, 40, 114, 115, 125, 44, 44, - 44, 44, 47, 45, 45, 45, 45, 40, 127, 127, - 127, 127, 40, 147, 40, 128, 40, 40, 40, 150, - 169, 128, 47, 48, 48, 48, 48, 40, 129, 129, - 129, 129, 40, 40, 129, 129, 140, 129, 129, 129, - 129, 129, 129, 40, 138, 40, 40, 40, 40, 40, - 148, 40, 40, 40, 40, 153, 139, 40, 154, 40, - 151, 158, 149, 40, 156, 40, 160, 40, 162, 299, - 152, 157, 159, 40, 155, 163, 40, 40, 40, 40, - 161, 164, 172, 40, 165, 174, 176, 40, 40, 166, - - 167, 40, 168, 170, 173, 40, 40, 40, 175, 171, - 180, 40, 177, 40, 40, 40, 179, 187, 40, 181, - 182, 178, 40, 40, 40, 40, 40, 199, 188, 184, - 189, 201, 183, 40, 197, 40, 185, 40, 190, 193, - 200, 186, 194, 40, 40, 195, 191, 40, 196, 198, - 192, 40, 207, 40, 40, 212, 202, 203, 40, 40, - 205, 40, 213, 208, 209, 204, 40, 214, 217, 40, - 210, 206, 40, 218, 40, 215, 211, 224, 219, 220, - 216, 40, 222, 40, 223, 40, 40, 226, 40, 40, - 247, 221, 124, 124, 124, 124, 230, 230, 230, 230, - - 235, 236, 227, 231, 317, 40, 40, 238, 228, 231, - 127, 127, 127, 127, 40, 237, 40, 128, 239, 40, - 40, 40, 40, 128, 232, 233, 240, 234, 234, 234, - 234, 40, 40, 40, 40, 241, 242, 248, 40, 243, - 244, 40, 246, 40, 40, 40, 40, 250, 40, 249, - 252, 251, 254, 40, 253, 255, 40, 40, 40, 40, - 40, 260, 40, 40, 40, 267, 40, 256, 258, 266, - 257, 40, 269, 264, 40, 270, 262, 268, 259, 263, - 265, 40, 40, 40, 261, 274, 40, 40, 40, 271, - 273, 276, 272, 40, 40, 40, 40, 277, 40, 40, - - 40, 40, 40, 279, 40, 275, 40, 40, 278, 281, - 296, 289, 40, 283, 322, 282, 40, 280, 410, 40, - 295, 284, 285, 285, 285, 285, 287, 286, 285, 285, - 288, 285, 285, 285, 285, 285, 285, 40, 40, 294, - 40, 40, 301, 40, 40, 40, 290, 297, 291, 40, - 40, 40, 292, 40, 293, 40, 303, 40, 298, 302, - 307, 40, 300, 40, 305, 40, 308, 40, 304, 40, - 40, 40, 306, 40, 312, 309, 310, 40, 313, 311, - 314, 40, 315, 316, 40, 318, 319, 40, 327, 40, - 40, 324, 320, 321, 323, 40, 40, 330, 40, 325, - - 230, 230, 230, 230, 40, 326, 40, 231, 379, 333, - 360, 232, 232, 231, 328, 328, 328, 328, 328, 328, - 328, 328, 234, 234, 234, 234, 40, 234, 234, 234, - 234, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 334, 40, 338, 40, 40, 40, 40, 329, - 331, 332, 343, 337, 339, 40, 40, 40, 342, 335, - 336, 341, 346, 348, 347, 344, 40, 340, 40, 345, - 40, 40, 40, 40, 40, 40, 40, 40, 355, 40, - 40, 40, 40, 356, 40, 40, 40, 354, 40, 349, - 40, 350, 351, 40, 352, 353, 357, 358, 359, 361, - - 362, 363, 367, 364, 40, 365, 40, 40, 40, 40, - 40, 368, 366, 369, 371, 40, 40, 40, 373, 370, - 40, 40, 40, 40, 375, 377, 380, 40, 372, 40, - 381, 382, 374, 378, 383, 40, 385, 40, 376, 40, - 40, 40, 391, 40, 384, 40, 386, 388, 40, 387, - 392, 40, 389, 390, 40, 40, 40, 40, 40, 40, - 328, 328, 328, 328, 40, 393, 396, 40, 40, 399, - 40, 401, 394, 402, 405, 395, 40, 40, 403, 40, - 398, 400, 406, 397, 40, 40, 404, 40, 40, 40, - 408, 407, 40, 40, 40, 40, 40, 409, 411, 40, - - 40, 413, 417, 418, 40, 414, 412, 419, 40, 40, - 416, 40, 415, 420, 40, 40, 421, 422, 40, 423, - 40, 40, 40, 40, 428, 424, 40, 40, 40, 430, - 431, 426, 40, 40, 425, 432, 433, 427, 429, 40, - 436, 434, 40, 40, 40, 40, 435, 40, 40, 40, - 40, 437, 439, 40, 438, 40, 441, 443, 447, 40, - 446, 40, 440, 40, 40, 40, 444, 40, 442, 452, - 449, 40, 445, 40, 40, 40, 451, 40, 448, 40, - 455, 40, 458, 40, 450, 40, 40, 40, 453, 40, - 454, 457, 460, 40, 456, 40, 467, 464, 465, 462, - - 40, 461, 40, 463, 40, 459, 40, 471, 40, 466, - 472, 468, 40, 469, 40, 470, 40, 40, 40, 473, - 40, 474, 40, 40, 40, 475, 477, 40, 478, 479, - 40, 476, 480, 40, 40, 483, 40, 481, 40, 40, - 40, 485, 40, 484, 40, 482, 40, 40, 40, 40, - 40, 492, 487, 493, 40, 491, 486, 488, 40, 489, - 40, 40, 495, 494, 496, 490, 40, 498, 40, 497, - 502, 503, 499, 504, 40, 40, 40, 500, 40, 40, - 40, 40, 40, 505, 40, 501, 507, 40, 40, 509, - 513, 40, 40, 40, 40, 40, 40, 40, 506, 508, - - 40, 517, 514, 519, 510, 511, 518, 512, 515, 40, - 521, 516, 40, 40, 40, 40, 520, 40, 522, 524, - 523, 40, 527, 526, 40, 40, 40, 40, 525, 40, - 528, 530, 40, 40, 40, 40, 533, 40, 40, 40, - 537, 531, 40, 539, 40, 40, 535, 529, 40, 536, - 40, 40, 538, 540, 40, 534, 532, 544, 541, 545, - 40, 40, 40, 542, 40, 40, 40, 40, 543, 548, - 40, 40, 40, 40, 546, 552, 549, 550, 40, 551, - 554, 557, 40, 547, 40, 40, 560, 555, 553, 556, - 40, 559, 40, 558, 40, 40, 40, 40, 40, 561, - - 40, 40, 566, 567, 568, 40, 562, 40, 563, 40, - 40, 40, 572, 40, 40, 564, 565, 40, 571, 573, - 40, 40, 40, 570, 40, 40, 40, 569, 574, 37, - 37, 37, 37, 39, 39, 50, 40, 50, 50, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 44, 44, 44, 45, 45, 45, 45, 40, 46, 146, + 40, 128, 40, 40, 47, 48, 48, 48, 48, 40, + 47, 48, 48, 48, 48, 40, 40, 68, 40, 40, + 69, 91, 40, 92, 51, 40, 135, 70, 56, 147, + 86, 52, 57, 53, 40, 54, 49, 58, 55, 60, + + 59, 61, 40, 87, 40, 40, 40, 64, 40, 88, + 82, 65, 62, 77, 138, 79, 63, 66, 83, 78, + 67, 40, 40, 84, 80, 81, 71, 85, 72, 73, + 40, 89, 40, 40, 40, 40, 74, 41, 109, 96, + 75, 173, 76, 123, 93, 40, 90, 40, 124, 40, + 94, 110, 121, 40, 111, 95, 97, 40, 131, 40, + 40, 112, 126, 40, 139, 122, 98, 125, 99, 100, + 142, 101, 102, 103, 40, 104, 129, 129, 129, 129, + 151, 105, 40, 106, 107, 40, 108, 97, 40, 40, + 160, 40, 43, 43, 43, 43, 40, 113, 136, 114, + + 137, 140, 115, 150, 116, 141, 117, 40, 118, 187, + 40, 154, 119, 120, 130, 44, 44, 44, 44, 47, + 45, 45, 45, 45, 40, 132, 132, 132, 132, 40, + 40, 155, 133, 157, 40, 40, 207, 40, 133, 47, + 48, 48, 48, 48, 40, 134, 134, 134, 134, 40, + 40, 134, 134, 145, 134, 134, 134, 134, 134, 134, + 40, 143, 40, 40, 40, 40, 40, 40, 40, 152, + 40, 156, 40, 144, 40, 148, 163, 149, 161, 158, + 40, 153, 40, 165, 162, 40, 159, 40, 167, 40, + 164, 166, 176, 40, 170, 171, 168, 172, 40, 40, + + 40, 169, 174, 40, 177, 178, 40, 180, 175, 40, + 40, 183, 40, 179, 40, 181, 189, 184, 182, 40, + 40, 40, 40, 185, 40, 186, 40, 40, 192, 40, + 40, 196, 40, 191, 40, 201, 193, 188, 205, 203, + 40, 40, 206, 40, 194, 197, 40, 190, 195, 198, + 202, 213, 199, 204, 208, 40, 209, 40, 200, 211, + 40, 40, 40, 40, 210, 40, 216, 40, 214, 223, + 212, 227, 218, 215, 220, 228, 40, 40, 219, 224, + 217, 229, 225, 221, 233, 40, 40, 226, 222, 230, + 232, 231, 40, 40, 129, 129, 129, 129, 238, 238, + + 238, 238, 40, 40, 40, 239, 40, 40, 40, 248, + 40, 239, 245, 234, 235, 243, 40, 40, 40, 253, + 236, 132, 132, 132, 132, 40, 244, 246, 133, 247, + 40, 40, 249, 250, 133, 240, 241, 40, 242, 242, + 242, 242, 40, 40, 40, 251, 255, 40, 254, 40, + 40, 40, 252, 40, 40, 259, 257, 40, 40, 256, + 258, 40, 261, 260, 40, 40, 267, 40, 40, 40, + 40, 274, 40, 263, 262, 40, 265, 264, 273, 271, + 40, 277, 40, 266, 40, 269, 272, 275, 270, 278, + 276, 268, 40, 281, 40, 40, 40, 40, 40, 40, + + 280, 40, 40, 279, 284, 40, 282, 40, 285, 40, + 40, 40, 40, 287, 40, 40, 286, 283, 301, 295, + 289, 290, 308, 288, 291, 310, 292, 40, 40, 40, + 293, 379, 294, 296, 297, 297, 297, 297, 40, 299, + 297, 297, 40, 297, 297, 297, 297, 297, 297, 40, + 298, 300, 306, 40, 40, 40, 40, 40, 302, 307, + 303, 40, 309, 312, 304, 40, 305, 40, 315, 40, + 311, 314, 40, 40, 317, 40, 319, 40, 313, 40, + 316, 40, 318, 40, 40, 40, 40, 40, 325, 40, + 330, 335, 320, 323, 324, 40, 322, 321, 326, 331, + + 327, 332, 333, 40, 328, 40, 329, 40, 334, 337, + 336, 338, 40, 40, 238, 238, 238, 238, 40, 240, + 240, 239, 341, 341, 341, 341, 40, 239, 40, 40, + 339, 341, 341, 341, 341, 342, 340, 242, 242, 242, + 242, 40, 242, 242, 242, 242, 40, 40, 40, 40, + 40, 40, 348, 40, 343, 346, 40, 40, 347, 40, + 40, 40, 351, 40, 40, 344, 345, 40, 40, 356, + 40, 350, 352, 358, 40, 40, 349, 354, 355, 359, + 40, 360, 40, 40, 40, 40, 40, 353, 357, 40, + 367, 40, 40, 40, 40, 368, 40, 40, 361, 366, + + 40, 40, 40, 362, 363, 40, 364, 365, 372, 40, + 369, 371, 370, 40, 374, 373, 375, 40, 40, 40, + 376, 378, 380, 40, 377, 40, 382, 384, 385, 40, + 40, 40, 387, 40, 40, 40, 381, 386, 388, 391, + 383, 389, 393, 40, 395, 40, 40, 40, 40, 390, + 40, 40, 398, 392, 396, 397, 394, 399, 401, 400, + 40, 403, 40, 40, 40, 40, 40, 40, 409, 402, + 404, 405, 40, 40, 406, 410, 407, 408, 40, 40, + 40, 412, 414, 415, 40, 40, 40, 40, 40, 411, + 341, 341, 341, 341, 40, 413, 416, 420, 40, 422, + + 40, 417, 424, 423, 40, 418, 40, 426, 419, 421, + 425, 427, 40, 40, 40, 40, 40, 40, 429, 428, + 431, 40, 40, 40, 40, 430, 434, 40, 40, 40, + 437, 438, 40, 40, 432, 433, 40, 40, 435, 436, + 439, 440, 442, 40, 40, 40, 441, 443, 40, 40, + 40, 40, 444, 40, 448, 40, 40, 451, 450, 40, + 445, 446, 447, 40, 452, 449, 455, 40, 453, 456, + 40, 40, 454, 40, 40, 40, 40, 40, 40, 457, + 459, 40, 458, 40, 463, 461, 466, 40, 465, 40, + 460, 40, 470, 40, 468, 464, 40, 462, 40, 40, + + 467, 40, 469, 40, 40, 40, 40, 40, 476, 473, + 472, 40, 40, 478, 471, 40, 475, 40, 40, 482, + 483, 474, 40, 40, 480, 481, 487, 479, 486, 485, + 40, 477, 488, 40, 484, 489, 40, 40, 40, 40, + 491, 490, 40, 40, 40, 40, 40, 40, 495, 40, + 40, 40, 496, 40, 493, 494, 497, 492, 498, 500, + 501, 40, 40, 502, 40, 40, 40, 499, 504, 40, + 40, 40, 503, 40, 505, 509, 40, 40, 510, 508, + 512, 40, 506, 40, 40, 515, 513, 511, 507, 40, + 40, 40, 40, 519, 514, 520, 40, 40, 521, 516, + + 40, 40, 40, 523, 517, 40, 40, 40, 518, 40, + 40, 525, 40, 40, 522, 524, 529, 539, 40, 533, + 530, 526, 40, 531, 527, 528, 534, 535, 40, 536, + 40, 40, 532, 40, 537, 40, 40, 538, 40, 40, + 542, 40, 40, 40, 540, 543, 545, 40, 40, 40, + 548, 40, 40, 40, 551, 546, 541, 553, 40, 40, + 40, 544, 40, 550, 40, 40, 552, 554, 40, 40, + 549, 547, 40, 558, 555, 40, 40, 559, 556, 40, + 562, 561, 40, 557, 563, 560, 40, 40, 565, 40, + 564, 40, 40, 40, 40, 567, 40, 40, 571, 566, + + 40, 40, 40, 568, 570, 569, 572, 40, 578, 573, + 40, 40, 40, 40, 575, 574, 40, 579, 40, 583, + 576, 577, 584, 40, 40, 40, 40, 40, 582, 40, + 581, 580, 40, 40, 40, 40, 40, 585, 37, 37, + 37, 37, 39, 39, 50, 40, 50, 50, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, @@ -726,157 +734,163 @@ static yyconst short int yy_nxt[1285] = 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 229, 40, 40, 40, 40, 122, 40, 38, 575, - 3, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575 + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 237, 40, 40, 40, 40, 40, 127, 40, + 38, 586, 3, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + + 586, 586, 586, 586, 586, 586 } ; -static yyconst short int yy_chk[1285] = +static yyconst short int yy_chk[1307] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 9, 62, 9, 9, 9, 9, 10, - 10, 10, 10, 11, 11, 11, 11, 11, 12, 62, - 20, 62, 26, 12, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 16, 20, 46, 17, - 26, 29, 63, 46, 16, 54, 26, 20, 17, 23, - 29, 16, 17, 16, 18, 16, 13, 17, 16, 18, - - 17, 18, 19, 63, 54, 23, 23, 19, 145, 24, - 22, 19, 18, 21, 24, 19, 18, 19, 21, 22, - 19, 21, 24, 28, 25, 22, 27, 24, 21, 25, - 145, 24, 21, 33, 21, 28, 35, 35, 33, 31, - 580, 28, 25, 34, 31, 27, 28, 27, 25, 30, - 51, 33, 34, 30, 36, 35, 53, 31, 51, 30, - 31, 30, 30, 36, 53, 30, 30, 31, 42, 42, - 42, 42, 56, 119, 30, 119, 30, 30, 52, 30, - 32, 60, 55, 56, 32, 43, 43, 43, 43, 578, - 32, 52, 32, 52, 55, 61, 60, 32, 55, 32, - - 64, 32, 61, 60, 66, 32, 32, 44, 44, 44, - 44, 44, 45, 45, 45, 45, 45, 45, 47, 47, - 47, 47, 47, 64, 80, 47, 574, 572, 58, 66, - 80, 47, 48, 48, 48, 48, 48, 48, 49, 49, - 49, 49, 49, 57, 49, 49, 58, 49, 49, 49, - 49, 49, 49, 65, 57, 67, 68, 69, 72, 71, - 65, 70, 76, 199, 73, 69, 57, 74, 70, 75, - 67, 72, 65, 77, 71, 78, 74, 79, 75, 199, - 68, 71, 73, 83, 70, 76, 81, 82, 85, 96, - 74, 77, 82, 84, 78, 83, 85, 86, 87, 79, - - 79, 88, 79, 81, 82, 89, 91, 92, 84, 81, - 89, 93, 86, 94, 95, 97, 88, 96, 101, 91, - 92, 87, 102, 98, 99, 103, 100, 101, 97, 94, - 98, 103, 93, 108, 100, 109, 94, 112, 98, 99, - 102, 95, 99, 104, 105, 99, 98, 107, 99, 100, - 98, 110, 108, 111, 113, 112, 104, 105, 571, 114, - 107, 115, 113, 109, 110, 105, 120, 113, 114, 117, - 111, 107, 118, 115, 116, 113, 111, 118, 116, 116, - 113, 121, 117, 132, 117, 147, 135, 120, 217, 131, - 147, 116, 124, 124, 124, 124, 125, 125, 125, 125, - - 131, 132, 121, 125, 217, 137, 134, 135, 121, 125, - 127, 127, 127, 127, 127, 134, 142, 127, 137, 139, - 140, 141, 148, 127, 128, 128, 139, 128, 128, 128, - 128, 128, 144, 146, 149, 140, 141, 148, 151, 142, - 144, 153, 146, 154, 152, 157, 155, 151, 156, 149, - 152, 151, 154, 158, 153, 155, 159, 160, 161, 164, - 163, 159, 165, 166, 162, 164, 167, 155, 157, 163, - 156, 170, 166, 162, 168, 167, 161, 165, 158, 161, - 162, 169, 171, 172, 160, 170, 173, 174, 175, 167, - 169, 172, 168, 176, 179, 180, 182, 173, 183, 194, - - 196, 188, 190, 175, 187, 171, 222, 189, 174, 179, - 196, 190, 339, 182, 222, 180, 192, 176, 339, 202, - 194, 183, 186, 186, 186, 186, 188, 187, 186, 186, - 189, 186, 186, 186, 186, 186, 186, 191, 197, 192, - 198, 200, 202, 208, 203, 204, 191, 197, 191, 205, - 209, 207, 191, 210, 191, 206, 204, 212, 198, 203, - 207, 211, 200, 214, 206, 228, 208, 218, 205, 213, - 216, 220, 206, 215, 212, 209, 210, 224, 213, 211, - 214, 219, 215, 216, 221, 218, 219, 227, 228, 223, - 236, 224, 220, 221, 223, 225, 272, 236, 296, 225, - - 230, 230, 230, 230, 240, 227, 570, 230, 296, 240, - 272, 231, 231, 230, 231, 231, 231, 231, 232, 232, - 232, 232, 233, 233, 233, 233, 233, 234, 234, 234, - 234, 234, 235, 237, 239, 244, 245, 246, 247, 248, - 250, 249, 244, 252, 248, 251, 254, 253, 255, 235, - 237, 239, 253, 247, 249, 257, 258, 256, 252, 245, - 246, 251, 256, 258, 257, 254, 260, 250, 261, 255, - 262, 263, 266, 267, 268, 269, 270, 568, 267, 283, - 271, 566, 274, 268, 273, 279, 275, 266, 282, 260, - 280, 261, 262, 284, 262, 263, 269, 270, 271, 273, - - 274, 275, 283, 279, 286, 280, 288, 289, 290, 291, - 295, 284, 282, 286, 289, 292, 293, 297, 291, 288, - 298, 304, 300, 565, 292, 293, 297, 301, 290, 314, - 298, 300, 291, 295, 301, 303, 304, 311, 292, 306, - 308, 312, 314, 313, 303, 315, 306, 311, 316, 308, - 315, 318, 312, 313, 319, 320, 321, 323, 326, 325, - 328, 328, 328, 328, 333, 316, 320, 334, 330, 325, - 331, 326, 318, 330, 334, 319, 338, 335, 331, 340, - 323, 325, 335, 321, 336, 337, 333, 341, 343, 344, - 337, 336, 342, 345, 351, 346, 348, 338, 340, 353, - - 352, 342, 346, 348, 355, 343, 341, 351, 354, 356, - 345, 357, 344, 352, 358, 360, 353, 354, 359, 355, - 363, 362, 370, 364, 360, 356, 365, 366, 371, 363, - 364, 358, 367, 368, 357, 365, 366, 359, 362, 379, - 370, 367, 380, 381, 383, 384, 368, 388, 385, 391, - 393, 371, 380, 392, 379, 394, 383, 385, 393, 395, - 392, 397, 381, 398, 399, 400, 388, 403, 384, 399, - 395, 404, 391, 401, 406, 407, 398, 408, 394, 410, - 403, 411, 407, 409, 397, 412, 417, 427, 400, 421, - 401, 406, 409, 416, 404, 422, 421, 416, 416, 411, - - 434, 410, 426, 412, 424, 408, 425, 426, 435, 417, - 427, 422, 429, 424, 436, 425, 445, 438, 439, 429, - 446, 434, 451, 452, 455, 435, 438, 453, 439, 445, - 454, 436, 446, 457, 459, 453, 462, 451, 463, 464, - 465, 455, 466, 454, 468, 452, 469, 470, 472, 471, - 474, 466, 459, 468, 475, 465, 457, 462, 473, 463, - 477, 478, 470, 469, 471, 464, 479, 473, 480, 472, - 478, 479, 474, 480, 481, 482, 484, 475, 485, 483, - 487, 490, 488, 481, 489, 477, 483, 492, 494, 485, - 490, 493, 495, 499, 501, 503, 564, 562, 482, 484, - - 510, 495, 492, 501, 487, 488, 499, 489, 493, 502, - 503, 494, 504, 506, 507, 508, 502, 513, 504, 507, - 506, 514, 513, 510, 515, 517, 516, 518, 508, 519, - 514, 516, 520, 521, 522, 523, 519, 524, 525, 527, - 523, 517, 528, 525, 529, 530, 521, 515, 531, 522, - 532, 533, 524, 527, 535, 520, 518, 531, 528, 532, - 536, 537, 538, 529, 539, 542, 541, 543, 530, 536, - 544, 546, 547, 551, 533, 541, 537, 538, 549, 539, - 543, 547, 552, 535, 550, 553, 551, 544, 542, 546, - 554, 550, 555, 549, 557, 556, 558, 559, 560, 552, - - 561, 563, 557, 558, 559, 567, 553, 573, 554, 548, - 569, 545, 567, 540, 534, 555, 556, 526, 563, 569, - 512, 511, 509, 561, 505, 500, 498, 560, 573, 576, - 576, 576, 576, 577, 577, 579, 497, 579, 579, 496, - 491, 486, 476, 467, 461, 460, 458, 456, 450, 449, - 448, 447, 444, 443, 442, 441, 440, 437, 433, 432, - 431, 430, 428, 423, 420, 419, 418, 415, 414, 413, - 405, 402, 396, 390, 389, 387, 386, 382, 378, 377, - 376, 375, 374, 373, 372, 369, 361, 350, 349, 347, - 332, 329, 327, 324, 322, 317, 310, 309, 307, 305, - - 302, 299, 294, 287, 281, 278, 277, 276, 265, 264, - 259, 243, 242, 241, 238, 226, 201, 195, 193, 185, - 184, 181, 178, 177, 150, 143, 138, 136, 133, 130, - 126, 122, 106, 90, 59, 39, 37, 8, 7, 3, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 575, 575, 575, 575 + 1, 1, 1, 9, 60, 9, 9, 9, 9, 10, + 10, 10, 10, 11, 11, 11, 11, 11, 12, 60, + 20, 591, 27, 12, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 16, 20, 51, 17, + 20, 27, 61, 27, 16, 25, 51, 20, 17, 61, + 25, 16, 17, 16, 18, 16, 13, 17, 16, 18, + + 17, 18, 19, 25, 22, 24, 53, 19, 23, 25, + 24, 19, 18, 22, 53, 23, 18, 19, 24, 22, + 19, 21, 26, 24, 23, 23, 21, 24, 21, 21, + 29, 26, 28, 31, 34, 82, 21, 589, 31, 29, + 21, 82, 21, 34, 28, 54, 26, 33, 35, 35, + 28, 31, 33, 36, 31, 28, 30, 64, 46, 56, + 30, 31, 36, 46, 54, 33, 30, 35, 30, 30, + 56, 30, 30, 30, 72, 30, 42, 42, 42, 42, + 64, 30, 63, 30, 30, 52, 30, 32, 95, 55, + 72, 32, 43, 43, 43, 43, 66, 32, 52, 32, + + 52, 55, 32, 63, 32, 55, 32, 67, 32, 95, + 70, 66, 32, 32, 44, 44, 44, 44, 44, 45, + 45, 45, 45, 45, 45, 47, 47, 47, 47, 47, + 107, 67, 47, 70, 585, 58, 107, 583, 47, 48, + 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, + 57, 49, 49, 58, 49, 49, 49, 49, 49, 49, + 62, 57, 65, 68, 71, 73, 74, 75, 77, 65, + 78, 68, 81, 57, 76, 62, 75, 62, 73, 71, + 79, 65, 80, 76, 74, 83, 71, 84, 78, 97, + 75, 77, 84, 85, 81, 81, 79, 81, 86, 87, + + 88, 80, 83, 90, 84, 85, 91, 87, 83, 92, + 93, 91, 94, 86, 96, 88, 97, 92, 90, 98, + 99, 100, 101, 93, 106, 94, 582, 103, 100, 105, + 104, 101, 112, 99, 102, 103, 100, 96, 105, 104, + 113, 108, 106, 109, 100, 101, 111, 98, 100, 102, + 103, 112, 102, 104, 108, 116, 109, 115, 102, 111, + 114, 118, 119, 120, 109, 117, 115, 581, 113, 118, + 111, 119, 116, 114, 117, 120, 122, 121, 116, 118, + 115, 121, 118, 117, 124, 123, 124, 118, 117, 122, + 123, 122, 125, 126, 129, 129, 129, 129, 130, 130, + + 130, 130, 144, 139, 136, 130, 140, 579, 137, 144, + 150, 130, 139, 125, 126, 136, 142, 145, 146, 150, + 126, 132, 132, 132, 132, 132, 137, 140, 132, 142, + 149, 152, 145, 146, 132, 133, 133, 148, 133, 133, + 133, 133, 133, 151, 153, 148, 152, 154, 151, 155, + 156, 158, 149, 157, 159, 155, 154, 160, 161, 153, + 154, 162, 157, 156, 163, 167, 162, 164, 168, 166, + 165, 167, 170, 158, 157, 169, 160, 159, 166, 165, + 171, 170, 172, 161, 173, 164, 165, 168, 164, 171, + 169, 163, 174, 173, 175, 178, 176, 177, 179, 180, + + 172, 183, 186, 171, 176, 182, 174, 202, 177, 193, + 187, 291, 200, 179, 191, 184, 178, 175, 193, 186, + 182, 183, 200, 180, 184, 202, 184, 190, 192, 195, + 184, 291, 184, 187, 189, 189, 189, 189, 199, 191, + 189, 189, 206, 189, 189, 189, 189, 189, 189, 194, + 190, 192, 195, 201, 205, 208, 209, 210, 194, 199, + 194, 211, 201, 206, 194, 212, 194, 213, 210, 214, + 205, 209, 215, 218, 212, 219, 213, 221, 208, 223, + 211, 225, 212, 230, 228, 227, 226, 577, 223, 224, + 225, 230, 214, 219, 221, 232, 218, 215, 224, 226, + + 224, 227, 228, 229, 224, 231, 224, 233, 229, 232, + 231, 233, 235, 236, 238, 238, 238, 238, 243, 239, + 239, 238, 239, 239, 239, 239, 576, 238, 574, 252, + 235, 240, 240, 240, 240, 243, 236, 241, 241, 241, + 241, 241, 242, 242, 242, 242, 242, 244, 245, 247, + 248, 251, 252, 253, 244, 248, 254, 255, 251, 256, + 257, 258, 255, 259, 260, 245, 247, 261, 262, 260, + 263, 254, 256, 262, 264, 267, 253, 258, 259, 263, + 268, 264, 269, 270, 273, 274, 276, 257, 261, 277, + 274, 278, 561, 279, 280, 276, 282, 290, 267, 273, + + 281, 283, 287, 268, 269, 295, 269, 270, 280, 288, + 277, 279, 278, 292, 282, 281, 283, 293, 294, 296, + 287, 290, 292, 298, 288, 300, 293, 294, 295, 302, + 303, 307, 298, 304, 301, 305, 292, 296, 300, 303, + 293, 301, 304, 309, 305, 308, 316, 310, 326, 302, + 312, 313, 309, 303, 307, 308, 304, 310, 313, 312, + 315, 316, 320, 318, 323, 324, 327, 325, 326, 315, + 318, 320, 328, 329, 323, 327, 324, 325, 330, 331, + 333, 328, 329, 330, 334, 336, 339, 338, 346, 327, + 341, 341, 341, 341, 344, 328, 331, 338, 343, 339, + + 347, 333, 344, 343, 351, 334, 348, 347, 336, 338, + 346, 348, 349, 350, 352, 353, 354, 355, 350, 349, + 352, 356, 357, 358, 360, 351, 355, 363, 364, 365, + 358, 360, 367, 366, 353, 354, 368, 369, 356, 357, + 363, 364, 366, 371, 370, 372, 365, 367, 374, 375, + 376, 388, 368, 386, 372, 377, 389, 376, 375, 378, + 369, 370, 371, 385, 377, 374, 386, 397, 378, 388, + 398, 399, 385, 401, 402, 403, 406, 417, 416, 389, + 398, 415, 397, 418, 403, 401, 416, 420, 415, 419, + 399, 421, 420, 422, 418, 406, 424, 402, 425, 427, + + 417, 428, 419, 429, 430, 431, 432, 433, 428, 424, + 422, 437, 442, 430, 421, 436, 427, 444, 447, 436, + 436, 425, 441, 445, 432, 433, 444, 431, 442, 441, + 446, 429, 445, 449, 437, 446, 454, 455, 456, 458, + 449, 447, 459, 469, 465, 470, 473, 472, 458, 475, + 477, 471, 459, 480, 455, 456, 465, 454, 469, 471, + 472, 481, 482, 473, 483, 488, 484, 470, 477, 486, + 487, 489, 475, 490, 480, 484, 491, 492, 486, 483, + 488, 493, 481, 495, 496, 491, 489, 487, 482, 498, + 497, 499, 501, 496, 490, 497, 500, 504, 498, 492, + + 502, 505, 506, 500, 493, 509, 510, 507, 495, 511, + 512, 502, 523, 516, 499, 501, 507, 523, 518, 512, + 509, 504, 519, 510, 505, 506, 516, 518, 520, 519, + 522, 524, 511, 526, 520, 529, 530, 522, 531, 533, + 529, 532, 534, 535, 524, 530, 532, 536, 537, 538, + 535, 539, 540, 542, 538, 533, 526, 540, 543, 544, + 545, 531, 548, 537, 546, 551, 539, 542, 547, 552, + 536, 534, 550, 546, 543, 553, 556, 547, 544, 555, + 551, 550, 557, 545, 552, 548, 558, 560, 555, 562, + 553, 563, 565, 564, 566, 557, 567, 568, 563, 556, + + 569, 570, 572, 558, 562, 560, 564, 573, 570, 565, + 571, 575, 578, 580, 567, 566, 584, 571, 559, 578, + 568, 569, 580, 554, 549, 541, 528, 527, 575, 525, + 573, 572, 521, 517, 515, 514, 513, 584, 587, 587, + 587, 587, 588, 588, 590, 508, 590, 590, 503, 494, + 485, 479, 478, 476, 474, 468, 467, 466, 464, 463, + 462, 461, 460, 457, 453, 452, 451, 450, 448, 443, + 440, 439, 438, 435, 434, 426, 423, 414, 413, 412, + 411, 410, 409, 408, 407, 405, 404, 400, 396, 395, + 394, 393, 392, 391, 390, 387, 384, 383, 382, 381, + + 380, 379, 373, 362, 361, 359, 345, 342, 340, 337, + 335, 332, 322, 321, 319, 317, 314, 311, 306, 299, + 289, 286, 285, 284, 275, 272, 271, 266, 265, 250, + 249, 246, 234, 222, 220, 217, 216, 207, 204, 203, + 198, 197, 196, 188, 185, 181, 147, 143, 141, 138, + 135, 131, 127, 110, 89, 69, 59, 39, 37, 8, + 7, 3, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, + + 586, 586, 586, 586, 586, 586 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; @@ -925,20 +939,16 @@ void set_scan_string (const char * str) { // Construct a token value for a non-obsolete token #define RET_TOK(type, Enum, sym) \ - llvmAsmlval.type.opcode = Instruction::Enum; \ - llvmAsmlval.type.obsolete = false; \ + llvmAsmlval.type = Instruction::Enum; \ return sym -// Construct a token value for an obsolete token -#define RET_TOK_OBSOLETE(type, Enum, sym) \ - llvmAsmlval.type.opcode = Instruction::Enum; \ - llvmAsmlval.type.obsolete = true; \ +#define RET_ENUM(type, Enum, sym) \ + llvmAsmlval.type = Enum; \ return sym // Construct a token value for an obsolete token -#define RET_TY(CTYPE, SIGN, SYM) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CTYPE); \ - llvmAsmlval.TypeVal.signedness = SIGN; \ +#define RET_TY(CTYPE, SYM) \ + llvmAsmlval.PrimType = CTYPE;\ return SYM namespace llvm { @@ -1049,7 +1059,7 @@ using namespace llvm; /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1053 "Lexer.cpp" +#line 1063 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1200,10 +1210,10 @@ YY_DECL register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 190 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -#line 1207 "Lexer.cpp" +#line 1217 "Lexer.cpp" if ( yy_init ) { @@ -1251,14 +1261,14 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 576 ) + if ( yy_current_state >= 587 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 575 ); + while ( yy_current_state != 586 ); yy_find_action: yy_current_state = *--yy_state_ptr; @@ -1296,616 +1306,701 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 192 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 195 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 196 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 201 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 197 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 198 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 199 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 200 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 201 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 202 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 203 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 204 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 205 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLIMPORT; } YY_BREAK case 14: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 206 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DLLEXPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 207 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return EXTERN_WEAK; } YY_BREAK case 16: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return EXTERNAL; } /* Deprecated, turn into external */ +#line 208 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return EXTERNAL; } YY_BREAK case 17: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return EXTERNAL; } +#line 209 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return IMPLEMENTATION; } YY_BREAK case 18: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return IMPLEMENTATION; } +#line 210 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ZEROINITIALIZER; } YY_BREAK case 19: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return ZEROINITIALIZER; } +#line 211 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return DOTDOTDOT; } YY_BREAK case 20: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return DOTDOTDOT; } +#line 212 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return UNDEF; } YY_BREAK case 21: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return UNDEF; } +#line 213 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return NULL_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return NULL_TOK; } +#line 214 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TO; } YY_BREAK case 23: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return TO; } +#line 215 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TAIL; } YY_BREAK case 24: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Unwind, UNWIND); } +#line 216 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TARGET; } YY_BREAK case 25: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return NOT; } /* Deprecated, turned into XOR */ +#line 217 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TRIPLE; } YY_BREAK case 26: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return TAIL; } +#line 218 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return DEPLIBS; } YY_BREAK case 27: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return TARGET; } +#line 219 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ENDIAN; } YY_BREAK case 28: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return TRIPLE; } +#line 220 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return POINTERSIZE; } YY_BREAK case 29: YY_RULE_SETUP -#line 225 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return DEPLIBS; } +#line 221 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return DATALAYOUT; } YY_BREAK case 30: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return ENDIAN; } +#line 222 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return LITTLE; } YY_BREAK case 31: YY_RULE_SETUP -#line 227 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return POINTERSIZE; } +#line 223 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return BIG; } YY_BREAK case 32: YY_RULE_SETUP -#line 228 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return DATALAYOUT; } +#line 224 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return VOLATILE; } YY_BREAK case 33: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return LITTLE; } +#line 225 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ALIGN; } YY_BREAK case 34: YY_RULE_SETUP -#line 230 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return BIG; } +#line 226 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SECTION; } YY_BREAK case 35: YY_RULE_SETUP -#line 231 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return VOLATILE; } +#line 227 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return MODULE; } YY_BREAK case 36: YY_RULE_SETUP -#line 232 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return ALIGN; } +#line 228 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return ASM_TOK; } YY_BREAK case 37: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return SECTION; } +#line 229 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return SIDEEFFECT; } YY_BREAK case 38: YY_RULE_SETUP -#line 234 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return MODULE; } +#line 231 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return CC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 235 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return ASM_TOK; } +#line 232 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return CCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return SIDEEFFECT; } +#line 233 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return CSRETCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 238 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return CC_TOK; } +#line 234 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return FASTCC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 239 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return CCC_TOK; } +#line 235 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return COLDCC_TOK; } YY_BREAK case 43: YY_RULE_SETUP -#line 240 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return CSRETCC_TOK; } +#line 236 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return X86_STDCALLCC_TOK; } YY_BREAK case 44: YY_RULE_SETUP -#line 241 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return FASTCC_TOK; } +#line 237 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return X86_FASTCALLCC_TOK; } YY_BREAK case 45: YY_RULE_SETUP -#line 242 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return COLDCC_TOK; } +#line 239 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::VoidTy, VOID); } YY_BREAK case 46: YY_RULE_SETUP -#line 243 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return X86_STDCALLCC_TOK; } +#line 240 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::BoolTy, BOOL); } YY_BREAK case 47: YY_RULE_SETUP -#line 244 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return X86_FASTCALLCC_TOK; } +#line 241 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::SByteTy, SBYTE); } YY_BREAK case 48: YY_RULE_SETUP -#line 246 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::VoidTy, isSignless, VOID); } +#line 242 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UByteTy, UBYTE); } YY_BREAK case 49: YY_RULE_SETUP -#line 247 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::BoolTy, isSignless, BOOL); } +#line 243 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::ShortTy, SHORT); } YY_BREAK case 50: YY_RULE_SETUP -#line 248 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::SByteTy, isSigned, SBYTE); } +#line 244 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UShortTy,USHORT);} YY_BREAK case 51: YY_RULE_SETUP -#line 249 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::UByteTy, isUnsigned, UBYTE); } +#line 245 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::IntTy, INT); } YY_BREAK case 52: YY_RULE_SETUP -#line 250 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::ShortTy, isSigned, SHORT); } +#line 246 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::UIntTy, UINT); } YY_BREAK case 53: YY_RULE_SETUP -#line 251 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::UShortTy,isUnsigned, USHORT);} +#line 247 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LongTy, LONG); } YY_BREAK case 54: YY_RULE_SETUP -#line 252 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::IntTy, isSigned, INT); } +#line 248 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::ULongTy, ULONG); } YY_BREAK case 55: YY_RULE_SETUP -#line 253 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::UIntTy, isUnsigned, UINT); } +#line 249 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::FloatTy, FLOAT); } YY_BREAK case 56: YY_RULE_SETUP -#line 254 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::LongTy, isSigned, LONG); } +#line 250 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::DoubleTy,DOUBLE);} YY_BREAK case 57: YY_RULE_SETUP -#line 255 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::ULongTy, isUnsigned, ULONG); } +#line 251 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LabelTy, LABEL); } YY_BREAK case 58: YY_RULE_SETUP -#line 256 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::FloatTy, isSignless, FLOAT); } +#line 252 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return TYPE; } YY_BREAK case 59: YY_RULE_SETUP -#line 257 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::DoubleTy,isSignless, DOUBLE);} +#line 253 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ return OPAQUE; } YY_BREAK case 60: YY_RULE_SETUP -#line 258 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TY(Type::LabelTy, isSignless, LABEL); } +#line 255 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 61: YY_RULE_SETUP -#line 259 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return TYPE; } +#line 256 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 62: YY_RULE_SETUP -#line 260 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return OPAQUE; } +#line 257 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 63: YY_RULE_SETUP -#line 262 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Add, ADD); } +#line 258 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, UDiv, UDIV); } YY_BREAK case 64: YY_RULE_SETUP -#line 263 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Sub, SUB); } +#line 259 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SDiv, SDIV); } YY_BREAK case 65: YY_RULE_SETUP -#line 264 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Mul, MUL); } +#line 260 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, FDiv, FDIV); } YY_BREAK case 66: YY_RULE_SETUP -#line 265 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK_OBSOLETE(BinaryOpVal, UDiv, UDIV); } +#line 261 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, URem, UREM); } YY_BREAK case 67: YY_RULE_SETUP -#line 266 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, UDiv, UDIV); } +#line 262 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SRem, SREM); } YY_BREAK case 68: YY_RULE_SETUP -#line 267 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SDiv, SDIV); } +#line 263 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, FRem, FREM); } YY_BREAK case 69: YY_RULE_SETUP -#line 268 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, FDiv, FDIV); } +#line 264 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 70: YY_RULE_SETUP -#line 269 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK_OBSOLETE(BinaryOpVal, URem, UREM); } +#line 265 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 71: YY_RULE_SETUP -#line 270 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, URem, UREM); } +#line 266 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 72: YY_RULE_SETUP -#line 271 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SRem, SREM); } +#line 267 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 73: YY_RULE_SETUP -#line 272 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, FRem, FREM); } +#line 268 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 74: YY_RULE_SETUP -#line 273 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, And, AND); } +#line 269 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 75: YY_RULE_SETUP -#line 274 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Or , OR ); } +#line 270 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 76: YY_RULE_SETUP -#line 275 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, Xor, XOR); } +#line 271 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 77: YY_RULE_SETUP -#line 276 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetNE, SETNE); } +#line 272 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 78: YY_RULE_SETUP -#line 277 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); } +#line 273 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, ICmp, ICMP); } YY_BREAK case 79: YY_RULE_SETUP -#line 278 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetLT, SETLT); } +#line 274 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, FCmp, FCMP); } YY_BREAK case 80: YY_RULE_SETUP -#line 279 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetGT, SETGT); } +#line 275 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_EQ, EQ); } YY_BREAK case 81: YY_RULE_SETUP -#line 280 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetLE, SETLE); } +#line 276 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_NE, NE); } YY_BREAK case 82: YY_RULE_SETUP -#line 281 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(BinaryOpVal, SetGE, SETGE); } +#line 277 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_SLT, SLT); } YY_BREAK case 83: YY_RULE_SETUP -#line 283 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } +#line 278 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_SGT, SGT); } YY_BREAK case 84: YY_RULE_SETUP -#line 284 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Call, CALL); } +#line 279 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_SLE, SLE); } YY_BREAK case 85: YY_RULE_SETUP -#line 285 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK_OBSOLETE(CastOpVal, Trunc, TRUNC); } +#line 280 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_SGE, SGE); } YY_BREAK case 86: YY_RULE_SETUP -#line 286 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, Trunc, TRUNC); } +#line 281 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_ULT, ULT); } YY_BREAK case 87: YY_RULE_SETUP -#line 287 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, ZExt, ZEXT); } +#line 282 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_UGT, UGT); } YY_BREAK case 88: YY_RULE_SETUP -#line 288 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, SExt, SEXT); } +#line 283 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_ULE, ULE); } YY_BREAK case 89: YY_RULE_SETUP -#line 289 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } +#line 284 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(IPredicate, ICmpInst::ICMP_UGE, UGE); } YY_BREAK case 90: YY_RULE_SETUP -#line 290 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPExt, FPEXT); } +#line 285 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_OEQ, ORDEQ); } YY_BREAK case 91: YY_RULE_SETUP -#line 291 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, UIToFP, UITOFP); } +#line 286 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_ONE, ORDNE); } YY_BREAK case 92: YY_RULE_SETUP -#line 292 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, SIToFP, SITOFP); } +#line 287 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_OLT, ORDLT); } YY_BREAK case 93: YY_RULE_SETUP -#line 293 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPToUI, FPTOUI); } +#line 288 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_OGT, ORDGT); } YY_BREAK case 94: YY_RULE_SETUP -#line 294 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, FPToSI, FPTOSI); } +#line 289 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_OLE, ORDLE); } YY_BREAK case 95: YY_RULE_SETUP -#line 295 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } +#line 290 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_OGE, ORDGE); } YY_BREAK case 96: YY_RULE_SETUP -#line 296 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } +#line 291 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_ORD, ORD); } YY_BREAK case 97: YY_RULE_SETUP -#line 297 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(CastOpVal, BitCast, BITCAST); } +#line 292 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_UNO, UNO); } YY_BREAK case 98: YY_RULE_SETUP -#line 298 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Select, SELECT); } +#line 293 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_UEQ, UNOEQ); } YY_BREAK case 99: YY_RULE_SETUP -#line 299 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, Shl, SHL); } +#line 294 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_UNE, UNONE); } YY_BREAK case 100: YY_RULE_SETUP -#line 300 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK_OBSOLETE(OtherOpVal, LShr, LSHR); } +#line 295 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_ULT, UNOLT); } YY_BREAK case 101: YY_RULE_SETUP -#line 301 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, LShr, LSHR); } +#line 296 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_UGT, UNOGT); } YY_BREAK case 102: YY_RULE_SETUP -#line 302 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, AShr, ASHR); } +#line 297 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_ULE, UNOLE); } YY_BREAK case 103: YY_RULE_SETUP -#line 303 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return VANEXT_old; } +#line 298 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_ENUM(FPredicate, FCmpInst::FCMP_UGE, UNOGE); } YY_BREAK case 104: YY_RULE_SETUP -#line 304 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ return VAARG_old; } +#line 300 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 105: YY_RULE_SETUP -#line 305 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, VAArg , VAARG); } +#line 301 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 106: YY_RULE_SETUP -#line 306 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Ret, RET); } +#line 302 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, Trunc, TRUNC); } YY_BREAK case 107: YY_RULE_SETUP -#line 307 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Br, BR); } +#line 303 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, ZExt, ZEXT); } YY_BREAK case 108: YY_RULE_SETUP -#line 308 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Switch, SWITCH); } +#line 304 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, SExt, SEXT); } YY_BREAK case 109: YY_RULE_SETUP -#line 309 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Invoke, INVOKE); } +#line 305 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } YY_BREAK case 110: YY_RULE_SETUP -#line 310 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Unwind, UNWIND); } +#line 306 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPExt, FPEXT); } YY_BREAK case 111: YY_RULE_SETUP -#line 311 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } +#line 307 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, UIToFP, UITOFP); } YY_BREAK case 112: YY_RULE_SETUP -#line 313 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Malloc, MALLOC); } +#line 308 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, SIToFP, SITOFP); } YY_BREAK case 113: YY_RULE_SETUP -#line 314 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Alloca, ALLOCA); } +#line 309 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPToUI, FPTOUI); } YY_BREAK case 114: YY_RULE_SETUP -#line 315 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Free, FREE); } +#line 310 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, FPToSI, FPTOSI); } YY_BREAK case 115: YY_RULE_SETUP -#line 316 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Load, LOAD); } +#line 311 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } YY_BREAK case 116: YY_RULE_SETUP -#line 317 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, Store, STORE); } +#line 312 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } YY_BREAK case 117: YY_RULE_SETUP -#line 318 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } +#line 313 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(CastOpVal, BitCast, BITCAST); } YY_BREAK case 118: YY_RULE_SETUP -#line 320 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } +#line 314 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 119: YY_RULE_SETUP -#line 321 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -{ RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } +#line 315 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, Shl, SHL); } YY_BREAK case 120: YY_RULE_SETUP +#line 316 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, LShr, LSHR); } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 317 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, AShr, ASHR); } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 318 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, VAArg , VAARG); } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 319 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Ret, RET); } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 320 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Br, BR); } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 321 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Switch, SWITCH); } + YY_BREAK +case 126: +YY_RULE_SETUP #line 322 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Invoke, INVOKE); } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 323 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Unwind, UNWIND); } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 324 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 326 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Malloc, MALLOC); } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 327 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Alloca, ALLOCA); } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 328 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Free, FREE); } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 329 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Load, LOAD); } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 330 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, Store, STORE); } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 331 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 333 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 334 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +{ RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 335 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK -case 121: +case 138: YY_RULE_SETUP -#line 325 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 338 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % return VAR_ID; } YY_BREAK -case 122: +case 139: YY_RULE_SETUP -#line 330 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 343 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1913,9 +2008,9 @@ YY_RULE_SETUP return LABELSTR; } YY_BREAK -case 123: +case 140: YY_RULE_SETUP -#line 336 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 349 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1923,9 +2018,9 @@ YY_RULE_SETUP return LABELSTR; } YY_BREAK -case 124: +case 141: YY_RULE_SETUP -#line 343 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 356 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a @@ -1936,14 +2031,14 @@ YY_RULE_SETUP return STRINGCONSTANT; } YY_BREAK -case 125: +case 142: YY_RULE_SETUP -#line 354 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 367 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK -case 126: +case 143: YY_RULE_SETUP -#line 355 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 368 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range @@ -1953,17 +2048,17 @@ YY_RULE_SETUP return ESINT64VAL; } YY_BREAK -case 127: +case 144: YY_RULE_SETUP -#line 363 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 376 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; } YY_BREAK -case 128: +case 145: YY_RULE_SETUP -#line 368 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 381 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -1972,9 +2067,9 @@ YY_RULE_SETUP return UINTVAL; } YY_BREAK -case 129: +case 146: YY_RULE_SETUP -#line 375 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 388 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range @@ -1984,18 +2079,18 @@ YY_RULE_SETUP return SINTVAL; } YY_BREAK -case 130: +case 147: YY_RULE_SETUP -#line 384 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 397 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK -case 131: +case 148: YY_RULE_SETUP -#line 385 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 387 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 400 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -2004,22 +2099,22 @@ case YY_STATE_EOF(INITIAL): return EOF; } YY_BREAK -case 132: +case 149: YY_RULE_SETUP -#line 395 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 408 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK -case 133: +case 150: YY_RULE_SETUP -#line 396 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 409 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK -case 134: +case 151: YY_RULE_SETUP -#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 411 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2023 "Lexer.cpp" +#line 2118 "Lexer.cpp" case YY_END_OF_BUFFER: { @@ -2306,7 +2401,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 576 ) + if ( yy_current_state >= 587 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2336,11 +2431,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 576 ) + if ( yy_current_state >= 587 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 575); + yy_is_jam = (yy_current_state == 586); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; @@ -2897,5 +2992,5 @@ int main() return 0; } #endif -#line 398 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 411 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" diff --git a/lib/AsmParser/Lexer.l.cvs b/lib/AsmParser/Lexer.l.cvs index 553ba81..5e60654 100644 --- a/lib/AsmParser/Lexer.l.cvs +++ b/lib/AsmParser/Lexer.l.cvs @@ -41,20 +41,16 @@ void set_scan_string (const char * str) { // Construct a token value for a non-obsolete token #define RET_TOK(type, Enum, sym) \ - llvmAsmlval.type.opcode = Instruction::Enum; \ - llvmAsmlval.type.obsolete = false; \ + llvmAsmlval.type = Instruction::Enum; \ return sym -// Construct a token value for an obsolete token -#define RET_TOK_OBSOLETE(type, Enum, sym) \ - llvmAsmlval.type.opcode = Instruction::Enum; \ - llvmAsmlval.type.obsolete = true; \ +#define RET_ENUM(type, Enum, sym) \ + llvmAsmlval.type = Enum; \ return sym // Construct a token value for an obsolete token -#define RET_TY(CTYPE, SIGN, SYM) \ - llvmAsmlval.TypeVal.type = new PATypeHolder(CTYPE); \ - llvmAsmlval.TypeVal.signedness = SIGN; \ +#define RET_TY(CTYPE, SYM) \ + llvmAsmlval.PrimType = CTYPE;\ return SYM namespace llvm { @@ -209,7 +205,6 @@ appending { return APPENDING; } dllimport { return DLLIMPORT; } dllexport { return DLLEXPORT; } extern_weak { return EXTERN_WEAK; } -uninitialized { return EXTERNAL; } /* Deprecated, turn into external */ external { return EXTERNAL; } implementation { return IMPLEMENTATION; } zeroinitializer { return ZEROINITIALIZER; } @@ -217,8 +212,6 @@ zeroinitializer { return ZEROINITIALIZER; } undef { return UNDEF; } null { return NULL_TOK; } to { return TO; } -except { RET_TOK(TermOpVal, Unwind, UNWIND); } -not { return NOT; } /* Deprecated, turned into XOR */ tail { return TAIL; } target { return TARGET; } triple { return TRIPLE; } @@ -243,30 +236,28 @@ coldcc { return COLDCC_TOK; } x86_stdcallcc { return X86_STDCALLCC_TOK; } x86_fastcallcc { return X86_FASTCALLCC_TOK; } -void { RET_TY(Type::VoidTy, isSignless, VOID); } -bool { RET_TY(Type::BoolTy, isSignless, BOOL); } -sbyte { RET_TY(Type::SByteTy, isSigned, SBYTE); } -ubyte { RET_TY(Type::UByteTy, isUnsigned, UBYTE); } -short { RET_TY(Type::ShortTy, isSigned, SHORT); } -ushort { RET_TY(Type::UShortTy,isUnsigned, USHORT);} -int { RET_TY(Type::IntTy, isSigned, INT); } -uint { RET_TY(Type::UIntTy, isUnsigned, UINT); } -long { RET_TY(Type::LongTy, isSigned, LONG); } -ulong { RET_TY(Type::ULongTy, isUnsigned, ULONG); } -float { RET_TY(Type::FloatTy, isSignless, FLOAT); } -double { RET_TY(Type::DoubleTy,isSignless, DOUBLE);} -label { RET_TY(Type::LabelTy, isSignless, LABEL); } +void { RET_TY(Type::VoidTy, VOID); } +bool { RET_TY(Type::BoolTy, BOOL); } +sbyte { RET_TY(Type::SByteTy, SBYTE); } +ubyte { RET_TY(Type::UByteTy, UBYTE); } +short { RET_TY(Type::ShortTy, SHORT); } +ushort { RET_TY(Type::UShortTy,USHORT);} +int { RET_TY(Type::IntTy, INT); } +uint { RET_TY(Type::UIntTy, UINT); } +long { RET_TY(Type::LongTy, LONG); } +ulong { RET_TY(Type::ULongTy, ULONG); } +float { RET_TY(Type::FloatTy, FLOAT); } +double { RET_TY(Type::DoubleTy,DOUBLE);} +label { RET_TY(Type::LabelTy, LABEL); } type { return TYPE; } opaque { return OPAQUE; } add { RET_TOK(BinaryOpVal, Add, ADD); } sub { RET_TOK(BinaryOpVal, Sub, SUB); } mul { RET_TOK(BinaryOpVal, Mul, MUL); } -div { RET_TOK_OBSOLETE(BinaryOpVal, UDiv, UDIV); } udiv { RET_TOK(BinaryOpVal, UDiv, UDIV); } sdiv { RET_TOK(BinaryOpVal, SDiv, SDIV); } fdiv { RET_TOK(BinaryOpVal, FDiv, FDIV); } -rem { RET_TOK_OBSOLETE(BinaryOpVal, URem, UREM); } urem { RET_TOK(BinaryOpVal, URem, UREM); } srem { RET_TOK(BinaryOpVal, SRem, SREM); } frem { RET_TOK(BinaryOpVal, FRem, FREM); } @@ -279,10 +270,35 @@ setlt { RET_TOK(BinaryOpVal, SetLT, SETLT); } setgt { RET_TOK(BinaryOpVal, SetGT, SETGT); } setle { RET_TOK(BinaryOpVal, SetLE, SETLE); } setge { RET_TOK(BinaryOpVal, SetGE, SETGE); } +icmp { RET_TOK(OtherOpVal, ICmp, ICMP); } +fcmp { RET_TOK(OtherOpVal, FCmp, FCMP); } +eq { RET_ENUM(IPredicate, ICmpInst::ICMP_EQ, EQ); } +ne { RET_ENUM(IPredicate, ICmpInst::ICMP_NE, NE); } +slt { RET_ENUM(IPredicate, ICmpInst::ICMP_SLT, SLT); } +sgt { RET_ENUM(IPredicate, ICmpInst::ICMP_SGT, SGT); } +sle { RET_ENUM(IPredicate, ICmpInst::ICMP_SLE, SLE); } +sge { RET_ENUM(IPredicate, ICmpInst::ICMP_SGE, SGE); } +ult { RET_ENUM(IPredicate, ICmpInst::ICMP_ULT, ULT); } +ugt { RET_ENUM(IPredicate, ICmpInst::ICMP_UGT, UGT); } +ule { RET_ENUM(IPredicate, ICmpInst::ICMP_ULE, ULE); } +uge { RET_ENUM(IPredicate, ICmpInst::ICMP_UGE, UGE); } +ordeq { RET_ENUM(FPredicate, FCmpInst::FCMP_OEQ, ORDEQ); } +ordne { RET_ENUM(FPredicate, FCmpInst::FCMP_ONE, ORDNE); } +ordlt { RET_ENUM(FPredicate, FCmpInst::FCMP_OLT, ORDLT); } +ordgt { RET_ENUM(FPredicate, FCmpInst::FCMP_OGT, ORDGT); } +ordle { RET_ENUM(FPredicate, FCmpInst::FCMP_OLE, ORDLE); } +ordge { RET_ENUM(FPredicate, FCmpInst::FCMP_OGE, ORDGE); } +ord { RET_ENUM(FPredicate, FCmpInst::FCMP_ORD, ORD); } +uno { RET_ENUM(FPredicate, FCmpInst::FCMP_UNO, UNO); } +unoeq { RET_ENUM(FPredicate, FCmpInst::FCMP_UEQ, UNOEQ); } +unone { RET_ENUM(FPredicate, FCmpInst::FCMP_UNE, UNONE); } +unolt { RET_ENUM(FPredicate, FCmpInst::FCMP_ULT, UNOLT); } +unogt { RET_ENUM(FPredicate, FCmpInst::FCMP_UGT, UNOGT); } +unole { RET_ENUM(FPredicate, FCmpInst::FCMP_ULE, UNOLE); } +unoge { RET_ENUM(FPredicate, FCmpInst::FCMP_UGE, UNOGE); } phi { RET_TOK(OtherOpVal, PHI, PHI_TOK); } call { RET_TOK(OtherOpVal, Call, CALL); } -cast { RET_TOK_OBSOLETE(CastOpVal, Trunc, TRUNC); } trunc { RET_TOK(CastOpVal, Trunc, TRUNC); } zext { RET_TOK(CastOpVal, ZExt, ZEXT); } sext { RET_TOK(CastOpVal, SExt, SEXT); } @@ -297,11 +313,8 @@ ptrtoint { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } bitcast { RET_TOK(CastOpVal, BitCast, BITCAST); } select { RET_TOK(OtherOpVal, Select, SELECT); } shl { RET_TOK(OtherOpVal, Shl, SHL); } -shr { RET_TOK_OBSOLETE(OtherOpVal, LShr, LSHR); } lshr { RET_TOK(OtherOpVal, LShr, LSHR); } ashr { RET_TOK(OtherOpVal, AShr, ASHR); } -vanext { return VANEXT_old; } -vaarg { return VAARG_old; } va_arg { RET_TOK(OtherOpVal, VAArg , VAARG); } ret { RET_TOK(TermOpVal, Ret, RET); } br { RET_TOK(TermOpVal, Br, BR); } diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index d06b522..125ece6 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -157,35 +157,61 @@ SETGT = 348, SETEQ = 349, SETNE = 350, - MALLOC = 351, - ALLOCA = 352, - FREE = 353, - LOAD = 354, - STORE = 355, - GETELEMENTPTR = 356, - TRUNC = 357, - ZEXT = 358, - SEXT = 359, - FPTRUNC = 360, - FPEXT = 361, - BITCAST = 362, - UITOFP = 363, - SITOFP = 364, - FPTOUI = 365, - FPTOSI = 366, - INTTOPTR = 367, - PTRTOINT = 368, - PHI_TOK = 369, - SELECT = 370, - SHL = 371, - LSHR = 372, - ASHR = 373, - VAARG = 374, - EXTRACTELEMENT = 375, - INSERTELEMENT = 376, - SHUFFLEVECTOR = 377, - VAARG_old = 378, - VANEXT_old = 379 + ICMP = 351, + FCMP = 352, + EQ = 353, + NE = 354, + SLT = 355, + SGT = 356, + SLE = 357, + SGE = 358, + ULT = 359, + UGT = 360, + ULE = 361, + UGE = 362, + ORDEQ = 363, + ORDNE = 364, + ORDLT = 365, + ORDGT = 366, + ORDLE = 367, + ORDGE = 368, + ORD = 369, + UNO = 370, + UNOEQ = 371, + UNONE = 372, + UNOLT = 373, + UNOGT = 374, + UNOLE = 375, + UNOGE = 376, + MALLOC = 377, + ALLOCA = 378, + FREE = 379, + LOAD = 380, + STORE = 381, + GETELEMENTPTR = 382, + TRUNC = 383, + ZEXT = 384, + SEXT = 385, + FPTRUNC = 386, + FPEXT = 387, + BITCAST = 388, + UITOFP = 389, + SITOFP = 390, + FPTOUI = 391, + FPTOSI = 392, + INTTOPTR = 393, + PTRTOINT = 394, + PHI_TOK = 395, + SELECT = 396, + SHL = 397, + LSHR = 398, + ASHR = 399, + VAARG = 400, + EXTRACTELEMENT = 401, + INSERTELEMENT = 402, + SHUFFLEVECTOR = 403, + VAARG_old = 404, + VANEXT_old = 405 }; #endif /* Tokens. */ @@ -282,35 +308,61 @@ #define SETGT 348 #define SETEQ 349 #define SETNE 350 -#define MALLOC 351 -#define ALLOCA 352 -#define FREE 353 -#define LOAD 354 -#define STORE 355 -#define GETELEMENTPTR 356 -#define TRUNC 357 -#define ZEXT 358 -#define SEXT 359 -#define FPTRUNC 360 -#define FPEXT 361 -#define BITCAST 362 -#define UITOFP 363 -#define SITOFP 364 -#define FPTOUI 365 -#define FPTOSI 366 -#define INTTOPTR 367 -#define PTRTOINT 368 -#define PHI_TOK 369 -#define SELECT 370 -#define SHL 371 -#define LSHR 372 -#define ASHR 373 -#define VAARG 374 -#define EXTRACTELEMENT 375 -#define INSERTELEMENT 376 -#define SHUFFLEVECTOR 377 -#define VAARG_old 378 -#define VANEXT_old 379 +#define ICMP 351 +#define FCMP 352 +#define EQ 353 +#define NE 354 +#define SLT 355 +#define SGT 356 +#define SLE 357 +#define SGE 358 +#define ULT 359 +#define UGT 360 +#define ULE 361 +#define UGE 362 +#define ORDEQ 363 +#define ORDNE 364 +#define ORDLT 365 +#define ORDGT 366 +#define ORDLE 367 +#define ORDGE 368 +#define ORD 369 +#define UNO 370 +#define UNOEQ 371 +#define UNONE 372 +#define UNOLT 373 +#define UNOGT 374 +#define UNOLE 375 +#define UNOGE 376 +#define MALLOC 377 +#define ALLOCA 378 +#define FREE 379 +#define LOAD 380 +#define STORE 381 +#define GETELEMENTPTR 382 +#define TRUNC 383 +#define ZEXT 384 +#define SEXT 385 +#define FPTRUNC 386 +#define FPEXT 387 +#define BITCAST 388 +#define UITOFP 389 +#define SITOFP 390 +#define FPTOUI 391 +#define FPTOSI 392 +#define INTTOPTR 393 +#define PTRTOINT 394 +#define PHI_TOK 395 +#define SELECT 396 +#define SHL 397 +#define LSHR 398 +#define ASHR 399 +#define VAARG 400 +#define EXTRACTELEMENT 401 +#define INSERTELEMENT 402 +#define SHUFFLEVECTOR 403 +#define VAARG_old 404 +#define VANEXT_old 405 @@ -430,11 +482,6 @@ static struct PerModuleInfo { return; } - // Look for intrinsic functions and CallInst that need to be upgraded - for (Module::iterator FI = CurrentModule->begin(), - FE = CurrentModule->end(); FI != FE; ) - UpgradeCallsToIntrinsic(FI++); - Values.clear(); // Clear out function local definitions Types.clear(); CurrentModule = 0; @@ -560,7 +607,7 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) { Type *Typ = OpaqueType::get(); CurModule.LateResolveTypes.insert(std::make_pair(D, Typ)); return Typ; -} + } static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = @@ -1119,71 +1166,6 @@ static PATypeHolder HandleUpRefs(const Type *ty) { return Ty; } -/// 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. -/// @brief Convert obsolete BinaryOps opcodes to new values -static void -sanitizeOpcode(OpcodeInfo<Instruction::BinaryOps> &OI, const Type *Ty) -{ - // If its not obsolete, don't do anything - if (!OI.obsolete) - return; - - // If its a packed type we want to use the element type - if (const PackedType *PTy = dyn_cast<PackedType>(Ty)) - Ty = PTy->getElementType(); - - // Depending on the opcode .. - switch (OI.opcode) { - default: - GenerateError("Invalid obsolete opCode (check Lexer.l)"); - 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; -} - -/// This function is similar to the previous overload of sanitizeOpcode but -/// operates on Instruction::OtherOps instead of Instruction::BinaryOps. -/// @brief Convert obsolete OtherOps opcodes to new values -static void -sanitizeOpcode(OpcodeInfo<Instruction::OtherOps> &OI, const Type *Ty) -{ - // If its not obsolete, don't do anything - if (!OI.obsolete) - return; - - switch (OI.opcode) { - default: - GenerateError("Invalid obsolete opcode (check Lexer.l)"); - break; - case Instruction::LShr: - if (Ty->isSigned()) - OI.opcode = Instruction::AShr; - break; - } - // Its not obsolete any more, we fixed it. - OI.obsolete = false; -} - // common code from the two 'RunVMAsmParser' functions static Module* RunParser(Module * M) { @@ -1360,25 +1342,28 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1038 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 968 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; - std::pair<TypeInfo, char*> *ArgVal; + std::pair<llvm::PATypeHolder*, char*> *ArgVal; llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - ConstInfo ConstVal; - TypeInfo TypeVal; - ValueInfo ValueVal; + llvm::Constant *ConstVal; - std::vector<std::pair<TypeInfo,char*> >*ArgList; - std::vector<ValueInfo> *ValueList; - std::list<TypeInfo> *TypeList; + const llvm::Type *PrimType; + llvm::PATypeHolder *TypeVal; + llvm::Value *ValueVal; + + std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList; + std::vector<llvm::Value*> *ValueList; + std::list<llvm::PATypeHolder> *TypeList; // Represent the RHS of PHI node - std::list<std::pair<llvm::Value*, llvm::BasicBlock*> > *PHIList; + std::list<std::pair<llvm::Value*, + llvm::BasicBlock*> > *PHIList; std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable; - std::vector<ConstInfo> *ConstVector; + std::vector<llvm::Constant*> *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -1391,15 +1376,17 @@ typedef union YYSTYPE { char *StrVal; // This memory is strdup'd! llvm::ValID ValIDVal; // strdup'd memory maybe! - BinaryOpInfo BinaryOpVal; - TermOpInfo TermOpVal; - MemOpInfo MemOpVal; - CastOpInfo CastOpVal; - OtherOpInfo OtherOpVal; + llvm::Instruction::BinaryOps BinaryOpVal; + llvm::Instruction::TermOps TermOpVal; + llvm::Instruction::MemoryOps MemOpVal; + llvm::Instruction::CastOps CastOpVal; + llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; + llvm::ICmpInst::Predicate IPredicate; + llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1403 "llvmAsmParser.tab.c" +#line 1390 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1411,7 +1398,7 @@ typedef union YYSTYPE { /* Line 219 of yacc.c. */ -#line 1415 "llvmAsmParser.tab.c" +#line 1402 "llvmAsmParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1562,20 +1549,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1410 +#define YYLAST 1503 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 139 +#define YYNTOKENS 165 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 76 +#define YYNNTS 78 /* YYNRULES -- Number of rules. */ -#define YYNRULES 269 +#define YYNRULES 297 /* YYNRULES -- Number of states. */ -#define YYNSTATES 534 +#define YYNSTATES 586 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 379 +#define YYMAXUTOK 405 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -1587,15 +1574,15 @@ static const unsigned char yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 128, 129, 137, 2, 126, 2, 2, 2, 2, 2, + 154, 155, 163, 2, 152, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 133, 125, 134, 2, 2, 2, 2, 2, 2, 2, + 159, 151, 160, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 130, 127, 132, 2, 2, 2, 2, 2, 138, + 2, 156, 153, 158, 2, 2, 2, 2, 2, 164, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 131, 2, 2, 135, 2, 136, 2, 2, 2, 2, + 157, 2, 2, 161, 2, 162, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1620,7 +1607,10 @@ static const unsigned char yytranslate[] = 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124 + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150 }; #if YYDEBUG @@ -1633,151 +1623,165 @@ static const unsigned short int yyprhs[] = 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 104, 105, 107, 109, 111, 113, 115, 117, - 119, 120, 121, 123, 125, 127, 129, 131, 133, 136, - 137, 140, 141, 145, 148, 149, 151, 152, 156, 158, - 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, - 201, 203, 206, 211, 217, 223, 227, 230, 233, 235, - 239, 241, 245, 247, 248, 253, 257, 261, 266, 271, - 275, 278, 281, 284, 287, 290, 293, 296, 299, 302, - 305, 312, 318, 327, 334, 341, 348, 355, 362, 371, - 380, 384, 386, 388, 390, 392, 395, 398, 403, 406, - 408, 413, 416, 421, 422, 430, 431, 439, 440, 448, - 449, 457, 461, 466, 467, 469, 471, 473, 477, 481, - 485, 489, 493, 497, 499, 500, 502, 504, 506, 507, - 510, 514, 516, 518, 522, 524, 525, 534, 536, 538, - 542, 544, 546, 549, 550, 552, 554, 555, 560, 561, - 563, 565, 567, 569, 571, 573, 575, 577, 579, 583, - 585, 591, 593, 595, 597, 599, 602, 605, 608, 612, - 615, 616, 618, 621, 624, 628, 638, 648, 657, 671, - 673, 675, 682, 688, 691, 698, 706, 708, 712, 714, - 715, 718, 720, 726, 732, 738, 741, 746, 751, 758, - 763, 768, 773, 778, 785, 792, 795, 803, 805, 808, - 809, 811, 812, 816, 823, 827, 834, 837, 842, 849 + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 149, 152, 153, 155, 157, + 159, 161, 163, 165, 167, 168, 169, 171, 173, 175, + 177, 179, 181, 184, 185, 188, 189, 193, 196, 197, + 199, 200, 204, 206, 209, 211, 213, 215, 217, 219, + 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, + 241, 243, 245, 247, 249, 251, 254, 259, 265, 271, + 275, 278, 281, 283, 287, 289, 293, 295, 296, 301, + 305, 309, 314, 319, 323, 326, 329, 332, 335, 338, + 341, 344, 347, 350, 353, 360, 366, 375, 382, 389, + 396, 405, 414, 421, 428, 437, 446, 450, 452, 454, + 456, 458, 461, 464, 469, 472, 474, 479, 482, 487, + 488, 496, 497, 505, 506, 514, 515, 523, 527, 532, + 533, 535, 537, 539, 543, 547, 551, 555, 559, 563, + 565, 566, 568, 570, 572, 573, 576, 580, 582, 584, + 588, 590, 591, 600, 602, 604, 608, 610, 612, 615, + 616, 618, 620, 621, 626, 627, 629, 631, 633, 635, + 637, 639, 641, 643, 645, 649, 651, 657, 659, 661, + 663, 665, 668, 671, 674, 678, 681, 682, 684, 687, + 690, 694, 704, 714, 723, 737, 739, 741, 748, 754, + 757, 764, 772, 774, 778, 780, 781, 784, 786, 792, + 798, 804, 811, 818, 821, 826, 831, 838, 843, 848, + 853, 858, 865, 872, 875, 883, 885, 888, 889, 891, + 892, 896, 903, 907, 914, 917, 922, 929 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short int yyrhs[] = { - 171, 0, -1, 5, -1, 6, -1, 3, -1, 4, + 199, 0, -1, 5, -1, 6, -1, 3, -1, 4, -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, - -1, 93, -1, 94, -1, 95, -1, 102, -1, 103, - -1, 104, -1, 105, -1, 106, -1, 107, -1, 108, - -1, 109, -1, 110, -1, 111, -1, 112, -1, 113, - -1, 116, -1, 117, -1, 118, -1, 16, -1, 14, - -1, 12, -1, 10, -1, 17, -1, 15, -1, 13, - -1, 11, -1, 147, -1, 148, -1, 18, -1, 19, - -1, 183, 125, -1, -1, 41, -1, 42, -1, 43, - -1, 44, -1, 45, -1, 46, -1, 47, -1, -1, - -1, 65, -1, 66, -1, 67, -1, 68, -1, 69, - -1, 70, -1, 64, 4, -1, -1, 57, 4, -1, - -1, 126, 57, 4, -1, 34, 24, -1, -1, 156, - -1, -1, 126, 159, 158, -1, 156, -1, 57, 4, - -1, 162, -1, 8, -1, 164, -1, 8, -1, 164, - -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, - -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, - -1, 19, -1, 20, -1, 21, -1, 48, -1, 163, - -1, 198, -1, 127, 4, -1, 161, 128, 166, 129, - -1, 130, 4, 131, 164, 132, -1, 133, 4, 131, - 164, 134, -1, 135, 165, 136, -1, 135, 136, -1, - 164, 137, -1, 164, -1, 165, 126, 164, -1, 165, - -1, 165, 126, 37, -1, 37, -1, -1, 162, 130, - 169, 132, -1, 162, 130, 132, -1, 162, 138, 24, - -1, 162, 133, 169, 134, -1, 162, 135, 169, 136, - -1, 162, 135, 136, -1, 162, 38, -1, 162, 39, - -1, 162, 198, -1, 162, 168, -1, 162, 26, -1, - 147, 141, -1, 148, 4, -1, 9, 27, -1, 9, - 28, -1, 150, 7, -1, 145, 128, 167, 36, 162, - 129, -1, 101, 128, 167, 212, 129, -1, 115, 128, - 167, 126, 167, 126, 167, 129, -1, 142, 128, 167, - 126, 167, 129, -1, 143, 128, 167, 126, 167, 129, - -1, 144, 128, 167, 126, 167, 129, -1, 146, 128, - 167, 126, 167, 129, -1, 120, 128, 167, 126, 167, - 129, -1, 121, 128, 167, 126, 167, 126, 167, 129, - -1, 122, 128, 167, 126, 167, 126, 167, 129, -1, - 169, 126, 167, -1, 167, -1, 32, -1, 33, -1, - 172, -1, 172, 192, -1, 172, 194, -1, 172, 62, - 61, 178, -1, 172, 25, -1, 173, -1, 173, 151, - 20, 160, -1, 173, 194, -1, 173, 62, 61, 178, - -1, -1, 173, 151, 152, 170, 167, 174, 158, -1, - -1, 173, 151, 50, 170, 162, 175, 158, -1, -1, - 173, 151, 45, 170, 162, 176, 158, -1, -1, 173, - 151, 47, 170, 162, 177, 158, -1, 173, 51, 180, - -1, 173, 58, 125, 181, -1, -1, 24, -1, 56, - -1, 55, -1, 53, 125, 179, -1, 54, 125, 4, - -1, 52, 125, 24, -1, 71, 125, 24, -1, 130, - 182, 132, -1, 182, 126, 24, -1, 24, -1, -1, - 22, -1, 24, -1, 183, -1, -1, 162, 184, -1, - 186, 126, 185, -1, 185, -1, 186, -1, 186, 126, - 37, -1, 37, -1, -1, 153, 160, 183, 128, 187, - 129, 157, 154, -1, 29, -1, 135, -1, 152, 188, - 189, -1, 30, -1, 136, -1, 201, 191, -1, -1, - 45, -1, 47, -1, -1, 31, 195, 193, 188, -1, - -1, 63, -1, 3, -1, 4, -1, 7, -1, 27, - -1, 28, -1, 38, -1, 39, -1, 26, -1, 133, - 169, 134, -1, 168, -1, 61, 196, 24, 126, 24, - -1, 140, -1, 183, -1, 198, -1, 197, -1, 162, - 199, -1, 201, 202, -1, 190, 202, -1, 203, 151, - 204, -1, 203, 206, -1, -1, 23, -1, 72, 200, - -1, 72, 8, -1, 73, 21, 199, -1, 73, 9, - 199, 126, 21, 199, 126, 21, 199, -1, 74, 149, - 199, 126, 21, 199, 130, 205, 132, -1, 74, 149, - 199, 126, 21, 199, 130, 132, -1, 75, 153, 160, - 199, 128, 209, 129, 36, 21, 199, 76, 21, 199, - -1, 76, -1, 77, -1, 205, 149, 197, 126, 21, - 199, -1, 149, 197, 126, 21, 199, -1, 151, 211, - -1, 162, 130, 199, 126, 199, 132, -1, 207, 126, - 130, 199, 126, 199, 132, -1, 200, -1, 208, 126, - 200, -1, 208, -1, -1, 60, 59, -1, 59, -1, - 142, 162, 199, 126, 199, -1, 143, 162, 199, 126, - 199, -1, 144, 162, 199, 126, 199, -1, 49, 200, - -1, 146, 200, 126, 200, -1, 145, 200, 36, 162, - -1, 115, 200, 126, 200, 126, 200, -1, 119, 200, - 126, 162, -1, 123, 200, 126, 162, -1, 124, 200, - 126, 162, -1, 120, 200, 126, 200, -1, 121, 200, - 126, 200, 126, 200, -1, 122, 200, 126, 200, 126, - 200, -1, 114, 207, -1, 210, 153, 160, 199, 128, - 209, 129, -1, 214, -1, 126, 208, -1, -1, 35, - -1, -1, 96, 162, 155, -1, 96, 162, 126, 15, - 199, 155, -1, 97, 162, 155, -1, 97, 162, 126, - 15, 199, 155, -1, 98, 200, -1, 213, 99, 162, - 199, -1, 213, 100, 200, 126, 162, 199, -1, 101, - 162, 199, 212, -1 + -1, 93, -1, 94, -1, 95, -1, 128, -1, 129, + -1, 130, -1, 131, -1, 132, -1, 133, -1, 134, + -1, 135, -1, 136, -1, 137, -1, 138, -1, 139, + -1, 142, -1, 143, -1, 144, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 102, -1, 103, -1, 104, + -1, 105, -1, 106, -1, 107, -1, 108, -1, 109, + -1, 110, -1, 111, -1, 112, -1, 113, -1, 114, + -1, 115, -1, 116, -1, 117, -1, 118, -1, 119, + -1, 120, -1, 121, -1, 16, -1, 14, -1, 12, + -1, 10, -1, 17, -1, 15, -1, 13, -1, 11, + -1, 175, -1, 176, -1, 18, -1, 19, -1, 211, + 151, -1, -1, 41, -1, 42, -1, 43, -1, 44, + -1, 45, -1, 46, -1, 47, -1, -1, -1, 65, + -1, 66, -1, 67, -1, 68, -1, 69, -1, 70, + -1, 64, 4, -1, -1, 57, 4, -1, -1, 152, + 57, 4, -1, 34, 24, -1, -1, 184, -1, -1, + 152, 187, 186, -1, 184, -1, 57, 4, -1, 190, + -1, 8, -1, 192, -1, 8, -1, 192, -1, 9, + -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, + -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, + -1, 20, -1, 21, -1, 48, -1, 191, -1, 226, + -1, 153, 4, -1, 189, 154, 194, 155, -1, 156, + 4, 157, 192, 158, -1, 159, 4, 157, 192, 160, + -1, 161, 193, 162, -1, 161, 162, -1, 192, 163, + -1, 192, -1, 193, 152, 192, -1, 193, -1, 193, + 152, 37, -1, 37, -1, -1, 190, 156, 197, 158, + -1, 190, 156, 158, -1, 190, 164, 24, -1, 190, + 159, 197, 160, -1, 190, 161, 197, 162, -1, 190, + 161, 162, -1, 190, 38, -1, 190, 39, -1, 190, + 226, -1, 190, 196, -1, 190, 26, -1, 175, 167, + -1, 176, 4, -1, 9, 27, -1, 9, 28, -1, + 178, 7, -1, 171, 154, 195, 36, 190, 155, -1, + 127, 154, 195, 240, 155, -1, 141, 154, 195, 152, + 195, 152, 195, 155, -1, 168, 154, 195, 152, 195, + 155, -1, 169, 154, 195, 152, 195, 155, -1, 170, + 154, 195, 152, 195, 155, -1, 96, 154, 173, 152, + 195, 152, 195, 155, -1, 97, 154, 174, 152, 195, + 152, 195, 155, -1, 172, 154, 195, 152, 195, 155, + -1, 146, 154, 195, 152, 195, 155, -1, 147, 154, + 195, 152, 195, 152, 195, 155, -1, 148, 154, 195, + 152, 195, 152, 195, 155, -1, 197, 152, 195, -1, + 195, -1, 32, -1, 33, -1, 200, -1, 200, 220, + -1, 200, 222, -1, 200, 62, 61, 206, -1, 200, + 25, -1, 201, -1, 201, 179, 20, 188, -1, 201, + 222, -1, 201, 62, 61, 206, -1, -1, 201, 179, + 180, 198, 195, 202, 186, -1, -1, 201, 179, 50, + 198, 190, 203, 186, -1, -1, 201, 179, 45, 198, + 190, 204, 186, -1, -1, 201, 179, 47, 198, 190, + 205, 186, -1, 201, 51, 208, -1, 201, 58, 151, + 209, -1, -1, 24, -1, 56, -1, 55, -1, 53, + 151, 207, -1, 54, 151, 4, -1, 52, 151, 24, + -1, 71, 151, 24, -1, 156, 210, 158, -1, 210, + 152, 24, -1, 24, -1, -1, 22, -1, 24, -1, + 211, -1, -1, 190, 212, -1, 214, 152, 213, -1, + 213, -1, 214, -1, 214, 152, 37, -1, 37, -1, + -1, 181, 188, 211, 154, 215, 155, 185, 182, -1, + 29, -1, 161, -1, 180, 216, 217, -1, 30, -1, + 162, -1, 229, 219, -1, -1, 45, -1, 47, -1, + -1, 31, 223, 221, 216, -1, -1, 63, -1, 3, + -1, 4, -1, 7, -1, 27, -1, 28, -1, 38, + -1, 39, -1, 26, -1, 159, 197, 160, -1, 196, + -1, 61, 224, 24, 152, 24, -1, 166, -1, 211, + -1, 226, -1, 225, -1, 190, 227, -1, 229, 230, + -1, 218, 230, -1, 231, 179, 232, -1, 231, 234, + -1, -1, 23, -1, 72, 228, -1, 72, 8, -1, + 73, 21, 227, -1, 73, 9, 227, 152, 21, 227, + 152, 21, 227, -1, 74, 177, 227, 152, 21, 227, + 156, 233, 158, -1, 74, 177, 227, 152, 21, 227, + 156, 158, -1, 75, 181, 188, 227, 154, 237, 155, + 36, 21, 227, 76, 21, 227, -1, 76, -1, 77, + -1, 233, 177, 225, 152, 21, 227, -1, 177, 225, + 152, 21, 227, -1, 179, 239, -1, 190, 156, 227, + 152, 227, 158, -1, 235, 152, 156, 227, 152, 227, + 158, -1, 228, -1, 236, 152, 228, -1, 236, -1, + -1, 60, 59, -1, 59, -1, 168, 190, 227, 152, + 227, -1, 169, 190, 227, 152, 227, -1, 170, 190, + 227, 152, 227, -1, 96, 173, 190, 227, 152, 227, + -1, 97, 174, 190, 227, 152, 227, -1, 49, 228, + -1, 172, 228, 152, 228, -1, 171, 228, 36, 190, + -1, 141, 228, 152, 228, 152, 228, -1, 145, 228, + 152, 190, -1, 149, 228, 152, 190, -1, 150, 228, + 152, 190, -1, 146, 228, 152, 228, -1, 147, 228, + 152, 228, 152, 228, -1, 148, 228, 152, 228, 152, + 228, -1, 140, 235, -1, 238, 181, 188, 227, 154, + 237, 155, -1, 242, -1, 152, 236, -1, -1, 35, + -1, -1, 122, 190, 183, -1, 122, 190, 152, 15, + 227, 183, -1, 123, 190, 183, -1, 123, 190, 152, + 15, 227, 183, -1, 124, 228, -1, 241, 125, 190, + 227, -1, 241, 126, 228, 152, 190, 227, -1, 127, + 190, 227, 240, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1164, 1164, 1165, 1173, 1174, 1184, 1184, 1184, 1184, - 1184, 1184, 1184, 1184, 1184, 1185, 1185, 1185, 1186, 1186, - 1186, 1186, 1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, - 1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1193, - 1193, 1193, 1193, 1194, 1194, 1194, 1194, 1195, 1195, 1196, - 1196, 1199, 1203, 1208, 1209, 1210, 1211, 1212, 1213, 1214, - 1215, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1233, - 1234, 1240, 1241, 1249, 1257, 1258, 1263, 1264, 1265, 1270, - 1284, 1284, 1288, 1288, 1293, 1304, 1304, 1304, 1304, 1304, - 1304, 1304, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1311, - 1315, 1324, 1333, 1348, 1355, 1369, 1380, 1385, 1397, 1402, - 1408, 1409, 1415, 1421, 1432, 1463, 1478, 1509, 1539, 1564, - 1578, 1589, 1595, 1657, 1664, 1674, 1681, 1688, 1693, 1698, - 1707, 1733, 1755, 1764, 1793, 1805, 1812, 1824, 1831, 1838, - 1848, 1852, 1860, 1860, 1870, 1878, 1883, 1887, 1891, 1895, - 1910, 1932, 1935, 1938, 1938, 1946, 1946, 1955, 1955, 1964, - 1964, 1974, 1977, 1980, 1984, 1997, 1998, 2000, 2004, 2013, - 2017, 2022, 2024, 2029, 2034, 2043, 2043, 2044, 2044, 2046, - 2053, 2059, 2066, 2070, 2078, 2086, 2091, 2185, 2185, 2187, - 2195, 2195, 2197, 2202, 2203, 2204, 2206, 2206, 2216, 2220, - 2225, 2229, 2233, 2237, 2241, 2245, 2249, 2253, 2257, 2280, - 2284, 2298, 2302, 2308, 2308, 2314, 2321, 2325, 2334, 2345, - 2354, 2366, 2379, 2383, 2387, 2392, 2401, 2420, 2429, 2494, - 2498, 2505, 2516, 2529, 2538, 2547, 2557, 2561, 2568, 2571, - 2575, 2579, 2584, 2606, 2621, 2635, 2648, 2659, 2685, 2693, - 2699, 2719, 2742, 2748, 2754, 2760, 2775, 2848, 2855, 2858, - 2863, 2867, 2874, 2879, 2885, 2890, 2896, 2904, 2916, 2931 + 0, 1105, 1105, 1106, 1114, 1115, 1125, 1125, 1125, 1125, + 1125, 1125, 1125, 1125, 1125, 1126, 1126, 1126, 1127, 1127, + 1127, 1127, 1127, 1127, 1128, 1128, 1128, 1128, 1128, 1128, + 1129, 1129, 1129, 1129, 1129, 1129, 1130, 1130, 1130, 1131, + 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1132, + 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133, 1133, 1133, + 1133, 1133, 1133, 1137, 1137, 1137, 1137, 1138, 1138, 1138, + 1138, 1139, 1139, 1140, 1140, 1143, 1147, 1152, 1153, 1154, + 1155, 1156, 1157, 1158, 1159, 1161, 1162, 1163, 1164, 1165, + 1166, 1167, 1168, 1177, 1178, 1184, 1185, 1193, 1201, 1202, + 1207, 1208, 1209, 1214, 1228, 1228, 1229, 1229, 1231, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1242, 1242, 1242, 1242, + 1242, 1242, 1243, 1247, 1251, 1259, 1267, 1280, 1285, 1297, + 1307, 1311, 1322, 1327, 1333, 1334, 1338, 1342, 1353, 1379, + 1393, 1423, 1449, 1470, 1483, 1493, 1498, 1559, 1566, 1574, + 1580, 1586, 1590, 1594, 1602, 1614, 1646, 1654, 1678, 1689, + 1695, 1700, 1705, 1714, 1720, 1726, 1735, 1739, 1747, 1747, + 1757, 1765, 1770, 1774, 1778, 1782, 1797, 1819, 1822, 1825, + 1825, 1833, 1833, 1841, 1841, 1849, 1849, 1858, 1861, 1864, + 1868, 1881, 1882, 1884, 1888, 1897, 1901, 1906, 1908, 1913, + 1918, 1927, 1927, 1928, 1928, 1930, 1937, 1943, 1950, 1954, + 1960, 1965, 1970, 2065, 2065, 2067, 2075, 2075, 2077, 2082, + 2083, 2084, 2086, 2086, 2096, 2100, 2105, 2109, 2113, 2117, + 2121, 2125, 2129, 2133, 2137, 2162, 2166, 2180, 2184, 2190, + 2190, 2196, 2201, 2205, 2214, 2225, 2234, 2246, 2259, 2263, + 2267, 2272, 2281, 2300, 2309, 2365, 2369, 2376, 2387, 2400, + 2409, 2418, 2428, 2432, 2439, 2439, 2441, 2445, 2450, 2469, + 2484, 2498, 2509, 2520, 2533, 2542, 2553, 2561, 2567, 2587, + 2610, 2616, 2622, 2628, 2643, 2702, 2709, 2712, 2717, 2721, + 2728, 2733, 2739, 2744, 2750, 2758, 2770, 2785 }; #endif @@ -1800,7 +1804,10 @@ static const char *const yytname[] = "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", - "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", + "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "ICMP", + "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", + "UGE", "ORDEQ", "ORDNE", "ORDLT", "ORDGT", "ORDLE", "ORDGE", "ORD", + "UNO", "UNOEQ", "UNONE", "UNOLT", "UNOGT", "UNOLE", "UNOGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "SHL", "LSHR", @@ -1808,17 +1815,17 @@ static const char *const yytname[] = "VAARG_old", "VANEXT_old", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", "ArithmeticOps", "LogicalOps", "SetCondOps", - "CastOps", "ShiftOps", "SIntType", "UIntType", "IntType", "FPType", - "OptAssign", "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", - "SectionString", "OptSection", "GlobalVarAttributes", - "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType", - "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", "ConstExpr", - "ConstVector", "GlobalType", "Module", "FunctionList", "ConstPool", "@1", - "@2", "@3", "@4", "AsmBlock", "BigOrLittle", "TargetDefinition", - "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FnDeclareLinkage", "FunctionProto", "@5", - "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", + "CastOps", "ShiftOps", "IPredicates", "FPredicates", "SIntType", + "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", + "OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", + "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", + "ConstExpr", "ConstVector", "GlobalType", "Module", "FunctionList", + "ConstPool", "@1", "@2", "@3", "@4", "AsmBlock", "BigOrLittle", + "TargetDefinition", "LibrariesDefinition", "LibList", "Name", "OptName", + "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", + "FunctionHeader", "END", "Function", "FnDeclareLinkage", "FunctionProto", + "@5", "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal", "IndexList", "OptVolatile", @@ -1843,41 +1850,47 @@ static const unsigned short int yytoknum[] = 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 61, 44, 92, 40, 41, - 91, 120, 93, 60, 62, 123, 125, 42, 99 + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 61, 44, 92, 40, 41, 91, 120, 93, 60, + 62, 123, 125, 42, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 139, 140, 140, 141, 141, 142, 142, 142, 142, - 142, 142, 142, 142, 142, 143, 143, 143, 144, 144, - 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 146, 146, 146, 147, - 147, 147, 147, 148, 148, 148, 148, 149, 149, 150, - 150, 151, 151, 152, 152, 152, 152, 152, 152, 152, - 152, 153, 153, 153, 153, 153, 153, 153, 153, 154, - 154, 155, 155, 156, 157, 157, 158, 158, 159, 159, - 160, 160, 161, 161, 162, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, - 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, - 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 169, 169, 170, 170, 171, 172, 172, 172, 172, 172, - 173, 173, 173, 174, 173, 175, 173, 176, 173, 177, - 173, 173, 173, 173, 178, 179, 179, 180, 180, 180, - 180, 181, 182, 182, 182, 183, 183, 184, 184, 185, - 186, 186, 187, 187, 187, 187, 188, 189, 189, 190, - 191, 191, 192, 193, 193, 193, 195, 194, 196, 196, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 198, 198, 199, 199, 200, 201, 201, 202, 203, - 203, 203, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 205, 205, 206, 207, 207, 208, 208, 209, 209, - 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, - 213, 213, 214, 214, 214, 214, 214, 214, 214, 214 + 0, 165, 166, 166, 167, 167, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 169, 169, 169, 170, 170, + 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 172, 172, 172, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 175, 175, 175, 175, 176, 176, 176, + 176, 177, 177, 178, 178, 179, 179, 180, 180, 180, + 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, + 181, 181, 181, 182, 182, 183, 183, 184, 185, 185, + 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 193, 193, 194, 194, 194, 194, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 197, 197, 198, 198, + 199, 200, 200, 200, 200, 200, 201, 201, 201, 202, + 201, 203, 201, 204, 201, 205, 201, 201, 201, 201, + 206, 207, 207, 208, 208, 208, 208, 209, 210, 210, + 210, 211, 211, 212, 212, 213, 214, 214, 215, 215, + 215, 215, 216, 217, 217, 218, 219, 219, 220, 221, + 221, 221, 223, 222, 224, 224, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 226, 226, 227, + 227, 228, 229, 229, 230, 231, 231, 231, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 233, 233, 234, + 235, 235, 236, 236, 237, 237, 238, 238, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 240, 240, 241, 241, + 242, 242, 242, 242, 242, 242, 242, 242 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1888,28 +1901,31 @@ static const unsigned char yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, - 2, 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 5, 3, 2, 2, 1, 3, - 1, 3, 1, 0, 4, 3, 3, 4, 4, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 6, 5, 8, 6, 6, 6, 6, 6, 8, 8, - 3, 1, 1, 1, 1, 2, 2, 4, 2, 1, - 4, 2, 4, 0, 7, 0, 7, 0, 7, 0, - 7, 3, 4, 0, 1, 1, 1, 3, 3, 3, - 3, 3, 3, 1, 0, 1, 1, 1, 0, 2, - 3, 1, 1, 3, 1, 0, 8, 1, 1, 3, - 1, 1, 2, 0, 1, 1, 0, 4, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 5, 1, 1, 1, 1, 2, 2, 2, 3, 2, - 0, 1, 2, 2, 3, 9, 9, 8, 13, 1, - 1, 6, 5, 2, 6, 7, 1, 3, 1, 0, - 2, 1, 5, 5, 5, 2, 4, 4, 6, 4, - 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, - 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 + 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, + 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, + 1, 1, 2, 0, 2, 0, 3, 2, 0, 1, + 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 4, 5, 5, 3, + 2, 2, 1, 3, 1, 3, 1, 0, 4, 3, + 3, 4, 4, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 6, 5, 8, 6, 6, 6, + 8, 8, 6, 6, 8, 8, 3, 1, 1, 1, + 1, 2, 2, 4, 2, 1, 4, 2, 4, 0, + 7, 0, 7, 0, 7, 0, 7, 3, 4, 0, + 1, 1, 1, 3, 3, 3, 3, 3, 3, 1, + 0, 1, 1, 1, 0, 2, 3, 1, 1, 3, + 1, 0, 8, 1, 1, 3, 1, 1, 2, 0, + 1, 1, 0, 4, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, + 1, 2, 2, 2, 3, 2, 0, 1, 2, 2, + 3, 9, 9, 8, 13, 1, 1, 6, 5, 2, + 6, 7, 1, 3, 1, 0, 2, 1, 5, 5, + 5, 6, 6, 2, 4, 4, 6, 4, 4, 4, + 4, 6, 6, 2, 7, 1, 2, 0, 1, 0, + 3, 6, 3, 6, 2, 4, 6, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -1917,504 +1933,537 @@ static const unsigned char yyr2[] = means the default is an error. */ static const unsigned short int yydefact[] = { - 163, 0, 60, 149, 1, 148, 196, 53, 54, 55, - 56, 57, 58, 59, 0, 61, 220, 145, 146, 220, - 175, 176, 0, 0, 0, 60, 0, 151, 193, 0, - 0, 62, 63, 64, 65, 66, 67, 0, 0, 221, - 217, 52, 190, 191, 192, 216, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 0, 0, 51, 194, - 195, 61, 164, 147, 68, 2, 3, 81, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 0, 0, 0, 0, 211, 0, 0, 80, - 99, 84, 212, 100, 187, 188, 189, 261, 219, 0, - 0, 0, 0, 174, 162, 152, 150, 142, 143, 0, - 0, 0, 0, 197, 101, 0, 0, 83, 106, 108, - 0, 0, 113, 107, 260, 0, 241, 0, 0, 0, - 0, 61, 229, 230, 6, 7, 8, 9, 10, 11, + 189, 0, 84, 175, 1, 174, 222, 77, 78, 79, + 80, 81, 82, 83, 0, 85, 246, 171, 172, 246, + 201, 202, 0, 0, 0, 84, 0, 177, 219, 0, + 0, 86, 87, 88, 89, 90, 91, 0, 0, 247, + 243, 76, 216, 217, 218, 242, 0, 0, 0, 0, + 187, 0, 0, 0, 0, 0, 0, 0, 75, 220, + 221, 85, 190, 173, 92, 2, 3, 105, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 0, 0, 0, 0, 237, 0, 0, 104, + 123, 108, 238, 124, 213, 214, 215, 289, 245, 0, + 0, 0, 0, 200, 188, 178, 176, 168, 169, 0, + 0, 0, 0, 223, 125, 0, 0, 107, 130, 132, + 0, 0, 137, 131, 288, 0, 267, 0, 0, 0, + 0, 85, 255, 256, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 0, 0, 0, 0, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, - 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 218, 61, 233, 0, 257, 169, - 166, 165, 167, 168, 170, 173, 0, 157, 159, 155, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 0, 0, 0, 0, 153, 0, 0, 0, 105, - 185, 112, 110, 0, 0, 245, 240, 223, 222, 0, - 0, 42, 46, 41, 45, 40, 44, 39, 43, 47, - 48, 0, 0, 71, 71, 266, 0, 0, 255, 0, + 22, 23, 0, 0, 0, 0, 0, 0, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 0, 0, 36, 37, 38, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 244, 85, 259, 0, + 285, 195, 192, 191, 193, 194, 196, 199, 0, 183, + 185, 181, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 0, 0, 0, 0, 179, 0, 0, + 0, 129, 211, 136, 134, 0, 0, 273, 266, 249, + 248, 0, 0, 66, 70, 65, 69, 64, 68, 63, + 67, 71, 72, 0, 0, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 0, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 0, 95, 95, 294, 0, 0, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 171, 76, 76, 76, 127, - 128, 4, 5, 125, 126, 129, 124, 120, 121, 0, + 0, 0, 0, 197, 100, 100, 100, 151, 152, 4, + 5, 149, 150, 153, 148, 144, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 123, 122, 76, 82, 82, 109, 184, - 178, 181, 182, 0, 0, 102, 200, 201, 202, 207, - 203, 204, 205, 206, 198, 0, 209, 214, 213, 215, - 0, 224, 0, 0, 0, 262, 0, 264, 259, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 172, 0, 158, 160, - 156, 0, 0, 0, 0, 0, 115, 141, 0, 0, - 119, 0, 116, 0, 0, 0, 0, 0, 154, 103, - 104, 177, 179, 0, 74, 111, 199, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 269, 0, 0, 0, - 249, 252, 0, 0, 250, 251, 0, 0, 0, 247, - 246, 0, 267, 0, 0, 0, 78, 76, 259, 0, - 0, 0, 0, 0, 114, 117, 118, 0, 0, 0, - 0, 0, 183, 180, 75, 69, 0, 208, 0, 0, - 239, 71, 72, 71, 236, 258, 0, 0, 0, 0, - 0, 242, 243, 244, 239, 0, 73, 79, 77, 0, - 0, 0, 0, 0, 140, 0, 0, 0, 0, 0, - 0, 186, 0, 0, 0, 238, 0, 0, 263, 265, - 0, 0, 0, 248, 253, 254, 0, 268, 131, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 70, 210, - 0, 0, 0, 237, 234, 0, 256, 0, 137, 0, - 0, 133, 134, 135, 130, 136, 0, 227, 0, 0, - 0, 235, 0, 0, 0, 225, 0, 226, 0, 0, - 132, 138, 139, 0, 0, 0, 0, 0, 0, 232, - 0, 0, 231, 228 + 0, 0, 0, 147, 146, 100, 106, 106, 133, 210, + 204, 207, 208, 0, 0, 126, 226, 227, 228, 233, + 229, 230, 231, 232, 224, 0, 235, 240, 239, 241, + 0, 250, 0, 0, 0, 0, 0, 290, 0, 292, + 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 198, 0, + 184, 186, 182, 0, 0, 0, 0, 0, 0, 0, + 139, 167, 0, 0, 143, 0, 140, 0, 0, 0, + 0, 0, 180, 127, 128, 203, 205, 0, 98, 135, + 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 297, 0, 0, 0, 277, 280, 0, 0, + 278, 279, 0, 0, 0, 275, 274, 0, 295, 0, + 0, 0, 102, 100, 0, 0, 287, 0, 0, 0, + 0, 0, 138, 141, 142, 0, 0, 0, 0, 0, + 209, 206, 99, 93, 0, 234, 0, 0, 265, 0, + 0, 95, 96, 95, 262, 286, 0, 0, 0, 0, + 0, 268, 269, 270, 265, 0, 97, 103, 101, 0, + 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, + 0, 0, 0, 212, 0, 0, 0, 264, 0, 271, + 272, 0, 291, 293, 0, 0, 0, 276, 281, 282, + 0, 296, 0, 0, 155, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 94, 236, 0, 0, 0, 263, + 260, 0, 284, 0, 0, 0, 163, 0, 0, 157, + 158, 159, 154, 162, 0, 253, 0, 0, 0, 261, + 0, 0, 0, 0, 0, 251, 0, 252, 0, 0, + 160, 161, 156, 164, 165, 0, 0, 0, 0, 0, + 0, 258, 0, 0, 257, 254 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short int yydefgoto[] = { - -1, 86, 273, 288, 289, 290, 291, 292, 211, 212, - 241, 213, 25, 15, 37, 461, 325, 406, 425, 348, - 407, 87, 88, 214, 90, 91, 120, 223, 357, 316, - 358, 109, 1, 2, 3, 295, 268, 266, 267, 63, - 192, 50, 104, 196, 92, 372, 301, 302, 303, 38, - 96, 16, 44, 17, 61, 18, 28, 377, 317, 93, - 319, 434, 19, 40, 41, 184, 509, 98, 248, 465, - 466, 185, 186, 386, 187, 188 + -1, 86, 301, 318, 319, 320, 321, 322, 255, 270, + 213, 214, 243, 215, 25, 15, 37, 503, 357, 442, + 463, 380, 443, 87, 88, 216, 90, 91, 120, 225, + 391, 346, 392, 109, 1, 2, 3, 325, 296, 294, + 295, 63, 194, 50, 104, 198, 92, 406, 331, 332, + 333, 38, 96, 16, 44, 17, 61, 18, 28, 411, + 347, 93, 349, 474, 19, 40, 41, 186, 557, 98, + 276, 507, 508, 187, 188, 422, 189, 190 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -472 +#define YYPACT_NINF -531 static const short int yypact[] = { - -472, 24, 395, 501, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -13, 112, 46, -472, -472, -11, - -472, -472, -18, -41, 45, 51, -1, -472, 40, 106, - 131, -472, -472, -472, -472, -472, -472, 1136, -23, -472, - -472, 81, -472, -472, -472, -472, 30, 33, 49, 61, - -472, 57, 106, 1136, 78, 78, 78, 78, -472, -472, - -472, 112, -472, -472, -472, -472, -472, 62, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, 185, 187, 188, 619, -472, 81, 67, -472, - -472, -71, -472, -472, -472, -472, -472, 1286, -472, 174, - 58, 196, 177, 178, -472, -472, -472, -472, -472, 1177, - 1177, 1177, 1197, -472, -472, 72, 73, -472, -472, -71, - -89, 79, 151, -472, -472, 1177, -472, 147, 1222, 12, - 218, 112, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, -472, 1177, 1177, 1177, 1177, -472, -472, -472, -472, - -472, -472, -472, -472, -472, -472, -472, -472, 1177, 1177, - -472, -472, -472, 1177, 1177, 1177, 1177, 1177, 1177, 1177, - 1177, 1177, 1177, 1177, -472, 112, -472, -55, -472, -472, - -472, -472, -472, -472, -472, -472, -62, -472, -472, -472, - 95, 123, 204, 125, 205, 130, 206, 149, 207, 208, - 210, 181, 209, 214, 488, -472, 1177, 1177, 1177, -472, - 944, -472, 88, 93, 698, -472, -472, 62, -472, 698, - 698, -472, -472, -472, -472, -472, -472, -472, -472, -472, - -472, 698, 1136, 97, 110, -472, 698, 108, 113, 114, - 120, 121, 124, 126, 133, 136, 698, 698, 698, 213, - 139, 1136, 1177, 1177, 227, -472, 140, 140, 140, -472, - -472, -472, -472, -472, -472, -472, -472, -472, -472, 141, - 142, 143, 145, 146, 985, 1197, 639, 243, 148, 154, - 155, 157, 165, -472, -472, 140, -28, -51, -71, -472, - 81, -472, 153, 172, 1005, -472, -472, -472, -472, -472, - -472, -472, -472, -472, 244, 1197, -472, -472, -472, -472, - 180, -472, 182, 698, -7, -472, -6, -472, 183, 698, - 138, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 184, 186, - 189, 1177, 1177, 698, 698, 190, -472, -17, -472, -472, - -472, 1197, 1197, 1197, 1197, 1197, -472, -472, -24, -85, - -472, -80, -472, 1197, 1197, 1197, 1197, 1197, -472, -472, - -472, -472, -472, 1046, 277, -472, -472, 289, -27, 293, - 296, 191, 698, 314, 698, 1177, -472, 194, 698, 195, - -472, -472, 200, 201, -472, -472, 698, 698, 698, -472, - -472, 202, -472, 1177, 298, 324, -472, 140, 183, 203, - 211, 212, 224, 1197, -472, -472, -472, 225, 226, 230, - 295, 232, -472, -472, -472, 275, 233, -472, 698, 698, - 1177, 235, -472, 235, -472, 239, 698, 241, 1177, 1177, - 1177, -472, -472, -472, 1177, 698, -472, -472, -472, 215, - 1197, 1197, 1197, 1197, -472, 1197, 1197, 1197, 1177, 1197, - 329, -472, 310, 242, 223, 239, 240, 278, -472, -472, - 1177, 238, 698, -472, -472, -472, 247, -472, -472, 245, - 250, 246, 255, 254, 256, 257, 259, 262, -472, -472, - 318, 15, 337, -472, -472, 252, -472, 1197, -472, 1197, - 1197, -472, -472, -472, -472, -472, 698, -472, 818, 65, - 371, -472, 265, 267, 268, -472, 272, -472, 818, 698, - -472, -472, -472, 378, 274, 328, 698, 384, 385, -472, - 698, 698, -472, -472 + -531, 114, 234, 65, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, 74, 132, 47, -531, -531, -13, + -531, -531, 24, -15, 98, 145, 13, -531, 84, 153, + 175, -531, -531, -531, -531, -531, -531, 1181, -24, -531, + -531, 108, -531, -531, -531, -531, 29, 30, 32, 33, + -531, 26, 153, 1181, 10, 10, 10, 10, -531, -531, + -531, 132, -531, -531, -531, -531, -531, 50, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, 202, 204, 205, 593, -531, 108, 56, -531, + -531, -70, -531, -531, -531, -531, -531, 1353, -531, 187, + 70, 209, 190, 192, -531, -531, -531, -531, -531, 1201, + 1201, 1201, 1242, -531, -531, 62, 63, -531, -531, -70, + -140, 68, 982, -531, -531, 1201, -531, 164, 1262, 0, + 273, 132, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, 216, 516, 1201, 1201, 1201, 1201, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + 1201, 1201, -531, -531, -531, 1201, 1201, 1201, 1201, 1201, + 1201, 1201, 1201, 1201, 1201, 1201, -531, 132, -531, 31, + -531, -531, -531, -531, -531, -531, -531, -531, -72, -531, + -531, -531, 133, 159, 220, 163, 221, 165, 222, 167, + 223, 225, 228, 172, 224, 229, 433, -531, 1201, 1201, + 1201, -531, 1023, -531, 85, 83, 684, -531, -531, 50, + -531, 684, 684, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, 684, 1181, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, 1201, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + 1201, 88, 89, -531, 684, 86, 91, 92, 93, 95, + 99, 103, 104, 106, 684, 684, 684, 226, 109, 1181, + 1201, 1201, 236, -531, 116, 116, 116, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, 117, 118, 120, + 143, 144, 148, 154, 927, 1242, 648, 246, 155, 156, + 157, 170, 171, -531, -531, 116, -59, -39, -70, -531, + 108, -531, 147, 179, 1084, -531, -531, -531, -531, -531, + -531, -531, -531, -531, 272, 1242, -531, -531, -531, -531, + 186, -531, 188, 684, 684, 684, -1, -531, 9, -531, + 189, 684, 183, 1201, 1201, 1201, 1201, 1201, 1201, 1201, + 193, 194, 195, 1201, 1201, 684, 684, 196, -531, -19, + -531, -531, -531, 216, 516, 1242, 1242, 1242, 1242, 1242, + -531, -531, -30, -60, -531, -83, -531, 1242, 1242, 1242, + 1242, 1242, -531, -531, -531, -531, -531, 1140, 308, -531, + -531, 320, -47, 328, 329, 198, 206, 207, 684, 352, + 684, 1201, -531, 208, 684, 212, -531, -531, 213, 215, + -531, -531, 684, 684, 684, -531, -531, 214, -531, 1201, + 345, 367, -531, 116, 230, 231, 189, 233, 235, 237, + 238, 1242, -531, -531, -531, 239, 240, 241, 336, 242, + -531, -531, -531, 316, 254, -531, 684, 684, 1201, 684, + 684, 258, -531, 258, -531, 259, 684, 260, 1201, 1201, + 1201, -531, -531, -531, 1201, 684, -531, -531, -531, 1242, + 1242, 219, 1242, 1242, 1242, 1242, -531, 1242, 1242, 1242, + 1201, 1242, 372, -531, 353, 261, 232, 259, 262, -531, + -531, 321, -531, -531, 1201, 256, 684, -531, -531, -531, + 263, -531, 264, 267, -531, 268, 266, 274, 275, 270, + 277, 278, 279, 280, -531, -531, 360, 20, 350, -531, + -531, 257, -531, 1242, 1242, 1242, -531, 1242, 1242, -531, + -531, -531, -531, -531, 684, -531, 830, 35, 415, -531, + 282, 285, 291, 293, 297, -531, 304, -531, 830, 684, + -531, -531, -531, -531, -531, 437, 309, 384, 684, 441, + 443, -531, 684, 684, -531, -531 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { - -472, -472, -472, 311, 312, 313, 315, 317, -129, -127, - -471, -472, 370, 392, -120, -472, -237, 50, -472, -253, - -472, -49, -472, -37, -472, -67, 301, -472, -110, 220, - -263, 64, -472, -472, -472, -472, -472, -472, -472, 373, - -472, -472, -472, -472, 2, -472, 70, -472, -472, 374, - -472, -472, -472, -472, -472, 441, -472, -472, -418, 34, - 31, -115, -472, 426, -472, -472, -472, -472, -472, 63, - 3, -472, -472, 38, -472, -472 + -531, -531, -531, 368, 369, 370, 371, 373, 90, 94, + -129, -128, -530, -531, 428, 449, -112, -531, -268, 67, + -531, -231, -531, -50, -531, -37, -531, -65, 354, -531, + -94, 265, -290, 46, -531, -531, -531, -531, -531, -531, + -531, 427, -531, -531, -531, -531, 3, -531, 73, -531, + -531, 421, -531, -531, -531, -531, -531, 480, -531, -531, + -515, -203, 69, -117, -531, 465, -531, -531, -531, -531, + -531, 64, 2, -531, -531, 42, -531, -531 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -145 +#define YYTABLE_NINF -171 static const short int yytable[] = { - 89, 239, 215, 240, 106, 26, 94, 327, 382, 384, - 225, 242, 39, 228, 349, 350, 89, 404, 119, 42, - 508, 229, 359, 361, 4, 231, 232, 233, 234, 235, - 236, 237, 238, 230, 46, 47, 48, 218, 518, 245, - 405, 413, 368, 26, 262, 263, 413, 219, 29, 415, - 383, 383, 378, 49, 249, 119, 416, -82, 250, 251, - 252, 253, 254, 255, 264, 261, 123, 259, 260, 39, - 265, 53, 197, 198, 199, 231, 232, 233, 234, 235, - 236, 237, 238, 370, 51, 59, 123, 60, 224, 121, - 516, 224, 7, 8, 9, 10, 54, 12, 55, 413, - 524, 56, 413, 20, 369, 21, 52, 427, 414, 123, - 107, 108, 95, 190, 191, 243, 244, 224, 246, 110, - 111, 112, 269, 270, 58, 43, -42, -42, -41, -41, - 62, 247, 224, -40, -40, 64, 224, 224, 224, 224, - 224, 224, 256, 257, 258, 224, 224, 507, 345, 296, - 297, 298, -39, -39, 448, 99, 65, 66, 100, 117, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 20, 101, 21, 30, 31, 32, 33, - 34, 35, 36, 300, 271, 272, 102, 103, 221, 114, - -83, 115, 116, 323, 468, 122, 469, 517, 189, 81, - 193, 194, 195, 216, 217, 89, 226, 220, -46, -45, - -44, -43, 343, 274, 304, -49, 389, -50, 391, 392, - 393, 275, 305, 324, 89, 344, 224, 400, 231, 232, - 233, 234, 235, 236, 237, 238, 326, 298, 329, 330, - 331, 408, 409, 410, 411, 412, 332, 333, 294, 341, - 334, 346, 335, 417, 418, 419, 420, 421, 318, 336, - 320, 321, 337, 318, 318, 342, 347, 362, 388, 351, - 352, 353, 322, 354, 355, 318, 363, 328, 82, 373, - 318, 83, 364, 365, 84, 366, 85, 338, 339, 340, - 318, 318, 318, 367, 224, 390, 224, 224, 224, 394, - 395, 374, 371, 454, 399, 224, 379, 376, 380, 385, - 396, 404, 397, 426, 428, 398, 403, 429, 432, 430, - 436, 438, 446, 473, 474, 475, 439, 440, 447, 450, - 444, 458, 460, 488, 489, 383, 300, 451, 452, 506, - 479, 480, 481, 482, 478, 483, 484, 485, 224, 487, - 453, 455, 456, 491, 381, 493, 457, 318, 459, 462, - 387, 467, 239, 318, 240, 470, 445, 472, 490, 492, - 494, 497, 499, 510, 401, 402, 496, 318, 318, 498, - 239, 500, 240, 501, 511, 502, 503, 512, 504, 513, - 514, 505, 519, 224, 520, -144, 521, 522, 523, 526, - 527, 224, 224, 224, 528, 530, 531, 224, 179, 180, - 181, 97, 182, 431, 183, 433, 318, 57, 318, 437, - 5, 486, 318, 222, 424, 105, 6, 441, 442, 443, - 318, 318, 318, 224, 293, 113, 7, 8, 9, 10, - 11, 12, 13, 423, 27, 45, 449, 476, 435, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 463, - 464, 0, 318, 318, 0, 0, 0, 471, 0, 0, - 318, 0, 0, 0, 0, 0, 477, 0, 0, 318, + 89, 241, 242, 106, 359, 94, 26, 556, 227, 231, + 39, 230, 220, 324, 418, 440, 89, 42, 217, 244, + 119, 232, 221, 348, 420, 393, 395, 568, 348, 348, + 233, 234, 235, 236, 237, 238, 239, 240, 441, 273, + 348, 566, 107, 108, 26, 233, 234, 235, 236, 237, + 238, 239, 240, 576, 277, 412, 419, 119, 278, 279, + 280, 281, 282, 283, 381, 382, 419, 287, 288, 451, + 39, 348, 199, 200, 201, 289, 46, 47, 48, 454, + 292, 348, 348, 348, -106, -76, 293, 20, 226, 21, + 121, 226, 451, 123, 402, 49, 6, -76, -76, 403, + 453, 110, 111, 112, 123, 451, -76, -76, -76, -76, + -76, -76, -76, 465, 4, -76, 22, 271, 272, 226, + 274, 404, 451, 23, 123, 192, 193, 24, 452, 59, + 20, 60, 21, 275, 226, 29, 51, 95, 226, 226, + 226, 226, 226, 226, 284, 285, 286, 226, 226, 43, + 348, 348, 348, 326, 327, 328, 290, 291, 348, 52, + 297, 298, -66, -66, 58, 53, -65, -65, -64, -64, + -63, -63, 348, 348, 377, 299, 300, 62, 555, 64, + 99, 100, 103, 101, 102, 330, 7, 8, 9, 10, + 54, 12, 55, 567, 353, 56, 30, 31, 32, 33, + 34, 35, 36, 512, -107, 513, 114, 89, 115, 116, + 122, 191, 488, 195, 196, 348, 197, 348, 354, 218, + 219, 348, 222, 228, -70, -69, -68, -67, 302, 348, + 348, 348, -73, 355, -170, -74, 303, 334, 335, 375, + 356, 358, 361, 362, 363, 364, 425, 365, 427, 428, + 429, 366, 89, 376, 226, 367, 368, 436, 369, 5, + 378, 374, 373, 348, 348, 6, 348, 348, 379, 328, + 396, 383, 384, 348, 385, 7, 8, 9, 10, 11, + 12, 13, 348, 233, 234, 235, 236, 237, 238, 239, + 240, 446, 447, 448, 449, 450, 14, 386, 387, 407, + 350, 351, 388, 455, 456, 457, 458, 459, 389, 397, + 398, 399, 352, 348, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 400, 401, 226, 426, 226, 226, + 226, 430, 431, 405, 408, 410, 435, 226, 413, 424, + 414, 421, 440, 360, 464, 432, 433, 434, 439, 466, + 467, 348, 468, 370, 371, 372, 472, 496, 469, 470, + 476, 517, 518, 519, 478, 479, 348, 480, 484, 486, + 330, 487, 500, 502, 524, 348, 534, 535, 419, 348, + 348, 554, 489, 490, 226, 492, 558, 493, 537, 494, + 495, 497, 498, 499, 501, 522, 523, 539, 525, 526, + 527, 528, 485, 529, 530, 531, 504, 533, 241, 242, + 511, 514, 516, 536, 540, 559, 543, 538, 542, 544, + 545, 546, 415, 416, 417, 549, 547, 548, 241, 242, + 423, 226, 550, 551, 552, 553, 569, 570, 65, 66, + 571, 226, 226, 226, 437, 438, 572, 226, 573, 560, + 561, 562, 574, 563, 564, 20, 575, 21, 578, 304, + 580, 579, 582, 532, 583, 181, 182, 183, 184, 97, + 185, 305, 306, 444, 57, 462, 224, 226, 445, 105, + 461, 323, 113, 27, 45, 475, 520, 471, 491, 473, + 0, 0, 0, 477, 0, 0, 0, 0, 0, 0, + 0, 481, 482, 483, 0, 0, 0, 0, 0, 0, + 0, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 307, + 308, 0, 0, 0, 0, 505, 506, 0, 509, 510, + 0, 0, 0, 0, 0, 515, 0, 0, 0, 0, + 0, 0, 0, 0, 521, 0, 0, 0, 0, 0, + 309, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 0, 310, 172, 173, 174, 0, 311, + 312, 313, 0, 0, 0, 541, 0, 0, 0, 314, + 0, 0, 315, 0, 316, 0, 0, 317, 65, 66, + 0, 117, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 20, 0, 21, 0, 0, + 0, 0, 0, 565, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 577, 0, + 0, 81, 0, 0, 0, 0, 0, 581, 0, 0, + 0, 584, 585, 65, 66, 0, 117, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 79, 80, + 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 336, 337, 65, + 66, 338, 0, 0, 0, 0, 81, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, + 339, 340, 341, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 65, 66, 0, 0, 0, 0, 0, - 0, 0, 0, 495, 0, 0, 318, 0, 0, 0, - 20, 0, 21, 0, 276, 0, 0, 0, 0, 0, - 0, -52, 0, 20, 0, 21, 277, 278, 0, 0, - 0, 0, 6, -52, -52, 0, 0, 515, 0, 0, - 318, 0, -52, -52, -52, -52, -52, -52, -52, 0, - 525, -52, 22, 318, 0, 0, 0, 529, 0, 23, - 318, 532, 533, 24, 318, 318, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 0, 0, 0, 0, 0, 279, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 0, 280, 170, 171, 172, 0, 281, 282, - 283, 0, 0, 0, 0, 0, 0, 0, 284, 0, - 0, 285, 0, 286, 65, 66, 287, 117, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 20, 0, 21, 65, 66, 0, 117, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 79, - 80, 20, 0, 21, 0, 0, 0, 81, 0, 0, + 0, 0, 0, 0, 0, 344, 82, 0, 0, 83, + 0, 0, 84, 0, 85, 118, 0, 0, 0, 0, + 0, 0, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 307, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, + 0, 82, 0, 0, 83, 0, 0, 84, 0, 85, + 394, 309, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 0, 310, 172, 173, 174, 0, + 311, 312, 313, 336, 337, 0, 0, 338, 0, 0, + 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 339, 340, 341, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 306, 307, 65, 66, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 21, 0, 309, 310, 311, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 312, 313, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, - 0, 0, 84, 0, 85, 118, 0, 0, 0, 314, - 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, - 0, 0, 84, 0, 85, 360, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 0, 0, 0, 0, 0, 279, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 0, 280, 170, 171, 172, 0, 281, 282, - 283, 306, 307, 0, 0, 308, 0, 0, 0, 0, - 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 309, 310, 311, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 312, 313, 0, 0, + 0, 344, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 307, 308, 0, 0, + 0, 0, 65, 66, 0, 117, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 79, 80, 20, + 0, 21, 0, 0, 0, 0, 0, 309, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 0, 310, 172, 173, 174, 81, 311, 312, 313, 0, + 0, 0, 0, 0, 0, 0, 0, 65, 66, 345, + 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 20, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, + 0, 0, 0, 0, 0, 0, 0, 0, 65, 66, + 81, 117, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 0, 0, 0, 0, 0, 279, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 0, 280, 170, 171, 172, 0, 281, 282, - 283, 0, 0, 0, 0, 0, 0, 0, 0, 65, - 66, 315, 117, 68, 69, 70, 71, 72, 73, 74, + 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, + 82, 0, 0, 83, 0, 390, 84, 0, 85, 65, + 66, 0, 117, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 299, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 66, 81, 117, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 79, 80, 20, 0, 21, - 65, 66, 0, 117, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 20, 0, 21, - 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, - 0, 0, 375, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 66, 81, 117, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 20, 0, - 21, 82, 0, 0, 83, 0, 0, 84, 0, 85, - 0, 0, 0, 422, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 0, 0, 83, 0, 356, 84, 0, - 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 0, 0, 83, 0, 0, 84, 0, - 85, 65, 66, 0, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 20, 0, - 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 82, 0, 0, 83, 0, 0, 84, - 0, 85, 65, 66, 81, 117, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 20, - 0, 21, 65, 66, 0, 117, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 79, 80, 20, - 0, 21, 0, 0, 0, 81, 0, 65, 66, 0, - 227, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 20, 81, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 82, 0, 0, 83, 0, 0, 84, - 81, 85, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 409, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, + 0, 84, 0, 85, 0, 65, 66, 0, 117, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 20, 0, 21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 82, 460, 0, 83, + 0, 0, 84, 0, 85, 0, 65, 66, 81, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 20, 0, 21, 65, 66, 0, 117, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 20, 0, 21, 0, 0, 0, 81, + 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, + 83, 0, 0, 84, 0, 85, 0, 65, 66, 81, + 117, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 79, 80, 20, 0, 21, 65, 66, 0, + 229, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 20, 0, 21, 0, 0, 0, + 81, 0, 0, 82, 0, 0, 83, 0, 0, 84, + 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, + 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, 0, 0, 84, 0, 85, 0, 0, 0, 0, 0, 0, 0, - 0, 124, 0, 0, 82, 0, 0, 83, 0, 0, - 84, 0, 85, 0, 0, 125, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 126, 127, 0, 0, 82, - 0, 0, 83, 0, 0, 84, 0, 85, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 0, 0, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178 + 0, 0, 0, 0, 82, 0, 0, 83, 0, 0, + 84, 0, 85, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, + 0, 0, 0, 0, 0, 82, 0, 0, 83, 0, + 0, 84, 125, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 126, 127, 0, 82, 0, 0, 83, 0, + 0, 84, 0, 85, 0, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 154, 155, 156, 0, 0, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180 }; static const short int yycheck[] = { - 37, 130, 112, 130, 53, 3, 29, 244, 15, 15, - 125, 131, 23, 128, 267, 268, 53, 34, 85, 30, - 491, 9, 285, 286, 0, 10, 11, 12, 13, 14, - 15, 16, 17, 21, 52, 53, 54, 126, 509, 154, - 57, 126, 295, 41, 99, 100, 126, 136, 61, 134, - 57, 57, 315, 71, 169, 122, 136, 128, 173, 174, - 175, 176, 177, 178, 126, 185, 137, 182, 183, 23, - 132, 20, 109, 110, 111, 10, 11, 12, 13, 14, - 15, 16, 17, 134, 125, 45, 137, 47, 125, 87, - 508, 128, 41, 42, 43, 44, 45, 46, 47, 126, - 518, 50, 126, 22, 132, 24, 61, 134, 132, 137, - 32, 33, 135, 55, 56, 152, 153, 154, 155, 55, - 56, 57, 27, 28, 125, 136, 3, 4, 3, 4, - 24, 168, 169, 3, 4, 4, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 132, 263, 216, - 217, 218, 3, 4, 407, 125, 5, 6, 125, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 125, 24, 64, 65, 66, 67, - 68, 69, 70, 220, 3, 4, 125, 130, 37, 4, - 128, 4, 4, 242, 431, 128, 433, 132, 24, 48, - 4, 24, 24, 131, 131, 242, 59, 128, 4, 4, - 4, 4, 261, 4, 126, 7, 331, 7, 333, 334, - 335, 7, 129, 126, 261, 262, 263, 342, 10, 11, - 12, 13, 14, 15, 16, 17, 126, 304, 130, 126, - 126, 351, 352, 353, 354, 355, 126, 126, 214, 36, - 126, 24, 126, 363, 364, 365, 366, 367, 224, 126, - 229, 230, 126, 229, 230, 126, 126, 24, 130, 128, - 128, 128, 241, 128, 128, 241, 128, 246, 127, 126, - 246, 130, 128, 128, 133, 128, 135, 256, 257, 258, - 256, 257, 258, 128, 331, 332, 333, 334, 335, 336, - 337, 129, 300, 413, 341, 342, 126, 63, 126, 126, - 126, 34, 126, 24, 21, 126, 126, 21, 4, 128, - 126, 126, 24, 438, 439, 440, 126, 126, 4, 126, - 128, 36, 57, 4, 24, 57, 373, 126, 126, 21, - 450, 451, 452, 453, 129, 455, 456, 457, 385, 459, - 126, 126, 126, 130, 323, 470, 126, 323, 126, 126, - 329, 126, 491, 329, 491, 126, 403, 126, 126, 129, - 132, 126, 126, 36, 343, 344, 129, 343, 344, 129, - 509, 126, 509, 129, 132, 129, 129, 497, 129, 499, - 500, 129, 21, 430, 129, 0, 129, 129, 126, 21, - 126, 438, 439, 440, 76, 21, 21, 444, 97, 97, - 97, 41, 97, 382, 97, 384, 382, 25, 384, 388, - 25, 458, 388, 122, 374, 52, 31, 396, 397, 398, - 396, 397, 398, 470, 214, 61, 41, 42, 43, 44, - 45, 46, 47, 373, 3, 19, 408, 444, 385, -1, - -1, -1, -1, -1, -1, -1, -1, 62, -1, 428, - 429, -1, 428, 429, -1, -1, -1, 436, -1, -1, - 436, -1, -1, -1, -1, -1, 445, -1, -1, 445, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 5, 6, -1, -1, -1, -1, -1, - -1, -1, -1, 472, -1, -1, 472, -1, -1, -1, - 22, -1, 24, -1, 26, -1, -1, -1, -1, -1, - -1, 20, -1, 22, -1, 24, 38, 39, -1, -1, - -1, -1, 31, 32, 33, -1, -1, 506, -1, -1, - 506, -1, 41, 42, 43, 44, 45, 46, 47, -1, - 519, 50, 51, 519, -1, -1, -1, 526, -1, 58, - 526, 530, 531, 62, 530, 531, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, -1, -1, -1, -1, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, -1, 115, 116, 117, 118, -1, 120, 121, - 122, -1, -1, -1, -1, -1, -1, -1, 130, -1, - -1, 133, -1, 135, 5, 6, 138, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, + 37, 130, 130, 53, 272, 29, 3, 537, 125, 9, + 23, 128, 152, 216, 15, 34, 53, 30, 112, 131, + 85, 21, 162, 226, 15, 315, 316, 557, 231, 232, + 10, 11, 12, 13, 14, 15, 16, 17, 57, 156, + 243, 556, 32, 33, 41, 10, 11, 12, 13, 14, + 15, 16, 17, 568, 171, 345, 57, 122, 175, 176, + 177, 178, 179, 180, 295, 296, 57, 184, 185, 152, + 23, 274, 109, 110, 111, 187, 52, 53, 54, 162, + 152, 284, 285, 286, 154, 20, 158, 22, 125, 24, + 87, 128, 152, 163, 325, 71, 31, 32, 33, 158, + 160, 55, 56, 57, 163, 152, 41, 42, 43, 44, + 45, 46, 47, 160, 0, 50, 51, 154, 155, 156, + 157, 160, 152, 58, 163, 55, 56, 62, 158, 45, + 22, 47, 24, 170, 171, 61, 151, 161, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 162, + 353, 354, 355, 218, 219, 220, 125, 126, 361, 61, + 27, 28, 3, 4, 151, 20, 3, 4, 3, 4, + 3, 4, 375, 376, 291, 3, 4, 24, 158, 4, + 151, 151, 156, 151, 151, 222, 41, 42, 43, 44, + 45, 46, 47, 158, 244, 50, 64, 65, 66, 67, + 68, 69, 70, 471, 154, 473, 4, 244, 4, 4, + 154, 24, 443, 4, 24, 418, 24, 420, 255, 157, + 157, 424, 154, 59, 4, 4, 4, 4, 4, 432, + 433, 434, 7, 270, 0, 7, 7, 152, 155, 289, + 152, 152, 156, 152, 152, 152, 363, 152, 365, 366, + 367, 152, 289, 290, 291, 152, 152, 374, 152, 25, + 24, 152, 36, 466, 467, 31, 469, 470, 152, 334, + 24, 154, 154, 476, 154, 41, 42, 43, 44, 45, + 46, 47, 485, 10, 11, 12, 13, 14, 15, 16, + 17, 385, 386, 387, 388, 389, 62, 154, 154, 152, + 231, 232, 154, 397, 398, 399, 400, 401, 154, 154, + 154, 154, 243, 516, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 154, 154, 363, 364, 365, 366, + 367, 368, 369, 330, 155, 63, 373, 374, 152, 156, + 152, 152, 34, 274, 24, 152, 152, 152, 152, 21, + 21, 554, 154, 284, 285, 286, 4, 451, 152, 152, + 152, 478, 479, 480, 152, 152, 569, 152, 154, 24, + 407, 4, 36, 57, 155, 578, 4, 24, 57, 582, + 583, 21, 152, 152, 421, 152, 36, 152, 156, 152, + 152, 152, 152, 152, 152, 489, 490, 514, 492, 493, + 494, 495, 439, 497, 498, 499, 152, 501, 537, 537, + 152, 152, 152, 152, 158, 158, 152, 155, 155, 152, + 152, 155, 353, 354, 355, 155, 152, 152, 557, 557, + 361, 468, 155, 155, 155, 155, 21, 155, 5, 6, + 155, 478, 479, 480, 375, 376, 155, 484, 155, 543, + 544, 545, 155, 547, 548, 22, 152, 24, 21, 26, + 76, 152, 21, 500, 21, 97, 97, 97, 97, 41, + 97, 38, 39, 383, 25, 408, 122, 514, 384, 52, + 407, 216, 61, 3, 19, 421, 484, 418, 446, 420, + -1, -1, -1, 424, -1, -1, -1, -1, -1, -1, + -1, 432, 433, 434, -1, -1, -1, -1, -1, -1, + -1, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, -1, -1, -1, -1, 466, 467, -1, 469, 470, + -1, -1, -1, -1, -1, 476, -1, -1, -1, -1, + -1, -1, -1, -1, 485, -1, -1, -1, -1, -1, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, -1, 141, 142, 143, 144, -1, 146, + 147, 148, -1, -1, -1, 516, -1, -1, -1, 156, + -1, -1, 159, -1, 161, -1, -1, 164, 5, 6, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, + -1, -1, -1, 554, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 569, -1, + -1, 48, -1, -1, -1, -1, -1, 578, -1, -1, + -1, 582, 583, 5, 6, -1, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, + 6, 7, -1, -1, -1, -1, 48, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 22, -1, 24, -1, + 26, 27, 28, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, + -1, -1, -1, -1, -1, 61, 153, -1, -1, 156, + -1, -1, 159, -1, 161, 162, -1, -1, -1, -1, + -1, -1, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, + -1, 153, -1, -1, 156, -1, -1, 159, -1, 161, + 162, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, -1, 141, 142, 143, 144, -1, + 146, 147, 148, 3, 4, -1, -1, 7, -1, -1, + -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 26, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, 24, -1, 26, 27, 28, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 38, 39, -1, -1, - -1, -1, -1, -1, -1, -1, 127, -1, -1, 130, - -1, -1, 133, -1, 135, 136, -1, -1, -1, 61, - -1, -1, -1, -1, -1, -1, 127, -1, -1, 130, - -1, -1, 133, -1, 135, 136, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, -1, -1, -1, -1, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, -1, 115, 116, 117, 118, -1, 120, 121, - 122, 3, 4, -1, -1, 7, -1, -1, -1, -1, - -1, 133, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 26, 27, 28, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, + -1, -1, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + -1, 24, -1, -1, -1, -1, -1, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + -1, 141, 142, 143, 144, 48, 146, 147, 148, -1, + -1, -1, -1, -1, -1, -1, -1, 5, 6, 159, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, -1, 5, 6, + 48, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, -1, -1, -1, -1, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, -1, 115, 116, 117, 118, -1, 120, 121, - 122, -1, -1, -1, -1, -1, -1, -1, -1, 5, - 6, 133, 8, 9, 10, 11, 12, 13, 14, 15, + 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, + 153, -1, -1, 156, -1, 158, 159, -1, 161, 5, + 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, - 5, 6, 48, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, - -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, - -1, 5, 6, 48, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, 127, -1, -1, 130, -1, -1, 133, -1, 135, - -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 127, -1, -1, 130, -1, 132, 133, -1, - 135, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 127, -1, -1, 130, -1, -1, 133, -1, - 135, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 127, -1, -1, 130, -1, -1, 133, - -1, 135, 5, 6, 48, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, 24, 5, 6, -1, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, 24, -1, -1, -1, 48, -1, 5, 6, -1, + -1, -1, 48, -1, -1, 153, -1, -1, 156, -1, + -1, 159, -1, 161, -1, 5, 6, -1, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 153, 37, -1, 156, + -1, -1, 159, -1, 161, -1, 5, 6, 48, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, 24, 5, 6, -1, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, 24, -1, -1, -1, 48, + -1, -1, -1, -1, -1, -1, -1, 153, -1, -1, + 156, -1, -1, 159, -1, 161, -1, 5, 6, 48, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 48, 24, -1, -1, -1, + 18, 19, 20, 21, 22, -1, 24, 5, 6, -1, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, + 48, -1, -1, 153, -1, -1, 156, -1, -1, 159, + -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, + 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 127, -1, -1, 130, -1, -1, 133, - 48, 135, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 153, -1, -1, 156, -1, -1, + 159, -1, 161, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 153, -1, -1, 156, -1, -1, + 159, -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, + -1, -1, -1, -1, -1, 153, -1, -1, 156, -1, + -1, 159, 49, 161, -1, -1, -1, -1, -1, -1, + -1, -1, 59, 60, -1, 153, -1, -1, 156, -1, + -1, 159, -1, 161, -1, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 127, -1, -1, 130, -1, -1, - 133, -1, 135, -1, -1, -1, -1, -1, -1, -1, - -1, 35, -1, -1, 127, -1, -1, 130, -1, -1, - 133, -1, 135, -1, -1, 49, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, 60, -1, -1, 127, - -1, -1, 130, -1, -1, 133, -1, 135, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, -1, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124 + -1, -1, -1, -1, -1, 122, 123, 124, -1, -1, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 171, 172, 173, 0, 25, 31, 41, 42, 43, - 44, 45, 46, 47, 62, 152, 190, 192, 194, 201, - 22, 24, 51, 58, 62, 151, 183, 194, 195, 61, - 64, 65, 66, 67, 68, 69, 70, 153, 188, 23, - 202, 203, 30, 136, 191, 202, 52, 53, 54, 71, - 180, 125, 61, 20, 45, 47, 50, 152, 125, 45, - 47, 193, 24, 178, 4, 5, 6, 8, 9, 10, + 0, 199, 200, 201, 0, 25, 31, 41, 42, 43, + 44, 45, 46, 47, 62, 180, 218, 220, 222, 229, + 22, 24, 51, 58, 62, 179, 211, 222, 223, 61, + 64, 65, 66, 67, 68, 69, 70, 181, 216, 23, + 230, 231, 30, 162, 219, 230, 52, 53, 54, 71, + 208, 151, 61, 20, 45, 47, 50, 180, 151, 45, + 47, 221, 24, 206, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 48, 127, 130, 133, 135, 140, 160, 161, 162, - 163, 164, 183, 198, 29, 135, 189, 151, 206, 125, - 125, 125, 125, 130, 181, 178, 160, 32, 33, 170, - 170, 170, 170, 188, 4, 4, 4, 8, 136, 164, - 165, 183, 128, 137, 35, 49, 59, 60, 72, 73, + 21, 48, 153, 156, 159, 161, 166, 188, 189, 190, + 191, 192, 211, 226, 29, 161, 217, 179, 234, 151, + 151, 151, 151, 156, 209, 206, 188, 32, 33, 198, + 198, 198, 198, 216, 4, 4, 4, 8, 162, 192, + 193, 211, 154, 163, 35, 49, 59, 60, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 142, - 143, 144, 145, 146, 204, 210, 211, 213, 214, 24, - 55, 56, 179, 4, 24, 24, 182, 162, 162, 162, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 147, 148, 150, 162, 167, 131, 131, 126, 136, - 128, 37, 165, 166, 162, 200, 59, 8, 200, 9, - 21, 10, 11, 12, 13, 14, 15, 16, 17, 147, - 148, 149, 153, 162, 162, 200, 162, 162, 207, 200, - 200, 200, 200, 200, 200, 200, 162, 162, 162, 200, - 200, 153, 99, 100, 126, 132, 176, 177, 175, 27, - 28, 3, 4, 141, 4, 7, 26, 38, 39, 101, - 115, 120, 121, 122, 130, 133, 135, 138, 142, 143, - 144, 145, 146, 168, 198, 174, 164, 164, 164, 37, - 162, 185, 186, 187, 126, 129, 3, 4, 7, 26, - 27, 28, 38, 39, 61, 133, 168, 197, 198, 199, - 199, 199, 199, 160, 126, 155, 126, 155, 199, 130, - 126, 126, 126, 126, 126, 126, 126, 126, 199, 199, - 199, 36, 126, 160, 162, 200, 24, 126, 158, 158, - 158, 128, 128, 128, 128, 128, 132, 167, 169, 169, - 136, 169, 24, 128, 128, 128, 128, 128, 158, 132, - 134, 183, 184, 126, 129, 37, 63, 196, 169, 126, - 126, 199, 15, 57, 15, 126, 212, 199, 130, 200, - 162, 200, 200, 200, 162, 162, 126, 126, 126, 162, - 200, 199, 199, 126, 34, 57, 156, 159, 167, 167, - 167, 167, 167, 126, 132, 134, 136, 167, 167, 167, - 167, 167, 37, 185, 156, 157, 24, 134, 21, 21, - 128, 199, 4, 199, 200, 208, 126, 199, 126, 126, - 126, 199, 199, 199, 128, 162, 24, 4, 158, 212, - 126, 126, 126, 126, 167, 126, 126, 126, 36, 126, - 57, 154, 126, 199, 199, 208, 209, 126, 155, 155, - 126, 199, 126, 200, 200, 200, 209, 199, 129, 167, - 167, 167, 167, 167, 167, 167, 162, 167, 4, 24, - 126, 130, 129, 200, 132, 199, 129, 126, 129, 126, - 126, 129, 129, 129, 129, 129, 21, 132, 149, 205, - 36, 132, 167, 167, 167, 199, 197, 132, 149, 21, - 129, 129, 129, 126, 197, 199, 21, 126, 76, 199, - 21, 21, 199, 199 + 94, 95, 96, 97, 122, 123, 124, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 168, 169, 170, 171, 172, 232, 238, 239, 241, + 242, 24, 55, 56, 207, 4, 24, 24, 210, 190, + 190, 190, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 175, 176, 178, 190, 195, 157, 157, + 152, 162, 154, 37, 193, 194, 190, 228, 59, 8, + 228, 9, 21, 10, 11, 12, 13, 14, 15, 16, + 17, 175, 176, 177, 181, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 173, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 174, 190, 190, 228, 190, 190, 235, 228, 228, 228, + 228, 228, 228, 228, 190, 190, 190, 228, 228, 181, + 125, 126, 152, 158, 204, 205, 203, 27, 28, 3, + 4, 167, 4, 7, 26, 38, 39, 96, 97, 127, + 141, 146, 147, 148, 156, 159, 161, 164, 168, 169, + 170, 171, 172, 196, 226, 202, 192, 192, 192, 37, + 190, 213, 214, 215, 152, 155, 3, 4, 7, 26, + 27, 28, 38, 39, 61, 159, 196, 225, 226, 227, + 227, 227, 227, 188, 190, 190, 152, 183, 152, 183, + 227, 156, 152, 152, 152, 152, 152, 152, 152, 152, + 227, 227, 227, 36, 152, 188, 190, 228, 24, 152, + 186, 186, 186, 154, 154, 154, 154, 154, 154, 154, + 158, 195, 197, 197, 162, 197, 24, 154, 154, 154, + 154, 154, 186, 158, 160, 211, 212, 152, 155, 37, + 63, 224, 197, 152, 152, 227, 227, 227, 15, 57, + 15, 152, 240, 227, 156, 228, 190, 228, 228, 228, + 190, 190, 152, 152, 152, 190, 228, 227, 227, 152, + 34, 57, 184, 187, 173, 174, 195, 195, 195, 195, + 195, 152, 158, 160, 162, 195, 195, 195, 195, 195, + 37, 213, 184, 185, 24, 160, 21, 21, 154, 152, + 152, 227, 4, 227, 228, 236, 152, 227, 152, 152, + 152, 227, 227, 227, 154, 190, 24, 4, 186, 152, + 152, 240, 152, 152, 152, 152, 195, 152, 152, 152, + 36, 152, 57, 182, 152, 227, 227, 236, 237, 227, + 227, 152, 183, 183, 152, 227, 152, 228, 228, 228, + 237, 227, 195, 195, 155, 195, 195, 195, 195, 195, + 195, 195, 190, 195, 4, 24, 152, 156, 155, 228, + 158, 227, 155, 152, 152, 152, 155, 152, 152, 155, + 155, 155, 155, 155, 21, 158, 177, 233, 36, 158, + 195, 195, 195, 195, 195, 227, 225, 158, 177, 21, + 155, 155, 155, 155, 155, 152, 225, 227, 21, 152, + 76, 227, 21, 21, 227, 227 }; #define yyerrok (yyerrstatus = 0) @@ -3084,7 +3133,7 @@ yyreduce: switch (yyn) { case 3: -#line 1165 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1106 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -3094,7 +3143,7 @@ yyreduce: break; case 5: -#line 1174 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1115 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -3103,99 +3152,99 @@ yyreduce: ;} break; - case 51: -#line 1199 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 75: +#line 1143 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR ;} break; - case 52: -#line 1203 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 76: +#line 1147 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR ;} break; - case 53: -#line 1208 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 77: +#line 1152 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; - case 54: -#line 1209 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 78: +#line 1153 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; - case 55: -#line 1210 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 79: +#line 1154 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; - case 56: -#line 1211 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 80: +#line 1155 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; - case 57: -#line 1212 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 81: +#line 1156 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; - case 58: -#line 1213 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 82: +#line 1157 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; - case 59: -#line 1214 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 83: +#line 1158 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; - case 60: -#line 1215 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 84: +#line 1159 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; - case 61: -#line 1217 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 85: +#line 1161 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; - case 62: -#line 1218 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 86: +#line 1162 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; - case 63: -#line 1219 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 87: +#line 1163 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::CSRet; ;} break; - case 64: -#line 1220 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 88: +#line 1164 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; - case 65: -#line 1221 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 89: +#line 1165 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; - case 66: -#line 1222 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 90: +#line 1166 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; - case 67: -#line 1223 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 91: +#line 1167 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; - case 68: -#line 1224 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 92: +#line 1168 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large!"); @@ -3204,13 +3253,13 @@ yyreduce: ;} break; - case 69: -#line 1233 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 93: +#line 1177 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 70: -#line 1234 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 94: +#line 1178 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3219,13 +3268,13 @@ yyreduce: ;} break; - case 71: -#line 1240 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 95: +#line 1184 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 72: -#line 1241 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 96: +#line 1185 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3234,8 +3283,8 @@ yyreduce: ;} break; - case 73: -#line 1249 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 97: +#line 1193 "/proj/llvm/llvm-4/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] == '\\') @@ -3245,28 +3294,28 @@ yyreduce: ;} break; - case 74: -#line 1257 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 98: +#line 1201 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; - case 75: -#line 1258 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 99: +#line 1202 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; - case 76: -#line 1263 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 100: +#line 1207 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" {;} break; - case 77: -#line 1264 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 101: +#line 1208 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" {;} break; - case 78: -#line 1265 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 102: +#line 1209 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3274,8 +3323,8 @@ yyreduce: ;} break; - case 79: -#line 1270 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 103: +#line 1214 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two!"); @@ -3284,209 +3333,186 @@ yyreduce: ;} break; - case 81: -#line 1284 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal).type = new PATypeHolder((yyvsp[0].TypeVal).type->get()); - (yyval.TypeVal).signedness = (yyvsp[0].TypeVal).signedness; -;} + case 105: +#line 1228 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} break; - case 83: -#line 1288 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal).type = new PATypeHolder((yyvsp[0].TypeVal).type->get()); - (yyval.TypeVal).signedness = (yyvsp[0].TypeVal).signedness; -;} + case 107: +#line 1229 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} break; - case 84: -#line 1293 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 108: +#line 1231 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + - ((yyvsp[0].TypeVal).type->get())->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); (yyval.TypeVal) = (yyvsp[0].TypeVal); CHECK_FOR_ERROR -;} + ;} break; - case 98: -#line 1306 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 122: +#line 1243 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeVal).type = new PATypeHolder(OpaqueType::get()); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR ;} break; - case 99: -#line 1311 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 123: +#line 1247 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeVal) = (yyvsp[0].TypeVal); + (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR ;} break; - case 100: -#line 1315 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 124: +#line 1251 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.TypeVal).type = new PATypeHolder(tmp); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(tmp); ;} break; - case 101: -#line 1324 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 125: +#line 1259 "/proj/llvm/llvm-4/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 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal).type = new PATypeHolder(OT); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR ;} break; - case 102: -#line 1333 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 126: +#line 1267 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Function derived type? std::vector<const Type*> Params; - for (std::list<TypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(), + for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(), E = (yyvsp[-1].TypeList)->end(); I != E; ++I) - Params.push_back(I->type->get()); + Params.push_back(*I); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs( - FunctionType::get((yyvsp[-3].TypeVal).type->get(),Params,isVarArg))); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FunctionType::get(*(yyvsp[-3].TypeVal),Params,isVarArg))); delete (yyvsp[-1].TypeList); // Delete the argument list - delete (yyvsp[-3].TypeVal).type; + delete (yyvsp[-3].TypeVal); // Delete the return type handle CHECK_FOR_ERROR ;} break; - case 103: -#line 1348 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 127: +#line 1280 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Sized array type? - (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs( - ArrayType::get((yyvsp[-1].TypeVal).type->get(), (unsigned)(yyvsp[-3].UInt64Val)))); - (yyval.TypeVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 104: -#line 1355 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 128: +#line 1285 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).type->get(); - if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) - GEN_ERROR("Unsigned result not equal to signed result"); - if (!ElemTy->isPrimitiveType()) - GEN_ERROR("Elemental type of a PackedType must be primitive"); - if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) - GEN_ERROR("Vector length should be a power of 2!"); - (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs( - PackedType::get((yyvsp[-1].TypeVal).type->get(), (unsigned)(yyvsp[-3].UInt64Val)))); - (yyval.TypeVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; - CHECK_FOR_ERROR + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); + if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + GEN_ERROR("Unsigned result not equal to signed result"); + if (!ElemTy->isPrimitiveType()) + GEN_ERROR("Elemental type of a PackedType must be primitive"); + if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + GEN_ERROR("Vector length should be a power of 2!"); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR ;} break; - case 105: -#line 1369 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 129: +#line 1297 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector<const Type*> Elements; - for (std::list<TypeInfo>::iterator I = (yyvsp[-1].TypeList)->begin(), + for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[-1].TypeList)->begin(), E = (yyvsp[-1].TypeList)->end(); I != E; ++I) - Elements.push_back((*I).type->get()); + Elements.push_back(*I); - (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete (yyvsp[-1].TypeList); CHECK_FOR_ERROR ;} break; - case 106: -#line 1380 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 130: +#line 1307 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? - (yyval.TypeVal).type = new PATypeHolder(StructType::get(std::vector<const Type*>())); - (yyval.TypeVal).signedness = isSignless; + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>())); CHECK_FOR_ERROR ;} break; - case 107: -#line 1385 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 131: +#line 1311 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Pointer type? - if ((yyvsp[-1].TypeVal).type->get() == Type::LabelTy) + if (*(yyvsp[-1].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal).type = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[-1].TypeVal).type->get()))); - (yyval.TypeVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 108: -#line 1397 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 132: +#line 1322 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeList) = new std::list<TypeInfo>(); - (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); + (yyval.TypeList) = new std::list<PATypeHolder>(); + (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 109: -#line 1402 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 133: +#line 1327 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 111: -#line 1409 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 135: +#line 1334 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(TI); + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy); CHECK_FOR_ERROR ;} break; - case 112: -#line 1415 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 136: +#line 1338 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; - ((yyval.TypeList) = new std::list<TypeInfo>())->push_back(TI); + ((yyval.TypeList) = new std::list<PATypeHolder>())->push_back(Type::VoidTy); CHECK_FOR_ERROR ;} break; - case 113: -#line 1421 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 137: +#line 1342 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeList) = new std::list<TypeInfo>(); + (yyval.TypeList) = new std::list<PATypeHolder>(); CHECK_FOR_ERROR ;} break; - case 114: -#line 1432 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 138: +#line 1353 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal).type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-3].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ((yyvsp[-3].TypeVal).type->get())->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); @@ -3497,50 +3523,44 @@ yyreduce: itostr(NumElements) + "!"); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->getType()) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i].cnst->getType()->getDescription() + "'."); - } else { - elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); - } + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal).cnst = ConstantArray::get(ATy, elems); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; - case 115: -#line 1463 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 139: +#line 1379 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ((yyvsp[-2].TypeVal).type->get())->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); - (yyval.ConstVal).cnst = ConstantArray::get(ATy, std::vector<llvm::Constant*>()); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-2].TypeVal).type; + (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>()); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; - case 116: -#line 1478 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 140: +#line 1393 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal).type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[-2].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ((yyvsp[-2].TypeVal).type->get())->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); @@ -3562,20 +3582,19 @@ yyreduce: GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free((yyvsp[0].StrVal)); - (yyval.ConstVal).cnst = ConstantArray::get(ATy, Vals); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-2].TypeVal).type; + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; - case 117: -#line 1509 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 141: +#line 1423 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr - const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal).type->get()); + const PackedType *PTy = dyn_cast<PackedType>((yyvsp[-3].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (yyvsp[-3].TypeVal).type->get()->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); @@ -3586,99 +3605,88 @@ yyreduce: itostr(NumElements) + "!"); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->getType()) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[-1].ConstVector))[i].cnst->getType()->getDescription() + "'."); - } else - elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal).cnst = ConstantPacked::get(PTy, elems); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); + (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; - case 118: -#line 1539 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 142: +#line 1449 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal).type->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-3].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (yyvsp[-3].TypeVal).type->get()->getDescription() + "'!"); + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - std::vector<Constant*> elems; for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[-1].ConstVector))[i].cnst->getType() != STy->getElementType(i)) { + if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); - } else - elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); - (yyval.ConstVal).cnst = ConstantStruct::get(STy, elems); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-3].TypeVal).type; delete (yyvsp[-1].ConstVector); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; - case 119: -#line 1564 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 143: +#line 1470 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal).type->get()); + const StructType *STy = dyn_cast<StructType>((yyvsp[-2].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (yyvsp[-2].TypeVal).type->get()->getDescription() + "'!"); + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); - (yyval.ConstVal).cnst = ConstantStruct::get(STy, std::vector<Constant*>()); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-2].TypeVal).type; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>()); + delete (yyvsp[-2].TypeVal); CHECK_FOR_ERROR ;} break; - case 120: -#line 1578 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 144: +#line 1483 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).type->get()); + const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (yyvsp[-1].TypeVal).type->get()->getDescription() + "'!"); + (*(yyvsp[-1].TypeVal))->getDescription() + "'!"); - (yyval.ConstVal).cnst = ConstantPointerNull::get(PTy); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; + (yyval.ConstVal) = ConstantPointerNull::get(PTy); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 121: -#line 1589 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 145: +#line 1493 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ConstVal).cnst = UndefValue::get((yyvsp[-1].TypeVal).type->get()); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; + (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 122: -#line 1595 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 146: +#line 1498 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal).type->get()); + const PointerType *Ty = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type!"); @@ -3734,173 +3742,158 @@ yyreduce: } } - (yyval.ConstVal).cnst = cast<GlobalValue>(V); - (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; - delete (yyvsp[-1].TypeVal).type; // Free the type handle + (yyval.ConstVal) = cast<GlobalValue>(V); + delete (yyvsp[-1].TypeVal); // Free the type handle CHECK_FOR_ERROR ;} break; - case 123: -#line 1657 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 147: +#line 1559 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-1].TypeVal).type->get() != (yyvsp[0].ConstVal).cnst->getType()) + if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression!"); (yyval.ConstVal) = (yyvsp[0].ConstVal); - delete (yyvsp[-1].TypeVal).type; + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 124: -#line 1664 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 148: +#line 1566 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const Type *Ty = (yyvsp[-1].TypeVal).type->get(); + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); - (yyval.ConstVal).cnst = Constant::getNullValue(Ty); - (yyval.ConstVal).signedness = isSignless; - delete (yyvsp[-1].TypeVal).type; + (yyval.ConstVal) = Constant::getNullValue(Ty); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 125: -#line 1674 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 149: +#line 1574 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].SInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal).cnst = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].SInt64Val)); - (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 126: -#line 1681 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 150: +#line 1580 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].UInt64Val))) + if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); - (yyval.ConstVal).cnst = ConstantInt::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].UInt64Val)); - (yyval.ConstVal).signedness = (yyvsp[-1].TypeVal).signedness; + (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 127: -#line 1688 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 151: +#line 1586 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - (yyval.ConstVal).cnst = ConstantBool::getTrue(); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantBool::getTrue(); CHECK_FOR_ERROR ;} break; - case 128: -#line 1693 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 152: +#line 1590 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - (yyval.ConstVal).cnst = ConstantBool::getFalse(); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantBool::getFalse(); CHECK_FOR_ERROR ;} break; - case 129: -#line 1698 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 153: +#line 1594 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].FPVal))) + if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type!!"); - (yyval.ConstVal).cnst = ConstantFP::get((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].FPVal)); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; - case 130: -#line 1707 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 154: +#line 1602 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Constant *Val = (yyvsp[-3].ConstVal).cnst; - const Type *Ty = (yyvsp[-1].TypeVal).type->get(); + Constant *Val = (yyvsp[-3].ConstVal); + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + Val->getType()->getDescription() + "'!"); if (!Ty->isFirstClassType()) GEN_ERROR("cast constant expression to a non-primitive type: '" + Ty->getDescription() + "'!"); - if ((yyvsp[-5].CastOpVal).obsolete) { - if (Ty == Type::BoolTy) { - // The previous definition of cast to bool was a compare against zero. - // We have to retain that semantic so we do it here. - (yyval.ConstVal).cnst = ConstantExpr::get(Instruction::SetNE, Val, - Constant::getNullValue(Val->getType())); - } else if (Val->getType()->isFloatingPoint() && isa<PointerType>(Ty)) { - Constant *CE = ConstantExpr::getFPToUI(Val, Type::ULongTy); - (yyval.ConstVal).cnst = ConstantExpr::getIntToPtr(CE, Ty); - } else { - (yyval.ConstVal).cnst = ConstantExpr::getCast(Val, Ty); - } - } else { - (yyval.ConstVal).cnst = ConstantExpr::getCast((yyvsp[-5].CastOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].TypeVal).type->get()); - } - delete (yyvsp[-1].TypeVal).type; + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); ;} break; - case 131: -#line 1733 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 155: +#line 1614 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa<PointerType>((yyvsp[-2].ConstVal).cnst->getType())) + if (!isa<PointerType>((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); - std::vector<llvm::Value*> IdxVec; - for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i < e; ++i) - if (Constant *C = dyn_cast<Constant>((*(yyvsp[-1].ValueList))[i].val)) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant getelementptr must be constants!"); + // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct + // indices to uint struct indices for compatibility. + generic_gep_type_iterator<std::vector<Value*>::iterator> + GTI = gep_type_begin((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()), + GTE = gep_type_end((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()); + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) + if (isa<StructType>(*GTI)) // Only change struct indices + if (ConstantInt *CUI = dyn_cast<ConstantInt>((*(yyvsp[-1].ValueList))[i])) + if (CUI->getType() == Type::UByteTy) + (*(yyvsp[-1].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal).cnst->getType(), IdxVec, true); + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); + std::vector<Constant*> IdxVec; + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast<Constant>((*(yyvsp[-1].ValueList))[i])) + IdxVec.push_back(C); + else + GEN_ERROR("Indices to constant getelementptr must be constants!"); + delete (yyvsp[-1].ValueList); - (yyval.ConstVal).cnst = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal).cnst, IdxVec); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec); CHECK_FOR_ERROR ;} break; - case 132: -#line 1755 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 156: +#line 1646 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-5].ConstVal).cnst->getType() != Type::BoolTy) + if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); - if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Select operand types must match!"); - (yyval.ConstVal).cnst = ConstantExpr::getSelect((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 133: -#line 1764 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 157: +#line 1654 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) + 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).cnst->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 // broken case. See PR424 for more information. - if (!isa<PointerType>((yyvsp[-3].ConstVal).cnst->getType())) { - (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); + if (!isa<PointerType>((yyvsp[-3].ConstVal)->getType())) { + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -3908,121 +3901,129 @@ yyreduce: case Module::Pointer64: IntPtrTy = Type::LongTy; break; default: GEN_ERROR("invalid pointer binary constant expr!"); } - (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, - ConstantExpr::getCast((yyvsp[-3].ConstVal).cnst, IntPtrTy), - ConstantExpr::getCast((yyvsp[-1].ConstVal).cnst, IntPtrTy)); - (yyval.ConstVal).cnst = ConstantExpr::getCast((yyval.ConstVal).cnst, (yyvsp[-3].ConstVal).cnst->getType()); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), ConstantExpr::getCast((yyvsp[-3].ConstVal), IntPtrTy), + ConstantExpr::getCast((yyvsp[-1].ConstVal), IntPtrTy)); + (yyval.ConstVal) = ConstantExpr::getCast((yyval.ConstVal), (yyvsp[-3].ConstVal)->getType()); } - (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; CHECK_FOR_ERROR ;} break; - case 134: -#line 1793 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 158: +#line 1678 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match!"); - if (!(yyvsp[-3].ConstVal).cnst->getType()->isIntegral()) { - if (!isa<PackedType>((yyvsp[-3].ConstVal).cnst->getType()) || - !cast<PackedType>((yyvsp[-3].ConstVal).cnst->getType())->getElementType()->isIntegral()) + if (!(yyvsp[-3].ConstVal)->getType()->isIntegral()) { + if (!isa<PackedType>((yyvsp[-3].ConstVal)->getType()) || + !cast<PackedType>((yyvsp[-3].ConstVal)->getType())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 135: -#line 1805 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 159: +#line 1689 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal).cnst->getType() != (yyvsp[-1].ConstVal).cnst->getType()) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("setcc operand types must match!"); - (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].BinaryOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 136: -#line 1812 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 160: +#line 1695 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-1].ConstVal).cnst->getType() != Type::UByteTy) + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + GEN_ERROR("icmp operand types must match!"); + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + ;} + break; + + case 161: +#line 1700 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + GEN_ERROR("fcmp operand types must match!"); + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + ;} + break; + + case 162: +#line 1705 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); - if (!(yyvsp[-3].ConstVal).cnst->getType()->isInteger()) + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); - // Handle opcode upgrade situations - sanitizeOpcode((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal).cnst->getType()); CHECK_FOR_ERROR; - (yyval.ConstVal).cnst = ConstantExpr::get((yyvsp[-5].OtherOpVal).opcode, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 137: -#line 1824 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 163: +#line 1714 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) + if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands!"); - (yyval.ConstVal).cnst = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = (yyvsp[-3].ConstVal).signedness; + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 138: -#line 1831 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 164: +#line 1720 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) + if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands!"); - (yyval.ConstVal).cnst = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 139: -#line 1838 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 165: +#line 1726 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst)) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.ConstVal).cnst = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal).cnst, (yyvsp[-3].ConstVal).cnst, (yyvsp[-1].ConstVal).cnst); - (yyval.ConstVal).signedness = isSignless; + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); CHECK_FOR_ERROR ;} break; - case 140: -#line 1848 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 166: +#line 1735 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; - case 141: -#line 1852 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 167: +#line 1739 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ConstVector) = new std::vector<ConstInfo>(); + (yyval.ConstVector) = new std::vector<Constant*>(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; - case 142: -#line 1860 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 168: +#line 1747 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 143: -#line 1860 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 169: +#line 1747 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 144: -#line 1870 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 170: +#line 1757 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -4030,8 +4031,8 @@ yyreduce: ;} break; - case 145: -#line 1878 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 171: +#line 1765 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); @@ -4039,32 +4040,32 @@ yyreduce: ;} break; - case 146: -#line 1883 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 172: +#line 1770 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR ;} break; - case 147: -#line 1887 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 173: +#line 1774 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); CHECK_FOR_ERROR ;} break; - case 148: -#line 1891 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 174: +#line 1778 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR ;} break; - case 149: -#line 1895 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 175: +#line 1782 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -4080,8 +4081,8 @@ yyreduce: ;} break; - case 150: -#line 1910 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 176: +#line 1797 "/proj/llvm/llvm-4/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: @@ -4092,128 +4093,125 @@ yyreduce: // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].TypeVal).type->get()); + ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal)); - if (!setTypeName((yyvsp[0].TypeVal).type->get(), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { + if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*((yyvsp[0].TypeVal).type)); - } else { - delete (yyvsp[0].TypeVal).type; + CurModule.Types.push_back(*(yyvsp[0].TypeVal)); } + + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 151: -#line 1932 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 177: +#line 1819 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Function prototypes can be in const pool CHECK_FOR_ERROR ;} break; - case 152: -#line 1935 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 178: +#line 1822 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Asm blocks can be in the const pool CHECK_FOR_ERROR ;} break; - case 153: -#line 1938 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 179: +#line 1825 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].ConstVal).cnst == 0) + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal).cnst->getType(), (yyvsp[0].ConstVal).cnst); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; - case 154: -#line 1943 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 180: +#line 1830 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 155: -#line 1946 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 181: +#line 1833 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), - (yyvsp[0].TypeVal).type->get(), 0); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal).type; + delete (yyvsp[0].TypeVal); ;} break; - case 156: -#line 1951 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 182: +#line 1837 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 157: -#line 1955 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 183: +#line 1841 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), - (yyvsp[0].TypeVal).type->get(), 0); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal).type; + delete (yyvsp[0].TypeVal); ;} break; - case 158: -#line 1960 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 184: +#line 1845 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 159: -#line 1964 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 185: +#line 1849 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = - ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), - (yyvsp[0].TypeVal).type->get(), 0); + ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal).type; + delete (yyvsp[0].TypeVal); ;} break; - case 160: -#line 1970 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 186: +#line 1854 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 161: -#line 1974 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 187: +#line 1858 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 162: -#line 1977 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 188: +#line 1861 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 163: -#line 1980 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 189: +#line 1864 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ;} break; - case 164: -#line 1984 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 190: +#line 1868 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4228,26 +4226,26 @@ yyreduce: ;} break; - case 165: -#line 1997 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 191: +#line 1881 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; - case 166: -#line 1998 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 192: +#line 1882 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; - case 167: -#line 2000 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 193: +#line 1884 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness)); CHECK_FOR_ERROR ;} break; - case 168: -#line 2004 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 194: +#line 1888 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); @@ -4259,24 +4257,24 @@ yyreduce: ;} break; - case 169: -#line 2013 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 195: +#line 1897 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); ;} break; - case 170: -#line 2017 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 196: +#line 1901 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); ;} break; - case 172: -#line 2024 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 198: +#line 1908 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4284,8 +4282,8 @@ yyreduce: ;} break; - case 173: -#line 2029 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 199: +#line 1913 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4293,30 +4291,30 @@ yyreduce: ;} break; - case 174: -#line 2034 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 200: +#line 1918 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 178: -#line 2044 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 204: +#line 1928 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; - case 179: -#line 2046 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 205: +#line 1930 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-1].TypeVal).type->get() == Type::VoidTy) + if (*(yyvsp[-1].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - (yyval.ArgVal) = new std::pair<TypeInfo, char*>((yyvsp[-1].TypeVal), (yyvsp[0].StrVal)); + (yyval.ArgVal) = new std::pair<PATypeHolder*, char*>((yyvsp[-1].TypeVal), (yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; - case 180: -#line 2053 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 206: +#line 1937 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -4325,80 +4323,74 @@ yyreduce: ;} break; - case 181: -#line 2059 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 207: +#line 1943 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = new std::vector<std::pair<TypeInfo,char*> >(); + (yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); delete (yyvsp[0].ArgVal); CHECK_FOR_ERROR ;} break; - case 182: -#line 2066 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 208: +#line 1950 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR ;} break; - case 183: -#line 2070 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 209: +#line 1954 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); - TI.signedness = isSignless; - (yyval.ArgList)->push_back(std::pair<TypeInfo,char*>(TI,(char*)0)); + (yyval.ArgList)->push_back(std::pair<PATypeHolder*, + char*>(new PATypeHolder(Type::VoidTy), 0)); CHECK_FOR_ERROR ;} break; - case 184: -#line 2078 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 210: +#line 1960 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = new std::vector<std::pair<TypeInfo,char*> >(); - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); - TI.signedness = isSignless; - (yyval.ArgList)->push_back(std::make_pair(TI, (char*)0)); + (yyval.ArgList) = new std::vector<std::pair<PATypeHolder*,char*> >(); + (yyval.ArgList)->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); CHECK_FOR_ERROR ;} break; - case 185: -#line 2086 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 211: +#line 1965 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR ;} break; - case 186: -#line 2092 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 212: +#line 1971 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); free((yyvsp[-5].StrVal)); // Free strdup'd memory! - if (!((yyvsp[-6].TypeVal).type->get())->isFirstClassType() && (yyvsp[-6].TypeVal).type->get() != Type::VoidTy) + if (!(*(yyvsp[-6].TypeVal))->isFirstClassType() && *(yyvsp[-6].TypeVal) != Type::VoidTy) GEN_ERROR("LLVM functions cannot return aggregate types!"); std::vector<const Type*> ParamTypeList; if ((yyvsp[-3].ArgList)) { // If there are arguments... - for (std::vector<std::pair<TypeInfo,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(); + for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(); I != (yyvsp[-3].ArgList)->end(); ++I) - ParamTypeList.push_back(I->first.type->get()); + ParamTypeList.push_back(I->first->get()); } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - const FunctionType *FT = FunctionType::get((yyvsp[-6].TypeVal).type->get(), ParamTypeList, - isVarArg); + const FunctionType *FT = FunctionType::get(*(yyvsp[-6].TypeVal), ParamTypeList, isVarArg); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[-6].TypeVal).type; + delete (yyvsp[-6].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4452,27 +4444,29 @@ yyreduce: // Add all of the arguments we parsed to the function... if ((yyvsp[-3].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[-3].ArgList)->back().first.type->get() == Type::VoidTy && - (yyvsp[-3].ArgList)->back().second == 0 && "Not a varargs marker!"); - delete (yyvsp[-3].ArgList)->back().first.type; + assert((yyvsp[-3].ArgList)->back().first->get() == Type::VoidTy && (yyvsp[-3].ArgList)->back().second == 0&& + "Not a varargs marker!"); + delete (yyvsp[-3].ArgList)->back().first; (yyvsp[-3].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); - for (std::vector<std::pair<TypeInfo,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(); + for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = (yyvsp[-3].ArgList)->begin(); I != (yyvsp[-3].ArgList)->end(); ++I, ++ArgIt) { - delete I->first.type; // Delete the typeholder... + delete I->first; // Delete the typeholder... + setValueName(ArgIt, I->second); // Insert arg into symtab... CHECK_FOR_ERROR InsertValue(ArgIt); } + delete (yyvsp[-3].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR ;} break; - case 189: -#line 2187 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 215: +#line 2067 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -4482,31 +4476,31 @@ yyreduce: ;} break; - case 192: -#line 2197 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 218: +#line 2077 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; - case 194: -#line 2203 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 220: +#line 2083 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.Linkage = GlobalValue::DLLImportLinkage; ;} break; - case 195: -#line 2204 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 221: +#line 2084 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.Linkage = GlobalValue::ExternalWeakLinkage; ;} break; - case 196: -#line 2206 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 222: +#line 2086 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; - case 197: -#line 2206 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 223: +#line 2086 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -4514,123 +4508,125 @@ yyreduce: ;} break; - case 198: -#line 2216 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 224: +#line 2096 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 199: -#line 2220 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 225: +#line 2100 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 200: -#line 2225 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 226: +#line 2105 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 201: -#line 2229 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 227: +#line 2109 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 202: -#line 2233 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 228: +#line 2113 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR ;} break; - case 203: -#line 2237 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 229: +#line 2117 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::getTrue()); CHECK_FOR_ERROR ;} break; - case 204: -#line 2241 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 230: +#line 2121 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::getFalse()); CHECK_FOR_ERROR ;} break; - case 205: -#line 2245 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 231: +#line 2125 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR ;} break; - case 206: -#line 2249 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 232: +#line 2129 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR ;} break; - case 207: -#line 2253 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 233: +#line 2133 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR ;} break; - case 208: -#line 2257 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 234: +#line 2137 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[-1].ConstVector))[0].cnst->getType(); + const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( - HandleUpRefs(PackedType::get( ETy, NumElements))); + HandleUpRefs( + PackedType::get( + ETy, + NumElements) + ) + ); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[-1].ConstVector))[i].cnst->getType()) { + if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[-1].ConstVector))[i].cnst->getType()->getDescription() + "'."); - } else - elems.push_back((*(yyvsp[-1].ConstVector))[i].cnst); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, elems)); + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector))); delete PTy; delete (yyvsp[-1].ConstVector); CHECK_FOR_ERROR ;} break; - case 209: -#line 2280 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 235: +#line 2162 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).cnst); + (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); CHECK_FOR_ERROR ;} break; - case 210: -#line 2284 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 236: +#line 2166 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -4643,50 +4639,48 @@ yyreduce: ;} break; - case 211: -#line 2298 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 237: +#line 2180 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); CHECK_FOR_ERROR ;} break; - case 212: -#line 2302 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 238: +#line 2184 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); CHECK_FOR_ERROR ;} break; - case 215: -#line 2314 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 241: +#line 2196 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueVal).val = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); - delete (yyvsp[-1].TypeVal).type; + (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR - (yyval.ValueVal).signedness = (yyvsp[-1].TypeVal).signedness; ;} break; - case 216: -#line 2321 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 242: +#line 2201 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; - case 217: -#line 2325 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 243: +#line 2205 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR ;} break; - case 218: -#line 2334 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 244: +#line 2214 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR @@ -4699,8 +4693,8 @@ yyreduce: ;} break; - case 219: -#line 2345 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 245: +#line 2225 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[0].InstVal))) if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0))) @@ -4712,8 +4706,8 @@ yyreduce: ;} break; - case 220: -#line 2354 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 246: +#line 2234 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); CHECK_FOR_ERROR @@ -4728,8 +4722,8 @@ yyreduce: ;} break; - case 221: -#line 2366 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 247: +#line 2246 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); CHECK_FOR_ERROR @@ -4744,24 +4738,24 @@ yyreduce: ;} break; - case 222: -#line 2379 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 248: +#line 2259 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal).val); + (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 223: -#line 2383 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 249: +#line 2263 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR ;} break; - case 224: -#line 2387 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 250: +#line 2267 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR @@ -4769,8 +4763,8 @@ yyreduce: ;} break; - case 225: -#line 2392 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 251: +#line 2272 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR @@ -4782,10 +4776,10 @@ yyreduce: ;} break; - case 226: -#line 2401 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 252: +#line 2281 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-7].TypeVal).type->get(), (yyvsp[-6].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal((yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR @@ -4805,10 +4799,10 @@ yyreduce: ;} break; - case 227: -#line 2420 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 253: +#line 2300 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-6].TypeVal).type->get(), (yyvsp[-5].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal((yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR @@ -4818,26 +4812,26 @@ yyreduce: ;} break; - case 228: -#line 2430 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 254: +#line 2310 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast<PointerType>((yyvsp[-10].TypeVal).type->get())) || + if (!(PFTy = dyn_cast<PointerType>((yyvsp[-10].TypeVal)->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; if ((yyvsp[-7].ValueList)) { - for (std::vector<ValueInfo>::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end(); + for (std::vector<Value*>::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end(); I != E; ++I) - ParamTypes.push_back((*I).val->getType()); + ParamTypes.push_back((*I)->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get((yyvsp[-10].TypeVal).type->get(), ParamTypes, isVarArg); + Ty = FunctionType::get((yyvsp[-10].TypeVal)->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } @@ -4857,56 +4851,47 @@ yyreduce: // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector<ValueInfo>::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end(); - - std::vector<Value*> args; - for (; ArgI != ArgE; ++ArgI) - if (I == E) { - if (Ty->isVarArg()) { - args.push_back((*ArgI).val); - } else { - GEN_ERROR("Too many parameters for function of type " + - Ty->getDescription()); - } - } else { - if ((*ArgI).val->getType() != *I) { - GEN_ERROR("Parameter " + (*ArgI).val->getName() + - " is not of type '" + (*I)->getDescription() + "'!"); - } else - args.push_back((*ArgI).val); - ++I; - } - (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, args); + std::vector<Value*>::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end(); + + for (; ArgI != ArgE && I != E; ++ArgI, ++I) + if ((*ArgI)->getType() != *I) + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + + (*I)->getDescription() + "'!"); + + if (I != E || (ArgI != ArgE && !Ty->isVarArg())) + GEN_ERROR("Invalid number of parameters detected!"); + + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, *(yyvsp[-7].ValueList)); } cast<InvokeInst>((yyval.TermInstVal))->setCallingConv((yyvsp[-11].UIntVal)); - delete (yyvsp[-10].TypeVal).type; + delete (yyvsp[-10].TypeVal); delete (yyvsp[-7].ValueList); CHECK_FOR_ERROR ;} break; - case 229: -#line 2494 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 255: +#line 2365 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR ;} break; - case 230: -#line 2498 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 256: +#line 2369 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR ;} break; - case 231: -#line 2505 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 257: +#line 2376 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); - Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].TypeVal).type->get(), (yyvsp[-3].ValIDVal))); + Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); @@ -4917,11 +4902,11 @@ yyreduce: ;} break; - case 232: -#line 2516 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 258: +#line 2387 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >(); - Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].TypeVal).type->get(), (yyvsp[-3].ValIDVal))); + Constant *V = cast<Constant>(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); CHECK_FOR_ERROR if (V == 0) @@ -4933,8 +4918,8 @@ yyreduce: ;} break; - case 233: -#line 2529 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 259: +#line 2400 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); @@ -4945,21 +4930,21 @@ yyreduce: ;} break; - case 234: -#line 2538 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 260: +#line 2409 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >(); - Value* tmpVal = getVal((yyvsp[-5].TypeVal).type->get(), (yyvsp[-3].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[-5].TypeVal).type; + delete (yyvsp[-5].TypeVal); ;} break; - case 235: -#line 2547 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 261: +#line 2418 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -4970,16 +4955,16 @@ yyreduce: ;} break; - case 236: -#line 2557 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 262: +#line 2428 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { // Used for call statements, and memory insts... - (yyval.ValueList) = new std::vector<ValueInfo>(); + (yyval.ValueList) = new std::vector<Value*>(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); ;} break; - case 237: -#line 2561 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 263: +#line 2432 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -4987,188 +4972,189 @@ yyreduce: ;} break; - case 238: -#line 2568 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[0].ValueList); - ;} - break; - - case 239: -#line 2571 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = 0; - ;} + case 265: +#line 2439 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueList) = 0; ;} break; - case 240: -#line 2575 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 266: +#line 2441 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 241: -#line 2579 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 267: +#line 2445 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 242: -#line 2584 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 268: +#line 2450 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!(yyvsp[-3].TypeVal).type->get()->isInteger() && !(yyvsp[-3].TypeVal).type->get()->isFloatingPoint() && - !isa<PackedType>((yyvsp[-3].TypeVal).type->get())) + 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).type->get()) && - ((yyvsp[-4].BinaryOpVal).opcode == Instruction::URem || - (yyvsp[-4].BinaryOpVal).opcode == Instruction::SRem || - (yyvsp[-4].BinaryOpVal).opcode == Instruction::FRem)) + if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get()) && + ((yyvsp[-4].BinaryOpVal) == Instruction::URem || + (yyvsp[-4].BinaryOpVal) == Instruction::SRem || + (yyvsp[-4].BinaryOpVal) == 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).type->get()); - CHECK_FOR_ERROR; - Value* val1 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[-2].ValIDVal)); + Value* val1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* val2 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + Value* val2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal).opcode, val1, val2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), val1, val2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[-3].TypeVal).type; + delete (yyvsp[-3].TypeVal); ;} break; - case 243: -#line 2606 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 269: +#line 2469 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!(yyvsp[-3].TypeVal).type->get()->isIntegral()) { - if (!isa<PackedType>((yyvsp[-3].TypeVal).type->get()) || - !cast<PackedType>((yyvsp[-3].TypeVal).type->get())->getElementType()->isIntegral()) + if (!(*(yyvsp[-3].TypeVal))->isIntegral()) { + if (!isa<PackedType>((yyvsp[-3].TypeVal)->get()) || + !cast<PackedType>((yyvsp[-3].TypeVal)->get())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - Value* tmpVal1 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal).opcode, tmpVal1, tmpVal2); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[-3].TypeVal).type; + delete (yyvsp[-3].TypeVal); ;} break; - case 244: -#line 2621 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 270: +#line 2484 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if(isa<PackedType>((yyvsp[-3].TypeVal).type->get())) { + if(isa<PackedType>((*(yyvsp[-3].TypeVal)).get())) { GEN_ERROR( "PackedTypes currently not supported in setcc instructions!"); } - Value* tmpVal1 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[-2].ValIDVal)); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal((yyvsp[-3].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new SetCondInst((yyvsp[-4].BinaryOpVal).opcode, tmpVal1, tmpVal2); + (yyval.InstVal) = new SetCondInst((yyvsp[-4].BinaryOpVal), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null!"); - delete (yyvsp[-3].TypeVal).type; + delete (yyvsp[-3].TypeVal); ;} break; - case 245: -#line 2635 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 271: +#line 2498 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Packed types not supported by icmp instruction"); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + CHECK_FOR_ERROR + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].IPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) + GEN_ERROR("icmp operator returned null!"); + ;} + break; + + case 272: +#line 2509 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + { + if (isa<PackedType>((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR("Packed types not supported by fcmp instruction"); + Value* tmpVal1 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal)); + CHECK_FOR_ERROR + (yyval.InstVal) = CmpInst::create((yyvsp[-5].OtherOpVal), (yyvsp[-4].FPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) + GEN_ERROR("fcmp operator returned null!"); + ;} + break; + + case 273: +#line 2520 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { llvm_cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal).val->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal)->getType()); if (Ones == 0) GEN_ERROR("Expected integral type for not instruction!"); - (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal).val, Ones); + (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal), Ones); if ((yyval.InstVal) == 0) GEN_ERROR("Could not create a xor instruction!"); CHECK_FOR_ERROR ;} break; - case 246: -#line 2648 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 274: +#line 2533 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].ValueVal).val->getType() != Type::UByteTy) + if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); - if (!(yyvsp[-2].ValueVal).val->getType()->isInteger()) + if (!(yyvsp[-2].ValueVal)->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); - // Handle opcode upgrade situations - sanitizeOpcode((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal).val->getType()); CHECK_FOR_ERROR; - (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal).opcode, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); + (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 247: -#line 2659 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 275: +#line 2542 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* Val = (yyvsp[-2].ValueVal).val; - const Type* Ty = (yyvsp[0].TypeVal).type->get(); + Value* Val = (yyvsp[-2].ValueVal); + const Type* Ty = (yyvsp[0].TypeVal)->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast from a non-primitive type: '" + Val->getType()->getDescription() + "'!"); if (!Ty->isFirstClassType()) GEN_ERROR("cast to a non-primitive type: '" + Ty->getDescription() +"'!"); - - if ((yyvsp[-3].CastOpVal).obsolete) { - if (Ty == Type::BoolTy) { - // The previous definition of cast to bool was a compare against zero. - // We have to retain that semantic so we do it here. - (yyval.InstVal) = new SetCondInst(Instruction::SetNE, (yyvsp[-2].ValueVal).val, - Constant::getNullValue((yyvsp[-2].ValueVal).val->getType())); - } else if (Val->getType()->isFloatingPoint() && isa<PointerType>(Ty)) { - CastInst *CI = new FPToUIInst(Val, Type::ULongTy); - (yyval.InstVal) = new IntToPtrInst(CI, Ty); - } else { - (yyval.InstVal) = CastInst::createInferredCast(Val, Ty); - } - } else { - (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal).opcode, (yyvsp[-2].ValueVal).val, (yyvsp[0].TypeVal).type->get()); - } - delete (yyvsp[0].TypeVal).type; + (yyval.InstVal) = CastInst::create((yyvsp[-3].CastOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].TypeVal)->get()); + delete (yyvsp[0].TypeVal); ;} break; - case 248: -#line 2685 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 276: +#line 2553 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-4].ValueVal).val->getType() != Type::BoolTy) + if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); - if ((yyvsp[-2].ValueVal).val->getType() != (yyvsp[0].ValueVal).val->getType()) + if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) GEN_ERROR("select value types should match!"); - (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); + (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 249: -#line 2693 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 277: +#line 2561 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { NewVarArgs = true; - (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal).val, (yyvsp[0].TypeVal).type->get()); - delete (yyvsp[0].TypeVal).type; + (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 250: -#line 2699 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 278: +#line 2567 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; - const Type* ArgTy = (yyvsp[-2].ValueVal).val->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -5179,20 +5165,20 @@ yyreduce: //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal).val); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - (yyval.InstVal) = new VAArgInst(foo, (yyvsp[0].TypeVal).type->get()); - delete (yyvsp[0].TypeVal).type; + (yyval.InstVal) = new VAArgInst(foo, *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 251: -#line 2719 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 279: +#line 2587 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; - const Type* ArgTy = (yyvsp[-2].ValueVal).val->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -5204,49 +5190,49 @@ yyreduce: //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal).val); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - Instruction* tmp = new VAArgInst(foo, (yyvsp[0].TypeVal).type->get()); + Instruction* tmp = new VAArgInst(foo, *(yyvsp[0].TypeVal)); CurBB->getInstList().push_back(tmp); (yyval.InstVal) = new LoadInst(foo); - delete (yyvsp[0].TypeVal).type; + delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR ;} break; - case 252: -#line 2742 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 280: +#line 2610 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) + if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid extractelement operands!"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); + (yyval.InstVal) = new ExtractElementInst((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 253: -#line 2748 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 281: +#line 2616 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) + if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid insertelement operands!"); - (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); + (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 254: -#line 2754 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 282: +#line 2622 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val)) + if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid shufflevector operands!"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal).val, (yyvsp[-2].ValueVal).val, (yyvsp[0].ValueVal).val); + (yyval.InstVal) = new ShuffleVectorInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 255: -#line 2760 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 283: +#line 2628 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5264,30 +5250,29 @@ yyreduce: ;} break; - case 256: -#line 2775 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 284: +#line 2643 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast<PointerType>((yyvsp[-4].TypeVal).type->get())) || + if (!(PFTy = dyn_cast<PointerType>((yyvsp[-4].TypeVal)->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; if ((yyvsp[-1].ValueList)) { - for (std::vector<ValueInfo>::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end(); + for (std::vector<Value*>::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end(); I != E; ++I) - ParamTypes.push_back((*I).val->getType()); + ParamTypes.push_back((*I)->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - if (!(yyvsp[-4].TypeVal).type->get()->isFirstClassType() && - (yyvsp[-4].TypeVal).type->get() != Type::VoidTy) + if (!(*(yyvsp[-4].TypeVal))->isFirstClassType() && *(yyvsp[-4].TypeVal) != Type::VoidTy) GEN_ERROR("LLVM functions cannot return aggregate types!"); - Ty = FunctionType::get((yyvsp[-4].TypeVal).type->get(), ParamTypes, isVarArg); + Ty = FunctionType::get((yyvsp[-4].TypeVal)->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } @@ -5308,180 +5293,174 @@ yyreduce: // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector<ValueInfo>::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end(); - - std::vector<Value*> args; - for (; ArgI != ArgE ; ++ArgI) - if (I == E) { - if (Ty->isVarArg()) { - args.push_back((*ArgI).val); - } else { - GEN_ERROR("Too many parameters for function of type " + - Ty->getDescription()); - } - } else { - if ((*ArgI).val->getType() != *I) { - GEN_ERROR("Parameter " + (*ArgI).val->getName() + - " is not of type '" + (*I)->getDescription() + "'!"); - } else - args.push_back((*ArgI).val); - ++I; - } + std::vector<Value*>::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end(); + + for (; ArgI != ArgE && I != E; ++ArgI, ++I) + if ((*ArgI)->getType() != *I) + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) GEN_ERROR("Invalid number of parameters detected!"); - (yyval.InstVal) = new CallInst(V, args); + (yyval.InstVal) = new CallInst(V, *(yyvsp[-1].ValueList)); } cast<CallInst>((yyval.InstVal))->setTailCall((yyvsp[-6].BoolVal)); cast<CallInst>((yyval.InstVal))->setCallingConv((yyvsp[-5].UIntVal)); - delete (yyvsp[-4].TypeVal).type; + delete (yyvsp[-4].TypeVal); delete (yyvsp[-1].ValueList); CHECK_FOR_ERROR ;} break; - case 257: -#line 2848 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 285: +#line 2702 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR ;} break; - case 258: -#line 2855 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 286: +#line 2709 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); CHECK_FOR_ERROR ;} break; - case 259: -#line 2858 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 287: +#line 2712 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueList) = new std::vector<ValueInfo>(); + (yyval.ValueList) = new std::vector<Value*>(); CHECK_FOR_ERROR ;} break; - case 260: -#line 2863 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 288: +#line 2717 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 261: -#line 2867 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 289: +#line 2721 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 262: -#line 2874 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 290: +#line 2728 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.InstVal) = new MallocInst((yyvsp[-1].TypeVal).type->get(), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal).type; + (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 263: -#line 2879 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 291: +#line 2733 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst((yyvsp[-4].TypeVal).type->get(), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal).type; + (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; - case 264: -#line 2885 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 292: +#line 2739 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - (yyval.InstVal) = new AllocaInst((yyvsp[-1].TypeVal).type->get(), 0, (yyvsp[0].UIntVal)); - delete (yyvsp[-1].TypeVal).type; + (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR ;} break; - case 265: -#line 2890 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 293: +#line 2744 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); + Value* tmpVal = getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst((yyvsp[-4].TypeVal).type->get(), tmpVal, (yyvsp[0].UIntVal)); - delete (yyvsp[-4].TypeVal).type; + (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), tmpVal, (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); ;} break; - case 266: -#line 2896 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 294: +#line 2750 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa<PointerType>((yyvsp[0].ValueVal).val->getType())) + if (!isa<PointerType>((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[0].ValueVal).val->getType()->getDescription() + "!"); - (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal).val); + (yyvsp[0].ValueVal)->getType()->getDescription() + "!"); + (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR ;} break; - case 267: -#line 2904 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 295: +#line 2758 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa<PointerType>((yyvsp[-1].TypeVal).type->get())) + if (!isa<PointerType>((yyvsp[-1].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (yyvsp[-1].TypeVal).type->get()->getDescription()); - if (!cast<PointerType>((yyvsp[-1].TypeVal).type->get())->getElementType()->isFirstClassType()) + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!cast<PointerType>((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (yyvsp[-1].TypeVal).type->get()->getDescription()); - Value* tmpVal = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + (*(yyvsp[-1].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); - delete (yyvsp[-1].TypeVal).type; + delete (yyvsp[-1].TypeVal); ;} break; - case 268: -#line 2916 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 296: +#line 2770 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - const PointerType *PT = dyn_cast<PointerType>((yyvsp[-1].TypeVal).type->get()); + const PointerType *PT = dyn_cast<PointerType>((yyvsp[-1].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - ((yyvsp[-1].TypeVal).type->get())->getDescription()); + (*(yyvsp[-1].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[-3].ValueVal).val->getType()) - GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal).val->getType()->getDescription() + + if (ElTy != (yyvsp[-3].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); - Value* tmpVal = getVal((yyvsp[-1].TypeVal).type->get(), (yyvsp[0].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal).val, tmpVal, (yyvsp[-5].BoolVal)); - delete (yyvsp[-1].TypeVal).type; + (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); + delete (yyvsp[-1].TypeVal); ;} break; - case 269: -#line 2931 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" + case 297: +#line 2785 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" { - if (!isa<PointerType>((yyvsp[-2].TypeVal).type->get())) + if (!isa<PointerType>((yyvsp[-2].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - std::vector<Value*> indices; - for (unsigned i = 0, e = (yyvsp[0].ValueList)->size(); i != e; ++i) - indices.push_back((*(yyvsp[0].ValueList))[i].val); - - if (!GetElementPtrInst::getIndexedType((yyvsp[-2].TypeVal).type->get(), indices, true)) + // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct + // indices to uint struct indices for compatibility. + generic_gep_type_iterator<std::vector<Value*>::iterator> + GTI = gep_type_begin((yyvsp[-2].TypeVal)->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()), + GTE = gep_type_end((yyvsp[-2].TypeVal)->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()); + for (unsigned i = 0, e = (yyvsp[0].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) + if (isa<StructType>(*GTI)) // Only change struct indices + if (ConstantInt *CUI = dyn_cast<ConstantInt>((*(yyvsp[0].ValueList))[i])) + if (CUI->getType() == Type::UByteTy) + (*(yyvsp[0].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + + if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), *(yyvsp[0].ValueList), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (yyvsp[-2].TypeVal).type->get()->getDescription()+ "'!"); - Value* tmpVal = getVal((yyvsp[-2].TypeVal).type->get(), (yyvsp[-1].ValIDVal)); + (*(yyvsp[-2].TypeVal))->getDescription()+ "'!"); + Value* tmpVal = getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, indices); - delete (yyvsp[-2].TypeVal).type; + (yyval.InstVal) = new GetElementPtrInst(tmpVal, *(yyvsp[0].ValueList)); + delete (yyvsp[-2].TypeVal); delete (yyvsp[0].ValueList); ;} break; @@ -5491,7 +5470,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 5495 "llvmAsmParser.tab.c" +#line 5474 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -5759,7 +5738,7 @@ yyreturn: } -#line 2950 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2811 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" void llvm::GenerateError(const std::string &message, int LineNo) { diff --git a/lib/AsmParser/llvmAsmParser.h.cvs b/lib/AsmParser/llvmAsmParser.h.cvs index 429cd68..da8fc0e 100644 --- a/lib/AsmParser/llvmAsmParser.h.cvs +++ b/lib/AsmParser/llvmAsmParser.h.cvs @@ -122,35 +122,61 @@ SETGT = 348, SETEQ = 349, SETNE = 350, - MALLOC = 351, - ALLOCA = 352, - FREE = 353, - LOAD = 354, - STORE = 355, - GETELEMENTPTR = 356, - TRUNC = 357, - ZEXT = 358, - SEXT = 359, - FPTRUNC = 360, - FPEXT = 361, - BITCAST = 362, - UITOFP = 363, - SITOFP = 364, - FPTOUI = 365, - FPTOSI = 366, - INTTOPTR = 367, - PTRTOINT = 368, - PHI_TOK = 369, - SELECT = 370, - SHL = 371, - LSHR = 372, - ASHR = 373, - VAARG = 374, - EXTRACTELEMENT = 375, - INSERTELEMENT = 376, - SHUFFLEVECTOR = 377, - VAARG_old = 378, - VANEXT_old = 379 + ICMP = 351, + FCMP = 352, + EQ = 353, + NE = 354, + SLT = 355, + SGT = 356, + SLE = 357, + SGE = 358, + ULT = 359, + UGT = 360, + ULE = 361, + UGE = 362, + ORDEQ = 363, + ORDNE = 364, + ORDLT = 365, + ORDGT = 366, + ORDLE = 367, + ORDGE = 368, + ORD = 369, + UNO = 370, + UNOEQ = 371, + UNONE = 372, + UNOLT = 373, + UNOGT = 374, + UNOLE = 375, + UNOGE = 376, + MALLOC = 377, + ALLOCA = 378, + FREE = 379, + LOAD = 380, + STORE = 381, + GETELEMENTPTR = 382, + TRUNC = 383, + ZEXT = 384, + SEXT = 385, + FPTRUNC = 386, + FPEXT = 387, + BITCAST = 388, + UITOFP = 389, + SITOFP = 390, + FPTOUI = 391, + FPTOSI = 392, + INTTOPTR = 393, + PTRTOINT = 394, + PHI_TOK = 395, + SELECT = 396, + SHL = 397, + LSHR = 398, + ASHR = 399, + VAARG = 400, + EXTRACTELEMENT = 401, + INSERTELEMENT = 402, + SHUFFLEVECTOR = 403, + VAARG_old = 404, + VANEXT_old = 405 }; #endif /* Tokens. */ @@ -247,59 +273,88 @@ #define SETGT 348 #define SETEQ 349 #define SETNE 350 -#define MALLOC 351 -#define ALLOCA 352 -#define FREE 353 -#define LOAD 354 -#define STORE 355 -#define GETELEMENTPTR 356 -#define TRUNC 357 -#define ZEXT 358 -#define SEXT 359 -#define FPTRUNC 360 -#define FPEXT 361 -#define BITCAST 362 -#define UITOFP 363 -#define SITOFP 364 -#define FPTOUI 365 -#define FPTOSI 366 -#define INTTOPTR 367 -#define PTRTOINT 368 -#define PHI_TOK 369 -#define SELECT 370 -#define SHL 371 -#define LSHR 372 -#define ASHR 373 -#define VAARG 374 -#define EXTRACTELEMENT 375 -#define INSERTELEMENT 376 -#define SHUFFLEVECTOR 377 -#define VAARG_old 378 -#define VANEXT_old 379 +#define ICMP 351 +#define FCMP 352 +#define EQ 353 +#define NE 354 +#define SLT 355 +#define SGT 356 +#define SLE 357 +#define SGE 358 +#define ULT 359 +#define UGT 360 +#define ULE 361 +#define UGE 362 +#define ORDEQ 363 +#define ORDNE 364 +#define ORDLT 365 +#define ORDGT 366 +#define ORDLE 367 +#define ORDGE 368 +#define ORD 369 +#define UNO 370 +#define UNOEQ 371 +#define UNONE 372 +#define UNOLT 373 +#define UNOGT 374 +#define UNOLE 375 +#define UNOGE 376 +#define MALLOC 377 +#define ALLOCA 378 +#define FREE 379 +#define LOAD 380 +#define STORE 381 +#define GETELEMENTPTR 382 +#define TRUNC 383 +#define ZEXT 384 +#define SEXT 385 +#define FPTRUNC 386 +#define FPEXT 387 +#define BITCAST 388 +#define UITOFP 389 +#define SITOFP 390 +#define FPTOUI 391 +#define FPTOSI 392 +#define INTTOPTR 393 +#define PTRTOINT 394 +#define PHI_TOK 395 +#define SELECT 396 +#define SHL 397 +#define LSHR 398 +#define ASHR 399 +#define VAARG 400 +#define EXTRACTELEMENT 401 +#define INSERTELEMENT 402 +#define SHUFFLEVECTOR 403 +#define VAARG_old 404 +#define VANEXT_old 405 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1038 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 968 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; - std::pair<TypeInfo, char*> *ArgVal; + std::pair<llvm::PATypeHolder*, char*> *ArgVal; llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - ConstInfo ConstVal; - TypeInfo TypeVal; - ValueInfo ValueVal; + llvm::Constant *ConstVal; - std::vector<std::pair<TypeInfo,char*> >*ArgList; - std::vector<ValueInfo> *ValueList; - std::list<TypeInfo> *TypeList; + const llvm::Type *PrimType; + llvm::PATypeHolder *TypeVal; + llvm::Value *ValueVal; + + std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList; + std::vector<llvm::Value*> *ValueList; + std::list<llvm::PATypeHolder> *TypeList; // Represent the RHS of PHI node - std::list<std::pair<llvm::Value*, llvm::BasicBlock*> > *PHIList; + std::list<std::pair<llvm::Value*, + llvm::BasicBlock*> > *PHIList; std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable; - std::vector<ConstInfo> *ConstVector; + std::vector<llvm::Constant*> *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -312,15 +367,17 @@ typedef union YYSTYPE { char *StrVal; // This memory is strdup'd! llvm::ValID ValIDVal; // strdup'd memory maybe! - BinaryOpInfo BinaryOpVal; - TermOpInfo TermOpVal; - MemOpInfo MemOpVal; - CastOpInfo CastOpVal; - OtherOpInfo OtherOpVal; + llvm::Instruction::BinaryOps BinaryOpVal; + llvm::Instruction::TermOps TermOpVal; + llvm::Instruction::MemoryOps MemOpVal; + llvm::Instruction::CastOps CastOpVal; + llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; + llvm::ICmpInst::Predicate IPredicate; + llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; /* Line 1447 of yacc.c. */ -#line 324 "llvmAsmParser.tab.h" +#line 381 "llvmAsmParser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index 1d1558e..8d0b7a2 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -124,11 +124,6 @@ static struct PerModuleInfo { return; } - // Look for intrinsic functions and CallInst that need to be upgraded - for (Module::iterator FI = CurrentModule->begin(), - FE = CurrentModule->end(); FI != FE; ) - UpgradeCallsToIntrinsic(FI++); - Values.clear(); // Clear out function local definitions Types.clear(); CurrentModule = 0; @@ -254,7 +249,7 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) { Type *Typ = OpaqueType::get(); CurModule.LateResolveTypes.insert(std::make_pair(D, Typ)); return Typ; -} + } static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = @@ -813,71 +808,6 @@ static PATypeHolder HandleUpRefs(const Type *ty) { return Ty; } -/// 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. -/// @brief Convert obsolete BinaryOps opcodes to new values -static void -sanitizeOpcode(OpcodeInfo<Instruction::BinaryOps> &OI, const Type *Ty) -{ - // If its not obsolete, don't do anything - if (!OI.obsolete) - return; - - // If its a packed type we want to use the element type - if (const PackedType *PTy = dyn_cast<PackedType>(Ty)) - Ty = PTy->getElementType(); - - // Depending on the opcode .. - switch (OI.opcode) { - default: - GenerateError("Invalid obsolete opCode (check Lexer.l)"); - 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; -} - -/// This function is similar to the previous overload of sanitizeOpcode but -/// operates on Instruction::OtherOps instead of Instruction::BinaryOps. -/// @brief Convert obsolete OtherOps opcodes to new values -static void -sanitizeOpcode(OpcodeInfo<Instruction::OtherOps> &OI, const Type *Ty) -{ - // If its not obsolete, don't do anything - if (!OI.obsolete) - return; - - switch (OI.opcode) { - default: - GenerateError("Invalid obsolete opcode (check Lexer.l)"); - break; - case Instruction::LShr: - if (Ty->isSigned()) - OI.opcode = Instruction::AShr; - break; - } - // Its not obsolete any more, we fixed it. - OI.obsolete = false; -} - // common code from the two 'RunVMAsmParser' functions static Module* RunParser(Module * M) { @@ -1038,21 +968,24 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { %union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; - std::pair<TypeInfo, char*> *ArgVal; + std::pair<llvm::PATypeHolder*, char*> *ArgVal; llvm::BasicBlock *BasicBlockVal; llvm::TerminatorInst *TermInstVal; llvm::Instruction *InstVal; - ConstInfo ConstVal; - TypeInfo TypeVal; - ValueInfo ValueVal; + llvm::Constant *ConstVal; - std::vector<std::pair<TypeInfo,char*> >*ArgList; - std::vector<ValueInfo> *ValueList; - std::list<TypeInfo> *TypeList; + const llvm::Type *PrimType; + llvm::PATypeHolder *TypeVal; + llvm::Value *ValueVal; + + std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList; + std::vector<llvm::Value*> *ValueList; + std::list<llvm::PATypeHolder> *TypeList; // Represent the RHS of PHI node - std::list<std::pair<llvm::Value*, llvm::BasicBlock*> > *PHIList; + std::list<std::pair<llvm::Value*, + llvm::BasicBlock*> > *PHIList; std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable; - std::vector<ConstInfo> *ConstVector; + std::vector<llvm::Constant*> *ConstVector; llvm::GlobalValue::LinkageTypes Linkage; int64_t SInt64Val; @@ -1065,12 +998,14 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { char *StrVal; // This memory is strdup'd! llvm::ValID ValIDVal; // strdup'd memory maybe! - BinaryOpInfo BinaryOpVal; - TermOpInfo TermOpVal; - MemOpInfo MemOpVal; - CastOpInfo CastOpVal; - OtherOpInfo OtherOpVal; + llvm::Instruction::BinaryOps BinaryOpVal; + llvm::Instruction::TermOps TermOpVal; + llvm::Instruction::MemoryOps MemOpVal; + llvm::Instruction::CastOps CastOpVal; + llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; + llvm::ICmpInst::Predicate IPredicate; + llvm::FCmpInst::Predicate FPredicate; } %type <ModuleVal> Module FunctionList @@ -1113,9 +1048,9 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { // Built in types... %type <TypeVal> Types TypesV UpRTypes UpRTypesV -%type <TypeVal> SIntType UIntType IntType FPType PrimType // Classifications -%token <TypeVal> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG -%token <TypeVal> FLOAT DOUBLE TYPE LABEL +%type <PrimType> SIntType UIntType IntType FPType PrimType // Classifications +%token <PrimType> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG +%token <PrimType> FLOAT DOUBLE TYPE LABEL %token <StrVal> VAR_ID LABELSTR STRINGCONSTANT %type <StrVal> Name OptName OptAssign @@ -1140,6 +1075,12 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { %type <BinaryOpVal> ArithmeticOps LogicalOps SetCondOps // Binops Subcatagories %token <BinaryOpVal> ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR %token <BinaryOpVal> SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators +%token <OtherOpVal> ICMP FCMP +%token <IPredicate> EQ NE SLT SGT SLE SGE ULT UGT ULE UGE +%type <IPredicate> IPredicates +%token <FPredicate> ORDEQ ORDNE ORDLT ORDGT ORDLE ORDGE ORD UNO UNOEQ UNONE +%token <FPredicate> UNOLT UNOGT UNOLE UNOGE +%type <FPredicate> FPredicates // Memory Instructions %token <MemOpVal> MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR @@ -1187,6 +1128,9 @@ SetCondOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE; CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST | UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT; ShiftOps : SHL | LSHR | ASHR; +IPredicates : EQ | NE | SLT | SGT | SLE | SGE | ULT | UGT | ULE | UGE ; +FPredicates : ORDEQ | ORDNE | ORDLT | ORDGT | ORDLE | ORDGE | ORD | UNO + | UNOEQ | UNONE | UNOLT | UNOGT | UNOLE | UNOGE ; // These are some types that allow classification if we only want a particular // thing... for example, only a signed, unsigned, or integral type. @@ -1281,22 +1225,15 @@ GlobalVarAttribute : SectionString { // // TypesV includes all of 'Types', but it also includes the void type. -TypesV : Types | VOID { - $$.type = new PATypeHolder($1.type->get()); - $$.signedness = $1.signedness; -}; -UpRTypesV : UpRTypes | VOID { - $$.type = new PATypeHolder($1.type->get()); - $$.signedness = $1.signedness; -}; +TypesV : Types | VOID { $$ = new PATypeHolder($1); }; +UpRTypesV : UpRTypes | VOID { $$ = new PATypeHolder($1); }; Types : UpRTypes { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + - ($1.type->get())->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); $$ = $1; CHECK_FOR_ERROR -}; + }; // Derived types are added later... @@ -1304,19 +1241,17 @@ Types : UpRTypes { PrimType : BOOL | SBYTE | UBYTE | SHORT | USHORT | INT | UINT ; PrimType : LONG | ULONG | FLOAT | DOUBLE | TYPE | LABEL; UpRTypes : OPAQUE { - $$.type = new PATypeHolder(OpaqueType::get()); - $$.signedness = isSignless; + $$ = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR } | PrimType { - $$ = $1; + $$ = new PATypeHolder($1); CHECK_FOR_ERROR }; UpRTypes : SymbolicValueRef { // Named types are also simple types... const Type* tmp = getTypeVal($1); CHECK_FOR_ERROR - $$.type = new PATypeHolder(tmp); - $$.signedness = isSignless; + $$ = new PATypeHolder(tmp); }; // Include derived types in the Types production. @@ -1325,69 +1260,59 @@ UpRTypes : '\\' EUINT64VAL { // Type UpReference if ($2 > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector... - $$.type = new PATypeHolder(OT); - $$.signedness = isSignless; + $$ = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR } | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? std::vector<const Type*> Params; - for (std::list<TypeInfo>::iterator I = $3->begin(), + for (std::list<llvm::PATypeHolder>::iterator I = $3->begin(), E = $3->end(); I != E; ++I) - Params.push_back(I->type->get()); + Params.push_back(*I); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - $$.type = new PATypeHolder(HandleUpRefs( - FunctionType::get($1.type->get(),Params,isVarArg))); - $$.signedness = isSignless; + $$ = new PATypeHolder(HandleUpRefs(FunctionType::get(*$1,Params,isVarArg))); delete $3; // Delete the argument list - delete $1.type; + delete $1; // Delete the return type handle CHECK_FOR_ERROR } | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? - $$.type = new PATypeHolder(HandleUpRefs( - ArrayType::get($4.type->get(), (unsigned)$2))); - $$.signedness = isSignless; - delete $4.type; + $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); + delete $4; CHECK_FOR_ERROR } | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? - const llvm::Type* ElemTy = $4.type->get(); - if ((unsigned)$2 != $2) - GEN_ERROR("Unsigned result not equal to signed result"); - if (!ElemTy->isPrimitiveType()) - GEN_ERROR("Elemental type of a PackedType must be primitive"); - if (!isPowerOf2_32($2)) - GEN_ERROR("Vector length should be a power of 2!"); - $$.type = new PATypeHolder(HandleUpRefs( - PackedType::get($4.type->get(), (unsigned)$2))); - $$.signedness = isSignless; - delete $4.type; - CHECK_FOR_ERROR + const llvm::Type* ElemTy = $4->get(); + if ((unsigned)$2 != $2) + GEN_ERROR("Unsigned result not equal to signed result"); + if (!ElemTy->isPrimitiveType()) + GEN_ERROR("Elemental type of a PackedType must be primitive"); + if (!isPowerOf2_32($2)) + GEN_ERROR("Vector length should be a power of 2!"); + $$ = new PATypeHolder(HandleUpRefs(PackedType::get(*$4, (unsigned)$2))); + delete $4; + CHECK_FOR_ERROR } | '{' TypeListI '}' { // Structure type? std::vector<const Type*> Elements; - for (std::list<TypeInfo>::iterator I = $2->begin(), + for (std::list<llvm::PATypeHolder>::iterator I = $2->begin(), E = $2->end(); I != E; ++I) - Elements.push_back((*I).type->get()); + Elements.push_back(*I); - $$.type = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - $$.signedness = isSignless; + $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete $2; CHECK_FOR_ERROR } | '{' '}' { // Empty structure type? - $$.type = new PATypeHolder(StructType::get(std::vector<const Type*>())); - $$.signedness = isSignless; + $$ = new PATypeHolder(StructType::get(std::vector<const Type*>())); CHECK_FOR_ERROR } | UpRTypes '*' { // Pointer type? - if ($1.type->get() == Type::LabelTy) + if (*$1 == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - $$.type = new PATypeHolder(HandleUpRefs(PointerType::get($1.type->get()))); - $$.signedness = isSignless; - delete $1.type; + $$ = new PATypeHolder(HandleUpRefs(PointerType::get(*$1))); + delete $1; CHECK_FOR_ERROR }; @@ -1395,31 +1320,27 @@ UpRTypes : '\\' EUINT64VAL { // Type UpReference // declaration type lists // TypeListI : UpRTypes { - $$ = new std::list<TypeInfo>(); - $$->push_back($1); + $$ = new std::list<PATypeHolder>(); + $$->push_back(*$1); delete $1; CHECK_FOR_ERROR } | TypeListI ',' UpRTypes { - ($$=$1)->push_back($3); + ($$=$1)->push_back(*$3); delete $3; CHECK_FOR_ERROR }; // ArgTypeList - List of types for a function type declaration... ArgTypeListI : TypeListI | TypeListI ',' DOTDOTDOT { - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; - ($$=$1)->push_back(TI); + ($$=$1)->push_back(Type::VoidTy); CHECK_FOR_ERROR } | DOTDOTDOT { - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); TI.signedness = isSignless; - ($$ = new std::list<TypeInfo>())->push_back(TI); + ($$ = new std::list<PATypeHolder>())->push_back(Type::VoidTy); CHECK_FOR_ERROR } | /*empty*/ { - $$ = new std::list<TypeInfo>(); + $$ = new std::list<PATypeHolder>(); CHECK_FOR_ERROR }; @@ -1430,10 +1351,10 @@ ArgTypeListI : TypeListI // ResolvedVal, ValueRef and ConstValueRef productions. // ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast<ArrayType>($1.type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ($1.type->get())->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); @@ -1444,42 +1365,36 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr itostr(NumElements) + "!"); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i].cnst->getType()) { + if (ETy != (*$3)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i].cnst->getType()->getDescription() + "'."); - } else { - elems.push_back((*$3)[i].cnst); - } + (*$3)[i]->getType()->getDescription() + "'."); } - $$.cnst = ConstantArray::get(ATy, elems); - $$.signedness = isSignless; - delete $1.type; delete $3; + $$ = ConstantArray::get(ATy, *$3); + delete $1; delete $3; CHECK_FOR_ERROR } | Types '[' ']' { - const ArrayType *ATy = dyn_cast<ArrayType>($1.type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ($1.type->get())->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); - $$.cnst = ConstantArray::get(ATy, std::vector<llvm::Constant*>()); - $$.signedness = isSignless; - delete $1.type; + $$ = ConstantArray::get(ATy, std::vector<Constant*>()); + delete $1; CHECK_FOR_ERROR } | Types 'c' STRINGCONSTANT { - const ArrayType *ATy = dyn_cast<ArrayType>($1.type->get()); + const ArrayType *ATy = dyn_cast<ArrayType>($1->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - ($1.type->get())->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); @@ -1501,16 +1416,15 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free($3); - $$.cnst = ConstantArray::get(ATy, Vals); - $$.signedness = isSignless; - delete $1.type; + $$ = ConstantArray::get(ATy, Vals); + delete $1; CHECK_FOR_ERROR } | Types '<' ConstVector '>' { // Nonempty unsized arr - const PackedType *PTy = dyn_cast<PackedType>($1.type->get()); + const PackedType *PTy = dyn_cast<PackedType>($1->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - $1.type->get()->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); @@ -1521,79 +1435,68 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr itostr(NumElements) + "!"); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < $3->size(); i++) { - if (ETy != (*$3)[i].cnst->getType()) { + if (ETy != (*$3)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*$3)[i].cnst->getType()->getDescription() + "'."); - } else - elems.push_back((*$3)[i].cnst); + (*$3)[i]->getType()->getDescription() + "'."); } - $$.cnst = ConstantPacked::get(PTy, elems); - $$.signedness = isSignless; - delete $1.type; delete $3; + $$ = ConstantPacked::get(PTy, *$3); + delete $1; delete $3; CHECK_FOR_ERROR } | Types '{' ConstVector '}' { - const StructType *STy = dyn_cast<StructType>($1.type->get()); + const StructType *STy = dyn_cast<StructType>($1->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - $1.type->get()->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); if ($3->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type!"); // Check to ensure that constants are compatible with the type initializer! - std::vector<Constant*> elems; for (unsigned i = 0, e = $3->size(); i != e; ++i) - if ((*$3)[i].cnst->getType() != STy->getElementType(i)) { + if ((*$3)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); - } else - elems.push_back((*$3)[i].cnst); - $$.cnst = ConstantStruct::get(STy, elems); - $$.signedness = isSignless; - delete $1.type; delete $3; + $$ = ConstantStruct::get(STy, *$3); + delete $1; delete $3; CHECK_FOR_ERROR } | Types '{' '}' { - const StructType *STy = dyn_cast<StructType>($1.type->get()); + const StructType *STy = dyn_cast<StructType>($1->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - $1.type->get()->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type!"); - $$.cnst = ConstantStruct::get(STy, std::vector<Constant*>()); - $$.signedness = isSignless; - delete $1.type; + $$ = ConstantStruct::get(STy, std::vector<Constant*>()); + delete $1; CHECK_FOR_ERROR } | Types NULL_TOK { - const PointerType *PTy = dyn_cast<PointerType>($1.type->get()); + const PointerType *PTy = dyn_cast<PointerType>($1->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - $1.type->get()->getDescription() + "'!"); + (*$1)->getDescription() + "'!"); - $$.cnst = ConstantPointerNull::get(PTy); - $$.signedness = isSignless; - delete $1.type; + $$ = ConstantPointerNull::get(PTy); + delete $1; CHECK_FOR_ERROR } | Types UNDEF { - $$.cnst = UndefValue::get($1.type->get()); - $$.signedness = isSignless; - delete $1.type; + $$ = UndefValue::get($1->get()); + delete $1; CHECK_FOR_ERROR } | Types SymbolicValueRef { - const PointerType *Ty = dyn_cast<PointerType>($1.type->get()); + const PointerType *Ty = dyn_cast<PointerType>($1->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type!"); @@ -1649,132 +1552,116 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr } } - $$.cnst = cast<GlobalValue>(V); - $$.signedness = $1.signedness; - delete $1.type; // Free the type handle + $$ = cast<GlobalValue>(V); + delete $1; // Free the type handle CHECK_FOR_ERROR } | Types ConstExpr { - if ($1.type->get() != $2.cnst->getType()) + if ($1->get() != $2->getType()) GEN_ERROR("Mismatched types for constant expression!"); $$ = $2; - delete $1.type; + delete $1; CHECK_FOR_ERROR } | Types ZEROINITIALIZER { - const Type *Ty = $1.type->get(); + const Type *Ty = $1->get(); if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty)) GEN_ERROR("Cannot create a null initialized value of this type!"); - $$.cnst = Constant::getNullValue(Ty); - $$.signedness = isSignless; - delete $1.type; + $$ = Constant::getNullValue(Ty); + delete $1; CHECK_FOR_ERROR - }; - -ConstVal : SIntType EINT64VAL { // integral constants - if (!ConstantInt::isValueValidForType($1.type->get(), $2)) + } + | SIntType EINT64VAL { // integral constants + if (!ConstantInt::isValueValidForType($1, $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$.cnst = ConstantInt::get($1.type->get(), $2); - $$.signedness = $1.signedness; + $$ = ConstantInt::get($1, $2); CHECK_FOR_ERROR } | UIntType EUINT64VAL { // integral constants - if (!ConstantInt::isValueValidForType($1.type->get(), $2)) + if (!ConstantInt::isValueValidForType($1, $2)) GEN_ERROR("Constant value doesn't fit in type!"); - $$.cnst = ConstantInt::get($1.type->get(), $2); - $$.signedness = $1.signedness; + $$ = ConstantInt::get($1, $2); CHECK_FOR_ERROR } | BOOL TRUETOK { // Boolean constants - $$.cnst = ConstantBool::getTrue(); - $$.signedness = isSignless; + $$ = ConstantBool::getTrue(); CHECK_FOR_ERROR } | BOOL FALSETOK { // Boolean constants - $$.cnst = ConstantBool::getFalse(); - $$.signedness = isSignless; + $$ = ConstantBool::getFalse(); CHECK_FOR_ERROR } | FPType FPVAL { // Float & Double constants - if (!ConstantFP::isValueValidForType($1.type->get(), $2)) + if (!ConstantFP::isValueValidForType($1, $2)) GEN_ERROR("Floating point constant invalid for type!!"); - $$.cnst = ConstantFP::get($1.type->get(), $2); - $$.signedness = isSignless; + $$ = ConstantFP::get($1, $2); CHECK_FOR_ERROR }; ConstExpr: CastOps '(' ConstVal TO Types ')' { - Constant *Val = $3.cnst; - const Type *Ty = $5.type->get(); + Constant *Val = $3; + const Type *Ty = $5->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + Val->getType()->getDescription() + "'!"); if (!Ty->isFirstClassType()) GEN_ERROR("cast constant expression to a non-primitive type: '" + Ty->getDescription() + "'!"); - if ($1.obsolete) { - if (Ty == Type::BoolTy) { - // The previous definition of cast to bool was a compare against zero. - // We have to retain that semantic so we do it here. - $$.cnst = ConstantExpr::get(Instruction::SetNE, Val, - Constant::getNullValue(Val->getType())); - } else if (Val->getType()->isFloatingPoint() && isa<PointerType>(Ty)) { - Constant *CE = ConstantExpr::getFPToUI(Val, Type::ULongTy); - $$.cnst = ConstantExpr::getIntToPtr(CE, Ty); - } else { - $$.cnst = ConstantExpr::getCast(Val, Ty); - } - } else { - $$.cnst = ConstantExpr::getCast($1.opcode, $3.cnst, $5.type->get()); - } - delete $5.type; + $$ = ConstantExpr::getCast($1, $3, $5->get()); + delete $5; } | GETELEMENTPTR '(' ConstVal IndexList ')' { - if (!isa<PointerType>($3.cnst->getType())) + if (!isa<PointerType>($3->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); - std::vector<llvm::Value*> IdxVec; - for (unsigned i = 0, e = $4->size(); i < e; ++i) - if (Constant *C = dyn_cast<Constant>((*$4)[i].val)) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant getelementptr must be constants!"); + // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct + // indices to uint struct indices for compatibility. + generic_gep_type_iterator<std::vector<Value*>::iterator> + GTI = gep_type_begin($3->getType(), $4->begin(), $4->end()), + GTE = gep_type_end($3->getType(), $4->begin(), $4->end()); + for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) + if (isa<StructType>(*GTI)) // Only change struct indices + if (ConstantInt *CUI = dyn_cast<ConstantInt>((*$4)[i])) + if (CUI->getType() == Type::UByteTy) + (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); const Type *IdxTy = - GetElementPtrInst::getIndexedType($3.cnst->getType(), IdxVec, true); + GetElementPtrInst::getIndexedType($3->getType(), *$4, true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr!"); + std::vector<Constant*> IdxVec; + for (unsigned i = 0, e = $4->size(); i != e; ++i) + if (Constant *C = dyn_cast<Constant>((*$4)[i])) + IdxVec.push_back(C); + else + GEN_ERROR("Indices to constant getelementptr must be constants!"); + delete $4; - $$.cnst = ConstantExpr::getGetElementPtr($3.cnst, IdxVec); - $$.signedness = isSignless; + $$ = ConstantExpr::getGetElementPtr($3, IdxVec); CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if ($3.cnst->getType() != Type::BoolTy) + if ($3->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); - if ($5.cnst->getType() != $7.cnst->getType()) + if ($5->getType() != $7->getType()) GEN_ERROR("Select operand types must match!"); - $$.cnst = ConstantExpr::getSelect($3.cnst, $5.cnst, $7.cnst); - $$.signedness = isSignless; + $$ = ConstantExpr::getSelect($3, $5, $7); CHECK_FOR_ERROR } | ArithmeticOps '(' ConstVal ',' ConstVal ')' { - if ($3.cnst->getType() != $5.cnst->getType()) + 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.cnst->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 // broken case. See PR424 for more information. - if (!isa<PointerType>($3.cnst->getType())) { - $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); + if (!isa<PointerType>($3->getType())) { + $$ = ConstantExpr::get($1, $3, $5); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -1782,64 +1669,64 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { case Module::Pointer64: IntPtrTy = Type::LongTy; break; default: GEN_ERROR("invalid pointer binary constant expr!"); } - $$.cnst = ConstantExpr::get($1.opcode, - ConstantExpr::getCast($3.cnst, IntPtrTy), - ConstantExpr::getCast($5.cnst, IntPtrTy)); - $$.cnst = ConstantExpr::getCast($$.cnst, $3.cnst->getType()); + $$ = ConstantExpr::get($1, ConstantExpr::getCast($3, IntPtrTy), + ConstantExpr::getCast($5, IntPtrTy)); + $$ = ConstantExpr::getCast($$, $3->getType()); } - $$.signedness = $3.signedness; CHECK_FOR_ERROR } | LogicalOps '(' ConstVal ',' ConstVal ')' { - if ($3.cnst->getType() != $5.cnst->getType()) + if ($3->getType() != $5->getType()) GEN_ERROR("Logical operator types must match!"); - if (!$3.cnst->getType()->isIntegral()) { - if (!isa<PackedType>($3.cnst->getType()) || - !cast<PackedType>($3.cnst->getType())->getElementType()->isIntegral()) + if (!$3->getType()->isIntegral()) { + if (!isa<PackedType>($3->getType()) || + !cast<PackedType>($3->getType())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); - $$.signedness = $3.signedness; + $$ = ConstantExpr::get($1, $3, $5); CHECK_FOR_ERROR } | SetCondOps '(' ConstVal ',' ConstVal ')' { - if ($3.cnst->getType() != $5.cnst->getType()) + if ($3->getType() != $5->getType()) GEN_ERROR("setcc operand types must match!"); - $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); - $$.signedness = isSignless; + $$ = ConstantExpr::get($1, $3, $5); CHECK_FOR_ERROR } + | ICMP '(' IPredicates ',' ConstVal ',' ConstVal ')' { + if ($5->getType() != $7->getType()) + GEN_ERROR("icmp operand types must match!"); + $$ = ConstantExpr::getICmp($3, $5, $7); + } + | FCMP '(' FPredicates ',' ConstVal ',' ConstVal ')' { + if ($5->getType() != $7->getType()) + GEN_ERROR("fcmp operand types must match!"); + $$ = ConstantExpr::getFCmp($3, $5, $7); + } | ShiftOps '(' ConstVal ',' ConstVal ')' { - if ($5.cnst->getType() != Type::UByteTy) + if ($5->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); - if (!$3.cnst->getType()->isInteger()) + if (!$3->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); - // Handle opcode upgrade situations - sanitizeOpcode($1, $3.cnst->getType()); CHECK_FOR_ERROR; - $$.cnst = ConstantExpr::get($1.opcode, $3.cnst, $5.cnst); - $$.signedness = $3.signedness; + $$ = ConstantExpr::get($1, $3, $5); CHECK_FOR_ERROR } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { - if (!ExtractElementInst::isValidOperands($3.cnst, $5.cnst)) + if (!ExtractElementInst::isValidOperands($3, $5)) GEN_ERROR("Invalid extractelement operands!"); - $$.cnst = ConstantExpr::getExtractElement($3.cnst, $5.cnst); - $$.signedness = $3.signedness; + $$ = ConstantExpr::getExtractElement($3, $5); CHECK_FOR_ERROR } | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!InsertElementInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) + if (!InsertElementInst::isValidOperands($3, $5, $7)) GEN_ERROR("Invalid insertelement operands!"); - $$.cnst = ConstantExpr::getInsertElement($3.cnst, $5.cnst, $7.cnst); - $$.signedness = isSignless; + $$ = ConstantExpr::getInsertElement($3, $5, $7); CHECK_FOR_ERROR } | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { - if (!ShuffleVectorInst::isValidOperands($3.cnst, $5.cnst, $7.cnst)) + if (!ShuffleVectorInst::isValidOperands($3, $5, $7)) GEN_ERROR("Invalid shufflevector operands!"); - $$.cnst = ConstantExpr::getShuffleVector($3.cnst, $5.cnst, $7.cnst); - $$.signedness = isSignless; + $$ = ConstantExpr::getShuffleVector($3, $5, $7); CHECK_FOR_ERROR }; @@ -1850,7 +1737,7 @@ ConstVector : ConstVector ',' ConstVal { CHECK_FOR_ERROR } | ConstVal { - $$ = new std::vector<ConstInfo>(); + $$ = new std::vector<Constant*>(); $$->push_back($1); CHECK_FOR_ERROR }; @@ -1917,16 +1804,16 @@ ConstPool : ConstPool OptAssign TYPE TypesV { // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo($2, $4.type->get()); + ResolveTypeTo($2, *$4); - if (!setTypeName($4.type->get(), $2) && !$2) { + if (!setTypeName(*$4, $2) && !$2) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*($4.type)); - } else { - delete $4.type; + CurModule.Types.push_back(*$4); } + + delete $4; CHECK_FOR_ERROR } | ConstPool FunctionProto { // Function prototypes can be in const pool @@ -1936,37 +1823,34 @@ ConstPool : ConstPool OptAssign TYPE TypesV { CHECK_FOR_ERROR } | ConstPool OptAssign OptLinkage GlobalType ConstVal { - if ($5.cnst == 0) + if ($5 == 0) GEN_ERROR("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable($2, $3, $4, $5.cnst->getType(), $5.cnst); + CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; } | ConstPool OptAssign EXTERNAL GlobalType Types { - CurGV = ParseGlobalVariable($2, GlobalValue::ExternalLinkage, $4, - $5.type->get(), 0); + CurGV = ParseGlobalVariable($2, GlobalValue::ExternalLinkage, $4, *$5, 0); CHECK_FOR_ERROR - delete $5.type; + delete $5; } GlobalVarAttributes { CurGV = 0; CHECK_FOR_ERROR } | ConstPool OptAssign DLLIMPORT GlobalType Types { - CurGV = ParseGlobalVariable($2, GlobalValue::DLLImportLinkage, $4, - $5.type->get(), 0); + CurGV = ParseGlobalVariable($2, GlobalValue::DLLImportLinkage, $4, *$5, 0); CHECK_FOR_ERROR - delete $5.type; + delete $5; } GlobalVarAttributes { CurGV = 0; CHECK_FOR_ERROR } | ConstPool OptAssign EXTERN_WEAK GlobalType Types { CurGV = - ParseGlobalVariable($2, GlobalValue::ExternalWeakLinkage, $4, - $5.type->get(), 0); + ParseGlobalVariable($2, GlobalValue::ExternalWeakLinkage, $4, *$5, 0); CHECK_FOR_ERROR - delete $5.type; + delete $5; } GlobalVarAttributes { CurGV = 0; CHECK_FOR_ERROR @@ -2044,9 +1928,9 @@ Name : VAR_ID | STRINGCONSTANT; OptName : Name | /*empty*/ { $$ = 0; }; ArgVal : Types OptName { - if ($1.type->get() == Type::VoidTy) + if (*$1 == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); - $$ = new std::pair<TypeInfo, char*>($1, $2); + $$ = new std::pair<PATypeHolder*, char*>($1, $2); CHECK_FOR_ERROR }; @@ -2057,7 +1941,7 @@ ArgListH : ArgListH ',' ArgVal { CHECK_FOR_ERROR } | ArgVal { - $$ = new std::vector<std::pair<TypeInfo,char*> >(); + $$ = new std::vector<std::pair<PATypeHolder*,char*> >(); $$->push_back(*$1); delete $1; CHECK_FOR_ERROR @@ -2069,18 +1953,13 @@ ArgList : ArgListH { } | ArgListH ',' DOTDOTDOT { $$ = $1; - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); - TI.signedness = isSignless; - $$->push_back(std::pair<TypeInfo,char*>(TI,(char*)0)); + $$->push_back(std::pair<PATypeHolder*, + char*>(new PATypeHolder(Type::VoidTy), 0)); CHECK_FOR_ERROR } | DOTDOTDOT { - $$ = new std::vector<std::pair<TypeInfo,char*> >(); - TypeInfo TI; - TI.type = new PATypeHolder(Type::VoidTy); - TI.signedness = isSignless; - $$->push_back(std::make_pair(TI, (char*)0)); + $$ = new std::vector<std::pair<PATypeHolder*,char*> >(); + $$->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); CHECK_FOR_ERROR } | /* empty */ { @@ -2094,23 +1973,22 @@ FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' std::string FunctionName($3); free($3); // Free strdup'd memory! - if (!($2.type->get())->isFirstClassType() && $2.type->get() != Type::VoidTy) + if (!(*$2)->isFirstClassType() && *$2 != Type::VoidTy) GEN_ERROR("LLVM functions cannot return aggregate types!"); std::vector<const Type*> ParamTypeList; if ($5) { // If there are arguments... - for (std::vector<std::pair<TypeInfo,char*> >::iterator I = $5->begin(); + for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = $5->begin(); I != $5->end(); ++I) - ParamTypeList.push_back(I->first.type->get()); + ParamTypeList.push_back(I->first->get()); } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - const FunctionType *FT = FunctionType::get($2.type->get(), ParamTypeList, - isVarArg); + const FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg); const PointerType *PFT = PointerType::get(FT); - delete $2.type; + delete $2; ValID ID; if (!FunctionName.empty()) { @@ -2164,19 +2042,21 @@ FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' // Add all of the arguments we parsed to the function... if ($5) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert($5->back().first.type->get() == Type::VoidTy && - $5->back().second == 0 && "Not a varargs marker!"); - delete $5->back().first.type; + assert($5->back().first->get() == Type::VoidTy && $5->back().second == 0&& + "Not a varargs marker!"); + delete $5->back().first; $5->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); - for (std::vector<std::pair<TypeInfo,char*> >::iterator I = $5->begin(); + for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = $5->begin(); I != $5->end(); ++I, ++ArgIt) { - delete I->first.type; // Delete the typeholder... + delete I->first; // Delete the typeholder... + setValueName(ArgIt, I->second); // Insert arg into symtab... CHECK_FOR_ERROR InsertValue(ArgIt); } + delete $5; // We're now done with the argument list } CHECK_FOR_ERROR @@ -2255,30 +2135,32 @@ ConstValueRef : ESINT64VAL { // A reference to a direct constant CHECK_FOR_ERROR } | '<' ConstVector '>' { // Nonempty unsized packed vector - const Type *ETy = (*$2)[0].cnst->getType(); + const Type *ETy = (*$2)[0]->getType(); int NumElements = $2->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( - HandleUpRefs(PackedType::get( ETy, NumElements))); + HandleUpRefs( + PackedType::get( + ETy, + NumElements) + ) + ); // Verify all elements are correct type! - std::vector<Constant*> elems; for (unsigned i = 0; i < $2->size(); i++) { - if (ETy != (*$2)[i].cnst->getType()) { + if (ETy != (*$2)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*$2)[i].cnst->getType()->getDescription() + "'."); - } else - elems.push_back((*$2)[i].cnst); + (*$2)[i]->getType()->getDescription() + "'."); } - $$ = ValID::create(ConstantPacked::get(pt, elems)); + $$ = ValID::create(ConstantPacked::get(pt, *$2)); delete PTy; delete $2; CHECK_FOR_ERROR } | ConstExpr { - $$ = ValID::create($1.cnst); + $$ = ValID::create($1); CHECK_FOR_ERROR } | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { @@ -2312,10 +2194,8 @@ ValueRef : SymbolicValueRef | ConstValueRef; // type immediately preceeds the value reference, and allows complex constant // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { - $$.val = getVal($1.type->get(), $2); - delete $1.type; + $$ = getVal(*$1, $2); delete $1; CHECK_FOR_ERROR - $$.signedness = $1.signedness; }; BasicBlockList : BasicBlockList BasicBlock { @@ -2377,7 +2257,7 @@ InstructionList : InstructionList Inst { }; BBTerminatorInst : RET ResolvedVal { // Return with a result... - $$ = new ReturnInst($2.val); + $$ = new ReturnInst($2); CHECK_FOR_ERROR } | RET VOID { // Return with no result... @@ -2399,7 +2279,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... $$ = new BranchInst(tmpBBA, tmpBBB, tmpVal); } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' { - Value* tmpVal = getVal($2.type->get(), $3); + Value* tmpVal = getVal($2, $3); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal($6); CHECK_FOR_ERROR @@ -2418,7 +2298,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... CHECK_FOR_ERROR } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' { - Value* tmpVal = getVal($2.type->get(), $3); + Value* tmpVal = getVal($2, $3); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal($6); CHECK_FOR_ERROR @@ -2431,20 +2311,20 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast<PointerType>($3.type->get())) || + if (!(PFTy = dyn_cast<PointerType>($3->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; if ($6) { - for (std::vector<ValueInfo>::iterator I = $6->begin(), E = $6->end(); + for (std::vector<Value*>::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I).val->getType()); + ParamTypes.push_back((*I)->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get($3.type->get(), ParamTypes, isVarArg); + Ty = FunctionType::get($3->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } @@ -2464,30 +2344,21 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector<ValueInfo>::iterator ArgI = $6->begin(), ArgE = $6->end(); - - std::vector<Value*> args; - for (; ArgI != ArgE; ++ArgI) - if (I == E) { - if (Ty->isVarArg()) { - args.push_back((*ArgI).val); - } else { - GEN_ERROR("Too many parameters for function of type " + - Ty->getDescription()); - } - } else { - if ((*ArgI).val->getType() != *I) { - GEN_ERROR("Parameter " + (*ArgI).val->getName() + - " is not of type '" + (*I)->getDescription() + "'!"); - } else - args.push_back((*ArgI).val); - ++I; - } - $$ = new InvokeInst(V, Normal, Except, args); + std::vector<Value*>::iterator ArgI = $6->begin(), ArgE = $6->end(); + + for (; ArgI != ArgE && I != E; ++ArgI, ++I) + if ((*ArgI)->getType() != *I) + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + + (*I)->getDescription() + "'!"); + + if (I != E || (ArgI != ArgE && !Ty->isVarArg())) + GEN_ERROR("Invalid number of parameters detected!"); + + $$ = new InvokeInst(V, Normal, Except, *$6); } cast<InvokeInst>($$)->setCallingConv($2); - delete $3.type; + delete $3; delete $6; CHECK_FOR_ERROR } @@ -2504,7 +2375,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef { $$ = $1; - Constant *V = cast<Constant>(getValNonImprovising($2.type->get(), $3)); + Constant *V = cast<Constant>(getValNonImprovising($2, $3)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value!"); @@ -2515,7 +2386,7 @@ JumpTable : JumpTable IntType ConstValueRef ',' LABEL ValueRef { } | IntType ConstValueRef ',' LABEL ValueRef { $$ = new std::vector<std::pair<Constant*, BasicBlock*> >(); - Constant *V = cast<Constant>(getValNonImprovising($1.type->get(), $2)); + Constant *V = cast<Constant>(getValNonImprovising($1, $2)); CHECK_FOR_ERROR if (V == 0) @@ -2537,12 +2408,12 @@ Inst : OptAssign InstVal { PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes $$ = new std::list<std::pair<Value*, BasicBlock*> >(); - Value* tmpVal = getVal($1.type->get(), $3); + Value* tmpVal = getVal(*$1, $3); CHECK_FOR_ERROR BasicBlock* tmpBB = getBBVal($5); CHECK_FOR_ERROR $$->push_back(std::make_pair(tmpVal, tmpBB)); - delete $1.type; + delete $1; } | PHIList ',' '[' ValueRef ',' ValueRef ']' { $$ = $1; @@ -2555,7 +2426,7 @@ PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes ValueRefList : ResolvedVal { // Used for call statements, and memory insts... - $$ = new std::vector<ValueInfo>(); + $$ = new std::vector<Value*>(); $$->push_back($1); } | ValueRefList ',' ResolvedVal { @@ -2565,12 +2436,7 @@ ValueRefList : ResolvedVal { // Used for call statements, and memory insts... }; // ValueRefListE - Just like ValueRefList, except that it may also be empty! -ValueRefListE : ValueRefList { - $$ = $1; - } - | /*empty*/ { - $$ = 0; - }; +ValueRefListE : ValueRefList | /*empty*/ { $$ = 0; }; OptTailCall : TAIL CALL { $$ = true; @@ -2582,123 +2448,125 @@ OptTailCall : TAIL CALL { }; InstVal : ArithmeticOps Types ValueRef ',' ValueRef { - if (!$2.type->get()->isInteger() && !$2.type->get()->isFloatingPoint() && - !isa<PackedType>($2.type->get())) + if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && + !isa<PackedType>((*$2).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa<PackedType>($2.type->get()) && - ($1.opcode == Instruction::URem || - $1.opcode == Instruction::SRem || - $1.opcode == Instruction::FRem)) + if (isa<PackedType>((*$2).get()) && + ($1 == Instruction::URem || + $1 == Instruction::SRem || + $1 == 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.type->get()); - CHECK_FOR_ERROR; - Value* val1 = getVal($2.type->get(), $3); + Value* val1 = getVal(*$2, $3); CHECK_FOR_ERROR - Value* val2 = getVal($2.type->get(), $5); + Value* val2 = getVal(*$2, $5); CHECK_FOR_ERROR - $$ = BinaryOperator::create($1.opcode, val1, val2); + $$ = BinaryOperator::create($1, val1, val2); if ($$ == 0) GEN_ERROR("binary operator returned null!"); - delete $2.type; + delete $2; } | LogicalOps Types ValueRef ',' ValueRef { - if (!$2.type->get()->isIntegral()) { - if (!isa<PackedType>($2.type->get()) || - !cast<PackedType>($2.type->get())->getElementType()->isIntegral()) + if (!(*$2)->isIntegral()) { + if (!isa<PackedType>($2->get()) || + !cast<PackedType>($2->get())->getElementType()->isIntegral()) GEN_ERROR("Logical operator requires integral operands!"); } - Value* tmpVal1 = getVal($2.type->get(), $3); + Value* tmpVal1 = getVal(*$2, $3); CHECK_FOR_ERROR - Value* tmpVal2 = getVal($2.type->get(), $5); + Value* tmpVal2 = getVal(*$2, $5); CHECK_FOR_ERROR - $$ = BinaryOperator::create($1.opcode, tmpVal1, tmpVal2); + $$ = BinaryOperator::create($1, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("binary operator returned null!"); - delete $2.type; + delete $2; } | SetCondOps Types ValueRef ',' ValueRef { - if(isa<PackedType>($2.type->get())) { + if(isa<PackedType>((*$2).get())) { GEN_ERROR( "PackedTypes currently not supported in setcc instructions!"); } - Value* tmpVal1 = getVal($2.type->get(), $3); + Value* tmpVal1 = getVal(*$2, $3); CHECK_FOR_ERROR - Value* tmpVal2 = getVal($2.type->get(), $5); + Value* tmpVal2 = getVal(*$2, $5); CHECK_FOR_ERROR - $$ = new SetCondInst($1.opcode, tmpVal1, tmpVal2); + $$ = new SetCondInst($1, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("binary operator returned null!"); - delete $2.type; + delete $2; + } + | ICMP IPredicates Types ValueRef ',' ValueRef { + if (isa<PackedType>((*$3).get())) + GEN_ERROR("Packed types not supported by icmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("icmp operator returned null!"); + } + | FCMP FPredicates Types ValueRef ',' ValueRef { + if (isa<PackedType>((*$3).get())) + GEN_ERROR("Packed types not supported by fcmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("fcmp operator returned null!"); } | NOT ResolvedVal { llvm_cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue($2.val->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue($2->getType()); if (Ones == 0) GEN_ERROR("Expected integral type for not instruction!"); - $$ = BinaryOperator::create(Instruction::Xor, $2.val, Ones); + $$ = BinaryOperator::create(Instruction::Xor, $2, Ones); if ($$ == 0) GEN_ERROR("Could not create a xor instruction!"); CHECK_FOR_ERROR } | ShiftOps ResolvedVal ',' ResolvedVal { - if ($4.val->getType() != Type::UByteTy) + if ($4->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); - if (!$2.val->getType()->isInteger()) + if (!$2->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); - // Handle opcode upgrade situations - sanitizeOpcode($1, $2.val->getType()); CHECK_FOR_ERROR; - $$ = new ShiftInst($1.opcode, $2.val, $4.val); + $$ = new ShiftInst($1, $2, $4); CHECK_FOR_ERROR } | CastOps ResolvedVal TO Types { - Value* Val = $2.val; - const Type* Ty = $4.type->get(); + Value* Val = $2; + const Type* Ty = $4->get(); if (!Val->getType()->isFirstClassType()) GEN_ERROR("cast from a non-primitive type: '" + Val->getType()->getDescription() + "'!"); if (!Ty->isFirstClassType()) GEN_ERROR("cast to a non-primitive type: '" + Ty->getDescription() +"'!"); - - if ($1.obsolete) { - if (Ty == Type::BoolTy) { - // The previous definition of cast to bool was a compare against zero. - // We have to retain that semantic so we do it here. - $$ = new SetCondInst(Instruction::SetNE, $2.val, - Constant::getNullValue($2.val->getType())); - } else if (Val->getType()->isFloatingPoint() && isa<PointerType>(Ty)) { - CastInst *CI = new FPToUIInst(Val, Type::ULongTy); - $$ = new IntToPtrInst(CI, Ty); - } else { - $$ = CastInst::createInferredCast(Val, Ty); - } - } else { - $$ = CastInst::create($1.opcode, $2.val, $4.type->get()); - } - delete $4.type; + $$ = CastInst::create($1, $2, $4->get()); + delete $4; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if ($2.val->getType() != Type::BoolTy) + if ($2->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); - if ($4.val->getType() != $6.val->getType()) + if ($4->getType() != $6->getType()) GEN_ERROR("select value types should match!"); - $$ = new SelectInst($2.val, $4.val, $6.val); + $$ = new SelectInst($2, $4, $6); CHECK_FOR_ERROR } | VAARG ResolvedVal ',' Types { NewVarArgs = true; - $$ = new VAArgInst($2.val, $4.type->get()); - delete $4.type; + $$ = new VAArgInst($2, *$4); + delete $4; CHECK_FOR_ERROR } | VAARG_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2.val->getType(); + const Type* ArgTy = $2->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2709,16 +2577,16 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2.val); + CallInst* bar = new CallInst(NF, $2); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - $$ = new VAArgInst(foo, $4.type->get()); - delete $4.type; + $$ = new VAArgInst(foo, *$4); + delete $4; CHECK_FOR_ERROR } | VANEXT_old ResolvedVal ',' Types { ObsoleteVarArgs = true; - const Type* ArgTy = $2.val->getType(); + const Type* ArgTy = $2->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -2730,31 +2598,31 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, $2.val); + CallInst* bar = new CallInst(NF, $2); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - Instruction* tmp = new VAArgInst(foo, $4.type->get()); + Instruction* tmp = new VAArgInst(foo, *$4); CurBB->getInstList().push_back(tmp); $$ = new LoadInst(foo); - delete $4.type; + delete $4; CHECK_FOR_ERROR } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { - if (!ExtractElementInst::isValidOperands($2.val, $4.val)) + if (!ExtractElementInst::isValidOperands($2, $4)) GEN_ERROR("Invalid extractelement operands!"); - $$ = new ExtractElementInst($2.val, $4.val); + $$ = new ExtractElementInst($2, $4); CHECK_FOR_ERROR } | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!InsertElementInst::isValidOperands($2.val, $4.val, $6.val)) + if (!InsertElementInst::isValidOperands($2, $4, $6)) GEN_ERROR("Invalid insertelement operands!"); - $$ = new InsertElementInst($2.val, $4.val, $6.val); + $$ = new InsertElementInst($2, $4, $6); CHECK_FOR_ERROR } | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if (!ShuffleVectorInst::isValidOperands($2.val, $4.val, $6.val)) + if (!ShuffleVectorInst::isValidOperands($2, $4, $6)) GEN_ERROR("Invalid shufflevector operands!"); - $$ = new ShuffleVectorInst($2.val, $4.val, $6.val); + $$ = new ShuffleVectorInst($2, $4, $6); CHECK_FOR_ERROR } | PHI_TOK PHIList { @@ -2776,24 +2644,23 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast<PointerType>($3.type->get())) || + if (!(PFTy = dyn_cast<PointerType>($3->get())) || !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector<const Type*> ParamTypes; if ($6) { - for (std::vector<ValueInfo>::iterator I = $6->begin(), E = $6->end(); + for (std::vector<Value*>::iterator I = $6->begin(), E = $6->end(); I != E; ++I) - ParamTypes.push_back((*I).val->getType()); + ParamTypes.push_back((*I)->getType()); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - if (!$3.type->get()->isFirstClassType() && - $3.type->get() != Type::VoidTy) + if (!(*$3)->isFirstClassType() && *$3 != Type::VoidTy) GEN_ERROR("LLVM functions cannot return aggregate types!"); - Ty = FunctionType::get($3.type->get(), ParamTypes, isVarArg); + Ty = FunctionType::get($3->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } @@ -2814,34 +2681,21 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector<ValueInfo>::iterator ArgI = $6->begin(), ArgE = $6->end(); - - std::vector<Value*> args; - for (; ArgI != ArgE ; ++ArgI) - if (I == E) { - if (Ty->isVarArg()) { - args.push_back((*ArgI).val); - } else { - GEN_ERROR("Too many parameters for function of type " + - Ty->getDescription()); - } - } else { - if ((*ArgI).val->getType() != *I) { - GEN_ERROR("Parameter " + (*ArgI).val->getName() + - " is not of type '" + (*I)->getDescription() + "'!"); - } else - args.push_back((*ArgI).val); - ++I; - } + std::vector<Value*>::iterator ArgI = $6->begin(), ArgE = $6->end(); + + for (; ArgI != ArgE && I != E; ++ArgI, ++I) + if ((*ArgI)->getType() != *I) + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) GEN_ERROR("Invalid number of parameters detected!"); - $$ = new CallInst(V, args); + $$ = new CallInst(V, *$6); } cast<CallInst>($$)->setTailCall($1); cast<CallInst>($$)->setCallingConv($2); - delete $3.type; + delete $3; delete $6; CHECK_FOR_ERROR } @@ -2856,7 +2710,7 @@ IndexList : ',' ValueRefList { $$ = $2; CHECK_FOR_ERROR } | /* empty */ { - $$ = new std::vector<ValueInfo>(); + $$ = new std::vector<Value*>(); CHECK_FOR_ERROR }; @@ -2872,77 +2726,84 @@ OptVolatile : VOLATILE { MemoryInst : MALLOC Types OptCAlign { - $$ = new MallocInst($2.type->get(), 0, $3); - delete $2.type; + $$ = new MallocInst(*$2, 0, $3); + delete $2; CHECK_FOR_ERROR } | MALLOC Types ',' UINT ValueRef OptCAlign { - Value* tmpVal = getVal($4.type->get(), $5); + Value* tmpVal = getVal($4, $5); CHECK_FOR_ERROR - $$ = new MallocInst($2.type->get(), tmpVal, $6); - delete $2.type; + $$ = new MallocInst(*$2, tmpVal, $6); + delete $2; } | ALLOCA Types OptCAlign { - $$ = new AllocaInst($2.type->get(), 0, $3); - delete $2.type; + $$ = new AllocaInst(*$2, 0, $3); + delete $2; CHECK_FOR_ERROR } | ALLOCA Types ',' UINT ValueRef OptCAlign { - Value* tmpVal = getVal($4.type->get(), $5); + Value* tmpVal = getVal($4, $5); CHECK_FOR_ERROR - $$ = new AllocaInst($2.type->get(), tmpVal, $6); - delete $2.type; + $$ = new AllocaInst(*$2, tmpVal, $6); + delete $2; } | FREE ResolvedVal { - if (!isa<PointerType>($2.val->getType())) + if (!isa<PointerType>($2->getType())) GEN_ERROR("Trying to free nonpointer type " + - $2.val->getType()->getDescription() + "!"); - $$ = new FreeInst($2.val); + $2->getType()->getDescription() + "!"); + $$ = new FreeInst($2); CHECK_FOR_ERROR } | OptVolatile LOAD Types ValueRef { - if (!isa<PointerType>($3.type->get())) + if (!isa<PointerType>($3->get())) GEN_ERROR("Can't load from nonpointer type: " + - $3.type->get()->getDescription()); - if (!cast<PointerType>($3.type->get())->getElementType()->isFirstClassType()) + (*$3)->getDescription()); + if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - $3.type->get()->getDescription()); - Value* tmpVal = getVal($3.type->get(), $4); + (*$3)->getDescription()); + Value* tmpVal = getVal(*$3, $4); CHECK_FOR_ERROR $$ = new LoadInst(tmpVal, "", $1); - delete $3.type; + delete $3; } | OptVolatile STORE ResolvedVal ',' Types ValueRef { - const PointerType *PT = dyn_cast<PointerType>($5.type->get()); + const PointerType *PT = dyn_cast<PointerType>($5->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - ($5.type->get())->getDescription()); + (*$5)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != $3.val->getType()) - GEN_ERROR("Can't store '" + $3.val->getType()->getDescription() + + if (ElTy != $3->getType()) + GEN_ERROR("Can't store '" + $3->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); - Value* tmpVal = getVal($5.type->get(), $6); + Value* tmpVal = getVal(*$5, $6); CHECK_FOR_ERROR - $$ = new StoreInst($3.val, tmpVal, $1); - delete $5.type; + $$ = new StoreInst($3, tmpVal, $1); + delete $5; } | GETELEMENTPTR Types ValueRef IndexList { - if (!isa<PointerType>($2.type->get())) + if (!isa<PointerType>($2->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); - std::vector<Value*> indices; - for (unsigned i = 0, e = $4->size(); i != e; ++i) - indices.push_back((*$4)[i].val); - - if (!GetElementPtrInst::getIndexedType($2.type->get(), indices, true)) + // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct + // indices to uint struct indices for compatibility. + generic_gep_type_iterator<std::vector<Value*>::iterator> + GTI = gep_type_begin($2->get(), $4->begin(), $4->end()), + GTE = gep_type_end($2->get(), $4->begin(), $4->end()); + for (unsigned i = 0, e = $4->size(); i != e && GTI != GTE; ++i, ++GTI) + if (isa<StructType>(*GTI)) // Only change struct indices + if (ConstantInt *CUI = dyn_cast<ConstantInt>((*$4)[i])) + if (CUI->getType() == Type::UByteTy) + (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + + if (!GetElementPtrInst::getIndexedType(*$2, *$4, true)) GEN_ERROR("Invalid getelementptr indices for type '" + - $2.type->get()->getDescription()+ "'!"); - Value* tmpVal = getVal($2.type->get(), $3); + (*$2)->getDescription()+ "'!"); + Value* tmpVal = getVal(*$2, $3); CHECK_FOR_ERROR - $$ = new GetElementPtrInst(tmpVal, indices); - delete $2.type; + $$ = new GetElementPtrInst(tmpVal, *$4); + delete $2; delete $4; }; |