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
|
2014-11-10 David Malcolm <dmalcolm@redhat.com>
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-11-10 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c: Add includes now needed since r216805 by
cgraph.h: hash-map.h, is-a.h, plugin-api.h, vec.h, hashtab.h,
hash-set.h, machmode.h, tm.h, hard-reg-set.h, function.h,
ipa-ref.h, dumpfile.h.
* jit-playback.c: Likewise.
2014-11-05 David Malcolm <dmalcolm@redhat.com>
* jit-playback.c (gcc::jit::playback::context::handle_locations):
Drop the disabled debugging code.
2014-11-05 David Malcolm <dmalcolm@redhat.com>
* docs/topics/expressions.rst (Type-coercion): Casts between
pointer types are valid.
* libgccjit.c: Document that gcc_jit_context et al are actually
subclasses of the gcc::jit::recording classes.
(RETURN_VAL_IF_FAIL): Add top-level descriptive comment.
(RETURN_IF_NOT_VALID_BLOCK): Likewise.
(RETURN_NULL_IF_NOT_VALID_BLOCK): Likewise.
(jit_error): Likewise.
(compatible_types): Likewise.
(gcc_jit_context_acquire): Likewise.
(gcc_jit_context_release): Likewise.
(gcc_jit_context_new_child_context): Likewise.
(gcc_jit_context_new_location): Likewise.
(gcc_jit_location_as_object): Likewise.
(gcc_jit_type_as_object): Likewise.
(gcc_jit_context_get_type): Likewise.
(gcc_jit_context_get_int_type): Likewise.
(gcc_jit_type_get_pointer): Likewise.
(gcc_jit_type_get_const): Likewise.
(gcc_jit_type_get_volatile): Likewise.
(gcc_jit_context_new_array_type): Likewise. Also document that
LOC can be NULL. Fail with an error on negative size.
(gcc_jit_context_new_field): Add top-level descriptive comment and
document that LOC can be NULL.
(gcc_jit_field_as_object): Add top-level descriptive comment.
(gcc_jit_context_new_struct_type): Likewise. Also document that
LOC can be NULL.
(gcc_jit_context_new_opaque_struct): Likewise.
(gcc_jit_struct_as_type): Add top-level descriptive comment.
(gcc_jit_struct_set_fields): Likewise. Also document that LOC can
be NULL.
(gcc_jit_context_new_union_type): Likewise.
(gcc_jit_context_new_function_ptr_type): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_param_as_object): Add top-level descriptive comment.
(gcc_jit_param_as_lvalue): Likewise.
(gcc_jit_param_as_rvalue): Likewise.
(gcc_jit_context_new_function): Likewise. Also document that LOC
can be NULL.
(gcc_jit_context_get_builtin_function): Add top-level descriptive
comment.
(gcc_jit_function_as_object): Likewise.
(gcc_jit_function_get_param): Likewise.
(gcc_jit_function_dump_to_dot): Likewise.
(gcc_jit_function_new_block): Likewise.
(gcc_jit_block_as_object): Likewise.
(gcc_jit_block_get_function): Likewise.
(gcc_jit_context_new_global): Likewise. Also document that LOC
can be NULL.
(gcc_jit_lvalue_as_object): Add top-level descriptive comment.
(gcc_jit_lvalue_as_rvalue): Likewise.
(gcc_jit_rvalue_as_object): Likewise.
(gcc_jit_rvalue_get_type): Likewise.
(RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Likewise.
(gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
(gcc_jit_context_null): Likewise.
(gcc_jit_context_new_string_literal): Likewise.
(gcc_jit_context_new_unary_op): Likewise. Also document that LOC
can be NULL.
(gcc_jit_context_new_binary_op): Likewise.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_call_through_ptr): Likewise.
(is_valid_cast): Add top-level descriptive comment.
(gcc_jit_context_new_cast): Likewise. Also document that LOC can
be NULL.
(gcc_jit_context_new_array_access): Likewise.
(gcc_jit_object_get_context): Add top-level descriptive comment.
(gcc_jit_object_get_debug_string): Likewise.
(gcc_jit_lvalue_access_field): Likewise. Also document that LOC can
be NULL.
(gcc_jit_rvalue_access_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
(gcc_jit_rvalue_dereference): Likewise.
(gcc_jit_lvalue_get_address): Likewise.
(gcc_jit_function_new_local): Likewise.
(gcc_jit_block_add_eval): Likewise.
(gcc_jit_block_add_assignment): Likewise.
(gcc_jit_block_add_assignment_op): Likewise.
(is_bool): Add top-level descriptive comment.
(gcc_jit_block_end_with_conditional): Likewise. Also document
that LOC can be NULL.
(gcc_jit_block_add_comment): Likewise.
(gcc_jit_block_end_with_jump): Likewise.
(gcc_jit_block_end_with_return): Likewise.
(gcc_jit_block_end_with_void_return): Likewise.
(gcc_jit_context_set_str_option): Add top-level descriptive
comment.
(gcc_jit_context_set_int_option): Likewise.
(gcc_jit_context_set_bool_option): Likewise.
(gcc_jit_context_compile): Likewise.
(gcc_jit_context_dump_to_file): Likewise.
(gcc_jit_context_get_first_error): Likewise.
(gcc_jit_result_get_code): Likewise.
(gcc_jit_result_release): Likewise.
* libgccjit.h (gcc_jit_context_acquire): Remove FIXME from
comment.
(gcc_jit_context_get_int_type): Add comment.
(gcc_jit_context_new_field): Likewise.
(gcc_jit_context_new_struct_type): Likewise.
(gcc_jit_context_new_opaque_struct): Likewise.
(gcc_jit_struct_as_type): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_param_as_lvalue): Likewise.
(gcc_jit_param_as_rvalue): Likewise.
(enum gcc_jit_function_kind): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_context_get_builtin_function): Likewise.
(gcc_jit_function_get_param): Likewise.
2014-11-05 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_context_get_type): Verify that "type"
is valid immediately, rather than relying on called code.
(gcc_jit_context_new_function): Likewise for "kind".
(gcc_jit_context_new_unary_op): Likewise for "op".
(valid_binary_op_p): New.
(gcc_jit_context_new_binary_op): Verify that "op" is valid
immediately, rather than relying on called code.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_block_add_assignment_op): Likewise.
2014-11-05 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c: Include safe-ctype.h from libiberty.
(IS_ASCII_ALPHA): Delete.
(IS_ASCII_DIGIT): Delete.
(IS_ASCII_ALNUM): Delete.
(gcc_jit_context_new_function): Replace use of IS_ASCII_ALPHA and
IS_ASCII_ALNUM with ISALPHA and ISALNUM respectively, from
libiberty.
2014-10-30 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c (jit_langhook_init): Remove some dead code.
2014-10-27 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c: Drop includes of tree-iterator.h,
tree-ssa-alias.h, gimple-expr.h, gimple.h, gimple-pretty-print.h.
* jit-playback.c: Drop includes of debug.h, langhooks.h,
langhooks-def.h, tree-iterator.h, gimple-expr.h, tree-ssa-alias.h,
gimple.h, gimple-pretty-print.h, diagnostic-core.h, dumpfile.h.
2014-10-21 David Malcolm <dmalcolm@redhat.com>
* jit-recording.c: Include tm.h. Don't include function.h.
2014-10-21 David Malcolm <dmalcolm@redhat.com>
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-10-21 David Malcolm <dmalcolm@redhat.com>
* docs/intro/index.rst: Drop install.rst. Add tutorial04.rst.
* docs/intro/install.rst: Rename to...
* docs/intro/tutorial01.rst: ...this, renaming old tutorial01.rst to...
* docs/intro/tutorial02.rst: ...this, renaming old tutorial02.rst to...
* docs/intro/tutorial03.rst: ...this, renaming old tutorial03.rst to...
* docs/intro/tutorial04.rst: ...this.
* docs/examples/install-hello-world.c: Rename to...
* docs/examples/tut01-hello-world.c: ...this.
* docs/examples/tut01-square.c: Rename to...
* docs/examples/tut02-square.c: ...this.
* docs/examples/tut02-sum-of-squares.c: Rename to...
* docs/examples/tut03-sum-of-squares.c: ...this.
* docs/examples/tut03-toyvm: Rename directory to...
* docs/examples/tut04-toyvm: ...this.
* docs/examples/tut04-toyvm/toyvm.c (PATH_TO_SCRIPTS): Update
for directory renaming.
2014-10-21 David Malcolm <dmalcolm@redhat.com>
* docs/intro/install.rst ("Installation via packages"): Drop
this section.
("Installation from source"): Drop this section, moving parts
of it to https://gcc.gnu.org/wiki/JIT and some others to
docs/internals/index.rst.
("Hello world"): This section becomes the only remaining part
of this file. Eliminate references to pkg-config.
* docs/internals/index.rst
("Using a working copy without installing every time"): Rewrite
as...
("Working on the JIT library"): ...new section, aimed at
contributors (and myself) working from a build directory,
eliminating references to installation. Add description
of pertinent configuration options.
("Running the test suite"): Add setting of LIBRARY_PATH to
description of how to run a built binary outside of the test
suite.
("Environment variables"): New section, describing pertinent
environment variables.
2014-10-20 David Malcolm <dmalcolm@redhat.com>
* jit-recording.c (gcc::jit::dump::dump): Handle fopen failures
by emitting an error on the context.
(gcc::jit::dump::~dump): Likewise for fclose failures.
(gcc::jit::dump::write): Don't attempt further work if the fopen
failed. Handle fwrite failures by emitting an error on the
context.
2014-10-20 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (jit.install-common): Drop installation of
libgccjit.pc.
* config-lang.in (outputs): Drop jit/libgccjit.pc.
* libgccjit.pc.in: Delete.
2014-10-17 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (jit): Add $(FULL_DRIVER_NAME) as a dependency, so
that the symlink is created for testing.
* jit-playback.c (gcc::jit::playback::context::compile): Add
"-fno-use-linker-plugin" when invoking the driver. Update error
messages to talk about the "gcc driver" rather than the
"gcc harness". To ease troubleshooting, add error messages giving
the driver name and PATH to the error-handling code that fires
when the driver can't be found.
2014-10-07 David Malcolm <dmalcolm@redhat.com>
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-10-07 David Malcolm <dmalcolm@redhat.com>
* docs/internals/index.rst (Overview of code structure): Directly
include the comment from jit-common.h as rst, rather than as a
quoted C++ comment.
* jit-common.h: Convert the summary format to valid reStructured
text for inclusion by docs/internals/index.rst.
* notes.txt: Clarify where libgccjit.c, jit-recording.c and
jit-playback.c fit into the high-level diagram.
2014-10-07 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (jit_OBJS): Drop jit/internal-api.o.
Add jit/jit-recording.o and jit/jit-playback.o.
* internal-api.c: Delete, moving content to new files jit-recording.c
and jit-playback.c.
* internal-api.h: Delete, moving content to new files
jit-common.h, jit-playback.h, jit-recording.h.
* jit-common.h: New file, containing the forward decls of classes
formerly in internal-api.h.
* jit-recording.c: New file, containing the gcc::jit::recording
code formerly in internal-api.c, and gcc::jit::dump.
* jit-recording.h: New file, containing the gcc::jit::recording
prototypes formerly in internal-api.h.
* jit-playback.c: New file, containing the gcc::jit::playback
code formerly in internal-api.c.
* jit-playback.h: New file, containing the gcc::jit::playback
prototypes formerly in internal-api.h.
* dummy-frontend.c: Don't include "internal-api.h". Add includes
of jit-common.h and jit-playback.h.
* jit-builtins.h: Replace include of internal-api.h with
jit-common.h.
* jit-builtins.c: Replace include of internal-api.h with
jit-common.h. Add include of jit-recording.h.
* libgccjit.c: Likewise.
* docs/internals/index.rst (Overview of code structure): Update
to reflect the above changes.
2014-10-07 David Malcolm <dmalcolm@redhat.com>
* docs/internals/index.rst
(Using a working copy without installing): Rename to...
(Using a working copy without installing every time): ...this, and
update to reflect the need to have installed the driver binary
when running directly from a build directory.
(Running the test suite): Add PATH setting to the example.
* docs/intro/install.rst ("Hello world"): Likewise.
* internal-api.c: Include new autogenerated header
"gcc-driver-name.h".
(gcc::jit::playback::context::compile): Rather than looking for a
"gcc" on the path, look for GCC_DRIVER_NAME from gcc-driver-name.h,
as created by the configure script, so that we are using one for
the correct target.
2014-10-02 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (jit.info): Implement.
(jit.install-info): Implement.
(jit.dvi): Implement.
(jit.pdf): Implement in terms of new target "jit.texinfo.pdf".
(jit.install-pdf): Likewise for new target
"jit.texinfo.install-pdf".
(jit.install-html): Implement in terms of
"jit.$(doc_build_sys).install-html" to redirect to new targets
"jit.sphinx.install-html" or "jit.texinfo.install-html".
(jit.html): Implement in terms of "jit.$(doc_build_sys).html" to
redirect to new targets "jit.sphinx.html" or "jit.texinfo.html".
(JIT_TEXI_FILES): New variable.
(jit.texinfo.html): New target.
(jit.texinfo.install-html): New target.
(jit.texinfo.pdf): New target.
(jit.texinfo.install-pdf): New target.
(SPHINX_BUILD_DIR): New variable.
(jit.sphinx.html): New target.
(jit_htmldir): New variable.
(jit.sphinx.install-html): New target.
(jit.sphinx.pdf): New target.
2014-09-26 David Malcolm <dmalcolm@redhat.com>
* internal-api.h (gcc::jit::recording::context): Convert field
"m_first_error_str" from a fixed-size buffer to a pointer, and add
a field "m_owns_first_error_str" to determine if we're responsible
for freeing it.
* internal-api.c (gcc::jit::recording::context::context): Update
initializations in ctor for above change.
(gcc::jit::recording::context::~context): Free m_first_error_str
if we own it.
(gcc::jit::recording::context::add_error_va): When capturing the
first error message on a context, rather than copying "errmsg" to
a fixed-size buffer and truncating if oversize, simply store the
pointer to the error message, and flag whether we need to free it.
(gcc::jit::recording::context::get_first_error): Update for change
of "m_first_error_str" from an internal buffer to a pointer.
2014-09-25 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::playback::context::compile): Use
pex_one rather than system when invoking "gcc" to go from a .s
file to a .so file.
2014-09-25 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (make_tempdir_path_template): New.
(gcc::jit::playback::context::compile): Call
make_tempdir_path_template to make m_path_template, rather than
hardcoding "/tmp/" within "/tmp/libgccjit-XXXXXX".
2014-09-24 David Malcolm <dmalcolm@redhat.com>
* docs/internals/index.rst ("Overview of code structure"): Add
more descriptive text, including various fragments of
internal-api.h as appropriate.
* internal-api.h: Add marker comments for use by "literalinclude"
directives in docs/internals/index.rst.
2014-09-24 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c (my_walker): Rename to...
(my_ggc_walker): ...this.
(my_root_tab): Rename to...
(jit_root_tab): ...this.
(jit_langhook_init): Update for renaming of "my_root_tab" to
"jit_root_tab".
* internal-api.c: Add descriptive API comments to functions
throughout.
(mutex): Rename to...
(jit_mutex): ...this.
(gcc::jit::recording::context::compile): Update for renaming of
"mutex" to "jit_mutex".
* internal-api.h: Add descriptive API comments to functions
throughout. Add indentation to forward declarations of classes
to indicate inheritance.
* jit-builtins.c: Likewise.
2014-09-24 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::dump::write): Eliminate fixed-size
buffer "buf" by replacing call to vsnprintf with one to vasprintf
and a free, emitting an error on the dump's context if a malloc
failure occurs.
(gcc::jit::recording::context::add_error_va): Likewise, using
a precanned message if the malloc inside vasprinf fails. Split
local "buf" into "malloced_msg" and "errmsg" to ensure that we
free the message iff we're using one malloc-ed by vasprintf.
(gcc::jit::recording::string::from_printf): Eliminate fixed-size
buffer "buf" by replacing call to vsnprintf with one to vasprintf
and a free, emitting an error on the relevant context if a malloc
failure occurs.
2014-09-24 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c: Update copyright year. Follow standard for
initial includes by removing redundant include of "ansidecl.h".
* internal-api.c: Follow standard for initial includes by removing
redundant include of "ansidecl.h".
* jit-builtins.c: Likewise.
* libgccjit.c: Likewise.
2014-09-24 David Malcolm <dmalcolm@redhat.com>
* ChangeLog.jit: Add copyright footer.
* Make-lang.in: Update copyright.
* config-lang.in: Update copyright.
* docs/examples/install-hello-world.c: Add copyright header.
* docs/examples/tut01-square.c: Likewise.
* docs/examples/tut02-sum-of-squares.c: Likewise.
* docs/examples/tut03-toyvm/toyvm.c: Likewise.
* internal-api.c: Likewise.
* internal-api.h: Likewise.
* libgccjit++.h: Likewise.
* libgccjit.c: Likewise.
* libgccjit.h: Likewise.
* libgccjit.map: Likewise.
2014-09-23 David Malcolm <dmalcolm@redhat.com>
* TODO.rst (API): Shift operators are done.
* docs/topics/expressions.rst (Binary): Add shift operators.
* internal-api.c (binary_op_strings): Likewise.
(gcc::jit::playback::context::new_binary_op): Likewise.
* libgccjit.h (enum gcc_jit_binary_op): Likewise.
2014-09-23 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Rename "Initial Release" section to "API", and
remove completed items: builtins, docs, pkgconfig file, fuzz
testing. Move ability to name contexts and stmt_list per block
ideas to a new "Nice to have" section and note that it might be
better to go straight to gimple.
Move code coverage to "Test suite" section.
Add a "Probably not needed" section, moving some items to it.
Note that we're still missing shift operators.
Add idea that we could warn about unused objects in a context.
2014-09-23 David Malcolm <dmalcolm@redhat.com>
* docs/examples/tut03-toyvm/toyvm.c: Include <dejagnu.h>.
Add missing typedef of compilation_state.
(toyvm_function_parse): Add "name param.
(test): New.
(CHECK_NON_NULL): New, from harness.h
(CHECK_VALUE): Likewise.
(test_script): New.
(PATH_TO_SCRIPTS): New define.
(test_suite): New.
(main): If called with no args, run the test suite.
2014-09-23 David Malcolm <dmalcolm@redhat.com>
* docs/conf.py (__read_file): New helper function, for
extracting...
(gcc_BASEVER): New variable, read from "BASE-VER" in gcc src dir.
(gcc_DEVPHASE): Likewise, from file "DEV-PHASE".
(gcc_DATESTAMP): Likewise, from file "DATESTAMP".
(gcc_REVISION): Likewise, from file "REVISION" (if present).
(version): Rather than hardcoding this variable, extract from file
BASE-VER, via gcc_BASEVER local.
(release): Likewise, building it up from the files read above.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-09-22 David Malcolm <dmalcolm@redhat.com>
* docs/intro/tutorial01.rst: Remove stray "FIXME".
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-09-22 David Malcolm <dmalcolm@redhat.com>
* docs/index.rst: Add internals/index.rst.
* docs/internals/index.rst: New.
* notes.txt: Update to reflect renaming of toplev_main to
toplev::main.
2014-09-22 David Malcolm <dmalcolm@redhat.com>
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* docs/intro/install.rst: Reduce width of listing.
* docs/intro/tutorial01.rst: Use <libgccjit.h> rather than
"libgccjit.h" when including the header.
* docs/intro/tutorial02.rst: Likewise.
* docs/intro/tutorial03.rst: Clarify various sections; show
effect of reducing optimization level down from 3 to 2.
("Putting it all together"): Move to above...
("Behind the curtain: optimizing away stack manipulation"):
...this, and rename this to...
("Behind the curtain: How does our code get optimized?"): ...and
add more detail, and discussion of elimination of tail recursion.
2014-09-19 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Add detection of uninitialized variables, since
this bit me when developing "toyvm".
* docs/examples/tut03-toyvm/Makefile: New.
* docs/examples/tut03-toyvm/factorial.toy: New.
* docs/examples/tut03-toyvm/fibonacci.toy: New.
* docs/examples/tut03-toyvm/toyvm.c: New.
* docs/intro/index.rst: Add tutorial03.rst.
* docs/intro/tutorial01.rst: Fix example of how to dump
generated machine code.
* docs/intro/tutorial03.rst: New.
* docs/intro/factorial.png: New.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* docs/_build/texinfo/factorial.png: New (copied by sphinx from
docs/intro/factorial.png).
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (jit.install-common): Install libgccjit.pc to
"$(DESTDIR)/$(libdir)/pkgconfig".
* config-lang.in (outputs): Define this, adding jit/libgccjit.pc
so that it makes it into AC_CONFIG_FILES and is thus generated from
jit/libgccjit.pc.in at configure time.
* docs/intro/install.rst ("Hello world"): Add discussion about the
use of pkg-config when building against an install in
a non-standard location.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* libgccjit.pc.in: New.
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* docs/index.rst: Split index out into two new files...
* docs/intro/index.rst: New file.
* docs/topics/index.rst: New file.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* docs/_build/texinfo/Makefile: New file, generated by Sphinx, by
running "make texinfo" in docs directory.
* docs/_build/texinfo/libgccjit.texi: Likewise.
* docs/_build/texinfo/sum-of-squares.png: Likewise.
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* docs/conf.py (Options for HTML output): Update html_theme from
"default" to "pyramid".
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* docs/intro/install.rst: Markup fixes.
* docs/intro/tutorial01.rst: Likewise.
* docs/intro/tutorial02.rst: Likewise.
* docs/topics/contexts.rst: Likewise.
* docs/topics/expressions.rst: Likewise.
* docs/topics/functions.rst: Likewise.
* docs/topics/locations.rst: Likewise.
* docs/topics/types.rst: Likewise.
2014-09-18 David Malcolm <dmalcolm@redhat.com>
* docs/examples/install-hello-world.c (main): Fix missing
"return".
* docs/examples/tut01-square.c (main): Likewise.
* docs/examples/tut02-sum-of-squares.c (main): Likewise.
2014-09-17 David Malcolm <dmalcolm@redhat.com>
* docs/Makefile: New file.
* docs/conf.py: New file.
* docs/examples/install-hello-world.c: New file.
* docs/examples/tut01-square.c: New file.
* docs/examples/tut02-sum-of-squares.c: New file.
* docs/index.rst: New file.
* docs/intro/install.rst: New file.
* docs/intro/sum-of-squares.png: New file.
* docs/intro/tutorial01.rst: New file.
* docs/intro/tutorial02.rst: New file.
* docs/topics/contexts.rst: New file.
* docs/topics/expressions.rst: New file.
* docs/topics/functions.rst: New file.
* docs/topics/locations.rst: New file.
* docs/topics/objects.rst: New file.
* docs/topics/results.rst: New file.
* docs/topics/types.rst: New file.
2014-09-11 David Malcolm <dmalcolm@redhat.com>
* TODO.rst (Initial Release): Update for addition of myself as
maintainer.
2014-09-10 David Malcolm <dmalcolm@redhat.com>
* TODO.rst (Test suite): Multithreaded test is done.
2014-09-10 David Malcolm <dmalcolm@redhat.com>
* dummy-frontend.c: Fix up for the header file flattening on
trunk by adding includes of signop.h, tree-core.h, stor-layout.h,
tree-ssa-alias.h, gimple-expr.h.
(jit_langhook_write_globals): Update call to
finalize_compilation_unit to symtab->finalize_compilation_unit to
track change made on trunk in r214422.
* internal-api.c: Fix up for the header file flattening on trunk
by adding includes of gimple-expr.h, tree-ssa-alias.h,
stringpool.h, stor-layout.h, print-tree.h, gimplify.h.
(new_rvalue_from_int): Update call to real_from_integer.
(gcc::jit::playback::wrapper::operator new): Use
ggc_internal_cleared_alloc rather than
ggc_internal_cleared_alloc_stat.
(gcc::jit::playback::function::postprocess): Update call to
cgraph_finalize_function tocgraph_node::finalize_function.
(gcc::jit::playback::block::add_comment): Update call to
ggc_internal_alloc_stat to ggc_internal_alloc.
2014-08-08 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_new_union_type): New entrypoint.
(gcc_jit_lvalue_access_field): Rename first param from "struct_"
to "struct_or_union".
(gcc_jit_rvalue_access_field): Likewise.
* libgccjit.c (gcc_jit_context_new_union_type): New entrypoint.
* libgccjit.map (gcc_jit_context_new_union_type): New entrypoint.
* internal-api.h (gcc::jit::recording::compound_type): New class
(gcc::jit::recording::union): New class.
(gcc::jit::playback::struct_): Rename this class to...
(gcc::jit::playback::compound_type): ...this.
(gcc::jit::recording::context::new_union_type): New method.
(gcc::jit::recording::context): Rename field "m_structs" to
"m_compound_types", generalizing from a vec <struct_ *> to a
vec<compound_type *>.
(gcc::jit::recording::field): Update field m_container from
struct * to container_type *.
(gcc::jit::recording::field::get_container): Generalize from
struct_ * to container_type *.
(gcc::jit::recording::field::set_container): Likewise.
(gcc::jit::recording::compound_type): New subclass of type, to
be a superclass of existing class struct_ and new class union_.
(gcc::jit::recording::struct_::get_name): Move to...
(gcc::jit::recording::compound_type::get_name): ...here.
(gcc::jit::recording::struct_::get_loc): Move to...
(gcc::jit::recording::compound_type::get_loc): ...here.
(gcc::jit::recording::struct_::set_fields): Move to...
(gcc::jit::recording::compound_type::set_fields): ...here.
(gcc::jit::recording::struct_::dereference): Move to...
(gcc::jit::recording::compound_type::dereference): ...here.
(gcc::jit::recording::struct_::is_int): Move to...
(gcc::jit::recording::compound_type::is_int): ...here.
(gcc::jit::recording::struct_::is_float): Move to...
(gcc::jit::recording::compound_type::is_float): ...here.
(gcc::jit::recording::struct_::is_bool): Move to...
(gcc::jit::recording::compound_type::is_bool): ...here.
(gcc::jit::recording::struct_::is_pointer): Move to...
(gcc::jit::recording::compound_type::is_pointer): ...here.
(gcc::jit::recording::struct_::is_array): Move to...
(gcc::jit::recording::compound_type::is_array): ...here.
(gcc::jit::recording::struct_::playback_struct): Move to...
(gcc::jit::recording::compound_type::playback_compound_type):
...here, renaming and updating return type.
(gcc::jit::recording::struct_): Inherit from compound_type,
rather than just type.
(gcc::jit::recording::fields): Update to work on compound_type *
rather than struct_ *, renaming "m_struct" to "m_struct_or_union".
(gcc::jit::recording::union): New subclass of compound_type.
(gcc::jit::playback::context::new_struct_type): Generalize by
renaming to...
(gcc::jit::playback::context::new_compound_type): ...this, and
and an "is_struct" bool param.
(gcc::jit::playback::struct_): Generalize by renaming class to...
(gcc::jit::playback::compound_type): ...this.
* internal-api.c (gcc::jit::recording::context::context): Rename
field "m_structs" to "m_compound_types".
(gcc::jit::recording::context::new_struct_type): Likewise.
(gcc::jit::recording::context::new_union_type): New method.
(gcc::jit::recording::context::dump_to_file): Field "m_structs"
is renamed "m_compound_types" and changes type from struct_ *
to compound_type *.
(gcc::jit::recording::compound_type::compound_type): New ctor,
built from old body of gcc::jit::recording::struct_::struct_.
(gcc::jit::recording::struct_::set_fields): Move class to...
(gcc::jit::recording::compound_type::set_fields): ... here.
(gcc::jit::recording::struct_::dereference): Move class to...
(gcc::jit::recording::compound_type::dereference): ...here.
(gcc::jit::recording::struct_::struct_): Reimplement by calling
base class ctor.
(gcc::jit::recording::struct_::replay_into): The playback hook
is now "new_compound_type" and adds a bool, with true for
"is_struct" (vs a union).
(gcc::jit::recording::struct_::make_debug_string): "m_name" is
now moved to base class and private, so use an accessor.
(gcc::jit::recording::union_::union_): New function.
(gcc::jit::recording::union_::replay_into): New function.
(gcc::jit::recording::union_::make_debug_string): New function.
(gcc::jit::recording::fields::fields): Update first param from
struct_ * to compound_type *, and rename field "m_struct" to
"m_struct_or_union".
(gcc::jit::recording::fields::replay_into): "m_struct" is now
"m_struct_or_union" and has a playback_compound_type rather
than a playback_struct.
(gcc::jit::recording::fields::write_to_dump): Update for
renaming of m_struct to m_struct_or_union.
(gcc::jit::playback::context::new_struct_type): Rename method
to...
(gcc::jit::playback::context::new_compound_type): this,
generalizing so that it can make unions as well as structs; the
underlying playback type is now called "compound_type".
(gcc::jit::playback::struct_::set_fields): This method's class has
changed name, so this is now...
(gcc::jit::playback::compound_type::set_fields): ...this method.
* TODO.rst: Unions are done.
2014-08-08 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Function ptrs are done.
* internal-api.c
(gcc::jit::recording::context::new_function_ptr_type): New method.
(gcc::jit::recording::context::new_call_through_ptr): New method.
(gcc::jit::recording::memento_of_get_pointer::make_debug_string):
Add special-case handling of function pointer types.
(gcc::jit::recording::function_type::make_debug_string_with_ptr):
New method.
(gcc::jit::recording::function_type::make_debug_string):
Reimplement in terms of...
(gcc::jit::recording::function_type::make_debug_string_with): New
method, based on make_debug_string, but allowing for arbitrary
text between the return type and the parameters.
(gcc::jit::recording::call_through_ptr::call_through_ptr): New
method.
(gcc::jit::recording::call_through_ptr::replay_into): New method.
(gcc::jit::recording::call_through_ptr::make_debug_string): New
method.
(gcc::jit::playback::context::new_call): Reimplement in terms of...
(gcc::jit::playback::context::build_call): New method, using parts
of old implementation of new_call, so that we can share this
with...
(gcc::jit::playback::context::new_call_through_ptr): New method.
* internal-api.h
(gcc::jit::recording::context::new_function_ptr_type): New method.
(gcc::jit::recording::context::new_call_through_ptr): New method.
(gcc::jit::recording::type::dyn_cast_function_type): New method.
(gcc::jit::recording::function_type::dyn_cast_function_type): New
method.
(gcc::jit::recording::function_type::make_debug_string_with_ptr):
New method.
(gcc::jit::recording::function_type::make_debug_string_with): New
method.
(gcc::jit::recording::call_through_ptr): New subclass of rvalue.
(gcc::jit::playback::context::new_call_through_ptr): New method.
(gcc::jit::playback::context::build_call): New method.
* libgccjit.c (gcc_jit_context_new_function_ptr_type): New
function.
(gcc_jit_context_new_call_through_ptr): New function.
* libgccjit.h (gcc_jit_context_new_function_ptr_type): New
function.
(gcc_jit_context_new_call_through_ptr): New function.
* libgccjit.map (gcc_jit_context_new_call_through_ptr): New function.
(gcc_jit_context_new_function_ptr_type): New function.
2014-07-25 David Malcolm <dmalcolm@redhat.com>
* TODO.rst (error-checking): Remove various items that either
already were implemented, or are implemented by this commit.
* internal-api.h (gcc::jit::recording::type::is_numeric): New.
* libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): New macro.
(gcc_jit_context_new_rvalue_from_int): Verify that numeric_type is
indeed numeric.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_array_access): Likewise for type of "index".
2014-07-14 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::context::new_array_type):
Reject attempts to create an array of a struct if the fields of
the struct haven't yet been set.
* internal-api.h (gcc::jit::recording::type::dyn_cast_struct): New
virtual function.
(gcc::jit::recording::struct_::dyn_cast_struct): New, overriding
for this subclass.
(gcc::jit::recording::struct_::get_name): New.
2014-05-07 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (LIBGCCJIT_LINKER_NAME): New.
(LIBGCCJIT_VERSION_NUM): New.
(LIBGCCJIT_MINOR_NUM): New.
(LIBGCCJIT_RELEASE_NUM): New.
(LIBGCCJIT_SONAME): New.
(LIBGCCJIT_FILENAME): New.
(LIBGCCJIT_LINKER_NAME_SYMLINK): New.
(LIBGCCJIT_SONAME_SYMLINK): New.
(jit): Add symlink targets.
(libgccjit.so): Convert to...
(LIBGCCJIT_FILENAME): ...and add a soname.
(jit.install-common): Install the library with a soname, and
symlinks. Install libgccjit++.h.
2014-04-25 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::playback::context::compile): Put
any output of dlerror through the add_error method, rather
than merely printing it to stderr, so that the error is also
recorded on the context.
2014-03-19 Tom Tromey <tromey@redhat.com>
* internal-api.c (compile): Use auto_timevar.
2014-03-19 Tom Tromey <tromey@redhat.com>
* internal-api.c (compile): Use toplev, not toplev_options.
Simplify.
2014-03-19 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::context::add_error_va):
Rename local "progname" to "ctxt_progname" to avoid shadowing
the related global, for clarity.
(gcc::jit::playback::context::compile): Likewise.
2014-03-19 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::memento_of_get_pointer::
accepts_writes_from): Accept writes from pointers, but not arrays.
* internal-api.h (gcc::jit::recording::type::is_pointer): New.
(gcc::jit::recording::type::is_array): New.
(gcc::jit::recording::memento_of_get_type::accepts_writes_from):
Allow (void *) to accept writes of pointers, but not arrays.
(gcc::jit::recording::memento_of_get_type::is_pointer): New.
(gcc::jit::recording::memento_of_get_type::is_array): New.
(gcc::jit::recording::memento_of_get_pointer::is_pointer): New.
(gcc::jit::recording::memento_of_get_pointer::is_array): New.
(gcc::jit::recording::memento_of_get_const::is_pointer): New.
(gcc::jit::recording::memento_of_get_const::is_array): New.
(gcc::jit::recording::memento_of_get_volatile::is_pointer): New.
(gcc::jit::recording::memento_of_get_volatile::is_array): New.
(gcc::jit::recording::array_type::is_pointer): New.
(gcc::jit::recording::array_type::is_array): New.
(gcc::jit::recording::function_type::is_pointer): New.
(gcc::jit::recording::function_type::is_array): New.
(gcc::jit::recording::struct_::is_pointer): New.
(gcc::jit::recording::struct_::is_array): New.
* libgccjit.c (gcc_jit_context_new_rvalue_from_ptr): Require the
pointer_type to be a pointer, not an array.
(gcc_jit_context_null): Likewise.
(is_valid_cast): Require pointer casts to be between pointer types,
not arrays.
(gcc_jit_context_new_array_access): Update error message from "not
a pointer" to "not a pointer or array".
(gcc_jit_rvalue_dereference_field): Require the pointer arg to be
of pointer type, not an array.
(gcc_jit_rvalue_dereference): Likewise.
2014-03-14 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (is_valid_cast): Permit casts between pointer types.
* internal-api.c (convert): Report more information if this ever
occurs, and make the error occur on the playback context, so that
it makes the gcc_jit_result be NULL.
(gcc::jit::playback::context::build_cast): Handle pointers. Report
more information if an unhandlable cast reaches here.
2014-03-13 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (is_valid_cast): New.
(gcc_jit_context_new_cast): Check for compatible types.
* internal-api.c (gcc::jit::recording::memento_of_get_type::
is_int): New.
(gcc::jit::recording::memento_of_get_type::is_float): New.
(gcc::jit::recording::memento_of_get_type::is_bool): New.
* internal-api.h (gcc::jit::recording::type::is_int): New.
(gcc::jit::recording::type::is_float): New.
(gcc::jit::recording::type::is_bool): New.
(gcc::jit::recording::memento_of_get_type::is_int): New.
(gcc::jit::recording::memento_of_get_type::is_float): New.
(gcc::jit::recording::memento_of_get_type::is_bool): New.
(gcc::jit::recording::memento_of_get_pointer::is_int): New.
(gcc::jit::recording::memento_of_get_pointer::is_float): New.
(gcc::jit::recording::memento_of_get_pointer::is_bool): New.
(gcc::jit::recording::memento_of_get_const::is_int): New.
(gcc::jit::recording::memento_of_get_const::is_float): New.
(gcc::jit::recording::memento_of_get_const::is_bool): New.
(gcc::jit::recording::memento_of_get_volatile::is_int): New.
(gcc::jit::recording::memento_of_get_volatile::is_float): New.
(gcc::jit::recording::memento_of_get_volatile::is_bool): New.
(gcc::jit::recording::array_type::is_int): New.
(gcc::jit::recording::array_type::is_float): New.
(gcc::jit::recording::array_type::is_bool): New.
(gcc::jit::recording::function_type::is_int): New.
(gcc::jit::recording::function_type::is_float): New.
(gcc::jit::recording::function_type::is_bool): New.
(gcc::jit::recording::struct_::is_int): New.
(gcc::jit::recording::struct_::is_float): New.
(gcc::jit::recording::struct_::is_bool): New.
2014-03-13 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::context::set_str_option):
Provide NULL recording::location to add_error.
(gcc::jit::recording::context::set_int_option): Likewise.
(gcc::jit::recording::context::set_bool_option): Likewise.
(gcc::jit::playback::context::compile): Likewise.
(gcc::jit::recording::context::add_error): Add recording::location
param.
(gcc::jit::recording::context::add_error_va): Likewise; print it
when present; add "error: " to stderr messages.
(gcc::jit::recording::location::replay_into): Provide
recording::location to the playback::location.
(gcc::jit::recording::function::validate): Add locations to the
add_error invocations.
(gcc::jit::recording::block::validate): Likewise.
(gcc::jit::playback::context::get_type): Likewise.
(gcc::jit::playback::context::new_unary_op): Likewise.
(gcc::jit::playback::context::new_binary_op): Likewise.
(gcc::jit::playback::context::new_comparison): Likewise.
(gcc::jit::recording::block::get_loc): New.
(gcc::jit::recording::block::get_first_statement): New.
(gcc::jit::playback::context::build_cast): Pass in higher-level
arguments in the hope of eventually providing better error
messages when a cast isn't possible.
(gcc::jit::playback::context::new_cast): As above.
(gcc::jit::playback::context::add_error): Add playback::location
parameter, using it to provide the corresponding
recording::location (if any) when reporting the error to the
recording::context.
(gcc::jit::playback::context::add_error_va): Likewise.
(gcc::jit::playback::context::new_location): Likewise.
(gcc::jit::playback::source_line::get_location): Likewise.
(gcc::jit::playback::location::location): Likewise.
* internal-api.h (gcc::jit::recording::context::add_error): Add
recording::location param.
(gcc::jit::recording::context::add_error_va): Likewise.
(gcc::jit::recording::context::errors_occurred): Also consider
errors that occur on a parent or ancestor context, recursively.
(gcc::jit::recording::block::get_loc): New.
(gcc::jit::recording::block::get_first_statement): New.
(gcc::jit::recording::statement::get_loc): New.
(gcc::jit::playback::context::new_location): Add recording::location
parameter.
(gcc::jit::playback::context::add_error): Add playback::location
parameter.
(gcc::jit::playback::context::add_error_va): Likewise.
(gcc::jit::playback::context::build_cast): Pass in higher-level
arguments in the hope of eventually providing better error
messages when a cast isn't possible.
(gcc::jit::playback::source_line::get_location): Add
recording::location parameter.
(gcc::jit::playback::location::location): Likewise.
(gcc::jit::playback::location::get_recording_loc): New.
(gcc::jit::playback::location::m_recording_loc): New.
* jit-builtins.c (gcc::jit::builtins_manager::get_builtin_function):
Provide NULL recording::location to add_error.
(gcc::jit::builtins_manager::make_primitive_type): Likewise.
* libgccjit.c (RETURN_VAL_IF_FAIL): Add location argument.
(RETURN_VAL_IF_FAIL_PRINTF1): Likewise.
(RETURN_VAL_IF_FAIL_PRINTF2): Likewise.
(RETURN_VAL_IF_FAIL_PRINTF3): Likewise.
(RETURN_VAL_IF_FAIL_PRINTF4): Likewise.
(RETURN_VAL_IF_FAIL_PRINTF6): Likewise.
(RETURN_NULL_IF_FAIL): Likewise.
(RETURN_NULL_IF_FAIL_PRINTF1): Likewise.
(RETURN_NULL_IF_FAIL_PRINTF2): Likewise.
(RETURN_NULL_IF_FAIL_PRINTF3): Likewise.
(RETURN_NULL_IF_FAIL_PRINTF4): Likewise.
(RETURN_NULL_IF_FAIL_PRINTF6): Likewise.
(RETURN_IF_FAIL): Likewise.
(RETURN_IF_FAIL_PRINTF1): Likewise.
(RETURN_IF_FAIL_PRINTF2): Likewise.
(RETURN_IF_FAIL_PRINTF4): Likewise.
(RETURN_IF_NOT_VALID_BLOCK): Likewise.
(RETURN_NULL_IF_NOT_VALID_BLOCK): Likewise.
(jit_error): Likewise.
(gcc_jit_location_as_object): Provided location argument to
error-handling macros.
(gcc_jit_type_as_object): Likewise.
(gcc_jit_context_get_type): Likewise.
(gcc_jit_context_get_int_type): Likewise.
(gcc_jit_type_get_pointer): Likewise.
(gcc_jit_type_get_const): Likewise.
(gcc_jit_type_get_volatile): Likewise.
(gcc_jit_context_new_array_type): Likewise.
(gcc_jit_context_new_field): Likewise.
(gcc_jit_context_new_struct_type): Likewise.
(gcc_jit_context_new_opaque_struct): Likewise.
(gcc_jit_struct_as_type): Likewise.
(gcc_jit_struct_set_fields): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_param_as_object): Likewise.
(gcc_jit_param_as_lvalue): Likewise.
(gcc_jit_param_as_rvalue): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_context_get_builtin_function): Likewise.
(gcc_jit_function_as_object): Likewise.
(gcc_jit_function_get_param): Likewise.
(gcc_jit_function_dump_to_dot): Likewise.
(gcc_jit_function_new_block): Likewise.
(gcc_jit_block_as_object): Likewise.
(gcc_jit_block_get_function): Likewise.
(gcc_jit_context_new_global): Likewise.
(gcc_jit_lvalue_as_object): Likewise.
(gcc_jit_lvalue_as_rvalue): Likewise.
(gcc_jit_rvalue_as_object): Likewise.
(gcc_jit_rvalue_get_type): Likewise.
(gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
(gcc_jit_context_null): Likewise.
(gcc_jit_context_new_string_literal): Likewise.
(gcc_jit_context_new_unary_op): Likewise.
(gcc_jit_context_new_binary_op): Likewise.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_cast): Likewise.
(gcc_jit_context_new_array_access): Likewise.
(gcc_jit_object_get_context): Likewise.
(gcc_jit_object_get_debug_string): Likewise.
(gcc_jit_lvalue_access_field): Likewise.
(gcc_jit_rvalue_access_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
(gcc_jit_rvalue_dereference): Likewise.
(gcc_jit_lvalue_get_address): Likewise.
(gcc_jit_function_new_local): Likewise.
(gcc_jit_block_add_eval): Likewise.
(gcc_jit_block_add_assignment): Likewise.
(gcc_jit_block_add_assignment_op): Likewise.
(gcc_jit_block_end_with_conditional): Likewise.
(gcc_jit_block_add_comment): Likewise.
(gcc_jit_block_end_with_jump): Likewise.
(gcc_jit_block_end_with_return): Likewise.
(gcc_jit_block_end_with_void_return): Likewise.
(gcc_jit_context_set_str_option): Likewise.
(gcc_jit_context_set_int_option): Likewise.
(gcc_jit_context_set_bool_option): Likewise.
(gcc_jit_context_compile): Likewise.
(gcc_jit_context_dump_to_file): Likewise.
(gcc_jit_context_get_first_error): Likewise.
(gcc_jit_result_get_code): Likewise.
(gcc_jit_result_get_code): Likewise.
(gcc_jit_result_release): Likewise.
2014-03-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::context::new_rvalue): Make these
methods const.
(gccjit::context::zero): Likewise.
(gccjit::context::one): Likewise.
(gccjit::function::get_param): Likewise.
2014-03-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::error): New class, for exceptions.
(gccjit::context::get_inner_context): New accessor, so that we
can...
(gccjit::context::m_inner_ctxt): Make private.
(gccjit::context::context): Throw a gccjit::error if a NULL
context is passed in.
(gccjit::context::compile): Throw a gccjit::error if a NULL
result is returned from the C API, which indicates an error.
(gccjit::object::object): Throw a gccjit::error if a NULL
object is passed in, since that indicates that an error has
occurred.
(gccjit::location::location): In the default ctor, call the
base class default ctor rather than passing in a NULL to the
single-argument ctor, since the latter now indicates an error
has occurred at the C API level.
(gccjit::field::field): Likewise.
(gccjit::type::type): Likewise.
(gccjit::function::function): Likewise.
(gccjit::block::block): Likewise.
(gccjit::rvalue::rvalue): Likewise.
2014-03-07 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_function_kind): Add
GCC_JIT_FUNCTION_ALWAYS_INLINE.
* internal-api.c (gcc::jit::recording::function::write_to_dump):
Handle GCC_JIT_FUNCTION_ALWAYS_INLINE.
(gcc::jit::playback::context::new_function): Likewise.
(gcc::jit::playback::context::postprocess): Handle
GCC_JIT_FUNCTION_INTERNAL and GCC_JIT_FUNCTION_ALWAYS_INLINE by
clearing DECL_EXTERNAL and TREE_PUBLIC. Doing so fixes the
"undefined symbol" bug seen with GCC_JIT_FUNCTION_INTERNAL.
* TODO.rst: Update.
2014-03-07 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::context::new_global): New.
2014-03-07 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::playback::context::handle_locations):
Add a disabled call to line_table_dump, in case it's handy for
debugging in the future.
(gcc::jit::playback::context::set_tree_location): Assert that
the location is non-NULL.
(gcc::jit::playback::location::location): Initialize m_src_loc
to UNKNOWN_LOCATION. This field should always be overwritten by
handle_locations before use, but given recent issues with bogus
locations it seems safer to initialize it.
2014-03-06 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::context::
disassociate_from_playback): Recursively visit parent contexts.
2014-03-05 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_function_dump_to_dot): New.
* libgccjit.map (gcc_jit_function_dump_to_dot): New.
* libgccjit++.h (gccjit::function::dump_to_dot): New.
* libgccjit.c (gcc_jit_function_dump_to_dot): New.
* internal-api.h (gcc::jit::recording::function::dump_to_dot): New.
(gcc::jit::recording::block::block): Add m_index member.
(gcc::jit::recording::block::dump_to_dot): New.
(gcc::jit::recording::block::dump_edges_to_dot): New.
* internal-api.c (gcc::jit::recording::function::new_block): Give
each block an index.
(gcc::jit::recording::function::dump_to_dot): New.
(gcc::jit::recording::block::dump_to_dot): New.
(gcc::jit::recording::block::dump_edges_to_dot): New.
2014-03-04 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::memento_of_get_pointer::
accepts_writes_from): Avoid segfaulting when the argument is not
of pointer type.
* internal-api.h (gcc::jit::recording::accepts_writes_from): Add
an assertion.
* libgccjit.c (gcc_jit_context_new_comparison): Strip away const
and volatile when comparing input types.
2014-03-04 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_type_get_volatile): New.
* libgccjit.map (gcc_jit_type_get_volatile): New.
* libgccjit.c (gcc_jit_type_get_volatile): New.
* libgccjit++.h (gccjit::type::get_volatile): New.
* internal-api.c (gcc::jit::recording::type::get_volatile): New.
(gcc::jit::recording::memento_of_get_volatile::replay_into): New.
(gcc::jit::recording::memento_of_get_volatile::make_debug_string): New.
* internal-api.h (gcc::jit::recording::type::get_volatile): New.
(gcc::jit::recording::type::accepts_writes_from): Strip off
qualifiers such as "const" and "volatile" from the source type.
(gcc::jit::recording::memento_of_get_volatile): New class.
(gcc::jit::playback::type::get_volatile): New.
* TODO.rst: Update.
2014-03-03 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::function::operator()): Add overload for
a call with 3 arguments.
(gccjit::block::add_call): Likewise for 4 arguments.
(gccjit::rvalue::cast_to): New method.
(gccjit::rvalue::operator[]): New methods.
2014-02-28 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_context_new_binary_op): Check that the
operands have the same type.
(gcc_jit_context_new_comparison): Likewise.
2014-02-28 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_new_cast): New.
* libgccjit.map (gcc_jit_context_new_cast): New.
* libgccjit++.h (gccjit::context::new_cast): New method.
* libgccjit.c (gcc_jit_context_new_cast): New.
* internal-api.h (gcc::jit::recording::context::new_cast): New method.
(gcc::jit::recording::cast): New subclass of rvalue.
(gcc::jit::playback::context::new_cast): New method.
(gcc::jit::playback::context::build_cast): New method.
* internal-api.c (convert): New.
(gcc::jit::recording::context::new_cast): New.
(gcc::jit::recording::cast::replay_into): New.
(gcc::jit::recording::cast::make_debug_string): New.
(gcc::jit::playback::context::build_cast): New.
(gcc::jit::playback::context::new_cast): New.
* TODO.rst: Update.
2014-02-28 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_block_get_function): New.
* libgccjit.map (gcc_jit_block_get_function): New.
* libgccjit++.h (gccjit::block::get_function): New method.
* libgccjit.c (gcc_jit_block_get_function): New.
2014-02-27 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_label): Delete in favor of...
(gcc_jit_block): New type.
(gcc_jit_loop): Delete.
(gcc_jit_function_new_forward_label): Delete in favor of...
(gcc_jit_function_new_block): New.
(gcc_jit_label_as_object): Delete in favor of...
(gcc_jit_block_as_object): New.
(gcc_jit_function_add_eval): Delete in favor of...
(gcc_jit_block_add_eval): New.
(gcc_jit_function_add_assignment): Delete in favor of...
(gcc_jit_block_add_assignment): New.
(gcc_jit_function_add_assignment_op): Delete in favor of...
(gcc_jit_block_add_assignment_op): New.
(gcc_jit_function_add_comment): Delete in favor of...
(gcc_jit_block_add_comment): New.
(gcc_jit_label_as_object): Delete in favor of...
(gcc_jit_block_as_object): New.
(gcc_jit_function_add_conditional): Delete in favor of...
(gcc_jit_block_end_with_conditional): New.
(gcc_jit_function_add_jump): Delete in favor of...
(gcc_jit_block_end_with_jump): New.
(gcc_jit_function_add_return): Delete in favor of...
(gcc_jit_block_end_with_return): New.
(gcc_jit_function_add_void_return): Delete in favor of...
(gcc_jit_block_end_with_void_return): New.
(gcc_jit_function_new_loop): Delete.
(gcc_jit_function_new_loop_over_range): Delete.
(gcc_jit_loop_as_object): Delete.
(gcc_jit_loop_end): Delete.
* libgccjit.map (gcc_jit_function_add_assignment): Delete in favor of...
(gcc_jit_block_add_assignment): New.
(gcc_jit_function_add_assignment_op): Delete in favor of...
(gcc_jit_block_add_assignment_op): New.
(gcc_jit_function_add_comment): Delete in favor of...
(gcc_jit_block_add_comment): New.
(gcc_jit_function_add_eval): Delete in favor of...
(gcc_jit_block_add_eval): New.
(gcc_jit_label_as_object): Delete in favor of...
(gcc_jit_block_as_object): New.
(gcc_jit_function_add_conditional): Delete in favor of...
(gcc_jit_block_end_with_conditional): New.
(gcc_jit_function_add_jump): Delete in favor of...
(gcc_jit_block_end_with_jump): New.
(gcc_jit_function_add_return): Delete in favor of...
(gcc_jit_block_end_with_return): New.
(gcc_jit_function_add_void_return): Delete in favor of...
(gcc_jit_block_end_with_void_return): New.
(gcc_jit_function_add_label): Delete in favor of...
(gcc_jit_function_new_block): New.
(gcc_jit_function_new_forward_label): Delete.
(gcc_jit_function_place_forward_label): Delete.
(gcc_jit_function_new_loop): Delete.
(gcc_jit_function_new_loop_over_range): Delete.
(gcc_jit_loop_as_object): Delete.
(gcc_jit_loop_end): Delete.
* libgccjit.c (gcc_jit_label): Delete in favor of...
(gcc_jit_block): New type.
(gcc_jit_loop): Delete.
(RETURN_IF_NOT_FUNC_DEFINITION): Delete in favor of...
(RETURN_IF_NOT_VALID_BLOCK): New macro.
(RETURN_NULL_IF_NOT_FUNC_DEFINITION): Delete in favor of...
(RETURN_NULL_IF_NOT_VALID_BLOCK): New macro.
(gcc_jit_function_new_forward_label): Delete in favor of...
(gcc_jit_function_new_block): New.
(gcc_jit_label_as_object): Delete in favor of...
(gcc_jit_block_as_object): New.
(gcc_jit_rvalue_dereference_field): Ensure that field has been
placed.
(gcc_jit_function_add_label): Delete
(gcc_jit_function_place_forward_label): Delete.
(gcc_jit_function_add_eval): Delete in favor of...
(gcc_jit_block_add_eval): New.
(gcc_jit_function_add_assignment): Delete in favor of...
(gcc_jit_block_add_assignment): New.
(gcc_jit_function_add_assignment_op): Delete in favor of...
(gcc_jit_block_add_assignment_op): New.
(gcc_jit_function_add_conditional): Delete in favor of...
(gcc_jit_block_end_with_conditional): New.
(gcc_jit_function_add_comment): Delete in favor of...
(gcc_jit_block_add_comment): New.
(gcc_jit_function_add_jump): Delete in favor of...
(gcc_jit_block_end_with_jump): New.
(gcc_jit_function_add_return): Delete in favor of...
(gcc_jit_block_end_with_return): New.
(gcc_jit_function_add_void_return): Delete in favor of...
(gcc_jit_block_end_with_void_return): New.
(gcc_jit_function_new_loop): Delete.
(gcc_jit_function_new_loop_over_range): Delete.
(gcc_jit_loop_as_object): Delete.
(gcc_jit_loop_end): Delete.
* internal-api.h (gcc::jit::recording::label): Delete class in
favor of...
(gcc::jit::recording::block): New class.
(gcc::jit::recording::loop): Delete class.
(gcc::jit::recording::loop_end): Delete class.
(gcc::jit::playback::label): Delete class in favor of...
(gcc::jit::playback::block): New class.
(gcc::jit::playback::loop): Delete class.
(gcc::jit::recording::playback_label): Delete function in favor of...
(gcc::jit::recording::playback_block): New function.
(gcc::jit::recording::context::validate): New.
(gcc::jit::recording::function::new_forward_label): Delete method.
(gcc::jit::recording::function::add_eval): Delete method in favor
of method of new gcc::jit::recording::block class.
(gcc::jit::recording::function::add_assignment): Likewise.
(gcc::jit::recording::function::add_assignment_op): Likewise.
(gcc::jit::recording::function::add_comment): Likewise.
(gcc::jit::recording::function::add_conditional): Likewise.
(gcc::jit::recording::function::place_forward_label): Likewise.
(gcc::jit::recording::function::add_jump): Likewise.
(gcc::jit::recording::function::add_return): Likewise.
(gcc::jit::recording::function::add_label): Delete method in favor of...
(gcc::jit::recording::function::new_block): New method.
(gcc::jit::recording::function::new_loop): Delete method.
(gcc::jit::recording::function::validate): New method.
(gcc::jit::recording::function::m_activity): Delete field in favor of...
(gcc::jit::recording::function::m_blocks): New field.
(gcc::jit::recording::statement::get_successor_blocks): New method.
(gcc::jit::recording::statement::write_to_dump): Make public.
(gcc::jit::recording::statement::statement): Accept a block rather
than a function.
(gcc::jit::recording::statement::playback_function): Delete.
(gcc::jit::recording::statement::get_block): New.
(gcc::jit::recording::statement::m_func): Delete in favor of...
(gcc::jit::recording::statement::m_block): ...this.
(gcc::jit::recording::eval::eval): Accept a block rather than a
function.
(gcc::jit::recording::assignment::assignment): Likewise.
(gcc::jit::recording::assignment_op::assignment_op): Likewise.
(gcc::jit::recording::comment::comment): Likewise.
(gcc::jit::recording::return::return): Likewise.
(gcc::jit::recording::conditional::conditional): Likewise; accept
blocks rather than labels.
(gcc::jit::recording::jump::jump): Likewise.
(gcc::jit::recording::conditional::get_successor_blocks): New.
(gcc::jit::recording::jump::get_successor_blocks): New.
(gcc::jit::playback::function::new_forward_label): Delete method
in favor of...
(gcc::jit::playback::function::new_block): New method.
(gcc::jit::playback::function::build_stmt_list): New method.
(gcc::jit::playback::function::m_blocks): New field.
* libgccjit++.h (gccjit::label): Delete class in favor of...
(gccjit::block): New class.
(gccjit::function::new_forward_label): Delete methods in favor of...
(gccjit::function::new_block): New methods.
(gccjit::function::add_comment): Delete methods in favor of methods
of new class gccjit::block.
(gccjit::function::add_conditional): Likewise.
(gccjit::function::add_label): Likewise.
(gccjit::function::place_forward_label): Likewise.
(gccjit::function::add_jump): Likewise.
(gccjit::function::add_return): Likewise.
(gccjit::function::add_call): Likewise.
* internal-api.c (gcc::jit::recording::playback_label): Delete in
favor of...
(gcc::jit::recording::playback_block): New.
(gcc::jit::recording::context::compile): Validate.
(gcc::jit::recording::context::validate): New.
(gcc::jit::recording::function::function): Update.
(gcc::jit::recording::function::new_forward_label): Delete.
(gcc::jit::recording::function::add_eval): Delete.
(gcc::jit::recording::function::add_assignment): Delete.
(gcc::jit::recording::function::add_assignment_op): Delete.
(gcc::jit::recording::function::new_block): New.
(gcc::jit::recording::function::add_comment): Delete.
(gcc::jit::ecording::function::add_conditional): Delete.
(gcc::jit::recording::function::add_label): Delete.
(gcc::jit::recording::function::place_forward_label): Delete.
(gcc::jit::recording::function::add_jump): Delete.
(gcc::jit::recording::function::add_return): Delete.
(gcc::jit::recording::function::new_loop): Delete.
(gcc::jit::recording::function::write_to_dump): Port to block-based
representation.
(gcc::jit::recording::function::validate): New.
(gcc::jit::recording::block::add_eval): New.
(gcc::jit::recording::block::add_assignment): New.
(gcc::jit::recording::label::replay_into): Delete.
(gcc::jit::recording::block::add_assignment_op): New.
(gcc::jit::recording::block::add_comment): New.
(gcc::jit::recording::block::end_with_conditional): New.
(gcc::jit::recording::block::end_with_jump): New.
(gcc::jit::recording::block::end_with_return): New.
(gcc::jit::recording::block::write_to_dump): New.
(gcc::jit::recording::block::validate): New.
(gcc::jit::recording::block::get_last_statement): New.
(gcc::jit::recording::block::get_successor_blocks): New.
(gcc::jit::recording::block::replay_into): New.
(gcc::jit::recording::label::make_debug_string): Delete.
(gcc::jit::recording::block::make_debug_string): New.
(gcc::jit::recording::statement::get_successor_blocks): New.
(gcc::jit::recording::eval::replay_into): Port to block-based
representation.
(gcc::jit::recording::assignment::replay_into): Likewise.
(gcc::jit::recording::assignment_op::replay_into): Likewise.
(gcc::jit::recording::comment::replay_into): Likewise.
(gcc::jit::recording::conditional::replay_into): Likewise.
(gcc::jit::recording::jump::replay_into): Likewise.
(gcc::jit::recording::return_::replay_into): Likewise.
(gcc::jit::recording::conditional::get_successor_blocks): New.
(gcc::jit::recording::place_label::place_label): Delete.
(gcc::jit::recording::place_label::replay_into): Delete.
(gcc::jit::recording::place_label::make_debug_string): Delete.
(gcc::jit::recording::place_label::write_to_dump): Delete.
(gcc::jit::recording::jump::get_successor_blocks): New.
(gcc::jit::recording::return_::get_successor_blocks): New.
(gcc::jit::recording::loop::replay_into): Delete.
(gcc::jit::recording::loop::make_debug_string): Delete.
(gcc::jit::recording::loop::end): Delete.
(gcc::jit::recording::loop_end::replay_into): Delete.
(gcc::jit::recording::loop_end::make_debug_string): Delete.
(gcc::jit::playback::function::new_forward_label): Delete.
(gcc::jit::playback::function::new_block): New.
(gcc::jit::playback::function::build_stmt_list): New.
(gcc::jit::playback::function::add_eval): Replace with...
(gcc::jit::playback::block::add_eval): New.
(gcc::jit::playback::function::add_assignment): Replace with...
(gcc::jit::playback::block::add_assignment): New.
(gcc::jit::playback::function::add_comment): Replace with...
(gcc::jit::playback::block::add_comment): New, reimplementing,
given that we no longer have labels.
(gcc::jit::playback::function::add_conditional): Replace with...
(gcc::jit::playback::block::add_conditional): New, reworking,
given that on_false can no longer be NULL.
(gcc::jit::playback::function::add_label): Delete.
(gcc::jit::playback::function::place_forward_label): Delete.
(gcc::jit::playback::function::add_jump): Replace with...
(gcc::jit::playback::block::add_jump): New.
(gcc::jit::playback::function::add_return): Replace with...
(gcc::jit::playback::block::add_return): New.
(gcc::jit::playback::function::new_loop): Delete.
(gcc::jit::playback::label::label): Replace with...
(gcc::jit::playback::block::block): ...this.
(gcc::jit::playback::loop::loop): Delete.
(gcc::jit::playback::loop::end): Delete.
(gcc::jit::playback::context::replay): Call each function's
build_stmt_list.
* TODO.rst: Update
2014-02-25 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_function_add_void_return): New.
* libgccjit.map (gcc_jit_function_add_void_return): New.
* libgccjit.c (gcc_jit_function_add_void_return): New.
* libgccjit++.h (add_return): Add overloaded variant with no
rvalue, calling gcc_jit_function_add_void_return.
* internal-api.c (gcc::jit::recording::function::add_return): Add
comment that rvalue could be NULL.
(gcc::jit::playback::function::add_return): Support rvalue being
NULL.
2014-02-25 David Malcolm <dmalcolm@redhat.com>
* internal-api.h (gcc::jit::playback::function): Add field
m_inner_block.
* internal-api.c (gcc::jit::playback::function::function):
Create BLOCK here and link it to the BIND_EXPR.
(gcc::jit::playback::function::gt_ggc_mx): Walk m_inner_block.
(gcc::jit::playback::function::postprocess): Set up BLOCK_VARS on
the block, so that the local variables make it into the debuginfo.
2014-02-24 Philip Herron <redbrain@gcc.gnu.org>
* Make-lang.in (jit.install-common): Implement.
2014-02-21 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_dump_to_file): New.
* libgccjit.map (gcc_jit_context_dump_to_file): New.
* libgccjit.c (gcc_jit_context_dump_to_file): New.
* libgccjit++.h (gccjit::context::dump_to_file): New.
* internal-api.h (gcc::jit::dump): New class.
(gcc::jit::recording::playback_location): Add a replayer argument,
so that playback locations can be created before playback statements.
(gcc::jit::recording::location::playback_location): Likewise.
(gcc::jit::recording::statement::playback_location): Likewise.
(gcc::jit::recording::context::dump_to_file): New.
(gcc::jit::recording::context::m_structs): New field, for use by
dump_to_file.
(gcc::jit::recording::context::m_functions): Likewise.
(gcc::jit::recording::memento::write_to_dump): New virtual function.
(gcc::jit::recording::field::write_to_dump): New.
(gcc::jit::recording::fields::write_to_dump): New.
(gcc::jit::recording::function::write_to_dump): New.
(gcc::jit::recording::function::m_locals): New field for use by
write_to_dump.
(gcc::jit::recording::function::m_activity): Likewise.
(gcc::jit::recording::local::write_to_dump): New.
(gcc::jit::recording::statement::write_to_dump): New.
(gcc::jit::recording::place_label::write_to_dump): New.
* internal-api.c (gcc::jit::dump::dump): New.
(gcc::jit::dump::~dump): New.
(gcc::jit::dump::write): New.
(gcc::jit::dump::make_location): New.
(gcc::jit::recording::playback_location): Add a replayer argument,
so that playback locations can be created before playback statements.
(gcc::jit::recording::context::context): Initialize new fields.
(gcc::jit::recording::function::function): Likewise.
(gcc::jit::recording::context::new_struct_type): Add struct to the
context's m_structs vector.
(gcc::jit::recording::context::new_function): Add function to the
context's m_functions vector.
(gcc::jit::recording::context::dump_to_file): New.
(gcc::jit::recording::memento::write_to_dump): New.
(gcc::jit::recording::field::write_to_dump): New.
(gcc::jit::recording::fields::write_to_dump): New.
(gcc::jit::recording::function::write_to_dump): New.
(gcc::jit::recording::local::write_to_dump): New.
(gcc::jit::recording::statement::write_to_dump): New.
(gcc::jit::recording::place_label::write_to_dump): New.
(gcc::jit::recording::array_type::replay_into): Pass on replayer
to call to playback_location.
(gcc::jit::recording::field::replay_into): Likewise.
(gcc::jit::recording::struct_::replay_into): Likewise.
(gcc::jit::recording::param::replay_into): Likewise.
(gcc::jit::recording::function::replay_into): Likewise.
(gcc::jit::recording::global::replay_into): Likewise.
(gcc::jit::recording::unary_op::replay_into): Likewise.
(gcc::jit::recording::binary_op::replay_into): Likewise.
(gcc::jit::recording::comparison::replay_into): Likewise.
(gcc::jit::recording::call::replay_into): Likewise.
(gcc::jit::recording::array_access::replay_into): Likewise.
(gcc::jit::recording::access_field_of_lvalue::replay_into): Likewise.
(gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
(gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
(gcc::jit::recording::dereference_rvalue::replay_into): Likewise.
(gcc::jit::recording::get_address_of_lvalue::replay_into): Likewise.
(gcc::jit::recording::local::replay_into): Likewise.
(gcc::jit::recording::eval::replay_into): Likewise.
(gcc::jit::recording::assignment::replay_into): Likewise.
(gcc::jit::recording::assignment_op::replay_into): Likewise.
(gcc::jit::recording::comment::replay_into): Likewise.
(gcc::jit::recording::conditional::replay_into): Likewise.
(gcc::jit::recording::place_label::replay_into): Likewise.
(gcc::jit::recording::jump::replay_into): Likewise.
(gcc::jit::recording::return_::replay_into): Likewise.
(gcc::jit::recording::loop::replay_into): Likewise.
(gcc::jit::recording::loop_end::replay_into): Likewise.
(gcc::jit::recording::function::new_local): Add to the function's
vector of locals.
(gcc::jit::recording::function::add_eval): Add to the function's
m_activity field.
(gcc::jit::recording::function::add_assignment): Likewise.
(gcc::jit::recording::function::add_assignment_op): Likewise.
(gcc::jit::recording::function::add_comment): Likewise.
(gcc::jit::recording::function::add_conditional): Likewise.
(gcc::jit::recording::function::place_forward_label): Likewise.
(gcc::jit::recording::function::add_jump): Likewise.
(gcc::jit::recording::function::add_return): Likewise.
(gcc::jit::recording::function::new_loop): Likewise.
(gcc::jit::recording::conditional::make_debug_string): Add missing
semicolon.
2014-02-19 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_context_new_rvalue_from_ptr): Verify that
pointer_type is indeed a pointer type.
(gcc_jit_context_null): Likewise.
(gcc_jit_context_new_array_access): Verify that ptr is indeed a
pointer.
* TODO.rst: Update
2014-02-18 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_struct): New.
(gcc_jit_context_new_struct_type): Change return type from gcc_jit_type
to gcc_jit_struct.
(gcc_jit_context_new_opaque_struct): New.
(gcc_jit_struct_as_type): New.
(gcc_jit_struct_set_fields): New.
(gcc_jit_context_null): New.
* libgccjit.map (gcc_jit_context_new_opaque_struct): New.
(gcc_jit_context_null): New.
(gcc_jit_struct_as_type): New.
(gcc_jit_struct_set_fields): New.
* libgccjit++.h (gccjit::context::new_struct_type): Return a
struct_ rather than a type.
(gccjit::context::new_opaque_struct_type): New.
(gccjit::struct_): New subclass of type.
* libgccjit.c (gcc_jit_struct): New.
(RETURN_VAL_IF_FAIL_PRINTF1): New.
(RETURN_VAL_IF_FAIL_PRINTF2): New.
(RETURN_NULL_IF_FAIL_PRINTF1): New.
(RETURN_IF_FAIL_PRINTF1): New.
(RETURN_IF_FAIL_PRINTF2): New.
(gcc_jit_context_new_struct_type): Return a gcc_jit_struct rather
than a gcc_jit_type; implement by creating the struct, then
setting the fields in it.
(gcc_jit_context_new_opaque_struct): New.
(gcc_jit_struct_as_type): New.
(gcc_jit_struct_set_fields): New.
(gcc_jit_context_null): New.
(gcc_jit_lvalue_access_field): Use the struct's context when
reporting on a NULL field; verify that the field has been placed
in a struct.
(gcc_jit_rvalue_access_field): Likewise.
(is_bool): New.
(gcc_jit_function_add_conditional): Use the function's context
when reporting errors; verify that boolval's type is indeed
boolean.
(gcc_jit_function_new_loop): Likewise.
* internal-api.h (gcc::jit::recording::context::new_struct_type):
Don't accept fields, and return a struct_ rather than a type_, so
that fields can be set later.
(gcc::jit::recording::struct_::struct_): Store a (fields *) rather
than a vec of fields.
(gcc::jit::recording::struct_::as_type): New.
(gcc::jit::recording::struct_::get_fields): New.
(gcc::jit::recording::struct_::set_fields): New.
(gcc::jit::recording::struct_::playback_struct): New.
(gcc::jit::recording::fields): New class.
(gcc::jit::playback::context::new_struct_type): Don't accept
fields, and return a struct_ rather than a type_, so that fields
can be set later.
(gcc::jit::playback::struct_): New subclass of type.
* internal-api.c (gcc::jit::recording::context::get_type): With
nested contexts, create basic types within the ultimate parent
context, allowing for a fast check for the boolean type using
pointer equality.
(gcc::jit::recording::context::new_struct_type): Don't accept
fields, and return a struct_ rather than a type_, so that fields
can be set later.
(gcc::jit::recording::context::get_opaque_FILE_type): Update for
struct-creation changes.
(gcc::jit::recording::struct_::struct_): Store a (fields *) rather
than a vec of fields.
(gcc::jit::recording::struct_::set_fields): New.
(gcc::jit::recording::struct_::replay_into): Don't playback the
fields, as this is now done by a fields instance.
(gcc::jit::recording::fields::fields): New.
(gcc::jit::recording::fields::replay_into): New.
(gcc::jit::recording::fields::make_debug_string): New.
(gcc::jit:: playback::context::new_struct_type): Don't accept
fields, and return a struct_ rather than a type_, so that fields
can be set later.
(gcc::jit::playback::struct_::set_fields): New.
* TODO.rst: Update.
2014-02-18 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_function_new_local): Use the context of the
function when reporting errors.
(gcc_jit_function_place_forward_label): Likewise.
(gcc_jit_function_add_eval): Likewise.
(gcc_jit_function_add_assignment_op): Likewise.
(gcc_jit_function_add_comment): Likewise.
(gcc_jit_function_add_jump): Likewise.
2014-02-14 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::type::zero): New method.
(gccjit::type::one): New method.
(gccjit::function::add_call): New family of overloaded methods.
2014-02-13 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_get_builtin_function): New.
* libgccjit.map (gcc_jit_context_get_builtin_function): New.
* libgccjit++.h (gccjit::context::get_builtin_function): New method.
* Make-lang.in (jit_OBJS): Add jit/jit-builtins.o
* jit-builtins.c: New source file, for managing builtin functions
and their types.
* jit-builtins.h: Likewise.
* libgccjit.c (gcc_jit_context_new_function): Pass BUILT_IN_NONE for
the new argument of new_function
(gcc_jit_context_get_builtin_function): New.
* internal-api.h: Add idempotency guards.
(gcc::jit::recording::context::new_function): Add parameter
for builtin functions.
(gcc::jit::recording::context::get_builtin_function): New method.
(gcc::jit::recording::context::m_builtins_manager): New field.
(gcc::jit::recording::type::as_a_function_type): New virtual function.
(gcc::jit::recording::function_type): New subclass of type.
(gcc::jit::recording::function::function): Add parameter for
builtin functions.
(gcc::jit::recording::function::m_builtin_id): New field.
(gcc::jit::recording::function::new_function_type): New method.
(gcc::jit::playback::function::function): Add parameter for
builtin functions.
* internal-api.c (gcc::jit::recording::context::context):
NULL-initialize new field m_builtins_manager.
(gcc::jit::recording::context::~context): Clean up the builtins
manager, if one has been created.
(gcc::jit::recording::context::new_function): Add parameter
(gcc::jit::recording::context::get_builtin_function): New method.
(gcc::jit::recording::function_type::function_type): Implement
constructor for new subclass.
(gcc::jit::recording::function_type::dereference): Implement
method for new subclass.
(gcc::jit::recording::function_type::replay_into): Likewise.
(gcc::jit::recording::function_type::make_debug_string): Likewise.
(gcc::jit::recording::function::function): Add parameter for
builtin functions.
(gcc::jit::recording::function::replay_into): Likewise for
creation of playback object.
(gcc::jit::recording::function::new_function_type): New method.
(gcc::jit::playback::function::new_function): Add parameter for
builtin functions, using it to set up the fndecl accordingly.
2014-02-11 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (IS_ASCII_ALPHA): New macro.
(IS_ASCII_DIGIT): New macro.
(IS_ASCII_ALNUM): New macro.
(gcc_jit_context_new_function): Require that function names be valid
C identifiers for now, to avoid later problems in the assembler.
2014-02-11 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_types): Add GCC_JIT_TYPE_BOOL.
* internal-api.h (gcc::jit::recording::comparison::comparison): Use
GCC_JIT_TYPE_BOOL as the types of comparisons, rather than
GCC_JIT_TYPE_INT.
* internal-api.c (gcc::jit::recording::memento_of_get_type::
dereference): Handle GCC_JIT_TYPE_BOOL (with an error).
(get_type_strings): Add GCC_JIT_TYPE_BOOL.
(get_tree_node_for_type): Handle GCC_JIT_TYPE_BOOL.
2014-02-11 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::context::add_error_va): If
GCC_JIT_STR_OPTION_PROGNAME is NULL, use "libgccjit.so", as per
the comment in libgccjit.h
(gcc::jit::recording::label::replay_into): When reporting on an
unplaced label, include the name of the containing function in
the error message.
* libgccjit.c: Remove comment about "Functions for use within the
code factory", as this distinction went away in commit
96b218c9a1d5f39fb649e02c0e77586b180e8516.
(RETURN_VAL_IF_FAIL_PRINTF4): New.
(RETURN_NULL_IF_FAIL_PRINTF4): New.
(jit_error): Invoke vfprintf with the correct format string in
the NULL context case.
(gcc_jit_context_new_call): Check for NULL entries within the
array of arguments.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_get_int_type): New.
* libgccjit.map (gcc_jit_context_get_int_type): New.
* libgccjit.c (gcc_jit_context_get_int_type): New.
* internal-api.h (gcc::jit::recording::context::get_int_type): New.
(gcc::jit::recording::context::get_int_type<T>): New template.
* internal-api.c (gcc::jit::recording::context::get_int_type): New.
* libgccjit++.h: Include <limits> so we can use std::numeric_limits.
(gccjit::context::get_int_type): New.
(gccjit::context::get_int_type<T>): New.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_function_get_param): New.
* libgccjit.map (gcc_jit_function_get_param): New.
* libgccjit.c (gcc_jit_function_get_param): New.
* libgccjit++.h (gccjit::function::get_param): New.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::object::get_inner_object): Make const.
(gccjit::location::get_inner_location): Likewise.
(gccjit::field::get_inner_field): Likewise.
(gccjit::type::get_inner_type): Likewise.
(gccjit::function::get_inner_function): Likewise.
(gccjit::label::get_inner_label): Likewise.
(gccjit::rvalue::get_inner_rvalue): Likewise.
(gccjit::lvalue::get_inner_lvalue): Likewise.
(gccjit::param::get_inner_param): Likewise.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::object::get_context): New method.
(gccjit::function): Add overloaded operator () for various
numbers of arguments as a very terse way of creating function calls.
(gccjit::rvalue::get_type): New method.
(operator-): New overloaded unary op for rvalues.
(operator~): Likewise.
(operator!): Likewise.
(operator+): New overloaded binary op for rvalues.
(operator-): Likewise.
(operator*): Likewise.
(operator/): Likewise.
(operator%): Likewise.
(operator&): Likewise.
(operator^): Likewise.
(operator|): Likewise.
(operator&&): Likewise.
(operator||): Likewise.
(operator==): New overloaded comparison for rvalues.
(operator!=): Likewise.
(operator<): Likewise.
(operator<=): Likewise.
(operator>): Likewise.
(operator>=): Likewise.
(operator*): New overloaded operator for dereferencing an
rvalue representing a pointer.
* libgccjit.c (gcc_jit_rvalue_get_type): New.
* libgccjit.h (gcc_jit_rvalue_get_type): New.
* libgccjit.map (gcc_jit_rvalue_get_type): New.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::context::new_minus): New method,
providing a way to do a specific unary op with less typing.
(gccjit::context::new_bitwise_negate): Likewise.
(gccjit::context::new_logical_negate): Likewise.
(gccjit::context::new_plus): Likewise, for binary op.
(gccjit::context::new_minus): Likewise.
(gccjit::context::new_mult): Likewise.
(gccjit::context::new_divide): Likewise.
(gccjit::context::new_modulo): Likewise.
(gccjit::context::new_bitwise_and): Likewise.
(gccjit::context::new_bitwise_xor): Likewise.
(gccjit::context::new_bitwise_or): Likewise.
(gccjit::context::new_logical_and): Likewise.
(gccjit::context::new_logical_or): Likewise.
(gccjit::context::new_eq): Likewise, for comparison.
(gccjit::context::new_ne): Likewise.
(gccjit::context::new_lt): Likewise.
(gccjit::context::new_le): Likewise.
(gccjit::context::gccjit::context::new_gt): Likewise.
(gccjit::context::gccjit::context::new_ge): Likewise.
(gccjit::context::new_call): Add a series of overloaded methods
for specific numbers of args (from 0 - 6), to avoid the need for
client code to manually build a std::vector (or requiring C++11).
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::context::new_struct_type): Pass std::vector
"fields" argument by reference rather than by value.
(gccjit::context::new_function): Likewise, for "params" arg.
(gccjit::context::new_call): Likewise, for "args" arg.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::context::new_location): Update filename
arg from a const char * to a const std::string &.
(gccjit::context::new_field): Likewise for "name" arg.
(gccjit::context::new_struct_type): Likewise.
(gccjit::context::new_param): Likewise.
(gccjit::context::new_function): Likewise.
(gccjit::function::new_local): Likewise.
(gccjit::context::new_rvalue): Likewise for "value" arg.
(gccjit::function::add_comment): Likewise for "text" arg.
(gccjit::function::new_forward_label): Likewise for "name" arg; add
variant taking no args for anonymous labels.
(gccjit::function::add_label): Likewise.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h (gccjit::object, gccjit::location): Move
these declarations to before that of gccjit::context so that
the various methods of context taking a location can have a
default location value.
(gccjit::context::new_array_type): Consolidate two methods,
one accepting a gccjit::location, the other without, by
providing a default argument (which thus has to be moved to the
end of the argument list).
(gccjit::context::new_field): Likewise.
(gccjit::context::new_struct_type): Likewise.
(gccjit::context::new_param): Likewise.
(gccjit::context::new_function): Likewise.
(gccjit::context::new_unary_op): Likewise.
(gccjit::context::new_binary_op): Likewise.
(gccjit::context::new_comparison): Likewise.
(gccjit::context::new_call): Likewise.
(gccjit::context::new_array_access): Likewise.
(gccjit::function::new_local): Likewise.
(gccjit::function::add_eval): Likewise.
(gccjit::function::add_assignment): Likewise.
(gccjit::function::add_assignment_op): Likewise.
(gccjit::function::add_comment): Likewise.
(gccjit::function::add_conditional): Likewise.
(gccjit::function::add_label): Likewise.
(gccjit::function::place_forward_label): Likewise.
(gccjit::function::add_jump): Likewise.
(gccjit::function::add_return): Likewise.
(gccjit::rvalue::access_field): Likewise.
(gccjit::rvalue::dereference_field): Likewise.
(gccjit::rvalue::dereference): Likewise.
(gccjit::lvalue::access_field): Likewise.
(gccjit::lvalue::get_address): Likewise.
2014-02-10 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Update.
2014-02-06 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h: Include <ostream> rather than <iostream>, since
the former gets us std::ostream, and the latter may introduce
startup-time overhead for constructing std::cout et al.
(gccjit::context::new_child_context): New.
(gccjit::context::release): New.
(gccjit::context::compile): New.
(gccjit::context::set_int_option): New.
(gccjit::context::set_bool_option): New.
2014-02-03 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (struct gcc_jit_object): New.
(gcc_jit_object_get_context): New.
(gcc_jit_object_get_debug_string): New.
(gcc_jit_location_as_object): New.
(gcc_jit_type_as_object): New.
(gcc_jit_field_as_object): New.
(gcc_jit_param_as_object): New.
(gcc_jit_function_as_object): New.
(gcc_jit_label_as_object): New.
(gcc_jit_lvalue_as_object): New.
(gcc_jit_rvalue_as_object): New.
(gcc_jit_loop_as_object): New.
* libgccjit.map (gcc_jit_field_as_object): New.
(gcc_jit_function_as_object): New.
(gcc_jit_label_as_object): New.
(gcc_jit_location_as_object): New.
(gcc_jit_loop_as_object): New.
(gcc_jit_lvalue_as_object): New.
(gcc_jit_object_get_context): New.
(gcc_jit_object_get_debug_string): New.
(gcc_jit_param_as_object): New.
(gcc_jit_rvalue_as_object): New.
(gcc_jit_type_as_object): New.
* libgccjit.c (struct gcc_jit_object): New.
(gcc_jit_location_as_object): New.
(gcc_jit_type_as_object): New.
(gcc_jit_field_as_object): New.
(gcc_jit_param_as_object): New.
(gcc_jit_function_as_object): New.
(gcc_jit_label_as_object): New.
(gcc_jit_lvalue_as_object): New.
(gcc_jit_rvalue_as_object): New.
(gcc_jit_object_get_context): New.
(gcc_jit_object_get_debug_string): New.
(gcc_jit_loop_as_object): New.
* internal-api.h (gcc::jit::recording::memento::get_context): New.
(gcc::jit::recording::memento::as_object): New.
* libgccjit++.h: Require iostream, for std::ostream.
(class object): New base class.
(operator << (std::ostream& stream, const object &obj)): New.
(location): Inherit from the new "object" base class.
(location::m_inner_loc): Remove, in favor of...
(location::get_inner_location): ...new method.
(field): Inherit from the new "object" base class.
(field::m_inner_field): Remove, in favor of...
(field::get_inner_field): ...new method.
(type): Inherit from the new "object" base class.
(type::m_inner_type): Remove, in favor of...
(type::get_inner_type): ...new method.
(function): Inherit from the new "object" base class.
(function::m_inner_func): Remove, in favor of...
(function::get_inner_function): ...new method.
(label): Inherit from the new "object" base class.
(label::m_inner_label): Remove, in favor of...
(label::get_inner_label): ...new method.
(rvalue) Inherit from the new "object" base class.
(rvalue::m_inner_rvalue): Remove, in favor of...
(rvalue::get_inner_rvalue): ...new method.
(context::new_field): Update for move of inner pointer to the
"object" base class.
(context::new_struct_type): Likewise.
(context::new_param): Likewise.
(context::new_function): Likewise.
(context::new_rvalue): Likewise.
(context::zero): Likewise.
(context::one): Likewise.
(context::new_rvalue): Likewise.
(context::new_rvalue): Likewise.
(context::new_unary_op): Likewise.
(context::new_binary_op): Likewise.
(context::new_comparison): Likewise.
(context::new_call): Likewise.
(object::get_debug_string): New.
(object::object): New.
(object::get_inner_object): New.
(operator << (std::ostream&, const object &)): New.
(location::location): Update for move of inner pointer to the
"object" base class.
(location::get_inner_location): New.
(field::field): Update for move of inner pointer to the
"object" base class.
(field::get_inner_field): New.
(type::type): Update for move of inner pointer to the
"object" base class.
(type::get_pointer): Likewise.
(type::get_inner_type): New.
(function::function): Update for move of inner pointer to the
"object" base class.
(function::new_forward_label): Likewise.
(function::new_local): Likewise.
(function::add_eval): Likewise.
(function::add_assignment): Likewise.
(function::add_assignment_op): Likewise.
(function::add_comment): Likewise.
(function::add_conditional): Likewise.
(function::add_label): Likewise.
(function::place_forward_label): Likewise.
(function::add_jump): Likewise.
(function::add_return): Likewise.
(function::get_inner_function): New.
(label::label): Update for move of inner pointer to the "object"
base class.
(label::get_inner_label): New
(rvalue::rvalue): Update for move of inner pointer to the "object"
base class.
(rvalue::get_inner_rvalue): New.
(rvalue::access_field): Likewise.
(rvalue::dereference_field): Likewise.
(rvalue::dereference): Likewise.
(lvalue::get_inner_lvalue): Update for move of inner pointer to
the "object" base class.
(lvalue::access_field): Likewise.
(lvalue::get_address): Likewise.
2014-01-31 David Malcolm <dmalcolm@redhat.com>
* libgccjit++.h: New file - a C++ wrapper for the libgccjit.h API.
* TODO.rst ("Test Suite"): New section, adding note about C++
tests.
2014-01-31 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_new_rvalue_from_int): Give the type
parameter a more descriptive name.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
* libgccjit.c (gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
* internal-api.h (gcc::jit::recording::context::
new_rvalue_from_int): Likewise.
(gcc::jit::recording::context::
new_rvalue_from_double): Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_int::
memento_of_new_rvalue_from_int): Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_double::
memento_of_new_rvalue_from_double): Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_ptr::
memento_of_new_rvalue_from_ptr): Likewise.
2014-01-30 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Label-placement is now checked.
* internal-api.c (gcc::jit::recording::context::replay_into): Give
up if any errors occur during the playback.
(gcc::jit::recording::label::replay_into): Issue an error if the
label has not yet been placed (at playback time).
(gcc::jit::recording::place_label::place_label): Move this here
from internal-api.h. Issue an error if the label has already
been placed (at recording time).
* internal-api.h (gcc::jit::recording::label): Add an
m_has_been_placed field, and make class place_label a friend so
it can set it.
(gcc::jit::recording::label::has_been_placed): New accessor.
(gcc::jit::recording::place_label::place_label): Move to
internal-api.c.
(gcc::jit::playback::context::errors_occurred): Make public, for
use by gcc::jit::recording::context::replay_into.
2014-01-30 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::recording::type::get_pointer):
Ensure that repeated calls yield the same type.
(gcc::jit::recording::memento_of_get_pointer::
accepts_writes_from): New.
(gcc::jit::recording::context::new_call): Move
the existing argument checking to...
* libgccjit.c (gcc_jit_context_new_call): ...here, and add
checking of the types of the arguments against the function.
(RETURN_VAL_IF_FAIL_PRINTF6): New.
(RETURN_NULL_IF_FAIL_PRINTF6): New.
* internal-api.h (gcc::jit::recording::type): New field
m_pointer_to_this_type, for use by get_pointer method.
(gcc::jit::recording::memento_of_get_pointer::
accepts_writes_from): New.
(gcc::jit::recording::function::get_param): New.
* TODO.rst (argument checking of gcc_jit_context_new_call): Done.
2014-01-30 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: begin a list of error-checking we could do that this
commit *doesn't* cover.
* libgccjit.h (gcc_jit_field): Add note that fields can't be
shared between structs.
(GCC_JIT_BINARY_OP_MODULO): Fix typo in comment.
* libgccjit.c: (RETURN_VAL_IF_FAIL_PRINTF2): New.
(RETURN_VAL_IF_FAIL_PRINTF3): New.
(RETURN_NULL_IF_FAIL_PRINTF2): New.
(RETURN_NULL_IF_FAIL_PRINTF3): New.
(RETURN_IF_FAIL_PRINTF4): New.
(jit_error): Take a gcc::jit::recording::context rather than
a gcc_jit_context so that we pass in contexts from the inner
layer.
(compatible_types): New, for use in type-checking.
(gcc_jit_context_new_struct_type): Check each field to ensure that
it isn't already in use by another struct.
(gcc_jit_rvalue_dereference_field): Check that ptr is of a pointer
type and that the field is within the correct struct, using new
get_debug_string hooks to generate error messages.
(gcc_jit_rvalue_dereference): Check that rvalue is of a pointer
type.
(gcc_jit_function_add_assignment): Use the function's context when
reporting on NULL lvalue or rvalue. Verify that the lvalue and
rvalue have compatible types.
(gcc_jit_function_add_return): Use the function's context when
reporting on NULL rvalue. Verify that the rvalue is of an
appropriate type given the function's return type.
* internal-api.h (NUM_GCC_JIT_TYPES): New.
(gcc::jit::recording::context::record): Move from here to
internal-api.c.
(gcc::jit::recording::context::get_opaque_FILE_type): New.
(gcc::jit::recording::context::m_basic_types): New field.
(gcc::jit::recording::context::m_FILE_type): New field.
(gcc::jit::recording::memento::get_debug_string): New method.
(gcc::jit::recording::memento::memento): Initialize new field
m_debug_string, and verify context is non-NULL.
(gcc::jit::recording::memento::make_debug_string): New
pure-virtual function lazily used by get_debug_string.
(gcc::jit::recording::memento::m_debug_string): New field, for
get_debug_string to use as a cache.
(gcc::jit::recording::string): Rename field m_copy to m_buffer.
(gcc::jit::recording::from_printf): New factory function.
(gcc::jit::recording::make_debug_string): New.
(gcc::jit::recording::location::make_debug_string): New.
(gcc::jit::recording::type::dereference): New pure-virtual
function.
(gcc::jit::recording::type::accepts_writes_from): New virtual
function.
(gcc::jit::recording::type::unqualified): New virtual function.
(gcc::jit::recording::memento_of_get_type::dereference): New.
(gcc::jit::recording::memento_of_get_type::
accepts_writes_from): New.
(gcc::jit::recording::memento_of_get_type::make_debug_string):
New.
(gcc::jit::recording::memento_of_get_pointer::make_debug_string):
New.
(gcc::jit::recording::memento_of_get_pointer::dereference): New.
New.
(gcc::jit::recording::memento_of_get_const::make_debug_string):
New.
(gcc::jit::recording::memento_of_get_const::dereference): New.
New.
(gcc::jit::recording::memento_of_get_const::accepts_writes_from):
New.
(gcc::jit::recording::memento_of_get_const::unqualified): New.
(gcc::jit::recording::field): New field m_container, for the
containing struct (or union, if we implement that).
(gcc::jit::recording::field::get_type): New.
(gcc::jit::recording::field::get_container): New.
(gcc::jit::recording::field:set_container): New.
(gcc::jit::recording::field::make_debug_string): New.
(gcc::jit::recording::struct_::struct_): Move ctor implementation
from here into internal-api.c.
(gcc::jit::recording::struct_::dereference): New.
(gcc::jit::recording::struct_::make_debug_string): New.
(gcc::jit::recording::rvalue::m_type): New field.
(gcc::jit::recording::rvalue::rvalue): Require a non-NULL type for
new rvalue instances.
(gcc::jit::recording::rvalue::get_type): New accessor.
(gcc::jit::recording::lvalue): Eliminate field m_type in favor of
that within the rvalue base class.
(gcc::jit::recording::param::make_debug_string): New.
(gcc::jit::recording::function::get_return_type): New accessor.
(gcc::jit::recording::function::make_debug_string): New.
(gcc::jit::recording::label::make_debug_string): New.
(gcc::jit::recording::global): Eliminate field m_type in favor of
that within the rvalue ultimate base class (via lvalue).
(gcc::jit::recording::make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_int): Eliminate
field m_type in favor of that within the rvalue base class.
(gcc::jit::recording::memento_of_new_rvalue_from_int::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_double): Eliminate
field m_type in favor of that within the rvalue base class.
(gcc::jit::recording::memento_of_new_rvalue_from_double::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_ptr): Eliminate
field m_type in favor of that within the rvalue base class.
(gcc::jit::recording::memento_of_new_rvalue_from_ptr::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_string_literal::
memento_of_new_string_literal): Initialize type.
(gcc::jit::recording::memento_of_new_string_literal::
make_debug_string): New.
(gcc::jit::recording::unary_op): Eliminate field m_result_type in
favor of m_type within the rvalue base class.
(gcc::jit::recording::unary_op::make_debug_string): New.
(gcc::jit::recording::binary_op): Eliminate field m_result_type in
favor of m_type within the rvalue base class.
(gcc::jit::recording::binary_op::make_debug_string): New.
(gcc::jit::recording::comparison): Eliminate field m_result_type
in favor of m_type within the rvalue base class.
(gcc::jit::recording::comparison::make_debug_string): New.
(gcc::jit::recording::make_debug_string): New.
(gcc::jit::recording::array_lookup::array_lookup): Initialize type
by dereferencing the type of the pointer.
(gcc::jit::recording::array_lookup::make_debug_string): New.
(gcc::jit::recording::access_field_of_lvalue::
access_field_of_lvalue): Initialize type from that of the field.
(gcc::jit::recording::access_field_of_lvalue::
make_debug_string): New.
(gcc::jit::recording::access_field_rvalue::
access_field_of_rvalue): Initialize type from that of the field.
(gcc::jit::recording::access_field_rvalue::make_debug_string):
New.
(gcc::jit::recording::dereference_field_rvalue::
dereference_field_rvalue): Initialize type from that of the field.
(gcc::jit::recording::dereference_field_rvalue::
make_debug_string): New.
(gcc::jit::recording::dereference_rvalue::dereference_rvalue):
Initialize type by dereferencing the type of the pointer.
(gcc::jit::recording::dereference_rvalue::make_debug_string): New.
(gcc::jit::recording::get_address_of_lvalue::
get_address_of_lvalue): Initialize type by dereferencing the type
of the pointer.
(gcc::jit::recording::get_address_of_lvalue::make_debug_string):
New.
(gcc::jit::recording::local): Eliminate field m_type in favor of
that within the rvalue ultimate base class (via lvalue).
(gcc::jit::recording::make_debug_string): New.
(gcc::jit::recording::eval::make_debug_string): New.
(gcc::jit::recording::assignment::make_debug_string): New.
(gcc::jit::recording::assignment_op::make_debug_string): New.
(gcc::jit::recording::comment::make_debug_string): New.
(gcc::jit::recording::conditional::make_debug_string): New.
(gcc::jit::recording::place_label::make_debug_string): New.
(gcc::jit::recording::jump::make_debug_string): New.
(gcc::jit::recording::return_::make_debug_string): New.
(gcc::jit::recording::loop::make_debug_string): New.
(gcc::jit::recording::loop_end::make_debug_string): New.
* internal-api.c (gcc::jit::recording::context::context):
Initialize m_FILE_type and m_basic_types.
(gcc::jit::recording::context::record): Move here from
internal-api.h.
(gcc::jit::recording::context::replay_into): Add a disabled way to
log everything during a replay, exercising the stringification
machinery.
(gcc::jit::recording::context::get_type): Cache and reuse the
types, so that repeated calls on the context give the same object.
(gcc::jit::recording::context::get_opaque_FILE_type): New, for
the result of dereferencing (FILE*), mostly so that fuzz-testing
that tries this gets something sane back.
(gcc::jit::recording::memento::get_debug_string): New method,
giving a way to easily get a descriptive (const char *) for
an API entity. Internally, it lazily calls the make_debug_string
virtual function, storing the result in m_debug_string.
(gcc::jit::recording::string::string): Rename field m_copy to m_buffer.
(gcc::jit::recording::string::~string): Likewise.
(gcc::jit::recording::string::from_printf): New factory function,
to make it easy to implement the make_debug_string hooks.
(gcc::jit::recording::string::make_debug_string): New.
(gcc::jit::recording::location::make_debug_string): New.
(gcc::jit::recording::memento_of_get_type::dereference): New.
(get_type_strings): New table of strings, for use by...
(gcc::jit::recording::memento_of_get_type::make_debug_string): New.
(gcc::jit::recording::memento_of_get_pointer::make_debug_string): New.
(gcc::jit::recording::memento_of_get_const::make_debug_string): New.
(gcc::jit::recording::field::make_debug_string): New.
(gcc::jit::recording::struct_::struct_): Move here from
internal-api.h. Mark all fields as belonging to the new struct.
(gcc::jit::recording::struct_::dereference): New.
(gcc::jit::recording::struct_::make_debug_string): New.
(gcc::jit::recording::function::make_debug_string): New.
(gcc::jit::recording::label::make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_int::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_double::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_rvalue_from_ptr::
make_debug_string): New.
(gcc::jit::recording::memento_of_new_string_literal::
make_debug_string): New.
(gcc::jit::recording::unary_op::replay_into): Use get_type ()
rather than the now-defunct m_result_type.
(gcc::jit::recording::binary_op::replay_into): Likewise.
(unary_op_strings): New table of strings for use by...
(gcc::jit::recording::unary_op::make_debug_string): New.
(binary_op_strings): New table of strings for use by...
(gcc::jit::recording::binary_op::make_debug_string): New.
(comparison_strings): New table of strings for use by...
(gcc::jit::recording::comparison::make_debug_string): New.
(gcc::jit::recording::call::call): Initialize the type.
(gcc::jit::recording::call::make_debug_string): New.
(gcc::jit::recording::array_lookup::make_debug_string): New.
(gcc::jit::recording::access_field_of_lvalue::
make_debug_string): New.
(gcc::jit::recording::access_field_rvalue::
make_debug_string): New.
(gcc::jit::recording::dereference_field_rvalue::
make_debug_string): New.
(gcc::jit::recording::dereference_rvalue::make_debug_string): New.
(gcc::jit::recording::get_address_of_lvalue::
make_debug_string): New.
(gcc::jit::recording::eval::make_debug_string): New.
(gcc::jit::recording::assignment::make_debug_string): New.
(gcc::jit::recording::assignment_op::make_debug_string): New.
(gcc::jit::recording::comment::make_debug_string): New.
(gcc::jit::recording::conditional::make_debug_string): New.
(gcc::jit::recording::place_label::make_debug_string): New.
(gcc::jit::recording::jump::make_debug_string): New.
(gcc::jit::recording::return_::make_debug_string): New.
(gcc::jit::recording::loop::make_debug_string): New.
(gcc::jit::recording::loop_end::make_debug_string): New.
2014-01-29 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_lvalue_access_field): Require
a (gcc_jit_field *) rather than a field name.
(gcc_jit_rvalue_access_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
* libgccjit.c (gcc_jit_lvalue_access_field): Require
a (gcc_jit_field *) rather than a field name.
(gcc_jit_rvalue_access_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
* internal-api.c (gcc::jit::recording::rvalue::access_field):
Require a field rather than a fieldname string.
(gcc::jit::recording::rvalue::dereference_field): Likewise.
(gcc::jit::recording::lvalue::access_field): Likewise.
(gcc::jit::recording::access_field_of_lvalue::replay_into): Update
given that this now has a field, rather than a fieldname.
(gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
(gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
(get_field): Delete, as we no longer need to convert
from (struct, identifier) pairs to fields, instead directly using
fields.
(gcc::jit::playback::context::new_field_access): Require a field
rather than a fieldname, removing the need to look up the field by
name within the struct.
(gcc::jit::playback::lvalue::access_field): Likewise.
(gcc::jit::playback::rvalue::access_field): Likewise.
(gcc::jit::playback::rvalue::dereference_field): Likewise.
* internal-api.h (gcc::jit::recording::rvalue::access_field):
Require a field rather than a fieldname string.
(gcc::jit::recording::rvalue::dereference_field): Likewise.
(gcc::jit::recording::lvalue::access_field): Likewise.
(gcc::jit::recording::access_field_of_lvalue::access_field_of_lvalue):
Likewise.
(gcc::jit::recording::access_field_of_lvalue::m_fieldname): Drop
string field in favor of...
(gcc::jit::recording::access_field_of_lvalue::m_field):
..."field" field, as it were.
(gcc::jit::recording::access_field_of_rvalue::access_field_of_rvalue):
Likewise.
(gcc::jit::recording::access_field_of_rvalue::m_fieldname): Drop
string field in favor of...
(gcc::jit::recording::access_field_of_rvalue::m_field):
..."field" field.
(gcc::jit::recording::dereference_field_rvalue::
dereference_field_rvalue): Likewise.
(gcc::jit::recording::dereference_field_rvalue::m_fieldname): Drop
string field in favor of...
(gcc::jit::recording::dereference_field_rvalue::m_field):
..."field" field.
(gcc::jit::playback::context::new_field_access): Require a field
rather than a fieldname string.
(gcc::jit::playback::context::access_field): Likewise.
(gcc::jit::playback::context::dereference_field): Likewise.
(gcc::jit::playback::rvalue::access_field):
2014-01-28 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_context_new_child_context): New function.
* libgccjit.map (gcc_jit_context_new_child_context): New function.
* libgccjit.c (gcc_jit_context): Make the constructor explicit,
with a parent context as a parameter.
(gcc_jit_context_acquire): Create context with a NULL parent.
(gcc_jit_context_new_child_context): New function, creating a
context with the given parent.
* internal-api.h (gcc::jit::recording::context::context): New
explicit constructor, taking a parent context as a parameter.
(gcc::jit::recording::context::m_parent_ctxt): New field.
* internal-api.c (gcc::jit::recording::context::context): New
explicit constructor, taking a parent context as a parameter.
(gcc::jit::recording::context::replay_into): Replay parent contexts
before replaying the context itself.
2014-01-27 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::playback::context::compile): Removal
of the code-creation callback (96b218c9a1d5f39fb649e02c0e77586b180e8516)
accidentally removed the implementation of
GCC_JIT_BOOL_OPTION_DUMP_GENERATED_CODE; reinstate it.
2014-01-27 David Malcolm <dmalcolm@redhat.com>
* internal-api (gcc::jit::recording::context::new_call): Verify
the argument count of the call against the parameter count of the
function, issuing an error if there's a mismatch.
* internal-api.h (gcc::jit::recording::function::get_name): New.
* (gcc::jit::recording::function::get_params): New.
* (gcc::jit::recording::function::is_variadic): New.
2014-01-27 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_binary_op): Remove
GCC_JIT_BINARY_OP_FLOATING_DIVIDE, which I accidentally added
as part of a880c0d9c642730550f39d328f29a1d9935cb07e.
2014-01-24 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h: Update comments to eliminate the code-creation
callback. All "contextual" objects change from merely being
"alive" during the callback to having a lifetime equal to that
of the context they are created within, with automatic cleanup
when the context is released.
(gcc_jit_code_callback): Delete.
(gcc_jit_context_set_code_factory): Delete.
* libgccjit.map (gcc_jit_context_set_code_factory): Delete.
* dummy-frontend.c (my_walker): Update for rename of the singleton
reference-owning context.
(jit_langhook_parse_file): Rather than run a client-provided
callback, we now replay a recording of the client activity.
* internal-api.h (gcc::jit): Split the existing API into two
copies...
(gcc::jit::recording): ...a class hierarchy used to implement
the client-facing API, which records the API calls made to it
and...
(gcc::jit::playback): ...a class hierarchy used within the
dummy GCC frontend, which plays back the recorded API calls once
GCC is initialized.
* internal-api.c (gcc::jit::recording::playback_location): New
API, in which client API calls are recorded as a list of "memento"
objects, to be played back into GCC when the dummy frontend runs.
(gcc::jit::recording::playback_string): Likewise.
(gcc::jit::recording::playback_label): Likewise.
(gcc::jit::recording::context::~context): Likewise.
(gcc::jit::recording::context::replay_into): Likewise.
(gcc::jit::recording::context::disassociate_from_playback): Likewise.
(gcc::jit::recording::context::new_string): Likewise.
(gcc::jit::recording::context::new_location): Likewise.
(gcc::jit::recording::context::get_type): Likewise.
(gcc::jit::recording::context::new_field): Likewise.
(gcc::jit::recording::context::new_struct_type): Likewise.
(gcc::jit::recording::context::new_param): Likewise.
(gcc::jit::recording::context::new_function): Likewise.
(gcc::jit::recording::context::new_global): Likewise.
(gcc::jit::recording::context::new_rvalue_from_int): Likewise.
(gcc::jit::recording::context::new_rvalue_from_double): Likewise.
(gcc::jit::recording::context::new_rvalue_from_ptr): Likewise.
(gcc::jit::recording::context::new_string_literal): Likewise.
(gcc::jit::recording::context::new_unary_op): Likewise.
(gcc::jit::recording::context::new_binary_op): Likewise.
(gcc::jit::recording::context::new_comparison): Likewise.
(gcc::jit::recording::context::new_call): Likewise.
(gcc::jit::recording::context::new_array_lookup): Likewise.
(gcc::jit::recording::string::string): Likewise.
(gcc::jit::recording::string::~string): Likewise.
(gcc::jit::recording::location::replay_into): Likewise.
(gcc::jit::recording::type::get_pointer): Likewise.
(gcc::jit::recording::type::get_const): Likewise.
(gcc::jit::recording::memento_of_get_type::replay_into): Likewise.
(gcc::jit::recording::memento_of_get_pointer::replay_into): Likewise.
(gcc::jit::recording::memento_of_get_const::replay_into): Likewise.
(gcc::jit::recording::field::replay_into): Likewise.
(gcc::jit::recording::struct_::replay_into): Likewise.
(gcc::jit::recording::rvalue::access_field): Likewise.
(gcc::jit::recording::rvalue::dereference_field): Likewise.
(gcc::jit::recording::rvalue::dereference): Likewise.
(gcc::jit::recording::lvalue::access_field): Likewise.
(gcc::jit::recording::lvalue::get_address): Likewise.
(gcc::jit::recording::param::replay_into): Likewise.
(gcc::jit::recording::function::function): Likewise.
(gcc::jit::recording::function::replay_into): Likewise.
(gcc::jit::recording::function::new_local): Likewise.
(gcc::jit::recording::function::new_forward_label): Likewise.
(gcc::jit::recording::function::add_eval): Likewise.
(gcc::jit::recording::function::add_assignment): Likewise.
(gcc::jit::recording::function::add_assignment_op): Likewise.
(gcc::jit::recording::function::add_comment): Likewise.
(gcc::jit::recording::function::add_conditional): Likewise.
(gcc::jit::recording::function::add_label): Likewise.
(gcc::jit::recording::function::place_forward_label): Likewise.
(gcc::jit::recording::function::add_jump): Likewise.
(gcc::jit::recording::function::add_return): Likewise.
(gcc::jit::recording::function::new_loop): Likewise.
(gcc::jit::recording::label::replay_into): Likewise.
(gcc::jit::recording::global::replay_into): Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_int::replay_into):
Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_double::replay_into):
Likewise.
(gcc::jit::recording::memento_of_new_rvalue_from_ptr::replay_into):
Likewise.
(gcc::jit::recording::memento_of_new_string_literal::replay_into):
Likewise.
(gcc::jit::recording::unary_op::replay_into): Likewise.
(gcc::jit::recording::binary_op::replay_into): Likewise.
(gcc::jit::recording::comparison::replay_into): Likewise.
(gcc::jit::recording::call::call): Likewise.
(gcc::jit::recording::call::replay_into): Likewise.
(gcc::jit::recording::array_lookup::replay_into): Likewise.
(gcc::jit::recording::access_field_of_lvalue::replay_into): Likewise.
(gcc::jit::recording::access_field_rvalue::replay_into): Likewise.
(gcc::jit::recording::dereference_field_rvalue::replay_into): Likewise.
(gcc::jit::recording::dereference_rvalue::replay_into): Likewise.
(gcc::jit::recording::get_address_of_lvalue::replay_into): Likewise.
(gcc::jit::recording::local::replay_into): Likewise.
(gcc::jit::recording::eval::replay_into): Likewise.
(gcc::jit::recording::assignment::replay_into): Likewise.
(gcc::jit::recording::assignment_op::replay_into): Likewise.
(gcc::jit::recording::comment::replay_into): Likewise.
(gcc::jit::recording::conditional::replay_into): Likewise.
(gcc::jit::recording::place_label::replay_into): Likewise.
(gcc::jit::recording::jump::replay_into): Likewise.
(gcc::jit::recording::return_::replay_into): Likewise.
(gcc::jit::recording::loop::replay_into): Likewise.
(gcc::jit::recording::loop::end): Likewise.
(gcc::jit::recording::loop_end::replay_into): Likewise.
(gcc::jit::recording::context::set_str_option): Likewise.
Option setting and error-handling is now "owned" by the recording
context; the playback context delegates to the recording context
for these aspects.
(gcc::jit::recording::context::set_int_option): Likewise.
(gcc::jit::recording::context::set_bool_option): Likewise.
(gcc::jit::recording::context::compile): Likewise.
(gcc::jit::recording::context::add_error): Likewise.
(gcc::jit::recording::context::add_error_va): Likewise.
(gcc::jit::recording::context::get_first_error): Likewise.
(gcc::jit::context::context): Rename to...
(gcc::jit::playback::context::context): ...this.
(gcc::jit::context::~context): Rename to...
(gcc::jit::playback::context::~context): ...this.
(gcc::jit::context::gt_ggc_mx): Rename to...
(gcc::jit::playback::context::gt_ggc_mx): ...this.
(gcc::jit::context::set_code_factory): Eliminate.
(gcc::jit::context::get_type): Rename to...
(gcc::jit::playback::context::get_type): ...this.
(gcc::jit::context::new_field): Rename to...
(gcc::jit::playback::context::new_field): ...this.
(gcc::jit::context::new_struct_type): Rename to...
(gcc::jit::playback::context::new_struct_type): ...this, and
update to require a vec<field *>.
(gcc::jit::context::new_param): Rename to...
(gcc::jit::playback::context::new_param): ...this.
(gcc::jit::context::new_function): Rename to...
(gcc::jit::playback::context::new_function): ...this, and update
to require a vec<param *>.
(gcc::jit::context::new_global): Rename to...
(gcc::jit::playback::context::new_global): ...this.
(gcc::jit::context::new_rvalue_from_int): Rename to...
(gcc::jit::playback::context::new_rvalue_from_int): ...this.
(gcc::jit::context::new_rvalue_from_double): Rename to...
(gcc::jit::playback::context::new_rvalue_from_double): ...this.
(gcc::jit::context::new_rvalue_from_ptr): Rename to...
(gcc::jit::playback::context::new_rvalue_from_ptr): ...this.
(gcc::jit::context::new_string_literal): Rename to...
(gcc::jit::playback::context::new_string_literal): ...this.
(gcc::jit::context::as_truth_value): Rename to...
(gcc::jit::playback::context::as_truth_value): ...this.
(gcc::jit::context::new_unary_op): Rename to...
(gcc::jit::playback::context::new_unary_op): ...this.
(gcc::jit::context::new_binary_op): Rename to...
(gcc::jit::playback::context::new_binary_op): ...this.
(gcc::jit::context::new_comparison): Rename to...
(gcc::jit::playback::context::new_comparison): ...this.
(gcc::jit::context::new_call): Rename to...
(gcc::jit::playback::context::new_call): ...this, and update
to require a vec<rvalue *>.
(gcc::jit::context::new_array_lookup): Rename to...
(gcc::jit::playback::context::new_array_lookup): ...this.
(gcc::jit::context::new_field_access): Rename to...
(gcc::jit::playback::context::new_field_access): ...this.
(gcc::jit::context::new_dereference): Rename to...
(gcc::jit::playback::context::new_dereference): ...this.
(gcc::jit::lvalue::access_field): Rename to...
(gcc::jit::playback::lvalue::access_field): ...this.
(gcc::jit::lvalue::get_address): Rename to...
(gcc::jit::playback::lvalue::get_address): ...this.
(gcc::jit::rvalue::dereference_field): Rename to...
(gcc::jit::playback::rvalue::dereference_field): ...this.
(gcc::jit::rvalue::dereference): Rename to...
(gcc::jit::playback::rvalue::dereference): ...this.
(gcc::jit::wrapper::operator new): Rename to...
(gcc::jit::playback::wrapper::operator new): ...this.
(gcc::jit::function::function): Rename to...
(gcc::jit::playback::function::function): ...this.
(gcc::jit::function::gt_ggc_mx): Rename to...
(gcc::jit::playback::function::gt_ggc_mx): ...this.
(gcc::jit::function::get_return_type_as_tree): Rename to...
(gcc::jit::playback::function::get_return_type_as_tree): ...this.
(gcc::jit::function::new_local): Rename to...
(gcc::jit::playback::function::new_local): ...this.
(gcc::jit::function::new_forward_label): Rename to...
(gcc::jit::playback::function::new_forward_label): ...this.
(gcc::jit::function::postprocess): Rename to...
(gcc::jit::playback::function::postprocess): ...this.
(gcc::jit::function::add_eval): Rename to...
(gcc::jit::playback::function::add_eval): ...this.
(gcc::jit::function::add_assignment): Rename to...
(gcc::jit::playback::function::add_assignment): ...this.
(gcc::jit::function::add_comment): Rename to...
(gcc::jit::playback::function::add_comment): ...this.
(gcc::jit::function::add_conditional): Rename to...
(gcc::jit::playback::function::add_conditional): ...this.
(gcc::jit::function::add_label): Rename to...
(gcc::jit::playback::function::add_label): ...this.
(gcc::jit::function::place_forward_label): Rename to...
(gcc::jit::playback::function::place_forward_label): ...this.
(gcc::jit::function::add_jump): Rename to...
(gcc::jit::playback::function::add_jump): ...this.
(gcc::jit::function::add_return): Rename to...
(gcc::jit::playback::function::add_return): ...this.
(gcc::jit::function::new_loop): Rename to...
(gcc::jit::playback::function::new_loop): ...this.
(gcc::jit::label::label): Rename to...
(gcc::jit::playback::label::label): ...this.
(gcc::jit::loop::loop): Rename to...
(gc::jit::playback::loop::loop): ...this.
(gcc::jit::loop::end): Rename to...
(gcc::jit::playback::loop): ...this.
(gcc::jit::active_jit_ctxt): Eliminate in favor of...
(gcc::jit::active_playback_ctxt): ...this.
(gcc::jit::context::compile): Rename to...
(gcc::jit::playback::context::compile): ...this, and eliminate the
mutex handling; this is done for us by the caller.
(gcc::jit::context::invoke_code_factory): Rename to...
(gcc::jit::playback::context::replay): this. Rather than call
a client-provided callback, instead replay the recorded API
calls.
(gcc::jit::context::dump_generated_code): Rename to...
(gcc::jit::playback::context::dump_generated_code): ...this.
(location_comparator): Update for renamed types.
(gcc::jit::context::handle_locations): Rename to...
(gcc::jit::playback::context::handle_locations): ...this.
(gcc::jit::context::add_error): Rename to...
(gcc::jit::playback::context::add_error): this, and delegate to
the recording context's add_error_va.
(gcc::jit::context::add_error_va): Rename to...
(gcc::jit::playback::context::add_error_va): this, and delegate
to the recording context.
(gcc::jit::context::new_location): Rename to...
(gcc::jit::playback::context::new_location): ...this.
(gcc::jit::context::set_tree_location): Rename to...
(gcc::jit::playback::context::set_tree_location): ...this.
(gcc::jit::context::get_source_file): Rename to...
(gcc::jit::playback::context::get_source_file): ...this.
(gcc::jit::source_file::source_file): Rename to...
(gcc::jit::playback::source_file::source_file): ...this.
(gcc::jit::source_file::get_source_line): Rename to...
(gcc::jit::playback::source_file::get_source_line): ...this.
(gcc::jit::source_line::source_line): Rename to...
(gcc::jit::playback::source_line::source_line): ...this.
(gcc::jit::source_line::get_location): Rename to...
(gcc::jit::playback::source_line::get_location): ...this.
(gcc::jit::location::location): Rename to...
(gcc::jit::playback::location::location): ...this.
* libgccjit.c: Update classes to derive from the "jit::recording"
class hierarchy.
(RETURN_IF_NOT_INITIAL_CTXT): Eliminate, as it relates to
code-creation callbacks.
(RETURN_NULL_IF_NOT_INITIAL_CTXT): Likewise.
(RETURN_NULL_IF_NOT_CALLBACK_CTXT): Likewise.
(jit_error): There isn't an "active jit context" anymore, except
during actual compilation, so simplify the logic here.
(gcc_jit_context_set_code_factory): Delete.
(gcc_jit_context_new_location): Update preconditions now that we
don't have code-creation callbacks.
(gcc_jit_context_get_type): Likewise.
(gcc_jit_type_get_pointer): Likewise.
(gcc_jit_type_get_const): Likewise.
(gcc_jit_context_new_field): Likewise.
(gcc_jit_context_new_struct_type): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_param_as_lvalue): Likewise.
(gcc_jit_param_as_rvalue): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_function_new_forward_label): Likewise.
(gcc_jit_context_new_global): Likewise.
(gcc_jit_lvalue_as_rvalue): Likewise.
(gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
(gcc_jit_context_new_string_literal): Likewise.
(gcc_jit_context_new_unary_op): Likewise.
(gcc_jit_context_new_binary_op): Likewise.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_array_lookup): Likewise.
(gcc_jit_context_set_str_option): Likewise.
(gcc_jit_context_set_int_option): Likewise.
(gcc_jit_context_set_bool_option): Likewise.
(gcc_jit_context_compile): Likewise.
(gcc_jit_function_add_assignment_op): Likewise. Also,
reimplement as a separate kind of recording, since we can't know
the type of the lvalue at recording-time.
* notes.txt: Update diagram to reflect the new implementation.
2014-01-24 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_binary_op): We will use the result
type to determine if GCC_JIT_BINARY_OP_DIVIDE should
truncate towards zero, or be floating-point division.
* internal-api.c (gcc::jit::context::new_binary_op): Likewise.
2014-01-24 David Malcolm <dmalcolm@redhat.com>
* internal-api.h (gcc::jit::context::get_str_option): New access
method.
(gcc::jit::context::get_int_option): Likewise.
* internal-api.c (gcc::jit::context::~context): Use access methods
for options, rather than direct field access.
(gcc::jit::context::compile): Likewise.
2014-01-23 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_bool_option): New value:
GCC_JIT_BOOL_OPTION_DUMP_GENERATED_CODE.
* internal-api.c (gcc::jit::context::compile): Call
dump_generated_code if the user has requested it.
(gcc::jit::context::dump_generated_code): New, copying
from the .s file to stderr.
* internal-api.h (gcc::jit::context::dump_generated_code): New.
2014-01-23 David Malcolm <dmalcolm@redhat.com>
* internal-api.h (gcc::jit::function): Add field
"m_inner_bind_expr".
* internal-api.c (gcc::jit::function::function): Create a BIND_EXPR
for all non-imported functions, and put the statement list within
it.
(gcc::jit::function::gt_ggc_mx): Visit m_inner_bind_expr.
(gcc::jit::function::new_local): Set the DECL_CONTEXT of the new
local to be the function's BIND_EXPR, and prepend the new local
to said BIND_EXPR's BIND_EXPR_VARS chain.
(gcc::jit::function::postprocess): Set the DECL_SAVED_TREE of the
FUNCTION_DECL to be the BIND_EXPR, rather than the statement list.
The latter is now contained within the former.
2014-01-23 David Malcolm <dmalcolm@redhat.com>
* internal-api.h (gcc::jit::function::add_stmt): New.
* internal-api.c (gcc::jit::function::add_eval): Replace use of
tsi_link_stmt with call to add_stmt.
(gcc::jit::function::add_assignment): Likewise.
(gcc::jit::function::add_conditional): Likewise.
(gcc::jit::function::place_forward_label): Likewise.
(gcc::jit::function::add_jump): Likewise.
(gcc::jit::function::add_return): Likewise.
2014-01-21 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::function::add_comment): New.
* internal-api.h (gcc::jit::function::add_comment): New.
* libgccjit.c (gcc_jit_function_add_comment): New.
* libgccjit.h (gcc_jit_function_add_comment): New.
* libgccjit.map: Add gcc_jit_function_add_comment.
2013-10-24 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::function::add_eval): Handle non-NULL
locations.
(gcc::jit::context::handle_locations): Fix test for the various
kinds of declarations, replacing use of DECL_MINIMAL_CHECK,
which aborts on failure (such as if we saw a type).
* libgccjit.h (GCC_JIT_BOOL_OPTION_DEBUGINFO): Fix out-of-date
comment.
2013-10-23 David Malcolm <dmalcolm@redhat.com>
* internal-api.c: Update for rename of tree-flow.h to tree-cfg.h
in r203320, for declaration of dump_function_to_file.
* TODO.rst ("segfault seen in libbacktrace"): Remove - this was
fixed by Ian in r203810.
2013-10-23 David Malcolm <dmalcolm@redhat.com>
* internal-api.c: Add missing include of diagnostic-core.h
2013-10-22 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::add_error_va): Record the
first error that occurs on a context.
(gcc::jit::context::get_first_error): New.
* internal-api.h (gcc::jit::context::get_first_error): New.
(gcc::jit::context::m_first_error_str): New.
* libgccjit.c (gcc_jit_context_get_first_error): New.
* libgccjit.h (gcc_jit_context_get_first_error): New.
* libgccjit.map (gcc_jit_context_get_first_error): New.
2013-10-21 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::compile): Correctly cleanup
timevars in error-handling, preventing an issue where an error
on a context left timevar.c in an unstopped state, leading to an
assertion failure when restarting timevars in the next compile.
Found via fuzz-testing.
2013-10-21 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::postprocess): Show source
line numbers (if any) in gimple dump.
2013-10-21 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_function_new_local): Use a more clear
error message for the case where someone tries to add a local
to a function imported from elsewhere.
2013-10-21 David Malcolm <dmalcolm@redhat.com>
* TODO.rst ("the C unary prefix "&" operator"): Remove completed item.
* internal-api.c (gcc::jit::lvalue::get_address): New.
* internal-api.h (gcc::jit::lvalue::get_address): New.
* libgccjit.c (gcc_jit_lvalue_get_address): New.
* libgccjit.h (gcc_jit_lvalue_get_address): New.
* libgccjit.map (gcc_jit_lvalue_get_address): New.
2013-10-18 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::new_param): Add context
argument to ctor for rvalue and its subclasses.
(gcc::jit::context::new_global): Likewise.
(gcc::jit::context::new_rvalue_from_int): Likewise.
(gcc::jit::context::new_rvalue_from_double): Likewise.
(gcc::jit::context::new_rvalue_from_ptr): Likewise.
(gcc::jit::context::new_string_literal): Likewise.
(gcc::jit::context::new_call): Likewise.
(gcc::jit::context::new_array_lookup): Likewise.
(gcc::jit::function::new_local): Likewise.
(gcc::jit::context::new_binary_op): Likewise; add new
operations.
(gcc::jit::context::new_comparison): Likewise; add new
comparisons.
(gcc::jit::context::as_truth_value): New.
(gcc::jit::context::new_unary_op): New.
(gcc::jit::context::new_field_access): Convert to a helper
method for use by the access_fields methods.
(gcc::jit::context::new_dereference): New.
(gcc::jit::lvalue::access_field): New.
(gcc::jit::rvalue::access_field): New.
(gcc::jit::rvalue::dereference_field): New.
(gcc::jit::rvalue::dereference): New.
* internal-api.h (gcc::jit::context::new_unary_op): New.
(gcc::jit::context::new_field_access): Work
(gcc::jit::context::new_dereference): New.
(gcc::jit::context::as_truth_value): New.
(gcc::jit::rvalue): Add a context field.
(gcc::jit::rvalue::access_field): New.
(gcc::jit::rvalue::dereference_field): New.
(gcc::jit::rvalue::dereference): New.
(gcc::jit::lvalue::lvalue): Add context to ctor.
(gcc::jit::lvalue::access_field): New.
(gcc::jit::param::param): Add context to ctor.
* libgccjit.c (gcc_jit_context_new_unary_op): New.
(gcc_jit_context_new_field_access): Remove.
(gcc_jit_lvalue_access_field): New.
(gcc_jit_rvalue_access_field): New.
(gcc_jit_rvalue_dereference_field): New.
(gcc_jit_rvalue_dereference): New.
*libgccjit.h (enum gcc_jit_unary_op): New.
(gcc_jit_context_new_unary_op): New.
(enum gcc_jit_binary_op): Document values, and add...
(GCC_JIT_BINARY_OP_DIVIDE): New.
(GCC_JIT_BINARY_OP_MODULO): New.
(GCC_JIT_BINARY_OP_BITWISE_AND): New.
(GCC_JIT_BINARY_OP_BITWISE_XOR): New.
(GCC_JIT_BINARY_OP_BITWISE_OR): New.
(GCC_JIT_BINARY_OP_LOGICAL_AND): New.
(GCC_JIT_BINARY_OP_LOGICAL_OR): New.
(enum gcc_jit_comparison): Document values, and add...
(GCC_JIT_COMPARISON_EQ): New.
(GCC_JIT_COMPARISON_NE): New.
(GCC_JIT_COMPARISON_LE): New.
(GCC_JIT_COMPARISON_GT): New.
(GCC_JIT_COMPARISON_GE): New.
(gcc_jit_context_new_field_access): Remove.
(gcc_jit_lvalue_access_field): New.
(gcc_jit_rvalue_access_field): New.
(gcc_jit_rvalue_dereference_field): New.
(gcc_jit_rvalue_dereference): New.
* libgccjit.map (gcc_jit_context_new_field_access): Remove.
(gcc_jit_lvalue_access_field): New.
(gcc_jit_rvalue_access_field): New.
(gcc_jit_rvalue_dereference_field): New.
(gcc_jit_rvalue_dereference): New.
* TODO.rst: Update
2013-10-18 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::get_type): Improve error
message, and report the bogus value.
(gcc::jit::context::new_binary_op): Likewise.
(gcc::jit::context::new_comparison): Likewise.
(gcc::jit::context::set_str_option): Likewise.
(gcc::jit::context::set_int_option): Likewise.
(gcc::jit::context::set_bool_option): Likewise.
(gcc::jit::context::compile): Likewise, and make the errors
block the creation of result, rather than just the return
value of the client callback.
(gcc::jit::context::add_error): Add varargs and provide
implementation, calling into...
(gcc::jit::context::add_error_va): New.
* internal-api.h (GNU_PRINTF): New.
(gcc::jit::context::add_error): Add varargs and GNU_PRINTF
attribute macro.
(gcc::jit::context::add_error_va): New.
(gcc::jit::context::errors_occurred): New.
(gcc::jit::context::m_error_count): New.
(gcc::jit::function::get_kind): New.
* libgccjit.c (JIT_BEGIN_STMT): New.
(JIT_END_STMT): New.
(RETURN_VAL_IF_FAIL): New.
(RETURN_NULL_IF_FAIL): New.
(RETURN_IF_FAIL): New.
(RETURN_IF_NOT_INITIAL_CTXT): New.
(RETURN_NULL_IF_NOT_INITIAL_CTXT): New.
(RETURN_NULL_IF_NOT_CALLBACK_CTXT): New.
(RETURN_IF_NOT_FUNC_DEFINITION): New.
(RETURN_NULL_IF_NOT_FUNC_DEFINITION): New.
(jit_error): New.
(gcc_jit_context_set_code_factory): Use new error-checking
macros.
(ASSERT_WITHIN_CALLBACK): Remove.
(ASSERT_NOT_WITHIN_CALLBACK): Remove.
(gcc_jit_context_new_location): Use new error-checking macros.
(gcc_jit_context_get_type): Likewise.
(gcc_jit_type_get_pointer): Likewise.
(gcc_jit_type_get_const): Likewise.
(gcc_jit_context_new_field): Likewise.
(gcc_jit_context_new_struct_type): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_param_as_lvalue): Likewise.
(gcc_jit_param_as_rvalue): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_function_new_forward_label): Likewise.
(gcc_jit_context_new_global): Likewise.
(gcc_jit_lvalue_as_rvalue): Likewise.
(gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
(gcc_jit_context_new_string_literal): Likewise.
(gcc_jit_context_new_binary_op): Likewise.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_array_lookup): Likewise.
(gcc_jit_context_new_field_access): Likewise.
(gcc_jit_function_new_local): Likewise.
(gcc_jit_function_add_label): Likewise.
(gcc_jit_function_place_forward_label): Likewise.
(gcc_jit_function_add_eval): Likewise.
(gcc_jit_function_add_assignment): Likewise.
(gcc_jit_function_add_assignment_op): Likewise.
(gcc_jit_function_add_conditional): Likewise.
(gcc_jit_function_add_jump): Likewise.
(gcc_jit_function_add_return): Likewise.
(gcc_jit_function_new_loop): Likewise.
(gcc_jit_loop_end): Likewise.
(gcc_jit_context_set_str_option): Likewise.
(gcc_jit_context_set_int_option): Likewise.
(gcc_jit_context_set_bool_option): Likewise.
(gcc_jit_context_compile): Likewise.
(gcc_jit_result_get_code): Likewise.
(gcc_jit_result_release): Likewise.
* libgccjit.h (gcc_jit_function_new_forward_label): Clarify
behavior.
(gcc_jit_function_add_label): Likewise.
2013-10-17 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::get_void_type): Remove.
(gcc::jit::context::get_char_type): Remove.
(gcc::jit::context::get_int_type): Remove.
(gcc::jit::context::get_float_type): Remove.
(gcc::jit::context::get_double_type): Remove.
(get_tree_node_for_type): New.
(gcc::jit::context::get_type): New.
(gcc::jit::context::new_rvalue_from_double): New.
(gcc::jit::context::new_rvalue_from_ptr): New.
* internal-api.h (gcc::jit::context::get_void_type): Remove.
(gcc::jit::context::get_char_type): Remove.
(gcc::jit::context::get_int_type): Remove.
(gcc::jit::context::get_float_type): Remove.
(gcc::jit::context::get_double_type): Remove.
(gcc::jit::context::get_type): New.
(gcc::jit::context::new_rvalue_from_double): New.
(gcc::jit::context::new_rvalue_from_ptr): New.
* libgccjit.c (gcc_jit_context_get_void_type): Remove.
(gcc_jit_context_get_char_type): Remove.
(gcc_jit_context_get_int_type): Remove.
(gcc_jit_context_get_float_type): Remove.
(gcc_jit_context_get_double_type): Remove.
(gcc_jit_context_get_type): New.
(gcc_jit_context_new_rvalue_from_double): New.
(gcc_jit_context_new_rvalue_from_ptr): New.
* libgccjit.h (gcc_jit_context_get_void_type): Remove.
(gcc_jit_context_get_char_type): Remove.
(gcc_jit_context_get_int_type): Remove.
(gcc_jit_context_get_float_type): Remove.
(gcc_jit_context_get_double_type): Remove.
(enum gcc_jit_types): New.
(gcc_jit_context_get_type): New.
(gcc_jit_context_new_rvalue_from_double): New.
(gcc_jit_context_new_rvalue_from_ptr): New.
* libgccjit.map (gcc_jit_context_get_void_type): Remove.
(gcc_jit_context_get_char_type): Remove.
(gcc_jit_context_get_int_type): Remove.
(gcc_jit_context_get_float_type): Remove.
(gcc_jit_context_get_double_type): Remove.
(enum gcc_jit_types): New.
(gcc_jit_context_get_type): New.
(gcc_jit_context_new_rvalue_from_double): New.
(gcc_jit_context_new_rvalue_from_ptr): New.
* TODO.rst ("access to more primitive types"): Remove
completed item.
2013-10-17 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h: Add and reword comments throughout.
2013-10-17 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Update.
2013-10-16 David Malcolm <dmalcolm@redhat.com>
* TODO.rst (gcc_jit_context_new_local): Remove completed item.
* internal-api.c (gcc::jit::context::new_local): Replace with...
(gcc::jit::function::new_local): ...this, and change return type
from (local*) to (lvalue*).
* internal-api.h (gcc::jit::local): Eliminate.
(gcc::jit::context::new_local): Replace with...
(gcc::jit::function::new_local): ...this, and change return type
from (local*) to (lvalue*).
* libgccjit.c (gcc_jit_local): Eliminate.
(gcc_jit_context_new_local): Replace with...
(gcc_jit_function_new_local): ...this, and change return type
from (gcc_jit_local*) to (gcc_jit_lvalue*).
(gcc_jit_local_as_lvalue): Remove.
(gcc_jit_local_as_rvalue): Remove.
* libgccjit.h (gcc_jit_local): Remove.
(gcc_jit_context_new_local): Replace with...
(gcc_jit_function_new_local): ...this, and change return type
from (gcc_jit_local*) to (gcc_jit_lvalue*).
(gcc_jit_local_as_lvalue): Remove.
(gcc_jit_local_as_rvalue): Remove.
* libgccjit.map (gcc_jit_context_new_local): Replace with...
(gcc_jit_function_new_local): ...this.
(gcc_jit_local_as_lvalue): Remove.
(gcc_jit_local_as_rvalue): Remove.
2013-10-15 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (gcc_jit_location): Rewrite comment to reflect
that this part of the API is now implemented.
("Functions for use within the code factory."): Add notes on
memory-management and lifetimes.
* notes.txt: Update diagram to show handle_locations.
2013-10-15 David Malcolm <dmalcolm@redhat.com>
* TODO.rst: Update.
2013-10-14 David Malcolm <dmalcolm@redhat.com>
* libgccjit.map: Alphabetize the exported symbols.
2013-10-14 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::new_field): Implement
location support, by calling set_tree_location.
(gcc::jit::context::new_struct_type): Likewise.
(gcc::jit::context::new_param): Likewise.
(gcc::jit::context::new_function): Likewise.
(gcc::jit::context::new_global): Likewise.
(gcc::jit::context::new_local): Likewise.
(gcc::jit::context::new_binary_op): Likewise.
(gcc::jit::context::new_comparison): Likewise.
(gcc::jit::context::new_call): Likewise.
(gcc::jit::context::new_array_lookup): Likewise.
(gcc::jit::context::new_field_access): Likewise.
(gcc::jit::context::add_assignment): Likewise.
(gcc::jit::context::add_conditional): Likewise.
(gcc::jit::function::add_label): Likewise.
(gcc::jit::function::add_jump): Likewise.
(gcc::jit::function::add_return): Likewise.
(gcc::jit::function::place_forward_label): Likewise, adding
location parameter.
(gcc::jit::loop::loop): Add loc arg to place_forward_label.
(gcc::jit::loop::end): Likewise.
(gcc::jit::context::invoke_code_factory): Call handle_locations
after the client callback is done, before any GC can run.
(line_comparator): New.
(location_comparator): New.
(gcc::jit::context::handle_locations): New.
(gcc::jit::context::new_location): New.
(gcc::jit::context::set_tree_location): New.
(gcc::jit::context::get_source_file): New.
(gcc::jit::source_file::source_file): New.
(gcc::jit::source_file::get_source_line): New.
(gcc::jit::source_line::source_line): New.
(gcc::jit::source_line::get_location): New.
(gcc::jit::location::location): New.
* internal-api.h (gcc::jit::context::new_location): New.
(gcc::jit::context::set_tree_location): New.
(gcc::jit::context::handle_locations): New.
(gcc::jit::context::get_source_file): New.
(gcc::jit::context::m_source_files): New field.
(gcc::jit::context::m_cached_locations: New field.
(gcc::jit::function::place_forward_label): Add location
parameter.
(gcc::jit::function::set_tree_location): New.
(gcc::jit::source_file): New class.
(gcc::jit::source_line): New class.
(gcc::jit::location): New class.
* libgccjit.c (gcc_jit_context_new_location): New.
(gcc_jit_function_place_forward_label): Add location parameter,
changing public API.
* libgccjit.h (gcc_jit_context_new_location): New.
(gcc_jit_function_place_forward_label): Add location parameter,
changing public API.
* libgccjit.map (gcc_jit_context_new_location): New.
(main): Remove obsolete export.
(called_function): Likewise.
2013-10-11 David Malcolm <dmalcolm@redhat.com>
* internal-api.c: Update includes to reflect move of decl of
dump_function_to_file from tree-dump.h to tree-flow.h in
r203320.
2013-10-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (GCC_JIT_BOOL_OPTION_DUMP_SUMMARY): New.
* internal-api.c ((gcc::jit::context::compile): Implement
GCC_JIT_BOOL_OPTION_DUMP_SUMMARY.
2013-10-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (GCC_JIT_BOOL_OPTION_SELFCHECK_GC): Improve
documentation.
(GCC_JIT_BOOL_OPTION_DUMP_INITIAL_GIMPLE): Likewise.
2013-10-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h: Clarify the separation of the API into "outside
the callback" and "within the callback" entrypoints, moving the
latter to the bottom of the header.
2013-10-10 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h: Add comments throughout.
2013-10-09 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::~context): Fix indentation;
clean up memory allocations when using
GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
2013-10-09 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_bool_option): Add
GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING.
* internal-api.c (gcc::jit::context::compile): Implement
GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING.
2013-10-09 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (enum gcc_jit_bool_option): Add
GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
* internal-api.c (gcc::jit::context::~context): Implement
GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES.
2013-10-08 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::compile): Use mkdtemp to
create a temporary directory and create the .s and .so files
there, rather than writing to "fake.s" and then reading it to
make "fake.so", then using it, fixing various possible race
attacks by processes that can write to the process' current
working directory.
(gcc::jit::context::~context): Clean up tempfiles and path
buffers.
* internal-api.h (gcc::jit::context): Add fields
m_path_template, m_path_tempdir, m_path_c_file, m_path_s_file,
m_path_so_file.
2013-10-08 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::new_function): Fix leak of
arg_types.
2013-10-08 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::~context): New.
* internal-api.h (gcc::jit::context::~context): New.
2013-10-07 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::compile): Implement
GCC_JIT_BOOL_OPTION_SELFCHECK_GC.
* libgccjit.h (enum gcc_jit_bool_option): Add
GCC_JIT_BOOL_OPTION_SELFCHECK_GC.
2013-10-07 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in: Rename JIT_OBJS to jit_OBJS. Delete manual
dependencies.
2013-10-04 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::context::new_global): New.
* internal-api.h (gcc::jit::context::new_global): New.
* libgccjit.c (gcc_jit_context_new_global) New.
* libgccjit.h (gcc_jit_context_new_global) New.
* libgccjit.map: Add gcc_jit_context_new_global.
2013-10-03 David Malcolm <dmalcolm@redhat.com>
* libgccjit.c (gcc_jit_param_as_lvalue): New.
* libgccjit.h (gcc_jit_param_as_lvalue): New.
* libgccjit.map: Add gcc_jit_param_as_lvalue.
2013-10-03 David Malcolm <dmalcolm@redhat.com>
* internal-api.c (gcc::jit::function::postprocess): Dump gimple
using dump_function_to_file rather than debug_gimple_seq so that
we also get the declaration.
2013-10-03 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in: New.
* TODO.rst: New.
* config-lang.in: New.
* dummy-frontend.c: New.
* internal-api.c: New.
* internal-api.h: New.
* libgccjit.c: New.
* libgccjit.h: New.
* libgccjit.map: New.
* notes.txt: New.
Copyright (C) 2013-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
|