1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
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
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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
|
;; -*- Lisp -*-
;; file libmelt-ana-gimple.melt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(comment "***
Copyright 2008 - 2015 Free Software Foundation, Inc.
Contributed by Basile Starynkevitch <basile@starynkevitch.net>
and Jeremie Salvucci <jeremie.salvucci@free.fr>
and Pierre Vittet <piervit@pvittet.com>
and Romain Geissler <romain.geissler@gmail.com>
This file libmelt-ana-gimple.{melt,cc} is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>.
***")
;; the copyright notice above apply both to libmelt-ana-gimple.melt and
;; to the generated file libmelt-ana-gimple*.c
;; This MELT module is GPL compatible since it is GPLv3+ licensed.
(module_is_gpl_compatible "GPLv3+")
;;;****************************************************************
;; list of still unhandled GIMPLE codes from gimple.def
;; GIMPLE_OMP_ATOMIC_LOAD
;; GIMPLE_OMP_ATOMIC_STORE
;; GIMPLE_OMP_CONTINUE
;; GIMPLE_OMP_CRITICAL
;; GIMPLE_OMP_FOR
;; GIMPLE_OMP_MASTER
;; GIMPLE_OMP_TASKGROUP
;; GIMPLE_OMP_ORDERED
;; GIMPLE_OMP_PARALLEL
;; GIMPLE_OMP_TASK
;; GIMPLE_OMP_RETURN
;; GIMPLE_OMP_SECTION
;; GIMPLE_OMP_SECTIONS
;; GIMPLE_OMP_SECTIONS_SWITCH
;; GIMPLE_OMP_SINGLE
;; GIMPLE_OMP_TARGET
;; GIMPLE_OMP_TEAMS
;;;****************************************************************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; gimple related primitives
(defprimitive is_gimple (v) :long
:doc #{Test if value $V is a boxed gimple.}#
#{(melt_magic_discr((melt_ptr_t)($v)) == MELTOBMAG_GIMPLE)}# )
(defprimitive make_gimple (discr :gimple g) :value
:doc #{Make a boxed gimple of given $DISCR and gimple $G.}#
#{(meltgc_new_gimple((meltobject_ptr_t)($discr),($g)))}# )
(defprimitive gimple_content (v) :gimple
:doc #{Retrieve the gimple stuff inside boxed gimple $V or else NULL}#
#{(melt_gimple_content((melt_ptr_t)($v)))}# )
(defprimitive ==g (:gimple g1 g2) :long
:doc #{Equality of gimples $G1 & $G2}#
#{(($g1) == ($g2))}#)
(defprimitive null_gimple ()
:gimple
:doc #{The null gimple.}#
#{((gimple)NULL)}#)
(defprimitive gimple_seq_of_basic_block (:basic_block bb) :gimple_seq
:doc #{Retrieve the gimple seq inside basic block $BB or null.}#
#{(($bb)?bb_seq(($bb)):NULL)}#)
(defprimitive gimple_seq_first_stmt (:gimple_seq gs) :gimple
:doc #{Retrieve the first gimple inside basic block $BB or null.}#
#{(($GS)?gimple_seq_first_stmt(($GS)):NULL)}#)
(defprimitive gimple_seq_last_stmt (:gimple_seq gs) :gimple
:doc #{Retrieve the last gimple inside basic block $BB or null.}#
#{(($GS)?gimple_seq_last_stmt(($GS)):NULL)}#)
;;; copy an unboxed gimple_copy
(defprimitive gimple_copy (:gimple g) :gimple
:doc #{Copy gimple stuff $G.}#
#{ (($g)?gimple_copy($g):NULL) }#)
;;;;;;;;;;;;;;;; map associating GCC gimple-s to non-null MELT values
(defprimitive is_mapgimple (map) :long
:doc #{Test if $MAP is a map of gimples.}#
#{ (melt_magic_discr((melt_ptr_t)($map)) == MELTOBMAG_MAPGIMPLES) }#)
(defprimitive mapgimple_size (map) :long
:doc #{Give the allocated size of a map of gimples $MAP.}#
#{ (melt_size_mapgimples((struct meltmapgimples_st*)($map))) }#)
;; primitive to get the attribute count of a mapgimple
(defprimitive mapgimple_count (map) :long
:doc #{Give the used count of a map of gimples $MAP.}#
#{ (melt_count_mapgimples((struct meltmapgimples_st*)($map))) }# )
;; get an entry in a mapgimple from a C gimple
(defprimitive mapgimple_get (map :gimple g) :value
:doc #{Safely get the value associated to gimple $G in map of gimples $MAP.}#
#{(melt_get_mapgimples((melt_ptr_t) ($MAP), ($G)))}#)
;; primitive for making a new map of gimples
(defprimitive make_mapgimple (discr :long len) :value
:doc #{Make a map of gimple keys of given $DISCR and $LEN.}#
#{(meltgc_new_mapgimples((meltobject_ptr_t) ($discr), ($len)))}#)
;; primitive for putting into a map of gimples
(defprimitive mapgimple_put (map :gimple gkey :value val) :void
:doc #{Safely put in map of gimple $MAP the gimple key $GKEY associated to $VAL.}#
#{melt_put_mapgimples((melt_ptr_t) ($MAP),
($GKEY), (melt_ptr_t) ($VAL))}#)
;; primitive for removing from a map of gimples
(defprimitive mapgimple_remove (map :gimple gkey) :void
:doc #{Safely remove in map of gimple $MAP the entry for gimple key $GKEY.}#
#{melt_remove_mapgimples((melt_ptr_t)($MAP), ($GKEY))}#)
;; get the auxiliary data from map of gimples
(defprimitive mapgimple_aux (map) :value
:doc #{Safely retrieve the auxiliary data of map of gimples $MAP.}#
#{melt_auxdata_mapgimples((melt_ptr_t)$MAP)}#)
;; put the auxiliary data in map of gimples
(defprimitive mapgimple_auxput (map aux) :void
:doc #{Safely put the auxiliary data of map of gimples $MAP as $AUX.}#
#{melt_auxput_mapgimples((melt_ptr_t)$MAP,(melt_ptr_t)$AUX)}#)
;; primitive to get the nth gimple of a mapgimple
(defprimitive mapgimple_nth_attr (map :long n) :gimple
#{(melt_nthattr_mapgimples((struct meltmapgimples_st*)($map), (int)($n)))}#)
;; primitive to get the nth value of a mapobject
(defprimitive mapgimple_nth_val (map :long n) :value
#{(melt_nthval_mapgimples((struct meltmapgimples_st*)($map), (int)($n)))}# )
;; iterator inside mapgimple
(defciterator foreach_mapgimple
(gimap) ; startformals
eachgimap ;state symbol
(:gimple att :value val) ;local formals
:doc #{Iterate inside the $GIMAP value -a map from gimples to values- for each gimple $ATT and value $VAL.}#
;; before expansion
#{
/* foreach_mapgimple $EACHGIMAP*/ int $EACHGIMAP#_rk=0;
for ($EACHGIMAP#_rk=0;
$EACHGIMAP#_rk < (int)melt_size_mapgimples((struct meltmapgimples_st*)($GIMAP));
$EACHGIMAP#_rk++) {
$ATT = (gimple) NULL;
$VAL = NULL;
gimple $EACHGIMAP#_gi = ((struct meltmapgimples_st*)($GIMAP))->entab[$EACHGIMAP#_rk].e_at;
if (!$EACHGIMAP#_gi
|| (void*) $EACHGIMAP#_gi == (void*) HTAB_DELETED_ENTRY) continue;
$ATT = $EACHGIMAP#_gi;
$VAL = ((struct meltmapgimples_st*)($GIMAP))->entab[$EACHGIMAP#_rk].e_va;
}#
;;after expansion
#{
} /*end foreach_mapgimple $EACHGIMAP*/
$ATT = (gimple) NULL;
$VAL = NULL;
}#
)
;; match a gimple value & extract the gimple of it
(defcmatcher gimpleval
(gv) ;match & no ins
(:gimple g) ;outs
gimpsta ;statesymb
:doc #{Match a gimple boxed value $GV and extract its gimple stuff $G.
As operator, build a boxed gimple from $G.}#
;; test expansion
#{ (melt_magic_discr((melt_ptr_t)($gv)) == MELTOBMAG_GIMPLE) }#
;; fill expansion
#{ $g = melt_gimple_content(((melt_ptr_t)($gv)));
}#
;; operator expansion
#{ (meltgc_new_gimple((meltobject_ptr_t)NULL, ($g))) }#
)
;; match a gimple at a known location and extract its location
(defcmatcher gimple_at_source_location
(:gimple g)
(:value filepathv
:long line
:long col)
gimpleatloc
:doc #{$GIMPLE_AT_SOURCE_LOCATION match a gimple with a known source
location, extracting the cached $FILEPATHV string value and the
$LINE and $COL info.}#
;; test expander
#{/* gimple_at_source_location $GIMPLEATLOC ? */ (($G)
&& gimple_has_location(($G))) }#
;; test filler
#{/* gimple_at_source_location $GIMPLEATLOC ! */ {
source_location $GIMPLEATLOC#_sloc = gimple_location ($G);
$FILEPATHV =
meltgc_cached_string_path_of_source_location ($GIMPLEATLOC#_sloc);
$LINE = LOCATION_LINE ($GIMPLEATLOC#_sloc);
$COL = LOCATION_COLUMN ($GIMPLEATLOC#_sloc);
} /* end gimple_at_source_location $GIMPLEATLOC ! */}#)
;; match a gimple assign to something
(defcmatcher gimple_assign_to
(:gimple ga) ;match
;; outputs
(:tree lhs ;left hand side
)
gimpassto
:doc #{Match gimple $GA as some kind of assignment to $LHS.}#
;; test expansion
#{/* gimple_assign_to $GIMPASSTO ?*/ ($GA && is_gimple_assign($GA)) }#
;; fill expansion
#{/* gimple_assign_to $GIMPASSTO !*/ $LHS = gimple_assign_lhs ($GA);
}#
;; no operator expansion
)
;; match or build a gimple single assign
(defcmatcher gimple_assign_single
(:gimple ga) ;match
;; outputs
(:tree lhs ;left hand side
:tree rhs ;first right operand
)
gimpassi
:doc #{Match gimple $GA as a single assign into tree $LHS of tree $RHS, or build such an assign.}#
;; test expansion
#{/* gimple_assign_single $gimpassi test*/ ($ga && gimple_assign_single_p ($ga))}#
;;fill expansion
#{/* gimple_assign_single $gimpassi fill*/
$lhs = gimple_assign_lhs($ga);
$rhs = gimple_assign_rhs1($ga);
}#
;; operator expansion
#{/* gimple_assign_single:*/ ($LHS != NULL_TREE && $RHS != NULL_TREE)?gimple_build_assign(($LHS),($RHS)):((gimple)0)}#
)
;; match a gimple cast assign
(defcmatcher gimple_assign_cast
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs ;first right operand
) ;outs
gimpascs
:doc #{Match gimple $GA as a casting assign into tree $LHS of tree $RHS.
See also $GIMPLE_BUILD_ASSIGN_CONVERT, $GIMPLE_BUILD_ASSIGN_VIEW_CONVERT, $GIMPLE_BUILD_ASSIGN_FLOAT.}#
;;test expansion
#{/* gimple_assign_cast $GIMPASCS test*/($ga && gimple_assign_cast_p ($ga))}#
;;fill expansion
#{/* gimple_assign_cast $GIMPASCS fill*/
$lhs = gimple_assign_lhs($ga);
$rhs = gimple_assign_rhs1($ga);
}#
)
(defprimitive gimple_build_assign_convert (:tree tlhs trhs) :gimple
:doc #{Build a gimple to assign and convert to $TLHS the tree $TRHS, if both are non-null.}#
#{ /*gimple_build_assign_convert*/ ($TLHS != (tree)0
&& $TRHS != (tree)0)
?
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($TLHS), CONVERT_EXPR, $(TRHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops (CONVERT_EXPR,($TLHS),($TRHS), NULL)
#endif /* GCC 5.0 or GCC 4.9 */
:((gimple)0)
}#
)
(defprimitive gimple_build_assign_view_convert (:tree tlhs trhs) :gimple
:doc #{Build a gimple to assign and view convert to $TLHS the tree $TRHS, if both are non-null.}#
#{/*gimple_build_assign_view_convert*/ ($TLHS != (tree)0
&& $TRHS != (tree)0)
?
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($TLHS), VIEW_CONVERT_EXPR, ($TRHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(VIEW_CONVERT_EXPR,
($TLHS),($TRHS), NULL)
#endif /* GCC 5.0 or GCC 4.9 */
:((gimple)0)}#
)
(defprimitive gimple_build_assign_fix_trunc (:tree tlhs trhs) :gimple
:doc #{Build a gimple to assign and fixed truncation to $TLHS the tree $TRHS, if both are non-null.}#
#{/*gimple_build_assign_fix_trunc*/ ($TLHS != (tree)0
&& $TRHS != (tree)0)
?
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($TLHS), FIX_TRUNC_EXPR, ($TRHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FIX_TRUNC_EXPR,
($TLHS),($TRHS), NULL)
#endif /* GCC 5.0 or GCC 4.9 */
:((gimple)0)}#
)
(defprimitive gimple_build_assign_float (:tree tlhs trhs) :gimple
:doc #{Build a gimple to assign the conversion to float $TLHS the tree $TRHS, if both are non-null.}#
#{/*gimple_build_assign_float:*/ ($TLHS != (tree)0
&& $TRHS != (tree)0)
?
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($TLHS), FLOAT_EXPR, ($TRHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FLOAT_EXPR,
($TLHS),($TRHS), NULL)
#endif /* GCC 5.0 or GCC 4.9 */
:((gimple)0)}#
)
;; match a gimple copy assign
(defcmatcher gimple_assign_copy
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs ;first right operand
) ;outs
gimpasscopy
:doc #{$GIMPLE_ASSIGN_COPY match a copy assignment into $LHS or $RHS.}#
;;test expansion
#{/*gimple_assign_copy $GIMPASSCOPY ? */ ($GA && gimple_assign_copy_p ($GA))}#
;;fill expansion
#{/*gimple_assign_copy $GIMPASSCOPY ! */
$lhs = gimple_assign_lhs($GA);
$rhs = gimple_assign_rhs1($GA);
}#
)
;; match a gimple copy assign with ssa name
(defcmatcher gimple_assign_ssa_name_copy
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs ;first right operand
) ;outs
gimpasssacopy
:doc #{$GIMPLE_ASSIGN_SSA_NAME_COPY match a copy assignment with both $LHS and $RHS being SSA.}#
;;test expansion
#{/*gimple_assign_ssa_name_copy $GIMPASSSACOPY ? */ ($GA
&& gimple_assign_ssa_name_copy_p ($GA))}#
;;fill expansion
#{/*gimple_assign_ssa_name_copy $GIMPASSSACOPY ! */
$LHS = gimple_assign_lhs($GA);
$RHS = gimple_assign_rhs1($GA);
}#
)
;; match a gimple unary nop assign
(defcmatcher gimple_assign_unary_nop
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs ;first right operand
) ;outs
gimpasg
:doc #{$GIMPLE_ASSIGN_UNARY_NOP match or build an unary nop assign into $LHS of $RHS.}#
;;test expansion
#{/*gimple_assign_unary_nop $GIMPASG ?*/ ($GA
&& gimple_assign_unary_nop_p ($GA))}#
;;fill expansion
#{/*gimple_assign_unary_nop $GIMPASG !*/
$lhs = gimple_assign_lhs($ga);
$rhs = gimple_assign_rhs1($ga);
}#
;; operator expansion
#{ /* gimple_assign_unary_nop: */
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), NOP_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(NOP_EXPR, $LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with unary negation X = -Y
(defcmatcher gimple_assign_negate
(:gimple ga)
(:tree lhs
:tree rhs)
gaum
:doc #{$GIMPLE_ASSIGN_NEGATE match or build an unary negate assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_negate $GAUM ? */ ($GA
&& gimple_expr_code ($GA) == NEGATE_EXPR)
}#
;; fill
#{ /* gimple_assign_negate $GAUM ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_negate:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), NEGATE_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops (NEGATE_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with unary float conversion X = (float)Y
(defcmatcher gimple_assign_float
(:gimple ga)
(:tree lhs
:tree rhs)
gauf
:doc #{$GIMPLE_ASSIGN_FLOAT match or build an unary float conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_float $GAUF ? */ ($GA
&& gimple_expr_code ($GA) == FLOAT_EXPR)
}#
;; fill
#{ /* gimple_assign_float $GAUF ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_float:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), FLOAT_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FLOAT_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign absolute value X = abs(Y)
(defcmatcher gimple_assign_abs
(:gimple ga)
(:tree lhs
:tree rhs)
gaua
:doc #{$GIMPLE_ASSIGN_ABS match or build an unary float conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_abs $GAUA ? */ ($GA
&& gimple_expr_code ($GA) == ABS_EXPR)
}#
;; fill
#{ /* gimple_assign_abs $GAUA ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_abs:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), ABS_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(ABS_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with barrier parenthesis X = (Y)
(defcmatcher gimple_assign_paren
(:gimple ga)
(:tree lhs
:tree rhs)
gaup
:doc #{$GIMPLE_ASSIGN_PAREN match or build a barrier parenthesis assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_paren $GAUP ? */ ($GA
&& gimple_expr_code ($GA) == PAREN_EXPR)
}#
;; fill
#{ /* gimple_assign_paren $GAUP ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_paren:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), PAREN_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(PAREN_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with conversion X = convert(Y)
(defcmatcher gimple_assign_convert
(:gimple ga)
(:tree lhs
:tree rhs)
gauc
:doc #{$GIMPLE_ASSIGN_CONVERT match or build a conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_convert $GAUC ? */ ($GA
&& gimple_expr_code ($GA) == CONVERT_EXPR)
}#
;; fill
#{ /* gimple_assign_convert $GAUC ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_convert:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), CONVERT_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(CONVERT_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with address space conversion X = adconvert(Y)
(defcmatcher gimple_assign_addr_space_convert
(:gimple ga)
(:tree lhs
:tree rhs)
gauc
:doc #{$GIMPLE_ASSIGN_ADDR_SPACE_CONVERT match or build an address space conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_addr_space_convert $GAUC ? */ ($GA
&& gimple_expr_code ($GA) == ADDR_SPACE_CONVERT_EXPR)
}#
;; fill
#{ /* gimple_assign_addr_space_convert $GAUC ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_addr_space_convert:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), ADDR_SPACE_CONVERT_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(ADDR_SPACE_CONVERT_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with fixedpoint conversion X = fixconvert(Y)
(defcmatcher gimple_assign_fixed_convert
(:gimple ga)
(:tree lhs
:tree rhs)
gauc
:doc #{$GIMPLE_ASSIGN_FIXED_CONVERT match or build a fixed-point conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_fixed_convert $GAUC ? */ ($GA
&& gimple_expr_code ($GA) == FIXED_CONVERT_EXPR)
}#
;; fill
#{ /* gimple_assign_fixed_convert $GAUC ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_fixed_convert:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), FIXED_CONVERT_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FIXED_CONVERT_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with nop conversion X = nopconvert(Y)
(defcmatcher gimple_assign_nop
(:gimple ga)
(:tree lhs
:tree rhs)
gauc
:doc #{$GIMPLE_ASSIGN_NOP match or build a no-op conversion assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_nop $GAUC ? */ ($GA
&& gimple_expr_code ($GA) == NOP_EXPR)
}#
;; fill
#{ /* gimple_assign_nop $GAUC ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_nop:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), NOP_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(NOP_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign with bitwise not X = ~Y
(defcmatcher gimple_assign_bit_not
(:gimple ga)
(:tree lhs
:tree rhs)
gabnot
:doc #{$GIMPLE_ASSIGN_BIT_NOT match or build an unary bitwise not assign into $LHS of $RHS.}#
;; test
#{ /* gimple_assign_unary_bit_not $GABNOT ? */ ($GA
&& gimple_expr_code ($GA) == BIT_NOT_EXPR)
}#
;; fill
#{ /* gimple_assign_bit_not $GABNOT ! */
$LHS = gimple_assign_lhs ($GA);
$RHS = gimple_assign_rhs1 ($GA);
}#
;; operator expansion
#{/*gimple_assign_bit_not:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), BIT_NOT_EXPR, ($RHS))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(BIT_NOT_EXPR,
$LHS, $RHS, NULL_TREE)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with addition ie X = Y + Z
(defcmatcher gimple_assign_plus
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasplus
:doc #{$GIMPLE_ASSIGN_PLUS match or build addition into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_plus $GASPLUS ?*/ ($GA
&& is_gimple_assign($GA) && gimple_expr_code($GA) == PLUS_EXPR)}#
;; fill
#{/*gimple_assign_plus $GASPLUS !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_plus:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), PLUS_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(PLUS_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with substraction ie X = Y - Z
(defcmatcher gimple_assign_minus
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasminus
:doc #{$GIMPLE_ASSIGN_MINUS match or build substraction into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_minus $GASMINUS ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == MINUS_EXPR)}#
;; fill
#{/*gimple_assign_minus $GASMINUS !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_minus:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), MINUS_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(MINUS_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with minimum ie X = MIN(Y, Z)
(defcmatcher gimple_assign_min
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasmin
:doc #{$GIMPLE_ASSIGN_MIN match or build minimum into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_min $GASMIN ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == MIN_EXPR)}#
;; fill
#{/*gimple_assign_min $GASMIN !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_min:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), MIN_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(MIN_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with maximum ie X = MAX(Y, Z)
(defcmatcher gimple_assign_max
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasmax
:doc #{$GIMPLE_ASSIGN_MAX match or build maximum into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_max $GASMAX ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == MAX_EXPR)}#
;; fill
#{/*gimple_assign_max $GASMAX !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_max:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), MAX_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(MAX_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;bitwise shift
;;;; match a gimple assign with leftshift ie X = Y lshift Z
(defcmatcher gimple_assign_lshift
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gaslsh
:doc #{$GIMPLE_ASSIGN_LSHIFT match or build bitwise leftshift into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_lshift $GASLSH ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == LSHIFT_EXPR)}#
;; fill
#{/*gimple_assign_lshift $GASLSH !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_lshift:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), LSHIFT_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(LSHIFT_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with rightshift ie X = Y lshift Z
(defcmatcher gimple_assign_rshift
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasrsh
:doc #{$GIMPLE_ASSIGN_RSHIFT match or build bitwise rightshift into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_rshift $GASRSH ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == RSHIFT_EXPR)}#
;; fill
#{/*gimple_assign_rshift $GASRSH !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_rshift:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), RSHIFT_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(RSHIFT_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;; bitwise rotation
;;;; match a gimple assign with leftrotation ie X = Y lrotate Z
(defcmatcher gimple_assign_lrotate
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gaslro
:doc #{$GIMPLE_ASSIGN_LROTATE match or build bitwise leftrotate into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_lrotate $GASLRO ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == LROTATE_EXPR)}#
;; fill
#{/*gimple_assign_lrotate $GASLRO !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_lrotate:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), LROTATE_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(LROTATE_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with rightshift ie X = Y lshift Z
(defcmatcher gimple_assign_rrotate
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasrro
:doc #{$GIMPLE_ASSIGN_RROTATE match or build bitwise rightrotate into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_rrotate $GASRRO ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == RROTATE_EXPR)}#
;; fill
#{/*gimple_assign_rrotate $GASRRO !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_rrotate:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), RROTATE_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(RROTATE_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;; bitwise and, or, xor
(defcmatcher gimple_assign_bit_ior
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasbior
:doc #{$GIMPLE_ASSIGN_BIT_IOR match or build bitwise inclusive-or into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_bit_ior $GASBIOR ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == BIT_IOR_EXPR)}#
;; fill
#{/*gimple_assign_bit_ior $GASBIOR !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_bit_ior:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), BIT_IOR_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(BIT_IOR_EXPR,
($LHS), ($RHS1), ($RHS2))
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
(defcmatcher gimple_assign_bit_xor
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasbxor
:doc #{$GIMPLE_ASSIGN_BIT_XOR match or build bitwise exclusive-or into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_bit_xor $GASBXOR ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == BIT_XOR_EXPR)}#
;; fill
#{/*gimple_assign_bit_xor $GASBXOR !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_bit_xor:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), BIT_XOR_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(BIT_XOR_EXPR,
($LHS), ($RHS1), ($RHS2))
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
(defcmatcher gimple_assign_bit_and
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasband
:doc #{$GIMPLE_ASSIGN_BIT_AND match or build bitwise and into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_bit_and $GASBAND ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == BIT_AND_EXPR)}#
;; fill
#{/*gimple_assign_bit_and $GASBAND !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_bit_and:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), BIT_AND_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(BIT_AND_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;; pointer arithmetic
(defcmatcher gimple_assign_pointer_plus
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gaspplus
:doc #{$GIMPLE_ASSIGN_POINTER_MINUS match or build pointer addition into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_pointer_plus $GASPPLUS ?*/ $ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == POINTER_PLUS_EXPR }#
;; fill
#{/*gimple_assign_pointer_plus $GASPPLUS !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_pointer_plus:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), POINTER_PLUS_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(POINTER_PLUS_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with multiplication ie X = Y * Z
(defcmatcher gimple_assign_mult
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasmult
:doc #{$GIMPLE_ASSIGN_MULT match or build multiplication into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_mult $GASMULT ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == MULT_EXPR)}#
;; fill
#{/*gimple_assign_mult $GASMULT !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_mult:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), MULT_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(MULT_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with highpart multiplication ie X = HIGHPART(Y * Z)
(defcmatcher gimple_assign_mult_highpart
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasmult
:doc #{$GIMPLE_ASSIGN_MULT_HIGHPART match or build multiplication into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_mult_highpart $GASMULT ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == MULT_EXPR)}#
;; fill
#{/*gimple_assign_mult_highpart $GASMULT !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_mult_highpart:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), MULT_HIGHPART_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(MULT_HIGHPART_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
(defcmatcher gimple_assign_widen_mult
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasmult
:doc #{$GIMPLE_ASSIGN_WIDEN_MULT match or build a widening multiplication into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_widen_mult $GASMULT ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == WIDEN_MULT_EXPR)}#
;; fill
#{/*gimple_assign_widen_mult $GASMULT !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_widen_mult:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), WIDEN_MULT_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(WIDEN_MULT_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with trunc division ie X = Y /trunc Z
(defcmatcher gimple_assign_trunc_div
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gastdiv
:doc #{$GIMPLE_ASSIGN_TRUNC_DIV match or build truncated division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_trunc_div $GASTDIV ?*/ ($GA && is_gimple_assign($GA) && gimple_expr_code($GA) == TRUNC_DIV_EXPR)}#
;; fill
#{/*gimple_assign_trunc_div $GASTDIV ?*/
$LHS = gimple_assign_lhs($GA);
$RHS1 = gimple_assign_rhs1($GA);
$RHS2 = gimple_assign_rhs2($GA);
}#
;; operator expansion
#{/*gimple_assign_trunc_div:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), TRUNC_DIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(TRUNC_DIV_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with ceil division ie X = Y /ceil Z
(defcmatcher gimple_assign_ceil_div
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gascdiv
:doc #{$GIMPLE_ASSIGN_CEIL_DIV match or build ceiling division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_ceil_div $GASCDIV ?*/ ($GA && is_gimple_assign($GA)
&& gimple_expr_code($GA) == CEIL_DIV_EXPR)}#
;; fill
#{/*gimple_assign_ceil_div $GASCDIV !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_ceil_div:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), CEIL_DIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(CEIL_DIV_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with floor division ie X = Y /floor Z
(defcmatcher gimple_assign_floor_div
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasfdiv
:doc #{$GIMPLE_ASSIGN_FLOOR_DIV match or build floor division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_floor_div $GASFDIV ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == FLOOR_DIV_EXPR)}#
;; fill
#{/*gimple_assign_floor_div $GASFDIV !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_floor_div: */
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), FLOOR_DIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FLOOR_DIV_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with round division ie X = Y /round Z
(defcmatcher gimple_assign_round_div
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasrdiv
:doc #{$GIMPLE_ASSIGN_ROUND_DIV match or build rounding division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_round_div $GASRDIV ?*/ ($ga && is_gimple_assign($ga) && gimple_expr_code($ga) == ROUND_DIV_EXPR)}#
;; fill
#{/*gimple_assign_round_div $GASRDIV !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_round_div:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), ROUND_DIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(ROUND_DIV_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with real division ie X = Y /real Z
(defcmatcher gimple_assign_rdiv
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasrediv
:doc #{$GIMPLE_ASSIGN_RDIV match or build reaol division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_rdiv $GASREDIV ?*/ ($GA && is_gimple_assign($GA)
&& gimple_expr_code($GA) == RDIV_EXPR)}#
;; fill
#{/*gimple_assign_rdiv $GASREDIV !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_rdiv:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), RDIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(RDIV_EXPR, $LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with exact division ie X = Y /exact Z
(defcmatcher gimple_assign_exact_div
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasxdiv
:doc #{$GIMPLE_ASSIGN_EXACT_DIV match or build exact division into $LHS of $RHS1 and $RHS2.}#
;; test
#{/* gimple_assign_exact_div $GASXDIV ? */ ($ga &&
is_gimple_assign($ga) && gimple_expr_code($ga) == EXACT_DIV_EXPR)}#
;; fill
#{/* gimple_assign_exact_div $GASXDIV ! */
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_exact_div:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), EXACT_DIV_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(EXACT_DIV_EXPR, $LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;;;;;;;;;;;;;;
;;;; match a gimple assign with trunc remainder ie X = Y %trunc Z
(defcmatcher gimple_assign_trunc_mod
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gastmod
:doc #{$GIMPLE_ASSIGN_TRUNC_MOD match or build truncated modulus into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_trunc_mod $GASTMOD ?*/ ($GA && is_gimple_assign($GA)
&& gimple_expr_code($GA) == TRUNC_MOD_EXPR)}#
;; fill
#{/*gimple_assign_trunc_mod $GASTMOD !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_trunc_mod:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), TRUNC_MOD_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(TRUNC_MOD_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with ceil remainder ie X = Y %ceil Z
(defcmatcher gimple_assign_ceil_mod
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gascmod
:doc #{$GIMPLE_ASSIGN_CEIL_MOD match or build ceil modulus into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_ceil_mod $GASCMOD ?*/ ($GA && is_gimple_assign($GA)
&& gimple_expr_code($GA) == CEIL_MOD_EXPR)}#
;; fill
#{/*gimple_assign_ceil_mod $GASCMOD !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_ceil_mod:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), CEIL_MOD_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(CEIL_MOD_EXPR, $LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with floor remainder ie X = Y %floor Z
(defcmatcher gimple_assign_floor_mod
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasflomod
:doc #{$GIMPLE_ASSIGN_FLOOR_MOD match or build floor modulus into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_floor_mod $GASFLOMOD ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == FLOOR_MOD_EXPR)}#
;; fill
#{/*gimple_assign_floor_mod $GASFLOMOD !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_floor_mod:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), FLOOR_MOD_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(FLOOR_MOD_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;; match a gimple assign with round remainder ie X = Y %round Z
(defcmatcher gimple_assign_round_mod
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
)
gasrmod
:doc #{$GIMPLE_ASSIGN_ROUND_MOD match or build rounded modulus into $LHS of $RHS1 and $RHS2.}#
;; test
#{/*gimple_assign_round_mod $GASRMOD ?*/ ($ga && is_gimple_assign($ga)
&& gimple_expr_code($ga) == ROUND_MOD_EXPR)}#
;; fill
#{/*gimple_assign_round_mod $GASRMOD !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
}#
;; operator expansion
#{/*gimple_assign_round_mod:*/
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), ROUND_MOD_EXPR, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops(ROUND_MOD_EXPR,
$LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;; match a gimple assign binary op
(defcmatcher gimple_assign_binaryop
(:gimple ga) ;match
(:tree lhs ;left hand side
:tree rhs1
:tree rhs2
:long opcode
)
gasbinop
:doc #{$GIMPLE_ASSIGN_BINARYOP match or build a binary operator of $OPCODE into $LHS of $RHS1 and $RHS2.}#
;; test
#{/* gimple_assign_binaryop $GASBINOP ?*/ ($ga
&& is_gimple_assign($ga) && gimple_num_ops($ga) >= 3)}#
;; fill
#{/* gimple_assign_binaryop $GASBINOP !*/
$lhs = gimple_assign_lhs($ga);
$rhs1 = gimple_assign_rhs1($ga);
$rhs2 = gimple_assign_rhs2($ga);
$opcode = gimple_assign_rhs_code($ga);
}#
;; operator expansion
#{/* gimple_assign_binaryop: */
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
gimple_build_assign (($LHS), (enum tree_code) $OPCODE, ($RHS1), ($RHS2))
#else /* GCC 4.9 */
gimple_build_assign_with_ops((enum tree_code) $OPCODE, $LHS, $RHS1, $RHS2)
#endif /* GCC 5.0 or GCC 4.9 */
}#
)
;;;;;;;;;;;;;;;;
;;; match any kind of gimple cond
(defcmatcher gimple_cond
(:gimple gc)
(:tree lhs rhs :long condcode)
gimpcond
:doc #{$GIMPLE_COND match a GIMPLE condition between $LHS and $RHS with the $CONDCODE long.}#
;; test
#{/*gimple_cond $GIMPCOND ?*/ ($GC && (long)gimple_code($GC) == GIMPLE_COND) }#
;; fill
#{/*gimple_cond $GIMPCOND !*/ $LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
$CONDCODE = gimple_cond_code($GC);
}#
;; operator expansion
#{/*gimple_cond:*/ ($CONDCODE>0 && $CONDCODE<(long)MAX_TREE_CODES
&& TREE_CODE_CLASS($CONDCODE)== tcc_comparison)
? gimple_build_cond((enum tree_code)$CONDCODE, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE): (gimple) NULL}#)
;;;;;;;;;;;;;;;;
;;; match a gimple cond less or equal
(defcmatcher gimple_cond_lessequal
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondle
:doc #{$GIMPLE_COND_LESSEQUAL match or build a <= condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_lessequal $GIMPCONDLE ? */ ($gc && gimple_code($gc)==GIMPLE_COND
&& gimple_cond_code($gc)==LE_EXPR)}#
;; fill expansion
#{/*gimple_cond_lessequal $GIMPCONDLE ! */
$lhs = gimple_cond_lhs($gc);
$rhs = gimple_cond_rhs($gc);
}#
;; operator expansion
#{/*gimple_cond_lessequal:*/ gimple_build_cond(LE_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;; match a gimple cond less
(defcmatcher gimple_cond_less
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondle
:doc #{$GIMPLE_COND_LESS match or build a < condition between $LHS and $RHS.}#
; test expansion
#{/*gimple_cond_less $GIMPCONDLE ?*/ ($gc && gimple_code($gc)==GIMPLE_COND
&& gimple_cond_code($gc)==LT_EXPR)}#
;; fill expansion
#{/*gimple_cond_less $GIMPCONDLE ! */
$lhs = gimple_cond_lhs($gc);
$rhs = gimple_cond_rhs($gc);
}#
;; operator expansion
#{/*gimple_cond_less:*/ gimple_build_cond(LT_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond not equal
(defcmatcher gimple_cond_notequal
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondne
:doc #{$GIMPLE_COND_NOTEQUAL match or build a != condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_notequal $GIMPCONDNE ?*/ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==NE_EXPR)}#
;; fill expansion
#{/*gimple_cond_notequal $GIMPCONDNE !*/
$LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_notequal:*/ gimple_build_cond(NE_EXPR, $LHS,
$RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;; match a gimple_cond equal
(defcmatcher gimple_cond_equal
(:gimple gc)
(:tree lhs
:tree rhs)
gimpcondeq
:doc #{$GIMPLE_COND_EQUAL match or build a == condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_equal $GIMPCONDEQ ?*/ ($GC &&
gimple_code ($GC) == GIMPLE_COND &&
gimple_cond_code ($GC) == EQ_EXPR)
}#
;; fill expansion
#{/*gimple_cond_equal $GIMPCONDEQ !*/
$lhs = gimple_cond_lhs ($gc);
$rhs = gimple_cond_rhs ($gc);
}#
;; operator expansion
#{/*gimple_cond_equal:*/ gimple_build_cond(EQ_EXPR, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;; match a gimple cond greater
(defcmatcher gimple_cond_greater
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondgt
:doc #{$GIMPLE_COND_GREATER match or build a > condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_greater $GIMPCONDGT ?*/ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==GT_EXPR)}#
;; fill expansion
#{/*gimple_cond_greater $GIMPCONDGT !*/
$LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_greater:*/ gimple_build_cond(GT_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;; match a gimple_cond greater or equal
(defcmatcher gimple_cond_greater_or_equal
(:gimple gc)
(:tree lhs
:tree rhs)
gimpcondge
:doc #{$GIMPLE_COND_GREATER_OR_EQUAL match or build a >= condition between $LHS and $RHS.}#
;; test
#{ /*gimple_cond_greater_or_equal $GIMPCONDGE ? */ ($GC &&
gimple_code ($GC) == GIMPLE_COND &&
gimple_cond_code ($GC) == GE_EXPR)
}#
;; fill
#{ /*gimple_cond_greater_or_equal $GIMPCONDGE ! */
$lhs = gimple_cond_lhs ($GC);
$rhs = gimple_cond_rhs ($GC);
}#
;; operator expansion
#{/*gimple_cond_greater_or_equal:*/ gimple_build_cond(GE_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond unordered
(defcmatcher gimple_cond_unordered
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondunord
:doc #{$GIMPLE_COND_UNORDERED match or build a unordered floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_unordered $GIMPCONDUNORD ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNORDERED_EXPR)}#
;; fill expansion
#{/*gimple_cond_unordered $GIMPCONDUNORD ! */
$lhs = gimple_cond_lhs($GC);
$rhs = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_unordered:*/ gimple_build_cond(UNORDERED_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond ordered
(defcmatcher gimple_cond_ordered
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondord
:doc #{$GIMPLE_COND_ORDERED match or build a unordered floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_unordered $GIMPCONDORD ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==ORDERED_EXPR)}#
;; fill expansion
#{/*gimple_cond_unordered $GIMPCONDORD ! */
$lhs = gimple_cond_lhs($GC);
$rhs = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_ordered:*/ gimple_build_cond(ORDERED_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond unlt
(defcmatcher gimple_cond_unlt
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondunlt
:doc #{$GIMPLE_COND_UNLT match or build a unordered or less than floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_unlt $GIMPCONDUNLT ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNLT_EXPR)}#
;; fill expansion
#{/*gimple_cond_unlt $GIMPCONDUNLT ! */
$lhs = gimple_cond_lhs($GC);
$rhs = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_unlt:*/ gimple_build_cond(UNLT_EXPR, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond unle
(defcmatcher gimple_cond_unle
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondunle
:doc #{$GIMPLE_COND_UNLE match or build a unordered or less or equal floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_unle $GIMPCONDUNLE ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNLE_EXPR)}#
;; fill expansion
#{/*gimple_cond_unle $GIMPCONDUNLE ! */
$lhs = gimple_cond_lhs($GC);
$rhs = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_unle:*/ gimple_build_cond(UNLE_EXPR, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond ungt
(defcmatcher gimple_cond_ungt
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondungt
:doc #{$GIMPLE_COND_UNGT match or build a unordered or greater than floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_ungt $GIMPCONDUNGT ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNGT_EXPR)}#
;; fill expansion
#{/*gimple_cond_ungt $GIMPCONDUNGT ! */
$lhs = gimple_cond_lhs($GC);
$rhs = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_ungt:*/ gimple_build_cond(UNGT_EXPR, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond unge
(defcmatcher gimple_cond_unge
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondunge
:doc #{$GIMPLE_COND_UNGE match or build a unordered or greater or equal floating point condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_unge $GIMPCONDUNGE ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNGE_EXPR)}#
;; fill expansion
#{/*gimple_cond_unge $GIMPCONDUNGE ! */
$LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_unge:*/ gimple_build_cond(UNGE_EXPR, $LHS, $RHS,
/*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond uneq
(defcmatcher gimple_cond_uneq
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpconduneq
:doc #{$GIMPLE_COND_UNEQ match or build a unordered or unequal floating point
condition between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_uneq $GIMPCONDUNEQ ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC)==UNEQ_EXPR)}#
;; fill expansion
#{/*gimple_cond_uneq $GIMPCONDUNEQ ! */
$LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_uneq:*/ gimple_build_cond(UNEQ_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;;;;;;;;;;;;;;;;
;;; match a gimple cond ltgt
(defcmatcher gimple_cond_ltgt
(:gimple gc)
(:tree lhs
:tree rhs
)
gimpcondltgt
:doc #{$GIMPLE_COND_LTGT match or build a less than or greater than floating point
condition reverse of $GIMPLE_COND_UNEQ between $LHS and $RHS.}#
;; test expansion
#{/*gimple_cond_ltgt $GIMPCONDLTGT ? */ ($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_code($GC) == LTGT_EXPR)}#
;; fill expansion
#{/*gimple_cond_ltgt $GIMPCONDLTGT ! */
$LHS = gimple_cond_lhs($GC);
$RHS = gimple_cond_rhs($GC);
}#
;; operator expansion
#{/*gimple_cond_ltgt:*/
gimple_build_cond(LTGT_EXPR, $LHS, $RHS, /*nolabels*/ NULL_TREE, NULL_TREE)}#
)
;; match a gimple cond true
(defcmatcher gimple_cond_true
(:gimple gc)
()
gimpcondtr
:doc #{$GIMPLE_COND_TRUE match a gimple conditional $GC with an always true condition.}#
;;test
#{/* gimple_cond_true $GIMPCONDTR ? */ ($GC && gimple_code($GC) == GIMPLE_COND
&& gimple_cond_true_p
(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gcond*>
#endif /* GCC 5.0 */
($GC)
))
}#
;;fill
#{ /* gimple_cond_true $GIMPCONDTR !*/
}# )
;; match a gimple cond false
(defcmatcher gimple_cond_false
(:gimple gc)
()
gimpcondfa
:doc #{$GIMPLE_COND_TRUE match a gimple conditional $GC with an always false condition.}#
;;test
#{/*fimple_cond_false $gimpcondfa ?*/
($GC && gimple_code($GC)==GIMPLE_COND
&& gimple_cond_false_p
(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gcond*>
#endif /* GCC 5.0 */
($GC)
))
}# )
;; rarely used pattern to extract the true & false labels. These are
;; often null!
(defcmatcher gimple_cond_with_true_false_labels
(:gimple gc)
(:tree truelab falselab)
gimpcondtrlab
:doc #{$GIMPLE_COND_WITH_TRUE_FALSE_LABELS match a gimple conditional $GC and
extracts its true label $TRUELAB and false label $FALSELAB.}#
;; test
#{/* gimple_cond_with_true_false_labels $gimpcondtrlab ?*/ ($gc && gimple_code($gc)==GIMPLE_COND)}#
;;fill
#{/* gimple_cond_with_true_false_labels $gimpcondtrlab !*/
$truelab = gimple_cond_true_label(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gcond*>
#endif /* GCC 5.0 */
($GC)
);
$falselab = gimple_cond_false_label(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gcond*>
#endif /* GCC 5.0 */
($GC)
);
}#
)
;; pattern to extract the true & false edges of a gimple_cond.
(defcmatcher gimple_cond_with_edges
(:gimple gc)
(:edge truedge falsedge)
gimpcondtredges
:doc #{$GIMPLE_COND_WITH_EDGES match a gimple conditional $GC and extracts
its true edge $TRUEDGE and false edge $FALSEDGE }#
;; test
#{/*$gimpcondtredges ?*/ ($gc && gimple_code($gc)==GIMPLE_COND)}#
;;fill
#{ /*$gimpcondtredges !*/
extract_cond_bb_edges ((gimple_bb ($gc)), &($truedge), &($falsedge));
}#)
;;; iterate on each argument of a call function
(defciterator foreach_argument_of_gimple_call
(:gimple gcall)
eaocf
(:tree argument)
:doc #{ $FOREACH_ARGUMENT_OF_GIMPLE_CALL iterates on each $ARGUMENT of gimple call $GCALL.}#
#{
/* foreach_argument_of_gimple_call before $EAOCF */
int $EAOCF#_i = 0;
$ARGUMENT = (tree)NULL;
if ($GCALL && gimple_code($GCALL) == GIMPLE_CALL)
{
int $EAOCF#_n = gimple_call_num_args ($gcall);
for ($EAOCF#_i = 0;
$EAOCF#_i < $EAOCF#_n;
$EAOCF#_i++)
{
$ARGUMENT = gimple_call_arg ($gcall, $EAOCF#_i);
}#
#{
/* foreach_argument_of_gimple_call after $EAOCF */
$ARGUMENT = (tree)NULL;
}
}
}#)
;;; match a gimple call to a direct function of any matched arity
(defcmatcher gimple_call
(:gimple gc)
(:tree lhs
fndecl
:long nbargs
)
gimpcall
:doc #{$GIMPLE_CALL match a gimple $GC if it is a call extracting result
$LHS to function decl $FNDECL with $NBARGS.}#
;; test
#{/* gimple_call $gimpcall ?*/($gc && gimple_code($gc)==GIMPLE_CALL)}#
;; fill
#{ /* gimple_call $gimpcall !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$nbargs = gimple_call_num_args($gc);
}# )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; add pattern matching ?(gimple_call_args ?lhs ?fndecl ?arg0 ?arg1 ... ?argn)
(defvar gimple_call_args_cmatcher_cache_tuple)
(setq gimple_call_args_cmatcher_cache_tuple (make_multiple discr_multiple 32))
(defun patexpand_gimple_call_args (sexpr env pctx)
(debug "patexpand_gimple_call_args" "; sexpr=" sexpr "\n.. env=" env "\n.. pctx=" pctx)
(assert_msg "check sexpr" (is_a sexpr class_sexpr) sexpr)
(assert_msg "check env" (is_a env class_environment) env)
(assert_msg "check pctx" (is_a pctx class_pattern_expansion_context) pctx)
(let (
(cont (unsafe_get_field :sexp_contents sexpr))
(loc (unsafe_get_field :loca_location sexpr))
(curpair (pair_tail (list_first cont)))
(argsp (patternexpand_pairlist_as_tuple curpair env pctx loc))
(nbargs (multiple_length argsp))
(nbcallargs (-i nbargs 2))
)
(debug "patexpand_gimple_call_args" "; loc=" loc "; cont=" cont
"\n.. argsp=" argsp)
(when (<i nbargs 2)
(error_at loc
"pattern ?(GIMPLE_CALL_ARGS <lhs> <fun> [<arg0>...]) with too few #$1 arguments"
nbargs)
(return))
(let (
(cachelen (multiple_length gimple_call_args_cmatcher_cache_tuple))
(cmat (if (<i nbcallargs cachelen)
(multiple_nth gimple_call_args_cmatcher_cache_tuple nbcallargs)
()))
)
(if (>=i nbcallargs cachelen)
(let ( (newcachelen (+i 1 (ori 0xf (+i 5 (*i 3 (/iraw nbcallargs 2))))))
(newtup (make_multiple discr_multiple newcachelen))
)
(foreach_long_upto
(0 (-i cachelen 1))
(:long hix)
(multiple_put_nth newtup hix (multiple_nth gimple_call_args_cmatcher_cache_tuple hix)))
(setq gimple_call_args_cmatcher_cache_tuple newtup)))
(let (
(argsymblist (list 'tr_lhs 'tr_fun))
)
(foreach_long_upto
(0 (-i nbcallargs 1))
(:long cix)
(let ( (curargname (string4out discr_string "TR_ARG_" cix))
(curargsymb (create_symbolstr curargname))
)
(debug "patexpand_gimple_call_args" "; curargsymb=" curargsymb)
(list_append argsymblist curargsymb)
)
)
(debug "patexpand_gimple_call_args" "; loc=" loc
" argssymblist=" argsymblist)
(let ( (tupargsymb (list_to_multiple argsymblist discr_multiple))
(cmatname (string4out discr_string "GIMPLE_CALL_ARGS_" nbcallargs))
(cmatsymb (create_symbolstr cmatname))
)
(debug "patexpand_gimple_call_args" "; loc=" loc
" tupargsymb=" tupargsymb
"\n.. cmatsymb=" cmatsymb)
(let (
(gibind (instance class_formal_binding
:binder 'gi
:fbind_type ctype_gimple))
(tupargbind (multiple_map
tupargsymb
(lambda (tsymb)
(instance class_formal_binding
:binder tsymb
:fbind_type ctype_tree))))
(cmtest
(let
( (cmt (make_list discr_list))
(gimplecallstate 'gimplecallstate)
(gi 'gi)
)
(add2list
cmt
##{ /* $CMATNAME $GIMPLECALLSTATE generated test for gimple_call_args ? */
($GI && gimple_code($GI)==GIMPLE_CALL && gimple_call_num_args($GI)== $NBCALLARGS)
}#
)
(debug "patexpand_gimple_call_args" "; loc=" loc "; cmtest=" cmt)
cmt))
(cmfill
(let ( (cmf (make_list discr_list))
(gimplecallstate 'gimplecallstate)
(gi 'gi)
(tr_lhs 'tr_lhs)
(tr_fun 'tr_fun)
)
(add2list
cmf
##{ /* $CMATNAME $GIMPLECALLSTATE generated fill for gimple_call_args ! */
$TR_LHS = gimple_call_lhs ($GI) ;
$TR_FUN = gimple_call_fndecl ($GI) ;
}#)
(foreach_in_multiple
(tupargsymb)
(curargsymb :long aix)
(if (>=i aix 2)
(let ( (nix (-i aix 2))
)
(add2list cmf
##{ $CURARGSYMB = gimple_call_args ($GI, $NIX) ;
}#)))
)
(debug "patexpand_gimple_call_args" "; loc=" loc "; cmfill=" cmf)
cmf
))
(newcmat
(instance class_cmatcher
:named_name cmatsymb
:amatch_matchbind gibind
:amatch_out tupargbind ;; tuple of formals
:cmatch_state 'gimplecallstate ;; symbol
:cmatch_exptest (list_to_multiple cmtest discr_multiple)
:cmatch_expfill (list_to_multiple cmfill discr_multiple)
))
)
(debug "patexpand_gimple_call_args" "; loc=" loc "\n.. newcmat=" newcmat)
(multiple_put_nth gimple_call_args_cmatcher_cache_tuple nbcallargs newcmat)
(setq cmat newcmat)
(debug "patexpand_gimple_call_args" "; loc=" loc "; nbcallargs=" nbcallargs
"\n.. updated cachetuple="
"\n.. cmat=" cmat)
)
)
)
(debug "patexpand_gimple_call_args" "; loc=" loc "; cmat=" cmat)
(assert_msg "check cmat" (is_a class_cmatcher cmat) cmat)
(multicall
(args pats)
(patmacexpand_for_matcher curpair cmat env loc pctx)
(debug "patexpand_gimple_call_args" "; loc=" loc " args=" args " pats=" pats)
(multicall
(subpatw :long imax imin isum)
(pattern_weight_tuple pats)
(debug "patexpand_gimple_call_args" "; loc=" loc " subpatw=" subpatw
"\n.. imax=" imax " imin=" imin " isum=" isum)
(let (
(cmatsymb (get_field :named_name cmat))
;;; notice that we are embedding the binding in the
;;; result, but not putting the binding in the
;;; environment. See comment about 'mv is not bound' in
;;; file warmelt-normatch.melt function
;;; normpat_anymatchpat...
(cmabind (instance class_cmatcher_binding
:binder cmatsymb
:cmbind_matcher cmat))
(res
(instance class_source_pattern_c_match
:loca_location loc
:pat_weight (constant_box (+i 1 isum))
:spac_operator cmat
:spac_operbind cmabind
:spac_inargs args
:spac_outargs pats)
)
)
(debug "patexpand_gimple_call_args" "; loc=" loc "\n.. cmabind=" cmabind
"\n.. res=" res)
(return res)
)
)
)
)
)
)
;; pseudo primitive gimple_call_args
;; expanded using gimple_build_call
(defvar gimple_call_args_primitive_cache_tuple)
(setq gimple_call_args_primitive_cache_tuple (make_multiple discr_multiple 32))
(defun mexpand_gimple_call_args (sexpr env mexpander modctx)
(debug "mexpand_gimple_call_args" "; sexpr=" sexpr "\n.. env=" env "\n.. modctx=" modctx)
(assert_msg "check sexpr" (is_a sexpr class_sexpr) sexpr)
(assert_msg "check env" (is_a env class_environment) env)
(let (
(cont (unsafe_get_field :sexp_contents sexpr))
(loc (unsafe_get_field :loca_location sexpr))
(xargtup (expand_restlist_as_tuple cont env mexpander modctx))
(nbargs (multiple_length xargtup))
(nbcallargs (-i nbargs 2))
)
(debug "mexpand_gimple_call_args" "; loc=" loc "; cont=" cont
"\n.. xargtup=" xargtup)
(when (<i nbargs 2)
(error_at loc "pseudo-primitive (GIMPLE_CALL_ARGS <lhs> <funtree> <args>...) with too few $1 arguments"
nbargs)
(return))
(let (
(cachelen (multiple_length gimple_call_args_primitive_cache_tuple))
(cprim (if (<i nbcallargs cachelen)
(multiple_nth gimple_call_args_primitive_cache_tuple nbcallargs)
()))
)
(unless cprim
;; grow the cache if needed
(if (>=i nbcallargs cachelen)
(let ( (newcachelen (+i 1 (ori 0xf (+i 5 (*i 3 (/iraw nbcallargs 2))))))
(newtup (make_multiple discr_multiple newcachelen))
)
(foreach_long_upto
(0 (-i cachelen 1))
(:long hix)
(multiple_put_nth newtup hix (multiple_nth gimple_call_args_primitive_cache_tuple hix)))
(setq gimple_call_args_primitive_cache_tuple newtup)))
(let (
(primname (string4out discr_string "GIMPLE_CALL_" nbcallargs))
(primsymb (create_symbolstr primname))
(tupformsymbs
(let ( (symlist (list 'tr_lhs 'tr_cfun))
)
(foreach_long_upto
(0 nbcallargs)
(:long fix)
(list_append symlist
(create_symbolstr (string4out discr_string "TR_ARG_" fix))))
(list_to_multiple symlist discr_multiple)))
(primfortup (multiple_map
tupformsymbs
(lambda (tsymb)
(instance class_formal_binding
:binder tsymb :fbind_type ctype_tree))))
(primexptup
(let ( (pxl (make_list discr_list))
(tr_cfun 'tr_cfun)
(tr_lhs 'tr_lhs)
)
(add2list pxl ##{/* gimple_call_args quasiprimitive $PRIMNAME */ melt_gimple_call_set_lhs}#
" (" ##{ gimple_build_call }# "("
##{$TR_CFUN, $NBCALLARGS}#)
(foreach_in_multiple
(tupformsymbs)
(curform :long fix)
(if fix (add2list pxl ##{, $CURFORM}#)))
(add2list pxl ")" ##{, $TR_LHS}# ")")
(list_to_multiple pxl discr_multiple)
))
(newprim (instance class_primitive
:named_name primsymb
:prim_formals primfortup
:prim_type ctype_tree
:prim_expansion primexptup))
)
(debug "mexpand_gimple_call_args" "; loc=" loc "; newprim= " newprim)
(setq cprim newprim)
))
(assert_msg "check cprim" (is_a cprim class_primitive))
(let ( (res (instance class_source_primitive
:loca_location loc
:sprim_oper cprim
:sargop_args xargtup))
)
(debug "mexpand_gimple_call_args" "; loc=" loc "; res=" res)
(return res)
)
)
)
)
;;
(export_patmacro gimple_call_args patexpand_gimple_call_args mexpand_gimple_call_args
:doc #{The $GIMPLE_CALL_ARGS is for patterns or expressions
for @code{GIMPLE_CALL}. Usage is @code{?(GIMPLE_CALL_ARGS
@var{<lhs>} @var{<fndecl>} @var{<args>...})}.}#)
(defun make_gimple_call (tlhs tfunv args)
:doc #{The function $MAKE_GIMPLE_CALL build a boxed gimple_call with lefthandside $TLHS for
function tree boxed in $TFUNV and arguments boxed in list or
multiple $ARGS.}#
(debug "make_gimple_call tlhs=" tlhs "\n.. tfunv=" tfunv "\n.. args=" args)
(let (
(tr_lhs (unbox :tree tlhs))
(tr_fun (unbox :tree tfunv))
)
(if (expr_chunk testfun_chk :long
#{/*make_gimple_call $TESTFUN_CHK*/ ($TR_FUN
&& (TREE_CODE ($TR_FUN) == FUNCTION_DECL || is_gimple_call_addr ($TR_FUN)))}#)
(let ( (arglist (make_list discr_list))
)
(cond
( (is_list args)
(each_component_in_list
args curarg
(let ( (t_curarg (unbox :tree curarg))
)
(if t_curarg (list_append args curarg)))
))
( (is_multiple args)
(foreach_in_multiple
(args)
(curarg :long aix)
(let ( (t_curarg (unbox :tree curarg))
)
(if t_curarg (list_append args curarg)))))
(:else
(void))
)
(let ( (argtup (list_to_multiple arglist discr_multiple))
(nbargs (multiple_length argtup))
(gr (null_gimple))
(t_curarg (null_tree))
)
(code_chunk
makecall_chk #{ /*make_gimple_call $MAKECALL_CHK */
/* special cases for small calls */
switch ($NBARGS) {
case 0:
$GR = gimple_build_call ($TR_FUN, 0);
break;
case 1:
$GR = gimple_build_call ($TR_FUN, 1,
melt_tree_content(melt_multiple_nth($ARGTUP, 0))
);
break;
case 2:
$GR = gimple_build_call ($TR_FUN, 2,
melt_tree_content(melt_multiple_nth($ARGTUP, 0)),
melt_tree_content(melt_multiple_nth($ARGTUP, 1))
);
break;
case 3:
$GR = gimple_build_call ($TR_FUN, 3,
melt_tree_content(melt_multiple_nth($ARGTUP, 0)),
melt_tree_content(melt_multiple_nth($ARGTUP, 1)),
melt_tree_content(melt_multiple_nth($ARGTUP, 2))
);
break;
case 4:
$GR = gimple_build_call ($TR_FUN, 4,
melt_tree_content(melt_multiple_nth($ARGTUP, 0)),
melt_tree_content(melt_multiple_nth($ARGTUP, 1)),
melt_tree_content(melt_multiple_nth($ARGTUP, 2)),
melt_tree_content(melt_multiple_nth($ARGTUP, 3))
);
break;
case 5:
$GR = gimple_build_call ($TR_FUN, 5,
melt_tree_content(melt_multiple_nth($ARGTUP, 0)),
melt_tree_content(melt_multiple_nth($ARGTUP, 1)),
melt_tree_content(melt_multiple_nth($ARGTUP, 2)),
melt_tree_content(melt_multiple_nth($ARGTUP, 3)),
melt_tree_content(melt_multiple_nth($ARGTUP, 4))
);
break;
default:
{
#if GCCPLUGIN_VERSION == 4008 /* GCC 4.8 */
vec<tree> $MAKECALL_CHK#_vargs;
#else /* GCC 4.9 */
auto_vec<tree> $MAKECALL_CHK#_vargs;
#endif /* GCC 4.9 */
$MAKECALL_CHK#_vargs.reserve($NBARGS);
for (int ix_$MAKECALL_CHK=0;
ix_$MAKECALL_CHK < (int) $NBARGS;
ix_$MAKECALL_CHK++) {
$T_CURARG = melt_tree_content(melt_multiple_nth($ARGTUP, ix_$MAKECALL_CHK));
$MAKECALL_CHK#_vargs.quick_push($T_CURARG);
$T_CURARG = NULL_TREE;
}
$GR = gimple_build_call_vec ($TR_FUN, $MAKECALL_CHK#_vargs);
}
break;
} /* end switch */
if ($TR_LHS) gimple_call_set_lhs($GR, $TR_LHS);
/*end make_gimple_call $MAKECALL_CHK */
}#)
(let ( (res (constant_box gr))
)
(debug "make_gimple_call res=" res)
(return res)
))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; add pattern matching ?(gimple_call_more_args ?lhs ?fndecl ?arg0 ?arg1 ... ?argn)
(defvar gimple_call_more_args_cmatcher_cache_tuple)
(setq gimple_call_more_args_cmatcher_cache_tuple (make_multiple discr_multiple 32))
(defun patexpand_gimple_call_more_args (sexpr env pctx)
(debug "patexpand_gimple_call_more_args" "; sexpr=" sexpr "\n.. env=" env "\n.. pctx=" pctx)
(assert_msg "check sexpr" (is_a sexpr class_sexpr) sexpr)
(assert_msg "check env" (is_a env class_environment) env)
(assert_msg "check pctx" (is_a pctx class_pattern_expansion_context) pctx)
(let (
(cont (unsafe_get_field :sexp_contents sexpr))
(loc (unsafe_get_field :loca_location sexpr))
(curpair (pair_tail (list_first cont)))
(argsp (patternexpand_pairlist_as_tuple curpair env pctx loc))
(nbargs (multiple_length argsp))
(nbcallargs (-i nbargs 2))
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "; cont=" cont
"\n.. argsp=" argsp)
(when (<i nbargs 2)
(error_at loc
"pattern ?(GIMPLE_CALL_MORE_ARGS <lhs> <fun> [<arg0>...]) with too few #$1 arguments"
nbargs)
(return))
(let (
(cachelen (multiple_length gimple_call_more_args_cmatcher_cache_tuple))
(cmat (if (<i nbcallargs cachelen)
(multiple_nth gimple_call_more_args_cmatcher_cache_tuple nbcallargs)
()))
)
(if (>=i nbcallargs cachelen)
(let ( (newcachelen (+i 1 (ori 0xf (+i 5 (*i 3 (/iraw nbcallargs 2))))))
(newtup (make_multiple discr_multiple newcachelen))
)
(foreach_long_upto
(0 (-i cachelen 1))
(:long hix)
(multiple_put_nth newtup hix (multiple_nth gimple_call_more_args_cmatcher_cache_tuple hix)))
(setq gimple_call_more_args_cmatcher_cache_tuple newtup)))
(let (
(argsymblist (list 'tr_lhs 'tr_fun))
)
(foreach_long_upto
(0 (-i nbcallargs 1))
(:long cix)
(let ( (curargname (string4out discr_string "TR_ARG_" cix))
(curargsymb (create_symbolstr curargname))
)
(debug "patexpand_gimple_call_more_args" "; curargsymb=" curargsymb)
(list_append argsymblist curargsymb)
)
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc
" argssymblist=" argsymblist)
(let ( (tupargsymb (list_to_multiple argsymblist discr_multiple))
(cmatname (string4out discr_string "GIMPLE_CALL_MORE_ARGS_" nbcallargs))
(cmatsymb (create_symbolstr cmatname))
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc
" tupargsymb=" tupargsymb
"\n.. cmatsymb=" cmatsymb)
(let (
(gibind (instance class_formal_binding
:binder 'gi
:fbind_type ctype_gimple))
(tupargbind (multiple_map
tupargsymb
(lambda (tsymb)
(instance class_formal_binding
:binder tsymb
:fbind_type ctype_tree))))
(cmtest
(let
( (cmt (make_list discr_list))
(gimplecallstate 'gimplecallstate)
(gi 'gi)
)
(add2list
cmt
##{ /* $CMATNAME $GIMPLECALLSTATE generated test for gimple_call_more_args ? */
($GI && gimple_code($GI)==GIMPLE_CALL && gimple_call_num_args($GI) >= $NBCALLARGS)
}#
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "; cmtest=" cmt)
cmt))
(cmfill
(let ( (cmf (make_list discr_list))
(gimplecallstate 'gimplecallstate)
(gi 'gi)
(tr_lhs 'tr_lhs)
(tr_fun 'tr_fun)
)
(add2list
cmf
##{ /* $CMATNAME $GIMPLECALLSTATE generated fill for gimple_call_more_args ! */
$TR_LHS = gimple_call_lhs ($GI) ;
$TR_FUN = gimple_call_fndecl ($GI) ;
}#)
(foreach_in_multiple
(tupargsymb)
(curargsymb :long aix)
(if (>=i aix 2)
(let ( (nix (-i aix 2))
)
(add2list cmf
##{ $CURARGSYMB = gimple_call_args ($GI, $NIX) ;
}#)))
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "; cmfill=" cmf)
cmf
))
(newcmat
(instance class_cmatcher
:named_name cmatsymb
:amatch_matchbind gibind
:amatch_out tupargbind ;; tuple of formals
:cmatch_state 'gimplecallstate ;; symbol
:cmatch_exptest (list_to_multiple cmtest discr_multiple)
:cmatch_expfill (list_to_multiple cmfill discr_multiple)
))
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "\n.. newcmat=" newcmat)
(multiple_put_nth gimple_call_more_args_cmatcher_cache_tuple nbcallargs newcmat)
(setq cmat newcmat)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "; nbcallargs=" nbcallargs
"\n.. updated cachetuple="
"\n.. cmat=" cmat)
)
)
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "; cmat=" cmat)
(assert_msg "check cmat" (is_a class_cmatcher cmat) cmat)
(multicall
(args pats)
(patmacexpand_for_matcher curpair cmat env loc pctx)
(debug "patexpand_gimple_call_more_args" "; loc=" loc " args=" args " pats=" pats)
(multicall
(subpatw :long imax imin isum)
(pattern_weight_tuple pats)
(debug "patexpand_gimple_call_more_args" "; loc=" loc " subpatw=" subpatw
"\n.. imax=" imax " imin=" imin " isum=" isum)
(let (
(cmatsymb (get_field :named_name cmat))
;;; notice that we are embedding the binding in the
;;; result, but not putting the binding in the
;;; environment. See comment about 'mv is not bound' in
;;; file warmelt-normatch.melt function
;;; normpat_anymatchpat...
(cmabind (instance class_cmatcher_binding
:binder cmatsymb
:cmbind_matcher cmat))
(res
(instance class_source_pattern_c_match
:loca_location loc
:pat_weight (constant_box (+i 1 isum))
:spac_operator cmat
:spac_operbind cmabind
:spac_inargs args
:spac_outargs pats)
)
)
(debug "patexpand_gimple_call_more_args" "; loc=" loc "\n.. cmabind=" cmabind
"\n.. res=" res)
(return res)
)
)
)
)
)
)
(defun mexpand_gimple_call_more_args (sexpr env mexpander modctx)
(debug "mexpand_gimple_call_more_args" "; sexpr=" sexpr "\n.. env=" env "\n.. modctx=" modctx)
(assert_msg "check sexpr" (is_a sexpr class_sexpr) sexpr)
(assert_msg "check env" (is_a env class_environment) env)
(let (
(cont (unsafe_get_field :sexp_contents sexpr))
(loc (unsafe_get_field :loca_location sexpr))
(xargtup (expand_restlist_as_tuple cont env mexpander modctx))
(nbargs (multiple_length xargtup))
(nbcallargs (-i nbargs 2))
)
(debug "mexpand_gimple_call_more_args" "; loc=" loc "; cont=" cont
"\n.. xargtup=" xargtup)
(error_at loc "GIMPLE_CALL_MORE_ARGS cannot be used in expressions...")
(return)))
(export_patmacro gimple_call_more_args patexpand_gimple_call_more_args mexpand_gimple_call_more_args
:doc #{The $GIMPLE_CALL_MORE_ARGS is for patterns but not expressions
for @code{GIMPLE_CALL}, with at least the given arguments and possibly some more.
Usage is @code{?(GIMPLE_CALL_MORE_ARGS
@var{<lhs>} @var{<fndecl>} @var{<args>...})}.}#)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; match a gimple call to a direct function of arity 1 exactly
(defcmatcher gimple_call_1
(:gimple gc)
(:tree lhs
fndecl
arg0)
gimp1call
:doc #{$GIMPLE_CALL_1 match a gimple $GC call of arity 1, extracting result $LHD function decl $FNDECL and $ARG0.}#
;; test
#{/* gimple_call_1 $gimp1call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==1)}#
;; fill
#{ /* gimple_call_1 $gimp1call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
}#)
;; match a gimple call to a direct function of arity 1 or more
(defcmatcher gimple_call_1_more
(:gimple gc)
(:tree lhs
fndecl
arg0
:long nbargs)
gimp1calm
:doc #{$GIMPLE_CALL_1_MORE match a gimple $GC call of arity 1 or more, extracting result $LHD function decl $FNDECL and $ARG0 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_1_more $gimp1calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=1)}#
;; fill
#{ /* gimple_call_1_more $gimp1calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$nbargs = gimple_call_num_args($gc);
}#)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; match a gimple call to a direct function of arity 2 exactly
(defcmatcher gimple_call_2
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1)
gimp2call
:doc #{$GIMPLE_CALL_2 match a gimple $GC call of arity 2, extracting result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1.}#
;; test
#{/* gimple_call_2 $gimp2call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==2)}#
;; fill
#{ /* gimple_call_2 $gimp2call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
}#)
;; match a gimple call to a direct function of arity 2 or more
(defcmatcher gimple_call_2_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
:long nbargs)
gimp2calm
:doc #{$GIMPLE_CALL_2_MORE match a gimple $GC call of arity 2 or more, extracting result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_2_more $gimp2calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=2)}#
;; fill
#{ /* gimple_call_2_more $gimp2calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$nbargs = gimple_call_num_args($gc);
}#)
;; match a gimple call to a direct function of arity 3 exactly
(defcmatcher gimple_call_3
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2)
gimp3call
:doc #{$GIMPLE_CALL_3 match a gimple $GC call of arity 3, extracting result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2.}#
;; test
#{/* gimple_call_3 $gimp3call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==3)}#
;; fill
#{ /* gimple_call_3 $gimp3call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
}#)
;; match a gimple call to a direct function of arity 3 or more
(defcmatcher gimple_call_3_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
:long nbargs
)
gimp3calm
:doc #{$GIMPLE_CALL_3_MORE match a gimple $GC call of arity 3 or more, extracting result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2 & number of args $NBARGS.}#
;; test
#{/* gimple_call_3_more $gimp3calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=3)}#
;; fill
#{ /* gimple_call_3_more $gimp3calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$nbargs = gimple_call_num_args($gc);
}#)
;; match a gimple call to a direct function of arity 4 exactly
(defcmatcher gimple_call_4
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3)
gimp4call
:doc #{$GIMPLE_CALL_4 match a gimple $GC call of arity 4, extracting result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2 & $ARG3.}#
;; test
#{/* gimple_call_4 $gimp4call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==4)}#
;; fill
#{ /* gimple_call_4 $gimp4call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
}#)
;; match a gimple call to a direct function of arity 4 or more
(defcmatcher gimple_call_4_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
:long nbargs
)
gimp4calm
:doc #{$GIMPLE_CALL_4_MORE match a gimple $GC call of arity 4 or more,
extracting result $LHD function decl $FNDECL and
arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_4_more $gimp4calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL
&& gimple_call_num_args($gc)>=4)}#
;; fill
#{ /* gimple_call_4_more $gimp4calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$nbargs = gimple_call_num_args($gc);
}#)
;;;;
;; match a gimple call to a direct function of arity 5 exactly
(defcmatcher gimple_call_5
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4)
gimp5call
:doc #{$GIMPLE_CALL_5 match a gimple $GC call of arity 5, extracting
result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4.}#
;; test
#{/* gimple_call_5 $gimp5call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==5)}#
;; fill
#{ /* gimple_call_5 $gimp5call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
}#)
;; match a gimple call to a direct function of arity 5 or more
(defcmatcher gimple_call_5_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4
:long nbargs
)
gimp5calm
:doc #{$GIMPLE_CALL_5_MORE match a gimple $GC call of arity 5 or more,
extracting result $LHD function decl $FNDECL and
arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_5_more $gimp5calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=5)}#
;; fill
#{ /* gimple_call_5_more $gimp5calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
$nbargs = gimple_call_num_args($gc);
}#)
;;;;
;; match a gimple call to a direct function of arity 6 exactly
(defcmatcher gimple_call_6
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4
arg5)
gimp6call
:doc #{$GIMPLE_CALL_6 match a gimple $GC call of arity 6, extracting
result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4 & $ARG5.}#
;; test
#{/* gimple_call_6 $gimp6call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==6)}#
;; fill
#{ /* gimple_call_6 $gimp6call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
$arg5 = gimple_call_arg(($gc), 5);
}#)
;; match a gimple call to a direct function of arity 6 or more
(defcmatcher gimple_call_6_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4
arg5
:long nbargs
)
gimp6calm
:doc #{$GIMPLE_CALL_6_MORE match a gimple $GC call of arity 6 or more,
extracting result $LHD function decl $FNDECL and
arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4 & $ARG5 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_6_more $gimp6calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=6)}#
;; fill
#{ /* gimple_call_6_more $gimp6calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
$arg5 = gimple_call_arg(($gc), 5);
$nbargs = gimple_call_num_args($gc);
}#)
;;;;
;; match a gimple call to a direct function of arity 7 exactly
(defcmatcher gimple_call_7
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4
arg5
arg6)
gimp7call
:doc #{$GIMPLE_CALL_7 match a gimple $GC call of arity 7, extracting
result $LHD function decl $FNDECL and arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4 & $ARG5 & $ARG6.}#
;; test
#{/* gimple_call_7 $gimp7call ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)==7)}#
;; fill
#{ /* gimple_call_7 $gimp7call !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
$arg5 = gimple_call_arg(($gc), 5);
$arg6 = gimple_call_arg(($gc), 6);
}#)
;; match a gimple call to a direct function of arity 7 or more
(defcmatcher gimple_call_7_more
(:gimple gc)
(:tree lhs
fndecl
arg0
arg1
arg2
arg3
arg4
arg5
arg6
:long nbargs
)
gimp7calm
:doc #{$GIMPLE_CALL_7_MORE match a gimple $GC call of arity 7 or more,
extracting result $LHD function decl $FNDECL and
arguments $ARG0 & $ARG1 & $ARG2 & $ARG3 & $ARG4 & $ARG5 & $ARG6 and number of arguments $NBARGS.}#
;; test
#{/* gimple_call_7_more $gimp7calm ?*/ ($gc && gimple_code($gc)==GIMPLE_CALL && gimple_call_num_args($gc)>=7)}#
;; fill
#{ /* gimple_call_7_more $gimp7calm !*/
$lhs = gimple_call_lhs($gc);
$fndecl = gimple_call_fndecl($gc);
$arg0 = gimple_call_arg(($gc), 0);
$arg1 = gimple_call_arg(($gc), 1);
$arg2 = gimple_call_arg(($gc), 2);
$arg3 = gimple_call_arg(($gc), 3);
$arg4 = gimple_call_arg(($gc), 4);
$arg5 = gimple_call_arg(($gc), 5);
$arg6 = gimple_call_arg(($gc), 6);
$nbargs = gimple_call_num_args($gc);
}#)
;;;; fetch the nth argument inside a call
(defprimitive gimple_call_nth_arg (:gimple gc :long n) :tree
:doc #{Safely retrieve in gimple call $GC its $N-th argument.}#
#{(($gc && gimple_code($gc) == GIMPLE_CALL && ($n)>=0
&& ($n) < gimple_call_num_args($gc))
? gimple_call_arg(($gc), ($n)) : NULL_TREE)}# )
;;;;;;;;;;;;;;;;
;;;; match a gimple return
(defcmatcher gimple_return
(:gimple gr)
(:tree retval
)
gimpret
:doc #{$GIMPLE_RETURN match or build a gimple return extracting the returned treee $RETVAL.}#
;; test
#{/* gimple_return $GIMPRET ? */ ($gr && gimple_code($gr)==GIMPLE_RETURN)}#
;; fill
#{/* gimple_return $GIMPRET ! */
$retval = gimple_return_retval(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const greturn*>
#endif /* GCC 5.0 */
($GR)
);
}#
;; operate
#{/* gimple_return: */ gimple_build_return($RETVAL) }#
)
;;;;;;;;;;;;;;;;
;;;; match a goto [to a label or var for indirect goto]
(defcmatcher gimple_goto
(:gimple gr)
(:tree tlabeld)
gimpgoto
:doc #{$GIMPLE_GOTO match or build a gimple goto to label destination tree $tLABELD}#
;; test
#{ /* gimple_goto $gimpgoto ? */ ($gr && gimple_code($gr) == GIMPLE_GOTO) }#
;; fill
#{ /* gimple_goto $gimpgoto ! */
$tlabeld = gimple_goto_dest(
($GR)
);
}#
;; operate
#{ /* gimple_goto: */ gimple_build_goto($TLABELD) }#
)
;;;;;;;;;;;;;;;;
;;; match a gimple error mark or a nil; probably not very useful!
(defcmatcher gimple_error_mark_or_nil
(:gimple gr)
()
gimperrnil
:doc #{$GIMPLE_ERROR_MARK_OR_NIL match a nil Gimple or an error mark.}#
;; test
#{ /*gimple_error_mark_or_nil $GIMPERRNIL ? */ (!$GR
|| gimple_code($GR) == GIMPLE_ERROR_MARK) }#
;; no fill
)
;;; match a gimple error mark
(defcmatcher gimple_error_mark
(:gimple gr)
()
gimperr
:doc #{$GIMPLE_ERROR_MARK match a Gimple error mark.}#
#{ /*gimple_error_mark $GIMPERR ? */ ($GR && gimple_code($GR) == GIMPLE_ERROR_MARK) }#
)
;; match any gimple_debug
(defcmatcher gimple_debug
(:gimple gr)
()
gimpdbg
:doc #{$GIMPLE_DEBUG match a Gimple debug.}#
;; test
#{ /* gimple_debug $GIMPDBG ? */ (($gr) && is_gimple_debug(($gr))) }#
;; no fill
)
;; match a gimple_debug_bind
(defcmatcher gimple_debug_bind
(:gimple gr)
(:tree tvar tval)
gimpdbgbind
:doc #{$GIMPLE_DEBUG_BIND match a Gimple debug bind extracting tree var $TVAR and value $TVALUE.}#
;; test
#{ /* gimple_debug_bind $gimpdbgbind ? */ (($GR) && gimple_debug_bind_p (($GR))) }#
;; fill
#{ /* gimple_debug_bind $gimpdbgbind ! */
$TVAR = gimple_debug_bind_get_var ($GR);
$TVAL = gimple_debug_bind_get_value ($GR);
}#
;; oper
#{/* gimple_debug_bind oper */ gimple_build_debug_bind (($TVAR), ($TVAL), NULL)}#
)
;;; match a label
(defcmatcher gimple_label
(:gimple gr)
(:tree tlabel)
gimplab
:doc #{$GIMPLE_LABEL match or build a gimple label extracting the label tree $TLABEL}#
;; test
#{ /* gimple_label $gimplab ? */ ($gr && gimple_code($gr) == GIMPLE_LABEL) }#
;; fill
#{ /* gimple_label $gimplab ! */
$tlabel = gimple_label_label(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const glabel*>
#endif /* GCC 5.0 */
($GR));
}#
;; operate
#{ /* gimple_label: */
gimple_build_label ($TLABEL)
}#
)
;;; match a transaction - only in GCC 4.8 or GCC 4.9
(defcmatcher gimple_transaction
(:gimple gr)
(:gimple_seq gsbody
:tree tlab)
gimptrans
:doc #{$GIMPLE_TRANSACTION match or build a transaction block gimple.
$GSBODY is the gimple_seq of the body, $TLAB is the label tree.}#
;; test
#{/*gimple_transaction $GIMPTRANS ?*/ ($GR && gimple_code($GR) == GIMPLE_TRANSACTION) }#
;; fill
#{/*gimple_transaction $GIMPTRANS !*/
$GSBODY = gimple_transaction_body (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <gtransaction*>
#endif /* GCC 5.0 */
($GR)) ;
$TLAB = gimple_transaction_label (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <gtransaction*>
#endif /* GCC 5.0 */
($GR)) ;
}#
;; operator expansion
#{/*gimple_transaction:*/ gimple_build_transaction($GSBODY,$TLAB)}#
)
;; match a gimple exception else
(defcmatcher gimple_eh_else
(:gimple gi)
(:gimple_seq gsnormbody gsexcbody)
gimpehels
:doc #{$GIMPLE_EH_ELSE match or build an exception else, sole
content of GIMPLE_TRY_FINALLY node. $GDNORMBODY is the normal exit
body, and $GSEXCBODY is the exceptional exit body.}#
;; test
#{ /* gimple_eh_else $GIMPEHELS ? */ ($GI && gimple_code($GI) == GIMPLE_EH_ELSE) }#
;; fill
#{ /* gimple_eh_else $GIMPEHELS ! */
$GSNORMBODY = gimple_eh_else_n_body(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <geh_else*>
#endif /* GCC 5.0 */
($GI)) ;
$GSEXCBODY = gimple_eh_else_e_body(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <geh_else*>
#endif /* GCC 5.0 */
($GI)) ;
}#
;; operate
#{ /*gimple_eh_else: */ gimple_build_eh_else ($GSNORMBODY, $GSEXCBODY) }#
)
(export_values gimple_transaction gimple_eh_else)
;;;;;;;;;;;;;;;;
(defcmatcher gimple_eh_dispatch
(:gimple gi)
(:long regnum)
gimpehdis
:doc #{$GIMPLE_EH_DISPATCH match or build an exception dispatch. $REGNUM is the region number.}#
;; test
#{ /* gimple_eh_dispatch $GIMPEHDIS ? */ ($GI && gimple_code($GI) == GIMPLE_EH_DISPATCH) }#
;; fill
#{ /* gimple_eh_dispatch $GIMPEHDIS ! */
$REGNUM = gimple_eh_dispatch_region (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const geh_dispatch*>
#endif /* GCC 5.0 */
($GI));
}#
;; operate
#{ /* gimple_eh_dispatch: */ gimple_build_eh_dispatch($REGNUM) }#
)
;;; match a nop
(defcmatcher gimple_nop
(:gimple gr)
()
gimpnop
:doc #{$GIMPLE_NOP match or build a nop gimple}#
;; test
#{ /* gimple_nop $gimpnop ?*/ ($gr && gimple_code($gr) == GIMPLE_NOP) }#
;; no fill
#{ /* gimple_nop $gimpnop ! */ }#
;; operator
#{ /*gimple_nop:*/ gimple_build_nop() }#
)
;;; match a gimple exception catcher
(defcmatcher gimple_catch
(:gimple gi)
(:tree textype
:gimple_seq gshandler)
gimpcatch
:doc #{$GIMPLE_CATCH match or build a typed exception handler with $TEXTYPE
being the type[s] of exceptions, and $GSHANDLER being the handler
body gimpleseq.}#
;; test
#{ /*gimple_catch $GIMPCATCH ? */ ($GI && gimple_code($GI) == GIMPLE_CATCH) }#
;; fill
#{ /*gimple_catch $GIMPCATCH ! */
$TEXTYPE = gimple_catch_types (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gcatch*>
#endif /* GCC 5.0 */
($GI));
$GSHANDLER = gimple_catch_handler (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <gcatch*>
#endif /* GCC 5.0 */
($GI));
}#
;; operator
#{ /*gimple_catch:*/ gimple_build_catch($TEXTYPE,$GSHANDLER) }#
)
;; match a gimple exception filter
(defcmatcher gimple_eh_filter
(:gimple gi)
(:tree textype
:gimple_seq gsfail)
gimpehfilt
:doc #{$GIMPLE_EH_FILTER match or build a gimple exception
specification. $TEXTYPE is the list of exception types and $GDFAIL
is the sequence to execute on failure.}#
;; test
#{ /*gimple_eh_filter $GIMPEHFILT ?*/ ($GI && gimple_code($GI) == GIMPLE_EH_FILTER) }#
;; fill
#{ /*gimple_eh_filter $GIMPEHFILT !*/
$TEXTYPE = gimple_eh_filter_types (($GI));
$GSFAIL = gimple_eh_filter_failure (($GI));
}#
;; operate
#{ /*gimple_eh_filter:*/ gimple_build_eh_filter($TEXTYPE,$GSFAIL) }#
)
;; match a gimple_eh_must_not_throw
(defcmatcher gimple_eh_must_not_throw
(:gimple gi)
(:tree tfndecl)
gimpnthr
:doc #{$GIMPLE_EH_MUST_NOT_THROW match or build an exception
barrier, with a non-returning function decl invoked when exception
propagates to this point.}#
;; test
#{ /* gimple_eh_must_not_throw $GIMPNTHR ? */ ($GI && gimple_code($GI) == GIMPLE_EH_MUST_NOT_THROW) }#
;; fill
#{ /* gimple_eh_must_not_throw $GIMPNTHR ! */
$TFNDECL = gimple_eh_must_not_throw_fndecl(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <geh_mnt*>
#endif /* GCC 5.0 */
($GI));
}#
;; operate
#{ /* gimple_eh_must_not_throw: */ gimple_build_eh_must_not_throw ($TFNDECL) }#
)
;; match a gimple exception resume
(defcmatcher gimple_resx
(:gimple gi)
(:long regnum)
gimpresx
:doc #{$GIMPLE_RESX match or build a gimple exception resume. $REGNUM is the exception region number.}#
;; test
#{ /* gimple_resx $GIMPRESX ? */ ($GI && gimple_code($GI) == GIMPLE_RESX) }#
;; fill
#{ /* gimple_resx $GIMPRESX ! */
$REGNUM = gimple_resx_region(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gresx*>
#endif /* GCC 5.0 */
($GI));
}#
;; operate
#{ /* gimple_resx: */ gimple_build_resx((int) $REGNUM) }#
)
;;;;;;;;;;;;;;;;
(defcmatcher gimple_try
(:gimple gi)
(:gimple_seq gseval gscleanup
:long kind)
gimptry
:doc #{$GIMPLE_TRY match a GIMPLE_TRY statement. $GSEVAL is the gimple seq to evaluate, GSCLEANUP is the cleanup.}#
;; test
#{ /* gimple_try $GIMPTRY ? */ ($GI && gimple_code($GI) == GIMPLE_TRY) }#
;; fill
#{ /* gimple_try $GIMPTRY ! */
$GSEVAL = gimple_try_eval ($GI);
$GSCLEANUP = gimple_try_cleanup ($GI);
$KIND = (long) gimple_try_kind ($GI);
}#
)
;;;;;;;;;;;;;;;;
(defcmatcher gimple_try_catch
(:gimple gi)
(:gimple_seq gseval gscleanup)
gimptry
:doc #{$GIMPLE_TRY_CATCH match or build a GIMPLE_TRY_CATCH statement. $GSEVAL is the gimple seq to evaluate, GSCLEANUP is the cleanup.}#
;; test
#{ /* gimple_try_catch $GIMPTRY ? */ ($GI && gimple_code($GI) == GIMPLE_TRY && gimple_try_kind($GI) == GIMPLE_TRY_CATCH) }#
;; fill
#{ /* gimple_try_catch $GIMPTRY ! */
$GSEVAL = gimple_try_eval ($GI);
$GSCLEANUP = gimple_try_cleanup ($GI);
}#
;; operate
#{ /* gimple_try_catch: */ gimple_build_try ($GSEVAL, $GSCLEANUP, GIMPLE_TRY_CATCH) }#
)
(defcmatcher gimple_try_finally
(:gimple gi)
(:gimple_seq gseval gscleanup)
gimptry
:doc #{$GIMPLE_TRY_FINALLY match or build a GIMPLE_TRY_FINALLY statement. $GSEVAL is the gimple seq to evaluate, GSCLEANUP is the cleanup.}#
;; test
#{ /* gimple_try_finally $GIMPTRY ? */ ($GI && gimple_code($GI) == GIMPLE_TRY && gimple_try_kind($GI) == GIMPLE_TRY_FINALLY) }#
;; fill
#{ /* gimple_try_finally $GIMPTRY ! */
$GSEVAL = gimple_try_eval ($GI);
$GSCLEANUP = gimple_try_cleanup ($GI);
}#
;; operate
#{ /* gimple_try_finally: */ gimple_build_try ($GSEVAL, $GSCLEANUP, GIMPLE_TRY_FINALLY) }#
)
;;; match a gimple bind
(defcmatcher gimple_bind
(:gimple gr)
(:tree tvars tblock
:gimple_seq gbody
)
gimpbind
:doc #{$GIMPLE_BIND match or build a local bind gimple with $TVARS locals and $TBLOCK block symbol and $GBODY body gimple_seq. }#
;; test
#{ /* gimple_bind $GIMPBIND ? */ ($GR && gimple_code($GR) == GIMPLE_BIND) }#
;; fill
#{ /* gimple_bind $GIMPBIND ! */
$TVARS = gimple_bind_vars(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gbind*>
#endif /* GCC 5.0 */
($GR));
$TBLOCK = gimple_bind_block(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gbind*>
#endif /* GCC 5.0 */
($GR));
$GBODY = gimple_bind_body(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gbind*>
#endif /* GCC 5.0 */
($GR));
}#
;; operator
#{ /*gimple_bind:*/ gimple_build_bind($TVARS,$GBODY,$TBLOCK)}#
)
;;; match a with cleanup expr, which is only inside the gimplifier
(defcmatcher gimple_with_cleanup_expr
(:gimple gr)
(:long cleanupflag)
gimpclx
:doc #{The $GIMPLE_WITH_CLEANUP_EXPR matches a cleanup expression, and sets the boolean $CLEANUPFLAG}#
;; test
#{ /* gimple_with_cleanup_expr ? */ ($GR && gimple_code($GR) == GIMPLE_WITH_CLEANUP_EXPR) }#
;; fill
#{ /* gimple_with_cleanup_expr ! */
$CLEANUPFLAG = gimple_wce_cleanup_eh_only($GR);
}#)
;;; match a gimple asm
(defcmatcher gimple_asm
(:gimple gr)
(:cstring asmstr
:long ninputs noutputs nclobbers)
gimpasm
:doc #{$GIMPLE_ASM match a gimple ASM statement of string $ASMSTR with $NINPUTS $NOUTPUTS $NCLUBBERS}#
;; test
#{ /* gimple_asm $gimpasm ? */ ($gr && gimple_code($gr) == GIMPLE_ASM) }#
;; fill
#{ /* gimple_asm $gimpasm ! */
$asmstr = gimple_asm_string (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gasm*>
#endif /* GCC 5.0 */
($GR));
$ninputs = gimple_asm_ninputs (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gasm*>
#endif /* GCC 5.0 */
($GR));
$noutputs = gimple_asm_noutputs (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gasm*>
#endif /* GCC 5.0 */
($GR));
$nclobbers = gimple_asm_nclobbers (
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 */
static_cast <const gasm*>
#endif /* GCC 5.0 */
($GR));
}# )
;;;;;;;;;;;;;;;;
;;; match a gimple switch
(defcmatcher gimple_switch
(:gimple gr)
(:tree tindex
tdeflab
:long numlabels)
gimpswitch
:doc #{$GIMPLE_SWITCH match or build a gimple SWITCH statement indexed by $TINDEX and with $NUMLABELS labels, with default label tree $TDEFLAB}#
;; test
#{ /* gimple_switch $gimpswitch ? */ ($gr && gimple_code($gr) == GIMPLE_SWITCH) }#
;; fill
#{ /* gimple_switch $gimpswitch ! */
$tindex = gimple_switch_index ($gr);
$numlabels = gimple_switch_num_labels ($gr);
$tdeflab = gimple_switch_default_label ($gr);
}#
;; operate
#{ /* gimple_switch: */ gimple_build_switch_nlabels($NUMLABELS, $TINDEX, $TDEFLAB) }#
)
;;; return the index of a switch
(defprimitive gimple_switch_index (:gimple gs) :tree
:doc #{Retrieve the index of gimple switch $GS.}#
#{ (($GS) && gimple_code($GS) == GIMPLE_SWITCH) ?
gimple_switch_index($GS) : (tree) NULL }#)
;;; set the index of a switch
(defprimitive gimple_switch_set_index (:gimple gs :tree trix) :void
:doc #{In gimple switch $GS set the index to $TRIX.}#
#{ if (($GS) && gimple_code($GS) == GIMPLE_SWITCH && ($TRIX) && (SSA_VAR_P ($TRIX) || CONSTANT_CLASS_P ($TRIX)))
{ gimple_switch_set_index ($GS, $TRIX); }
}#)
;;; return a tree label in a switch
(defprimitive gimple_switch_label (:gimple gs :long n) :tree
:doc #{Safely retrieve in gimple switch $GS the $N-th label -with $N positive or zero-.}#
#{ (($GS) && gimple_code($GS) == GIMPLE_SWITCH
&& $N >= 0 && $N < gimple_switch_num_labels($GS)) ?
gimple_switch_label($GS, $N) : NULL_TREE }#)
;;; set the tree label in a switch
(defprimitive gimple_switch_set_label (:gimple gs :long n :tree tlab) :void
:doc #{Safely set in gimple switch $GS the $N-th label -with $N positive or zero- to tree case label $TLAB.}#
#{ /* gimple_switch_set_label */
if (($GS) && gimple_code($GS) == GIMPLE_SWITCH
&& $N >= 0 && $N < gimple_switch_num_labels($GS)
&& ($TLAB == NULL_TREE || TREE_CODE($TLAB) == CASE_LABEL_EXPR))
gimple_switch_set_label ($GS, (unsigned)$N, $TLAB);
}#)
(defun make_gimple_switch (indexv defcasev cases)
:doc #{the $MAKE_GIMPLE_SWITCH function make a boxed gimple switch
with index in boxed tree $INDEXV, default case in boxed tree
$DEFCASEV, and cases in $CASES which is a list or tuple of boxed case label trees.}#
(debug "make_gimple_switch" " indexv=" indexv " defcasev=" defcasev " cases=" cases)
(let ( (tr_index (unbox :tree indexv))
(tr_defcase (unbox :tree defcasev))
)
(if (expr_chunk test_chk :long #{ /* make_gimple_switch $TEST_CHK */
(!$TR_INDEX || EXPR_P($TR_INDEX))
&& (!$TR_DEFCASE || TREE_CODE($TR_DEFCASE) == CASE_LABEL_EXPR) }#)
(let ( (caselist (make_list discr_list))
)
(cond
( (is_list cases)
(each_component_in_list
cases curcasev
(let ( (tr_curcase (unbox :tree curcasev))
)
(if (expr_chunk testcurcasel_chk :long #{ /* make_gimple_switch $TESTCURCASEL_CHK */
($TR_CURCASE
&& TREE_CODE($TR_CURCASE) == CASE_LABEL_EXPR)
}#
)
(list_append caselist curcasev)))
)
)
( (is_multiple cases)
(foreach_in_multiple
(cases)
(curcasev :long cix)
(let ( (tr_curcase (unbox :tree curcasev))
)
(if (expr_chunk testcurcaset_chk :long #{ /* make_gimple_switch $TESTCURCASET_CHK */
($TR_CURCASE
&& TREE_CODE($TR_CURCASE) == CASE_LABEL_EXPR)
}#
)
(list_append caselist curcasev)))
)
)
(:else (void)))
(let ( (casetup (list_to_multiple caselist discr_multiple))
(nbcases (multiple_length casetup))
(:gimple gr (null_gimple))
(:tree t_curcase (null_tree))
)
(code_chunk makegr_chk #{
/* make_gimple_switch $MAKEGR_CHK */
$GR = gimple_build_switch_nlabels ($NBCASES, $TR_INDEX, $TR_DEFCASE);
for (int ix_$MAKEGR_CHK = 0;
ix_$MAKEGR_CHK < (int) $NBCASES;
ix_$MAKEGR_CHK ++) {
$T_CURCASE = melt_tree_content(melt_multiple_nth($CASETUP, ix_$MAKEGR_CHK));
gimple_switch_set_label
(
#if GCCPLUGIN_VERSION >= 5000 /* GCC 5.0 has a class hierarchy */
static_cast<gswitch*>
#endif /* GCC 5.0 */
($GR),
(unsigned)ix_$MAKEGR_CHK, $T_CURCASE);
$T_CURCASE = NULL_TREE;
} /* end for ix_$MAKEGR_CHK */
}#)
(if gr
(let ( (res (constant_box gr))
)
(debug "make_gimple_switch" " res=" res)
(return res)
)
)
)
)
)
)
)
;;; iterator on switch cases
(defciterator foreach_case_of_gimple_switch
(:gimple gs)
ecos
(:tree tcase :long caseix)
:doc #{$FOREACH_CASE_OF_GIMPLE_SWITCH iterate on each tree case $TCASE and index $CASEIX of gimple switch $GS}#
#{
/* foreach_case_of_gimple_switch before $ECOS */
int $ECOS#_i = 0;
$TCASE = (tree) NULL;
$CASEIX = 0L;
if ($GS && gimple_code($GS) == GIMPLE_SWITCH)
{
int $ECOS#_n = gimple_switch_num_labels($GS);
for ($ECOS#_i = 0;
$ECOS#_i < $ECOS#_n;
$ECOS#_i++)
{
$TCASE = gimple_switch_label ($GS, $ECOS#_i);
$CASEIX = $ECOS#_i;
}#
#{
/* foreach_case_of_gimple_switch after $ECOS */
$TCASE = (tree) NULL;
$CASEIX = 0;
}
}
}#
)
;;;;;;;;;;;;;;;;
;;; match a phi node
(defcmatcher gimple_phi
(:gimple gr)
(:tree lhs ;left hand result
:long numargs)
gimphi
:doc #{$GIMPLE_PHI match a PHI node with $LHS being the result and $NUMARGS being the number of arguments}#
;; test
#{ /* gimple_phi $GIMPHI ? */ ($GR && gimple_code ($GR) == GIMPLE_PHI) }#
;; fill
#{ /* gimple_phi $GIMPHI ! */
$LHS = gimple_phi_result ($gr);
$NUMARGS = gimple_phi_num_args ($gr);
}# )
;;; safely retrieve the N-th argdeftree of a gimple phinode
(defprimitive gimple_phi_nth_arg_def (:gimple g :long n) :tree
:doc #{$GIMPLE_PHI_NTH_ARG_DEF safely retrieve from gimple $G
the $N-th argdef of a gimple phinode.}#
#{ ( ($g && gimple_code($G) == GIMPLE_PHI && $N >= 0
&& $N < gimple_phi_num_args ($G))
? gimple_phi_arg_def($G, $N) : NULL) }#)
;;; safely retrieve the N-th argedge of a gimple phinode
(defprimitive gimple_phi_nth_arg_edge (:gimple g :long n) :edge
:doc #{$GIMPLE_PHI_NTH_ARG_EDGE safely retrieve from gimple $G
the $N-th edge of a gimple phinode.}#
#{ ( ($g && gimple_code($G) == GIMPLE_PHI
&& $N >= 0 && $N < gimple_phi_num_args ($G))
? gimple_phi_arg_edge($G, $N) : (edge) NULL) }#)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcmatcher gimple_predict
(:gimple gr)
(:long predictor outcome)
gimpredi
:doc #{$GIMPLE_PREDICT match a GIMPLE_PREDICT statement, filling $PREDICTOR and $OUTCOME.}#
;; test
#{ /* gimple_predict $GIMPREDI ? */ ($GR && gimple_code($GR) == GIMPLE_PREDICT) }#
;; fill
#{ /* gimple_predict $GIMPREDI ! */
$PREDICTOR = (long) gimple_predict_predictor ($GR);
$OUTCOME = (long) gimple_predict_outcome ($GR);
}#)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; issue a notice or a warning at a gimple location
(defprimitive inform_at_gimple (:gimple g :cstring msg) :void
:doc #{$INFORM_AT_GIMPLE issue a notice at location of gimple $G with string $MSG.}#
#{ inform (($g ? gimple_location($g) : UNKNOWN_LOCATION), $msg); }#
)
(defprimitive warning_at_gimple (:gimple g :cstring msg) :void
:doc #{$WARNING_AT_GIMPLE issue a warning at location of gimple $G with string $MSG.}#
#{ warning_at(($g ? gimple_location($g) : UNKNOWN_LOCATION), 0, "MELT WARNING @Gimple: %s", $MSG); }#
)
(defprimitive warning_at_gimple_strbuf (:gimple g :value msg) :void
:doc #{$WARNING_AT_GIMPLE_STRBUF issue a warning at location of gimple $G with strbuf $MSG.}#
#{ melt_warning_at_strbuf(($g ? gimple_location($g) : UNKNOWN_LOCATION)
, $msg); }#
)
(defprimitive error_at_gimple (:gimple g :cstring msg) :void
:doc #{$ERROR_AT_GIMPLE issue a warning at location of gimple $G with string $MSG.}#
#{ error_at(($g ? gimple_location($g) : UNKNOWN_LOCATION), "MELT ERROR @Gimple: %s", $msg); }#
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defprimitive is_gimpleseq (v) :long
:doc #{$IS_GIMPLESEQ test if value $V is a boxed gimpleseq}#
#{(melt_magic_discr((melt_ptr_t)($v)) == MELTOBMAG_GIMPLESEQ)}# )
(defprimitive make_gimpleseq (discr :gimple_seq gs) :value
:doc #{$MAKE_GIMPLESEQ build a boxed gimpleseq of given $DISCR and gimpleseq $GS}#
#{(meltgc_new_gimpleseq((meltobject_ptr_t)($DISCR),($GS)))}# )
(defprimitive gimpleseq_content (v) :gimple_seq
:doc #{$GIMPLESEQ_CONTENT safely retrieve the gimpleseq inside boxed value $V}#
#{/*gimpleseq_content*/ (melt_gimpleseq_content((melt_ptr_t)($v)))}# )
;;;;
(defprimitive null_gimpleseq () :gimple_seq #{((gimple_seq)NULL)}#)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GIMPLE DEBUG OUTPUT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; boxed gimple debug
(defun dbgout_boxgimple_method (self dbgi :long depth)
(assert_msg "check dbgi" (is_a dbgi class_debug_information))
(let ( (dis (discrim self))
(out (unsafe_get_field :dbgi_out dbgi)) )
(add2out_strconst out " ?/")
(if (is_a dis class_named) (add2out_string out (unsafe_get_field :named_name dis)))
(add2out_strconst out "/{")
(ppstrbuf_gimple out depth (gimple_content self))
(add2out_strconst out "}/ ")
)
)
(install_method discr_gimple dbg_output dbgout_boxgimple_method)
(defun output_gimple (out :gimple g)
(if (is_out out)
(if g
(code_chunk outgimplechk
#{ /* output_gimple $OUTGIMPLECHK */ meltgc_ppout_gimple((melt_ptr_t)$OUT, 0, $G) }#)
(add2out_strconst out "*nullgimple*")
)))
(defun dbgout_mapgimple_method (self dbgi :long depth)
(assert_msg "check dbgi" (is_a dbgi class_debug_information))
(let ( (dis (discrim self))
(:long mapcount (mapgimple_count self))
(aux (mapgimple_aux self))
(out (unsafe_get_field :dbgi_out dbgi))
)
(add2out_strconst out " !gimplemap.")
(if (is_a dis class_named) (add2out_string out (unsafe_get_field :named_name dis)))
(add2out_strconst out "/")
(add2out_longdec out mapcount)
(add2out_strconst out "!{ ")
(if (and (<=i depth 1)
aux)
(progn
(add2out out " aux:")
(dbg_out aux dbgi (+i depth 3))
))
(foreach_mapgimple
(self)
(:gimple g :value val)
(add2out_indentnl out (+i depth 1))
(add2out out "*")
(output_gimple out g)
(add2out_strconst out " == ")
(dbg_out val dbgi (+i depth 2))
)
(add2out_strconst out " }!")
(add2out_indentnl out depth)
))
(install_method discr_map_gimples dbg_output dbgout_mapgimple_method)
;;;; boxed gimple seq debug
(defun dbgout_boxgimpleseq_method (self dbgi :long depth)
(assert_msg "check self" (is_a self discr_gimple_seq))
(assert_msg "check dbgi" (is_a dbgi class_debug_information))
(let ( (dis (discrim self))
(out (unsafe_get_field :dbgi_out dbgi)) )
(add2out_strconst out " ?/")
(if (is_a dis class_named) (add2out_string out (unsafe_get_field :named_name dis)))
(add2out_strconst out "/{")
(add2out_indentnl out (+i 1 depth))
(ppstrbuf_gimple_seq out (+i 1 depth) (gimpleseq_content self))
(add2out_indentnl out (+i 1 depth))
(add2out_strconst out "}/")
(add2out_indentnl out depth)
)
)
(install_method discr_gimple_seq dbg_output dbgout_boxgimpleseq_method)
;;;;;;;;;;;;;;;;
(defprimitive make_gimple_mixloc (:gimple g :long num :value val dis) :value
:doc #{Make a mixed location for the location of gimple $G with value $VAL
and discriminant $DIS, usually $DISCR_MIXED_LOCATION.}#
#{ (($g && gimple_location($g))?
meltgc_new_mixloc((meltobject_ptr_t)($dis), (melt_ptr_t)($val),
($num), (location_t)gimple_location(($g))):NULL) }#)
;;;;;;;;;;;;;;;;
(defprimitive gimple_seq_add_stmt (:gimple_seq gs :gimple g) :void
:doc #{Add to gimple seq $GS the gimple $G. May change and allocate $GS if it was NULL.}#
#{/*gimple_seq_add_stmt:*/ do {if ($G) gimple_seq_add_stmt (&$GS, $G);
}while(0)}#)
(defprimitive gimple_seq_add_seq (:gimple_seq gsdst gssrc) :void
:doc #{Append to gimple seq $GSDST the elements of gimple seq $GSSRC. May change and allocate $GSDST if it was null.}#
#{/*gimple_seq_add_seq:*/ gimple_seq_add_seq(&$GSDST, $GSSRC);
}#)
(defprimitive gimple_seq_copy (:gimple_seq gs) :gimple_seq
:doc #{Return a deep copy of gimple_seq $GS.}#
#{(($GS)?gimple_seq_copy(($GS)):((gimple_seq)0))}#
)
(defprimitive gimple_seq_alloc_with_stmt (:gimple g) :gimple_seq
:doc #{Allocate a new raw gimple sequence containing the gimple statement $G.
GCC may use cached free gimple sequences.}#
#{/*gimple_seq_alloc_with_stmt:*/ (($G)?gimple_seq_alloc_with_stmt(($G)):((gimple)NULL))}#)
(defprimitive gimple_seq_boxed_add_stmt (bgs :gimple g) :void
:doc #{Add to end of boxed gimple_seq $BGS the gimple $G. May fill $BGS if it contained a null gimple_seq.}#
#{/*gimple_seq_boxed_add_stmt:*/ if (melt_magic_discr ((melt_ptr_t)($BGS))
== MELTOBMAG_GIMPLESEQ
&& $G != (gimple)NULL)
gimple_seq_add_stmt (&(((struct meltgimpleseq_st*)($BGS))->val), ($G));}#
)
(defprimitive gimple_seq_boxed_add_seq (bgs :gimple_seq gs) :void
:doc #{Add to end of boxed gimple_seq $BGS the gimple_seq $GS. May fill $BGS if it contained a null gimple_seq.}#
#{/*gimple_seq_boxed_add_seq:*/ if (melt_magic_discr((melt_ptr_t)($BGS))
== MELTOBMAG_GIMPLESEQ
&& $GS != (gimple_seq)NULL)
gimple_seq_add_seq (&(((struct meltgimpleseq_st*)($BGS))->val), ($GS));}#
)
(defun gimple_seq_boxed_make_fill (discr :rest)
:doc #{Variadic function to make a boxed gimple seq of given
$DISCR -or $DISCR_GIMPLE_SEQ if null- and fill it with the given raw
gimples or gimpleseqs or boxed gimple values or boxed gimpleseq
values. A closure variadic argument is applied to the boxed
gimple_seq so may change it.}#
(if (null discr) (setq discr discr_gimple_seq))
(let ( (boxgs (make_gimpleseq discr (null_gimpleseq)))
)
;; boxgs can be null if discr was bad
(if (null boxgs)
(progn
(debug "gimple_seq_boxed_make_fill fail")
(return ())))
;; loop on variadic arguments
(forever
argloop
(variadic
( () (exit argloop))
( (:gimple g)
(gimple_seq_boxed_add_stmt boxgs g))
( (:gimple_seq gs)
(gimple_seq_boxed_add_seq boxgs gs))
( (:value v)
(cond
( (is_gimpleseq v)
(gimple_seq_boxed_add_seq boxgs (gimpleseq_content v)))
( (is_gimple v)
(gimple_seq_boxed_add_stmt boxgs (gimple_content v)))
( (is_closure v)
(v boxgs))
(:else
(debug "gimple_seq_boxed_make_fill ignoring v=" v)
()))
)
)
)
(debug "gimple_seq_boxed_make_fill return boxgs=" boxgs)
(return boxgs)
)
)
;;;;;;;;;;;;;;;;
(defprimitive gimple_build_return (:tree tr) :gimple
:doc #{Build a gimple to return $TR, if non-null.}#
#{($TR)?gimple_build_return(($TR)):((gimple)0)}#
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;; gimpleseq iteration
;;;; iterate on a gimpleseq
(defciterator each_in_gimpleseq
(:gimple_seq gseq) ;start formals
eachgimplseq
(:gimple g) ;local formals
;;; before expansion
#{ /* each_in_gimpleseq $EACHGIMPLSEQ + */
gimple_stmt_iterator gsi_$eachgimplseq;
if ($gseq)
for (gsi_$eachgimplseq = gsi_start ($gseq);
!gsi_end_p (gsi_$eachgimplseq);
gsi_next (&gsi_$eachgimplseq)) {
$g = gsi_stmt (gsi_$eachgimplseq);
}#
;;; after expansion
#{ } /* each_in_gimpleseq $EACHGIMPLSEQ - */ }# )
;;;; reverseiterate on a gimpleseq
(defciterator reveach_in_gimpleseq
(:gimple_seq gseq) ;start formals
eachgimplseq
(:gimple g) ;local formals
;;; before expansion
#{ /* reveach_in_gimpleseq $EACHGIMPLSEQ + */
gimple_stmt_iterator gsi_$eachgimplseq;
if ($gseq)
for (gsi_$eachgimplseq = gsi_last ($gseq);
!gsi_end_p (gsi_$eachgimplseq);
gsi_prev (&gsi_$eachgimplseq)) {
$g = gsi_stmt (gsi_$eachgimplseq);
}#
;;; after expansion
#{ } /* reveach_in_gimpleseq $EACHGIMPLSEQ - */ }# )
;; apply a function to each boxed gimple in a gimple seq
(defun do_each_gimpleseq (f :gimple_seq gseq)
(each_in_gimpleseq
(gseq) (:gimple g)
(let ( (gplval (make_gimple discr_gimple g)) )
(f gplval)))
)
;; apply a function to each boxed gimple in a gimple seq
(defun do_reveach_gimpleseq (f :gimple_seq gseq)
(reveach_in_gimpleseq
(gseq) (:gimple g)
(let ( (gplval (make_gimple discr_gimple g)) )
(f gplval)))
)
;;; gimple iterator
(defun gimple_iterator (f data :gimple g)
(each_bb_cfun
()
(:basic_block body :tree header)
(let ((:gimple_seq instructions (gimple_seq_of_basic_block body)))
(each_in_gimpleseq
(instructions)
(:gimple instruction)
(f data instruction))))
)
(defprimitive cfun_gimple_body () :gimple_seq
#{ (cfun?(cfun->gimple_body):NULL) }#)
;;;;;;;;;;;;;;;;
;; debug & output functions for gimple
(defun debugfun_gimple (dbgi :gimple g)
(assert_msg "check dbgi" (is_a dbgi class_debug_information))
(let ( (out (get_field :dbgi_out dbgi))
)
(if g
(code_chunk
outgimplechk
#{/*$OUTGIMPLECHK*/ meltgc_ppout_gimple ((melt_ptr_t)$OUT, 0, $G);}#
)
(add2out_strconst out "*nullgimple*")
)))
(register_gimple_debug_fun debugfun_gimple)
(defun diag_gimple (diagstate :gimple g)
(debug "diag_gimple start diagstate=" diagstate " g=" g)
(assert_msg "check diagstate" (is_a diagstate class_diagnostic_state))
(let ( (outbuf (make_strbuf discr_strbuf))
)
(output_gimple outbuf g)
(debug "diag_gimple outbuf=" outbuf)
(strbuf2string discr_string outbuf)))
(register_diag_gimple diag_gimple)
;;;;;;;;;;;;;;;;
;; debug & output functions for gimpleseq
(defun debugfun_gimpleseq (dbgi :gimple_seq gs)
(assert_msg "check dbgi" (is_a dbgi class_debug_information))
(let ( (out (get_field :dbgi_out dbgi))
)
(if gs
(code_chunk
outgimpleseqchk
#{ /*debugfun_gimpleseq $OUTGIMPLESEQCHK*/ meltgc_ppout_gimple_seq ((melt_ptr_t)$OUT, 0, $GS);}#
)
(add2out_strconst out "*nullgimpleseq*")
)))
(register_gimpleseq_debug_fun debugfun_gimpleseq)
(defun output_gimpleseq (out :gimple_seq gs)
(if (is_out out)
(if gs
(code_chunk
outgimpleseqchk
#{ /* output_gimpleseq $OUTGIMPLESEQCHK*/ meltgc_ppout_gimple_seq ((melt_ptr_t)$OUT, 0, $GS);}#
)
(add2out_strconst out "*nullgimpleseq*")
)))
(defun diag_gimpleseq (diagstate :gimple_seq gs)
(debug "diag_gimpleseq start diagstate=" diagstate " gs=" gs)
(assert_msg "check diagstate" (is_a diagstate class_diagnostic_state))
(let ( (outbuf (make_strbuf discr_strbuf))
)
(output_gimpleseq outbuf gs)
(strbuf2string discr_string outbuf)))
(register_diag_gimple_seq diag_gimpleseq)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; USE-DEF tree walking; handled differently in 4.8 & 4.9
;;;
(gccif "4.8"
;;; GCC 4.8 has the walk_use_def_chains function
;;
(cheader
#{ /* GCC 4.8 walk_use_def_hook utilities declaration */
#define MELTWALKHOOKDATA_MAGIC 0x5833fae1 /*1479801569*/
struct meltwalkhookdata_st {
unsigned mwh_magic; // always MELTWALKHOOKDATA_MAGIC
melt_ptr_t *mwh_hook_ad;
melt_ptr_t *mwh_wclos_ad;
melt_ptr_t *mwh_val_ad;
melt_ptr_t *mwh_visitedtree_ad;
}; // end struct meltwalkhookdata_st
MELT_EXTERN bool melt_4dot8_walk_hook_use_def_wrapper(tree, gimple, void *);
/* end GCC 4.8 walk_use_def_hook utilities */
}#)
;;
(defhook melt_4dot8_walk_use_def_hook (:tree tr :gimple g :value wclos val trhash)
()
:long
(debug "melt_4dot8_walk_use_def_hook tr=" tr "\n* gimple=" g "\n* wclos=" debug_less wclos
"\n* val=" val "\n* trhash=" debug_less trhash)
(assert_msg "melt_4dot8_walk_use_def_hook check wclos" (is_closure wclos) wclos)
(assert_msg "melt_4dot8_walk_use_def_hook check trhash" (is_maptree trhash) trhash)
(let ( (visited (maptree_get trhash tr))
)
(if visited (return 0)))
(maptree_put trhash tr :true)
(let ( (res (wclos val tr g))
)
(debug "melt_4dot8_walk_use_def_hook res=" res)
(return (if res 1 0))
)
) ;end melt_4dot8_walk_use_def_hook
;;
(cimplement
#{
/* GCC 4.8 walk_use_def_hook utilities implementation */
bool melt_4dot8_walk_hook_use_def_wrapper(tree tr, gimple g, void *ad) {
struct meltwalkhookdata_st* mwad = (struct meltwalkhookdata_st*)ad;
if (!mwad || mwad->mwh_magic != MELTWALKHOOKDATA_MAGIC)
melt_fatal_error("corrupted meltwalkhookdata_st @%p", ad);
return melthook_MELT_4DOT8_WALK_USE_DEF_HOOK (*(mwad->mwh_hook_ad),
tr, g,
*(mwad->mwh_wclos_ad),
*(mwad->mwh_val_ad),
*(mwad->mwh_visitedtree_ad)
);
}
/* end GCC 4.8 walk_use_def_hook utilities implementation */
}#)
;;
(defun melt_walk_use_def_chains (:value clos val :tree trvar)
:doc #{Walk in an unspecified order the use-def chain of SSA
variable $TRVAR; apply the $CLOS closure to the $VAL value and to the
current :tree and :gimple. Stop walking if the closure gives null.}#
(debug "melt_walk_use_def_chains clos=" clos "\n..val=" val "\n..trvar=" trvar)
(match
trvar
(?(tree_simple_ssa_name ?_ ?_)
(void))
(?_
(debug "melt_walk_use_def_chains not-ssa trvar=" trvar)
(return))
)
(if (is_closure clos)
(let ( (trmap (make_maptree discr_map_trees 43))
(whook melt_4dot8_walk_use_def_hook)
)
(debug "melt_walk_use_def_chains trmap=" trmap "\n.. whook=" whook "\n.. clos=" clos)
(code_chunk
walkusedef_chk
#{ /* melt_walk_use_def_chains $WALKUSEDEF_CHK start */
struct meltwalkhookdata_st mwhdata_$WALKUSEDEF_CHK;
memset (&mwhdata_$WALKUSEDEF_CHK, 0, sizeof(struct meltwalkhookdata_st ));
mwhdata_$WALKUSEDEF_CHK.mwh_hook_ad = (& $WHOOK);
mwhdata_$WALKUSEDEF_CHK.mwh_wclos_ad = (& $CLOS);
mwhdata_$WALKUSEDEF_CHK.mwh_val_ad = (& $VAL);
mwhdata_$WALKUSEDEF_CHK.mwh_visitedtree_ad = (& $TRMAP);
mwhdata_$WALKUSEDEF_CHK.mwh_magic = MELTWALKHOOKDATA_MAGIC;
walk_use_def_chains ($TRVAR, melt_4dot8_walk_hook_use_def_wrapper,
(void*)&mwhdata_$WALKUSEDEF_CHK,
true);
memset (&mwhdata_$WALKUSEDEF_CHK, 0, sizeof(struct meltwalkhookdata_st ));
/* melt_walk_use_def_chains $WALKUSEDEF_CHK end */
}#
)
)
)
)
(export_values melt_walk_use_def_chains)
) ;; end defun melt_walk_use_def_chains
;end GCC 4.8 walk use def
(gccif "4.9"
;;; GCC 4.9 don't the walk_use_def_chains function but has the
;;; FOR_EACH_SSA_TREE* macros from ssa-iterators.h
;;
;; the cheader below should be emitted once. If emitted twice,
;; trigger an error...
(cheader
#{ /* GCC 4.9 walk_use_def utilities declaration */
#ifdef MELT_WITHOUT_WALK_USE_DEF_CHAINS
#error got MELT_WITHOUT_WALK_USE_DEF_CHAINS
#endif
#define MELT_WITHOUT_WALK_USE_DEF_CHAINS
// header tree-ssa-operands.h defines USE_STMT
#include "tree-ssa-operands.h"
// header tree-phinodes.h defines gimple_vuse_op
#include "tree-phinodes.h"
// header gimple-ssa.h defines gimple_vuse_op
#include "gimple-ssa.h"
// header ssa-iterators.h defines FOR_EACH_SSA_TREE_OPERAND
#include "ssa-iterators.h"
}#)
;;
(defun melt_walk_use_def_chains (:value clos val :tree trvar)
:doc #{Walk in an unspecified order the use-def chain of SSA
variable $TRVAR; apply the $CLOS closure to the $VAL value and to the
current :tree and :gimple. Stop walking if the closure gives null.}#
(debug "melt_walk_use_def_chains clos=" clos "\n..val=" val "\n..trvar=" trvar)
(match
trvar
(?(tree_simple_ssa_name ?_ ?_)
(void))
(?_
(debug "melt_walk_use_def_chains not-ssa trvar=" trvar)
(return))
)
(if (is_closure clos)
(let ( (trmap (make_maptree discr_map_trees 43))
(:gimple gdef (expr_chunk gdefstmt_chk :gimple
#{ /*melt_walk_use_def_chains $GDEFSTMT_CHK */
SSA_NAME_DEF_STMT ($TRVAR) }#))
)
(debug "melt_walk_use_def_chains gdef=" gdef)
(letrec ( (internalwalker
(lambda (val :tree tr :gimple g)
(debug "melt_walk_use_def_chains/internalwalker val=" val
"\n.. tr=" tr "\n.. g=" g)
(assert_msg "melt_walk_use_def_chains/internalwalker tr" tr)
(assert_msg "melt_walk_use_def_chains/internalwalker g" g)
(if (maptree_get trmap tr)
(return))
(maptree_put trmap tr :true)
(debug "melt_walk_use_def_chains/internalwalker before call val=" val
"\n.. tr=" tr "\n.. g=" g)
(let ( (res (clos val tr g))
(:tree trwalked (null_tree))
(:gimple giwalked (null_gimple))
(:long stop 0)
)
(debug "melt_walk_use_def_chains/internalwalker after call res=" res
"\n.. tr=" tr "\n.. g=" g)
(when (null res)
(return))
(code_chunk
walkeruse_chk
#{ /* melt_walk_use_def_chains $WALKERUSE_CHK start */
tree tr_$WALKERUSE_CHK = NULL_TREE;
ssa_op_iter sit_$WALKERUSE_CHK;
memset (& sit_$WALKERUSE_CHK, 0, sizeof(ssa_op_iter));
FOR_EACH_SSA_TREE_OPERAND (tr_$WALKERUSE_CHK, $G,
sit_$WALKERUSE_CHK, SSA_OP_ALL_OPERANDS)
{
$TRWALKED = tr_$WALKERUSE_CHK;
$(debug "melt_walk_use_def_chains/internalwalker trwalked=" trwalked)
if ($TRWALKED && TREE_CODE($TRWALKED) == SSA_NAME) {
$GIWALKED = SSA_NAME_DEF_STMT($TRWALKED);
$(progn
(debug "melt_walk_use_def_chains/internalwalker recurring val=" val
"\n.. trwalked=" trwalked "\n.. giwalked=" giwalked)
(setq res (internalwalker val trwalked giwalked))
(debug "melt_walk_use_def_chains/internalwalker recurred val=" val
"\n.. trwalked=" trwalked "\n.. giwalked=" giwalked)
(void))
$GIWALKED = (gimple) NULL;
if (!$RES)
clear_and_done_ssa_iter(& sit_$WALKERUSE_CHK);
}
$TRWALKED = NULL_TREE;
}
/* melt_walk_use_def_chains $WALKERUSE_CHK end */
}#)
(return res)
)
)
)
)
(debug "melt_walk_use_def_chains recurring walker internalwalker=" internalwalker
"\n.. on val=" val
"\n.. trvar=" trvar "\n.. gdef=" gdef)
(let ( (resw (internalwalker val trvar gdef))
)
(debug "melt_walk_use_def_chains after recurring walker resw=" resw)
)))
)
) ;end melt_walk_use_def_chains
(export_values melt_walk_use_def_chains)
) ;end GCC 4.9 walk use def
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(export_values
;; alphanumerical order
==g
cfun_gimple_body
do_each_gimpleseq
do_reveach_gimpleseq
each_in_gimpleseq
error_at_gimple
foreach_argument_of_gimple_call
foreach_case_of_gimple_switch
foreach_mapgimple
gimple_asm
gimple_assign_abs
gimple_assign_addr_space_convert
gimple_assign_binaryop
gimple_assign_bit_and
gimple_assign_bit_ior
gimple_assign_bit_not
gimple_assign_bit_xor
gimple_assign_cast
gimple_assign_ceil_div
gimple_assign_ceil_mod
gimple_assign_convert
gimple_assign_copy
gimple_assign_exact_div
gimple_assign_fixed_convert
gimple_assign_float
gimple_assign_floor_div
gimple_assign_floor_mod
gimple_assign_lrotate
gimple_assign_lshift
gimple_assign_max
gimple_assign_min
gimple_assign_minus
gimple_assign_mult_highpart
gimple_assign_mult
gimple_assign_nop
gimple_assign_paren
gimple_assign_plus
gimple_assign_pointer_plus
gimple_assign_rdiv
gimple_assign_round_div
gimple_assign_round_mod
gimple_assign_rrotate
gimple_assign_rshift
gimple_assign_single
gimple_assign_ssa_name_copy
gimple_assign_to
gimple_assign_trunc_div
gimple_assign_trunc_mod
gimple_assign_negate
gimple_assign_unary_nop
gimple_assign_widen_mult
gimple_at_source_location
gimple_bind
gimple_build_assign_convert
gimple_build_assign_fix_trunc
gimple_build_assign_float
gimple_build_assign_view_convert
gimple_build_return
gimple_call
gimple_call_1
gimple_call_1_more
gimple_call_2
gimple_call_2_more
gimple_call_3
gimple_call_3_more
gimple_call_4
gimple_call_4_more
gimple_call_5
gimple_call_5_more
gimple_call_6
gimple_call_6_more
gimple_call_7
gimple_call_7_more
gimple_call_nth_arg
gimple_catch
gimple_cond
gimple_cond_equal
gimple_cond_false
gimple_cond_greater
gimple_cond_greater_or_equal
gimple_cond_less
gimple_cond_lessequal
gimple_cond_ltgt
gimple_cond_notequal
gimple_cond_ordered
gimple_cond_true
gimple_cond_uneq
gimple_cond_unge
gimple_cond_ungt
gimple_cond_unle
gimple_cond_unlt
gimple_cond_unordered
gimple_cond_with_edges
gimple_cond_with_true_false_labels
gimple_content
gimple_copy
gimple_debug
gimple_debug_bind
gimple_eh_dispatch
gimple_eh_filter
gimple_eh_must_not_throw
gimple_error_mark
gimple_goto
gimple_iterator
gimple_label
gimple_nop
gimple_phi
gimple_phi_nth_arg_def
gimple_phi_nth_arg_edge
gimple_predict
gimple_resx
gimple_return
gimple_seq_add_seq
gimple_seq_add_stmt
gimple_seq_alloc_with_stmt
gimple_seq_boxed_add_seq
gimple_seq_boxed_add_stmt
gimple_seq_boxed_make_fill
gimple_seq_copy
gimple_seq_first_stmt
gimple_seq_last_stmt
gimple_seq_of_basic_block
gimple_switch
gimple_switch_index
gimple_switch_label
gimple_switch_set_index
gimple_switch_set_label
gimple_try
gimple_try_catch
gimple_try_finally
gimple_with_cleanup_expr
gimpleseq_content
gimpleval
inform_at_gimple
is_gimple
is_gimpleseq
is_mapgimple
make_gimple
make_gimple_call
make_gimple_mixloc
make_gimple_switch
make_gimpleseq
make_mapgimple
mapgimple_aux
mapgimple_auxput
mapgimple_count
mapgimple_get
mapgimple_nth_attr
mapgimple_nth_val
mapgimple_put
mapgimple_remove
mapgimple_size
null_gimple
null_gimpleseq
output_gimple
output_gimpleseq
reveach_in_gimpleseq
warning_at_gimple
warning_at_gimple_strbuf
)
;; eof libmelt-ana-gimple.melt
|