1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
|
2006-03-09 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
`prepared' flag is set.
* generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
(LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
issues; see gtest-254.cs.
2006-03-07 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.InferType): Allow infering
`IEnumerable<T>' with an array of T; see gtest-251.cs.
2006-03-06 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeManager.InferType): Fix gtest-250.cs.
* typemanager.cs
(TypeManager.IsSubclassOf): Also check the base class.
* expression.cs
(Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
fixes gtest-249.cs.
2006-02-16 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeManager.GetGenericFieldDefinition): New public method; use it
instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2006-02-14 Martin Baulig <martin@ximian.com>
* *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2006-02-14 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeManager.DropGenericMethodArguments): New public method; don't
use GetGenericMethodDefinition() on something which is not a
generic method.
2006-02-14 Martin Baulig <martin@ximian.com>
* generic.cs
(ConstraintChecker.CheckConstraints): If a type parameter has the
`struct' constraint, the type must be a non-nullable valuetype.
2006-02-10 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.IsOverride): Make this work for instantiated methods
in a generic class; fixes #77509.
(TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
rather than calling it directly; fixes #77488.
2006-02-06 Miguel de Icaza <miguel@novell.com>
* codegen.cs (EmitScopeInitFromBlock): check here the
capture_context, there is no need to make two calls to the
EmitContext.
* anonymous.cs: Add some debugging messages that might help me
track other instances of this problem in the future (the
regression of test 467).
* cs-parser.jay: track the variable block, as we need to initalize
any captured variables declared in this block for the "catch"
portion of the "Try" statement.
* statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
scope initialization for captured variables.
Also, move the emit for the variables after the block location has
been marked.
2006-02-06 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2006-02-07 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeManager.IsGenericMethod): We now return whether something is
an instantiated generic method (and not a generic method def).
(TypeManager.IsGenericMethodDefinition): New public method.
* typemanager.cs
(TypeManager.CSharpSignature): Only include type arguments for
"real" generic methods, not for any instantiated method.
(TypeManager.GetMethodName): Likewise, but also allow generic
method definitions here.
2006-02-06 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): If we're a struct, pass
`TypeManager.value_type' as parent type to
ModuleBuilder.DefineType(). Fixes #77358.
2006-02-02 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
commit yesterday, the initialization for the roots is necessary.
What is not necessary is the scope activation.
2006-02-02 Raja R Harinath <rharinath@novell.com>
* ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
* expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
CS0206 checks.
(Argument.Resolve): Remove CS0206 checks.
2006-02-01 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
scopes for all the roots, the scopes will now be emitted when the
Blocks are entered. [This change was wrong, fixed on 2006-02-02]
(CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
code. This reduces a lot of existing cruft.
* statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
that the ScopeInfo is generated as we enter the scope, not at the
time of use, which is what we used to do before.
* codegen.cs (EmitScopeInitFromBlock): New routine, this is called
every time a Block is about to be emitted if we have a
CaptureContext.
2006-02-01 Raja R Harinath <rharinath@novell.com>
* codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
attribute for mscorlib too.
* typemanager.cs (NoTypes, NoTypeExprs): Remove.
(Reset): Update.
* *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
* typemanager.cs (cons_param_array_attribute): Make private.
(Reset): Set it to null.
(InitCoreHelpers): Don't initialize it.
(ConsParamArrayAttribute): New. Initialize it as needed.
* parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2006-01-31 Miguel de Icaza <miguel@novell.com>
* expression.cs: There might be errors reported during the
selection of applicable methods. If there are errors, do not
continue execution as it will lead the compiler to crash.
2006-01-30 Miguel de Icaza <miguel@novell.com>
* expression.cs: Member access is not allowed on anonymous
methods. Fixes #77402.
2006-01-30 Raja R Harinath <rharinath@novell.com>
Fix #77401
* cs-parser.jay (VariableDeclaration): Don't set
current_array_type to null.
(field_declaration, event_declaration, declaration_statement):
Set it to null here.
2006-01-29 Raja R Harinath <harinath@gmail.com>
Fix part of #77397
* generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2006-01-28 Raja R Harinath <harinath@gmail.com>
* typemanager.cs (GenericParameterPosition): New.
* doc.cs: Use it.
2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : To process "include" elements, first we should create
another list than XmlNodeList, because it could result in node
removal, which could result in that the XmlNodeList gives up
yielding next node.
2006-01-25 Miguel de Icaza <miguel@novell.com>
* expression.cs: Introduce an error report that we were not
catching before. Gonzalo ran into it.
2006-01-23 Miguel de Icaza <miguel@novell.com>
A fix for bug: #76957
* iterators.cs (MoveNextMethod.CreateMethodHost): call
ComputeMethodHost before creating the method, this is a new
requirement.
* anonymous.cs (AnonymousContainer): Now we track all the scopes
that this method references (RegisterScope). The actual scope
where the method is hosted is computed with the ComputeMethodHost
before we create the method.
Moved the Deepest routine here.
(AnonymousContainer.ComputeMethodHost): New routine used to
compute the proper ScopeInfo that will host the anonymous method.
(ScopeInfo): Deal with multiple roots. The problem was that we
did not have a unique root where all ScopeInfos could be hanged
from. Remove `topmost' ScopeInfo, and instead keep an arraylist
of roots.
Remove AdjustMethodScope which is now computed at the end. Remove
LinkScope which did a partial link, instead link all ScopeInfos
before code generation from the new "LinkScopes" routine.
Simplify all the Add* routines as they no longer need to maintain
the tree, they just need to record that they are using variables
from a ScopeInfo.
(IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
routines to produce the forest of ScopeInfo trees.
* class.cs (TypeContainer.AppendMethod): This is just like
AddMethod, but ensures that an interface implementation method
(IEnumerable.XXX) is not inserted at the beginning of the queue of
methods, but at the end.
We use this functionality to ensure that the generated MoveNext
method in the iterator class is resolved/emitted before the
enumerator methods created.
This is required because the MoveNext method computes the right
ScopeInfo for the method. And the other methods will eventually
need to resolve and fetch information computed from the anonymous
method.
2006-01-23 Raja R Harinath <rharinath@novell.com>
Improve implementation of section 14.4.2.2 (Better function member).
* expression.cs (Invocation.MoreSpecific): Compare all type
arguments before deciding if one type is more specific than
another. Handle array types too. Return the more specific type.
(Invocation.BetterFunction): Add more tie-breaking rules from
section 14.4.2.2. Perform "more specific" check after
other tie-breaking rules. Compare all parameter types before
choosing the "more specific" method.
2006-01-21 Raja R Harinath <harinath@gmail.com>
Carlos Alberto Cortez <calberto.cortez@gmail.com>
Fix rest of #76995.
* namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
the 'aliases' hash.
(NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
(NamespaceEntry.VerifyUsing): Resolve external aliases too.
2006-01-18 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.AddToMemberContainer): Use
`symbol.MemberName.MethodName' instead of just `symbol.Name';
fixes #77124.
2006-01-18 Martin Baulig <martin@ximian.com>
Fix #76417: a generic class may now have methods which may unify
for some type parameter substitutions.
* class.cs (Method.IsDuplicateImplementation): Don't report CS0408
for methods which may unify anymore.
* expression.cs (Invocation.MoreSpecific): New private static
method; checks whether one method is more specific than another
according to 14.4.2.2 of the spec.
(Invocation.BetterFunction): Implement the tie-breaking rules from
14.4.2.2 of the spec: if two methods unify for some type parameter
substitution, we need to pick the more specific one.
2006-01-18 Raja R Harinath <rharinath@novell.com>
Fix #76656, cs0231-2.cs.
* cs-parser.jay (formal_parameter_list): Make error case catch
more issues.
(parenthesized_expression_0): Add CS1026 check.
(invocation_expression): Remove unused { $$ = lexer.Location }.
2006-01-17 Raja R Harinath <rharinath@novell.com>
Fix #76824.
* cs-parser.jay (statement_expression): Don't list out the
individual statement-expressions. Convert syntax error into
CS0201 check.
2006-01-16 Raja R Harinath <rharinath@novell.com>
Fix #76874.
* ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
(UnboxCast.DoResolveLValue): New. Move CS0445 check from
CheckIntermediateModification.
(FieldExpr.DoResolve): Add new two-argument version that
allows us to resolve the InstanceExpression as an lvalue.
The one-argument variant is now just a wrapper.
(FieldExpr.DoResolveLValue): Use two-argument DoResolve.
Resolve the lhs as an lvalue if the it has a value type.
(FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
from Assign.DoResolve.
(PropertyExpr.InstanceResolve): Allow InstanceExpression to be
resolved as an lvalue.
(PropertyExpr.DoResolve): Update.
(PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
has a value type. Move CS1612 check here from
CheckIntermediateModification.
* assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
* expression.cs (EmptyExpression.OutAccess): New. Used as the
'right_side' of a ResolveLValue on an 'out' argument.
(EmptyExpression.LValueMemberAccess): New. Used as the
'right_side' of a propagated ResolveLValue on a value type.
(LocalVariableReference.DoResolveBase): Recognize
EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
Add CS1654 check.
(Argument.Resolve): Use EmptyExpression.OutAccess rather than
EmptyExpression.Null.
2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
* typemanager.cs : added IsGenericParameter(). In gmcs it returns
Type.IsGenericParameter(). Fixed bug #77183.
* doc.cs : it is now identical to doc.cs in mcs.
2006-01-16 Martin Baulig <martin@ximian.com>
* generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2006-01-16 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.CSharpSignature): Make this work for
ctors; fixes #77250.
2006-01-12 Miguel de Icaza <miguel@novell.com>
This fixes the problem where we used ldfld instead of ldflda to
load the "THIS" pointer on captured parameters, when THIS is a
value type. See bug #77205.
* iterators.cs (CapturedThisReference.Emit): Pass false to
EmitThis (we do not need the address).
* codegen.cs (EmitThis): it needs to know whether we need the
address of `this' or not. This is used by value types.
* expression.cs (This.AddressOf): Pass true to the EmitThis call,
every other call passes false.
2006-01-12 Raja R Harinath <rharinath@novell.com>
Fix #77221.
* typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
GetOverride.
* expression.cs (Invocation.OverloadResolve): Update.
(Invocation.DoResolve): Avoid double resolution of invocation.
2006-01-11 Raja R Harinath <rharinath@novell.com>
Fix #77180.
* expression.cs (Unary.Emit): When in /checked+ mode, don't emit
unary negation of floating point types as 0-expr; negation cannot
overflow in floating point types.
Fix #77204.
* expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
on operands of 'void' type.
Fix #77200.
* cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
and ExclusiveOr for boolean constants too.
2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
* expression.cs: Fix Console.WriteLine ((this = x).foo);
2006-01-12 Miguel de Icaza <miguel@novell.com>
* cs-tokenizer.cs (Position): New class used to save and restore
the position state in the tokenizer. Before this patch the save
and restore was not complete enough so the line and columns would
start to drift and the debugger and stack traces will get the
wrong data.
2006-01-10 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeParameter.InflateConstraints): New public method.
* iterators.cs (Iterator.DefineNestedTypes): Also inflate the
constraints; fixes #77042.
2006-01-10 Martin Baulig <martin@ximian.com>
* anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
instead of the `TypeBuilder' for this "<>THIS" variable; fixes
#77061.
2006-01-09 Raja R Harinath <rharinath@novell.com>
Fix #75636.
* expression.cs (Invocation.OverloadResolve): Replace reflected
override methods with their base virtual methods, rather than
skipping over them.
* typemanager.cs (TypeManager.GetOverride): New.
2005-12-21 Miguel de Icaza <miguel@novell.com>
* driver.cs: Report the case of no source files and no -out:
argument provided.
2005-12-20 Raja R Harinath <rharinath@novell.com>
Fix #77035.
* expression.cs (ComposedCast.GetSignatureForError): Define.
2006-01-05 Jb Evain <jbevain@gmail.com>
* class.cs (Property.Define, Indexer.Define): do not tag the
properties as SpecialName | RTSpecialName.
2006-01-04 Miguel de Icaza <miguel@novell.com>
* class.cs (MethodCore.IsDuplicateImplementation): This method was
doing a low-level comparission of parameter types. It was lacking
a check for __argslist.
2005-12-30 Miguel de Icaza <miguel@novell.com>
* expression.cs (ParameterReference.DoResolveBase): Allow
reference parameters if they are local to this block.
This allows the ref and out parameters of a delegate to be used in
an anonymous method, for example:
delegate void set (out int x);
set s = delegate (out int x){
x = 0;
};
This is used by functionality introduced late in the C# language.
* anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
method that take ref and out parameters.
Fixes #77119 which was a late change in the spec.
2005-12-23 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
parent if its the same scope. Fixes #77060.
2005-12-22 Marek Safar <marek.safar@seznam.cz>
* expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
errors 1726 for strong named assemblies with InternalsVisibleToAttribute
that doesn't contain the full public key. This is a update of the
friend assemblies in .Net 2.0 release.
2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
Fix #76995
* namespace.cs (NamespaceEntry): Add extern_aliases as a
ListDictionary, to contain the ExternAliasEntry entries (in
addition to the NamespaceEntry.aliases hashtable). This field is
shared between the original entry and its doppelganger (bodyless
copy of it).
(NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
extern_aliases field.
(NamespaceEntry.Lookup): Move the IsImplicit check after the
lookup in extern_aliases.
2005-12-16 Raja R Harinath <rharinath@novell.com>
Fix #77006.
* class.cs (TypeContainer.Mark_HasEquals): New.
(TypeContainer.Mark_HasGetHashCode): New.
(ClassPart): Override them.
(MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
* generic.cs (GenericMethod.DefineMembers): Update to changes.
(TypeParameter.TypeParameter): Change type of 'parent' argument to
DeclSpace.
Fix #77008.
* enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
'parent' argument to the base constructor.
Remove all mention of TypeContainer from decl.cs.
* decl.cs (MemberCore.Parent): Change into a DeclSpace.
(MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
(DeclSpace.DeclSpace): Likewise.
(DeclSpace.DefineMembers): Remove unused argument.
* cs-parser.jay (pop_current_class): Update to changes. Simplify
debugging check -- we don't care if the debug code throws an
InvalidCastException instead of an InternalErrorException.
* class.cs (TypeContainer.DefineMembers): Update to changes.
(TypeContainer.DoDefineMembers): Likewise.
(TypeContainer.GetMethods): Likewise.
(PropertyMember.Define): Likewise.
(MemberBase.Parent): New property that forwards to
MemberCore.Parent, but ensures that we get a TypeContainer.
* rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
(RootContext.PopulateTypes): Likewise. Remove special case code
for !RootContext.StdLib: DefineMembers is idempotent.
2005-12-13 Marek Safar <marek.safar@seznam.cz>
* class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : The search for referenced namespace was insufficient to
get global one as it used to do. Fixed bug #76965.
2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : check name in cref in the last phase that whether it is
namespace or not.
2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : reverted the latest change: it somehow broke
Mono.C5.
2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : so it turned out that we cannot skip override check for
interface members. Fixed bug #76954.
2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : fixed bug #75984:
- #warning and #error should not be handled when the source line
is disabled.
- #line is not checked strictly when the source line is disabled.
- #define and #undef is on the other hand checked strictly at any
state.
2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : missing Location (actually, filename) in one of
CS1027 report.
2005-12-15 Raja R Harinath <rharinath@novell.com>
* generic.cs (TypeManager.IsGeneric): Remove unused method.
* typemanager.cs (TypeManager.GetFullName): Rewrite to handle
nested types.
2005-12-14 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetFullName): Make this public;
`Type.Fullname' now never returns null.
* class.cs (Method.Define): Use TypeManager.GetFullName() for
explicit interface implementations; we're now using the same
naming convention than csc does.
2005-12-14 Miguel de Icaza <miguel@novell.com>
* convert.cs (ExplicitConversionCore): Check the return value from
ExplicitConversionCore which can return null on failure. Fixes #76914
2005-12-09 Raja R Harinath <rharinath@novell.com>
* anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
instead of IsGenericInstance.
* generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
code that's now covered by the more general test.
* typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
* generic.cs (DropGenericTypeArguments): New. Captures the common
pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
* attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
* generic.cs, report.cs, typemanager.cs: Likewise.
2005-12-08 Martin Baulig <martin@ximian.com>
* generic.cs (TypeArguments.Resolve): Added CS1547 check.
* typemanager.cs (TypeManager.CSharpSignature): Include type
arguments in the signature of a generic method.
2005-12-07 Martin Baulig <martin@ximian.com>
Add support for custom attributes on type parameters.
* cs-parser.jay (type_arguments): Added `opt_attributes'.
* generic.cs (TypeParameterName): New public class; we use this
instead of a `string' to store the name of a type parameter, so we
can also have `Attributes'.
(TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
array instead of a `string[]' array.
(TypeParameter.ctor): We now also take an `Attributes' argument.
(TypeParameter.EmitAttributes): New public method; emit our
`OptAttributes' here.
(GenericMethod.EmitAttributes): New public method; emit the custom
attributes on all our type parameters.
* class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
our type parameters.
(MethodData.Define): If we're a generic method, call
EmitAttributes() on it.
2005-12-07 Martin Baulig <martin@ximian.com>
* generic.cs
(ConstraintChecker): New public abstract class; move the
constraint checking here from `ConstructedType' and also do
constraint checking for generic methods here.
* expression.cs (Invocation.OverloadResolve): Use
ConstraintChecker.CheckConstraints() if we resolved to a generic
method. Fix #76806.
2005-12-05 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
* class.cs (EmitFieldInitializers): Simplified and fixed to work with
event initializers.
(FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
(FieldBase.Initializer): Initializer is now optional.
(EventField.Define): Only event field can have initializer.
* codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
* const.cs (Const): Reuse initializer.
* cs-parser.jay: Updated after FieldBase changes.
Added current_array_type to simplify array initializers.
* ecore.cs (NullCast.IsDefaultValue): Implemented.
* expression.cs, iterators.cs: Updated.
* namespace.cs (NamespaceEntry): Made UsingFound private.
2005-12-05 Marek Safar <marek.safar@seznam.cz>
* parameterCollection.cs: Obsolete, removed.
* parser.cs: Obsolete, removed.
2005-12-05 Marek Safar <marek.safar@seznam.cz>
Fix #76849.
* class.cs (Constructor.Emit): Set obsolete checking for whole context.
* enum.cs (Enum.Define): Set obsolete context here.
2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs :
- FindDocumentedMember() now expects 1) paramList as null
when "we don't have to check the number of parameters" and
2) Type.EmptyTypes when "there is no arguments".
- Introduced FoundMember struct to hold the exact type which was
used to find the documented member (the above change broke
test-xml-044; it might be better just to use DeclaringType than
what MS does, like this change does, but it depends on usage.)
2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : documented member might be from DeclaringType for nested
types. Fixed bug #76782.
2005-12-03 Ben Maurer <bmaurer@ximian.com>
* anonymous.cs: Have the param code handle leaving copies on the
stack etc. Allows anonymous params to take part in the assignment
code (++, +=, etc). Fixes bug #76550
* expression.cs: Handle the prepare_for_load/leave_copy by passing
it down to the anon code.
* iterators.cs: Use dummy var here
* codegen.cs: Handle new vars
2005-12-01 Marek Safar <marek.safar@seznam.cz>
Fix #76849.
* class.cs (MethodData.Define): Set proper Obsolete context.
* ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
obsolete context.
(FieldExpr.DoResolve): Ditto.
2005-12-01 Marek Safar <marek.safar@seznam.cz>
Fix #76849.
* class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
parent is not obsolete.
2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : (FindDocumentedMember) find parameterless members first
and get CS0419 in the early stage. Fixed first case of bug #76727.
2005-11-30 Marek Safar <marek.safar@seznam.cz>
Fix #76859.
* ecore.cs (Expression.ResolveAsConstant): Report constant error only when
no error was reported.
*expression.cs (Binary.DoResolve): left can be null.
2005-12-06 Raja R Harinath <rharinath@novell.com>
* class.cs (MethodCore.CheckGenericOverride): Delete unused
abstract method and all overrides.
* support.cs (ParameterData.GenericConstraints): Delete.
(ReflectionParameters.type_params): Delete.
(ReflectionParameters.ReflectionParameters): Make private.
(ReflectionParameters.GetConstaints): New factory method.
* generic.cs (TypeParameterDefineType): Use it.
(TypeManager.GetTypeParameterConstraints): Likewise.
2005-11-22 Marek Safar <marek.safar@seznam.cz>
Fix #76783.
* class.cs (MethodData.Emit): Parameters should be labeled first.
2005-11-21 Marek Safar <marek.safar@seznam.cz>
Fix #76761.
* parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2005-11-18 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (AreParametersCompliant): Moved to Parameter.
* class.cs (MethodCore): Parameter clean up.
(IMethodData): Added ParameterInfo.
(MethodData): Parameter clean up.
(Indexer.Define): Parameter clean up.
* anonymous.cs,
* codegen.cs,
* cs-parser.jay,
* decl.cs,
* doc.cs,
* ecore.cs,
* flowanalysis.cs,
* iterators.cs,
* pending.cs,
* statement.cs,
* typemanager.cs: Parameter clean up.
* delegate.cs (Define): Get rid of duplicated code.
* expression.cs (ParameterReference): Removed useless parameters
and simplified.
(Invocation): Ditto.
* parameter.cs (ParamsParameter): New class, params specialization.
(ArglistParameter): Attemp to separate arglist.
(Parameter): Refactored to be reusable and faster.
(Parameter.Modifier): Made understandable.
(Parameters): Changed to be used as a class for `this' assembly
parameters. Refactored to use new specialized classes.
* support.cs (ParameterData): Added Types property.
(InternalParameters): Deleted.
2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : the previous patch does not actually fix the bug.
PropertyInfo override check is now implemented and really fixed it.
* expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : apply "override filter" also to properties.
Fixed bug #76730.
2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
no need to check overrides. For classes, omit those results from
interfaces since they must exist in the class. Fixed bug #76726.
2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
* typemanager.cs : (GetFullNameSignature) differentiate indexers
with different parameters. Fixed the second problem in #76685.
2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : (FindDocumentedMember) pass invocation_type as well (to
get expected 'protected' access in CheckValidFamilyAccess()).
Fixed bug #76692.
2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
Fixed bug #76705. CS1569 was incorrectly commented out.
2005-11-23 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints.Define): Removed.
(TypeParameter.DefineConstraints): Removed.
(TypeParameter.DefineType): Call SetGenericParameterAttributes()
on the GenericTypeParameterBuilder here.
2005-11-23 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetProperty): Make this public.
* generic.cs (Nullable.NullableInfo.ctor): Use
TypeManager.GetProperty() rather than using reflection directly.
2005-11-17 Martin Baulig <martin@ximian.com>
* expression.cs (Indexers.GetIndexersForType): Added support for
generic parameters; fixes #76587.
2005-11-17 Martin Baulig <martin@ximian.com>
* anonymous.cs
(CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
inherit the scope from our parent. Fixes #76653.
2005-11-15 Martin Baulig <martin@ximian.com>
* anonymous.cs (ScopeInfo.ScopeType): New public field; use this
instead of `ScopeTypeBuilder' to refer to the "current" type.
(AnonymousMethod.CreateScopeType): Correctly create the helper
class if we're inside a generic type definition.
2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : use Invocation.IsOverride() to do real override check.
* expression.cs : made Invocation.IsOverride() internal.
2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : use TypeManager.FindMembers() instead of (possible)
TypeBuilder.FindMembers() and filter overriden base members out.
Fixed bug #76990.
2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : ref/out parameters are represented as '@' (instead of
'&' in type FullName). Fixed bug #76630 (additionally crefs).
2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : when there was no '.' in cref to methods in doc comment,
then parameters were missing in the output. Fixed bug #76691.
2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
* driver.cs : don't output docs when there is an error.
Fixed bug #76693.
2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs :
Now it should detect indexers. Fixed primary concern in bug #76685.
Fixed CS0419 message to not show the identical member signature in
the message.
2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
instead of Type.FindMembers() since it does not handle events.
Fixed bug #71604.
2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
* codegen.cs: Fixed typo (speficied -> specified).
2005-11-11 Marek Safar <marek.safar@seznam.cz>
Fix #76369.
* doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2005-11-11 Marek Safar <marek.safar@seznam.cz>
* attribute.cs: Changed error message.
* cs-tokenizer.cs: One more check.
2005-11-10 Marek Safar <marek.safar@seznam.cz>
* statement.cs (Block.Resolve): Ignore empty statement.
2005-11-10 Marek Safar <marek.safar@seznam.cz>
* report.cs: Made error/warning methods more strict to avoid
their misuse.
* anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
Use the more explicit AssemblyName.FullName instead of
AssemblyName.Name to report errors.
2005-11-11 Marek Safar <marek.safar@seznam.cz>
* attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
with mcs.
2005-11-10 Marek Safar <marek.safar@seznam.cz>
* class.cs,
* convert.cs,
* cs-parser.jay,
* decl.cs,
* enum.cs,
* expression.cs,
* generic.cs,
* pending.cs,
* report.cs: Fixed error reporting and typos.
* generic.cs (TypeParameter.GetSignatureForError): New method.
(ConstructedType.GetSignatureForError): Instead of DeclarationName.
* typemanager.cs (GetFullName): Refactored.
2005-11-08 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.GetCoClassAttributeValue): New method.
(AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
* class.cs (TypeContainer.IsComImport): New property.
(Constructor.Define): Create proper ctor for ComImport types.
* expression.cs (New.CheckComImport): Fixed.
2005-11-07 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CaptureContext.AddParameterToContext): The fact
that a parameter has been captured does not mean that we do not
have to do the rest of the processing. This fixes the second part
of #76592. If there was another anonymous method capturing
values in the past, the Scope would never be set for the second
method that captured the same parameter.
(CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
properly manipulate the stack. Second part of fix for #76592.
* expression.cs (New): Add support for invoking "new" on
interfaces that have been flagged with the ComImport attribute and
the CoClass. Fixes #76637
* statement.cs (Try.DoEmit): When a variable is captured, do not
try to emit the vi.LocalBuilder variable as it has been captured.
Create a temporary variable and store the results on the
FieldBuilder. Fixes #76642
2005-11-07 Marek Safar <marek.safar@seznam.cz>
* class.cs (CheckPairedOperators): Made compilable with csc 2.0.
* ecore.cs (InstanceResolve): Fixed CS1540 detection.
* expression.cs (Binary.DoResolve): Added && optimalization.
* typemanager.cs (AddUserType): Removed useless argument.
2005-11-04 Marek Safar <marek.safar@seznam.cz>
* statement.cs (Block.variables): Uses ListDictionary.
2005-11-03 Marek Safar <marek.safar@seznam.cz>
Fix #75969.
* class.cs (PartialContainer.EmitType): Customized to emit
security attributes.
(ClassPart.ApplyAttributeBuilder): Transform security attribute
for partial classes.
2005-11-03 Marek Safar <marek.safar@seznam.cz>
Fix #76599.
* expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
access has to be fixed.
* typemanager.cs (IsUnmanagedType): Wrong common field type.
2005-11-01 Marek Safar <marek.safar@seznam.cz>
Fix #76590.
* ecore.cs (NullCast.Reduce): Implemented.
* expression.cs (ArrayCreation.CheckIndices): Correcly check
constant type.
* statement.cs (SwitchLabel.ResolveAndReduce): Catch null
properly.
(Foreach.Resolve): Catch null properly.
2005-10-29 Marek Safar <marek.safar@seznam.cz>
* cs-tokenizer.cs: Warning text fix.
* driver.cs: AllWarningNumbers exposed on public interface.
* report.cs (): Reviewed warning numbers.
(IsValidWarning): Use binary search.
2005-10-29 Marek Safar <marek.safar@seznam.cz>
* driver.cs: Implemeted resource visibility.
(Resources): New class for code sharing between /res: and
/linkres:
2005-11-07 Marek Safar <marek.safar@seznam.cz>
decl.cs (CurrentTypeParameters): Fixed to be public.
2005-11-07 Marek Safar <marek.safar@seznam.cz>
generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2005-11-07 Marek Safar <marek.safar@seznam.cz>
gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2005-11-05 Kornél Pál <kornelpal@hotmail.com>
* gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
Add friend assembly access support.
* typemanager.cs: assembly_internals_vis_attrs
cache for friend assembly access.
(TypeManager.IsFriendAssembly): New method for
checking friend assembly access.
(TypeManager.Error_FriendAccessNameNotMatching): New
helper method.
(TypeManager.CompareKeyTokens): Likewise.
(TypeManager.Filter): Handle friend accessible
members.
* namespace.cs (RootNamespace.GetTypeInAssembly): Return
friend accessible types.
* ecore.cs (Expression.IsAccessorAccessible): Handle
friend accessible properties.
* decl.cs (DeclSpace.CheckAccessLevel): Handle friend
accessible types.
2005-10-28 Marek Safar <marek.safar@seznam.cz>
Fix #76568.
* cfold.cs (ConstantFold.BinaryFold): Implemented null cast
folding.
* convert (Convert.ImplicitReferenceConversion): NullCast holds
contants only.
* ecore.cs (NullCast): Child is contant only.
* literal.cs (NullLiteral.Reduce): null can be converted to any
reference type.
2005-10-28 Kornél Pál <kornelpal@hotmail.com>
* driver.cs: Use Encoding.Default as default code page instead
of ISO-28591.
2005-10-27 Raja R Harinath <rharinath@novell.com>
Fix #76085.
* expression.cs (Invocation.Error_InvalidArguments): Handle
__arglist parameters.
(Invocation.VerifyArgumentsCompat): Likewise.
* support.cs (ReflectionParameters.GetSignatureForError): Print
__arglist parameters.
(InternalParamters.GetSignatureForError): Likewise.
* parameter.cs (Parameters.GetSignatureForError): Likewise.
2005-10-26 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (GetPropertyValue): Made public.
* codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
Resolve.
Add new property WrapNonExceptionThrows to handle 2.0 assembly
attribute.
(AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
is not defined.
* driver.cs: Reflect method name change.
* statement.cs (Try.Resolve): Warn when try has both general
exception handlers.
* typemanager.cs: runtime_compatibility_attr_type new predefined
type.
2005-10-26 Raja R Harinath <harinath@gmail.com>
Fix #76419.
* pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
treat it as an empty parameter list.
2005-10-26 Raja R Harinath <rharinath@novell.com>
Fix #76271.
* ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
ResolveAsTypeStep silent.
* statement.cs (Block.AddConstant): Mark block as used.
(Block.ResolveMeta): Avoid piling on error messages
if a constant initializer resolution fails.
2005-10-25 Raja R Harinath <rharinath@novell.com>
* namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
Remove.
(NamespaceEntry.VerifyAllUsing): New.
(NamespaceEntry.AliasEntry.Resolve): New. Handles common error
behaviour. Delegates actual resolution of alias to ...
(NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
(NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
Update.
* driver.cs (Driver.MainDriver): Update.
* namespace.cs (NamespaceEntry.DefineNamespace): Remove.
(NamespaceEntry.SymbolFileID): Make into a on-demand computed
property.
(Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
Remove.
* symbolwriter.cs (SymbolWriter.Initialize): Don't call
RootNamespace.DefineNamespacesForAll.
2005-10-24 Raja R Harinath <harinath@gmail.com>
* typemanager.cs (assemblies, external_aliases, modules)
(AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
(ComputeNamespaces, GetRootNamespace): Remove extra staging
overhead. Move resposibility ...
* namespace.cs (GlobalRootNamespace): ... here. Update to changes.
* driver.cs, attribute.cs, codegen.cs: Update to changes.
2005-10-23 Raja R Harinath <harinath@gmail.com>
* namespace.cs (RootNamespace.all_namespaces): Renamed from
cached_namespaces. Improve usage.
(RootNamespace.Reset, RootNamespace.RegisterNamespace)
(RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
Move from GlobalRootNamespace and simplify.
(RootNamespace.Global): Make instance variable.
(RootNamespace.RootNamespace): Add "alias name" parameter.
(GlobalRootNamespace): Simplify drastically.
(Namespace.Lookup): Don't use GetNamespace.
* typemanager.cs (GetRootNamespace): Rename from
ComputeNamespaceForAlias.
(NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2005-10-23 Marek Safar <marek.safar@seznam.cz>
* anonymous.cs (AnonymousContainer): Don't crash when container
doesn't exist.
2005-10-23 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Binary.DoResolve): Warn when comparing same
values.
2005-10-23 Marek Safar <marek.safar@seznam.cz>
Fix #76486.
* expression.cs (Binary.DoResolve): It looks like there are no
convetsion rules in enum context.
2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
Add support for extern alias qualifiers.
* typemanager.cs: Move some LookupTypeReflection code
to namespace.cs, to have cleaner code. Added some methods
to help us keep track of the extern aliased references.
* driver.cs: Add suport for extern alias assemblies on command
line and check for their warnings/errors. Also keep track of the
extern aliased assemblies.
* namespace.cs: Move the global functionality of Namespace
to GlobalRootNamespace/RootNamespace. Now the global namespace
is GlobalRootNamespace.Globa. Also the code moved from
typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
Finally added LocalAliasEntry (AliasEntry before) and
ExternAliasEntry, to handle alias statements.
* cs-parser.jay: Add support in the grammar for extern alias
statement.
* doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
Update callings to Namespace (now in GlobalRootNamespace).
2005-10-25 Martin Baulig <martin@ximian.com>
* convert.cs (ImplicitTypeParameterConversion): Make base
interfaces actually work; fixes #76557.
2005-10-25 Martin Baulig <martin@ximian.com>
* generic.cs
(GenericMethod.Define): Call TypeParameter.DefineConstraints() on
all the type parameters; fixes #76551.
2005-10-25 Martin Baulig <martin@ximian.com>
Fix #76472.
* generic.cs
(GenericMethod.ctor): Added `Expression return_type' and
`Parameters parameters' arguments.
(GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
parameter and return types to check their constraints if they're
generic types.
* codegen.cs (EmitContext.ResolvingGenericMethod): New public
boolean field.
* ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
constraints of a generic type if `ec.ResolvingGenericMethod'.
* class.cs (MethodCore.DoDefineParameters): Set
`ec.ResolvingGenericMethod' if we're a generic method.
(MemberBase.MemberType): Likewise.
2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* typemanager.cs (TypeManager): Added
TypeManager.internals_visible_attr_type to cache
S.R.CompilerServices.InternalsVisibleToAttribute.
* codegen.cs (AssemblyClass): Added checks for
InternalsVisibleToAttribute in new method
CheckInternalsVisibleAttribute () and also cache the
AssemblyName in AssemblyClass.Name.
2005-10-24 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.ExpandInterfaces): Added overloaded version which
just takes a `Type[]' array.
* generic.cs
(Constraints.Resolve): Don't expand the interfaces here; ie. we
just use the interfaces which were explicitly specified and not
the interfaces they inherit. Fixes #76482.
(TypeParameter.FindMembers): Expand the interfaces here.
2005-10-21 Martin Baulig <martin@ximian.com>
* generic.cs
(Constraints.Resolve): Also resolve the actual types here.
(Constraints.ResolveTypes): Just check the constraints here.
Fixes #76363; see gtest-218.cs.
2005-10-21 Martin Baulig <martin@ximian.com>
* convert.cs
(Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
instead of a `BoxedCast'; fixes gtest-217.cs.
2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
* generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1) "new()" is specified as generic parameter constraint and 2) the
type is TypeBuilder and 3) the type is abstract even if it has a
default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2005-10-20 Martin Baulig <martin@ximian.com>
* generic.cs
(GenericConstraints.TypeParameter): New public property.
(TypeParameter.ctor): Also take a `DeclSpace' argument.
(TypeParameter.DeclSpace): New public property.
(TypeParameter.DefineType): Inflate the constraints if our
`DeclSpace' is an `Iterator'.
2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
* class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
GenericMethod argument to compare methods' generic type arguments.
Fixed bug #76382.
2005-10-19 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
not ResolveType() when resolving the base type, so we're not
checking the constraints here.
(TypeContainer.ResolveType): Call ResolveType() on our base_type
if we have any.
2005-10-19 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Committing
untested fix for #76441.
2005-10-18 Raja R Harinath <rharinath@novell.com>
Fix #76371.
* class.cs (TypeContainer.DefineType): Move updating of
topological sort earlier in the code.
* decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2005-10-18 Marek Safar <marek.safar@seznam.cz>
Fix #76273.
* cfold.cs (BinaryFold): Reduce constant in enum conversion.
* constant.cs (Constant.TryReduce): Moved from Cast class.
(Reduce): Made little bit more OO and fixed missing conversions.
* ecore.cs (Reduce): Implemented.
(Binary.EnumLiftUp): New method to upgrade values to enum values.
* literal.cs (Reduce): Implemented.
* class.cs: Reverted Miguel's wrong commit.
2005-10-14 Miguel de Icaza <miguel@novell.com>
* ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
* cs-parser.jay, expression.cs : CS0214 was missing error location
for constants. Fixed bug #76404.
2005-10-10 Raja R Harinath <rharinath@novell.com>
* ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
InstanceExpression.
(PropertyExpr.EmitCall): Likewise.
* expression.cs (Invocation.EmitArguments): Handle case where
arguments == null.
(Invocation.EmitCall): Avoid allocating temporary variable if
there are no arguments.
2005-10-11 Marek Safar <marek.safar@seznam.cz>
Fix #76370.
* convert.cs (ExplicitConversionCore): Fixed object->enum
conversion.
2005-10-07 Raja R Harinath <rharinath@novell.com>
Fix #76323.
* convert.cs (ImplicitConversionStandard): Move conversion of
void* to arbitrary pointer types ...
(ExplicitConversionStandard): .. here.
* ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
error to always print typenames.
2005-10-07 Raja R Harinath <rharinath@novell.com>
* convert.cs (GetConversionOperator): Rename from
GetConversionOperators. Move operator selection code from ...
(UserDefinedConversion): ... here.
2005-10-06 Marek Safar <marek.safar@seznam.cz>
* convert.cs (ExplicitConversionCore): Removed duplicate enum
conversion.
2005-10-05 Marek Safar <marek.safar@seznam.cz>
* assign.cs (Assign.DoResolve): Error method changed.
* cfold.cs (DoConstantNumericPromotions): Error method changed.
* const.cs (ResolveValue): Reset in_transit immediately.
* constant.cs: Error method changed.
* convert.cs: Removed useless location parameter.
(ExplicitNumericConversion): Don't do double enum check.
(ExplicitConversionCore): Renamed from ExplicitConversion.
(ExplicitUnsafe): Extracted from ExplicitConversion.
(ExplicitConversion): Uses for error reporting.
* ecore.cs (Error_ValueCannotBeConverted): More logic for more
error messages.
(ResolveBoolean): Uses common error method.
(CastToDecimal): Get rid of ec.
(CastFromDecimal): Optimized.
(ConvCast): Get rid of ec.
* enum.cs (ResolveValue): Reset in_transit immediately.
(Emit): Return after first error.
* expression.cs: Convert changes.
* literal.cs: Error method changed.
* statement.cs: Error method changed.
2005-10-06 Raja R Harinath <rharinath@novell.com>
Fix gtest-131.cs and gtest-211.cs.
* generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
Only emit code for a label if it is used. Unreachable code can
violate ECMA evaluation stack invariants.
2005-09-27 Marek Safar <marek.safar@seznam.cz>
* anonymous.cs: Implemented ExprClassName.
* assign.cs (Assign.DoResolve): Don't chrash when type is not
delegate.
* attribute.cs (ResolveArguments): Enabled MethodImplOptions
check.
* class.cs (StaticClass.DefineContainerMembers): Report protected
members as error.
* codegen.cs: if(ed) PRODUCTION.
* convert.cs (Error_CannotImplicitConversion): Better error
distinction.
* cs-parser.jay: More error checks.
* cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
* driver.cs (CSCParseOption): Enabled wrong option check.
* ecore.cs (Expression.ExprClassName): Turned to property.
(MemberExpr.CheckIntermediateModification): For checking boxed
value types modification.
* statement.cs (Fixed.Resolve): Expression type must be
convertible to fixed type.
(CollectionForeach.GetEnumeratorFilter,TryType):
Small refactoring for easier error checking.
2005-09-26 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.Resolve): Check Obsolete attribute for
attributes.
* class.cs (GeneratedBaseInitializer): New class for customization
compiler generated initializers.
(MemberBase.DoDefine): Check Obsolete attribute here.
(FieldMember.DoDefine): Ditto.
* const.cs (ExternalConstant.CreateDecimal): Builder for decimal
constants.
* decl.cs (MemberCore.EmitContext): Returns valid current ec.
(MemberCore.GetObsoleteAttribute): Removed argument.
(MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
(MemberCore.CheckObsoleteType): New helper.
* delegate.cs,
* enum.cs,
* statement.cs: Updates after MemberCore changes.
* ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
(FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
obsolete attribute for compiler construct.
(As.DoResolve): Cache result.
* iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2005-10-01 Miguel de Icaza <miguel@novell.com>
* expression.cs (Probe): instead of having a "Type probe_type"
keep the extra information as a TypeExpr probe_type_expr since the
"As" operator needs to perform some type checks.
* (As.DoResolve): If the type is a type parameter, ensure that it
is constrained by a class.
2005-09-22 Miguel de Icaza <miguel@novell.com>
* statement.cs (Lock): Use the TemporaryVariable class instead of
manually using local variables as those do not work when variables
are captured.
* ecore.cs: Moved the TemporaryVariable class from being a nested
class inside Foreach to be a public class that can be employed in
other places.
2005-09-19 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: interface_accessors replaced by
accessor_declarations.
* ecore.cs, literal.cs, statement.cs: NullLiteral holds null
location.
* statement.cs (GotoCase.Resolve): Convert null constant to
null case.
(SwitchLabel.ResolveAndReduce): Ditto.
(SwitchLabel.NullStringCase): Custom null stamp.
(Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
typemanager.cs (CSharpSignature): Don't skip first argument
for full names.
2005-09-16 Marek Safar <marek.safar@seznam.cz>
* cfold.cs, constant.cs, convert.cs, ecore.cs,
expression.cs, iterators.cs, literal.cs: Store constants and
literals location.
* class.cs (MemberBase.ShortName): Pass location.
* cs-parser.jay: Some location fixes.
* ecore.cs (Expression.Location): Made virtual.
2005-09-27 Marek Safar <marek.safar@seznam.cz>
Fix #72930.
* const.cs (Const.ResolveValue): Check for assigning non-null
value to reference type.
2005-09-26 Raja R Harinath <rharinath@novell.com>
Fix #76133.
* expression.cs (This.VerifyFixed): In a value type T, the type of
'this' is T&, iow, 'this' is either an out or ref parameter. In a
value type R, 'this' is treated as a value parameter.
2005-09-05 Miguel de Icaza <miguel@novell.com>
* expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
if the underlying types are the same, otherwise we need to produce
code that will do the proper cast.
This was exposed by Marek's constant rewrite which produced
invalid code for the call site:
enum X : long { a }
void Method (X v) {}
Method ((X) 5)
This fixes test-49.cs
2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
* attribute.cs : (Attribute.IsValidArgumentType): array of string/
Type/Object should be allowed as well. Fixed bug #75968.
2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
* expression.cs : (Binary.DoResolve): when one is enum constant and
another is constant 0, then return enum one *as enum type*.
Fixed bug 74846.
2005-10-04 Martin Baulig <martin@ximian.com>
* ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
`SetMemberIsUsed()' work for generics, too.
2005-10-04 Martin Baulig <martin@ximian.com>
* expression.cs (DelegateInvocation.EmitStatement): Make this work
for corlib. Fixes #75691.
2005-09-28 Marek Safar <marek.safar@seznam.cz>
Fix #76255.
* driver.cs: Fix compilation files with full root path.
2005-09-25 Miguel de Icaza <miguel@novell.com>
* report.cs (SymbolRelatedToPreviousError): Format the output so
it does not use an open parenthesis that is never closed.
* driver.cs: Follow coding guidelines
2005-09-18 Miguel de Icaza <miguel@novell.com>
* driver.cs: Set InEmacs based on the environment variable EMACS.
* location.cs (InEmacs): in this mode, do not report column
location as it confuses Emacs.
2005-10-03 Raja R Harinath <rharinath@novell.com>
* support.cs (SeekableStreamReader.Position): Don't error out when
the requested position is just beyond the end of the current
buffered data.
2005-09-28 Raja R Harinath <rharinath@novell.com>
* support.cs (SeekableStreamReader): Simplify drastically. Don't
try to keep in sync with the byte count of the underlying Stream.
However, this limits us to a window size of 2048 characters: i.e.,
the maximum lookahead of our lexer/parser can be 2048 characters.
2005-09-22 Martin Baulig <martin@ximian.com>
* driver.cs: Removed a debugging FIXME.
2005-09-21 Raja R Harinath <rharinath@novell.com>
* cs-parser.jay (type_arguments): Add CS1644 check.
* decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2005-09-15 Raja R Harinath <rharinath@novell.com>
* Makefile (PROGRAM): Make profile specific.
(gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
the current directory.
Fix test-455.cs.
* expression.cs (Invocation.EmitCall): Remove optimization on
this_call since it doesn't handle 'this' being a value type.
2005-09-05 Geoff Norton <gnorton@customerdna.com>
* driver.cs: Ensure file handles are closed after parsing
2005-09-05 Miguel de Icaza <miguel@novell.com>
* expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
if the underlying types are the same, otherwise we need to produce
code that will do the proper cast.
This was exposed by Marek's constant rewrite which produced
invalid code for the call site:
enum X : long { a }
void Method (X v) {}
Method ((X) 5)
This fixes test-49.cs
2005-09-05 Martin Baulig <martin@ximian.com>
* expression.cs (As.DoResolve): Use `probe_type.IsValueType'
instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
* cs-parser.jay (delegate_declaration): Small fix for #75852.
2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
* typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
to be a pointer type due to the spec 25.2, so check if declaring
type is generic type definition. Fixed bug #75772.
2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
Fixed bug #75957.
* generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
both types are not defined by methods.
* expression.cs : (Invocation.IsApplicable): it should work when
the argument type is equal to the parameter type, not only when
ImplicitConversionExists() returns true.
2005-09-02 Raja R Harinath <rharinath@novell.com>
* attribute.cs (GetMarshal): Work even if "DefineCustom" is
internal.
Fix #75941.
* ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
flow-branching for LocalVariableReferences in case we were invoked
from a MemberAccess.
* expression.cs (LocalVariableReference.VerifyAssigned): New.
Carved out of ...
(LocalVariableReference.DoResolveBase): ... this.
(MemberAccess.Resolve): Do the check that was disabled during
SimpleNameResolve.
2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
* class.cs :
(PartialContainer.Create): check abstract/sealed/static strictly
but abstract/sealed can exist only at one side. Fixed bug #75883.
2005-09-01 Kornél Pál <kornelpal@hotmail.com>
Fix #75945.
* attribute.cs (Attribute.GetMarshal): If ArraySubType is not
specified, don't default to UnmanagedType.I4.
2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
* expression.cs : conditional operator should check possibly
incorrect assign expression. Fixed bug #75946.
2005-08-30 Raja R Harinath <rharinath@novell.com>
Fix #75934.
* anonymous.cs (ScopeInfo.MakeFieldName): New helper.
(ScopeInfo.EmitScopeType): Use it to construct field names from
names of captured locals.
Fix #75929.
* ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
* convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
Pass 'target_type' to BoxedCast. Don't default to 'object'.
(ExplicitConversion): Remove enum cases already handled by
implicit conversion. Move implicit conversion check to the beginning.
* delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
* expression.cs (ArrayCreation.EmitDynamicInitializers):
Don't treat System.Enum as a struct.
2005-08-30 Jb Evain <jbevain@gmail.com>
* attribute.cs: handles as expression in parameters.
2005-08-30 Raja R Harinath <rharinath@novell.com>
Fix #75802.
* class.cs (TypeContainer.VerifyClsName): Don't use a
PartialContainer when verifying CLS compliance.
(AbstractPropertyEventMethod): Set Parent here, ...
(PropertyMethod): ... not here.
2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
* attribute.cs : escaped attribute name should not be allowed to be
resolved (e.g. @class as classAttribute). Fixed bug #75930.
2005-08-29 Raja R Harinath <rharinath@novell.com>
Fix #75927.
* convert.cs (ImplicitStandardConversionExists): Allow zero also
when converting a long constant to unsigned long.
* expression.cs (Invocation.OverloadResolve): Add sanity check to
detect where IsApplicable and VerifyArgumentsCompat disagree.
2005-08-29 Raja R Harinath <rharinath@novell.com>
and Carlos Alberto Cortez <carlos@unixmexico.org>
Fix #75848.
* class.cs (TypeContainer.CanElideInitializer): New helper.
(TypeContainer.EmitFieldInitializers): Use it to determine if we
can safely emitting the initializer of a field.
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* statement.cs : (Continue.Resolve()) Unlike break, continue is not
allowed inside a switch (without loop). Fixed bug #75433.
2005-08-26 Kornél Pál <kornelpal@hotmail.com>
* AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
* mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* driver.cs : kinda reverting the default encoding changes (not exact
revert since I noticed that "codepage:reset" might not work fine).
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* class.cs : (AbstractPropertyEventMethod) SetupName() now takes
Location. Now getter and setter store location correctly.
(errors/cs0111-12.cs now reports the expected location.)
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* driver.cs : Use default encoding on the environment.
Removed (now that) extra parameter for SeekableStreamReader.
* support.cs : (SeekableStreamReader) third .ctor() argument for
StreamReader is not required (always true). preamble size could
be acquired in simpler and safe way.
2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
* cs-parser.jay: report CS0642 at warning level 3
and report CS0642 for an if else statement also
fixes bug #74745. Patch by John Luke (and a bit
modified by me).
Removed extra CS0642 warning check for "while",
"for" and "fixed".
* statement.cs: In Block.Resolve(), CS0642 check
is reimplemented to check a sequence of an empty
statement and a block.
Both fix bug #66777.
2005-08-24 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
detection until I fix it.
* cs-tokenizer.cs: Changed error message.
* cs-parser.jay: Fixed 2 error locations.
* ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
(PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
properties.
* enum.cs (GetSignatureForError): Fixed.
* expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
method detection.
* class.cs,
* typemanager.cs (RegisterProperty): Removed.
* statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2005-08-24 Raja R Harinath <rharinath@novell.com>
Fix #75874.
* expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
(ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* expression.cs : tiny fix is required for not warning positive ulong.
See test-441.cs.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* expression.cs : add CS0652 check for constant and integral
expression. Fixed bug #53974.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* expression.cs : in DoNumericPromotions(), check if there is implicit
conversion overload for string (to check CS0034). Fixed bug #52492.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* ecore.cs : report location when it is *not* Null.
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
* codegen.cs,
ecore.cs,
flowanalysis.cs,
expression.cs:
Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
correctly. Fixed bug #75721.
2005-08-23 Raja R Harinath <rharinath@novell.com>
* support.cs (SeekableStreamReader.Position): Avoid an expensive
loop that performs 'min (pos, char_count)'.
Fix #75862.
* expression.cs (Unary.ResolveOperator): Don't discard implicit
converted value in Operator.OnesComplement.
2005-08-22 Ben Maurer <bmaurer@ximian.com>
* anonymous.cs: If the anon method is pulled into a helper class,
it needs to be `internal' not `private'. Fixes runtime behavior on
msft. bug #75704
2005-08-17 Marek Safar <marek.safar@seznam.cz>
Fix #75803
* decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
is a partial class.
2005-08-16 Marek Safar <marek.safar@seznam.cz>
The big constants rewrite
Fix #75746, #75685 and more
As a side effect saved 1MB for MWF ;-)
* attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
(GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
enum based for corlib compilation.
* cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
subtractions.
* class.cs (FixedField.Define): Use ResolveAsConstant.
* const.cs (IConstant): Interface constants and enums.
(Const.ResolveValue): New method for constant resolvning.
(ExternalConstant): Constants from imported assemblies.
* constant.cs (Constant.GetTypedValue): Used to get constant with forced
conversion; like enums.
(Constant.ToType): Converts this constant to different type.
(Constant.Increment): Adds 1.
* convert.cs (ImplicitConversionRequired): Simplified.
* cs-parser.jay: Create EnumMember directly.
* decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
* doc.cs (GenerateEnumDocComment): Removed.
* ecore.cs (Expression.ResolveAsConstant): New constant specific method.
(ConvertIntLiteral): Removed.
(FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
* enum.cs (EnumMember): Implement IConstant.
(Enum.IsValidEnumConstant): Removed.
(Enum.GetNextDefaultValue): Removed.
(Enum.FindMembers): Updated.
(Enum.GenerateDocComment): Iterate enum members.
* expression.cs (Cast.TryReduce): Handle enums correctly.
(New.Constantify): Made public.
(MemberAccess.DoResolve): Removed contant specific if(s).
* literal.cs (NullLiteral): Implement new abstract methods.
* statement.cs (GotoCase.Resolve): Use new constant methods.
(SwitchLabel.ResolveAndReduce): Use new constant methods.
* typemanager.cs (LookupEnum): Removed.
(IsEnumType): Fixed to work with corlib.
(RegisterConstant): Removed.
(LookupConstant): Removed.
(GetConstant): Changed to work with IConstant.
2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
* location.cs : Fixed overflown (>255) column number.
2005-08-03 Raja R Harinath <rharinath@novell.com>
First cut of the qualified-alias-member feature.
* cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
token.
* cs-parser.jay (DOUBLE_COLON): New token.
(namespace_or_type_name): Add rule for recognizing
qualified-alias-members.
(primary_expression): Likewise.
(element_access): Allow QualifiedAliasMember as a possible
type-bearing expression.
(local_variable_type, local_variable_pointer_type): Likewise.
* namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
aliases in the current and enclosing namespace declarations.
(NamespaceEntry.UsingAlias): Add CS0440 warning.
* decl.cs (MemberName.is_double_colon): New.
(MemberName.MemberName): Add new constructor for alias-member.
(MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
* expression.cs (QualifiedAliasMember): New expression type.
2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
* location.cs : it borked when no argument was specified.
2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
* location.cs : tiny ToString() format fix.
2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
* statement.cs : oops, it was missing.
2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
A set of fixes for precise line/column location.
* location.cs :
"token" field now holds a file/line "delta", a line number offset
from the segment, and a column number. See also:
http://lists.ximian.com/pipermail/mono-devel-list/2004-
December/009508.html
Removed static IsNull. Use instance IsNull property instead.
* cs-tokenizer.cs :
For some tokens it stores Location. For Identifier it stores
LocatedToken which is a pair of string name and location.
Column numbers are adjusted only at getChar().
* report.cs :
Use Location.ToString() for reporting (it now contains column).
* cs-parser.jay :
Largely modified to use LocatedToken instead of
string (IDENTIFIER), and to acquire Location from some tokens.
* namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
codegen.cs :
Now MemberName holds Location. DeclSpace.ctor() receives Location
as a parameter. Removed extra parameters to all derived classes.
Replaced Location.IsNull() with instance property.
* assign.cs, expression.cs :
Added .ctor() overload that omits Location.
* attribute.cs :
Added "nameEscaped" flag that indicates the identifier was escaped
in the source file. This fixes bug #57047.
2005-09-02 Martin Baulig <martin@ximian.com>
* class.cs: Make CS3005 a warning, not an error.
2005-08-02 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
New method, looking for lo-case imported cls type.
* decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
here.
* driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
* enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
* typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
all_imported_types.
(TypeManager.LoadAllImportedTypes): Lo-case imported types.
Optimized to save 3.5 MB for SWF compilation.
2005-08-01 Marek Safar <marek.safar@seznam.cz>
* class.cs (AddToTypeContainer): Use inheritance insted of if(s).
(PartialContainer.Create): Moved logic AddToContainer.
(PartialContainer.MarkForDuplicationCheck): Shares name.
* decl.cs (DeclSpace.AddToContainer): Check name collisions at one
place.
* namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
initialization.
(Namespace.GetSignatureForError): New method.
* tree.cs (Tree.RecordDecl): Moved to AddToContainer.
(RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2005-08-01 Raja R Harinath <rharinath@novell.com>
Fix #75669.
* ecore.cs (Expression.MemberLookupFailed): Use queried_type for
member lookup rather than qualifier_type, since qualifier_type can
be null.
2005-08-01 Marek Safar <marek.safar@seznam.cz>
* enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
enum member.
2005-07-31 Miguel de Icaza <miguel@novell.com>
* statement.cs: Copy the local exception into the exception
captured local. Fixes 75674
2005-07-31 Raja R Harinath <harinath@gmail.com>
Fix #75658.
* expression.cs (Invocation.OverloadResolve): Don't report error
CS1501 if error CS1502 has been reported.
(New.DoResolve): Delegate CS1501 reporting to
Invocation.OverloadResolve.
Fix #75656.
* statement.cs (Block.CheckInvariantMeaningInBlock): Verify
invariant-meaning-in-block property in an enclosing block if
necessary.
2005-07-29 Marek Safar <marek.safar@seznam.cz>
* statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
(SwitchLabel.Erorr_AlreadyOccurs): Share error message.
(Switch.CheckSwitch): Just save 50kb for SWF.
2005-07-27 Martin Baulig <martin@ximian.com>
* anonymous.cs (CaptureContext.AddField): Added
`AnonymousContainer am' argument; compute its toplevel scope if
it's not already computed. Fixes #75649.
2005-07-26 Raja R Harinath <rharinath@novell.com>
Fix #75628.
* class.cs (Constructor.Emit): Reset block to null if the block
resolve fails.
2005-07-25 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2005-07-25 Marek Safar <marek.safar@seznam.cz>
* class.cs (MethodData.Define): Check whether accessor implementing
interface is public.
* driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2005-07-22 Marek Safar <marek.safar@seznam.cz>
Fix #57245
* namespace.cs (LookupType): Moved same type check to...
* typemanager.cs (LookupTypeReflection): Don't allow to import more types
with the same name.
2005-07-21 Raja R Harinath <rharinath@novell.com>
* namespace.cs (NamespaceLookupType): Avoid a string allocation when we
already found a typebuilder.
* class.cs (MethodCore.IsDuplicateImplementation): Compare
MemberNames, not strings.
* const.cs (Error_ExpressionMustBeConst):
Rename from Error_EpressionMustBeConst.
* const.cs, class.cs, statement.cd: Update.
2005-07-21 Marek Safar <marek.safar@seznam.cz>
Fix #65573
* const.cs (Const.LookupConstantValue): Report missing contant expression
everytime.
(Error_EpressionMustBeConstant): Only one error method.
* class.cs, statement.c: Updated.
2005-07-20 Raja R Harinath <rharinath@novell.com>
* statement.cs (Block.Flags): Add back HasVarargs.
(Block.flags): Make protected.
(ToplevelBlock.HasVarargs): Convert to a property that updates flags.
* typemanager.cs (types, typecontainers, user_types): Remove.
(UserTypes, TypeContainers): Likewise.
(HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
(CleanUp, Reset): Update.
(AddUserType): Combine variants. Now, only updates builder_to_declspace.
(GetNestedType): Use Type.GetNestedType.
(CoreLookupType): Take two arguments, the namespace and the
basename of the type. Update to use the Namespace.Lookup
mechanism.
(InitEnumUnderlyingTypes, InitCoreTypes): Update.
(RealMemberLookup): Use IsNestedChildOf instead of playing with
string concatenation and substring matches.
* class.cs, enum.cs, delegate.cs: Update to changes.
2005-07-20 Marek Safar <marek.safar@seznam.cz>
* constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
Expression and made virtual.
* convert.cs (ImplicitReferenceConversionExists): Skip for value types.
(ImplicitStandardConversionExists): Fixed `byte' typo ?
* ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
* literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
error message.
* convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
change.
2005-07-18 Marek Safar <marek.safar@seznam.cz>
Fix #57707
* codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
AssemblyCultureAttribute is not used on executable.
* rootcontext.cs,
* typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2005-07-16 Raja R Harinath <rharinath@novell.com>
Fix #60638.
* expression.cs (Binary.Warning_UnintendeReferenceComparison):
New. Reports CS0252/CS0253.
Mostly taken from preliminary patch by Duncak Mak.
(Binary.DoResolveOperator): Store results of operator lookup.
Use them to detect if we need to warn about unintended reference
comparisons.
2005-07-15 Raja R Harinath <rharinath@novell.com>
Fix #72969.
* namespace.cs (Namespace.Lookup): Add back location parameter.
(Namespace.LookupType): Add CS0436 report. Add location parameter.
* delegate.cs, ecore.cs, expression.cs: Update to changes.
* codegen.cs (EmitContext.DeclSpace): Make readonly.
* namespace.cs (Namespace.Lookup): Carve out type lookup into ...
(Namespace.LookupType): ... this.
(NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
of namespaces.
* typemanager.cs (LookupTypeReflection): Remove buggy code that
purported to handle pointers.
(char_ptr_type, void_ptr_type): Use GetPointerType rather than
CoreLookupType.
2005-07-15 Marek Safar <marek.safar@seznam.cz>
* expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
type as namespace.
2005-07-15 Raja R Harinath <rharinath@novell.com>
* namespace.cs (Namespace.Lookup): Drop location parameter.
(NamespaceEntry.LookupAlias): Remove. Merge into ...
(NamespaceEntry.Lookup): ... this.
(NamespaceEntry.Error_AmbiguousTypeReference):
Move here from DeclSpace.
(NamespaceEntry.LookupNamespaceOrType): Move support for dotted
names ...
* ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
* decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
Move to NamespaceEntry.
* delegate.cs, expression.cs: Update to changes.
2005-08-31 Martin Baulig <martin@ximian.com>
Committing a patch from Atsushi Enomoto for #75850.
* statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
Prefer a generic enumerator over a non-generic one.
2005-08-26 Kornél Pál <kornelpal@hotmail.com>
* AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
* gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* driver.cs : reverting default encoding change as well as mcs.
2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
* driver.cs, support.cs : merged r48826.
Marek Safer wrote:
> could you integrate your mcs changes to gmcs otherwise
> gmcs cannot compile some files.
2005-08-20 Martin Baulig <martin@ximian.com>
* anonymous.cs (CaptureContext.CaptureThis): Create the topmost
scope if we don't already have it.
* expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
fixes #75867.
2005-07-31 Miguel de Icaza <miguel@novell.com>
* statement.cs: Copy the local exception into the exception
captured local. Fixes 75674
2005-07-15 Marek Safar <marek.safar@seznam.cz>
* expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
type as namespace.
2005-08-12 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
for nested types here to avoid hitting the cache too early.
2005-08-09 Miguel de Icaza <miguel@novell.com>
* enum.cs: On the new compiler CLS error 3005 is now a warning not
an error.
2005-08-03 Martin Baulig <martin@ximian.com>
Make iterators in generic methods work; see gtest-191.cs.
* generic.cs
(Constraints.Resolve): Protect against being called twice.
* class.cs
(TypeContainer.GetClassBases): Make this `protected virtual'.
* iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
(Iterator.GetClassBases): Override this and compute the base
classes here.
(Iterator.DefineNestedTypes): If we're a generic method, all our
method type parameters become class type parameters on the proxy
class.
* statement.cs
(ToplevelBlock.Parameters): Make this a property, not a field.
(ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2005-08-03 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsSubclassOf): Use
`TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
(TypeManager.GetFullName_recursed): Improved.
2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
Fix #75417
* ecore.cs (Expression.IsAccessorAccessible): Change the check for
Private accessor case, using TypeManager.IsPrivateAccessible instead of
invocation_type == mi.DeclaringType, since the first one also checks
other condition used by generic instances.
2005-07-27 Martin Baulig <martin@ximian.com>
* anonymous.cs (CaptureContext.AddField): Added
`AnonymousContainer am' argument; compute its toplevel scope if
it's not already computed. Fixes #75649.
2005-07-14 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.ResolveAttributeType): Renamed from
CheckAttributeType and refactored.
(Attribute.ResolvePossibleAttributeType): Changed to reuse
ResolveAsTypeTerminal error handling.
(ResolveAsTypeTerminal): Introduced because of global attributes extra
handling.
(GetSignatureForError): Print errors in same way.
* class.cs,
* codegen.cs: Reflect attribute GetSignatureForError change.
* ecore.cs,
* expression.cs: Add silent parameter to ResolveAsTypeStep.
* namespace.cs (UsingEntry): Refactored to make fields private.
* assign.cs,
statement.cs: Error_UnexpectedKind has extra parameter.
2005-07-14 Raja R Harinath <rharinath@novell.com>
* ecore.cs (IAlias): Remove.
* decl.cs (DeclSpace): Don't derive from IAlias. Remove members
that implement the interface.
* namespace.cs (Namespace): Likewise.
(Namespace.declspaces): Renamed from 'defined_names'.
(Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
DeclSpace instead of an IAlias.
* tree.cs (Tree.AddDecl): Update.
2005-07-12 Raja R Harinath <rharinath@novell.com>
* statement.cs (Block.Flags); Remove HasVarargs.
(Block.HasVarargs): Move to ToplevelBlock.
(Block.ThisVariable, Block.AddThisVariable): Likewise.
(Block.Variables): Make protected. Initialize variable hashtable
if necessary.
(Block.AddVariable): Update.
(Block.Resolve): Update to changes.
(ToplevelBlock.HasVarargs): New boolean.
(ToplevelBlock.ThisVariable): Move here from Block.
(ToplevelBlock.AddThisVariable): Likewise.
(ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
* expression.cs (This.ResolveBase): Update to changes.
(ArglistAccess.DoResolve): Likewise.
2005-07-11 Marek Safar <marek.safar@seznam.cz>
Fix #75321
* ecore.cs, class.cs: Use SetAssigned instead of direct access.
* class.cs (TypeContainer.VerifyMembers): Distinguish between
not used and not used & assigned.
(FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2005-07-11 Marek Safar <marek.safar@seznam.cz>
Fix #75053
* expression.cs (Is.DoResolve): null is never provided type.
2005-07-08 Marek Safar <marek.safar@seznam.cz>
Fix #52496
* cs-parser.jay: Less strict event error rule to catch more errors.
2005-07-11 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Improve the check
for the constructor constraint: we do not only have to check
whether the class has a public constructor, but also ensure that
it's parameterless. Fixes #75492.
2005-07-11 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
between type parameters if they either have the reference type
constraint or the class constraint.
2005-07-10 Kamil Skalski <nazgul@nemerle.org>
* generic.cs: Use MakeGenericType instead of BindGenericParameters.
2005-07-07 Marek Safar <marek.safar@seznam.cz>
Fix #74975
* attribute.cs (orig_sec_assembly): Holds original version of assembly.
(ExtractSecurityPermissionSet): Cope with self referencing security
attributes properly.
* driver.cs (SetOutputFile): Made public property OutputFile.
2005-07-07 Raja R Harinath <rharinath@novell.com>
Fix #75486.
* class.cs (TypeContainer.first_nonstatic_field): Rename from
has_nonstatic_fields. Make into a FieldBase pointer.
(TypeContainer.AddField): Add CS0282 check.
(TypeContainer.EmitType): Update.
2005-07-06 Miguel de Icaza <miguel@novell.com>
* cs-tokenizer.cs (consume_identifier): Do not create strings to
compare if they start with __.
2005-07-06 Raja R Harinath <rharinath@novell.com>
* statement.cs (Switch.SwitchGoverningType): Only look at
UserCasts that don't need implicit standard conversions to one of
the allowed switch types (Fixes test-322.cs).
(LocalInfo.Resolve): Re-enable sanity-test.
2005-07-06 Marek Safar <marek.safar@seznam.cz>
* cs-tokenizer.cs (consume_identifier): Detect double undescores
* ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
* expression.cs (Invocation.DoResolve): Report error CS0245 here.
2005-07-06 Raja R Harinath <rharinath@novell.com>
Fix #75472.
* ecore.cs (SimpleName.GetSignatureForError): Add.
* expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
(MemberAccess.GetSignatureForError): Add.
2005-07-05 Marek Safar <marek.safar@seznam.cz>
The big error and warning messages review.
* anonymous.cs,
* assign.cs,
* attribute.cs,
* class.cs,
* codegen.cs,
* convert.cs,
* cs-parser.jay,
* cs-tokenizer.cs,
* decl.cs,
* delegate.cs,
* doc.cs,
* driver.cs,
* ecore.cs,
* enum.cs,
* expression.cs,
* flowanalysis.cs,
* iterators.cs,
* literal.cs,
* location.cs,
* modifiers.cs,
* namespace.cs,
* parameter.cs,
* pending.cs,
* report.cs,
* rootcontext.cs,
* statement.cs,
* support.cs,
* tree.cs,
* typemanager.cs: Updated.
* class.cs: (MethodCore.SetYields): Moved here to share.
(PropertyMethod.Define): Moved iterator setup here.
* iterators.cs: Add orig_method to have full access to parent
container.
2005-07-05 Raja R Harinath <rharinath@novell.com>
Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
* ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
(FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
variable of struct type.
* expression.cs (Unary.ResolveOperator): Update to change.
(Indirection.VerifyFixed): Likewise.
(LocalVariableReference.VerifyFixed): A local variable is always fixed.
(ParameterReference.VerifyFixed): Value parameters are fixed.
(This.VerifyFixed): Treat 'this' as a value parameter.
* statement.cs (LocalInfo.IsFixed): Remove.
2005-07-01 Martin Baulig <martin@ximian.com>
* iterators.cs (Iterator.CapturedThisReference.Emit): Use
`ec.EmitThis ()' to get the correct scope.
2005-07-01 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
instance is a ParameterReference; fixes #75299.
2005-06-30 Raja R Harinath <rharinath@novell.com>
Fix #75412.
* expression.cs (Indexers.map): Remove.
(Indexers.Append): Filter out inaccessible setters and getters.
(IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
Fix #75283.
* ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
Refactored from ...
(FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
(FieldExpr.Emit, PropertyExpr.Emit): Update.
(FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
* expression.cs (Invocation.EmitCall): Add CS0120 check.
2005-06-30 Marek Safar <marek.safar@seznam.cz>
Fix #75322
* class.cs (FieldBase.GetInitializerExpression): One more field
for backup.
2005-06-28 Miguel de Icaza <miguel@novell.com>
* pending.cs: Do not define a proxy if the base method is virtual,
it will be picked up by the runtime (bug 75270).
2005-07-08 Martin Baulig <martin@ximian.com>
* anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2005-07-07 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraint): Use
ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
called recursively; fixes #75329.
2005-07-06 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.InferTypeArguments): Added support for
anonymous methods; fixes #75461.
2005-07-01 Martin Baulig <martin@ximian.com>
* iterators.cs (Iterator.CapturedThisReference.Emit): Use
`ec.EmitThis ()' to get the correct scope.
2005-07-01 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
instance is `This'; fixes #75299.
2005-06-30 Martin Baulig <martin@ximian.com>
* class.cs (Indexer): Implement IIteratorContainer; added support
for iterators in indexers.
* codegen.cs
(EmitContext.CurrentIterator): Make this a property, not a field.
* anonymous.cs (AnonymousContainer.Iterator): New public property.
2005-06-28 Miguel de Icaza <miguel@novell.com>
* pending.cs: Do not define a proxy if the base method is virtual,
it will be picked up by the runtime (bug 75270).
2005-06-28 Martin Baulig <martin@ximian.com>
* cs-parser.jay (interface_method_declaration): Avoid a
reduce/reduce conflict by moving some of the code into a separate
`interface_method_declaration_body' rule; fixes #75368.
2005-06-28 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
array check after the check for TypeBuilder's.
2005-06-21 Raja R Harinath <rharinath@novell.com>
* convert.cs (FindMostEncompassedType): Add two trivial special
cases (number_of_types == 0 || number_of_types == 1).
(FindMostEncompasingType): Likewise.
2005-06-17 Raja R Harinath <rharinath@novell.com>
Some cleanups preparing for the fix of #75283.
* ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
error testing.
(EventExpr.InstanceResolve): Likewise.
(EventExpr.DoResolve): Remove redundant checks.
2005-06-08 Miguel de Icaza <miguel@novell.com>
* class.cs: Small fix.
2005-06-08 Raja R Harinath <rharinath@novell.com>
Fix #75160.
* class.cs (GetPartialBases): Fix return value check of
part.GetClassBases.
2005-06-07 Raja R Harinath <rharinath@novell.com>
Ensure that partial classes are registered in their enclosing
namespace. Initial part of fix of #75160.
* tree.cs (Tree.RecordDecl): Add new namespace argument.
Register declspace with namespace here, not in
DeclSpace.RecordDecl.
* cs-parser.jay: Pass namespace to RecordDecl.
* class.cs (PartialContainer.Create): Likewise.
(ClassPart.DefineType): New sanity-check. Throws an exception if
called.
* decl.cs (Declspace.RecordDecl): Remove.
* namespace.cs (NamespaceEntry.DefineName): Remove.
2005-06-06 Marek Safar <marek.safar@seznam.cz>
* rootcontext.cs: Reset TargetExt as well.
2005-06-03 Raja R Harinath <rharinath@novell.com>
* ecore.cs (Expression.Resolve): Emit CS0654 error when
-langversion:ISO-1.
2005-06-02 Raja R Harinath <rharinath@novell.com>
Fix #75080, cs0119.cs.
* ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
of ...
(Expression.Resolve): ... this. Use it. Remove bogus code
allowing ExprClass.Type and ExprClass.Namespace for
ResolveFlags.VariableOrValue.
(Expression.Resolve) [1-argument variant]: Change default resolve
flags based on language version.
(Expression.Error_UnexpectedKind): Use a simple string array
rather than an ArrayList.
* expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
not ExprClass.Type.
(TypeOfVoid.DoResolve): Likewise.
(MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
flags argument -- it always has the same value.
2005-05-31 Raja R Harinath <rharinath@novell.com>
Fix #75081.
* ecore.cs (Expression.ResolveLValue): Add a Location parameter.
Use it in the error message.
* assign.cs, expression.cs, statement.cs: Update.
2005-05-30 Raja R Harinath <rharinath@novell.com>
Fix #75088.
* ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
the "almostMatchedMember" case too.
* typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
that failed the accessibility checks to 'almost_match'.
2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
* attribute.cs: Use internal MethodBuilder methods to set
ExactSpelling and SetLastError on PInvoke methods, instead
of passing them via charset. Fixes #75060.
2005-05-27 Raja R Harinath <rharinath@novell.com>
* parameter.cs (Parameter): Remove TODO comment.
(Parameter.DefineParameter): Remove Location parameter.
(Parameters.LabelParameters): Likewise.
* class.cs (Constructor.Emit): Update to change.
(MethodData.Emit): Likewise.
* anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
* delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
* parameter.cs,
Removed Parameters.Location and added Parameter.Location instead.
Removed Location parameter from Emit() and GetSignature().
* anonymous.cs,
class.cs,
cs-parser.jay,
delegate.cs,
iterators.cs,
statement.cs :
Modified all related calls.
2005-06-21 Martin Baulig <martin@ximian.com>
* generic.cs (NullCoalescingOperator.Emit): Make this work if the
left-hand side is not a nullable type; fixes #75328.
2005-06-21 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
(TypeManager.GetFullNameSignature): Likewise.
* convert.cs (Convert.Error_CannotImplicitConversion): Compare
`source.FullName' and `target.FullName' to check whether there are
two conflicting definitions.
2005-06-21 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitTypeParameterConversion): Always use
a BoxedCast - also for reference types - to be compatible with csc.
2005-06-21 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.DoResolve): Add support for nested
types in a generic instance; fixes #75320.
2005-06-20 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.InferType): Also walk the class
hierarchy for generic instances; fixes #75261.
2005-06-17 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
to make things work for corlib.
2005-06-15 Martin Baulig <martin@ximian.com>
* attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
obsolete `SecurityAction' values.
2005-06-06 Marek Safar <marek.safar@seznam.cz>
* rootcontext.cs: Reset TargetExt as well.
2005-06-09 Martin Baulig <martin@ximian.com>
* delegate.cs (Delegate.VerifyMethod): Added
`MethodGroupExpr old_mg' argument; inherit its
`HasTypeParameters'; fix #75085.
2005-06-09 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.OverloadResolve): Correctly handle
generic methods for the SetMemberIsUsed(); fix #75064.
2005-06-09 Martin Baulig <martin@ximian.com>
* statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
fixes #75062.
2005-06-08 Martin Baulig <martin@ximian.com>
* cs-parser.jay (nullable_type_or_conditional): If we put the
nullable back and our `type' is a `ComposedCast', remove the
nullable from it. Fixes #75156.
* expression.cs (ComposedCast.RemoveNullable): New public method.
2005-06-08 Martin Baulig <martin@ximian.com>
The big Iterators rewrite :-)
* iterators.cs: Rewrite this to use the anonymous methods framework.
* rootcontext.cs (RootContext.DefineTypes): Define Delegates
before the TypeContainers; see 2test-21.cs.
* class.cs
(TypeContainer.DefineType): Don't create a new EmitContext if we
already have one (this only happens if we're an Iterator).
(TypeContainer.Define): Also call Define() on all our iterators.
(Method.CreateEmitContext): Added support for iterators.
* anonymous.cs
(AnonymousContainer): New abstract base class for `AnonymousMethod'.
(AnonymousContainer.CreateMethodHost): Moved here from
AnonymousMethod and made abstract.
(AnonymousContainer.CreateScopeType): New abstract method.
(AnonymousContainer.IsIterator): New public property.
(ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
get the ScopeTypeBuilder rather than manually defining it here.
(ScopeInfo.EmitScopeInstance): New public method; correctly handle
iterators here.
* driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
before RootContext.DefineTypes().
* codegen.cs (EmitContext.RemapToProxy): Removed.
(EmitContext.CurrentAnonymousMethod): Changed type from
AnonymousMethod -> AnonymousContainer.
(EmitContext.ResolveTopBlock): Protect from being called twice.
(EmitContext.MapVariable, RemapParameter(LValue)): Removed.
(EmitContext.EmitThis): Removed the iterators hacks; use the
anonymous methods framework for that.
* statement.cs
(ToplevelBlock.Container): Make this a property, not a field.
(ToplevelBlock.ReParent): New public method; move the
ToplevelBlock into a new container.
(Foreach.TemporaryVariable): Simplify.
2005-06-05 Martin Baulig <martin@ximian.com>
* statement.cs (LocalInfo.CompilerGenerated): New flag.
(Block.AddTemporaryVariable): New public method; creates a new
`LocalInfo' for a temporary variable.
(Block.EmitMeta): Create the LocalBuilders for all the temporary
variables here.
(Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
non-iterator variables.
2005-06-05 Martin Baulig <martin@ximian.com>
* statement.cs (Foreach.TemporaryVariable): Create the
LocalBuilder in the Emit phase and not in Resolve since in some
situations, we don't have an ILGenerator during Resolve; see
2test-19.cs for an example.
2005-06-04 Martin Baulig <martin@ximian.com>
The big Foreach rewrite - Part II.
* typemanager.cs (TypeManager.object_getcurrent_void): Replaced
with `PropertyInfo ienumerator_getcurrent'.
* codegen.cs (VariableStorage): Removed.
* statement.cs
(Foreach): Derive from Statement, not ExceptionStatement.
(Foreach.CollectionForeach): New nested class. Moved all the code
dealing with collection foreach here.
(Foreach.ForeachHelperMethods): Removed.
(Foreach.TemporaryVariable): Implement IMemoryLocation.
2005-05-23 Martin Baulig <martin@ximian.com>
* statement.cs (Try.DoResolve): Don't create a `finally' if we
don't need to. Fix #75014.
2005-05-26 Raja R Harinath <rharinath@novell.com>
Improve user-defined conversion handling.
* convert.cs (GetConversionOperators): Rewrite. Return only the
applicable operators.
(AddConversionOperators): New. Helper for GetConversionOperators.
(FindMostEncompassedType, FindMostEncompassingType): Verify that
there is only one most encompassed/encompassing type.
(FindMostSpecificSource, FindMostSpecificTarget): Remove
"applicable operator" handling.
(UserConversion): Move cache here from GetConversionOperators.
Directly cache the chosen operator, rather than the whole
MethodGroup.
(ExplicitNumericConversion): Fix buggy implementation of Decimal
case. Allow conversion of decimal to sbyte and byte too.
* expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
New static methods. Used to avoid allocating EmptyExpressions in
convert.cs.
2005-05-24 Duncan Mak <duncan@novell.com>
* ecore.cs (CastFromDecimal): New class for casting a decimal to
another class, used in Convert.ExplicitNumericConversion.
(CastToDecimal): New class, similar to above, but casts to
System.Decimal, used in Convert.ImplicitNumericConversion and also
in explicit convesion from double/float to decimal.
* convert.cs (ImplicitNumericConversion): Handle implicit
conversions to System.Decimal.
(ExplicitNumericConversion): handle explicit conversions to
System.Decimal.
This fixes #68711.
2005-05-20 Miguel de Icaza <miguel@novell.com>
* typemanager.cs: Do not throw an exception in the TypeBuilder
case, we take care of it on the TypeCode.
2005-05-17 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.ResolveArguments): GuidAttribute check
is back.
* cs-parser.jay: Catch more lexical errors.
* report.cs: Add one more Error method.
* rootcontext.cs,
* typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2005-05-20 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.CircularDepException): Removed.
(TypeContainer.DefineType): Removed the `InTransit' stuff.
(TypeContainer.CheckRecursiveDefinition): Check for circular class
(CS0146) and interface (CS0529) dependencies here.
2005-05-20 Martin Baulig <martin@ximian.com>
* expression.cs (New.DoResolve): Move the CS0712 check above the
CS0144 check; otherwise it can never be reached.
2005-05-20 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2005-05-20 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Fix CS0698 check.
* typemanager.cs (TypeManager.IsAttributeType): New public method.
2005-05-19 Martin Baulig <martin@ximian.com>
* delegate.cs
(ImplicitDelegateCreation.Check): Added `bool check_only' argument
to disable error reporting.
* convert.cs (Convert.ImplicitStandardConversionExists): Use it
here since we don't want to report an error; see the new test-336.cs.
2005-05-19 Raja R Harinath <rharinath@novell.com>
* statement.cs (ToplevelBlock.GetParameterReference)
(ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
Move here from class Block.
* ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
* expression.cs (ParameterReference.DoResolveBase): Likewise.
2005-05-18 Martin Baulig <martin@ximian.com>
Fix #74978.
* flowanalysis.cs
(FlowBranching.Reachability): Add non-static public And() and Or()
methods.
(FlowBranchingSwitch): New class; do the `break_origins' thing
like in FlowBranchingLoop.
(FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
reachability, not just locals and parameters.
(FlowBranching.MergeChild): Remove some of the hacks for loop and
switch; MergeBreakOrigins() now takes care of that.
2005-05-18 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
a loop and may leave it, reset the barrier; fixes #74974.
2005-05-16 Raja R Harinath <rharinath@novell.com>
Fix test-382.cs. Emit values of decimal constants.
* class.cs (TypeContainer.RegisterFieldForInitialization): New.
Carved out of ...
(TypeContainer.AddField): ... this.
(TypeContainer.EmitFieldInitializers): Allow the list of fields
with initializers to include 'Const's.
(ClassPart.RegisterFieldForInitialization): Forward to
PartialContainer.
* const.cs (Const.Const): Pass initializer to base class.
(Const.Define): In case of decimal constants, register them for
initialization in a static constructor.
2005-05-14 Martin Baulig <martin@ximian.com>
* statement.cs (Block.Resolve): Correctly handle unreachable code;
do not call ResolveUnreachable() on unreachable statements in
here, see the comment in the source code.
2005-05-13 Raja R Harinath <rharinath@novell.com>
Fix #74934.
* expression.cs (BinaryResolveOperator): If one of the operands of
an equality comparison is 'null' and the other is a pointer type,
convert the null to a NullPointer.
* convert.cs (ImplicitReferenceConversion): If the expression is a
NullLiteral and the target type is a pointer type, return a
NullPointer instead.
(ImplicitConversionStandard): Likewise.
2005-05-13 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Set readonly context based on special constructs.
* expression.cs (LocalVariableReference.DoResolveBase): Improved
readonly variable error handling.
* rootcontext.cs (EmitCode): Don't verify members when error
occurred.
* statement.cs (LocalInfo): Add reaodnly context information.
(SetReadOnlyContext, GetReadOnlyContext): New methods.
2005-05-17 Martin Baulig <martin@ximian.com>
* expression.cs (Argument.Resolve): Turn on flow analysis; fix
#70970.
2005-05-13 Martin Baulig <martin@ximian.com>
* statement.cs (Block.Resolve, ResolveUnreachable): Correctly
handle unreachable blocks.
2005-05-13 Martin Baulig <martin@ximian.com>
* class.cs
(ConstructorInitializer.GetOverloadedConstructor): Don't crash.
(MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
#74905.
2005-05-13 Martin Baulig <martin@ximian.com>
* statement.cs (Block.Resolve): Make the `bool unresolved' flag an
instance variable, not a local. Fix #74873.
(Block.ResolveUnreachable): Set it to true here.
2005-05-12 Martin Baulig <martin@ximian.com>
* cs-parser.jay (property_declaration): Pass the `current_class',
not the `current_container' to Property's .ctor. Fixes #74912.
2005-05-11 Martin Baulig <martin@ximian.com>
* typemanager.cs (Closure): Copy this from MCS and merge all the
GMCS-specific changes into it.
2005-05-12 Raja R Harinath <harinath@gmail.com>
Fix #74920.
* typemanager.cs (unmanaged_enclosing_types): New.
(IsUnmanagedType): Avoid infloops by using
'unmanaged_enclosing_types' to talk with recursive invocations.
2005-05-11 Duncan Mak <duncan@novell.com>
* cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
continuing to process for 'arg'.
(handle_preprocessing_directive): Check the argument of the #endif
directive and report error CS1025 if there are any trailing
characters.
According to the C# spec, having even whitespace after the #endif
directive is illegal; however, because we call arg.TrimEnd ()
beforehand, we have the same behavior as csc, allowing whitespace
after the directive.
Fixes #74892.
2005-05-11 Marek Safar <marek.safar@seznam.cz>
Fix #74863.
* class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
(Constructor.GetObsoleteAttribute): Implemented correctly.
2005-05-10 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints.Resolve): Report CS0246 if we cannot
resolve the type; fixes #74864.
(DefaultValueExpression): Create the LocalTemporary in Emit(), not
in DoResolve(); fixes #74862.
2005-05-10 Martin Baulig <martin@ximian.com>
* support.cs (ReflectionParameters.ParameterModifier): Use
`Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
and `ParameterAttributes.In'. Fixes #74884.
2005-05-10 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
the cache if we're just looking for `MemberTypes.NestedType' in a
generic instance.
* ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
constraints if we're still resolving the type tree.
(Expression.MemberLookup): If we're resolving the type tree, only
look for `MemberTypes.NestedType' since we're only interested in
getting types.
* class.cs (TypeContainer.DefineType): Don't resolve the type
parameters here; do this later in ResolveType() after the type
tree has been resolved.
(TypeContainer.ResolveType): New public method; this is called
after the type tree is resolved and before the types are being
populated. We resolve the generic constraints here.
(TypeContainer.DoDefineMember): Check the constraints on our base
class and interfaces.
* decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
set the `ResolvingTypeTree' flag on the EmitContext.
* codegen.cs (EmitContext.ResolvingTypeTree): New public field.
2005-05-10 Marek Safar <marek.safar@seznam.cz>
* class.cs (Method.Define): Catch attempt for Finalizer declaration.
* expression.cs (Argument.GetParameterModifier): Turned to property.
(Invocation.Error_InvalidArguments): Add more descriptive errors.
* parameter.cs (Parameter.GetModifierSignature): Translates modifier to
its C# equivalent.
2005-05-09 Raja R Harinath <rharinath@novell.com>
Fix #74852.
* decl.cs (MemberCache.AddMethods): Register override methods,
rather than non-override methods.
* typemanager.cs (RegisterOverride): New.
(IsOverride): Update.
2005-05-09 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
2005-05-06 Martin Baulig <martin@ximian.com>
* attribute.cs
(Attributable.IsClsComplianceRequired): Fix typo in the method name.
(AttributeTester.AnalyzeTypeCompliance): Add generics support.
2005-05-09 Marek Safar <marek.safar@seznam.cz>
Fix #73105.
* ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
recursive declaration.
* statement.cs (Block.ResolveMeta): Report any error in resolving.
2005-05-06 Marek Safar <marek.safar@seznam.cz>
* cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
* expression.cs (Binary.DoResolve): (x && 0) is always 0.
2005-05-05 Raja R Harinath <rharinath@novell.com>
Fix #74797.
* decl.cs (DeclSpace.FamilyAccessible):
Use TypeManager.IsNestedFamilyAccessible.
Fix reopened #64812.
* typemanager.cs (Closure.Filter): Introduce checks for 'protected
internal'.
2005-05-04 Raja R Harinath <rharinath@novell.com>
Abin Thomas <projectmonokochi@rediffmail.com>
Anoob V E <projectmonokochi@rediffmail.com>
Harilal P R <projectmonokochi@rediffmail.com>
Fix #64812.
* typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
allow access to all static members.
2005-05-04 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2005-05-04 Martin Baulig <martin@ximian.com>
Fix #74655.
* statement.cs (Switch.SimpleSwitchEmit): Always emit the default
section at the end; make things work if `default' is not the last
section.
2005-05-04 Martin Baulig <martin@ximian.com>
Fix #70400.
* statement.cs (Switch): Replaced the `got_default' field with a
`default_section' one.
(Switch.CheckSwitch): Set `default_section' here.
(Switch.Resolve): If we're a constant switch and the constant is
not found, use the default section.
2005-05-03 Martin Baulig <martin@ximian.com>
* expression.cs (ArrayAccess.EmitGetLength): New public method.
* statement.cs (Foreach.ArrayForeach): New nested class.
(Foreach.TemporaryVariable): New nested class.
(Foreach.EmitArrayForeach): Removed; this is now in the new
ArrayForeach class.
2005-05-03 Raja R Harinath <rharinath@novell.com>
* pending.cs (BaseImplements): Move the #74773 fix here. This is
more conservative.
(VerifyPendingMethods): Revert change below.
* typemanager.cs (IsOverride, RegisterNonOverride): New.
* decl.cs (MemberCache.AddMethod): Register "non-override" methods
that used to trigger warning -28. Remove warning -28.
* expression.cs (Invocation.OverloadResolve): Use
TypeManager.IsOverride to distinguish override methods.
Fix #74773.
* pending.cs (VerifyPendingMethods): If a base type implements the
requested interface, don't bother checking individual methods of
the base type. As a side-effect, this prevents the creation of
unnecessary proxies.
2005-05-02 Martin Baulig <martin@ximian.com>
Fix #70182.
* flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
Also `And' the locals if the old vector is null.
(FlowBranching.UsageVector.BitVector.And): Allow `vector' being
null; in this case we basically reset all the variables.
2005-05-02 Martin Baulig <martin@ximian.com>
Fix #74529.
* flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
Added `FlowBranching branching' argument; always `and' the
variables instead of `or'ing them unless we're an infinite loop.
* statement.cs (While.Resolve): Create a new sibling unless we're
infinite.
2005-05-02 Martin Baulig <martin@ximian.com>
Fix #70140.
* class.cs (ConstructorInitializer.Resolve): Added `Block block'
arguments; use it instead of creating a new TopLevelBlock.
(Constructor.Emit): Call `block.ResolveMeta ()' before resolving
our ConstructorInitializer.
* statement.cs
(TopLevelBlock.TopLevelBranching): New public property.
(TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
and create our `TopLevelBranching'.
* codegen.cs (EmitContext.ResolveTopBlock): If we're not an
anonymous method host, use `block.TopLevelBranching' rather than
creating a new branching.
2005-04-20 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (ScopeInfo.AddChild): when adding a new child to
a ScopeInfo, if any of the current children is a child of the new
entry, move those children there.
2005-04-30 Martin Baulig <martin@ximian.com>
* statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
at the beginning of a SwitchSection. Fix #73335.
2005-04-27 Marek Safar <marek.safar@seznam.cz>
Fix #74378
* class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
* ecore.cs (FieldExpr): Add a new ctor with in_initializer.
(FieldExpr.DoResolve): Obsolete members are ignored for field
initializers.
2005-04-26 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
of arrays detection.
* class.cs (Interface.VerifyClsCompliance): Add base interfaces
verification.
(Field.VerifyClsCompliance): Volatile fields are not compliant.
* decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
arrays report.
2005-04-25 Ben Maurer <bmaurer@ximian.com>
* cs-parser.jay: Use the prefered version of -unsafe in error
message.
2005-04-22 Marek Safar <marek.safar@seznam.cz>
* driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
circumstances.
2005-04-20 John Luke <john.luke@gmail.com>
* driver.cs: fix typo in error message, --outout to --output
2005-04-30 Martin Baulig <martin@ximian.com>
* attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
handle the .NET 2.x security attributes.
2005-04-30 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.ExpandInterfaces): Don't add things twice.
* class.cs
(TypeContainer.VerifyClsCompliance): Allow generic instances.
2005-04-29 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints.ResolveTypes): Expand interfaces.
* anonymous.cs: Added support for anonymous generic methods.
2005-04-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetInterfaces): Correctly handle
generic instances.
2005-04-29 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.HasConstructorConstraint): Removed.
* expression.cs (New.DoResolve): Fix the CS0304 check.
2005-04-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetFullName): Updated to the new
naming schema.
* class.cs (MethodCore.IsDuplicateImplementation): If we're an
explicit interface implementation, compare the interface types.
(MethodData.Define): Use the new naming scheme from the latest
.NET 2.x beta2.
(MemberBase.DoDefineBase): Resolve `InterfaceType' here.
* decl.cs (MemberName.GetMemberName): Removed.
(MemberName.MethodName, FullName): New properties.
2005-04-25 Raja R Harinath <rharinath@novell.com>
* gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2005-04-22 Martin Baulig <martin@ximian.com>
* generic.cs (GenericMethod): Create the EmitContext in the
`Define()'; in `Define(MethodBuilder)', create the type parameters
before calling `Define()'. Fixes #73933.
2005-04-22 Martin Baulig <martin@ximian.com>
* generic.cs
(Constraints.Resolve): Make things work wrt. the new type lookup system.
(ConstructedType.ResolveAsTypeTerminal): Don't override this.
* ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
ConstructedType, check its constraints.
2005-04-20 Marek Safar <marek.safar@seznam.cz>
* codegen.cs (InRefOutArgumentResolving): New field.
* ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
fields outside contructor.
* expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2005-04-19 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CaptureContext.EmitParameterInstance): The
parameter code was not completed ever, so it was not as up-to-date
as local variables. Must finish it.
The bug fix was to compare the Toplevel of the block, not the
current block. Thanks for Ben for pointing this out.
2005-04-19 Raja R Harinath <rharinath@novell.com>
* decl.cs (AddMethods): Use the declaring type of the problem
method to determine if we want to squash a warning.
2005-04-19 Marek Safar <marek.safar@seznam.cz>
* attribute.cs: Removed debug output.
* decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
* driver.cs (Driver.parse): Synchronize parser ErrorOutput with
Report.Stderr.
2005-04-18 Raja R Harinath <rharinath@novell.com>
Fix #74481.
* expression.cs (Binary.EqualsNullIsReferenceEquals): New.
(Binary.DoResolveOperator): Use it to avoid blindly optimizing out
all null comparisons against reference types.
2005-04-18 Marek Safar <marek.safar@seznam.cz>
Fix# 74565
* class.cs (TypeContainer.CircularDepException) New nested
exception class.
(GetPartialBases, GetNormalBases, GetClassBases): Removed error.
(TypeContainer.DefineType): Removed error, reset InTransit before
exit.
(Class.DefineType): Throw exception when is in Transit.
Catch exception and report error.
(Struct.DefineType): Throw exception when is in Transit.
Catch exception and report error.
(Interface.DefineType): Throw exception when is in Transit.
Catch exception and report error.
* codegen.cs: Add InCatch,InFinally to EmitContext to easily
handle nested exception handlers.
* flowanalysis.cs (InTryWithCatch): New method, search for try with
a catch.
* iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
InFinally and InCatch storage.
* statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
(Catch.Resolve): Set and Restore ec.InCatch.
(Try.Resolve): Set and Restore ec.InFinally.
(Try.HasCatch): True when try has catch.
2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : In some cases FilterName returns MonoEvent and MonoField
for the same event member, so exclude such cases from warning 419.
Fixed bug #74633.
2005-04-16 Miguel de Icaza <miguel@novell.com>
* expression.cs (Binary.ResolveOperator): Apply patch from John
Luke to fix bug 59864: operators &, | and ^ on enumerations
require that the same enum type on both sides.
* driver.cs: Add warnings to old flag usage, this is to assist
people who produce Makefiles and hope that the Makefiles will be
used on Windows.
* class.cs (TypeContainer.EmitType): Moved the definition of the
special $PRIVATE$ field from the resolve phase to the Emit phase.
During resolve we do not know if we are a struct with
HasExplicitLayout, we know this only after the attributes for the
type are emitted.
Set the FieldOffset to zero on the dummy field that we create for
the class. Fixes 74590.
2005-04-16 Raja R Harinath <rharinath@novell.com>
Fix #73834.
* ecore.cs (PropertyExpr.resolved): New.
(DoResolve): Use it to handle a case of double resolution here.
Handle a case of identical-name-and-type-name.
* expression.cs (ArrayCreation.CheckIndices): Avoid double
resolution by storing the results of expression resolution back
into the "probes" array.
2005-04-15 Raja R Harinath <rharinath@novell.com>
Fix cs0208-7.cs and cs0208-8.cs.
* typemanager.cs (IsUnmanagedType): Arrays are not allowed
(cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
error reporting to point out the reason a struct is not unmanaged.
2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2005-04-13 Raja R Harinath <rharinath@novell.com>
Fix #74528.
* ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
IdenticalNameAndTypeName here.
(EventExpr.InstanceResolve): Likewise.
2005-04-13 Marek Safar <marek.safar@seznam.cz>
C# 2.0 DefaultCharSetAttribute implementation
* attribute.cs (Attribute.ResolveAsTypeStep): New protected method
which allows us to set GlobalNamespace for every resolve.
(Attribute.ResolveArguments): Cut from Resolve.
(Attribute.GetCharSetValue): Returns CharSet named argument.
(Attribute.DefinePInvokeMethod): Gets default charset from
module settings.
(GlobalAttribute.ResolveAsTypeStep): Override.
(GlobalAttribute.ResolveArguments): Override.
* class.cs (TypeAttr): Is protected.
* codegen.cs (ModuleClass.DefaultCharSet): New member.
(ModuleClass.DefaultCharSetType): New memeber.
(ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
* decl.cs (Decl.TypeAttr): New protected virtual. Returns default
charset from module.
* delegate.cs (TypeAttr): Override.
(Delegate.DefineType): Use this TypeAttr.
* driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
at very early stage (before types are defined) to resolve model
module attributes. It will probably not work with corlib but it
should be ok.
* enum.cs (Enum.TypeAttr): New protected virtual. Returns default
charset from module.
* typemanager.cs (default_charset_type): New type.
2005-04-13 Raja R Harinath <rharinath@novell.com>
* decl.cs (MemberCache.AddMethods): Don't warn if
System.Object.Finalize has buggy MethodAttributes.
* typemanager.cs (IsUnmanagedType): Restore !IsValueType check
removed below.
2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : detect ambiguous reference to overloaded members.
Fixed bug #71603. MS 1.1 csc does not detect it.
2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : delegates must not be referenced with parameters.
Fixed bug #71605.
2005-04-12 Miguel de Icaza <miguel@novell.com>
* typemanager.cs (IsUnmanagedType): Arrays are allowed.
2005-04-10 Miguel de Icaza <miguel@novell.com>
* driver.cs (MainDriver): Stop processing if the CLS stage found
errors.
(CompilerCallableEntryPoint.InvokeCompiler): Always
reset after execution; Take a TextWriter argument for the
output.
* report.cs: Use the error stream instead of hardcoding stderr.
2005-04-09 Miguel de Icaza <miguel@novell.com>
* class.cs: Reduce code paths to test, too small of an
optimization to make it worth the extra testing. Always perform
it.
2005-04-08 Raja R Harinath <rharinath@novell.com>
Fix #74510.
* class.cs (OperatorArrayList.CheckPairedOperators): Skip
operators that had errors reported on them.
2005-04-08 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.IsValidArgumentType): Test valid named
argument types.
(Attribute.Resolve): Add named argument type checking.
* class.cs (FixedField.Define): Use IsPrimitiveType
* expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
* iterators.cs (Iterator.DefineIterator): Add check for arglist and
unsafe parameter types.
* statement.cs (Using.ResolveExpression): Add better error description.
* typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2005-04-08 Raja R Harinath <rharinath@novell.com>
Fix #74484.
* attribute.cs (Attribute.GetAttributeUsage): Resolve
AttributeUsageAttribute in the emitcontext of the attribute class,
not in the emitcontext of the attributable entity it was attached to.
* cs-parser.jay: Use 'current_class', not 'current_container',
when creating a GlobalAttribute.
2005-04-08 Alp Toker <alp@atoker.com>
* pending.cs: The fix to #58413 failed to compile methods implementing
interfaces with/without params modifiers and vice versa, even though
params modifiers aren't part of the signature. Make the modifier check
less strict as in csc.
2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
Anoob V E <projectmonokochi@rediffmail.com>
Harilal P R <projectmonokochi@rediffmail.com>
Fix #58413.
* pending.cs (TypeAndMethods.mods): New. Store the parameter
modifiers of pending methods.
(PendingImplementation.PendingImplementation): Initialize it.
Add Parameter.Modifier [][] mods and initialize it with ParameterData.
(PendingImplementation.InterFaceMethod): Repalce Type[] argument
with ParameterData. Add check for modifiers.
* class.cs (MethodData.Define): Update to changes.
2005-04-07 Raja R Harinath <rharinath@novell.com>
* ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2005-04-07 Marek Safar <marek.safar@seznam.cz>
* class.cs (PropertyMethod.Define): Check private accessor in abstract
property.
* decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
* rootcontext.cs,
* typemanager.cs: Registered RequiredAttributeAttribute.
2005-04-06 Marek Safar <marek.safar@seznam.cz>
* class.cs (VerifyMembers): Doesn't need EmitContext argument.
Warning CS0169 is back at level 3.
(IMethodData.SetMemberIsUsed): New method.
* decl.cs (IsUsed): New value; moved from FieldBase.Status
(SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
* delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
* ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
contants.
(PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
is used.
* expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
is used.
* rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
to avoid the problems with nested types.
2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
Anoob V.E <projectmonokochi@rediffmail.com>
Harilal P.R <projectmonokochi@rediffmail.com>
Raja R Harinath <rharinath@novell.com>
Fix #73820.
* delegate.cs (Define): Emit ParamArrayAttribute for 'params'
attribute.
* typemanager (GetConstructor): Make public.
2005-04-05 John Luke <john.luke@gmail.com>
Raja R Harinath <rharinath@novell.com>
Fix #62232.
* typemanager.cs (IsUnmanagedType): Check non-public fields of a
struct too. Return false quicker in a few cases.
(VerifyUnManaged): Use it.
2005-04-05 Raja R Harinath <rharinath@novell.com>
Fix #74041.
* statement.cs (Block.Resolve): Initialize 'unreachable' to false,
not 'unreachable_seen'.
2005-04-04 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.GetValue): Removed unused.
* codegen.cs (CodeGen.TrimExt): Removed unused.
* cs-parser.jay (output): Removed unused.
* cs-tokenizer.cs (hex_digits): Removed unused.
* enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
* expression.cs (Indirection.LoadExprValue): Removed unused.
(ArrayCreation.ExpressionToArrayArgument): Removed unused.
* iterators.cs (Iterator.param_types): Removed unused.
* statement.cs (Goto.block): Removed unused.
(ToplevelBlock.did): Removed unused.
(Switch.ResolveConstantSwitch): Removed unused.
2005-04-01 Ben Maurer <bmaurer@ximian.com>
* rootcontext.cs: Allow mcs to bootstrap with the compilation
resetting thingy.
2005-04-19 Martin Baulig <martin@ximian.com>
Merged r42462 from MCS and made it work for GMCS.
* class.cs (MethodCore.ds): Moved this field to `MemberBase'.
* generic.cs (GenericMethod.Define): Removed `return_type' argument.
2005-04-01 Raja R Harinath <rharinath@novell.com>
Fix #74232 and cs0208-3.cs.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
* typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
unmanaged type. Don't use FieldBuilders when 't' is a
TypeBuilder. Use ModFlags and MemberType fields.
* class.cs (MemberBase.member_type): Rename from MemberType.
(MemberBase.MemberType): New property. Determines member_type on
demand.
(MemberBase.DoDefine): Don't initialize MemberType here.
(FieldMember.Define): Likewise.
2005-04-01 Marek Safar <marek.safar@seznam.cz>
Fix #74241
* class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
Attributes are emitted there.
2005-04-01 Raja R Harinath <rharinath@novell.com>
* cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
keyword in 'partial enum' too.
* cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
is not allowed).
Report from Kamil Skalski <nazgul@omega.pl>.
Fix #74309.
* rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
have partial containers too.
* ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
in block' checks to Block.CheckInvariantMeaningInBlock.
* statement.cs (Block.GetKnownVariableInfo): Make private.
(Block.IsVariableUsedInChildBlock): Remove.
(Block.IsVariableUsedInBlock): Likewise.
(Block.CheckInvariantMeaningInBlock): New. Show location of
conflicting declaration.
(Block.AddVariable): Make error messages less long-winded and more
specific. Show location of conflicting declaration.
* parameter.cs (Parameters.Location): New readonly property.
2005-03-31 Raja R Harinath <rharinath@novell.com>
Clean up semantics of invoking ResolveMemberAccess.
* ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
can have an instance, ensure that we pass in a non-TypeExpression
to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
(MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
argument. Update to changes and simplify.
(FieldExpr.Emitinstance): Remove CS0120 check.
(PropertyExpr.EmitInstance): Likewise.
* expression.cs (Argument.Resolve): Likewise.
(Invocation.DoResolve): Update to changes in semantics of
InstanceExpression.
2005-03-31 Marek Safar <marek.safar@seznam.cz>
Fix #74241
* class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
customization.
* decl.cs (MemberCache.AddMethods): Fix infinite loop.
2005-03-31 Raja R Harinath <rharinath@novell.com>
Fix difference in behaviour with commandline invocation.
* driver.cs (Driver.Reset): New.
(CompilerCallableEntryPoint): Call it.
* statement.cs (If.Resolve): Avoid spurious "uninitialized
variable" warnings if the boolean expression failed to resolve.
2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
* attribute.cs: Fix the union of several permissions when some of them
are unrestricted (so the result isn't an unrestricted permission set).
Fix #74036.
2005-03-30 Raja R Harinath <rharinath@novell.com>
* ecore.cs (MemberExpr): New class. Convert from interface
IMemberExpr.
(MemberExpr.ResolveMemberAccess): Refactor and move here from
MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
error checks.
(MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
(MethodGroupExpr.IsExplicitImpl): Remove.
(Expression.GetFieldFromEvent): Remove.
(SimpleName.MemberStaticCheck): Remove.
(SimpleName.DoSimpleNameResolve): Update to changes.
* expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
(MemberAccess.IdenticalNameAndTypeName): Remove.
(MemberAccess.error176): Move to MemberExpr.
(MemberAccess.DoResolve): Update to changes.
(BaseAccess.DoResolve): Likewise.
2005-03-30 Marek Safar <marek.safar@seznam.cz>
C# 2.0 Conditional attribute class implementation
* attribute.cs (AttributeTester.IsAttributeExcluded): New method.
Analyzes class whether it has attribute which has ConditionalAttribute
and its condition is not defined.
* class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
(Class.IsExcluded): New method. Search for at least one defined
condition in ConditionalAttribute of attribute class.
2005-03-30 Raja R Harinath <rharinath@novell.com>
* ecore.cs (PropertyExpr): Derive from Expression, not
ExpressionStatement.
(PropertyExpr.EmitStatement): Remove.
2005-03-29 Raja R Harinath <rharinath@novell.com>
Fix #74060.
* expression.cs (MemberAccess.ResolveMemberAccess): Allow the
internal field "value__" of an enum be private. The examples for
"value__" that I found on MSDN all used FieldAttributes.Private.
* decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
Don't mention IL method attribute names.
Fix #47991. Remove a TODO.
* statement.cs (Block.Toplevel): Make into a field.
(Block.Parameters): Move into ToplevelBlock.
(Block.known_variables): Rename from child_variable_names.
(Block.Block): Remove variants that take Parameters. Initialize
'Toplevel' with the immediately surrounding toplevel block.
(Block.AddKnownVariable): Rename from AddChildVariableName. Add a
LocalInfo parameter.
(Block.GetKnownVariableInfo): New.
(Block.IsVariableNameUsedInChildBlock): Update.
(Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
the block, even though it may not be in scope.
(Block.AddVariable): Remove Parameters parameter. Use
Toplevel.Parameters instead.
(Block.AddConstant): Remove Parameters parameter.
(Block.GetParameterReference): Update to use Toplevel.Parameters.
(Block.IsParamaterReference): Likewise.
(Block.IsLocalParameter): Likewise. Simplify a lot.
(ToplevelBlock.Parameters): New. Moved from Block.
(ToplevelBlock.ToplevelBlock): Update to changes. Always
initialize Parameters to a non-null value.
* cs-parser.jay: Update to changes.
* ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
simple names that mean different things in the same block. Use
Block.IsVariableNameUsedInBlock.
2005-03-28 Raja R Harinath <rharinath@novell.com>
* enum.cs (Enum.LookupEnumValue): Remove debugging code.
2005-03-26 Raja R Harinath <harinath@acm.org>
Fix #73038.
* assign.cs (Assign.DoResolve): When the RHS of an assignment
fails to resolve, ensure that the LHS is still resolved as an
lvalue.
2005-03-25 Raja R Harinath <harinath@acm.org>
* enum.cs (Enum.DefineType): Set ec.InEnumContext and
ec.ContainerType.
(Enum.current_ec): Remove.
(Enum.LookupEnumValue): Remove EmitContext argument.
Just uses the one created during DefineType.
(Enum.FindMembers): Update.
* expression.cs (MemberAccess.DoResolve): Update.
2005-03-22 Marek Safar <marek.safar@seznam.cz>
* assign.cs (Assign.DoResolve): Check for CS1717 when
source and target are same (uses Equals).
* expression.cs (LocalVariableReference, ParameterReference,
This): Implemented Equals, GetHashCode.
* statement.cs (Block.GetParameterReference): Removed useless
local variable.
2005-03-22 Raja R Harinath <rharinath@novell.com>
Fix cs0128.cs
* statement.cs (Block.AddVariable): Ensure that we skip implicit
blocks before deciding whether the error is cs0136 or cs0128.
* cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
(using_alias_directive, using_namespace_directive): Pass
MemberName, not an expression to Namespace.UsingAlias and
Namespace.Using.
(MakeName): Use the MemberName of the namespace.
* namespace.cs (Namespace.MemberName): New.
(UsingEntry.UsingEntry): Take a MemberName, not an expression.
(AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
Likewise.
* decl.cs (MemberName.Name): Make readonly.
(MemberName.FromDotted): New "constructor".
(MemberName.Equals, MemberName.GetHashCode): Implement overrides.
(MemberCore.Name): Compute from MemberName on demand.
(MemberCore.SetMemberName): Provide a way to change the
MemberName.
(MemberCore.AddToContainer): Don't take a fullname parameter.
* class.cs (TypeContainer.AddToMemberContainer): Don't add the
fully qualified name of the container to the member name.
(TypeContainer.AddToTypeContainer): Use a fully qualified name
only if the type is a member of the root container.
(TypeContainer.AddMethod, TypeContainer.AddProperty): Use
MemberName.Left rather than searching for an embedded ".".
(PartialContainer.CreatePart): Update to changes in RootContext.
(MemberBase.ShortName): Turn into a property. Use
MemberCore.SetMemberName.
(MemberBase.ExplicitInterfaceName): Remove.
(MemberBase.UpdateMemberName): Remove.
(AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
(PropertyBase.SetMemberName): New override.
* tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
(Tree.GetDecl): New.
(Tree.AllDecls): Rename from Decls.
* attribute.cs, enum.cs, report.cs: Update to changes.
* driver.cs (MainDriver): Use MemberName.FromDotted on
RootContext.MainClass.
2005-03-21 Marek Safar <marek.safar@seznam.cz>
* class.cs (FixedField.Define): Check for CS1664 and more sanity
checks.
* expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2005-03-18 Marek Safar <marek.safar@seznam.cz>
* modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
property accessor modifiers.
* class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
fixed buffer attribute (CS1716).
(PropertyMethod.HasCustomAccessModifier): When property accessor
has custom modifier.
* ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
modifiers.
(PropertyExpr.DoResolveLValue): Add CS0272.
2005-03-17 Miguel de Icaza <miguel@novell.com>
* convert.cs: When converting to a pointer, use the proper Conv.U
or Conv.I depending on the source data type.
* cs-tokenizer.cs: Make the size for large decimal constants,
fixes #72957.
2005-03-17 Martin Baulig <martin@ximian.com>
* anonymous.cs (AnonymousMethod.method_modifiers): Change default
from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2005-03-17 Martin Baulig <martin@ximian.com>
* anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
to bool so we can return an error condition.
(AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
returned an error.
2005-03-16 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
attributes.
2005-03-16 Raja R Harinath <rharinath@novell.com>
Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
Refactor to avoid traversing the list of assemblies, and to avoid
string concatenation.
* typemanager.cs (guid_attr_type): Remove.
(negative_hits, pointers, references): Remove hashes.
(type_hash): New.
(GetConstructedType): New. Uses type_hash to handle constructed
types (arrays, references, pointers).
(GetReferenceType, GetPointerType): Use it.
(GetNestedType): New. Uses type_hash to handle nested types of
reflected types.
(LookupType, LookupTypeDirect): Remove.
(CoreLookupType): Inline parts of old LookupTypeDirect code. Use
'types' hash and LookupTypeReflection directly.
(params_string, params_object): Use GetConstructedType.
* namespace.cs (Namespace.cached_types): New. Cache of reflected
top-level types.
(Namespace.Lookup): Use cached_types.
(NamespaceEntry.LookupNamespaceOrType): Inline the functionality
provided by old TypeManager.LookupType.
* rootcontext.cs (MakeFQN): Remove.
* decl.cs (DeclSpace.MakeFQN): Likewise.
(DeclSpace.LookupType): Use TypeManager.GetNestedType.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Use
TypeManager.GetConstructedType.
* tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2005-04-16 Zoltan Varga <vargaz@freemail.hu>
* cs-parser.jay: Fix build.
2005-03-15 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.CircularDepException) New nested
(MethodCore.CheckBase): Report CS1715 for properties and indexers.
* cs-parser.jay: Reports CS1527 for any namespace element.
* delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
Added CS0407.
* expression.cs (ParameterReference.IsAssigned): Changed error to
CS0269.
(Error_WrongNumArguments): Moved CS0245 detection here.
* statement.cs (Return.Resolve): Add CS1622 report.
2005-03-11 Marek Safar <marek.safar@seznam.cz>
* class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2005-03-11 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs expression.cs: Get rid of some allocations.
2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : just eliminate the latest change.
2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : commented out the latest change. It breaks xml-030.cs
2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
fail. So invoke CreateType() in FindDocumentedType().
2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : added IsKeyword().
* doc.cs : Detect keyword incorrectly used as identifier.
Allow identifiers prefixed by @.
2005-03-10 Marek Safar <marek.safar@seznam.cz>
* attributes.cs (Attributes.Emit): Continue after CheckTargets.
It caused exception in namespace resolving (again!).
* class.cs (Class.ctor): Removed exit.
(PropertyMethod.ctor): ditto.
* codegen.cs (Codegen.Reset): Reset static data.
(Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
* cs-tokenizer.cs (Cleanup): Removed.
* driver.cs (GetSystemDir): Rewrote to one line command.
It caused problem with unloaded dynamic modules.
(UnixParseOption): Removed Exit.
(CompilerCallableEntryPoint.InvokeCompiler): Make static.
(CompilerCallableEntryPoint.Reset): Reset suitable static data.
Now can be mcs used as library.
* ecore.cs (Expression.ResolveBoolean): Use Location.Null for
empty location.
* location.cs (Reset): Reset static data.
* namespace.cs (Reset): Reset static data.
* report.cs (Report.Reset): Reset static data.
* rootcontext.cs (RootContext.Reset): Reset static data.
* tree.cs (RootTypes.ctor): Use Location.Null
* typemanager.cs (TypeManager.Reset): Reset static data.
(CoreLookupType): Removed Exit.
(TypeHandle.Reset): Reset static data.
2005-03-10 Raja R Harinath <rharinath@novell.com>
Fix #73516.
* typemanager.cs (ComputeNamespaces): Import namespaces from
referenced modules too.
2005-03-09 Raja R Harinath <rharinath@novell.com>
* class.cs (TypeContainer.AddToMemberContainer): Use "." rather
than '.'.
2005-03-09 Raja R Harinath <rharinath@novell.com>
* decl.cs (DeclSpace.LookupType): Don't loop but recurse into
enclosing DeclSpace. This ensures that a name-lookup populates
more caches and there are fewer 'TypeExpression's. Carve out
nested type lookup into ...
(LookupNestedTypeInHierarchy): ... this.
2005-04-15 Martin Baulig <martin@ximian.com>
Merged r41590 from MCS and make it work in the generics land.
* generic.cs (TypeParameter.UpdateConstraints): Removed the
`check' argument.
* class.cs (PartialContainer.UpdateConstraints): Removed.
(PartialContainer.CheckConstraints): Removed.
(PartialContainer.SetParameterInfo): Store the constraints here.
(PartialContainer.DefineTypeParameters): New public method;
resolve the type parameter's constraints here. Note that the
PartialContainer doesn't have an EmitContext anymore, so we must
do this in the ClassPart.
2005-03-09 Raja R Harinath <rharinath@novell.com>
Clean up a few partial-class semantics.
Fixes test-357.cs and cs1618-2.cs.
* cs-parser.jay (struct_declaration): Use 'current_class' as
parent of newly-created struct. Remove call to Register ().
Use 'pop_current_class' to complete handing the current struct.
(interface_declaration): Likewise.
(class_declaration): Likewise.
(enum_declaration): Use 'current_class' as parent of newly created
enum.
(delegate_declaration): Likewise.
(pop_current_class): New function. This is used to handle closing
up the 'current_class' and 'current_container', and pointing them
to the enclosing class/container.
(CSharpParser): Initialize 'current_class' too.
* decl.cs (MemberCore): Add check for invariant: a partial
container is not a parsed entity, and thus does not enclose any
parsed members.
(DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
(DeclSpace.BaseTypeExpr): Use it.
(DeclSpace.LookupType): Add check for invariant.
* class.cs (TypeContainer): Add check for invariant: a nested
class should have the same NamespaceEntry as its enclosing class.
(TypeContainer.EmitFieldInitializers): Make virtual.
(TypeContainer.DefineDefaultConstructor): Adhere to invariant in
MemberCore.
(TypeContainer.Register): Remove.
(TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
null. Use TypeResolveEmitContext for resolving base types and
interfaces. Move initialization of Parts.TypeBuilder here from
...
(TypeContainer.DefineNestedTypes): ... here.
(PartialContainer): Take a Namespace not a NamespaceEntry.
(PartialContainer.Create): Don't use Register. Call the
appropriate Add... function directly.
(ClassPart): Take both the PartialContainer and the enclosing
class as constructor arguments.
(ClassPart.EmitFieldInitializers): Override.
(ClassPart.PartFindNestedTypes): Remove.
(FieldBase.GetInitializerExpression): Resolve the initializer
expression in the emit context of the enclosing class.
* tree.cs (RootTypes): Remove Register ().
2005-03-08 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Removed CS0134.
* driver.cs: Removed CS1901.
* expression.cs (SizeOf.DoResolve): Don't report CS0233
for predefined types.
2005-03-07 Duncan Mak <duncan@novell.com>
* codegen.cs (Save): Catch UnauthorizedAccessException as
well. Fixes bug #73454.
2005-03-07 Marek Safar <marek.safar@seznam.cz>
* cs-tokenizer.cs (xtoken): Add CS1035.
* class.cs (MethodData.Define): Add CS0683.
(FieldMember.ctor): Add CS0681.
2005-03-07 Raja R Harinath <rharinath@novell.com>
* ecore.cs (SimpleName.DoResolve): Rename from
SimpleName.DoResolveAllowStatic.
(SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
Pass 'intermediate' flag to MemberStaticCheck.
(SimpleName.MemberStaticCheck): Skip "static check" only in case
of "intermediate" lookups via MemberAccess.
(SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
* expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2005-03-07 Raja R Harinath <rharinath@novell.com>
Fix #73394.
* ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
slipped in because of variable names that are identical to a
builtin type's BCL equivalent ('string String;', 'int Int32;').
(PropertyExpr.EmitInstance): Likewise.
2005-03-04 Marek Safar <marek.safar@seznam.cz>
* cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
* report.cs (warning_ignore_table): Made public.
2005-03-04 Raja R Harinath <rharinath@novell.com>
Fix #73282.
* class.cs (MethodData.Emit): Pass 'container' to
container.GetObsoleteAttribute instead of 'container.Parent'.
2005-03-03 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add 1534 error test.
* iterators.cs (Yield.CheckContext): Add error 1629.
(Iterator.ctor): Save unsafe modifier.
(MoveNextMethod.DoEmit): Restore unsafe context.
* namespace.cs (UsingAlias): Better error message.
2005-03-03 Dan Winship <danw@novell.com>
* convert.cs (Error_CannotImplicitConversion): fix two bugs in
the warning message [#73219]
2005-03-03 Raja R Harinath <rharinath@novell.com>
Fix compile with MCS 1.0.0.0.
* cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
w_restore to not depend on string constant folding.
2005-03-03 Raja R Harinath <rharinath@novell.com>
* decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
CS0246 check to users who passed 'silent = false'.
* ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
check.
(SimpleName.SimpleNameResolve): Update.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
(MemberAccess.IdenticalNameAndTypeName): Update.
* doc.cs (FindDocumentedTypeNonArray): Update.
2005-03-03 Raja R Harinath <rharinath@novell.com>
* codegen.cs (EmitContext): Remove ResolvingTypeTree.
* parameters.cs (ComputeAndDefineParameters): Remove.
* decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
* delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
Use GetParameterInfo.
2005-03-02 Marek Safar <marek.safar@seznam.cz>
* report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2005-03-02 Raja R Harinath <rharinath@novell.com>
Unify DeclSpace.LookupType and DeclSpace.FindType.
* decl.cs (DeclSpace.FindNestedType): New virtual function. This
is in charge of defining nested types on demand.
(DeclSpace.LookupType): Use it when the current_type is a
TypeBuilder. Use LookupTypeDirect for reflected types.
(DeclSpace.FindType): Remove.
(DeclSpace.LookupInterfaceOrClass): Likewise.
(DeclSpace.DefineTypeAndParents): Likewise.
* ecore.cs (SimpleName.ResolveAsTypeStep): Just call
DeclSpace.LookupType.
* doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
* typemanager.cs (LookupType): Simplify.
(AddUserType): Remove type from negative_hits.
* namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
* class.cs (TypeContainer.FindMembers): Move handling of nested
types ...
(TypeContainer.FindMembers_NestedTypes): ... here.
(TypeContainer.FindNestedType): Implement override.
(ClassPart.FindNestedType): Delegate to PartialContainer.
(ClassPart.PartFindNestedType): Looks up the nested types of the
part alone.
2005-04-14 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType): Moved all the type lookup and
nested class logic into SimpleName.
(ConstructedType.ResolveConstructedType): Our underlying type is
already fully resolved; all the type lookup stuff is in
SimpleName.
* ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
constructed types here instead of in ConstructedType.
* decl.cs (MemberName.GetTypeExpression): Always create a
SimpleName, not a ConstructedType.
(DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2005-03-02 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DoDefineMembers): We also need a default
static constructor in static classes.
2005-03-01 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
sizeParamIndex is not specified.
2005-03-01 Marek Safar <marek.safar@seznam.cz>
Fix #73117
* report.cs (WarningMessage.IsEnabled): Missing null check.
2005-02-28 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (DefinePInvokeMethod): Fix, all data are stored
in the fields and not in the properties.
2005-02-28 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
fields as well.
2005-02-28 Marek Safar <marek.safar@seznam.cz>
* attribute.cs: Small refactoring (improved robustness).
(ImplOptions, UnmanagedType, UsageAttribute): Removed members.
(ValidateGuid): Removed.
(Resolve): Removed referenced to above mentioned.
(GetAttributeUsage): Made private and changed to work without
class assistance.
(GetIndexerAttributeValue): Don't crash.
(GetConditionalAttributeValue): Ditto.
(GetClsCompliantAttributeValue): Ditto.
(ExtractSecurityPermissionSet): All attributes exceptions are
error 648.
(GetPropertyValue): New helper.
(GetMethodImplOptions): New method.
(DefinePInvokeMethod): Reuse common code. Implemented handling of
some missing properties.
* class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
(Method.ApplyAttributeBuilder): Updated.
* decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
exception.
2005-02-28 Raja R Harinath <rharinath@novell.com>
Fix #73052.
* report.cs (Report.SymbolRelatedToPreviousError): Handle
non-simple types (array, pointer, reference).
2005-02-28 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
* class.cs (MethodCore.IsDuplicateImplementation): Special error
for operators.
(Method.CheckBase): Catch wrong destructor here.
(MethodData.Define): Add errors 550, 668.
* cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
* ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
* pending.cs (VerifyPendingMethods): Add error 551.
* typemanager.cs (CSharpName): Next error report helper.
2005-02-25 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Atttribute.Resolve): Add cache for parameter-less
attributes. Removed useless attribute double check.
It saves almost 2MBs for corlib.
2005-02-25 Raja R Harinath <rharinath@novell.com>
Fix #72924.
* statement.cs (ExpressionStatement.Resolve): Make robust to being
called twice in case of error.
2005-02-23 Chris Toshok <toshok@ximian.com>
Fix compiler portions of #72827.
* statement.cs (Block.Emit): call Begin/EndScope on the
EmitContext instead of the ILGenerator.
* codegen.cs (EmitContext.BeginScope): new method, call
ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
we have one.)
(EmitContext.BeginScope): same, but EndScope and CloseScope
* symbolwriter.cs (SymbolWriter.OpenScope): get the current il
offset and call the superclass's OpenScope(int) with it.
(SymbolWriter.CloseScope): get the current il
offset and call superclass's CloseScope(int) with it.
2005-02-23 Marek Safar <marek.safar@seznam.cz>
* anonymous.cs (AnonymousMethod.Compatible): Fixed to report
CS1677 for out and ref as well.
* class.cs (Method.Define): Add error CS1599 detection.
* cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
* cs-tokenizer.cs (xtoken): Add error CS1646 detection.
* delegate.cs (Delegate.Define): Add error CS1599 detection.
* support.cs.cs (ModifierDesc): New helper method.
2005-02-23 Raja R Harinath <rharinath@novell.com>
Abin Thomas <projectmonokochi@rediffmail.com>
Anoob V E <projectmonokochi@rediffmail.com>
Harilal P R <projectmonokochi@rediffmail.com>
Fix #57851, #72718.
* class.cs (ConstructorBuilder.Resolve): Make sure that the second
MemberLookup (used for error reporting) actually returns a result.
Fix error report number (122, not 112).
2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
Anoob V E <projectmonokochi@rediffmail.com>
Harilal P R <projectmonokochi@rediffmail.com>
Fix #71134.
* pending.cs (PendingImplementation.GetAbstractMethods):
Find NonPublic members too.
2005-02-22 Marek Safar <marek.safar@seznam.cz>
* expression.cs.cs (ConditionalLogicalOperator.DoResolve):
Fixed error 217.
* class.cs (MethodCore.CheckMethodAgainstBase):
Add error 239 report.
2005-02-21 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
* class.cs (Operator.Define): Add error 217 report.
2005-02-21 Raja R Harinath <rharinath@novell.com>
Fix #68955.
* expression.cs (Invocation.IsApplicable): Make public.
(Invocation.IsParamsMethodApplicable): Likewise.
* delegate.cs (Delegate.VerifyApplicability): Don't use
Invocation.VerifyArgumentCompat for parameter applicability
testing. Use Invocation.IsApplicable and
Invocation.IsParamsMethodApplicable.
2005-02-21 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
* class.cs (Operator.Define): Add error 217 report.
2005-02-21 Raja R Harinath <rharinath@novell.com>
* namespace.cs (UsingEntry.Resolve): Undo change below.
2005-02-21 Raja R Harinath <rharinath@novell.com>
Fix #72756.
* ecore.cs (Expression.MemberLookupFailed): Add argument to
disable the error message when the extended MemberLookup also
fails.
(Expression.MemberLookupFinal): Update.
(SimpleName.DoSimpleNameResolve): Update.
* expression.cs (MemberAccess.ResolveNamespaceOrType):
Don't use MemberLookupFinal.
(New.DoResolve): Update.
(BaseAccess.CommonResolve): Update.
2005-02-21 Raja R Harinath <rharinath@novell.com>
Fix #72732.
* attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
occured previously, don't resolve again.
2005-02-21 Marek Safar <marek.safar@seznam.cz>
Fix #69949
* attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
argument. Call ResolveAttributeUsage for unresolved.
when types doesn't match ctor arguments.
* class.cs (DoDefineMembers.TypeContainer): Removed safety check
for nested attribute classes.
(Class.attribute_usage): Removed.
(Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
for attribute class.
* ecore.cs (IsAttribute): Removed.
* namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
* rootcontext.cs (RegisterAttribute): Removed, attributes are
now normal types.
(attribute_types): Removed.
(EmitCode): Global attributes are emited as the latest.
2005-02-18 Marek Safar <marek.safar@seznam.cz>
* class.cs (EmitFieldInitializers): Don't emit field initializer
for default values when optimilization is on.
* constant.cs (Constant.IsDefaultValue): New property.
* driver.cs: Add /optimize handling.
* constant.cs,
* ecore.cs,
* literal.cs: Implement new IsDefaultValue property.
* rootcontext.cs (Optimize): New field, holds /optimize option.
2005-02-18 Raja R Harinath <rharinath@novell.com>
Fix crasher in re-opened #72347.
* namespace.cs (Namespace.Lookup): Return null if
DeclSpace.DefineType returns null.
Fix #72678.
* expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2005-02-18 Raja R Harinath <rharinath@novell.com>
Fix remainder of #63202. Change semantics of DoResolveLValue: it
now returns null if it cannot resolve to an lvalue.
* ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
(Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
returned null. Remove check for SimpleName.
(EventExpr.DoResolveLValue): New.
* iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
* expression.cs (Argument.Error_LValueRequired): New. Move CS1510
error from ...
(Argument.Resolve): ... here. Use it. Use DoResolveLValue to
avoid CS0131 error.
(Unary.ResolveOperator): Move CS0211 check ...
(Unary.DoResolve): ... here. Use DoResolveLValue to avoid
CS0131 error.
(Unary.DoResolveLValue): Simplify.
(AddressOf.DoResolveLValue): New.
(ArrayAccess.DoResolveLValue): New.
2005-02-16 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.Resolve): Add arguments casting for
when types doesn't match ctor arguments.
2005-02-16 Raja R Harinath <rharinath@novell.com>
Fix parts of #63202.
* expression.cs (UnaryMutator.ResolveOperator): Remove redundant
lookup of operator in base type. Ensure that all checks happen
when the operator resolves to an "op_..." method.
2005-02-15 Raja R Harinath <rharinath@novell.com>
Fix #71992.
* namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
'ignore_cs0104' parameter. Pass it to ...
(NamespaceEntry.Lookup): ... this.
* decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
* ecore.cs (SimpleName.ResolveAsTypeStep): Update.
(TypeLookupExpression.DoResolveAsTypeStep): Update.
* expression.cs (MemberAccess.IdenticalNameAndTypeName):
Update. Request that cs0104 errors be ignored.
(ComposedCast.ResolveAsTypeStep): Update.
2005-02-14 Raja R Harinath <rharinath@novell.com>
Fix #59209.
* expression.cs (Invocation.BetterFunction): Remove support for
comparing virtual functions and their overrides.
(Invocation.IsOverride): New.
(Invocation.OverloadResolve): Don't consider 'override' functions
during candidate selection. Store them in a lookaside list.
If the selected method is a 'virtual' function, use the list to
find any overrides that are closer to the LHS type.
2005-02-14 Marek Safar <marek.safar@seznam.cz>
* expression.cs (New.DoResolve): Add complex core type reduction.
(New.Constantify): Converts complex core type syntax like 'new int ()'
to simple constant.
2005-02-14 Raja R Harinath <rharinath@novell.com>
* decl.cs (EntryType.EntryType): New constructor to create an
updated copy of a cache entry.
(MemberCache.AddMethods): Use it.
(MemberCache.ClearDeclaredOnly): Remove.
(MemberCache.MemberCache): Update.
2005-02-11 Miguel de Icaza <miguel@novell.com>
* codegen.cs (EmitContext): Introduce the `MethodIsStatic'
variable. This one is represents the actual low-level declaration
of the method, as opposed to the semantic level `IsStatic'.
An anonymous method which is hosted into a static method might be
actually an instance method. IsStatic would reflect the
container, while MethodIsStatic represents the actual code
generated.
* expression.cs (ParameterReference): Use the new MethodIsStatic
instead of IsStatic.
* anonymous.cs (AnonymousMethod.Compatible): Pass the
Modifiers.STATIC to the Anonymous' Method EmitContext if static is
set on the current EmitContext.
* expression.cs (Cast): Overload DoResolveLValue so we can pass
resolve our casted expression as an LValue. This triggers the
proper LValue processing that is later required by Assign.
This fixes 72347.
* cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2005-02-11 Marek Safar <marek.safar@seznam.cz>
C# 2.0 Fixed buffer implementation
* anonymous.cs: Update after RegisterHelperClass renaming.
* attribute.cs (AttributeTester.fixed_buffer_cache):
Cache of external fixed buffers.
(AttributeTester.GetFixedBuffer): Returns IFixedBuffer
implementation if field is fixed buffer else null.
* class.cs
(TypeContainer.AddField): Accept FieldMember instead of Field.
(FieldBase.IsFieldClsCompliant): Extracted code from
VerifyClsCompliance descendant customization.
(FixedField): New class handles fixed buffer fields.
(FixedFieldExternal): Keeps information about imported fixed
buffer.
(IFixedField): Make access to internal or external fixed buffer
same.
* cs-parser.jay: Add fixed buffer parsing.
* ecore.cs (FieldExpr.Emit): Add special emit case for fixed
buffer.
* expression.cs (Indirection): Extended implementation to accept
fixed buffer field.
(PointerArithmetic.Emit): Get element from fixed buffer as well.
(ElementAccess.MakePointerAccess): Get type as parameter.
(DoResolve): Add fixed buffer field expression conversion.
(DoResolveLValue): Ditto.
(FixedBufferPtr): New class. Moved most of original ArrayPtr.
(ArrayPtr): Derives from FixedBufferPtr.
(ArrayPtr.Emit): Add extra emit for array elements.
* flowanalysis.cs.cs (StructInfo): Use FieldMember.
* rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
for compiler generated types.
(RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
* statement.cs (Fixed): Refactored to be easier add fixed buffer
and consume less memory.
(Fixed.Resolve): Add fixed buffer case.
* typemanager.cs (compiler_generated_attr_ctor,
fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
(HasElementType): Add our own implementation to work on every
runtime.
2005-02-11 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CaptureContext): Track whether `this' has been
referenced.
* expression.cs (This.ResolveBase): Call CaptureThis. Before we
only captured `this' if it was implicitly done (instance
methods/variables were used).
* codegen.cs (EmitContext.CaptureThis): New method to flag that
`this' must be captured.
2005-01-30 Miguel de Icaza <miguel@novell.com>
* anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
is null it means that there has been no need to capture anything,
so we just create a sibling.
Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
Just a partial fix. The other half is fairly elusive.
2005-02-10 Raja R Harinath <rharinath@novell.com>
Fix #52586, cs0121-4.cs.
* decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
and return a hashtable.
(MemberCache.ClearDeclaredOnly): New.
(MemberCache.MemberCache): Update to change. Make a deep copy of
the method_hash of a base type too.
(MemberCache.AddMethods): Adapt to having a deep copy of the base
type methods. Overwrite entries with the same MethodHandle so
that the ReflectedType is correct. The process leaves in base
virtual functions and their overrides as distinct entries.
(CacheEntry): Now a class instead of a struct. It shouldn't alter
matters since it was boxed in a ArrayList before.
(CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
modifier.
* expression.cs (Invocation.BetterFunction): Simplify. Handle the
case of a virtual function and its override (choose the overload
as better).
(Invocation.OverloadResolve): Avoid 'override' members during
'applicable_type' calculation.
2005-03-28 Raja R Harinath <rharinath@novell.com>
* typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
(TypeHandle.TypeHandle): Use LookupMemberCache rather than
GetTypeHandle. It is possible for a reflected type to derive from
a TypeBuilder (e.g., int[] derives from the TypeBuilder
System.Array during mscorlib compilation).
* decl.cs (MemberCache.MemberCache): If the base cache doesn't
contain a method_hash, don't create one either. Don't create a
deep copy of the base cache's method_hash.
(MemberCache.SetupCache): Rename back from DeepCopy.
(MemberCache.AddMethods): Rewrite, now that method_hash isn't
already initialized. If we see an override function, add its
underlying base virtual function to the member_hash too.
2005-02-09 Raja R Harinath <rharinath@novell.com>
Combine two near-redundant caches.
* typemanager.cs (method_params): Rename from method_internal_params.
(TypeManager.GetParameterData): New. Replace
Invocation.GetParameterData.
(TypeManager.LookupParametersByBuilder): Remove.
* expression.cs (Invocation.method_parameter_cache): Remove.
(Invocation.GetParameterData): Remove.
Update to changes.
* anonymous.cs, attribute.cs, convert.cs, delegate.cs:
Update to changes.
2005-02-08 Raja R Harinath <rharinath@novell.com>
Fix #72015.
* delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
TypeManager.multicast_delegate_type is null, resolve it by looking
up "System.MulticastDelegate".
* rootcontext.cs (RootContext.ResolveCore): Simplify.
2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
Fix cs0164.cs.
* statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
(LabeledStatement.AddReference): New. Set 'referenced'.
(Goto.Resolve): Use it.
2005-02-05 John Luke <john.luke@gmail.com>
* driver.cs: remove duplicate -doc line in Usage ()
2005-02-04 Raja R Harinath <rharinath@novell.com>
* location.cs (Location.AddFile): Fix CS2002 error report.
2005-02-02 Martin Baulig <martin@ximian.com>
* delegate.cs (Delegate.DefineType): Report an internal error if
TypeManager.multicast_delegate_type is null. See bug #72015 for
details.
2005-02-02 Raja R Harinath <rharinath@novell.com>
Fix a crasher in a variant of #31984.
* const.cs (Constant.CheckBase): New override that defers the
new-or-override check in case the base type hasn't been populated
yet.
(Constant.Define): Ensure the new-or-override check is performed.
2005-02-01 Duncan Mak <duncan@ximian.com>
* const.cs (LookupConstantValue): Check that `ce' is not null
before calling GetValue ().
2005-02-01 Raja R Harinath <rharinath@novell.com>
Fix test-334.cs (#69519).
* cs-parser.jay (using_alias_directive): Pass in an expression to
NamespaceEntry.UsingAlias.
(using_namespace_directive): Pass in an expression to
NamespaceEntry.Using.
(namespace_name): Don't flatten to a string.
* namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
(NamespaceEntry.AliasEntry.Resolve): Lookup using
ResolveAsTypeStep.
(NamespaceEntry.UsingEntry): Likewise.
(NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
changes.
(NamespaceEntry.LookupForUsing): Remove.
(NamespaceEntry.LookupNamespaceOrType): Add support for dotted
names.
(NamespaceEntry.Lookup): Remove support for dotted names.
2005-02-01 Raja R Harinath <rharinath@novell.com>
* namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
split into two.
(NamespaceEntry.ImplicitParent): Compute on demand.
(NamespaceEntry.Doppelganger): New implicit namespace-entry that
parallels the current.
(NamespaceEntry.LookupForUsing): Use it.
(NamespaceEntry.Lookup): If the current namespace-entry is
implicit, don't search aliases and using tables.
2005-02-01 Raja R Harinath <rharinath@novell.com>
Fix #31984.
* class.cs (TypeContainer.DoDefineMembers): Don't initialize
BaseCache here.
(TypeContainer.BaseCache): Compute on demand.
(TypeContainer.FindMembers): Define constants and types if they're
not already created.
(FieldMember.Define): Move resetting of ec.InUnsafe before error
check.
* const.cs (Constant.Define): Make idempotent.
2005-01-29 Miguel de Icaza <miguel@novell.com>
* pending.cs: Produce better code (no nops produced by using Ldarg
+ value).
* pending.cs (PendingImplementation.DefineProxy): It was not `arg
i - 1' it should be arg + 1.
Fixes bug #71819.
2005-01-28 Raja R Harinath <rharinath@novell.com>
* attribute.cs (Attribute.CheckAttributeType): Make private
non-virtual.
(Attribute.ResolveType): Make virtual.
(GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
handling of RootContext.Tree.Types.
2005-01-27 Raja R Harinath <rharinath@novell.com>
Update attribute-handling to use the SimpleName/MemberAccess
mechanisms.
* cs-parser.jay (attribute): Pass in an expression to the
constructors of Attribute and GlobalAttribute.
* attribute.cs (Attribute): Take an expression for the name.
(Attribute.ResolvePossibleAttributeTypes): New. Resolves the
passed in attribute name expression.
(Attribute.CheckAttributeType): Use it.
* ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
* expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
(MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
argument to prevent error messages if the lookup fails.
2005-01-27 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Indirection): Implemented IVariable interface
to support indirection in AddressOf operator.
(PointerArithmetic.Emit): Add optimalization for case where
result can be precomputed.
2005-01-26 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.AttributeTargets): Return the correct
AttributeTargets depending on our `Kind' instead of throwing an
exception; fixes #71632.
2005-01-26 Marek Safar <marek.safar@seznam.cz>
Fix #71257
* expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
constant members.
2005-03-17 Martin Baulig <martin@ximian.com>
* anonymous.cs (AnonymousMethod.method_modifiers): Change default
from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2005-03-17 Martin Baulig <martin@ximian.com>
* anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
to bool so we can return an error condition.
(AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
returned an error.
2005-03-17 Martin Baulig <martin@ximian.com>
* generic.cs (TypeMananager.IsIEnumerable): New public method.
* convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
converting from an array-type of T to `IEnumerable<T>'.
2005-03-16 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.Unwrap): Implement IAssignMethod.
(Nullable.LiftedUnaryMutator): New public class.
* expression.cs (UnaryMutator.DoResolve): Added support for
Nullable Types.
2005-03-14 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.NullCoalescingOperator): Implemented.
2005-03-14 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.LiftedBinaryOperator): Added support for
the comparision operators `<', `>', `<=' and `>='.
2005-03-13 Martin Baulig <martin@ximian.com>
* generic.cs
(Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
avoid confusion with the `NullLiteral'.
(Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2005-03-13 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
comparing arbitrary types with the null literal.
2005-03-13 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.LiftedBinaryOperator): Add support for the
boolean operators '&&', '||', '&' and '|'.
(Nullable.OperatorTrueOrFalse): New public class.
* ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
instead of a `StaticCallExpr'; added support for nullables.
2005-03-10 Martin Baulig <martin@ximian.com>
* expression.cs
(ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
rather than `etype.IsSubclassOf (TypeManager.value_type)'.
2005-03-07 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
it work if `expr' is not an IMemoryLocation.
(Nullable.Lifted): Implement IMemoryLocation.
(Nullable.LiftedConversion.ResolveUnderlying): Use the correct
target type.
2005-03-05 Martin Baulig <martin@ximian.com>
* generic.cs (Nullable.Unwrap, Wrap): New protected classes.
(Nullable.Lifted): New abstract class; rewrote the lifted conversions.
(Nullable): Added support for lifted unary and binary operators.
* expression.cs (Unary.DoResolve): Added support for nullable types.
(Binary.DoResolve): Likewise.
(Conditional.DoResolve): Likewise.
2005-03-02 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
* class.cs (ClassPart.SetParameterInfo): Override this.
(PartialContainer.SetParameterInfo): Override this.
(TypeContainer.CheckConstraints): New protected method.
(PartialContainer.CheckConstraints): Override this and check
whether the same contraints were specified in all parts of a
partial generic type definition.
(PartialContainer.UpdateConstraints): New public method.
* generic.cs (TypeParameter.UpdateConstraints): New public method.
2005-03-02 Martin Baulig <martin@ximian.com>
Committing a patch from Carlos Alberto Cortez to fix #72887.
* convert.cs (Convert.ExplicitReferenceConversionExists): Allow
casts from `T []' to `int []'.
2005-03-02 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.IsEqual): Make this symmetric.
* expression.cs (Binary.ResolveOperator): When resolving a
BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
`=='. Fixes #71866. See gen-127.cs.
2005-03-02 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DoDefineMembers): We also need a default
static constructor in static classes.
2005-03-02 Martin Baulig <martin@ximian.com>
* generic.cs
(NullableType.Name, NullableType.FullName): Add a "?" to the name.
(Nullable.LiftedConversion): Added support for user-defined
conversions.
* cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
* cs-parser.jay: Use ComposedCast everywhere instead of
NullableType, so we don't need to check for NullableType
everywhere.
(conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
case where we'll be resolved into a `parenthesized_expression_0'
afterwards.
* convert.cs
(Convert.UserDefinedConversion): Added nullable conversions.
2005-02-28 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.IsNullableType): New static method.
(Nullable): New abstract class.
(Nullable.NullLiteral): New public class.
(Nullable.LiftedConversion): New public class.
* cs-parser.jay (non_expression_type): Changed `builtin_types' to
`builtin_types opt_nullable'.
* convert.cs
(Convert.ImplicitConversionStandard): Added nullable conversions.
(Convert.ExplicitConversionStandard): Likewise.
(Convert.ExplicitConversion): Likewise.
2005-02-26 Martin Baulig <martin@ximian.com>
* expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
begin with a "?", for instance "?[]". Don't do a type lookup if
`dim' is empty.
2005-02-25 Martin Baulig <martin@ximian.com>
The first part of Nullable Types :-)
* generic.cs (NullableType): New public class.
(NullCoalescingOperator): New public class.
(TypeArguments.Resolve): Add a CS0306 check.
* cs-parser.jay (opt_error_modifier): Removed, this was unused.
(opt_nullable): New rule.
(type): Added `opt_nullable' to `namespace_or_type_name',
`builtin_types' and `pointer_type'.
(array_type): Added `opt_nullable'.
(opt_rank_specifier_or_nullable): New rule; this is the
combination of `opt_rank_specifier' and `opt_nullable'.
(opt_error): New rule; catch errors here.
(nullable_type_or_conditional): New rule; we use this to check for
nullable and still detect the conditional operator.
(local_variable_type): Use `opt_rank_specifier_or_nullable'
instead `opt_rank_specifier'.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
for nullables.
2005-02-24 Martin Baulig <martin@ximian.com>
* README, README.Changes: Removed; they're old and obsolete.
2005-02-22 Martin Baulig <martin@ximian.com>
* generic.cs (TypeParameter.Resolve): If resolving the constraints
returned an error, set `constraints' to null to avoid a crash
later on.
(TypeParameter.ResolveType): Likewise.
2005-02-22 Martin Baulig <martin@ximian.com>
* generic.cs
(Constraints.ResolveTypes): Protect against being called twice.
(Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
(TypeParameter.ResolveType): New public method; calls
constraints.ResolveTypes().
(TypeParameter.DefineType): Moved constraints.ResolveType() out
into the new ResolveType().
(GenericMethod.Define): Call ResolveType() on all our
TypeParameter's.
2005-02-21 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeManager.generic_nullable_type): New static public field.
(TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
* rootcontext.cs
(RootContext.ResolveCore): Resolve "System.Nullable`1".
2005-02-15 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.Constraints): Correctly check
constraints if the argument type is a type parameter; fixes
#72326.
2005-02-02 Martin Baulig <martin@ximian.com>
* delegate.cs (Delegate.DefineType): Report an internal error if
TypeManager.multicast_delegate_type is null. See bug #72015 for
details.
2005-01-29 Miguel de Icaza <miguel@novell.com>
* pending.cs: Produce better code (no nops produced by using Ldarg
+ value).
* pending.cs (PendingImplementation.DefineProxy): It was not `arg
i - 1' it should be arg + 1.
Fixes bug #71819.
2005-01-26 Martin Baulig <martin@ximian.com>
* cs-parser.jay (indexer_declarator): Don't report an error if we
have type parameters since we can be an explicit interface
implementation; fixes #71449.
2005-01-26 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.AttributeTargets): Return the correct
AttributeTargets depending on our `Kind' instead of throwing an
exception; fixes #71632.
2005-01-26 Martin Baulig <martin@ximian.com>
* delegate.cs (Delegate.DefineType): Correctly define our type
parameters. Fixes #71483.
2005-01-25 Raja R Harinath <rharinath@novell.com>
Fix #71602.
* expression.cs (MemberAccess.DoResolve): Don't complain with
cs0572 when the LHS of a member access has identical name and type
name.
2005-01-25 Marek Safar <marek.safar@seznam.cz>
Fix #71651, #71675
* attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
CreatePermission.
Create custom PermissionSet only for PermissionSetAttribute.
2005-01-24 Marek Safar <marek.safar@seznam.cz>
Fix #71649
* class.cs (StaticClass.DefineContainerMembers): Enable enums and
delegates in static class.
2005-01-24 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
merging an implicit block, just use its reachability.
* statement.cs (Block.Resolve): Make the unreachable code check
work wrt. implicit blocks; see test-337 from #63842.
2005-01-21 Alp Toker <alp@atoker.com>
* cs-parser.jay: destructor_declaration's container is PartialContainer
not Class when partial types are used, so use Kind prop instead of
'is'.
2005-01-22 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Improve error reporting when an interface
declares new types.
2005-01-20 Dick Porter <dick@ximian.com>
* support.cs: SeekableStreamReader fix from Sandor Dobos
(dobos_s@ibcnet.hu) to cope with Position setting when multibyte
chars are read. Fixes bug 70369.
2005-01-20 Raja R Harinath <rharinath@novell.com>
* cs-parser.jay (catch_clause): Simplify current_block handling
somewhat.
2005-01-17 Miguel de Icaza <miguel@ximian.com>
* convert.cs (ImplicitStandardConversionExists): Synchronize the
code with ImplicitStandardConversion to handle the implicit
conversion of method groups into valid delegate invocations.
The problem is that in parameter handling we were using this code
path. Fixes bug #64698
2005-01-19 Raja R Harinath <rharinath@novell.com>
* cs-parser.jay: Fix several infelicities.
- Avoid assigning to the parser value stack. Code like
'$3 = null' is unclean. Synthesize a value for the code block
instead.
- Avoid using oob_stack for storing location information. Use ...
(_mark_): ... this. New (empty) rule. Saves the current location
in $$.
(foreach_statement): Avoid using oob_stack for current_block
handling. Use technique used in for_statement and
using_statement. Synthesize a value for the code block to store
additional intermediate information.
2005-01-13 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (IsAccessorAccessible): Accessibility to private fields
of a different type is only allowed to private fields of a
containing type, not on fields of a base class.
See test-174.cs and error cs0122-9.cs
2005-01-13 Raja R Harinath <rharinath@novell.com>
Fix test-335.cs (bug #58126).
* cs-parser.jay (argument): Split out non-expression parts of the
rule into 'non_simple_argument'.
(invocation_expression): Support parenthesized invocations with
multiple arguments, and with single non-simple arguments.
2005-01-13 Raja R Harinath <rharinath@novell.com>
* cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
places.
2005-01-12 Raja R Harinath <rharinath@novell.com>
Fix cs0038-1.cs, cs1640-6.cs.
* ecore.cs (Expression.Resolve): Remove special-case for
SimpleName in error-handling.
(Expression.almostMatchedMembers): Relax access permission to
protected.
(Expression.MemberLookupFailed): Handle duplicates in
almostMatchedMembers list.
(SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
* expression.cs (New.DoResolve): Report CS1540 for more cases.
* typemanager.cs (GetFullNameSignature): Use the MethodBase
overload if the passed in MemberInfo is a MethodBase.
2005-01-25 Martin Baulig <martin@ximian.com>
* doc.cs
(DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2005-01-12 Marek Safar <marek.safar@seznam.cz>
Fix #70749
* attribute.cs (ExtractSecurityPermissionSet): Don't report error
for non-CAS & merge permission sets properly.
2005-01-11 Raja R Harinath <rharinath@novell.com>
Improve standard-compliance of simple name and member access
resolution. Fixes bugs #52697, #57200, #67520, #69519.
* ecore.cs (FullNamedExpression): New abstract base class
for Namespaces and TypeExpressions.
(ResolveFlags.SimpleName): Remove.
(SimpleName): Remove support for dotted names.
(SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
DeclSpace.FindType and DeclSpace.LookupType.
(SimpleName.DoSimpleNameResolve): Remove support for dotted names.
(Expression.ExprClassName): Make member function.
* expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
a namespace. Remove creation of dotted "SimpleName"s.
(MemberAccess.DoResolve): Likewise.
* decl.cs (DeclSpace.Cache): Make private.
(DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
(DeclSpace.FindType): Update.
(DeclSpace.LookupType): Move here from RootContext. Return a
FullNamedExpression.
* namespace.cs (Namespace): Derive from FullNamedExpression
so that it can be part of expression resolution.
(Namespace.Lookup): Return an FullNamedExpression.
(NamespaceEntry.LookupAlias): Lookup aliases only in current
namespace.
* rootcontext.cs (NamespaceLookup): Remove.
(LookupType): Move to DeclSpace.
* attribute.cs (CheckAttributeType): Update.
* doc.cs (FindDocumentedType): Remove allowAlias argument.
(FindDocumentedTypeNonArray): Likewise.
2005-01-11 Raja R Harinath <rharinath@novell.com>
Fix cs0509.cs, cs1632.cs.
* class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
is the same as IsInterface.
(TypeContainer.GetClassBases): Likewise.
* statement.cs (LabeledStatement.ig): New field.
(LabeledStatement.LabelTarget): Save ILGenerator which created the
label.
(LabeledStatement.DoEmit): Check that the label was created with
the same ILGenerator.
2005-01-10 Marek Safar <marek.safar@seznam.cz>
Fix #71058
* attribute.cs (GetMethodObsoleteAttribute): Need to transform
accessors to its properties.
* ecore.cs (PropertyExpr): Add AccessorTable to help track back
from accessors to property.
2005-01-10 Marek Safar <marek.safar@seznam.cz>
Fix #70722
* class.cs (MethodCore.CheckBase): Test base method obsoleteness
only for overrides.
2005-01-08 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Check for null and empty strings.
I have lost another battle to Paolo.
2005-01-07 Marek Safar <marek.safar@seznam.cz>
Fix #70942
* class.cs (PropertyMethod): Set Parent field in ctors.
(SetMethod.InternalParameters): Add unsafe switch hack.
Override MarkForDuplicationCheck where it is appropriate.
* decl.cs (MemberCore.MarkForDuplicationCheck): New method.
It says whether container allows members with the same name.
Base default is no.
(DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
Removed is_method parameter.
2005-01-06 Duncan Mak <duncan@ximian.com>
* cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
because the previous change led to incorrect reporting of CS1032
("Cannot define/undefine preprocessor symbols after first token in
file"). Instead of using `tokens_seen' as the only flag that
triggers CS1040, introduce `comments_seen'. This new flag is used
to signify having seen comments on the current line, so it is
unset after a newline.
2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs : When searching for a type, find nested type too.
This fixes bug #71040.
2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
* doc.cs :
- Warn missing member comment on those classes which also does not
have doc comments. Fixed bug #71041.
- Don't warn missing doc comment on default constructor.
Fixed bug #71042.
2005-01-06 Duncan Mak <duncan@ximian.com>
* cs-tokenizer.cs (xtoken): After handling traditional C-style
comments, set `tokens_seen' to true. This allows us to detect
misplaced preprocessor directives (i.e. not at the beginning of
the a line, nor after whitespaces). In that case, report error
CS1040. This fixes bug #56460.
* cs-parser.jay (interface_member_declaration): Add checks for
IsExplicitImpl, and report CS0541 error if an interface member is
defined as an explicit interface declaration.
2005-01-06 Marek Safar <marek.safar@seznam.cz>
Fix #70817
* class.cs (PropertyMethod): Set Parent field in ctors.
(SetMethod.InternalParameters): Add unsafe switch hack.
* decl.cs (MemberCore.Parent): Cannot be readonly.
2005-01-06 Raja R Harinath <rharinath@novell.com>
* decl.cs (DeclSpace.ResolveType): Remove.
(DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
Merge in code from ...
(DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
* class.cs, enum.cs: Update to changes.
2005-01-06 Miguel de Icaza <miguel@ximian.com>
* anonymous.cs: Ensure that we init the scope of our parent if it
has not been initialized yet.
2004-12-30 Duncan Mak <duncan@ximian.com>
* typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
if field.FieldBuilder is null. Fixes #70758.
* convert.cs: Fixed some typos and updated some of the comments.
(ImplicitStandardConversionExists):
(TryImplicitIntConversion): If `target_type' is an interface and
the type of `ic' implements this interface, return true or a new
BoxedCast instead of null. This fixes #70468.
2004-12-29 Duncan Mak <duncan@ximian.com>
* expression.cs (Argument.Emit): Check that Expr is
IMemoryLocation before casting to it, and report CS1510 otherwise.
This fixes #70402.
2004-12-21 Ben Maurer <bmaurer@ximian.com>
* statement.cs (Block.ThisVariable): remove the recursion here, to
make the --profile more sane.
2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
* driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
assembly, by JB Evain.
2004-12-17 Raja R Harinath <rharinath@novell.com>
* class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
rootcontext.cs, typemanager.cs: Make nomenclature consistent.
"parent" refers to enclosing type/class. "base" refers to superclass.
2004-12-17 Raja R Harinath <rharinath@novell.com>
* codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
Ensure that we only have GlobalAttributes.
* attribute.cs (Attribute.Emit): Make non-virtual.
(GlobalAttribute.Emit): Remove.
(Attribute.Resolve): Make virtual.
(GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
(Attribute.GetConditionalAttributeValue): Take an EmitContext as
the argument. Don't create one.
(Attribute.GetObsoleteAttribute): Likewise.
(Attribute.GetClsCompliantAttributeValue): Likewise.
* class.cs, decl.cs: Update to changes.
2004-12-17 Marek Safar <marek.safar@seznam.cz>
* delegate.cs (NewDelegate.DoResolve): Add error 149 report.
* ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
* statement.cs (Foreach.Resolve): Add error 186 report.
2004-12-16 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Conditional.DoResolve): Add warning 429.
* statement.cs (If.Resolve): Add warning 665.
2004-12-16 Raja R Harinath <rharinath@novell.com>
New invariant: RootContext.Tree.Types.NamespaceEntry == null
except when in the parser, and in GlobalAttribute.
* driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
* attribute.cs (GlobalAttribute.CheckAttributeType): Reset
RootContext.Tree.Types.NamespaceEntry once work is done.
(GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
and resets RootContext.Tree.Types.NamespaceEntry.
2004-12-15 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Don't create a block for every variable.
2004-12-14 Miguel de Icaza <miguel@ximian.com>
* location.cs: Provide extra information.
* statement.cs: The instance is not `ldarg_0.THIS' when accessing
variables from the captured environment, it is the ldarg_0.
2004-12-14 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Changed warning level for 642 to 4 until Miguel
find a conclusion.
* class.cs: Changed warning level for 169 to avoid developer
displeasure from warning flooding. It will be changed back when they
fix most of current BCL warnings.
* RootContext.cs: Pushed default WarningLevel to 3.
* statement.cs: Removed unused variable.
2004-12-14 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.GetClassBases): Add error 1521 report.
(TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
Add error 502 report.
(StaticClass.DefineType): Add error 441 report.
(Class.AllowedModifiersProp): New virtual property as temporary
extension to AllowedModifiers.
(Class.DefineType): Add error 418 report. Moved ModFlags check here
to share implementation with StaticClass and don't call virtual
methods from ctor.
* driver.cs (MainDriver): Add error 1558 test.
* parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
report. Moved error 36 test here.
* statement.cs (Throw.Resolve): Add error 724 report.
* typemanager.cs: Add out_attribute_type core type.
2004-12-13 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.VerifyClsCompliance): Add error
3018 report.
(PropertyBase.VerifyClsCompliance): Add errror 3025 report.
* codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3017 report.
* decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
* parameter.cs (ReturnParameter.ApplyAttributeBuilder):
Add error 3023 report.
(Parameter.ApplyAttributeBuilder): Add error 3022 report.
* tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
implementation.
2004-12-12 John Luke <john.luke@gmail.com>
* driver.cs (AddArgs): take -- into account when
adding arguments, fixes bug 65710
2004-12-12 Martin Baulig <martin@ximian.com>
* expression.cs (Unary.TryReduceNegative): Added support for
SByteConstant and ByteConstant.
(Unary.Reduce): Check error values from TryReduceNegative().
2004-12-10 Marek Safar <marek.safar@seznam.cz>
* attributes.cs (Attribute.Resolve): Avoid multiple error report
and report exception as error 182.
2004-12-10 Raja R Harinath <rharinath@novell.com>
* driver.cs (Main): Fix message when there are warnings.
2004-12-09 Miguel de Icaza <miguel@ximian.com>
* delegate.cs: Fixed my fix from yesterday, sorry about that.
2004-12-09 Marek Safar <marek.safar@seznam.cz>
* anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
Reduced number of warnings.
* class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2004-12-08 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Removed message.
* delegate.cs: Fix bug introduced in 1.1.x: 70219.
2004-12-08 <vargaz@freemail.hu>
* cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2004-12-08 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
instead of a CS3002 for properties and indexer.
2004-12-08 Martin Baulig <martin@ximian.com>
* decl.cs (MemberName.ToString): Make this work again.
2004-12-08 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Resolve): Add error 591 detection.
* class.cs (FieldMember.Define): Add error 1547 detection.
(Indexer.Define): Add error 620 detection.
(Operator.Define): Add error 590 detection.
* ecore.cs: Missing argument for error 79.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
detection.
2004-12-07 Marek Safar <marek.safar@seznam.cz>
Fix #70106
* assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
only.
2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
* cs-parser.jay : handle doc comments on implicit/explicit operators.
Some operator comments were suppressed.
* doc.cs : Implicit/explicit operator name in doc comments are like
"op_Explicit(type)~returnType", so added suffix handling.
2005-01-21 Alp Toker <alp@atoker.com>
* cs-parser.jay: destructor_declaration's container is PartialContainer
not Class when partial types are used, so use Kind prop instead of 'is'.
2004-12-12 Martin Baulig <martin@ximian.com>
* expression.cs (Unary.TryReduceNegative): Added support for
SByteConstant and ByteConstant.
(Unary.Reduce): Check error values from TryReduceNegative().
2004-12-11 Martin Baulig <martin@ximian.com>
* support.cs (ReflectionParameters.ParameterName): If we have a
`gpd', call `ParameterName' on it.
* parameter.cs (Parameter.GetParameterAttributes): New static method.
* pending.cs (PendingImplementation.DefineProxy): Call
DefineParameter() for all of the MethodBuilder's arguments.
2004-12-09 Martin Baulig <martin@ximian.com>
* doc.cs (DocUtil): Make this a static class.
2004-12-09 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): Moved the type inference
implementation into TypeManager.
* generics.cs (TypeManager): Moved the type inference
implementation here.
2004-12-09 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager): Make this a partial class.
* generics.cs
(TypeManager): Move the generics part of `TypeManager' here.
2004-12-08 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
instead of a CS3002 for properties and indexer. Added CS3024
check for generic interfaces.
* attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
instances are not CLS-compliant.
2004-12-08 Martin Baulig <martin@ximian.com>
* cs-parser.jay
(void_pointer_expression): New rule for `void*', `void**' etc.
(typeof_expression): Add `void_pointer_expression'; fixes #66846.
2004-12-08 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): Removed the hack for
MethodCore.MayUnify().
* typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
this actually work.
* class.cs (MethodCore.MayUnify): Use
TypeManager.MayBecomeEqualGenericTypes().
2004-12-08 Martin Baulig <martin@ximian.com>
* expression.cs (Is.DoResolve, As.DoResolve): If we're a type
parameter, box it. Fixes #69233.
2004-12-08 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Valuetypes always
have the ctor constraint. Fixes #68326.
2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
* cs-parser.jay : interface comment was not consumed because of
extra opt_semicolon before doc handling.
2004-12-03 Raja R Harinath <rharinath@novell.com>
Fix test-327.cs, test-328.cs, and put in early infrastructure
for eventually fixing #52697.
* namespace.cs (NamespaceEntry.LookupForUsing): New method.
(NamespaceEntry.LookupNamespaceOrType): New method, refactored
from other methods.
(NamespaceEntry.Lookup): Remove 'ignore_using' flag.
(AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
(VerifyUsing, error246): Update.
* rootcontext.cs (RootContext.NamespaceLookup): Just use
'NamespaceEntry.LookupNamespaceOrType'.
2004-12-07 Martin Baulig <martin@ximian.com>
* driver.cs: Call it "BETA SOFTWARE" :-)
2004-12-06 Raja R Harinath <rharinath@novell.com>
Fix crash on cs0657-17.cs.
* codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
Use RootContext.Tree.Types, not 'new RootTypes ()'.
* attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
the case where the NamespaceEntry gets overwritten.
2004-12-06 Marek Safar <marek.safar@seznam.cz>
Fixed #69195, #56821
* ecore.cs (ResolveBoolean): Tiny refactoring.
* expression.cs (Binary.DoResolve): Add warning 429 and skipping
of right expression resolving when left is false constant and
operator is LogicalAnd OR true constant and operator is LogicalOr.
* statement.cs (ResolveUnreachable): Always reports warning.
2004-12-05 Miguel de Icaza <miguel@ximian.com>
* class.cs: Distinguish between 1721 and 1722 (just a little help
for the programmer).
2004-12-03 Miguel de Icaza <miguel@ximian.com>
* delegate.cs: Only allow this on new versions of the language.
2004-12-02 Duncan Mak <duncan@ximian.com>
* ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
Expression class.
(Expression.IsAccessorAccessible): Moved from the PropertyExpr to
here as a static method. Take an additional bool out parameter
`must_do_cs1540_check' for signaling to InstanceResolve.
(PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
member field from PropertyExpr class and made it an argument of
the method instead.
(EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
check for MarshalByRefObject, and report CS0122 instead of CS1540.
(EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
and `remove_accessor' as well as InstanceResolve: report CS0122
where applicable.
Fixes #70129.
2004-12-07 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
and CS0692 where appropriate.
2004-12-06 Martin Baulig <martin@ximian.com>
* class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
IsDuplicateImplementation() and improved it.
* expression.cs (Invocation.InferTypeArguments): Added
`Type[] inferred_class_types' argument (for MethodCore.MayUnify)
and removed the "ref" modifier from `infered_types'.
* decl.cs (MemberName.ToString): Removed the exception.
2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
* cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
comments are allowed.
2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* delegate.cs: Add checks for subtypes in paramaters and return values
in VerifyMethod () to add support for Covariance/Contravariance
in delegates.
2004-12-02 Miguel de Icaza <miguel@ximian.com>
* report.cs: Remove extra closing parenthesis.
* convert.cs (Error_CannotImplicitConversion): If the name of the
types are the same, provide some extra information.
2004-12-02 Marek Safar <marek.safar@seznam.cz>
Fix bug #70102
* attribute.cs (Resolve): Improved implementation of params
attribute arguments.
* support.cs (ParameterData): Add HasParams to be faster.
2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
all things are for /doc support:
* doc.cs: new file that supports XML documentation generation.
* mcs.exe.sources: added doc.cs.
* driver.cs:
Handle /doc command line option.
Report error 2006 instead of 5 for missing file name for /doc.
Generate XML documentation when required, after type resolution.
* cs-tokenizer.cs:
Added support for picking up documentation (/// and /** ... */),
including a new XmlCommentState enumeration.
* cs-parser.jay:
Added lines to fill Documentation element for field, constant,
property, indexer, method, constructor, destructor, operator, event
and class, struct, interface, delegate, enum.
Added lines to warn incorrect comment.
* rootcontext.cs :
Added Documentation field (passed only when /doc was specified).
* decl.cs:
Added DocComment, DocCommentHeader, GenerateDocComment() and
OnGenerateDocComment() and some supporting private members for
/doc feature to MemberCore.
* class.cs:
Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
* delegate.cs:
Added overriden DocCommentHeader.
* enum.cs:
Added overriden DocCommentHeader and GenerateDocComment().
2004-12-01 Miguel de Icaza <miguel@ximian.com>
* cfold.cs (ConstantFold.DoConstantNumericPromotions): After
unwrapping the enumeration values, chain to
DoConstantNumericPromotions again, so we can promote things to the
fundamental types (takes care of enums that are bytes, sbytes).
Fixes bug #62054.
2004-12-01 Raja R Harinath <rharinath@novell.com>
* attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
Fix long-standing bug in type-lookup. Use FindType instead of
LookupType when ec.ResolvingTypeTree.
(Attribute.ResolveType, Attribute.Resolve)
(Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
Update to changes.
(Attributes.Search): Remove internal version. Update.
(Attributes.SearchMulti): Update.
(Attributes.GetClsCompliantAttribute): Remove.
(Attributes.GetIndexerNameAttribute): Remove.
* decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
(DeclSpace.GetClsCompliantAttributeValue): Likewise.
* class.cs (Indexer.Define): Likewise.
2004-12-01 Marek Safar <marek.safar@seznam.cz>
Fix bug #68790
* ecore.cs: CheckMarshallByRefAccess new virtual method for testing
MarshallByReference members access.
* expression.cs: Use CheckMarshallByRefAccess;
Better error CS0197 message.
* report.cs: Print whole related error message.
2004-11-29 Marek Safar <marek.safar@seznam.cz>
* class (GetClassBases): Better error 60 report.
(EventProperty): Disabled warning 67 detection.
2004-11-29 Marek Safar <marek.safar@seznam.cz>
Fix bug #60324
* cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
* constant.cs (DecimalConstant.Emit): Don't use int ctor for
precise values.
2004-11-29 Marek Safar <marek.safar@seznam.cz>
Fix bug #49488
* assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
* decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2004-11-26 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attribute.Resolve): Refine error reporting and
report a cs0117 if the identifier does not exist, to distinguish
from 0617 which is a miss-use of the actual identifier.
* ecore.cs (EventExpr.Emit): Refine error report and distinguish
between cs0070 and cs0079.
* class.cs (MemberBase.DoDefine): When reporting a wrong
accessibility level, we use MethodCore to compare instead of
Method (this was a regression in some refactoring effort).
So now we correctly report cs0056 again.
* convert.cs (ImplicitReferenceConversion): Corrected typo, I was
testing the target_type (which was known to be object_type) and
not the source type (which is anonymous_method).
Fixed reporting of error cs1660.
* expression.cs (UserCast.Source): Expose the underlying cast.
* statement.cs (Switch.SwitchGoverningType): Sort the list of
allowed types to find a match to int32 first (most common).
In addition, it ignores any ImplicitUserConversions that did an
internal implicit conversion (as the switch statement allows only
one integral conversion to exist).
* class.cs (PartialContainer.Create): rename `name' to
`member_name' for clarity. Then replace the string calls with a
call to MemberName.GetPartialName, as now using
MemberName.ToString is an error (this is due to the side effects
it had, that were fixed in the past).
This will restore the error reporting on a number of partial class
errors that were missusing this (and getting an exception as a
results, which is now just a plain textual warning, because
yyparse debug output would crash otherwise).
2004-11-26 Raja R Harinath <rharinath@novell.com>
* Makefile (PROGRAM_INSTALL_DIR): Remove.
2004-11-25 Ben Maurer <bmaurer@ximian.com>
* rootcontext.cs (LookupType): Make sure to cache lookups that
don't give us a negative result. This saves about 5% of corlib
compilation time.
2004-11-25 Miguel de Icaza <miguel@ximian.com>
* report.cs (AbstractMessage.Print): messages are sent to stderr
* class.cs (TypeContainer.GetClassBases): It is an error to have a
non-interface in the list of interfaces (at this point, either
parent was properly set, or a base class is being listed in the
interfaces section).
This flags error 1722, and resolves the crash from bug 69259.
2004-11-25 Ben Maurer <bmaurer@ximian.com>
* statement.cs (Using.EmitExpressionFinally): make this work right
for valuetypes. Fixes 69926.
2004-11-25 Miguel de Icaza <miguel@ximian.com>
* const.cs (Const.ChangeType): Cope with the "0 literal can be
converted to an enum" here, before we try to change the underlying
type. This code exists, but it is a different code path than the
one used while encoding constants.
(ImplicitReferenceConversionExists): In addition, resynchronized
the code here, so it matches the same code in
ImplicitReferenceConversionExists for the `from any class-type S
to any interface-type T'.
2004-11-25 Marek Safar <marek.safar@seznam.cz>
* cfold.cs (BinaryFold): Add addition for DecimalConstant.
2004-11-24 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Use verbosity accordingly.
2004-11-24 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Unary.ResolveOperator): Do not report warning;
AddressOf reads from variable.
(LocalVariableReferences.DoResolveBase): Improved my previous fix.
2004-11-24 Marek Safar <marek.safar@seznam.cz>
Fix bug #69462
* attribute.cs (Attributable): Removed CheckTargets.
(Attributes.Emit): Explicit attribute targets are tested here.
* class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
not enabled for interfaces.
* codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
(GetAssemblyName): Ouch next bug there.
2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* expression.cs: Error 275 added.
2004-11-23 Marek Safar <marek.safar@seznam.cz>
Fix bug #69177 (Implemented decimal constant support)
* cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
(BinaryFold): Add DecimalConstant.
* const.cs (Define): Decimal constant
(is not constant.
(ChangeType): Add decimal type handling.
(LookupConstantValue): Don't set value for decimal type but
emit DecimalConstantAttribute. Needed for constant optimization.
* constant.cs (ToDecimal): New method.
(ConvertToDecimal): New method.
(IntConstant): Implemented ConvertToDecimal.
(DecimalConstant.Emit): Emit optimized version for decimals in
int range.
* expression.cs (ResolveOperator): Changed order of constant
reduction to work correctly with native types which have
overloaded operators.
(ResolveMemberAccess): Extract constant value from attribute
for decimal type.
* rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
* typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
(ChangeType): Decimal is special.
(TypeToCoreType): Add decimal type.
2004-11-22 Marek Safar <marek.safar@seznam.cz>
* convert.cs (ImplicitConversionRequired): Add error cs0642 for
decimal types.
2004-11-22 Marek Safar <marek.safar@seznam.cz>
* class.cs (EventField.ApplyAttributeBuilder): Fix error
test cs1667-5.cs.
2004-11-19 Marek Safar <marek.safar@seznam.cz>
* class.cs (MemberBase.DoDefine): Fix error cs0508 report.
* pending.cs (PendingImplementation): Grab only interfaces.
2004-11-19 Marek Safar <marek.safar@seznam.cz>
* statement.cs (ForeachHelperMethods): Add location member and
error 202 detection.
2004-11-18 Marek Safar <marek.safar@seznam.cz>
* expression.cs (DoResolveBase): Fixed wrong warning for out
variables.
2004-12-04 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.TypeParameter_to_Null): Use the constraints
to check whether the conversion is ok.
* typemanager.cs (TypeManager.GetTypeArguments): Just return
`Type.EmptyTypes' if we're not a generic TypeContainer.
2004-11-25 Miguel de Icaza <miguel@ximian.com>
* convert.cs (ImplicitReferenceConversionExists): A surprisingly
old bug: when converting from the null literal to a pointer,
return an EmptyCast, not the NullLiteral.
This fixes #69921, the recent null_type changes probably made this
bug more prominent.
2004-12-03 Martin Baulig <martin@ximian.com>
* delegate.cs (NewDelegate.DoResolve): If we have an anonymous
method as our child, call AnonymousMethod.Compatible() on it.
2004-12-02 Miguel de Icaza <miguel@ximian.com>
* class.cs (FieldBase): Use an unused bit field from the field to
encode the `has_offset' property from the FieldMember. This saves
a couple of Ks on bootstrap compilation.
* delegate.cs (NewDelegate.DoResolve): If we have an anonymous
method as our child, return the AnonymousMethod resolved
expression.
* expression.cs (New.DoResolve): Allow return values from
NewDelegate to also include AnonymousMethods.
Fixes #70150.
2004-11-29 Raja R Harinath <rharinath@novell.com>
* decl.cs (MemberCore.MemberName): Remove readonly to fix an error
cs1648 report.
* rootcontext.cs (ResolveCore::interfaces_first_stage): Add
System.Runtime.InteropServices._Exception, since it's a base
interface of the core type System.Exception in the net_2_0 profile.
2004-11-27 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
2004-11-26 Raja R Harinath <rharinath@novell.com>
* Makefile: Convert to use executable.make.
* gmcs.exe.sources: New.
2004-11-25 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): Added support for byref types.
2004-11-25 Martin Baulig <martin@ximian.com>
* statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
in TypeManager.TypeToCoreType().
2004-11-25 Martin Baulig <martin@ximian.com>
* iterators.cs (Iterator.DoDefineMembers): Override and lookup the
"Dispose" method from the `current_type'.
(Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
DoDefineMembers() instead of using the MethodBuilder; this is
required for generic iterators.
* class.cs (TypeContainer.DoDefineMembers): Make this virtual.
2004-11-24 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
2004-11-20 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): Correctly infer generic
instances; see gen-103.cs.
(Invocation.InferTypeArguments): If a generic method doesn't have
any unbound type parameters, we don't need to infer anything.
2004-11-19 Raja R Harinath <rharinath@novell.com>
* Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
2004-11-17 Raja R Harinath <rharinath@novell.com>
* typemanager.cs (TypeHandle.GetTypeHandle): Make private.
(TypeHandle.GetMemberCache): New.
(TypeHandle.TypeHandle): Update.
(TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
(TypeManager.LookupParentInterfacesCache):
Rename from LookupInterfaceCache. Optimize slightly.
(TypeManager.MemberLookup_FindMembers): Update.
* decl.cs (MemberCache.MemberCache): Set Container to null in the
multi-type variant.
(AddCacheContents): Rename from AddHashtable.
* class.cs (TypeContainer.parent_container): Remove.
(TypeContainer.VerifyClsCompliance): Don't use parent_container.
(TypeContainer.DoDefineMembers): Don't initialize it.
Update to name changes.
2004-11-17 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodCore.CheckAccessModifiers): New helper routine
that factors the code to check access modifiers on override.
(PropertyBase): Use the code here.
Patch from Lluis S'anchez, fixes bug #69361.
2004-11-15 Miguel de Icaza <miguel@ximian.com>
* anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
routine that is used to report the use of a captured variable
whose address has been taken.
There are two checks: one when variables are being captured and
the other check is when the address of a variable is taken.
(because an anonymous methods might be resolved before *or* after
the address has been taken) and
* expression.cs (Conditional.DoResolve): Remove the special
casing that Martin added to trueExpr and falseExpr being both
NullLiteral. We get the right behavior now just by introducing
the null_type into the compiler.
* convert.cs (ExplicitConversion): Change the code to use
null_type instead of testing `expr is NullLiteral'.
(ImplicitConversionStandard): use null_type too.
(ImplicitReferenceConversionExists): use null_type too.
(ImplicitReferenceConversion): use null_type too.
* literal.cs: The type of `NullLiteral' is now null_type instead
of object_type.
(Resolve): Set the type here.
* typemanager.cs: Introduce null_type.
2004-11-18 Martin Baulig <martin@ximian.com>
* rootcontext.cs
(RootContext.LookupType): Return a `Type', not a `TypeExpr'.
2004-11-18 Martin Baulig <martin@ximian.com>
* ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
2004-11-18 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints.Resolve): Take an `EmitContext' instead
of a `DeclSpace'. If one of our constraints is a `ConstructedType',
call ResolveConstructedType() on it to resolve it without checking
constraints.
(Constraints.ResolveTypes): Check them here.
(ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
but don't check constraints.
(ConstructedType.ResolveAsTypeTerminal): Override this and also
check constraints here.
(ConstructedType.ResolveConstructedType): New public method. This
is called from DoResolveAsTypeStep() and Constraints.Resolve() to
resolve ourselves without checking constraints.
* ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
2004-11-18 Martin Baulig <martin@ximian.com>
* decl.cs
(DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
* delegate.cs (Delegate.DefineType): Always create the EmitContext.
2004-11-18 Martin Baulig <martin@ximian.com>
* ecore.cs (TypeExpr.ResolveType): Removed.
(Expression.ResolveAsTypeTerminal): We always return a fully
resolved `TypeExpr', so we can just access its `Type'.
* class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
2004-11-17 Martin Baulig <martin@ximian.com>
* ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
sure we don't return any unresolved TypeExpr's.
(TypeAliasExpression): The .ctor now takes an `IAlias' instead of
a `TypeExpr'.
(Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
* expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
unresolved `ConstructedType's.
2004-11-17 Martin Baulig <martin@ximian.com>
* ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
2004-11-17 Martin Baulig <martin@ximian.com>
* ecore.cs
(Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
* decl.cs (DeclSpace.ResolveType): Removed.
(DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
2004-11-17 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.AddHashtable): Add entries in the opposite
direction, like FindMembers() does. Fixes #69546, testcase is in
test-315.cs.
2004-11-16 Martin Baulig <martin@ximian.com>
This is based on a patch from Marek Safar, see bug #69082.
Fixes bugs #63705 and #67130.
* typemanager.cs (TypeManager.LookupInterfaceCache): New public
method; create a MemberCache for an interface type and cache the
result.
* decl.cs (IMemberContainer.ParentContainer): Removed.
(IMemberContainer.ParentCache): New property.
(MemberCache.SetupCacheForInterface): Removed.
(MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
to create a cache for an interface's "parent".
* class.cs (TypeContainer.DoDefineMembers): Setup cache for
interfaces too.
2004-11-14 Ben Maurer <bmaurer@ximian.com>
* statement.cs: Avoid adding bools to a hashtable.
2004-11-15 Martin Baulig <martin@ximian.com>
* decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
2004-11-11 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetMethodName): New method.
* class.cs (MethodData.Define): Include the generic arity in the
name of an explicit interface; also add it to the method name.
* pending.cs (PendingImplementation.InterfaceMethod): The method
name now includes the generic arity.
2004-11-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation.OverloadResolve): Flag error if we are
calling an unsafe method from a safe location.
2004-11-06 Marek Safar <marek.safar@seznam.cz>
Fix #69167
* codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2004-11-06 Miguel de Icaza <miguel@ximian.com>
* namespace.cs (VerifyUsing): use GetPartialName instead of
ToString.
2004-11-05 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Return.Resolve): Fix regression in typo: if
`in_exc', we have to request a NeedReturnLabel, this was a typo
introduced in the anonymous method check-in. Fixes #69131.
* Indexers were using the ShortName when defining themselves,
causing a regression in the compiler bootstrap when applying the
patch from 2004-11-02 (first part), now they use their full name
and the bug is gone.
2004-11-04 Zoltan Varga <vargaz@freemail.hu>
* driver.cs: Strip the path from the names of embedded resources. Fixes
#68519.
2004-11-04 Raja R Harinath <rharinath@novell.com>
Fix error message regression: cs0104-2.cs.
* namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
(AliasEntry.Resolve): Update.
* rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
'silent' flag.
(RootContext.LookupType): Update.
2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
* cs-parser.jay: Add support for handling accessor modifiers
* class: Add support port accessor modifiers and error checking,
define PropertyMethod.Define as virtual (not abstract anymore)
* ecore.cs: Add checking for proeprties access with access modifiers
* iterators.cs: Modify Accessor constructor call based in the modified
constructor
2004-11-02 Ben Maurer <bmaurer@ximian.com>
* expression.cs (StringConcat): Handle being called twice,
as when we have a concat in a field init with more than two
ctors in the class
2004-11-02 Miguel de Icaza <miguel@ximian.com>
* class.cs (Event.Define, Indexer.Define, Property.Define): Do not
special case explicit implementations, we should always produce
the .property or .event declaration.
* decl.cs (MemberName): Renamed GetFullName to GetPartialName
since it will not return correct data if people use this
unresolved in the presence of using statements (see test-313).
* class.cs (MethodData.Define): If we are an explicit interface
implementation, set the method name to the full name of the
interface plus the name of the method.
Notice that using the method.MethodName.GetFullName() does not
work, as it will only contain the name as declared on the source
file (it can be a shorthand in the presence of using statements)
and not the fully qualifed type name, for example:
using System;
class D : ICloneable {
object ICloneable.Clone () {
}
}
Would produce a method called `ICloneable.Clone' instead of
`System.ICloneable.Clone'.
* namespace.cs (Alias.Resolve): Use GetPartialName.
2004-11-01 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add error 1055 report.
2004-11-01 Miguel de Icaza <miguel@ximian.com>
* assign.cs (Assign.DoResolve): Only do the transform of
assignment into a New if the types are compatible, if not, fall
through and let the implicit code deal with the errors and with
the necessary conversions.
2004-11-01 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add error 1031 report.
* cs-tokenizer.cs: Add location for error 1038.
2004-10-31 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add error 1016 report.
2004-10-31 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add errors 1575,1611 report.
2004-10-31 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Add error 1001 report.
2004-10-31 Marek Safar <marek.safar@seznam.cz>
Fix #68850
* attribute.cs (GetMarshal): Add method argument for
caller identification.
* class.cs, codegen.cs, enum.cs, parameter.cs: Added
agument for GetMarshal and RuntimeMissingSupport.
2004-10-31 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (ExtractSecurityPermissionSet): Removed
TypeManager.code_access_permission_type.
* typemanager.cs: Removed TypeManager.code_access_permission_type.
2004-10-27 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LocalVariableReference.DoResolveLValue): Check
for obsolete use of a variable here. Fixes regression on errors
cs0619-25 and cs0619-26.
2004-10-27 Marek Safar <marek.safar@seznam.cz>
Fix #62358, implemented security attribute encoding.
* attribute.cs (Attribute.CheckSecurityActionValididy): New method.
Tests permitted SecurityAction for assembly or other types.
(Assembly.ExtractSecurityPermissionSet): New method. Transforms
data from SecurityPermissionAttribute to PermisionSet class.
* class.cs (ApplyAttributeBuilder): Added special handling
for System.Security.Permissions.SecurityAttribute based types.
* codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
special handling for System.Security.Permissions.SecurityAttribute
based types.
* enum.cs (ApplyAttributeBuilder): Added special handling
for System.Security.Permissions.SecurityAttribute based types.
* parameter.cs (ApplyAttributeBuilder): Added special handling
for System.Security.Permissions.SecurityAttribute based types.
* rootcontext.cs: Next 2 core types.
* typemanager.cs (TypeManager.security_permission_attr_type):
Built in type for the SecurityPermission Attribute.
(code_access_permission_type): Build in type.
2004-10-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LocalVariableReference.DoResolveBase, Emit):
Remove the tests for `ec.RemapToProxy' from here, and encapsulate
all of this information into
EmitContext.EmitCapturedVariableInstance.
* codegen.cs (EmitCapturedVariableInstance): move here the
funcionality of emitting an ldarg.0 in the presence of a
remapping. This centralizes the instance emit code.
(EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
then emit a load of this: it means that we have reached the
topmost ScopeInfo: the one that contains the pointer to the
instance of the class hosting the anonymous method.
* anonymous.cs (AddField, HaveCapturedFields): Propagate field
captures to the topmost CaptureContext.
2004-10-12 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LocalVariableReference): Move the knowledge about
the iterators into codegen's EmitCapturedVariableInstance.
2004-10-11 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
all code paths return a value from an anonymous method (it is the
same as the 161 error, but for anonymous methods).
2004-10-08 Miguel de Icaza <miguel@ximian.com>
The introduction of anonymous methods in the compiler changed
various ways of doing things in the compiler. The most
significant one is the hard split between the resolution phase
and the emission phases of the compiler.
For instance, routines that referenced local variables no
longer can safely create temporary variables during the
resolution phase: they must do so from the emission phase,
since the variable might have been "captured", hence access to
it can not be done with the local-variable operations from the runtime.
* statement.cs
(Block.Flags): New flag `IsTopLevel' to indicate that this block
is a toplevel block.
(ToplevelBlock): A new kind of Block, these are the blocks that
are created by the parser for all toplevel method bodies. These
include methods, accessors and anonymous methods.
These contain some extra information not found in regular blocks:
A pointer to an optional CaptureContext (for tracking captured
local variables and parameters). A pointer to the parent
ToplevelBlock.
(Return.Resolve): Catch missmatches when returning a value from an
anonymous method (error 1662).
Invoke NeedReturnLabel from the Resolve phase instead of the emit
phase.
(Break.Resolve): ditto.
(SwitchLabel): instead of defining the labels during the
resolution phase, we now turned the public ILLabel and ILLabelCode
labels into methods called GetILLabelCode() and GetILLabel() that
only define the label during the Emit phase.
(GotoCase): Track the SwitchLabel instead of the computed label
(its contained therein). Emit the code by using
SwitchLabel.GetILLabelCode ().
(LocalInfo.Flags.Captured): A new flag has been introduce to track
whether the Local has been captured or not.
(LocalInfo.IsCaptured): New property, used to tell whether the
local has been captured.
* anonymous.cs: Vastly updated to contain the anonymous method
support.
The main classes here are: CaptureContext which tracks any
captured information for a toplevel block and ScopeInfo used to
track the activation frames for various local variables.
Each toplevel block has an optional capture context associated
with it. When a method contains an anonymous method both the
toplevel method and the anonymous method will create a capture
context. When variables or parameters are captured, they are
recorded on the CaptureContext that owns them, for example:
void Demo () {
int a;
MyDelegate d = delegate {
a = 1;
}
}
Here `a' will be recorded as captured on the toplevel
CapturedContext, the inner captured context will not have anything
(it will only have data if local variables or parameters from it
are captured in a nested anonymous method.
The ScopeInfo is used to track the activation frames for local
variables, for example:
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++){
MyDelegate d = delegate {
call (i, j);
}
}
At runtime this captures a single captured variable `i', but it
captures 10 different versions of the variable `j'. The variable
`i' will be recorded on the toplevel ScopeInfo, while `j' will be
recorded on a child.
The toplevel ScopeInfo will also track information like the `this'
pointer if instance variables were referenced (this is necessary
as the anonymous method lives inside a nested class in the host
type of the method).
(AnonymousMethod): Expanded to track the Toplevel, implement
`AnonymousMethod.Compatible' to tell whether an anonymous method
can be converted to a target delegate type.
The routine now also produces the anonymous method content
(AnonymousDelegate): A helper class that derives from
DelegateCreation, this is used to generate the code necessary to
produce the delegate for the anonymous method that was created.
* assign.cs: API adjustments for new changes in
Convert.ImplicitStandardConversionExists.
* class.cs: Adjustments to cope with the fact that now toplevel
blocks are of type `ToplevelBlock'.
* cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
insteda of standard blocks.
Flag errors if params arguments are passed to anonymous methods.
* codegen.cs (EmitContext): Replace `InAnonymousMethod' with
`CurrentAnonymousMethod' which points to the current Anonymous
Method. The variable points to the AnonymousMethod class that
holds the code being compiled. It is set in the new EmitContext
created for the anonymous method.
(EmitContext.Phase): Introduce a variable and an enumeration to
assist in enforcing some rules about when and where we are allowed
to invoke certain methods (EmitContext.NeedsReturnLabel is the
only one that enfonces this right now).
(EmitContext.HaveCaptureInfo): new helper method that returns
whether we have a CapturedContext initialized.
(EmitContext.CaptureVariable): New method used to register that a
LocalInfo must be flagged for capturing.
(EmitContext.CapturedParameter): New method used to register that a
parameters must be flagged for capturing.
(EmitContext.CapturedField): New method used to register that a
field must be flagged for capturing.
(EmitContext.HaveCapturedVariables,
EmitContext.HaveCapturedFields): Return whether there are captured
variables or fields.
(EmitContext.EmitMethodHostInstance): This is used to emit the
instance for the anonymous method. The instance might be null
(static methods), this (for anonymous methods that capture nothing
and happen to live side-by-side with the current method body) or a
more complicated expression if the method has a CaptureContext.
(EmitContext.EmitTopBlock): Routine that drives the emission of
code: it will first resolve the top block, then emit any metadata
and then emit the code. The split is done so that we can extract
any anonymous methods and flag any captured variables/parameters.
(EmitContext.ResolveTopBlock): Triggers the resolution phase,
during this phase, the ILGenerator should not be used as labels
and local variables declared here might not be accessible to any
code that is part of an anonymous method.
Exceptions to this include the temporary variables that are
created by some statements internally for holding temporary
variables.
(EmitContext.EmitMeta): New routine, in charge of emitting all the
metadata for a cb
(EmitContext.TemporaryReturn): This method is typically called
from the Emit phase, and its the only place where we allow the
ReturnLabel to be defined other than the EmitMeta. The reason is
that otherwise we would have to duplicate a lot of logic in the
Resolve phases of various methods that today is on the Emit
phase.
(EmitContext.NeedReturnLabel): This no longer creates the label,
as the ILGenerator is not valid during the resolve phase.
(EmitContext.EmitThis): Extended the knowledge in this class to
work in anonymous methods in addition to iterators.
(EmitContext.EmitCapturedVariableInstance): This emits whatever
code is necessary on the stack to access the instance to a local
variable (the variable will be accessed as a field).
(EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
EmitContext.EmitAddressOfParameter): Routines to support
parameters (not completed at this point).
Removals: Removed RemapLocal and RemapLocalLValue. We probably
will also remove the parameters.
* convert.cs (Convert): Define a `ConstantEC' which points to a
null. This is just to prefity some code that uses
ImplicitStandardConversion code and do not have an EmitContext
handy.
The idea is to flag explicitly that at that point in time, it is
known that the conversion will not trigger the delegate checking
code in implicit conversions (which requires a valid
EmitContext).
Everywhere: pass new EmitContext parameter since
ImplicitStandardConversionExists now requires it to check for
anonymous method conversions.
(Convert.ImplicitStandardConversionExists): If the type of an
expression is the anonymous_method_type, and the type is a
delegate, we invoke the AnonymousMethod.Compatible method to check
whether an implicit conversion is possible.
(Convert.ImplicitConversionStandard): Only do implicit method
group conversions if the language level is not ISO_1.
* delegate.cs (Delegate.GetInvokeMethod): Common method to get the
MethodInfo for the Invoke method. used by Delegate and
AnonymousDelegate.
* expression.cs (Binary.DoNumericPromotions): only allow anonymous
method conversions if the target type is a delegate.
Removed extra debugging nops.
(LocalVariableReference): Turn the `local_info' into a public
field.
Add `prepared' field, the same hack used for FieldExprs to cope
with composed assignments, as Local variables do not necessarily
operate purely on the stack as they used to: they can be captured
fields.
Add `temp' for a temporary result, like fields.
Refactor DoResolve and DoResolveLValue into DoResolveBase.
It now copes with Local variables that are captured and emits the
proper instance variable to load it from a field in the captured
case.
(ParameterReference.DoResolveBase): During the resolve phase,
capture parameters if we are in an anonymous method.
(ParameterReference.Emit, ParameterReference.AddressOf): If in an
anonymous method, use the EmitContext helper routines to emit the
parameter reference.
* iterators.cs: Set RemapToProxy to true/false during the
EmitDispose class.
* parameters.cs (GetParameterByName): New helper method.
* typemanager.cs (anonymous_method_type) a new type that
represents an anonyous method. This is always an internal type,
used as a fencepost to test against the anonymous-methodness of an
expression.
2004-10-20 Marek Safar <marek.safar@seznam.cz>
* class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
561 report.
(PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2004-11-10 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.BetterFunction): If two methods have
equal parameter types, but only one of them is generic, the
non-generic one wins.
(New.DoResolve): Don't set `is_struct' to false if we're a generic
instance; just use `Type.IsValueType' to determine whether
something is a struct or not.
(MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
so we can be called multiple times.
2004-11-10 Martin Baulig <martin@ximian.com>
* generic.cs (TypeParameter.DefineConstraints): New public method.
(TypeParameter.CheckAccessLevel): Override this and return true.
(ConstructedType.ResolveType): Renamed to DoResolveType(), don't
override ResolveType() anymore.
(ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2004-11-10 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.LookupType): If we're a nested type,
call DeclSpace.ResolveNestedType() on it.
2004-11-10 Martin Baulig <martin@ximian.com>
* support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
non-null, call ParameterModifier() on it.
2004-11-10 Martin Baulig <martin@ximian.com>
* iterators.cs
(Iterators): Added `current_type' and `this_type' fields.
(Iterators.DefineIterator): Create a new EmitContext and store it
in `ec'; compute `this_type'.
2004-11-10 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.IsPrivateAccessible): New public method.
(Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2004-11-10 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Call
TypeBuilder.DefineGenericParameters() before resolving the type
parameters.
(MethodData.parent_method): New protected field.
(MethodData..ctor): Added `MethodInfo parent_method' argument.
(MethodData.Define): Compute `parent_method'.
* decl.cs
(MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
(MemberCore.GetClsCompliantAttributeValue): Likewise.
(DeclSpace.ec): New protected field; store the EmitContext here.
(DeclSpace.EmitContext): New public property.
(DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
(DeclSpace.ResolveNestedType): New public method.
(DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
(DeclSpace.NestedAccessible): Added `Type tb' argument.
(DeclSpace.FamilyAccessible): Likewise.
(DeclSpace.FindType): Call ResolveNestedType() for nested types.
(DeclSpace.GetClsCompliantAttributeValue): Don't create a new
EmitContext.
* delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
field.
* enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
(Enum.Emit): Don't create a new EmitContext.
2004-10-18 Martin Baulig <martin@ximian.com>
* statement.cs (Fixed.Resolve): Don't access the TypeExpr's
`Type' directly, but call ResolveType() on it.
(Catch.Resolve): Likewise.
(Foreach.Resolve): Likewise.
2004-10-18 Martin Baulig <martin@ximian.com>
* expression.cs (Cast.DoResolve): Don't access the TypeExpr's
`Type' directly, but call ResolveType() on it.
(Probe.DoResolve): Likewise.
(ArrayCreation.LookupType): Likewise.
(TypeOf.DoResolve): Likewise.
(SizeOf.DoResolve): Likewise.
2004-10-18 Raja R Harinath <rharinath@novell.com>
* class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
the ResolveType.
2004-10-17 John Luke <john.luke@gmail.com>
* class.cs (Operator.GetSignatureForError): use CSharpName
* parameter.cs (Parameter.GetSignatureForError): Returns
correct name even if was not defined.
2004-10-13 Raja R Harinath <rharinath@novell.com>
Fix #65816.
* class.cs (TypeContainer.EmitContext): New property.
(DefineNestedTypes): Create an emitcontext for each part.
(MethodCore.DoDefineParameters): Use container's emitcontext.
Pass type array to InternalParameters.
(MemberBase.DoDefine): Use container's emitcontext.
(FieldMember.Define): Likewise.
(Event.Define): Likewise.
(SetMethod.GetParameterInfo): Change argument to EmitContext.
Pass type array to InternalParameters.
(SetIndexerMethod.GetParameterInfo): Likewise.
(SetMethod.Define): Pass emitcontext to GetParameterInfo.
* delegate.cs (Define): Pass emitcontext to
ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
array to InternalParameters.
* expression.cs (ParameterReference.DoResolveBase): Pass
emitcontext to GetParameterInfo.
(ComposedCast.DoResolveAsTypeStep): Remove check on
ec.ResolvingTypeTree.
* parameter.cs (Parameter.Resolve): Change argument to
EmitContext. Use ResolveAsTypeTerminal.
(Parameter.GetSignature): Change argument to EmitContext.
(Parameters.ComputeSignature): Likewise.
(Parameters.ComputeParameterTypes): Likewise.
(Parameters.GetParameterInfo): Likewise.
(Parameters.ComputeAndDefineParameterTypes): Likewise.
Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
* support.cs (InternalParameters..ctor): Remove variant that takes
a DeclSpace.
* typemanager.cs (system_intptr_expr): New.
(InitExpressionTypes): Initialize it.
2004-10-12 Chris Toshok <toshok@ximian.com>
* cs-parser.jay: fix location for try_statement and catch_clause.
2004-10-18 Martin Baulig <martin@ximian.com>
* class.cs (FieldMember.Define): Don't access the TypeExpr's
`Type' directly, but call ResolveType() on it.
(MemberBase.DoDefine): Likewise.
* expression.cs (New.DoResolve): Don't access the TypeExpr's
`Type' directly, but call ResolveType() on it.
(ComposedCast.DoResolveAsTypeStep): Likewise.
* statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
`Type' directly, but call ResolveType() on it.
2004-10-17 John Luke <john.luke@gmail.com>
* class.cs (Operator.GetSignatureForError): use CSharpName
* parameter.cs (Parameter.GetSignatureForError): Returns
correct name even if was not defined.
2004-10-13 Raja R Harinath <rharinath@novell.com>
Fix #65816.
* class.cs (TypeContainer.EmitContext): New property.
(DefineNestedTypes): Create an emitcontext for each part.
(MethodCore.DoDefineParameters): Use container's emitcontext.
Pass type array to InternalParameters.
(MemberBase.DoDefine): Use container's emitcontext.
(FieldMember.Define): Likewise.
(Event.Define): Likewise.
(SetMethod.GetParameterInfo): Change argument to EmitContext.
Pass type array to InternalParameters.
(SetIndexerMethod.GetParameterInfo): Likewise.
(SetMethod.Define): Pass emitcontext to GetParameterInfo.
* delegate.cs (Define): Pass emitcontext to
ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
array to InternalParameters.
* expression.cs (ParameterReference.DoResolveBase): Pass
emitcontext to GetParameterInfo.
(ComposedCast.DoResolveAsTypeStep): Remove check on
ec.ResolvingTypeTree.
* parameter.cs (Parameter.Resolve): Change argument to
EmitContext. Use ResolveAsTypeTerminal.
(Parameter.GetSignature): Change argument to EmitContext.
(Parameters.ComputeSignature): Likewise.
(Parameters.ComputeParameterTypes): Likewise.
(Parameters.GetParameterInfo): Likewise.
(Parameters.ComputeAndDefineParameterTypes): Likewise.
Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
* support.cs (InternalParameters..ctor): Remove variant that takes
a DeclSpace.
* typemanager.cs (system_intptr_expr): New.
(InitExpressionTypes): Initialize it.
2004-10-12 Chris Toshok <toshok@ximian.com>
* cs-parser.jay: fix location for try_statement and catch_clause.
2004-10-07 Raja R Harinath <rharinath@novell.com>
More DeclSpace.ResolveType avoidance.
* decl.cs (MemberCore.InUnsafe): New property.
* class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
with newly created EmitContext.
(FieldMember.Define): Likewise.
* delegate.cs (Delegate.Define): Likewise.
* ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
only if normal name-lookup fails.
(TypeExpr.DoResolve): Enable error-checking.
* expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
(SizeOf.DoResolve): Likewise.
(ComposedCast.DoResolveAsTypeStep): Likewise.
(StackAlloc.DoResolve): Likewise.
* statement.cs (Block.Flags): Add new flag 'Unsafe'.
(Block.Unsafe): New property.
(Block.EmitMeta): Set ec.InUnsafe as appropriate.
(Unsafe): Set 'unsafe' flag of contained block.
(LocalInfo.Resolve): Use ResolveAsTypeTerminal.
(Fixed.Resolve): Likewise.
(Catch.Resolve): Likewise.
(Using.ResolveLocalVariableDecls): Likewise.
(Foreach.Resolve): Likewise.
2004-10-05 John Luke <john.luke@gmail.com>
* cs-parser.jay: add location to error CS0175
2004-10-04 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.Constantity): Add support for turning null
into a constant.
* const.cs (Const.Define): Allow constants to be reference types
as long as the value is Null.
2004-10-04 Juraj Skripsky <js@hotfeet.ch>
* namespace.cs (NamespaceEntry.Using): No matter which warning
level is set, check if this namespace name has already been added.
2004-10-03 Ben Maurer <bmaurer@ximian.com>
* expression.cs: reftype [!=]= null should always use br[true,false].
# 67410
2004-10-03 Marek Safar <marek.safar@seznam.cz>
Fix #67108
* attribute.cs: Enum conversion moved to
GetAttributeArgumentExpression to be applied to the all
expressions.
2004-10-01 Raja R Harinath <rharinath@novell.com>
Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
* class.c (TypeContainer.DefineType): Flag error if
base types aren't accessible due to access permissions.
* decl.cs (DeclSpace.ResolveType): Move logic to
Expression.ResolveAsTypeTerminal.
(DeclSpace.ResolveTypeExpr): Thin layer over
Expression.ResolveAsTypeTerminal.
(DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
Refactor code into NestedAccess. Use it.
(DeclSpace.NestedAccess): New.
* ecore.cs (Expression.ResolveAsTypeTerminal): Add new
argument to silence errors. Check access permissions.
(TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
* expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
(Cast.DoResolve): Likewise.
(New.DoResolve): Likewise.
(InvocationOrCast.DoResolve,ResolveStatement): Likewise.
(TypeOf.DoResolve): Likewise.
* expression.cs (Invocation.BetterConversion): Return the Type of
the better conversion. Implement section 14.4.2.3 more faithfully.
(Invocation.BetterFunction): Make boolean. Make correspondence to
section 14.4.2.2 explicit.
(Invocation.OverloadResolve): Update.
(Invocation): Remove is_base field.
(Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
(Invocation.Emit): Likewise.
2004-09-24 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Reverted 642 warning fix.
2004-09-23 Marek Safar <marek.safar@seznam.cz>
Fix bug #66615
* decl.cs (FindMemberWithSameName): Indexer can have more than
1 argument.
2004-09-23 Marek Safar <marek.safar@seznam.cz>
* expression.cs (LocalVariableReference.DoResolveLValue):
Do not report warning 219 for out values.
(EmptyExpression.Null): New member to avoid extra allocations.
2004-09-23 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Fix wrong warning 642 report.
* cs-tokenizer.cs (CheckNextToken): New helper;
Inspect next character if is same as expected.
2004-09-23 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
(Convert.ImplicitReferenceConversionExists): Likewise.
2004-11-09 Raja R Harinath <rharinath@novell.com>
* Makefile (DISTFILES): Comment out a few missing files.
2004-10-29 Raja R Harinath <rharinath@novell.com>
* Makefile (bootstrap_libs,bootstrap_libfiles): New.
(bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
(gmcs.exe): Invoke bootstrap-libs.
(clean-local): Clean the net_2_0_bootstrap profile too.
(PROGRAM_INSTALL_DIR): New.
(install-local): Use it.
2004-10-13 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.InflatedConstraints): New nested class.
(TypeParameter.DefineType): If we're a method type parameter and
that method is overriding something, "inflate" its constraints.
2004-10-12 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.DoResolve): If we're a SimpleName
and have type arguments, create and resolve a ConstructedType.
2004-10-12 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.FindMemberToOverride): Use
TypeManager.IsEqual() to compare the parameters and Type.Equals()
to compare the invocationType.
* typemanager.cs (TypeManager.IsEqual): Added support for arrays.
When comparing two type parameters, only do the signature-only
comparision for method type parameters.
2004-10-11 Martin Baulig <martin@ximian.com>
* report.cs: Don't make --fatal abort on warnings, we have
-warnaserror for that.
2004-10-11 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
(TypeManager.IsEqual): Call ourself recursively instead of using
Type.IsEqual().
2004-10-11 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
on our own type parameters, not on the ones we inherit from a containing
class.
* expression.cs (Invocation.InferType): Use `==', not `Equals()' for
the comparision.
* generic.cs (TypeParameter.Define): We may only be called once.
* pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
instead of TypeManager.IsEqual().
2004-09-28 Martin Baulig <martin@ximian.com>
* generic.cs
(GenericConstraints.EffectiveBaseClass): New public property.
(TypeParameter.GenericConstraints): New public property.
(ConstructedType.CheckConstraints): Improved.
* convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
(Convert.TypeParameterConversion): New private method; use this in
ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
for all conversions related to type parameters.
2004-09-24 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitReferenceConversion): Added implicit
type parameter conversions for type parameters which are known to
be reference types.
2004-09-24 Martin Baulig <martin@ximian.com>
* generic.cs (GenericConstraints): Added `IsReferenceType' and
`IsValueType' properties.
* support.cs (ReflectionConstraints): Use
Type.GetGenericParameterConstraints() instead of the old hack.
2004-09-24 Martin Baulig <martin@ximian.com>
* generic.cs (GenericConstraints): Moved here and made it an
abstract class.
* support.cs (GenericConstraints): Moved to generic.cs.
2004-09-24 Martin Baulig <martin@ximian.com>
* support.cs
(ReflectionConstraints): Un-nested this class and made it public.
* typemanager.cs
(TypeManager.GetTypeParameterConstraints): New public method.
(TypeManager.HasConstructorConstraint): Use the attributes.
2004-09-24 Martin Baulig <martin@ximian.com>
* support.cs (GenericConstraints): Replaced `HasConstructor',
`IsReferenceType' and `IsValueType' with `Attributes'.
(ReflectionParameters.ReflectionConstraints): Removed the Create()
method and made the .ctor public.
* generic.cs (Constraints.Attributes): New public property.
(Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
`IsReferenceType' -> `HasReferenceTypeConstraint' and
`IsValueType' -> `HasValueTypeConstraint'.
2004-09-23 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints): Reflect latest runtime changes.
2004-09-23 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
(Convert.ImplicitReferenceConversionExists): Likewise.
2004-09-23 Marek Safar <marek.safar@seznam.cz>
* class.cs (Operator.Define): Add error 448 and 559 report.
2004-09-22 Marek Safar <marek.safar@seznam.cz>
* class.cs (MemberBase.IsTypePermitted): New protected
method for checking error CS0610.
2004-09-22 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.HasExplicitLayout): New property
Returns whether container has StructLayout attribute set Explicit.
(FieldMember): New abstract class for consts and fields.
(FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
(Field): Reuse FieldMember.
* const.cs (Const): Reuse FieldMember.
* rootcontext.cs: EmitConstants call moved to class.
2004-09-22 Martin Baulig <martin@ximian.com>
Marek and me just fixed one of our oldest bugs: #28562 :-)
* ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
* attribute.cs (Attribute.GetAttributeArgumentExpression): If
we're an EnumConstant, just return that.
(Attribute.Resolve): GetAttributeArgumentExpression() may give us
an EnumConstant. In this case, we need to use GetValueAsEnumType()
to get the value which'll actually be written into the attribute.
However, we have to use GetValue() to access the attribute's value
in the compiler.
2004-09-22 Marek Safar <marek.safar@seznam.cz>
* constant.cs (Constant.IsNegative): New abstract property
IsNegative.
* expression.cs (ArrayAccess.DoResolve): Add warning 251.
(StackAlloc.DoResolve): Reused IsNegative.
2004-09-22 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.LookupGenericTypeContainer): New
public method; like LookupTypeContainer, but also works for
generic instances.
* report.cs (Report.SymbolRelatedToPreviousError): Use
TypeManager.LookupGenericTypeContainer().
2004-09-22 Martin Baulig <martin@ximian.com>
Thanks to Peter Sestoft for this bug report.
* expression.cs (Conditional): If both the `trueExpr' and the
`falseExpr' is a NullLiteral, return a NullLiteral.
2004-09-22 Martin Baulig <martin@ximian.com>
* statement.cs (Foreach.EmitCollectionForeach): If we're in an
iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
for the "get_Current" call.
2004-09-21 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitReferenceConversion): When
converting to an interface type, first check whether we're
converting from a reference type.
2004-09-14 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2004-09-14 Marek Safar <marek.safar@seznam.cz>
Fixed bug #61902
* codegen.cs (TestObsoleteMethodUsage): Trace when method is
called and is obsolete then this member suppress message
when call is inside next [Obsolete] method or type.
* expression.cs: Use TestObsoleteMethodUsage member.
2004-09-14 Martin Baulig <martin@ximian.com>
* genericparser.cs: Removed.
2004-09-13 Marek Safar <marek.safar@seznam.cz>
* class.cs (MethodCore.CheckBase): Fix bug #65757.
2004-09-12 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.Resolve): Add error 653 report.
* class.cs (Class.ApplyAttributeBuilder): Add error 641
report.
(Method.ApplyAttributeBuilder): Add error 685 report.
(Operator.Define): Add error 564 report.
* cs-tokenizer.cs (handle_hex): Add error 1013 report.
* expression.cs (Invocation.DoResolve): Add error
245 and 250 report.
* parameter.cs (Parameter.ApplyAttributeBuilder): Add
error 674 report.
2004-09-11 Marek Safar <marek.safar@seznam.cz>
* class.cs (ConstructorInitializer.Resolve):
Wrong error number (515->516).
2004-09-11 Marek Safar <marek.safar@seznam.cz>
* class.cs (Indexer.Define): Add error 631 report.
2004-09-11 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2004-09-11 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Probe.DoResolve): Add error CS0241 report.
2004-09-10 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added error CS0241 report.
2004-09-10 Raja R Harinath <rharinath@novell.com>
* cs-parser.jay (fixed_statement): Introduce a scope for the
declaration in the 'fixed' statement.
2004-09-09 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added CS0230 error report.
2004-09-09 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added errors CS0231 and CS0257 report.
2004-09-09 Marek Safar <marek.safar@seznam.cz>
* expression.cs (Argument.Resolve): Added error CS0192 and
CS0199 report.
2004-09-09 Marek Safar <marek.safar@seznam.cz>
C# 2.0 #pragma warning feature
* cs-tokenizer.cs (PreProcessPragma): New method;
Handles #pragma directive.
* report.cs (WarningRegions): New class; Support
class for #pragma warning directive. It tests whether
warning is enabled for a given line.
2004-09-08 Miguel de Icaza <miguel@ximian.com>
* const.cs: Add more descriptive error report, tahnks to
Sebastien.
2004-09-08 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2004-09-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Apply patch from Ben: Remove dead code from
ArrayCreation, and remove the TurnintoConstant call in const.cs,
as that code just threw an exception anwyays.
* const.cs: Remove the call to the turnintoconstant, for details
see bug: #63144
* literal.cs: The type of the null-literal is the null type; So
we use a placeholder type (literal.cs:System.Null, defined here)
for it.
* expression.cs (Conditional.DoResolve): Remove some old code that
is no longer needed, conversions have been fixed.
(ArrayCreationExpression.DoResolve): Return false if we fail to
resolve the inner expression.
2004-09-07 Raja R Harinath <rharinath@novell.com>
Fix test-290.cs.
* cs-parser.jay (delegate_declaration): Record a delegate
declaration as a type declaration.
Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2004-09-06 Miguel de Icaza <miguel@ximian.com>
* parameter.cs: Do not crash if the type can not be resolved.
* expression.cs: Report errors with unsafe pointers, fixes #64896
2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Pointer arith always needs to do a conv.i
if the operand is a long. fix 65320
2004-09-04 Marek Safar <marek.safar@seznam.cz>
Fixed cs0619-37.cs, cs0619-38.cs
* enum.cs (GetObsoleteAttribute): Removed.
* expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
on Enum member is double staged. The first is tested member
and then enum.
2004-09-04 Marek Safar <marek.safar@seznam.cz>
Fixed #56986, #63631, #65231
* class.cs: (TypeContainer.AddToMemberContainer): New method,
adds member to name container.
(TypeContainer.AddToTypeContainer): New method, adds type to
name container.
(AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
AddOperator): Simplified by reusing AddToMemberContainer.
(TypeContainer.UserDefinedStaticConstructor): Changed to property
instead of field.
(Method.CheckForDuplications): Fixed implementation to test all
possibilities.
(MemberBase): Detection whether member is explicit interface
implementation is now in constructor.
(MemberBase.UpdateMemberName): Handles IndexerName.
(Accessor): Changed to keep also location information.
(AbstractPropertyEventMethod): Is derived from MemberCore.
(AbstractPropertyEventMethod.IsDummy): Says whether accessor
will be emited or not.
(PropertyBase.AreAccessorsDuplicateImplementation):
Tests whether accessors are not in collision with some method.
(Operator): Is derived from MethodCore to simplify common
operations.
* decl.cs (Flags.TestMethodDuplication): Test for duplication
must be performed.
(DeclSpace.AddToContainer): Adds the member to defined_names
table. It tests for duplications and enclosing name conflicts.
* enum.cs (EnumMember): Clean up to reuse the base structures
2004-09-03 Martin Baulig <martin@ximian.com>
Merged latest changes into gmcs. Please keep this comment in
here, it makes it easier for me to see what changed in MCS since
the last time I merged.
2004-09-03 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineDefaultConstructor): Put this back
into TypeContainer, to make partial classes work again.
2004-09-03 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.V2): Removed.
2004-03-23 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.OverloadResolve): Added `bool
may_fail' argument and use it instead of the Location.IsNull() hack.
2004-09-09 Martin Baulig <martin@ximian.com>
* cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2004-09-09 Martin Baulig <martin@ximian.com>
* generic.cs (TypeParameter.DefineType): Added support for
explicit interface methods.
2004-09-09 Martin Baulig <martin@ximian.com>
* README.Changes: New document. Started to list important changes
between MCS and GMCS here.
2004-09-08 Martin Baulig <martin@ximian.com>
* class.cs
(TypeContainer.CheckRecursiveDefinition): New protected method.
(TypeContainer.DefineType): Move the CS0146 check into
CheckRecursiveDefinition().
2004-09-06 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Allow builtin
types for the constructor constraint.
2004-09-03 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineDefaultConstructor): Put this back
into TypeContainer, to make partial classes work again.
2004-09-03 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.V2): Removed.
2004-03-23 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.OverloadResolve): Added `bool
may_fail' argument and use it instead of the Location.IsNull() hack.
2004-09-03 Martin Baulig <martin@ximian.com>
Merged latest changes into gmcs. Please keep this comment in
here, it makes it easier for me to see what changed in MCS since
the last time I merged.
2004-09-03 Raja R Harinath <rharinath@novell.com>
Fix #61128.
* expression.cs (BetterConversion): Don't allow either conversion
to be null. Remove redundant implicit conversion test when 'q ==
null' -- when this function is invoked, we already know that the
implicit conversion exists.
(BetterFunction): Assume that 'best' is non-null. Remove
redundant reimplementation of IsApplicable when 'best' is null.
(IsParamsMethodApplicable, IsApplicable): Add new parameter for
number of arguments.
(IsAncestralType): Extract from OverloadResolve.
(OverloadResolve): Make robust to the MethodGroupExpr being
unsorted. Implement all the logic of Section 14.5.5.1, and
support overloading of methods from multiple applicable types.
Clean up logic somewhat. Don't pass null methods to BetterFunction.
* report.cs (SymbolRelatedToPreviousError): Cleanup output.
(RealError, Warning): Append type of report to related symbol.
2004-09-03 Marek Safar <marek.safar@seznam.cz>
* enum.cs: Fixed CLS-Compliance checks for enum members.
Error tests cs3008-8.cs, cs3014-8.cs
2004-09-02 Marek Safar <marek.safar@seznam.cz>
Fixed bug #62342, #63102
* class.cs: ImplementIndexer uses member.IsExplicitImpl
like ImplementMethod.
2004-09-02 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.GetAttributeArgumentExpression):
Fixed bug #65170.
2004-09-02 Martin Baulig <martin@ximian.com>
* statement.cs (Using.EmitLocalVariableDeclFinally): Use
TypeManager.GetArgumentTypes() rather than calling GetParameters()
on the MethodBase.
2004-09-01 Marek Safar <marek.safar@seznam.cz>
C# 2.0 Static classes implemented
* class.cs (TypeContainer): instance_constructors,
initialized_fields, initialized_static_fields,
default_constructor, base_inteface_types are protected to be
accessible from StaticClass.
(TypeContainer.DefineDefaultConstructor): New virtual method
for custom default constructor generating
(StaticClass): New class to handle "Static classes" feature.
* cs-parser.jay: Handle static keyword on class like instance
of StaticClass.
* driver.cs: Added "/langversion" command line switch with two
options (iso-1, default).
2004-08-31 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2004-08-31 Miguel de Icaza <miguel@ximian.com>
* delegate.cs: Style.
2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
* delegate.cs: Add seperate instance expr field for miguel.
2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
* PointerArithmetic (Resolve): make sure we are not doing
pointer arith on void*. Also, make sure we are resolved
by not setting eclass until resolve.
All callers: Make sure that PointerArithmetic gets resolved.
2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
* ArrayCreation (LookupType): If the type does not resolve
to an array, give an error.
2004-08-27 Marek Safar <marek.safar@seznam.cz>
* statement.cs (Try.Resolve): Fixed bug #64222
2004-08-27 Martin Baulig <martin@ximian.com>
* class.cs
(TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
crash here.
2004-08-26 Marek Safar <marek.safar@seznam.cz>
* ecore.cs (Constantify): Get underlying type via
System.Enum.GetUnderlyingType to avoid StackOverflow on the
Windows in special cases.
2004-08-26 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs (GetAddMethod): Used GetAddMethod (true)
for obtaining also private methods.
(GetRemoveMethod): Used GetRemoveMethod (true)
for obtaining also private methods.
2004-09-02 Martin Baulig <martin@ximian.com>
* statement.cs (Using.EmitLocalVariableDeclFinally): Use
TypeManager.GetArgumentTypes() rather than calling GetParameters()
on the MethodBase.
2004-08-27 Martin Baulig <martin@ximian.com>
* class.cs
(TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
crash here.
2004-08-25 Martin Baulig <martin@ximian.com>
* support.cs (ReflectionParameters..ctor): If this is a generic
method, retrieve and store its type parameters.
(InternalParameters..ctor): Added `TypeParameter[]' argument.
(ReflectionParameters.GenericConstraints): The argument specifies
the type parameter, not the method parameter.
(InternalParameters.GenericConstraints): Likewise.
* generic.cs (TypeParameter.DefineType): Correctly handle
constraints wrt. generic methods in interfaces and their
implementations.
2004-08-24 Martin Baulig <martin@ximian.com>
* generic.cs (TypeParameter.IsSubclassOf): New public method.
(Constraints.IsSubclassOf): New internal method.
* typemanager.cs (TypeManager.FindMembers): Added special support
for GenericTypeParameterBuilder's.
(TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
type parameters.
2004-08-24 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
this for accessibility checks.
(TypeManager.IsSubclassOrNestedChildOf): Renamed to
IsNestedFamilyAccessible.
(TypeManager.IsSubclassOf): New method, do what the name actually
says.
2004-08-24 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.DoResolve): When resolving ourselves
as a SimpleName, include the generic arity.
2004-08-24 Martin Baulig <martin@ximian.com>
* class.cs (Method.Define): Set MethodAttributes.SpecialName and
MethodAttributes.HideBySig for operators.
2004-08-23 Martin Baulig <martin@ximian.com>
Back to the old error reporting system :-)
* report.cs (Message): Removed.
(Report.MessageData, ErrorData, WarningData): Removed.
(Report.Error, Warning): Back to the old system.
2004-08-23 Martin Baulig <martin@ximian.com>
* decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
* class.cs (TypeContainer.ParentContainer): New public virtual
method; replaces the explicit interface implementation.
(ClassPart.ParentContainer): Override.
2004-08-23 Martin Baulig <martin@ximian.com>
* statement.cs (Switch): Added support for constant switches; see
#59428 or test-285.cs.
2004-08-22 Marek Safar <marek.safar@seznam.cz>
Fixed bug #62740.
* statement.cs (GetEnumeratorFilter): Removed useless
logic because C# specs is strict. GetEnumerator must be
public.
2004-08-22 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
a switch and may break, reset the barrier. Fixes #59867.
2004-08-22 Marek Safar <marek.safar@seznam.cz>
CLS-Compliance speed up (~5% for corlib)
* attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
New method. Tests container for CLS-Compliant names
* class.cs (TypeContainer.VerifyClsName): New method.
Checks whether container name is CLS Compliant.
(Constructor): Implements IMethodData.
* decl.cs (MemberCache.GetPublicMembers ): New method. Builds
low-case table for CLS Compliance test.
(MemberCache.VerifyClsParameterConflict): New method.
Checks method parameters for CS3006 error.
* enum.cs (EnumMember): Is derived from MemberCore.
(Enum.VerifyClsName): Optimized for better performance.
2004-08-06 Marek Safar <marek.safar@seznam.cz>
* report.cs: Renamed Error_T to Error and changed all
references.
2004-08-06 Marek Safar <marek.safar@seznam.cz>
* class.cs (TypeContainer.IndexerArrayList): New inner class
container for indexers.
(TypeContainer.DefaultIndexerName): New constant for default
indexer name. Replaced all "Item" with this constant.
(TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
* typemanager.cs (TypeManager.default_member_ctor): Cache here
DefaultMemberAttribute constructor.
2004-08-05 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
Fix bug #59429.
2004-08-05 Marek Safar <marek.safar@seznam.cz>
* mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
multi platforms problem.
* compiler.csproj: Included shared files.
2004-08-04 Marek Safar <marek.safar@seznam.cz>
Fix bug 60333, 55971 in the more general way
* attribute.cs (Attribute.GetAttributeArgumentExpression):
Added arg_type argument for constant conversion.
(Attribute.Resolve): Reuse GetAttributeArgumentExpression.
2004-08-04 Marek Safar <marek.safar@seznam.cz>
Fix bug #59760
* class.cs (TypeContainer ): New inner classes MethodArrayList,
OperatorArrayList, MethodCoreArrayList for typecontainer
containers. Changed class member types to these new types.
(MethodArrayList.DefineMembers): Added test for CS0659.
2004-08-04 Miguel de Icaza <miguel@ximian.com>
* cfold.cs: Synchronize the folding with the code in expression.cs
Binary.DoNumericPromotions for uint operands.
* attribute.cs: Revert patch from Raja, it introduced a regression
while building Blam-1.2.1 (hard to isolate a test case).
2004-08-04 Marek Safar <marek.safar@seznam.cz>
Fix for #55382
* class.cs:
(TypeContainer.Define): Renamed to DefineContainerMembers because of
name collision.
(MethodCore.parent_method): New member. The method we're overriding
if this is an override method.
(MethodCore.CheckBase): Moved from Method class and made common.
(MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
private.
(MethodCore.CheckForDuplications): New abstract method. For custom
member duplication search in a container
(MethodCore.FindOutParentMethod): New abstract method. Gets parent
method and its return type.
(Event.conflict_symbol): New member. Symbol with same name in the
parent class.
* decl.cs:
(MemberCache.FindMemberWithSameName): New method. The method
is looking for conflict with inherited symbols.
2004-08-04 Martin Baulig <martin@ximian.com>
* codegen.cs (VariableStorage.EmitLoadAddress): New public method.
* statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2004-08-03 Marek Safar <marek.safar@seznam.cz>
* report.cs (Message): New enum for better error, warning reference in
the code.
(MessageData): New inner abstract class. It generally handles printing of
error and warning messages.
Removed unused Error, Warning, Message methods.
2004-08-03 Marek Safar <marek.safar@seznam.cz>
Fix for cs0592-8.cs test
* attribute.cs
(Attributable.ValidAttributeTargets): Made public.
(Attribute.ExplicitTarget): New member for explicit target value.
(Attribute.CheckTargets): Now we translate explicit attribute
target to Target here.
2004-08-03 Ben Maurer <bmaurer@ximian.com>
* ecore.cs (MethodGroupExpr): new IsBase property.
* expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
* delegate.cs (DelegateCreation): store a MethodGroupExpr
rather than an instance expr.
(DelegateCreation.Emit): Use the method group rather than
the instance expression. Also, if you have base.Foo as the
method for a delegate, make sure to emit ldftn, not ldftnvirt.
(ResolveMethodGroupExpr): Use the MethodGroupExpr.
(NewDelegate.DoResolve): Only check for the existance of Invoke
if the method is going to be needed. Use MethodGroupExpr.
(NewDelegate.Emit): Remove, DelegateCreation implements this.
* expression.cs: For pointer arith., make sure to use
the size of the type, not the size of the pointer to
the type.
2004-08-03 Marek Safar <marek.safar@seznam.cz>
Fix for #60722
* class.cs (Class): Added error CS0502 test.
2004-08-03 John Luke <jluke@cfl.rr.com>
Raja R Harinath <rharinath@novell.com>
Fix for #60997.
* attribute.cs (Attribute.complained_before): New flag.
(Attribute.ResolveType, Attribute.Resolve),
(Attribute.DefinePInvokeMethod): Set it.
(Attributes.Search): Pass 'complain' to Attribute.ResolveType.
2004-08-03 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.ResolveOperator): Don't abort if we can't
use a user-defined operator; we still need to do numeric
promotions in case one argument is a builtin type and the other
one has an implicit conversion to that type. Fixes #62322.
2004-08-18 Martin Baulig <martin@ximian.com>
* class.cs (Method.Define): Use the correct method name when
creating the MethodBuilder for a generic method.
2004-08-17 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints): Support type parameter constraints.
2004-08-16 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
(Token.GENERIC_DIMENSION): New token; this is returned if we
encounter an unbound generic type in a typeof() expression.
* cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
this token is only generated while parsing a typeof() expression.
(typeof_expression): Removed the old unbound_type hack.
* generic.cs (TypeArguments.IsUnbound): New public property.
* decl.cs (MemberName): Added support for unbound types.
2004-08-14 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.IsEqualGenericInstance): New static method.
(TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
just used to check accessibility, so follow the rules of 26.1.6.
* expression.cs (MemberAccess.ResolveAsTypeStep): Return a
ConstructedType instead of a TypeExpression if we have type arguments.
* cs-parser.jay (typeof_expression): Support unbound generic types.
* ecore.cs (UnboundTypeExpression): New public class.
2004-08-12 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsNestedChildOf): Use
TypeManager.IsEqual() rather than `=='.
* decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
generic instances as well.
2004-08-12 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): We can only infer method
type parameters. Fixes #62647.
2004-08-11 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Create the TypeBuilder
before resolving the base classes.
2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Makefile: install .mdb file too.
2004-08-05 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
initializer, the current type is just the TypeBuilder, not the
instantiated generic type.
(FieldExpr.IsFieldInitializer): New public property.
2004-08-04 Martin Baulig <martin@ximian.com>
* codegen.cs (VariableStorage.EmitLoadAddress): New public method.
* statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2004-08-03 Martin Baulig <martin@ximian.com>
* class.cs (MethodData.Define): If we're an explicit
implementation, remove the generic arity from the type name.
2004-08-03 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.ResolveOperator): Don't abort if we can't
use a user-defined operator; we still need to do numeric
promotions in case one argument is a builtin type and the other
one has an implicit conversion to that type. Fixes #62322.
2004-08-02 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
`TypeExpr[]' array.
(TypeContainer.GetClassBases): Return the unexpanded list of
interfaces; we expand them later.
(TypeContainer.DefineType): After creating the TypeBuilder, call
TypeManager.ExpandInterfaces() to get an expanded and resolved
list of interfaces.
* ecore.cs (TypeExpr.GetInterfaces): Removed
* generics.cs (Constraints.InterfaceConstraints): Remove.
(TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
register the interface constraints.
* typemanager.cs
(TypeManager.AddUserType): Removed the `ifaces' argument.
(TypeManager.AddTypeParameter): Likewise.
(TypeManager.AddUserInterface): Removed, was unused.
(TypeManager.RegisterBuilder): Take a `Type[]' instead of a
`TypeExpr[]' array for the interfaces.
(TypeManager.ExpandInterfaces): Call this after the TypeBuilder
has been defined, returns a list of the resolved interfaces types.
(TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
(TypeManager.GetExplicitInterfaces): Likewise.
2004-08-02 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.EmitCall): If we're invoking a method
on a type parameter, use the new `Constrained' prefix opcode.
2004-08-02 Martin Baulig <martin@ximian.com>
* statement.cs (LocalInfo.Flags): Added `IsThis'.
(LocalInfo.IsThis): New public property.
(Block.EmitMeta): Don't create a LocalBuilder for `this'.
2004-08-01 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Don't set the default
here since we may get called from GetPartialBases().
(TypeContainer.DefineType): If GetClassBases() didn't return a
parent, use the default one.
2004-07-30 Martin Baulig <martin@ximian.com>
* Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
* class.cs (SourceMethod): New public class, derive from the
symbol writer's ISourceMethod.
(Method): Use the new symbol writer API.
* codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
as argument and use the new symbol writer.
* location.cs
(SourceFile): Implement the symbol writer's ISourceFile.
(Location.SymbolDocument): Removed.
(Location.SourceFile): New public property.
* symbolwriter.cs: Use the new symbol writer API.
2004-07-30 Raja R Harinath <rharinath@novell.com>
* Makefile (install-local): Remove. Functionality moved to
executable.make.
2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
* Makefile: Install mcs.exe.config file together with mcs.exe.
* mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
correct runtime version.
2004-07-25 Martin Baulig <martin@ximian.com>
* class.cs
(TypeContainer.RegisterOrder): Removed, this was unused.
(TypeContainer, interface_order): Removed.
(TypeContainer.AddClass, AddStruct, AddInterface): Take a
TypeContainer as argument since we can also be called with a
`PartialContainer' for a partial class/struct/interface.
(TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
of checking whether we're an `Interface' - we could be a
`PartialContainer'.
(PartialContainer.Register): Override; call
AddClass()/AddStruct()/AddInterface() on our parent.
* cs-parser.jay (interface_member_declaration): Add things to the
`current_container', not the `current_class'.
* rootcontext.cs (RegisterOrder): The overloaded version which
takes an `Interface' was unused, removed.
* typemanager.cs (TypeManager.LookupInterface): Return a
`TypeContainer', not an `Interface'.
(TypeManager.IsInterfaceType): The `builder_to_declspace' may
contain a `PartialContainer' for an interface, so check it's
`Kind' to figure out what it is.
2004-07-25 Martin Baulig <martin@ximian.com>
* class.cs (Class.DefaultTypeAttributes): New public constant.
(Struct.DefaultTypeAttributes): Likewise.
(Interface.DefaultTypeAttributes): Likewise.
(PartialContainer.TypeAttr): Override this and add the
DefaultTypeAttributes.
2004-07-25 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
we can just use the `Parent' field instead.
2004-07-25 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.Emit): Renamed to EmitType().
2004-07-25 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
our parts before defining any methods.
(TypeContainer.VerifyImplements): Make this virtual.
(ClassPart.VerifyImplements): Override and call VerifyImplements()
on our PartialContainer.
2004-07-25 Martin Baulig <martin@ximian.com>
* iterators.cs (Iterator.Define): Renamed to DefineIterator().
* decl.cs (DeclSpace.Define): Removed the `TypeContainer'
argument, we can just use the `Parent' field instead.
* class.cs
(MemberBase.CheckBase): Removed the `TypeContainer' argument.
(MemberBase.DoDefine): Likewise.
2004-07-24 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCore.Parent): New public field.
(DeclSpace.Parent): Moved to MemberCore.
* class.cs (MethodCore.ds): Removed; use `Parent' instead.
(MemberBase.ctor): Added TypeContainer argument, pass it to our
parent's .ctor.
(FieldBase, Field, Operator): Likewise.
(EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
(EventField, Event): Likewise.
2004-07-23 Martin Baulig <martin@ximian.com>
* class.cs (PartialContainer): New public class.
(ClassPart): New public class.
(TypeContainer): Added support for partial classes.
(TypeContainer.GetClassBases): Splitted some of the functionality
out into GetNormalBases() and GetPartialBases().
* cs-tokenizer.cs (Token.PARTIAL): New token.
(Tokenizer.consume_identifier): Added some hacks to recognize
`partial', but only if it's immediately followed by `class',
`struct' or `interface'.
* cs-parser.jay: Added support for partial clases.
2004-07-23 Martin Baulig <martin@ximian.com>
* class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
a `DeclSpace' and also made it readonly.
(MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
(Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
(PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
* cs-parser.jay: Pass the `current_class', not the
`current_container' (at the moment, this is still the same thing)
to a new Method, Property, Event, Indexer or Constructor.
2004-07-23 Martin Baulig <martin@ximian.com>
* cs-parser.jay (CSharpParser): Added a new `current_class' field
and removed the `current_interface' one.
(struct_declaration, class_declaration, interface_declaration):
Set `current_class' to the newly created class/struct/interface;
set their `Bases' and call Register() before parsing their body.
2004-07-23 Martin Baulig <martin@ximian.com>
* class.cs (Kind): New public enum.
(TypeContainer): Made this class abstract.
(TypeContainer.Kind): New public readonly field.
(TypeContainer.CheckDef): New public method; moved here from
cs-parser.jay.
(TypeContainer.Register): New public abstract method.
(TypeContainer.GetPendingImplementations): New public abstract
method.
(TypeContainer.GetClassBases): Removed the `is_class' and
`is_iface' parameters.
(TypeContainer.DefineNestedTypes): Formerly known as
DoDefineType().
(ClassOrStruct): Made this class abstract.
* tree.cs (RootTypes): New public type.
2004-07-20 Martin Baulig <martin@ximian.com>
* tree.cs (Tree.RecordNamespace): Removed.
(Tree.Namespaces): Removed.
* rootcontext.cs (RootContext.IsNamespace): Removed.
* cs-parser.jay (namespace_declaration): Just create a new
NamespaceEntry here.
2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
* Makefile: Install gmcs.exe.config file together with gmcs.exe.
* gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
entry to make sure it runs in the correct runtime version.
2004-07-18 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Improved
constraints checking.
2004-07-18 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.BetterMethod): Call
TypeManager.TypeToCoreType() on all types and removed my previous
hack; we're already doig the right thing here.
2004-07-17 Martin Baulig <martin@ximian.com>
* decl.cs (MemberName.MakeName): Create the "class`1" names here.
2004-07-16 Martin Baulig <martin@ximian.com>
* iterators.cs: Added generics support.
2004-07-16 Martin Baulig <martin@ximian.com>
* iterators.cs: Rewrote this. We're now using one single Proxy
class for both the IEnumerable and the IEnumerator interface and
`Iterator' derives from Class so we can use the high-level API.
* class.cs (TypeContainer.AddIterator): New method.
(TypeContainer.DoDefineType): New protected virtual method, which
is called from DefineType().
(TypeContainer.DoDefineMembers): Call DefineType() and
DefineMembers() on all our iterators.
(TypeContainer.Emit): Call Emit() on all our iterators.
(TypeContainer.CloseType): Call CloseType() on all our iterators.
* codegen.cs (EmitContext.CurrentIterator): New public field.
2004-07-15 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.not_supported_exception_type): New type.
2004-07-14 Martin Baulig <martin@ximian.com>
* typemanager.cs
(TypeManager.generic_ienumerable_type): New type.
(TypeManager.generic_ienumerator_type): New type.
* rootcontext.cs
(RootContext.interfaces_first_stage): Added
"System.Collections.Generic.IEnumerator`1" and
"System.Collections.Generic.IEnumerable`1".
2004-07-14 Martin Baulig <martin@ximian.com>
* iterators.cs: Use real error numbers.
2004-07-14 Martin Baulig <martin@ximian.com>
* iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
requires this to be a System.Collection.IEnumerable and not a
class implementing that interface.
(IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
2004-07-13 Marek Safar <marek.safar@seznam.cz>
* class.cs: Fixed previous fix, it broke some error tests.
2004-07-12 Martin Baulig <martin@ximian.com>
* enum.cs (Enum.Define): Call Emit() to emit the attributes.
Fixes #61293.
2004-07-14 Martin Baulig <martin@ximian.com>
* decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
an exclamation mark (!) for the generic arity to reflect the
latest spec changes; ie. use "System.Collections.Generic.IList`1".
2004-07-13 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
specifiers being part of a type argument.
2004-07-13 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
name for generic types.
2004-07-13 Martin Baulig <martin@ximian.com>
* assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
bit to fix #60119.
2004-07-09 Miguel de Icaza <miguel@ximian.com>
* assign.cs (LocalTemporary): Add new argument: is_address,If
`is_address' is true, then the value that we store is the address
to the real value, and not the value itself.
* ecore.cs (PropertyExpr): use the new local temporary
stuff to allow us to handle X.Y += z (where X is a struct)
2004-07-08 Martin Baulig <martin@ximian.com>
* statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
not always return, just like we're doing in Using.Resolve().
2004-07-07 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (fixed_statement): flag this as Pinned.
2004-07-06 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (TypeManager): Removed MakePinned method, this
mechanism is replaced with the .NET 2.x compatible mechanism of
calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
* statement.cs (LocalInfo): Remove MakePinned, add Pinned property
Rename `Fixed' to `Pinned' as a flag, to distinguish from the
`IsFixed' property which has a different meaning.
2004-07-02 Raja R Harinath <rharinath@novell.com>
* ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
visible from inside a nested class, not just the names of the
immediately enclosing class.
Fix for bug #60730.
2004-06-24 Raja R Harinath <rharinath@novell.com>
* expression.cs (BetterConversion): Remove buggy special-case
handling of "implicit constant expression conversions". At this
point, we already know that the conversion is possible -- we're
only checking to see which is better.
2004-06-24 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added error CS0210 test.
2004-06-24 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added error CS0134 test.
2004-06-24 Marek Safar <marek.safar@seznam.cz>
Fix bug #52507
* cs-parser.jay: Added error CS0145 test.
2004-06-24 Marek Safar <marek.safar@seznam.cz>
* class.cs (Operator.Define): Added test for errors CS0553, CS0554.
2004-06-23 Ben Maurer <bmaurer@ximian.com>
* expression.cs (StackAlloc.Resolve): The argument may not
be a constant; deal with this case.
2004-06-23 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (IndexerName_GetIndexerName): Renamed to
GetIndexerAttributeValue.
(ScanForIndexerName): Renamed to GetIndexerNameAttribute.
* class.cs (Indexer.Define): Added error tests for CS0415,
CS0609.
2004-06-23 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attribute.Resolve): Keep field code in sync with
property code.
2004-06-23 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
neither return nor throw, reset the barrier as well. Fixes #60457.
2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
* class.cs : EventAttributes is now set to None by default.
This fixes bug #60459.
2004-06-18 Marek Safar <marek.safar@seznam.cz>
Fix bug #60219
* class.cs (ConstructorInitializer.GetOverloadedConstructor):
Don't throw exception but return null (it's sufficient now).
2004-06-18 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs (GetArgumentTypes): Faster implementation.
2004-06-18 Martin Baulig <martin@ximian.com>
* attribute.cs (Attribute.Resolve): Check whether we're an
EmptyCast which a Constant child. Fixes #60333.
2004-06-17 Ben Maurer <bmaurer@ximian.com>
* statement.cs (EmitCollectionForeach): Account for the fact that
not all valuetypes are in areas which we can take the address of.
For these variables, we store to a temporary variable. Also, make
sure that we dont emit a `callvirt' on a valuetype method.
2004-06-15 Marek Safar <marek.safar@seznam.cz>
* expression.cs (StackAlloc.DoReSolve): Added test for
negative parameter (CS0247).
2004-06-15 Marek Safar <marek.safar@seznam.cz>
Fix bug #59792
* class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
2004-06-15 Marek Safar <marek.safar@seznam.cz>
Fix bug #59781
* expression.cs: (Binary.DoNumericPromotions): Added conversion for
ulong.
2004-06-14 Marek Safar <marek.safar@seznam.cz>
Fix bug #58254 & cs1555.cs, cs1556.cs
* driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
2004-06-14 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Added error CS1669 test for indexers.
2004-06-18 Martin Baulig <martin@ximian.com>
* generics.cs (GenericMethod.ctor): Don't take an Attributes
argument. Fixes #60441.
2004-06-16 Ben Maurer <bmaurer@ximian.com>
* ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
The name needs to have the actual name of the method in order
for other tests (such as the one in OverloadResolve for Invoke
on a delegate) to work. As well, it does not really help
error reporting because the method group had multiple methods.
* Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
Make profiling work.
2004-06-13 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Don't allow generic attributes.
2004-06-13 Martin Baulig <martin@ximian.com>
* class.cs (MemberBase.DoDefineBase): New protected method.
(MemberBase.DoDefine): Compute the `flags' in the new
DoDefineBase() which must be called first.
(Method.Define): Call DoDefineBase() first so we have the flags
when defining the generic method.
* cs-parser.jay (interface_method_declaration): Support generic methods.
2004-06-13 Martin Baulig <martin@ximian.com>
* decl.cs (TypeName): Removed.
(MemberName): Removed TypeName and MemberNow; now we just have
MemberName.
* cs-parser.jay: Don't distinguish between type arguments and type
parameters in the grammar and simplified the rules a bit. The
reduce/reduce conflicts are now gone (except the one we inherited
from mcs).
2004-06-11 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.IsParamsMethodApplicable): We need to
call this twice: for params and varargs methods.
2004-06-11 Marek Safar <marek.safar@seznam.cz>
* class.cs:
(FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
2004-06-11 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute.GetValidTargets): Made public.
* class.cs:
(AbstractPropertyEventMethod): New class for better code sharing.
(AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
CS1667 report.
(PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
2004-06-09 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Removed a reduce/reduce conflict.
2004-06-03 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.GetMemberAccess): Renamed to
GetSimpleName() and return a SimpleName.
* ecore.cs (SimpleName.Arguments): New public field.
(SimpleName): Added overloaded ctor which takes an additional
TypeArguments argument.
(SimpleName.SimpleNameResolve): Added support for generic methods.
(MethodGroupExpr.ResolveGeneric): New public method. The code was
formerly in MemberAccess.DoResolve(), but we also need it in
SimpleNameResolve().
* expression.cs (MemberAccess.DoResolve): Use the new
MethodGroupExpr.ResolveGeneric().
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs: If possible, use lookuptypedirect here. We can only do
this if there is no `.' after the namespace. Avoids using
LookupType, which does lots of slow processing.
(FindNestedType) New method, does what it says :-).
* namespace.cs: use LookupTypeDirect.
* rootcontext.cs: use membercache, if possible.
* typemanager.cs (LookupTypeDirect): Cache negative hits too.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs:
According to the spec,
In a member access of the form E.I, if E is a single identifier,
and if the meaning of E as a simple-name (§7.5.2) is a constant,
field, property, localvariable, or parameter with the same type as
the meaning of E as a type-name (§3.8), then both possible
meanings of E are permitted.
We did not check that E as a simple-name had the same type as E as
a type name.
This trivial check gives us 5-7% on bootstrap time.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs (Invocation.OverloadResolve): Avoid the
use of hashtables and boxing here by allocating on demand.
2004-05-30 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
we're doing a silent lookup. Don't try to lookup nested types in
TypeManager.object_type (thanks to Ben Maurer).
2004-05-30 Martin Baulig <martin@ximian.com>
Committing a patch from Ben Maurer.
* rootcontext.cs (RootContext.LookupType): Cache negative results.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* convert.cs: add a trivial cache for overload operator resolution.
2004-05-31 Marek Safar <marek.safar@seznam.cz>
* attribute.cs
(AttributeTester.GetObsoleteAttribute): Returns instance of
ObsoleteAttribute when type is obsolete.
* class.cs
(TypeContainer.VerifyObsoleteAttribute): Override.
(Method.GetSignatureForError): New method for usage when MethodBuilder is null.
(MethodCode.VerifyObsoleteAttribute): Override.
(MemberBase.VerifyObsoleteAttribute): Override.
* decl.cs
(MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
and report proper error.
*delegate.cs
(Delegate.VerifyObsoleteAttribute): Override.
* ecore.cs
(Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
and report proper error.
(FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
* enum.cs
(Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
and enum member.
* expression.cs
(Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
Added test for ObsoleteAttribute.
* statement.cs
(Catch): Derived from Statement.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs: If possible, use lookuptypedirect here. We can only do
this if there is no `.' after the namespace. Avoids using
LookupType, which does lots of slow processing.
(FindNestedType) New method, does what it says :-).
* namespace.cs: use LookupTypeDirect.
* rootcontext.cs: use membercache, if possible.
* typemanager.cs (LookupTypeDirect): Cache negative hits too.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs:
According to the spec,
In a member access of the form E.I, if E is a single identifier,
and if the meaning of E as a simple-name (§7.5.2) is a constant,
field, property, localvariable, or parameter with the same type as
the meaning of E as a type-name (§3.8), then both possible
meanings of E are permitted.
We did not check that E as a simple-name had the same type as E as
a type name.
This trivial check gives us 5-7% on bootstrap time.
2004-05-30 Marek Safar <marek.safar@seznam.cz>
Fixed bug #59071 & cs0160.cs
* statement.cs (Try.Resolve): Check here whether order of catch
clauses matches their dependencies.
2004-05-30 Marek Safar <marek.safar@seznam.cz>
Fixed bug #58624
* ecore.cs (SimpleName.SimpleNameResolve): Added test for
unsafe type.
2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs (Invocation.OverloadResolve): Avoid the
use of hashtables and boxing here by allocating on demand.
2004-05-30 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.LookupType): Don't cache things if
we're doing a silent lookup. Don't try to lookup nested types in
TypeManager.object_type (thanks to Ben Maurer).
2004-05-30 Martin Baulig <martin@ximian.com>
Committing a patch from Ben Maurer.
* rootcontext.cs (RootContext.LookupType): Cache negative results.
2004-05-29 Martin Baulig <martin@ximian.com>
* class.cs (IMethodData.ShouldIgnore): New method.
* typemanager.cs (TypeManager.MethodFlags): Don't take a
`Location' argument, we don't need it anywhere. Use
`IMethodData.ShouldIgnore ()' instead of
`MethodData.GetMethodFlags ()'.
(TypeManager.AddMethod): Removed.
(TypeManager.AddMethod2): Renamed to AddMethod.
2004-05-29 Martin Baulig <martin@ximian.com>
Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
* convert.cs (Convert.ImplicitReferenceConversion): If we're
converting from a class type S to an interface type and we already
have an object on the stack, don't box it again. Fixes #52578.
2004-05-29 Martin Baulig <martin@ximian.com>
* class.cs (ConstructorInitializer.GetOverloadedConstructor):
Added support for `params' parameters. Fixes #59267.
2004-05-29 Martin Baulig <martin@ximian.com>
* literal.cs (NullPointer): Provide a private .ctor which sets
`type' to TypeManager.object_type. Fixes #59048.
2004-05-29 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.ResolveMemberAccess): If we're an
EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
* ecore.cs (EventExpr.instance_expr): Make the field private.
2004-05-26 Marek Safar <marek.safar@seznam.cz>
Fixed bug #50080 & cs0214-2.cs
* expression.cs (Cast.DoResolve): Check unsafe context here.
* statement.cs (Resolve.DoResolve): Likewise.
2004-05-26 Martin Baulig <martin@ximian.com>
* namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
* rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
(RootContext.LookupType): Pass down the `silent' flag.
2004-05-25 Martin Baulig <martin@ximian.com>
* expression.cs
(MethodGroupExpr.IdenticalTypeName): New public property.
(Invocation.DoResolve): Don't report a CS0176 if the "instance"
expression actually refers to a type.
2004-05-25 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
for #56176 and made it actually work.
2004-05-25 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.CacheTemporaries): Make this virtual.
(FieldExpr, PropertyExpr): Override and implement
CacheTemporaries. Fixes #52279.
2004-05-25 Miguel de Icaza <miguel@ximian.com>
* location.cs: In the new compiler listing a file twice is a
warning, not an error.
2004-05-24 Martin Baulig <martin@ximian.com>
* enum.cs (Enum.DefineType): For the `BaseType' to be a
TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
2004-05-24 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.FindType): Try doing an alias lookup before
walking the `using' list. Fixes #53921.
2004-05-24 Martin Baulig <martin@ximian.com>
* const.cs (Const.LookupConstantValue): Added support for
EmptyCast's; fixes #55251.
2004-05-24 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Renamed to
DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
which does the CS0135 check. The reason is that we first need to
check whether the variable actually exists.
2004-05-24 Martin Baulig <martin@ximian.com>
* class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
than RootContext.LookupType() to find the explicit interface
type. Fixes #58584.
2004-05-24 Raja R Harinath <rharinath@novell.com>
* Makefile: Simplify. Use executable.make.
* mcs.exe.sources: New file. List of sources of mcs.exe.
2004-05-24 Anders Carlsson <andersca@gnome.org>
* decl.cs:
* enum.cs:
Use the invariant culture when doing String.Compare for CLS case
sensitivity.
2004-05-23 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.FindType): Only check the `using' list if we
don't have any dots. Fixes #52622, added cs0246-8.cs.
* namespace.cs (NamespaceEntry.Lookup): Likewise.
2004-05-23 Marek Safar <marek.safar@seznam.cz>
* class.cs (MemberBase.Define): Reuse MemberType member for
resolved type. Other methods can use it too.
2004-05-23 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
the variable also exists in the current block (otherwise, we need
to report a CS0103). Fixes #58670.
2004-05-23 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (Reachability.Reachable): Compute this
on-the-fly rather than storing it as a field.
2004-05-23 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (Reachability.And): Manually compute the
resulting `barrier' from the reachability.
2004-05-23 Marek Safar <marek.safar@seznam.cz>
Fix bug #57835
* attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
instance of ObsoleteAttribute when symbol is obsolete.
* class.cs
(IMethodData): Extended interface for ObsoleteAttribute support.
2004-05-22 Marek Safar <marek.safar@seznam.cz>
* attribute.cs: Fix bug #55970
2004-05-22 Marek Safar <marek.safar@seznam.cz>
Fix bug #52705
* attribute.cs
(GetObsoleteAttribute): New method. Creates the instance of
ObsoleteAttribute.
(AttributeTester.GetMemberObsoleteAttribute): Returns instance of
ObsoleteAttribute when member is obsolete.
(AttributeTester.Report_ObsoleteMessage): Common method for
Obsolete error/warning reporting.
* class.cs
(TypeContainer.base_classs_type): New member for storing parent type.
* decl.cs
(MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
for this MemberCore.
2004-05-21 Marek Safar <marek.safar@seznam.cz>
* attribute.cs, const.cs: Fix bug #58590
2004-05-21 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
out parameters if the end of the method is unreachable. Fixes
#58098.
2004-05-21 Marek Safar <marek.safar@seznam.cz>
* codegen.cs, cs-parser.jay: Removed SetAttributes method.
Hari was right, why extra method.
2004-05-21 Marek Safar <marek.safar@seznam.cz>
* attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
2004-05-20 Martin Baulig <martin@ximian.com>
* delegate.cs: Convert this file to Unix mode - like the original
version in mcs is.
2004-05-20 Martin Baulig <martin@ximian.com>
* attribute.cs: Convert this file to Unix mode - like the original
version in mcs is.
2004-05-19 Marek Safar <marek.safar@seznam.cz>
Fix bug #58688 (MCS does not report error when the same attribute
is assigned twice)
* attribute.cs (Attribute.Emit): Distinction between null and default.
2004-05-19 Raja R Harinath <rharinath@novell.com>
* cs-parser.jay (attribute): Create a GlobalAttribute for the case
of a top-level attribute without an attribute target.
* attribute.cs (Attribute.Error_AttributeConstructorMismatch):
Make non-static.
(Attribute.Conditional_GetConditionName),
(Attribute.Obsolete_GetObsoleteMessage): Update.
(Attribute.IndexerName_GetIndexerName): New. Attribute-specific
part of ScanForIndexerName.
(Attribute.CanIgnoreInvalidAttribute): New function.
(Attribute.ScanForIndexerName): Move to ...
(Attributes.ScanForIndexerName): ... here.
(Attributes.Attrs): Rename from now-misnamed AttributeSections.
(Attributes.Search): New internal variant that can choose not to
complain if types aren't resolved. The original signature now
complains.
(Attributes.GetClsCompliantAttribute): Use internal variant, with
complaints suppressed.
(GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
only if it not useful.
(CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
top-level for attributes that are shared between the assembly
and a top-level class.
* parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
* class.cs: Update to reflect changes.
(DefineIndexers): Fuse loops.
* codegen.cs (GetAssemblyName): Update to reflect changes. Accept
a couple more variants of attribute names.
2004-05-18 Marek Safar <marek.safar@seznam.cz>
Fix bug #52585 (Implemented explicit attribute declaration)
* attribute.cs:
(Attributable.ValidAttributeTargets): New abstract method. It gets
list of valid attribute targets for explicit target declaration.
(Attribute.Target): It holds target itself.
(AttributeSection): Removed.
(Attribute.CheckTargets): New method. It checks whether attribute
target is valid for the current element.
* class.cs:
(EventProperty): New class. For events that are declared like
property (with add and remove accessors).
(EventField): New class. For events that are declared like field.
class.cs
* cs-parser.jay: Implemented explicit attribute target declaration.
* class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
Override ValidAttributeTargets.
* parameter.cs:
(ReturnParameter): Class for applying custom attributes on
the return type.
(ParameterAtribute): New class. Class for applying custom
attributes on the parameter type.
2004-05-17 Miguel de Icaza <miguel@ximian.com>
* class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
definitions.
(Method): Allow UNSAFE here.
* modifiers.cs: Support unsafe reporting.
2004-05-17 Marek Safar <marek.safar@seznam.cz>
* decl.cs: Fix bug #58478.
2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* statement.cs: When checking for unreachable code on an EmptyStatement,
set the location. Fixes bug #58488.
2004-05-13 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add -pkg handling.
From Gonzalo: UseShelLExecute=false
2004-05-12 Marek Safar <marek.safar@seznam.cz>
* attribute.cs:
(Attribute.GetAttributeTargets): New method. Gets AttributeTargets
for attribute.
(Attribute.IsClsCompliaceRequired): Moved to base for better
accesibility.
(Attribute.UsageAttribute): New property for AttributeUsageAttribute
when attribute is AttributeUsageAttribute.
(Attribute.GetValidTargets): Simplified.
(Attribute.GetAttributeUsage): New method returns AttributeUsage
attribute for this type.
(Attribute.ApplyAttributes): Method renamed to Emit and make
non-static.
(GlobalAttributeSection): New class for special handling of global
attributes (assembly, module).
(AttributeSection.Emit): New method.
* class.cs: Implemented Attributable abstract methods.
(MethodCore.LabelParameters): Moved to Parameter class.
(Accessor): Is back simple class.
(PropertyMethod): Implemented Attributable abstract class.
(DelegateMethod): Implemented Attributable abstract class.
(Event): New constructor for disctintion between normal Event
and Event with accessors.
* cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
* codegen.cs, const.cs, decl.cs, delegate.cs:
(CommonAssemblyModulClass): Implemented Attributable abstract class
and simplified.
* enum.cs: Implement IAttributeSupport interface.
(EnumMember): New class for emum members. Implemented Attributable
abstract class
* parameter.cs:
(ParameterBase): Is abstract.
(ReturnParameter): New class for easier [return:] attribute handling.
* typemanager.cs: Removed builder_to_attr.
2004-05-11 Raja R Harinath <rharinath@novell.com>
Fix bug #57151.
* attribute.cs (Attribute.GetPositionalValue): New function.
* class.cs (TypeContainer.VerifyMembers): New function.
(TypeContainer.Emit): Use it.
(ClassOrStruct): New base class for Class and Struct.
(ClassOrStruct.ApplyAttributeBuilder): New function. Note if
StructLayout(LayoutKind.Explicit) was ascribed to the struct or
class.
(ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
then each non-static field should have a FieldOffset attribute.
Otherwise, none of the fields should have a FieldOffset attribute.
* rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
and FieldOffset attributes.
* typemanager.cs (TypeManager.struct_layout_attribute_type)
(TypeManager.field_offset_attribute_type): New core types.
(TypeManager.InitCoreTypes): Initialize them.
2004-05-11 Michal Moskal <malekith@pld-linux.org>
* class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
Return correct type.
From bug #58270.
2004-05-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.DoNumericPromotions): 0 long constant can
be implicitly converted to ulong.
* expression.cs: The logic for allowing operator &, | and ^ worked
was wrong, it worked before because we did not report an error in
an else branch. Fixes 57895.
* class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
allow volatile fields to be reference types.
2004-05-07 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add support for /debug-
2004-05-07 Raja R Harinath <rharinath@novell.com>
* attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
Add a 'complain' parameter to silence errors.
(Attribute.Resolve): Update to changes. Put in sanity check to catch
silently overlooked type-resolutions.
(Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
to reflect changes.
(Attributes.Search): New function.
(Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
(Attributes.GetAttributeFullName): Remove hack.
* class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
Update to reflect changes.
* codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
Use Attributes.Search instead of nested loops.
2004-05-07 Marek Safar <marek.safar@seznam.cz>
* decl.cs:
(MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
(MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
(DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
* report.cs: (Report.Warning): Renamed to Warning_T because of
parameter collision.
2004-05-05 Raja R Harinath <rharinath@novell.com>
* expression.cs (MemberAccess.ResolveMemberAccess):
Exit with non-zero status after Report.Error.
* rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
Likewise.
* typemanager.cs (TypeManager.CoreLookupType): Likewise.
2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
* support.cs: Don't hang when the file is empty.
2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
* support.cs: In SeekableStreamReader, compute the preamble size of the
underlying stream. Position changes should take into account that initial
count of bytes.
2004-05-03 Todd Berman <tberman@sevenl.net>
* driver.cs: remove unused GetSysVersion function.
2004-05-03 Todd Berman <tberman@sevenl.net>
* driver.cs: Remove the hack from saturday, as well as the hack
from jackson (LoadAssemblyFromGac), also adds the CWD to the
link_paths to get that bit proper.
2004-05-01 Todd Berman <tberman@sevenl.net>
* driver.cs: Try a LoadFrom before a Load, this checks the current
path. This is currently a bug in mono that is be fixed, however, this
provides a workaround for now. This will be removed when the bug
is fixed.
2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
* CryptoConvert.cs: Updated to latest version. Fix issue with
incomplete key pairs (#57941).
2004-05-01 Todd Berman <tberman@sevenl.net>
* driver.cs: Remove '.' from path_chars, now System.* loads properly
from the GAC
2004-04-30 Jackson Harper <jackson@ximian.com>
* codegen.cs: Open keys readonly.
2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* typemanager.cs: don't report cyclic struct layout when a struct
contains 2 or more fields of the same type. Failed for Pango.AttrShape
which has 2 Pango.Rectangle fields.
2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Handle IntPtr comparisons with IL code
rather than a method call.
2004-04-29 Martin Baulig <martin@ximian.com>
* ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
the list of PropertyInfo's in class hierarchy and find the
accessor. Fixes #56013.
2004-04-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2004-04-29 Martin Baulig <martin@ximian.com>
Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
* ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2004-04-29 Martin Baulig <martin@ximian.com>
* class.cs (ConstructorInitializer.Resolve): Check whether the
parent .ctor is accessible. Fixes #52146.
2004-04-29 Martin Baulig <martin@ximian.com>
Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
* statement.cs (Using.EmitLocalVariableDecls): Use
TypeManager.idisposable_type, not typeof (IDisposable).
(Foreach.EmitCollectionForeach): Added support for valuetypes.
2004-04-29 Martin Baulig <martin@ximian.com>
* class.cs (Event.Define): Don't emit the field and don't set
RTSpecialName and SpecialName for events on interfaces. Fixes
#57703.
2004-04-29 Raja R Harinath <rharinath@novell.com>
Refactor Attribute.ApplyAttributes.
* attribute.cs (Attributable): New base class for objects that can
have Attributes applied on them.
(Attribute): Make AttributeUsage fields public.
(Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
(Attribute.IsInternalCall): New property.
(Attribute.UsageAttr): Convert to a public read-only property.
(Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
(Attribute.ResolveType, Attribute.Resolve)
(Attribute.ScanForIndexerName): Update to reflect changes.
(Attribute.CheckAttributeTarget): Re-format.
(Attribute.ApplyAttributes): Refactor, to various
Attributable.ApplyAttributeBuilder methods.
* decl.cs (MemberCore): Make Attributable.
* class.cs (Accessor): Make Attributable.
(MethodData.ApplyAttributes): Use proper attribute types, not
attribute names.
(TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
(TypeContainer.ApplyAttributeBuilder)
(Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
(Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
(PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
(Operator.ApplyAttributeBuilder): New factored-out methods.
* const.cs (Const.ApplyAttributeBuilder): Likewise.
* delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
* enum.cs (Enum.ApplyAttributeBuilder): Likewise.
* parameter.cs (ParameterBase): New Attributable base class
that can also represent Return types.
(Parameter): Update to the changes.
2004-04-29 Jackson Harper <jackson@ximian.com>
* driver.cs: Prefer the corlib system version when looking for
assemblies in the GAC. This is still a hack, but its a better hack
now.
2004-04-29 Marek Safar <marek.safar@seznam.cz>
* decl.cs, enum.cs: Improved error 3005 reporting.
* report.cs (SymbolRelatedToPreviousError): New method for error reporting.
(related_symbols): New private member for list of symbols
related to reported error/warning.
* tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2004-04-29 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.Constantify): If we're an enum and
TypeManager.TypeToCoreType() doesn't give us another type, use
t.UnderlyingSystemType. Fixes #56178.
2004-04-29 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.SetupCacheForInterface): Look over all our
interfaces and for each interface, only add members directly
declared in that interface. Fixes #53255.
2004-04-28 Martin Baulig <martin@ximian.com>
* expression.cs (ConditionalLogicalOperator): Use a temporary
variable for `left' to avoid that we evaluate it more than once;
bug #52588.
2004-04-28 Martin Baulig <martin@ximian.com>
* expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
`void[]' (CS1547).
2004-04-28 Martin Baulig <martin@ximian.com>
* statement.cs (LocalInfo.Resolve): Check whether the type is not
void (CS1547).
* class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
whether the type is not void (CS1547).
2004-04-28 Martin Baulig <martin@ximian.com>
* expression.cs (Unary.DoResolveLValue): Override this and report
CS0131 for anything but Operator.Indirection.
2004-04-28 Martin Baulig <martin@ximian.com>
Committing a patch from Ben Maurer; see bug #50820.
* typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
check for classes.
* ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
classes.
2004-04-28 Martin Baulig <martin@ximian.com>
Committing a patch from Ben Maurer; see bug #50820.
* typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
check for classes.
* ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
classes.
2004-04-28 Martin Baulig <martin@ximian.com>
* statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
(Block.AddLabel): Call DoLookupLabel() to only search in the
current block.
2004-04-28 Martin Baulig <martin@ximian.com>
* cfold.cs (ConstantFold.BinaryFold): Added special support for
comparing StringConstants and NullLiterals in Equality and Inequality.
2004-04-28 Jackson Harper <jackson@ximian.com>
* driver.cs: Attempt to load referenced assemblies from the
GAC. This is the quick and dirty version of this method that
doesnt take into account versions and just takes the first
canidate found. Will be good enough for now as we will not have more
then one version installed into the GAC until I update this method.
2004-04-28 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.CheckStructCycles): New public
static method to check for cycles in the struct layout.
* rootcontext.cs (RootContext.PopulateTypes): Call
TypeManager.CheckStructCycles() for each TypeContainer.
[Note: We only need to visit each type once.]
2004-04-28 Martin Baulig <martin@ximian.com>
* constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
* const.cs (Const.LookupConstantValue): Return a `bool' signalling
success and added `out object value'. Use a `bool resolved' field
to check whether we've already been called rather than
`ConstantValue != null' since this breaks for NullLiterals.
2004-04-28 Raja R Harinath <rharinath@novell.com>
* driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
setting of this flag, since the 'set' method may be non-public.
2004-04-28 Raja R Harinath <rharinath@novell.com>
* flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
check on current_vector.Block.
2004-04-27 Martin Baulig <martin@ximian.com>
* expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
a field initializer. Fixes #56459.
2004-04-27 Martin Baulig <martin@ximian.com>
* ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
we're not attempting to use an indexer. Fixes #52154.
2004-04-27 Martin Baulig <martin@ximian.com>
* statement.cs (Return): Don't create a return label if we don't
need it; reverts my change from January 20th. Thanks to Ben
Maurer for this.
2004-04-27 Martin Baulig <martin@ximian.com>
According to the spec, `goto' can only leave a nested scope, but
never enter it.
* statement.cs (Block.LookupLabel): Only lookup in the current
block, don't recurse into parent or child blocks.
(Block.AddLabel): Check in parent and child blocks, report
CS0140/CS0158 if we find a duplicate.
(Block): Removed this indexer for label lookups.
(Goto.Resolve): Call LookupLabel() on our current FlowBranching;
this already does the error reporting for us.
* flowanalysis.cs
(FlowBranching.UsageVector.Block): New public variable; may be null.
(FlowBranching.CreateSibling): Added `Block' argument.
(FlowBranching.LookupLabel): New public virtual method. Lookup a
label for the target of a `goto' and check whether we're not
leaving a `finally'.
2004-04-27 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
just for returns).
2004-04-27 Martin Baulig <martin@ximian.com>
* statement.cs (Block.AddLabel): Also check for implicit blocks
and added a CS0158 check.
2004-04-27 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranchingLoop): New class.
(FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
UsageVector's instead of an ArrayList.
(FlowBranching.Label): Likewise.
(FlowBranching.UsageVector.MergeBreakOrigins): New method.
(FlowBranching.AddBreakVector): New method.
2004-04-27 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Small regression fix: only convert the type if we
the type is different, fixes System.Drawing build.
2004-04-27 Martin Baulig <martin@ximian.com>
* attribute.cs (Attribute.Resolve): If we have a constant value
for a named field or property, implicity convert it to the correct
type.
2004-04-27 Raja R Harinath <rharinath@novell.com>
* statement.cs (Block.Block): Implicit blocks share
'child_variable_names' fields with parent blocks.
(Block.AddChildVariableNames): Remove.
(Block.AddVariable): Mark variable as "used by a child block" in
every surrounding block.
* ecore.cs (SimpleName.SimpleNameResolve): If the name has already
been used in a child block, complain about violation of "Invariant
meaning in blocks" rule.
* cs-parser.jay (declare_local_variables): Don't use
AddChildVariableNames.
(foreach_statement): Don't create an implicit block: 'foreach'
introduces a scope.
2004-04-23 Miguel de Icaza <miguel@ximian.com>
* convert.cs (ImplicitNumericConversion): 0 is also positive when
converting from 0L to ulong. Fixes 57522.
2004-04-22 Marek Safar <marek.safar@seznam.cz>
* decl.cs (FindMemberToOverride): Fix wrong warning for case when
derived class hides via 'new' keyword field from base class (test-242.cs).
TODO: Handle this in the more general way.
* class.cs (CheckBase): Ditto.
2004-04-22 Marek Safar <marek.safar@seznam.cz>
* decl.cs (caching_flags): New member for storing cached values
as bit flags.
(MemberCore.Flags): New enum where bit flags for caching_flags
are defined.
(MemberCore.cls_compliance): Moved to caching_flags.
(DeclSpace.Created): Moved to caching_flags.
* class.cs: Use caching_flags instead of DeclSpace.Created
2004-04-21 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
if we are only a derived class, not a nested class.
* typemanager.cs: Same as above, but do this at the MemberLookup
level (used by field and methods, properties are handled in
PropertyExpr). Allow for the qualified access if we are a nested
method.
2004-04-21 Marek Safar <marek.safar@seznam.cz>
* class.cs: Refactoring.
(IMethodData): New inteface; Holds links to parent members
to avoid member duplication (reduced memory allocation).
(Method): Implemented IMethodData interface.
(PropertyBase): New inner classes for get/set methods.
(PropertyBase.PropertyMethod): Implemented IMethodData interface
(Event): New inner classes for add/remove methods.
(Event.DelegateMethod): Implemented IMethodData interface.
* cs-parser.jay: Pass DeclSpace to Event class for creation of valid
EmitContext (related to class.cs refactoring).
2004-04-21 Raja R Harinath <rharinath@novell.com>
* delegate.cs (Delegate.VerifyApplicability): If the number of
arguments are the same as the number of parameters, first try to
verify applicability ignoring any 'params' modifier on the last
parameter.
Fixes #56442.
2004-04-08 Martin Baulig <martin@ximian.com>
Merged latest changes into gmcs. Please keep this comment in
here, it makes it easier for me to see what changed in MCS since
the last time I merged.
2004-04-16 Raja R Harinath <rharinath@novell.com>
* class.cs (TypeContainer.AddIndexer): Use
'ExplicitInterfaceName' to determine if interface name was
explicitly specified. 'InterfaceType' is not initialized at this time.
(TypeContainer.DefineIndexers): Remove use of temporary list. The
Indexers array is already in the required order. Initialize
'IndexerName' only if there are normal indexers.
(TypeContainer.DoDefineMembers): Don't initialize IndexerName.
(TypeContainer.Emit): Emit DefaultMember attribute only if
IndexerName is initialized.
Fixes #56300.
2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
* enum.cs (Enum.DefineType): Don't allow char as type for enum.
Fixes #57007
2004-04-15 Raja R Harinath <rharinath@novell.com>
* attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
attributes.
Fix for #56456.
* attribute.cs (Attribute.Resolve): Check for duplicate named
attributes.
Fix for #56463.
2004-04-15 Miguel de Icaza <miguel@ximian.com>
* iterators.cs (MarkYield): track whether we are in an exception,
and generate code accordingly. Use a temporary value to store the
result for our state.
I had ignored a bit the interaction of try/catch with iterators
since their behavior was not entirely obvious, but now it is
possible to verify that our behavior is the same as MS .NET 2.0
Fixes 54814
2004-04-14 Miguel de Icaza <miguel@ximian.com>
* iterators.cs: Avoid creating temporaries if there is no work to
do.
* expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
Enumerations, use TypeManager.EnumToUnderlying and call
recursively.
Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
bug #57013
(This.Emit): Use EmitContext.EmitThis to emit our
instance variable.
(This.EmitAssign): Ditto.
* ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
codepaths, we will move all the functionality into
Mono.CSharp.This
(FieldExpr.EmitAssign): Ditto.
This fixes several hidden bugs that I uncovered while doing a code
review of this today.
* codegen.cs (EmitThis): reworked so the semantics are more clear
and also support value types "this" instances.
* iterators.cs: Changed so that for iterators in value types, we
do not pass the value type as a parameter.
Initialization of the enumerator helpers is now done in the caller
instead of passing the parameters to the constructors and having
the constructor set the fields.
The fields have now `assembly' visibility instead of private.
2004-04-11 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Argument.Resolve): Check if fields passed as ref
or out are contained in a MarshalByRefObject.
* typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
another compiler type.
2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs (Indexer.Define): use the new name checking method.
Also, return false on an error.
* cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
(is_identifier_[start/part]_character): make static.
2004-04-10 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.ResolveOperator): Do no append strings
twice: since we can be invoked more than once (array evaluation)
on the same concatenation, take care of this here. Based on a fix
from Ben (bug #56454)
2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
* codegen.cs: Fix another case where CS1548 must be reported (when
delay-sign isn't specified and no private is available #56564). Fix
loading the ECMA "key" to delay-sign an assembly. Report a CS1548
error when MCS is used on the MS runtime and we need to delay-sign
(which seems unsupported by AssemblyBuilder - see #56621).
2004-04-08 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
(TypeManager.ComputeNamespaces): Faster implementation for
Microsoft runtime.
* compiler.csproj: Updated AssemblyName to mcs.
2004-05-11 Jackson Harper <jackson@ximian.com>
* Makefile: Preserve MONO_PATH
2004-05-11 Jackson Harper <jackson@ximian.com>
* Makefile: Use mono and mcs to build gmcs
2004-05-03 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Add patch from Robert Shade
<rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
sync with mcs.
2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
* CryptoConvert.cs: Updated to latest version. Fix issue with
incomplete key pairs (#57941).
2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
* codegen.cs: Fix another case where CS1548 must be reported (when
delay-sign isn't specified and no private is available #56564). Fix
loading the ECMA "key" to delay-sign an assembly. Report a CS1548
error when MCS is used on the MS runtime and we need to delay-sign
(which seems unsupported by AssemblyBuilder - see #56621).
2004-04-29 Jackson Harper <jackson@ximian.com>
* Makefile: Set MONO_PATH to use the bootstrap corlib
* driver.cs: Check the GAC for referenced assemblies.
2004-04-29 Martin Baulig <martin@ximian.com>
* Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
2004-04-07 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.ResolveOperator): Added special case for
Equality/Inequality between a type parameter and a null literal.
2004-04-07 Martin Baulig <martin@ximian.com>
* convert.cs: Check null literal -> type parameter conversions.
2004-04-07 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Enforce the
`class' and `struct' constraints.
2004-04-07 Martin Baulig <martin@ximian.com>
* generic.cs (SpecialConstraint): New public enum.
(Constraints.Resolve): Added support for the `class' and `struct'
constraints.
* cs-parser.jay (type_parameter_constraint): Added support for the
`class' and `struct' constraints.
2004-04-07 Martin Baulig <martin@ximian.com>
* support.cs (GenericConstraints): Replaced `Types' by
`ClassConstraint' and `InterfaceConstraints'; added
`HasClassConstraint'.
2004-04-07 Martin Baulig <martin@ximian.com>
* generic.cs
(Constraints.InterfaceConstraints): New public property.
(Constraints.Types): Make this property public
(TypeParameter): Implement IMemberContainer.
(TypeParameter.Define): Take a `GenericTypeParameterBuilder'
instead of a TypeBuilder/MethodBuilder; pass the interface
constraints to TypeManager.AddTypeParameter().
(TypeParameter.DefineType): Just take an EmitContext and no
TypeBuilder/MethodBuilder. Use the new public API.
* typemanager.cs (TypeManager.AddTypeParameter): Added
`TypeExpr[]' argument; add the interfaces to the
`builder_to_ifaces' hash.
(TypeManager.LookupMemberContainer): For
GenericTypeParameterBuilders, get the TypeParameter from the
`builder_to_type_param'.
(TypeManager.FindMembers): For GenericTypeParameterBuilders, get
the TypeParameter and call FindMembers on it.
2004-04-07 Martin Baulig <martin@ximian.com>
* class.cs
(MethodCore.GenericMethod): Moved this field here from Method.
(MethodCore.IsDuplicateImplementation): Take the number of type
parameters into account if we're a generic method.
* expression.cs (Invocation.InferTypeArguments): Don't return true
if `arguments' is null; we still need to check whether we actually
don't need to infer anything in this case.
(MemberAccess): Merged the functionality from GenericMemberAccess
into this class.
* generic.cs (GenericMemberAccess): Removed.
2004-04-05 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCore): For generic classes, interfaces and
structs, `Name' now includes the number of type parameters
("Stack!1.Node!1").
(DeclSpace.FindType): Removed the `num_type_args' argument; we now
encode the number of type arguments in the type name.
* expression.cs (Expression.MemberLookup): Removed the
`num_type_args' argument; we now encode the number of type
arguments in the type name.
* ecore.cs (SimpleName): Encode the number of type arguments in
the type name itself.
* generic.cs (ConstructedType): Likewise.
* tree.cs (Tree.RecordDecl): Take a `string' instead of a
`MemberName'; we now include the number of type parameters in the
type name.
* typemanager.cs (TypeManager.CheckGeneric): Removed.
(TypeManager.MemberLookup): Removed the
`num_type_args' argument; we now encode the number of type
arguments in the type name.
2004-04-03 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
(MemberCore.MemberName): Moved here from MemberBase.
(DeclSpace.SetParameterInfo): Just take the constraints as an
ArrayList; we already have the type parameters in our
`MemberName'; also do the CS0080 reporting here.
* cs-parser.jay (struct_declaration): Use `member_name' instead of
`IDENTIFIER opt_type_parameter_list'; when constructing our
`MemberName', it'll already include our type parameters.
(class_declaration, interface_declaration): Likewise.
(delegate_declaration): Likewise.
(MakeName): Take a MemberName and return a MemberName.
The following two changes are required to avoid shift/reduce conflicts:
(member_name): Don't include a TypeName anymore; ie. this is now
just 'IDENTIFIER opt_type_parameter_list'.
(property_declaration, event_declaration): Use a
`namespace_or_type_name' instead of a `member_name'.
2004-04-03 Martin Baulig <martin@ximian.com>
* decl.cs (MemberName): Renamed to `TypeName' and created a new
`MemberName' class.
(TypeName): Formerly known as MemberName.
* namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
instead of a `MemberName'.
* cs-parser.jay (namespace_or_type_name): Create a TypeName.
(member_name): New rule; create a MemberName.
2004-04-02 Martin Baulig <martin@ximian.com>
* namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
(CS0305 and CS0308).
2004-04-02 Martin Baulig <martin@ximian.com>
* generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
support for nested types.
2004-04-02 Martin Baulig <martin@ximian.com>
* ecore.cs (IAlias): New public interface.
(TypeExpr, TypeExpression): Implement IAlias.
(TypeAliasExpression): New public class.
* namespace.cs (Namespace): Implement IAlias.
(Namespace.Lookup): Return an IAlias instead on an object.
(Namespace.DefineName): Take an IAlias instead of an object.
(NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
an object.
(NamespaceEntry.UsingAlias): Take a Membername instead of an
Expression.
(NamespaceEntry.LookupAlias): Return an IAlias instead on an
object.
(NamespaceEntry.Lookup): Likewise.
* rootcontext.cs (RootContext.LookupType): Return a TypeExpr
instead of a Type.
* decl.cs (DeclSpace): Implement IAlias.
(DeclSpace.LookupAlias): Return an IAlias instead of a string.
* generic.cs (ConstructedType): Improved error checking.
2004-04-02 Martin Baulig <martin@ximian.com>
* convert.cs: Added type parameter conversions.
* ecore.cs
(UnboxCast.Emit): Emit an `unbox.any' for type params.
(ClassCast.Emit): If the source type is a type parameter, box it.
If the target type is a type parameter, emit an `unbox.any'
instead of a `classcast'.1
2004-04-01 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
2004-04-01 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Use
Convert.ImplicitStandardConversionExists(); user-defined implicit
conversions are not allowed according to the spec.
2004-03-30 Martin Baulig <martin@ximian.com>
* expression.cs (New): Added support for type parameters.
* typemanager.cs
(TypeManager.activator_type): New public static field.
(TypeManager.activator_create_instance): Likewise.
2004-03-30 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.HasConstructorConstraint): New
public method.
2004-03-30 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.CheckConstraints): Actually follow
the spec here: the argument type must be convertible to the
constraints.
2004-03-30 Martin Baulig <martin@ximian.com>
* generic.cs
(TypeParameter.Define, TypeParameter.DefineMethod): Call
TypeManager.AddTypeParameter().
(ConstructedType.CheckConstraints): Re-enable this and actually
check whether we have a constructor constraint.
* typemanager.cs
(TypeManager.builder_to_type_param): New static field.
(TypeManager.AddTypeParameter): New static method.
(TypeManager.LookupTypeParameter): New public method.
2004-03-30 Martin Baulig <martin@ximian.com>
* generic.cs (TypeParameter.DefineType): Return a boolean and use
the new API to actually define the constructor constraint.
* typemanager.cs
(TypeManager.new_constraint_attr_type): New static field.
(TypeManager.InitCoreTypes): Initialize it.
2004-03-30 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints): Completed error checking, use correct
error numbers.
2004-03-29 Martin Baulig <martin@ximian.com>
* delegate.cs (Delegate.VerifyMethod): Infer type arguments.
* expression.cs (Invocation.InferTypeArguments): Added overloaded
public version which takes a `ParameterData pd' instead of an
`ArrayList args'.
2004-03-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
not a MethodInfo.
2004-03-29 Martin Baulig <martin@ximian.com>
* expression.cs (Argument.ResolveMethodGroup): If we're a
ConstructedType, call GetMemberAccess() on it.
2004-03-29 Martin Baulig <martin@ximian.com>
* class.cs (MethodBase.CheckGenericOverride): New abstract method.
(MethodCore.CheckGenericOverride): When overriding a generic
method, check whether the constraints match.
* support.cs (GenericConstraints): New public interface.
(ParameterData.GenericConstraints): New public method.
* parameter.cs (Parameter.Resolve): Check whether we're a generic
method parameter and compute our constraints if appropriate.
(Parameter.GenericConstraints): New public property.
* generic.cs (Constraints): Implement GenericConstraints.
2004-03-29 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.FindMemberToOverride): Use
`paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
2004-03-29 Martin Baulig <martin@ximian.com>
* generic.cs (GenericMethod.Define): Resolve our type parameters.
2004-03-29 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
not allowed on non-generic declarations").
2004-03-29 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferTypeArguments): Added overloaded
public version of this method.
* class.cs (MethodCore.IsDuplicateImplementation): Use
Invocation.InferTypeArguments() to check this.
2004-03-29 Martin Baulig <martin@ximian.com>
* convert.cs: Use TypeManager.IsDelegateType() instead of
comparing types correctly.
2004-03-29 Martin Baulig <martin@ximian.com>
* convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
types directly to make it work for generic instances.
* typemanager.cs (TypeManager.IsSubclassOf): New static method.
2004-03-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
support for arrays.
2004-03-24 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.FindType): Also use
TypeManager.CheckGeneric() for types from the using clauses.
2004-03-23 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.OverloadResolve): Added `bool
may_fail' argument and use it instead of the Location.IsNull() hack.
2004-03-23 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferType): Use correct type inference
rules here.
2004-03-23 Martin Baulig <martin@ximian.com>
* ecore.cs (MethodGroupExpr.Name): Use
TypeManager.CSharpSignature() instead of just the name.
* expression.cs (Invocation.OverloadResolve): Provide better error
reporting.
(Invocation.DoResolve): OverloadResolve() never returns null
without reporting an error, so removed the error -6 reporting here.
2004-03-23 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
generic methods.
* cs-parser.jay (delegate_declaration): Support generic delegates.
* delegate.cs: Support generic delegates.
2004-03-22 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.InferParamsTypeArguments): New static
method; does type inference for params arguments.
2004-03-21 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsGenericMethod): New public static
method; checks whether a method is a generic method.
* expression.cs (Invocation.InferTypeArguments): New static method;
infer type arguments for generic method invocation.
* ecore.cs (MethodGroupExpr.HasTypeArguments): New public
property; we set this to true if we're resolving a generic method
invocation and the user specified type arguments, ie. we're not
doing type inference.
2004-03-20 Martin Baulig <martin@ximian.com>
* class.cs (MethodData.DeclaringType): New public property.
(MethodData.Define): Set DeclaringType here.
(Operator.Define): Use OperatorMethod.MethodData.DeclaringType
instead of OperatorMethodBuilder.DeclaringType.
2004-03-20 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (xtoken): Return a special
Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
* cs-parser.jay (default_value_expression): Switch to the new
syntax (14.5.13).
2004-03-19 Martin Baulig <martin@ximian.com>
* decl.cs (MemberName): New class. We use this to "construct"
namespace_or_type_name's.
* generics.cs (TypeArguments.GetDeclarations): New public method;
returns the type arguments as a string[] and reports a CS0081 if
one of them is not an identifier.
* class.cs (MemberBase): The .ctor now takes the name as a
MemberName instead of a string.
(MemberBase.ExplicitInterfaceName): Changed type from string to
Expression.
(MemberBase.DoDefine): If we're an explicit implementation, the
InterfaceType may be a generic instance.
* cs-parser.jay (namespace_or_type_name): Return a MemberName.
(namespace_name): Call MemberName.GetName () to transform the
MemberName into a string and ensure we don't have any type
arguments.
(type_name): Call MemberName.GetTypeExpression() to transfrom the
MemberName into an expression.
(method_header): Use namespace_or_type_name instead of member_name.
2004-04-07 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Add new types to the boot resolution.
* ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
MulticastDelegate is not allowed.
* typemanager.cs: Add new types to lookup: System.TypedReference
and ArgIterator.
* paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
check for TypedReference or ArgIterator, they are not allowed.
* ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
makes us properly catch 1510 in some conditions (see bug 56016 for
details).
2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
* CryptoConvert.cs: update from corlib version
with endian fixes.
2004-04-05 Miguel de Icaza <miguel@ximian.com>
* class.cs (Indexer.Define): Check indexername declaration
2004-04-05 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (IsClsCompliant): Fixed problem with handling
all three states (compliant, not-compliant, undetected).
2004-03-30 Marek Safar <marek.safar@seznam.cz>
* attribute.cs (Attribute): Location is now public.
(Resolve): Store resolved arguments (pos_values) in attribute class.
Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
(GetClsCompliantAttributeValue): New method that gets
CLSCompliantAttribute value.
(GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
if exists else null.
(AttributeTester): New class for CLS-Compliant verification routines.
* class.cs (Emit): Add CLS-Compliant verification.
(Method.GetSignatureForError): Implemented.
(Constructor.GetSignatureForError): Implemented
(Constructor.HasCompliantArgs): Returns if constructor has
CLS-Compliant arguments.
(Constructor.Emit): Override.
(Construcor.IsIdentifierClsCompliant): New method; For constructors
is needed to test only parameters.
(FieldBase.GetSignatureForError): Implemented.
(TypeContainer): New member for storing base interfaces.
(TypeContainer.FindMembers): Search in base interfaces too.
* codegen.cs (GetClsComplianceAttribute): New method that gets
assembly or module CLSCompliantAttribute value.
(ResolveClsCompliance): New method that resolve CLSCompliantAttribute
for assembly.
(ModuleClass.Emit): Add error 3012 test.
* const.cs (Emit): Override and call base for CLS-Compliant tests.
* decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
state for all decl types.
(MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
if CLS-Compliant tests are required.
(IsClsCompliaceRequired): New method. Analyze whether code
must be CLS-Compliant.
(IsExposedFromAssembly): New method. Returns true when MemberCore
is exposed from assembly.
(GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
value or gets cached value.
(HasClsCompliantAttribute): New method. Returns true if MemberCore
is explicitly marked with CLSCompliantAttribute.
(IsIdentifierClsCompliant): New abstract method. This method is
used to testing error 3005.
(IsIdentifierAndParamClsCompliant): New method. Common helper method
for identifier and parameters CLS-Compliant testing.
(VerifyClsCompliance): New method. The main virtual method for
CLS-Compliant verifications.
(CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
null. I don't know why is null (too many public members !).
(GetClsCompliantAttributeValue). New method. Goes through class hierarchy
and get value of first CLSCompliantAttribute that found.
* delegate.cs (Emit): Override and call base for CLS-Compliant tests.
(VerifyClsCompliance): Override and add extra tests.
* driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
clscheck- disable CLS-Compliant verification event if assembly is has
CLSCompliantAttribute(true).
* enum.cs (Emit): Override and call base for CLS-Compliant tests.
ApllyAttribute is now called in emit section as in the other cases.
Possible future Emit integration.
(IsIdentifierClsCompliant): New override.
(VerifyClsCompliance): New override.
(GetEnumeratorName): Returns full enum name.
* parameter.cs (GetSignatureForError): Implemented.
* report.cs (WarningData): New struct for Warning message information.
(LocationOfPreviousError): New method.
(Warning): New method. Reports warning based on the warning table.
(Error_T): New method. Reports error based on the error table.
* rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
verifications are done here.
* tree.cs (RecordDecl): Used new LocationOfPreviousError method.
* typemanager.cs (cls_compliant_attribute_type): New member thath holds
CLSCompliantAttribute.
(all_imported_types): New member holds all imported types from other
assemblies.
(LoadAllImportedTypes): New method fills static table with exported types
from all referenced assemblies.
(Modules): New property returns all assembly modules.
2004-03-30 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add a rule to catch wrong event syntax instead of
throwing a parser error.
* ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
which removes the hardcoded get_/set_ prefixes for properties, as
IL allows for the properties to be named something else.
Bug #56013
* expression.cs: Do not override operand before we know if it is
non-null. Fix 56207
2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
* typemanager.cs: support for pinned variables.
2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs, typemanager.cs: Avoid using an arraylist
as a buffer if there is only one result set.
2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Make sure you cant call a static method
with an instance expression, bug #56174.
2004-03-29 Miguel de Icaza <miguel@ximian.com>
* class.cs (IsDuplicateImplementation): Improve error reporting to
flag 663 (method only differs in parameter modifier).
* cs-tokenizer.cs: Do not require whitespace when a ( or " will do
in preprocessor directives.
* location.cs (LookupFile): Allow for the empty path.
* attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
better approach for some of that patch, but its failing with the
CharSet enumeration. For now try/catch will do.
* typemanager.cs: Do not crash if a struct does not have fields.
Fixes 56150.
2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: cs0213, cant fix a fixed expression.
fixes 50231.
2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
* cs-parser.jay: detect invalid embeded statements gracefully.
bug #51113.
2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
* ecore.cs, typemanager.cs: Correct impl of cs1540 check.
As a regex:
s/
the invocation type may not be a subclass of the tye of the item/
The type of the item must be a subclass of the invocation item.
/g
Fixes bug #50820.
2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
* attribute.cs: Added methods to get a string and a bool from an
attribute. Required to information from AssemblyKeyFileAttribute,
AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
* codegen.cs: Modified AssemblyName creation to include support for
strongnames. Catch additional exceptions to report them as CS1548.
* compiler.csproj: Updated include CryptoConvert.cs.
* compiler.csproj.user: Removed file - user specific configuration.
* CryptoConvert.cs: New. A COPY of the class CryptoConvert from
Mono.Security assembly. The original class is maintained and tested in
/mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
* drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
like CSC 8.0 (C# v2) supports.
* Makefile: Added CryptoConvert.cs to mcs sources.
* rootcontext.cs: Added new options for strongnames.
2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
* driver.cs: For --expect-error, report error code `2'
if the program compiled with no errors, error code `1' if
it compiled with an error other than the one expected.
2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
* compiler.csproj: Updated for Visual Studio .NET 2003.
* compiler.csproj.user: Updated for Visual Studio .NET 2003.
* compiler.sln: Updated for Visual Studio .NET 2003.
2004-03-24 Ravi Pratap M <ravi@ximian.com>
* expression.cs: Fix bug #47234. We basically need to apply the
rule that we prefer the conversion of null to a reference type
when faced with a conversion to 'object' (csc behaviour).
2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
* statement.cs: Shorter form for foreach, eliminates
a local variable. r=Martin.
2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
* constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
checks if we can use brtrue/brfalse to test for 0.
* expression.cs: use the above in the test for using brtrue/brfalse.
cleanup code a bit.
2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Rewrite string concat stuff. Benefits:
- "a" + foo + "b" + "c" becomes "a" + foo + "bc"
- "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
rather than a concat chain.
* typemanager.cs: Add lookups for more concat overloads.
2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Emit shorter il code for array init.
newarr
dup
// set 1
// set 2
newarr
stloc.x
ldloc.x
// set 1
ldloc.x
// set 2
2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
* statement.cs: Before, two switch blocks would be merged if the
total size of the blocks (end_item - begin_item + 1) was less than
two times the combined sizes of the blocks.
Now, it will only merge if after the merge at least half of the
slots are filled.
fixes 55885.
2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
* class.cs : csc build fix for GetMethods(). See bug #52503.
2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Make sure fp comparisons work with NaN.
This fixes bug #54303. Mig approved this patch a long
time ago, but we were not able to test b/c the runtime
had a related bug.
2004-03-19 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (TypExpr.GetHashCode): implement this overload.
2004-03-19 Martin Baulig <martin@ximian.com>
* class.cs (MemberCore.IsDuplicateImplementation): Check whether
two overloads may unify for some type parameter substitutions and
report a CS0408 if appropriate.
2004-03-19 Martin Baulig <martin@ximian.com>
* class.cs (MemberCore.IsDuplicateImplementation): Report the
error here and not in our caller.
2004-03-19 Martin Baulig <martin@ximian.com>
* interface.cs: Completely killed this file.
(Interface): We're now a TypeContainer and live in class.cs.
* class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
argument; we're now also called for interfaces.
(TypeContainer.DefineMembers): Allow this method being called
multiple times.
(TypeContainer.GetMethods): New public method; formerly known as
Interface.GetMethod(). This is used by PendingImplementation.
(TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
it's now private and non-static.
(Interface): Moved this here; it's now implemented similar to
Class and Struct.
(Method, Property, Event, Indexer): Added `bool is_interface'
argument to their .ctor's.
(MemberBase.IsInterface): New public field.
* cs-parser.jay: Create normal Method, Property, Event, Indexer
instances instead of InterfaceMethod, InterfaceProperty, etc.
(opt_interface_base): Removed; we now use `opt_class_base' instead.
(InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
2004-03-19 Martin Baulig <martin@ximian.com>
* class.cs (MethodCore.IsDuplicateImplementation): New private
method which does the CS0111 checking.
(Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
Use IsDuplicateImplementation().
2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs (FindMemberToOverride): New method to find the correct
method or property to override in the base class.
* class.cs
- Make Method/Property use the above method to find the
version in the base class.
- Remove the InheritableMemberSignatureCompare as it is now
dead code.
This patch makes large code bases much faster to compile, as it is
O(n) rather than O(n^2) to do this validation.
Also, it fixes bug 52458 which is that nested classes are not
taken into account when finding the base class member.
Reviewed/Approved by Martin.
2004-03-17 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.DoResolve): Take the parent's number
of type arguments into account; use the `real_num_type_args'
approach like in DoResolveAsTypeStep().
* generic.cs (GenericMemberAccess.DoResolve): Make this work for
nested types.
2004-03-17 Marek Safar <marek.safar@seznam.cz>
* interface.cs: In all interface classes removed redundant
member initialization.
2004-03-16 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
2004-03-15 Miguel de Icaza <miguel@ximian.com>
* decl.cs (DefineTypeAndParents): New helper method to define a
type's containers before the type itself is defined; This is a
bug exposed by the recent changes to Windows.Forms when an
implemented interface was defined inside a class that had not been
built yet.
* modifiers.cs (MethodAttr): All methods in C# are HideBySig.
(Check): Loop correctly to report errors modifiers
(UNSAFE was not in the loop, since it was the same as TOP).
* interface.cs: Every interface member now takes a ModFlags,
instead of a "is_new" bool, which we set on the base MemberCore.
Every place where we called "UnsafeOk" in the interface, now we
call the proper member (InterfaceMethod.UnsafeOK) instead to get
the unsafe settings from the member declaration instead of the
container interface.
* cs-parser.jay (opt_new): Allow unsafe here per the spec.
* pending.cs (TypeAndMethods): Add `get_indexer_name' and
`set_indexer_name' to the pending bits (one per type).
We fixed a bug today that was picking the wrong method to
override, since for properties the existing InterfaceMethod code
basically ignored the method name. Now we make sure that the
method name is one of the valid indexer names.
2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
* support.cs (SeekableStreamReader): Keep track of stream byte
positions and don't mix them with character offsets to the buffer.
Patch from Gustavo Giráldez
2004-03-15 Marek Safar <marek.safar@seznam.cz>
* interface.cs (InterfaceSetGetBase): Removed double member
initialization, base class does it as well.
2004-03-13 Martin Baulig <martin@ximian.com>
* class.cs: Reverted Miguel's latest commit; it makes mcs crash
when compiling corlib.
2004-03-13 Miguel de Icaza <miguel@ximian.com>
* convert.cs (ExplicitConversion): We were reporting an error on
certain conversions (object_type source to a value type, when the
expression was `null') before we had a chance to pass it through
the user defined conversions.
* driver.cs: Replace / and \ in resource specifications to dots.
Fixes 50752
* class.cs: Add check for duplicate operators. Fixes 52477
2004-03-11 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
that are in the middle of the statements, not only at the end.
Fixes #54987
* class.cs (TypeContainer.AddField): No longer set the
`HaveStaticConstructor' flag, now we call it
`UserDefineStaticConstructor' to diferentiate the slightly
semantic difference.
The situation is that we were not adding BeforeFieldInit (from
Modifiers.TypeAttr) to classes that could have it.
BeforeFieldInit should be set to classes that have no static
constructor.
See:
http://www.yoda.arachsys.com/csharp/beforefieldinit.html
And most importantly Zoltan's comment:
http://bugzilla.ximian.com/show_bug.cgi?id=44229
"I think beforefieldinit means 'it's ok to initialize the type sometime
before its static fields are used', i.e. initialization does not need
to be triggered by the first access to the type. Setting this flag
helps the JIT to compile better code, since it can run the static
constructor at JIT time, and does not need to generate code to call it
(possibly lots of times) at runtime. Unfortunately, mcs does not set
this flag for lots of classes like String.
csc sets this flag if the type does not have an explicit static
constructor. The reasoning seems to be that if there are only static
initalizers for a type, and no static constructor, then the programmer
does not care when this initialization happens, so beforefieldinit
can be used.
This bug prevents the AOT compiler from being usable, since it
generates so many calls to mono_runtime_class_init that the AOT code
is much slower than the JITted code. The JITted code is faster,
because it does not generate these calls if the vtable is type is
already initialized, which is true in the majority of cases. But the
AOT compiler can't do this."
2004-03-10 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodData.Emit): Refactor the code so symbolic
information is generated for destructors; For some reasons we
were taking a code path that did not generate symbolic information
before.
2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs: Create a Constructor.CheckBase method that
takes care of all validation type code. The method
contains some code that was moved from Define.
It also includes new code that checks for duplicate ctors.
This fixes bug #55148.
2004-03-09 Joshua Tauberer <tauberer@for.net>
* expression.cs (ArrayCreation): Fix: More than 6 nulls in
a { ... }-style array creation invokes EmitStaticInitializers
which is not good for reference-type arrays. String, decimal
and now null constants (NullCast) are not counted toward
static initializers.
2004-03-05 Martin Baulig <martin@ximian.com>
* location.cs (SourceFile.HasLineDirective): New public field;
specifies whether the file contains or is referenced by a "#line"
directive.
(Location.DefineSymbolDocuments): Ignore source files which
either contain or are referenced by a "#line" directive.
2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs (Method.CheckBase): Avoid using FindMembers, we have
direct access to our parent, so check the method inline there.
2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs (Invocation.EmitCall): Miguel's last commit
caused a regression. If you had:
T t = null;
t.Foo ();
In Foo the implict this would be null.
2004-02-27 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation.EmitCall): If the method is not
virtual, do not emit a CallVirt to it, use Call.
* typemanager.cs (GetFullNameSignature): Improve the method to
cope with ".ctor" and replace it with the type name.
* class.cs (ConstructorInitializer.Resolve): Now the method takes
as an argument the ConstructorBuilder where it is being defined,
to catch the recursive constructor invocations.
2004-03-16 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
ConstructedType, call ResolveType() on it to get the type rather
than just using `expr.Type'.
2004-03-16 Martin Baulig <martin@ximian.com>
* generics.cs (ConstructedType.GetMemberAccess): Take the
EmitContext instead on the TypeExpr and use
ec.TypeContainer.CurrentType/ec.ContainerType.
2004-03-16 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
parameters before aliases.
2004-03-16 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
New oublic function; checks whether two generic instances may become
equal under some instantiations (26.3.1).
* class.cs (TypeContainer.Define): Call
TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
error.
2004-03-16 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Moved
Error_TypeParameterAsBase() here and also check whether the base
class is not an attribute.
2004-03-16 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
2004-03-16 Martin Baulig <martin@ximian.com>
* class.cs (Error_TypeParameterAsBase): Use correct error number
here (CS0689).
2004-03-16 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
for generics.
* generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
error reporting.
2004-03-15 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetFullName): New public method.
(TypeManager.MemberLookup): Added `int_num_type_arguments'
argument; only return members with the correct number of type
arguments.
(TypeManager.CheckGeneric): Allow -1 to bypass the check.
(TypeManager.FilterWithClosure): Call CheckGeneric() to check
whether the number of type arguments matches.
* generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
* expression.cs (MemberAccess): Added public `NumTypeArguments'
field; it's set by the protected .ctor when we're actually a
GenericMemberAccess.
(MemberAccess.ResolveAsTypeStep): Compute the total number of type
arguments and pass it to MemberLookupFinal ().
* ecore.cs (Expression.MemberLookup): Added `int
num_type_arguments' argument; only return members with the correct
number of type arguments.
(Expression.MemberLookupFailed): Check whether the MemberLookup
failed because we did not have the correct number of type
arguments; report CS0305 in this case.
* decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
`e.ResolveAsTypeTerminal()' already did so.
2004-03-15 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.ResolveLValue): Allow e.type being null if
we're a ConstructedType; in this case, the caller must report an
error (for instance CS0131).
* generic.cs (TypeArguments): Added Location argument to the .ctor.
(TypeArguments.Resolve): Actually report errors here.
2004-03-15 Miguel de Icaza <miguel@ximian.com>
* pending.cs (TypeAndMethods): Add `get_indexer_name' and
`set_indexer_name' to the pending bits (one per type).
We fixed a bug today that was picking the wrong method to
override, since for properties the existing InterfaceMethod code
basically ignored the method name. Now we make sure that the
method name is one of the valid indexer names.
2004-03-15 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IndexerPropertyName): Added support
for generic instances.
2004-03-13 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Call
TypeManager.AddUserType() immediately after creating the
TypeBuilder; pass all type parameters when creating the
CurrentType.
* decl.cs (DeclSpace.FindNestedType): New public method.
(DeclSpace.FindType): Added `int num_type_args' argument; only
return types with the correct number of type parameters.
(DeclSpace.CountTypeParams): New public property.
* ecore.cs (SimpleName.ctor): Added overloaded version which takes
the number of type parameters; defaults to zero.
* generic.cs (TypeArguments.Count): New public property.
(ConstructedType.DoResolveAsTypeStep): First call
ds.FindNestedType() to find out whether we're nested in the
current generic type; in this case, we inherit all type parameters
from the current class.
* rootcontext.cs (RootContext.NamespaceLookup): Added `int
num_type_args' argument.
(RootContext.LookupType): Added overloaded version which takes the
number of type arguments; only return types with the correct
number of type arguments.
* typemanager.cs (TypeManager.CheckGeneric): New public function;
checks whether `Type t' has `int num_type_args'.
2004-03-13 Martin Baulig <martin@ximian.com>
* generic.cs (GenericMethod.DefineType): New method; calls
DefineType() on all the type parameters.
* class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
(MethodData.Define): If we're a generic method, call
GenericMethod.DefineType() to define the type parameters.
2004-03-10 Martin Baulig <martin@ximian.com>
* pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
instead of IsAssignableFrom.
2004-03-10 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
* support.cs (ParameterData.HasArrayParameter): New property.
(ReflectionParameters.ctor): Take a MethodBase instead of a
ParameterInfo[]. If we have any type parameters, get the generic
method definition and ask it whether we have variable arguments.
2004-02-26 Miguel de Icaza <miguel@ximian.com>
* iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
routines to check if a type is an enumerable/enumerator allow
classes that implement the IEnumerable or IEnumerator interfaces.
* class.cs (Property, Operator): Implement IIteratorContainer, and
implement SetYields.
(Property.Define): Do the block swapping for get_methods in the
context of iterators. We need to check if Properties also
include indexers or not.
(Operator): Assign the Block before invoking the
OperatorMethod.Define, so we can trigger the Iterator code
replacement.
* cs-parser.jay (SimpleIteratorContainer): new helper class. Both
Property and Operator classes are not created when we parse the
declarator but until we have the block completed, so we use a
singleton SimpleIteratorContainer.Simple to flag whether the
SetYields has been invoked.
We propagate this setting then to the Property or the Operator to
allow the `yield' to function.
2004-02-25 Marek Safar <marek.safar@seznam.cz>
* codegen.cs: Implemented attribute support for modules.
New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
Assembly/Module functionality.
* attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
2004-02-16 Marek Safar <marek.safar@seznam.cz>
* interface.cs (FindMembers): The operation is performed on all base
interfaces and not only on the first. It is required for future CLS Compliance patch.
2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
* statement.cs, codegen.cs:
This patch deals with patterns such as:
public class List : IEnumerable {
public MyEnumerator GetEnumerator () {
return new MyEnumerator(this);
}
IEnumerator IEnumerable.GetEnumerator () {
...
}
public struct MyEnumerator : IEnumerator {
...
}
}
Before, there were a few things we did wrong:
1) we would emit callvirt on a struct, which is illegal
2) we emited ldarg when we needed to emit ldarga
3) we would mistakenly call the interface methods on an enumerator
type that derived from IEnumerator and was in another assembly. For example:
public class MyEnumerator : IEnumerator
Would have the interface methods called, even if there were public impls of the
method. In a struct, this lead to invalid IL code.
2004-02-11 Marek Safar <marek.safar@seznam.cz>
* const.cs: Const is now derived from FieldBase. Method EmitConstant name
renamed to Emit.
* delegate.cs (Define): Fixed crash when delegate type is undefined.
2004-02-11 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Fix small regression: we were not testing V2
compiler features correctly.
* interface.cs: If the emit context is null, then create one
2004-02-09 Marek Safar <marek.safar@seznam.cz>
* decl.cs (GetSignatureForError): New virtual method to get full name
for error messages.
* attribute.cs (IAttributeSupport): New interface for attribute setting.
Now it is possible to rewrite ApplyAttributes method to be less if/else.
* interface.cs : All InterfaceXXX classes are now derived from MemberCore.
Duplicated members and code in these classes has been removed.
Better encapsulation in these classes.
2004-02-07 Miguel de Icaza <miguel@ximian.com>
* assign.cs (Assign.DoResolve): When dealing with compound
assignments, there is a new rule in ECMA C# 2.4 (might have been
there before, but it is documented here) that states that in:
a op= b;
If b is of type int, and the `op' is a shift-operator, then the
above is evaluated as:
a = (int) a op b
* expression.cs (Binary.ResolveOperator): Instead of testing for
int/uint/long/ulong, try to implicitly convert to any of those
types and use that in pointer arithmetic.
* delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
method to print information for from the type, not from the
null-method we were given.
2004-02-01 Duncan Mak <duncan@ximian.com>
* cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
parsing for cmd, fixes bug #53694.
2004-02-04 Marek Safar <marek.safar@seznam.cz>
* class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
in the member name duplication tests. Property and operator name duplication
was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
2004-02-03 Marek Safar <marek.safar@seznam.cz>
* interface.cs (PopulateMethod): Fixed crash when interface method
returns not existing type (error test cs0246-3.cs).
2004-02-02 Ravi Pratap M <ravi@ximian.com>
* cs-parser.jay (interface_accessors): Re-write actions to also
store attributes attached to get and set methods. Fix spelling
while at it.
(inteface_property_declaration): Modify accordingly.
(InterfaceAccessorInfo): New helper class to store information to pass
around between rules that use interface_accessors.
* interface.cs (Emit): Apply attributes on the get and set
accessors of properties and indexers too.
* attribute.cs (ApplyAttributes): Modify accordingly to use the
right MethodBuilder when applying attributes to the get and set accessors.
2004-01-31 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
2004-01-26 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Handle #line hidden from PDC bits.
2004-01-25 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Remove YIELD token, instead use the new grammar
changes that treat `yield' specially when present before `break'
or `return' tokens.
* cs-tokenizer.cs: yield is no longer a keyword.
2004-01-23 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
setting for default constructors.
For default constructors are almost every time set wrong Modifier. The
generated IL code has been alright. But inside mcs this values was
wrong and this was reason why several of my CLS Compliance tests
failed.
2004-02-27 Martin Baulig <martin@ximian.com>
* generics.cs (ConstructedType.ResolveType): Make the nested type
stuff actually work.
2004-02-25 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.CurrentTypeParameters): New protected
property; returns the type parameters just from the current type,
ie. with the ones from outer classes.
(DeclSpace.LookupGeneric): First search in the current class, then
in outer classes.
(DeclSpace.initialize_type_params): When hiding a type parameter
from an outer class, put it into the `type_param_list' anyways.
* expression.cs (MemberAccess.expr): Made this field protected.
* class.cs (TypeContainer.Define): The `CurrentType' just contains
the type parameters from the current class.
* generic.cs (ConstructedType.ResolveType): Support nested generic
types by taking the type parameters which we inherit from outer
classes into account.
(GenericMemberAccess.ResolveAsTypeStep): Override this and added
support for nested generic types.
2004-02-23 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
field and check whether we're nested inside a generic type.
(DeclSpace.ResolveType): If we're resolving to a generic type
definition, create a ConstructedType and return its resolved type.
(DeclSpace.initialize_type_params): New private method;
initializes the `type_param_list' field from the type parameters
from this and all enclosing classes.
(DeclSpace.TypeParameters): Call initialize_type_params() unless
we're already initialized.
2004-02-23 Martin Baulig <martin@ximian.com>
* class.cs (Method.Define): Create the generic method before
calling DoDefine().
(Memberbase.DoDefine): Added DeclSpace argument (in addition to
the TypeContainer one); we use this for generic methods.
* decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
parent's TypeBuilder.
2004-02-18 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
to check for equality.
2004-02-05 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): If we have an
`ec.TypeContainer.CurrentType', use it instead of
`ec.ContainerType' to check whether we're in the type's ctor.
2004-01-29 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.DoResolve): If we're a
`ConstructedType', then we're actually a generic method, so
rewrite the expr as a GenericMemberAccess.
* cs-parser.jay (member_name): Don't use `namespace_or_type_name'
here; manually parse it into a string.
2004-01-28 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsEqual): New static method.
(TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
check for equality instead of using `=='.
2004-01-26 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.CurrentType): New public field.
* expression.cs (This.ResolveBase): If we have an
`ec.TypeContainer.CurrentType', use it instead of
`ec.ContainerType'.
* class.cs (TypeContainer.DefineType): If we're a generic type,
create the `CurrentType' (unresolved).
(TypeContainer.GenericType): New private field.
(TypeContainer.DefineMembers): If we have a `CurrentType', resolve
it and store it in `GenericType' before creating the MemberCache.
(TypeContainer.GetMembers): If we have a `GenericType', call
TypeManager.FindMembers() on it.
* interface.cs (Interface.GenericType): New private field.
(Interface.DefineType): If we're a generic type, create the
`CurrentType' (unresolved).
(Interface.DefineMembers): If we have a `CurrentType', resolve it
and store it in `GenericType' before creating the MemberCache.
(Interface.GetMembers): If we have a `GenericType', call
TypeManager.FindMembers() on it.
2004-01-22 Martin Baulig <martin@ximian.com>
* cs-parser.jay (namespace_or_type_name): Return an Expression,
not a QualifiedIdentifier. This is what `type_name_expression'
was previously doing.
(type_name_expression): Removed; the code is now in
`namespace_or_type_name'.
(qualified_identifier): Removed, use `namespace_or_type_name'
instead.
(QualifiedIdentifier): Removed this class.
2004-01-22 Martin Baulig <martin@ximian.com>
* namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
not a string as alias name.
2004-01-21 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldInfo.AddressOf): Revert patch from previous
#52730 bug, and instead compute correctly the need to use a
temporary variable when requesting an address based on the
static/instace modified of the field and the constructor.
2004-01-21 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
class and namespace before looking up aliases. Fixes #52517.
2004-01-21 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (UsageVector.Merge): Allow variables being
assinged in a 'try'; fixes exception4.cs.
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* class.cs : Implemented parameter-less constructor for TypeContainer
* decl.cs: Attributes are now stored here. New property OptAttributes
* delegate.cs, enum.cs, interface.cs: Removed attribute member.
* rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs (CSharpSignature): Now reports also inner class name.
(CSharpSignature): New method for indexer and property signature.
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* pending.cs (IsVirtualFilter): Faster implementation.
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* typemanager.cs: Avoid inclusion of same assembly more than once.
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* cs-parser.jay: Fixed problem where the last assembly attribute
has been applied also to following declaration (class, struct, etc.)
2004-01-21 Marek Safar <marek.safar@seznam.cz>
* class.cs: Added error CS0538, CS0539 reporting.
Fixed crash on Microsoft runtime when field type is void.
* cs-parser.jay: Added error CS0537 reporting.
* pending.cs: Added error CS0535 reporting.
Improved error report for errors CS0536, CS0534.
2004-01-20 Miguel de Icaza <miguel@ximian.com>
Merge a few bits from the Anonymous Method MCS tree.
* statement.cs (ToplevelBlock): New class for toplevel methods,
will hold anonymous methods, lifted variables.
* cs-parser.jay: Create toplevel blocks for delegates and for
regular blocks of code.
2004-01-20 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext): Removed `InTry', `InCatch',
`InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
and `NeedExplicitReturn'; added `IsLastStatement'.
(EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
have a `ReturnLabel' or we're not unreachable.
* flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
child's reachability; don't just override ours with it. Fixes
#58058 (lluis's example).
(FlowBranching): Added public InTryOrCatch(), InCatch(),
InFinally(), InLoop(), InSwitch() and
BreakCrossesTryCatchBoundary() methods.
* statement.cs (Return): Do all error checking in Resolve().
Unless we are the last statement in a top-level block, always
create a return label and jump to it.
(Break, Continue): Do all error checking in Resolve(); also make
sure we aren't leaving a `finally'.
(Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
statement in a top-level block.
(Block.Flags): Added `IsDestructor'.
(Block.IsDestructor): New public property.
2004-01-20 Martin Baulig <martin@ximian.com>
* statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
2004-01-20 Martin Baulig <martin@ximian.com>
* statement.cs (Statement.ResolveUnreachable): New public method.
(If, While): Do the dead-code elimination in Resolve(), not in Emit().
(Block.Resolve): Resolve unreachable statements.
2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: We need to fix the case where we do
not have a temp variable here.
* assign.cs: Only expression compound assignments need
temporary variables.
2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
* flowanalysis.cs: Reduce memory allocation in a few ways:
- A block with no variables should not allocate a bit
vector for itself.
- A method with no out parameters does not need any tracking
for assignment of the parameters, so we need not allocate
any data for it.
- The arrays:
public readonly Type[] VariableTypes;
public readonly string[] VariableNames;
Are redundant. The data is already stored in the variable
map, so we need not allocate another array for it.
- We need to add alot of checks for if (params | locals) == null
due to the first two changes.
2004-01-18 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
implement IMemoryLocation, we store a copy on a local variable and
take the address of it. Patch from Benjamin Jemlich
* cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
to use a special "type_name_expression" rule which reduces the
number of "QualifiedIdentifier" classes created, and instead
directly creates MemberAccess expressions.
2004-01-17 Miguel de Icaza <miguel@ximian.com>
* convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
that fixes #52853. Null literal assignment to ValueType
* class.cs (MethodData.Emit): Instead of checking the name of the
method to determine if its a destructor, create a new derived
class from Method called Destructor, and test for that.
* cs-parser.jay: Create a Destructor object instead of a Method.
Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
Fixes: 52933
2004-01-16 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.ResolveOperator): Perform an implicit
conversion from MethodGroups to their delegate types on the
Addition operation.
* delegate.cs: Introduce a new class DelegateCreation that is the
base class for `NewDelegate' and `ImplicitDelegateCreation',
factor some code in here.
* convert.cs (Convert.ImplicitConversionStandard): Add an implicit
conversion from MethodGroups to compatible delegate types.
* ecore.cs (Expression.Resolve): Do not flag error 654
(Methodgroupd needs parenthesis) if running on the V2 compiler, as
we allow conversions from MethodGroups to delegate types now.
* assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
assignments in v2 either.
2004-01-10 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
static read-only fields in ctors.
Applied patch from Benjamin Jemlich
* expression.cs (UnaryMutator): Avoid leaking local variables.
2004-01-09 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (IsCastToken): Allow the various native types
here to return true, as they can be used like this:
(XXX) int.MEMBER ()
Fixed 49836 and all the other dups
2004-01-09 Zoltan Varga <vargaz@freemail.hu>
* driver.cs: Implement /win32res and /win32icon.
2004-01-08 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add a rule to improve error handling for the
common mistake of placing modifiers after the type.
2004-01-07 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (interface_event_declaration): Catch
initialization of events on interfaces, and report cs0068
* cs-parser.jay (interface_event_declaration): Catch
initialization of events.
* ecore.cs: Better report missing constructors.
* expression.cs (Binary.ResolveOperator): My previous bug fix had
the error reporting done in the wrong place. Fix.
* expression.cs (Binary.ResolveOperator): Catch the
operator + (E x, E y) error earlier, and later allow for implicit
conversions in operator +/- (E e, U x) from U to the underlying
type of E.
* class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
52596, if the container class is abstract, the default constructor
is protected otherwise its public (before, we were always public).
* statement.cs (Fixed.Resolve): Catch a couple more errors in the
fixed statement.
(Using.EmitLocalVariableDecls): Applied patch from Benjamin
Jemlich that fixes bug #52597, MCS was generating invalid code for
idisposable structs. Thanks to Ben for following up with this
bug as well.
2004-01-06 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Allow assemblies without code to be generated, fixes
52230.
2004-01-07 Nick Drochak <ndrochak@gol.com>
* attribute.cs: Remove unneeded catch variables. Eliminates a warning.
2004-01-05 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add rules to improve error reporting if fields or
methods are declared at the namespace level (error 116)
* Add rules to catch event add/remove
2004-01-04 David Sheldon <dave-mono@earth.li>
* expression.cs: Added matching ")" to error message for
CS0077
2004-01-03 Todd Berman <tberman@gentoo.org>
* ecore.cs, attribute.cs:
Applying fix from #52429.
2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
* ecore.cs, expression.cs, statement.cs:
Total rewrite of how we handle branching. We
now handle complex boolean expressions with fewer
jumps. As well if (x == 0) no longer emits a ceq.
if (x is Foo) is much faster now, because we generate
better code.
Overall, we get a pretty big improvement on our benchmark
tests. The code we generate is smaller and more readable.
I did a full two-stage bootstrap. The patch was reviewed
by Martin and Miguel.
2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
* cs-parser.jay: Make primary_expression not take a QI.
we dont need this because the member_access rule covers
us here. So we replace the rule with just IDENTIFIER.
This has two good effects. First, we remove a s/r conflict.
Second, we allocate many fewer QualifiedIdentifier objects.
2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
* attribute.cs: Handle MarshalAs attributes as pseudo, and
set the correct information via SRE. This prevents
hanging on the MS runtime. Fixes #29374.
2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
* convert.cs: correctly handle conversions to value types
from Enum and ValueType as unboxing conversions.
Fixes bug #52569. Patch by Benjamin Jemlich.
2004-01-02 Ravi Pratap <ravi@ximian.com>
* expression.cs (BetterConversion): Prefer int -> uint
over int -> ulong (csc's behaviour). This fixed bug #52046.
2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs (MemberCache.FindMembers): now returns a
MemberInfo [].
* typemanager.cs: In general, go with with ^^.
(CopyNewMethods): take an IList.
(RealMemberLookup): Only allocate an arraylist
if we copy from two sets of methods.
This change basically does two things:
1) Fewer array lists allocated due to CopyNewMethods.
2) the explicit cast in MemberList costed ALOT.
2004-01-02 Zoltan Varga <vargaz@freemail.hu>
* cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
a hashtable to avoid needless string allocations when an identifier is
used more than once (the common case).
2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
* pending.cs: MS's TypeBuilder.GetInterfaces ()
is broken, it will not return anything. So, we
have to use the information we have in mcs to
do the task.
* typemanager.cs: Add a cache for GetInterfaces,
since this will now be used more often (due to ^^)
(GetExplicitInterfaces) New method that gets the
declared, not effective, interfaces on a type
builder (eg, if you have interface IFoo, interface
IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
{ IBar }.
This patch makes MCS able to bootstrap itself on
Windows again.
2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Remove the Nop's that Miguel put
in by mistake.
2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
* report.cs, codegen.cs: Give the real stack trace to
the error when an exception is thrown.
2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs: only allocate hashtables for ifaces if
it is an iface!
2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: fix the error from cs0121-2.cs
(a parent interface has two child interfaces that
have a function with the same name and 0 params
and the function is called through the parent).
2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs, rootcontext.cs, typmanager.cs: do not
leak pointers.
2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
* codegen.cs: remove stack for the ec flow branching.
It is already a linked list, so no need.
2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
* Makefile: Allow custom profiler here.
2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
* typemanager.cs (LookupType):
- Use a static char [], because split takes
a param array for args, so it was allocating
every time.
- Do not store true in a hashtable, it boxes.
2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
* flowanalysis.cs: bytify common enums.
2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
* modifiers.cs: Add a new set of flags for the
flags allowed on explicit interface impls.
* cs-parser.jay: catch the use of modifiers in
interfaces correctly.
* class.cs: catch private void IFoo.Blah ().
All related to bug #50572.
2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs: Rewrite the consistant accessability checking.
Accessability is not linear, it must be implemented in
a tableish way. Fixes #49704.
2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
* expression.cs: Handle negation in a checked context.
We must use subtraction from zero. Fixes #38674.
2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs: Ignore static void main in DLLs.
* rootcontext.cs: Handle the target type here,
since we are have to access it from class.cs
* driver.cs: account for the above.
2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
* report.cs: Give line numbers and files if available.
2003-12-20 Zoltan Varga <vargaz@freemail.hu>
* driver.cs: Implement /addmodule.
* typemanager.cs: Change 'modules' field so it now contains Modules not
ModuleBuilders.
2003-12-20 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
(FieldBase.IsAssigned): Removed this field.
(FieldBase.SetAssigned): New public method.
(TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
2003-12-20 Martin Baulig <martin@ximian.com>
* expression.cs (LocalVariableReference.DoResolve): Don't set
`vi.Used' if we're called from DoResolveLValue().
* statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
returns the usage vector it just merged into the current one -
pass this one to UsageWarning().
(Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
of the `EmitContext', don't call this recursively on our children.
2003-12-19 Zoltan Varga <vargaz@freemail.hu>
* driver.cs: Implement /target:module.
2003-12-18 Zoltan Varga <vargaz@freemail.hu>
* support.cs (CharArrayHashtable): New helper class.
* cs-tokenizer.cs: Store keywords in a hashtable indexed by
char arrays, not strings, so we can avoid creating a string in
consume_identifier if the identifier is a keyword.
2003-12-16 Martin Baulig <martin@ximian.com>
* statement.cs (LocalInfo.Assigned): Removed this property.
(LocalInfo.Flags): Removed `Assigned'.
(LocalInfo.IsAssigned): New public method; takes the EmitContext
and uses flow analysis.
(Block.UsageWarning): Made this method private.
(Block.Resolve): Call UsageWarning() if appropriate.
* expression.cs (LocalVariableReference.DoResolve): Always set
LocalInfo.Used here.
2003-12-13 Martin Baulig <martin@ximian.com>
* statement.cs (Statement.DoEmit, Statement.Emit): Don't return
any value here; we're now using flow analysis to figure out
whether a statement/block returns a value.
2003-12-13 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
working again.
(FlowBranching.MergeFinally): Don't call
`branching.CheckOutParameters()' here, this is called in
MergeTopBlock().
(FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
when adding the `finally' vector.
2003-12-13 Martin Baulig <martin@ximian.com>
* flowanalysis.cs
(UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
actually work and also fix #48962.
2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
* decl.cs: Do not check System.Object for nested types,
since we know it does not have any. Big bang for buck:
BEFORE:
Run 1: 8.35 seconds
Run 2: 8.32 seconds
corlib: 17.99 seconds
AFTER:
Run 1: 8.17 seconds
Run 2: 8.17 seconds
corlib: 17.39 seconds
2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs (FindMembers): Allocate arraylists on demand. Most of the
time we are returning 0 members, so we save alot here.
2003-12-11 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
`MergeChild()', also just take the `FlowBranching' as argument;
call Merge() on it and return the result.
(FlowBranching.Merge): We don't need to do anything if we just
have one sibling.
2003-12-11 Martin Baulig <martin@ximian.com>
* flowanalysis.cs: Use a list of `UsageVector's instead of storing
them in an `ArrayList' to reduce memory usage. Thanks to Ben
Maurer for this idea.
2003-12-11 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (MergeResult): This class is now gone; we now
use the `UsageVector' for this. The reason for this is that if a
branching just has one sibling, we don't need to "merge" them at
all - that's the next step to do.
(FlowBranching.Merge): We now return a `UsageVector' instead of a
`MergeResult'.
2003-12-11 Martin Baulig <martin@ximian.com>
Reworked flow analyis and made it more precise and bug-free. The
most important change is that we're now using a special `Reachability'
class instead of having "magic" meanings of `FlowReturns'. I'll
do some more cleanups and optimizations and also add some more
documentation this week.
* flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
largely reworked this class.
(FlowReturns): Removed `Unreachable' and `Exception'; we now use
the new `Reachability' class instead of having "magic" values here.
(FlowBranching): We're now using an instance of `Reachability'
instead of having separate `Returns', `Breaks' etc. fields.
* codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
based on flow analysis; ignore the return value of block.Emit ().
2003-12-10 Zoltan Varga <vargaz@freemail.hu>
* driver.cs typemanager.cs: Find the mono extensions to corlib even
if they are private.
2003-12-09 Martin Baulig <martin@ximian.com>
* flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
call them directly on the UsageVector.
2003-12-09 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
Changed return type from `FlowReturns' to `Reachability'.
2003-12-09 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranching.Reachability): New sealed class.
(FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
`Reachable' fields with a single `Reachability' one.
2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
* class.cs (FindMembers): Remove foreach's.
Bootstrap times:
BEFORE
Run 1: 8.74 seconds
Run 2: 8.71 seconds
AFTER
Run 1: 8.64 seconds
Run 2: 8.58 seconds
2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
* cs-parser.jay:
* gen-treedump.cs:
* statement.cs:
This patch does a few things:
1. EmptyStatement is now a singleton, so it is never reallocated.
2. All blah is EmptyStatement constructs have been changed to
blah == EmptyStatement.Value, which is much faster and valid
now that EmptyStatement is a singleton.
3. When resolving a block, rather than allocating a new array for
the non-empty statements, empty statements are replaced with
EmptyStatement.Value
4. Some recursive functions have been made non-recursive.
Mainly the performance impact is from (3), however (1) and (2) are needed for
this to work. (4) does not make a big difference in normal situations, however
it makes the profile look saner.
Bootstrap times:
BEFORE
9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
Total memory allocated: 56397 KB
AFTER
9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
Total memory allocated: 55666 KB
2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
* support.cs: Rewrite DoubleHash to use its own impl. Is faster
than the hashtable in a hashtable version
* decl.cs: Right now, whenever we try to lookup a type inside a namespace,
we always end up concating a string. This results in a huge perf
loss, because many strings have to be tracked by the GC. In this
patch, we first use a hashtable that works with two keys, so that
the strings do not need to be concat'ed.
Bootstrap times:
BEFORE
Run 1: 8.74 seconds
Run 2: 8.71 seconds
AFTER
Run 1: 8.65 seconds
Run 2: 8.56 seconds
2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
* Makefile: Add a new target `do-time' that does a quick and simple
profile, leaving easy to parse output.
2003-12-08 Zoltan Varga <vargaz@freemail.hu>
* codegen.cs (Init): Create the dynamic assembly with
AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
* support.cs: Make the PtrHashtable use only one
instance of its comparer.
2003-11-30 Zoltan Varga <vargaz@freemail.hu>
* typemanager.cs: Fix lookup of GetNamespaces.
2003-11-29 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Removed redundant line.
* statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
ArrayLists, use for loops with bounds.
* flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
arraylist.
* expression.cs (Invocation.OverloadResolve): Avoid foreach on
arraylists, use for loop with bounds.
The above three changes give us a 0.071 second performance
improvement out of 3.294 seconds down to 3.223. On my machine
the above changes reduced the memory usage by 1,387 KB during
compiler bootstrap.
* cs-parser.jay (QualifiedIdentifier): New class used to represent
QualifiedIdentifiers. Before we created a new string through
concatenation, and mostly later on, the result would be
manipulated by DecomposeQI through string manipulation.
This reduced the compiler memory usage for bootstrapping from
59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
compile times in 0.05 seconds.
2003-11-28 Dick Porter <dick@ximian.com>
* support.cs: Do string compares with the Invariant culture.
* rootcontext.cs:
* gen-treedump.cs:
* expression.cs:
* driver.cs:
* decl.cs:
* codegen.cs:
* class.cs: Use the char forms of IndexOf and LastIndexOf, so that
the comparison is done with the Invariant culture.
2003-11-27 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Foreach.TryType): Use DeclaredOnly to find the
GetEnumerator method.
(ProbeCollectionType): Iterate starting at the most specific type
upwards looking for a GetEnumerator
* expression.cs: Shift count can be up to 31 for int/uint and 63
for long/ulong.
2003-11-26 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Block.LookupLabel): Also look for the label on the
children blocks. Use a hash table to keep track of visited
nodes.
* cfold.cs (IntConstant to UIntConstant mapping): Only return if
we actually did transform the other operand, otherwise fall back
to the common codepath that casts to long.
* cs-tokenizer.cs: Use the same code pattern as the int case.
Maybe I should do the parsing myself, and avoid depending on the
Parse routines to get this done.
2003-11-25 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
which fixes bug 51347. This time test it.
* expression.cs: Make TypeOfVoid derive from TypeOf, so code in
attributes for example can not tell the difference between these.
The difference was only a syntax feature of the language.
* attribute.cs: Apply attributes to delegates.
* delegate.cs: Call the apply attributes method.
2003-11-24 Miguel de Icaza <miguel@ximian.com>
* convert.cs (TryImplicitIntConversion): One line bug fix: we were
comparing 0 vs Byte.MinValue, not the value
(ImplicitConversionRequired): When reporting a conversion error,
use error 31 to print out the constant error instead of the
simpler 29.
* expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
which fixes bug 51347.
2003-11-22 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
which fixes the -warnaserror command line option.
2003-11-21 Miguel de Icaza <miguel@ximian.com>
* cfold.cs (DoNumericPromotions): During constant folding of
additions on UIntConstant, special case intconstants with
IntConstants like we do on the expression binary operator.
2003-11-12 Miguel de Icaza <miguel@ximian.com>
* convert.cs (ImplicitReferenceConversion): We were missing a case
(System.Enum are not value types or class types, so we need to
classify them separatedly).
* driver.cs: We do not support error 2007.
2003-11-12 Jackson Harper <jackson@ximian.com>
* driver.cs: Use corlib.dll or mscorlib.dll when looking up the
system directory. Also use the full file name so users can
libraries names mscorlib-o-tron.dll in a non system dir.
2004-01-04 David Sheldon <dave-mono@earth.li>
* expression.cs: Added matching ")" to error message for CS0077.
2003-12-19 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsEqualGenericType): New public
static method; see documentation in the method.
(TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
* convert.cs (Convert.ImplicitReferenceConversion,
Convert.ImplicitReferenceConversionExists): Add support for
generic type declarations; see gen-36.cs.
2003-12-19 Martin Baulig <martin@ximian.com>
* pending.cs (Pending.InterfaceMethod): Use
`Type.IsAssignableFrom()' instead of `=='.
2003-12-18 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
byref types first.
* convert.cs (Convert.ImplicitStandardConversionExists): Use
`expr_type.Equals (target_type)' instead of `=='.
2003-12-08 Martin Baulig <martin@ximian.com>
* generics.cs (Constraints.Types): Removed.
(Constraints.Resolve): Just resolve everything to TypeExpr's, not
to Type's.
(Constraints.ResolveTypes): New public method; resolves the
TypeExpr's to Type's.
(TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
longer takes the constraints.
(TypeParameter.DefineMethod): Likewise.
(TypeParameter.DefineType): New public method. Calls
`TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
the constraints.
2003-12-08 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ImplicitConversionStandard): Use
`expr_type.Equals (target_type)' instead of `=='.
2003-12-08 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetReferenceType): Call
`Type.MakeByRefType ()'.
2003-12-08 Martin Baulig <martin@ximian.com>
* cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
just has some special meaning in some situations. For instance,
it is allowed to use `where' as the name of a variable etc.
2003-12-04 Martin Baulig <martin@ximian.com>
* expression.cs (ComposedCast.DoResolveAsTypeStep): Use
`Type.MakeArrayType()' for array types.
2003-11-18 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation.VerifyArgumentsCompat): Remove
debugging message.
(SizeOf.DoResolve): assign the `type_queried' field. This gets
corlib to compile.
2003-11-16 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext.IsGeneric): Removed.
* ecore.cs (SimpleName.ResolveAsTypeStep): Always call
ResolveGeneric() on the DeclSpace.
2003-11-16 Martin Baulig <martin@ximian.com>
* generic.cs (TypeArguments.Resolve):
`Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
`ResolveType()' on it to get the Type.
2003-11-15 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.GetInterfaces): Override this.
2003-11-14 Martin Baulig <martin@ximian.com>
* interface.cs (Interface.DefineType): Define all type parameters
before adding the interfaces we inherit.
2003-11-11 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.ResolveType): Always call
`gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
2003-11-10 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
(TypeManager.InitCoreTypes): Initialize them here, but instead of
calling `ResolveType()' on them, directly assign their `Type'.
2003-11-08 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType): Override `IsClass' etc.
2003-11-08 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
return value and the `out parent' parameter.
(TypeContainer.DefineType): Moved the CS0644 check into
GetClassBases(). Don't pass the interface types to the
`builder.DefineType()'/`builder.DefineNestedType()', but resolve
them later and then call `TypeBuilder.AddInterfaceImplementation()'.
* ecore.cs (TypeExpr.IsAttribute): New property.
(TypeExpr.GetInterfaces): New method.
* interface.cs (Interface.GetInterfaceTypeByName): Return a
TypeExpr instead of a Type.
(Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
(Interface.DefineType): Don't pass the interface types to the
`builder.Definetype()'/`builder.DefineNestedType()', but resolve
them later and then call `TypeBulider.AddInterfaceImplementation()'.
* typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
instead of a `Type[]'.
(TypeManager.RegisterBuilder): Likewise.
(TypeManager.AddUserInterface): Likewise.
(TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
`Type[]' and also return a `TypeExpr[]'.
(TypeManager.GetInterfaces): Return a `TypeExpr[]'.
2003-11-08 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
Expression.
2003-11-08 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
TypeManager.ResolveExpressionTypes().
* ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
instead of an Expression.
(TypeExpr): This is now an abstract base class for `TypeExpression'.
(TypeExpression): New public class; formerly known as `TypeExpr'.
* expression.cs (ComposedCast): Derive from TypeExpr.
* typemanager.cs (TypeManager.system_*_expr): These are now
TypExpr's instead of Expression's.
(TypeManager.ResolveExpressionTypes): New public static function;
called from DeclSpace.GetTypeResolveEmitContext() to resolve all
of them.
2003-11-06 Miguel de Icaza <miguel@ximian.com>
* expression.cs (New.DoResolve): Do not dereference value that
might be a null return.
* statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
sure that the constant value has the right type. Fixes an
unreported bug, similar to 50425.
* const.cs (Const.LookupConstantValue): Call
ImplicitStandardConversionExists before doing a conversion to
avoid havng the TypeManager.ChangeType do conversions.
Reduced the number of casts used
(Const.ChangeType): New routine to enable reuse of the constant
type changing code from statement.
* typemanager.cs (ChangeType): Move common initialization to
static global variables.
Fixes #50425.
* convert.cs (ImplicitReferenceConversion): Somehow we allowed
every value type to go through, even if it was void. Fix that.
* cs-tokenizer.cs: Use is_identifier_start_character on the start
character of the define, and the is_identifier_part_character for
the rest of the string.
2003-11-05 Miguel de Icaza <miguel@ximian.com>
* expression.cs (UnaryMutator.EmitCode): When I updated
LocalVariableReference.DoResolve, I overdid it, and dropped an
optimization done on local variable references.
2003-11-04 Miguel de Icaza <miguel@ximian.com>
* ecore.cs: Convert the return from Ldlen into an int.
2003-10-20 Miguel de Icaza <miguel@ximian.com>
* decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
the accessibility, this is a special case for toplevel non-public
classes (internal for instance).
2003-10-20 Nick Drochak <ndrochak@gol.com>
* ecore.cs: Fix typo and build. Needed another right paren.
2003-10-19 Miguel de Icaza <miguel@ximian.com>
* ecore.cs: Applied fix from Ben Maurer. We were handling in the
`internal' case regular and protected, but not allowing protected
to be evaluated later. Bug 49840
2003-10-15 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Switch.TableSwitchEmit): Compare the upper bound
to kb.Nlast, and not the kb.nFirst to isolate the switch
statement.
Extract the underlying type, so enumerations of long/ulong are
treated like long/ulong.
2003-10-14 Miguel de Icaza <miguel@ximian.com>
* expression.cs (New): Overload the meaning of RequestedType to
track the possible creation of the NewDelegate type, since
DoResolve is invoked more than once for new constructors on field
initialization.
See bugs: #48800 and #37014
* cs-parser.jay (declare_local_constants): Take an arraylist
instead of a single constant.
(local_constant_declaration): It should take a
constant_declarators, not a constant_declarator. Fixes 49487
* convert.cs: Fix error report.
2003-10-13 Jackson Harper <jackson@ximian.com>
* typemanager.cs (TypeToCoreType): Add float and double this fixes
bug #49611
2003-11-03 Martin Baulig <martin@ximian.com>
* expression.cs (ArrayAccess.GetStoreOpcode): Added
`out bool has_type_arg'; if set, we need to pass the type to
ig.Emit().
(ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
Stelem_Any/Ldelem_Any for generic parameters.
2003-11-02 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.EmitCall): Use
`TypeManager.IsValueType()' to check whether it's a value type.
Don't set `struct_call' when calling a method on a type parameter.
2003-11-02 Martin Baulig <martin@ximian.com>
* generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
and removed the TypeBuilder argument.
* typemanager.cs (TypeManager.IsValueType): Return
`t.IsGenericParameter || t.IsValueType'.
2003-10-25 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
call ConstructedType.Resolve() on it.
* generic.cs (ConstructedType.Resolve): Set `type' on success.
2003-10-25 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.GetClassBases): Changed
`out Type parent' into `out TypeExpr parent'. Moved CS0644 and
CS8214 reporting here.
(TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
instead of a `Type' for our parent. In case of a recursive
declaration (see tests/gen-23.cs for an example), our parent is a
ConstructedType and it doesn't have its type set. So, first
create our own TypeBuilder, then call constructed.Resolve() to get
the parent's type and finally TypeBuilder.SetParent() it.
* ecore.cs (TypeExpr.Name): New public virtual property.
* generic.cs
(ConstructedType): We're now a TypeExpr and not just an Expression.
(ConstructedType.ResolveAsTypeStep): Don't resolve our type
arguments here; this is done later.
(ConstructedType.Resolve): New public method to resolve the type
arguments and bind them.
2003-10-21 Martin Baulig <martin@ximian.com>
* convert.cs: Use `TypeManager.IsValueType' instead of
'type.IsValueType' everywhere.
* typemanager.cs (TypeManager.IsValueType): Return true for type
parameters. The reason for this is that we need to box a type
parameter when converting it to a reference type.
* cs-parser.jay: Added support for default value expressions.
* generics.cs (DefaultValueExpression): New public class.
2003-10-17 Martin Baulig <martin@ximian.com>
* generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
TypeContainer so we can also use this for Interfaces.
(TypeParameter.Resolve): Likewise.
* interface.cs (Interface.DefineType): Added support for generic
interfaces.
* cs-parser.jay: Added support for generic structs and interfaces.
2003-10-17 Martin Baulig <martin@ximian.com>
* generic.cs (GenericMemberAccess.DoResolve): We can now actually
call generic methods :-)
2003-10-16 Martin Baulig <martin@ximian.com>
* cs-parser.jay (namespace_or_type_name): Only create a
GenericMemberAccess if we actually have type arguments.
2003-10-13 Martin Baulig <martin@ximian.com>
* class.cs (Method.Define): If we're a generic method, call
TypeBuilder.DefineGenericMethod () before resolving
the parameters.
(MethodData): Added .ctor which takes an additional MethodBuilder
argument; this is used for generic methods.
(MethodData.Define): Call `builder.SetGenericMethodSignature()' if
we already have a MethodBuilder.
2003-10-10 Martin Baulig <martin@ximian.com>
* class.cs (Method): Added .ctor which takes a `GenericMethod'
instead of a `DeclSpace'. This is used for generic methods.
* cs-parser.jay (method_header): Added support for generic
methods; create a `GenericMethod' instance and pass it to the
`Method's .ctor; it'll be used as the `DeclSpace' to lookup
parameters and locals.
* decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
since we already have the location. Check whether we're a generic
type declaration or a generic method and create the correct type
parameter.
* generic.cs (TypeParameter.DefineMethod): New public method.
(GenericMethod): New public class; derives from DeclSpace and is
used for generic methods.
2003-10-09 Martin Baulig <martin@ximian.com>
* class.cs (MethodCore): Added additional `DeclSpace ds' argument
to the .ctor.
(MethodCore.DoDefineParameters): Removed the TypeContainer
argument; use the DeclSpace which was passed to the .ctor instead.
(MethodCore.CheckParameter): Take a DeclSpace instead of a
TypeContainer; we only need a DeclSpace here.
2003-10-09 Martin Baulig <martin@ximian.com>
* class.cs (MethodData): Added additional `DeclSpace ds' argument
to the .ctor.
(MethodData.Define, MethodData.Emit): Pass the `ds' to the
EmitContext's .ctor.
2003-10-09 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
(AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
AsAccessible(), moved them as well.
* class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
2003-10-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
generation for >=, as spotted by Paolo, bug 48679.
Patch from David Waite.
* cs-tokenizer.cs: Add handling for #pragma.
* cs-parser.jay: Allow for both yield and yield return in the
syntax. The anti-cobolization of C# fight will go on!
* class.cs (TypeBuilder.DefineType): Catch error condition here
(Parent.DefineType erroring out and returning null).
* expression.cs (ArrayCreation.EmitDynamicInitializers): When
coping with enumerations variables, we were mistakenly processing
them as a regular value type instead of built-in types. Fixes the
bug #48063
* typemanager.cs (IsBuiltinOrEnum): New method.
2003-09-30 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Upgrade: yield now needs the return clause.
2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* cs-parser.jay : Renamed yyName to yyNames related to jay.
2003-09-29 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.GetMethodFlags): Added support for
inflated generic methods.
* generics.cs (ConstructedType): Distinguish between open and
closed constructed types; correctly resolve the arguments.
2003-09-22 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
all type arguments meet their constraints.
2003-09-19 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.SetupCacheForInterface): Take a
`MemberCache parent' argument. Normally, an interface doesn't
have a parent type except System.Object, but we use this in gmcs
for generic type parameters.
2003-09-18 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
on `type.IsInterface'; don't check whether the type has a parent
to determine whether it's an interface.
2003-09-17 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.ToString): Always use `name' as the
type name.
2003-09-15 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
* generic.cs (Constraints.Resolve): New public method; this is
called to resolve the constraint types and to check whether all
the constraints are correct.
(Constraints.Types): New public property.
(TypeParameter.Resolve): New public method; resolves all the
type's constraints.
* class.cs (TypeContainer.DefineType): Call
TypeParameter.Resolve() before actually defining the type.
2003-09-15 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.DefineType): Added an error flag to
avoid reporting duplicate CS0146's ("class definition is
circular.").
* driver.cs (Driver.MainDriver): Abort if
RootContext.ResolveTree() reported any errors.
2003-09-07 Martin Baulig <martin@ximian.com>
* report.cs (Error, Warning): Added overloaded versions which take
a `params object[] args' and call String.Format().
2003-09-07 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace..ctor): Don't call
NamespaceEntry.DefineName() here; do it in RecordDecl() which is
called from Tree.RecordDecl(). Fixes the CS0101 reporting.
(DeclSpace.RecordDecl): New method.
* tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
2003-09-02 Ravi Pratap <ravi@ximian.com>
* attribute.cs (CheckAttributeTarget): Ensure that we allow return
value attributes to be applied to ParameterBuilders.
* class.cs (MethodCore.LabelParameters): Make static and more
generic so that it can be used from other places - like interface
methods, for instance.
* interface.cs (Interface.Emit): Call LabelParameters before
emitting attributes on the InterfaceMethod.
2003-09-07 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
if the number of type parameters doesn't match.
2003-09-04 Martin Baulig <martin@ximian.com>
* expression.cs (ComposedCast.ResolveAsTypeStep): Added support
for arrays of generic type params (ie. `!0[]').
2003-09-04 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.AsAccessible): Ignore generic parameters
for the moment.
2003-09-04 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.LookupGeneric): New method.
(DeclSpace.CheckAccessLevel): Ignore generic parameters for the
moment.
* generic.cs (TypeParameterExpr): Take a TypeParameter as
argument, not just a string.
(TypeParameter.Define): New public method; this is called to
actually define the generic parameter; after this, you can use the
new `Type' property to get the type.
2003-09-04 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
is now an ArrayList; initialize the result of the `TypeParameters'
property here.
(DeclSpace.GetGenericData): Removed.
(DeclSpace.LookupGeneric): Temporarily removed; we need to
implement this in a different way.
(DeclSpace.GetTypeParameters): Removed; there's now a
`TypeParameters' property.
(DeclSpace.TypeParameters): New public property.
* generic.cs (Constraints): Make this class public.
(TypeParameter): New public class.
2003-09-04 Martin Baulig <martin@ximian.com>
* decl.cs (DeclSpace.GetTypeParameters): New method to return the
generic parameters.
* class.cs (TypeContainer.DefineType): Call
TypeBuilder.DefineGenericParameter () on all generic parameters if
this is a generic type.
2003-08-28 Martin Baulig <martin@ximian.com>
* sample-stack.il: Compile this with ilasm: "ilasm /dll
sample-stack.il".
* sample-hello.cs: Compile this with gmcs: "gmcs
/r:sample-stack.dll sample-hello.cs".
2003-08-28 Martin Baulig <martin@ximian.com>
* generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
the parameters to the generic type.
2003-08-28 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
2003-08-28 Martin Baulig <martin@ximian.com>
* cs-parser.jay (opt_type_argument_list): Use
`OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
(primary_expression): Replace `qualified_identifier' with `type_name'.
(type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
* cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
parser to check whether it is syntactically a type parameter list;
return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
this case.
2003-08-26 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Look for members before
resolving aliases; fixes #47927.
2003-08-26 Martin Baulig <martin@ximian.com>
* statement.cs (Using.DoResolve): This is internally emitting a
try/finally clause, so we need to set ec.NeedExplicitReturn if we
do not always return. Fixes #47681.
2003-08-26 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCore): Moved WarningNotHiding(),
Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
into MemberBase.
(AdditionResult): Make this nested in DeclSpace.
(DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
argument; call NamespaceEntry.Define() unless we're nested in a
class or struct.
* namespace.cs (Namespace.DefineName): New public function. This
is called from DeclSpace's .ctor to add
(Namespace.Lookup): Include DeclSpaces in the lookup.
* class.cs (Operator): Derive from MemberBase, not MemberCore.
* const.cs (Const): Derive from MemberBase, not MemberCore.
2003-08-25 Martin Baulig <martin@ximian.com>
* convert.cs (Convert.ExplicitReferenceConversion): When
converting from an interface type to a class, unbox if the target
type is a struct type. Fixes #47822.
2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
#47854.
2003-08-22 Martin Baulig <martin@ximian.com>
* class.cs (TypeManager.DefineType): When defining a nested type,
call DefineType() on our parent; fixes #47801.
2003-08-22 Martin Baulig <martin@ximian.com>
* class.cs (MethodData.Define): While checking if a method is an
interface implementation, improve the test a bit more to fix #47654.
2003-08-22 Martin Baulig <martin@ximian.com>
* expression.cs (Probe.DoResolve): Check whether `expr' resolved
correctly; fixes #47722.
2003-08-22 Martin Baulig <martin@ximian.com>
* expression.cs (UnaryMutator.ResolveVariable): If the target is a
LocalVariableReference, ensure it's not read-only. Fixes #47536.
* statement.cs (Fixed.DoResolve): Make all variables read-only.
2003-08-22 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
can only be assigned in static constructors. Fixes #47161.
2003-08-22 Martin Baulig <martin@ximian.com>
Rewrote and improved the flow analysis code.
* flowbranching.cs (FlowBranching): Make this class abstract.
(FlowBranching.CreateBranching): New static function to create a
new flow branching.
(FlowBranchingBlock, FlowBranchingException): New classes.
(FlowBranching.UsageVector.Type): New public readonly field.
(FlowBranching.UsageVector.Breaks): Removed the setter.
(FlowBranching.UsageVector.Returns): Removed the setter.
(FlowBranching.UsageVector): Added Break(), Return(),
NeverReachable() and Throw() methods to modify the reachability.
(FlowBranching.UsageVector.MergeChildren): Removed, this is now
done by FlowBranching.Merge().
(FlowBranching.UsageVector.MergeChild): New method; merges the
merge result into the current vector.
(FlowBranching.Merge): New abstract method to merge a branching.
2003-08-12 Martin Baulig <martin@ximian.com>
* expression.cs (Indirection.CacheTemporaries): Create the
LocalTemporary with the pointer type, not its element type.
2003-08-10 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
token was a keyword or not.
Add `error' options where an IDENTIFIER was expected; Provide
CheckToken and CheckIdentifierToken convenience error reporting
functions.
Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
* decl.cs: Rename `NamespaceEntry Namespace' public field into
NameSpaceEntry NameSpaceEntry.
(LookupInterfaceOrClass): Avoid creating a full qualified name
from namespace and name: avoid doing lookups when we know the
namespace is non-existant. Use new Tree.LookupByNamespace which
looks up DeclSpaces based on their namespace, name pair.
* driver.cs: Provide a new `parser verbose' to display the
exception thrown during parsing. This is turned off by default
now, so the output of a failure from mcs is more graceful.
* namespace.cs: Track all the namespaces defined in a hashtable
for quick lookup.
(IsNamespace): New method
2003-08-09 Miguel de Icaza <miguel@ximian.com>
* namespace.cs: Remove redundant call; Avoid using MakeFQN when
we know that we need to concatenate (full typename can never be
null).
* class.cs: ditto.
* statement.cs: Use a bitfield; Do not initialize to null things
which are done by the constructor by default.
* cs-parser.jay: bug fix, parameter was 4, not 3.
* expression.cs: Just use the property;
* statement.cs: No need for GetVariableInfo method.
2003-08-08 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowReturns): This is now nested in the
`FlowBranching' class.
(MyBitVector): Moved this here from statement.cs.
(FlowBranching.SiblingType): New enum type.
(FlowBranching.CreateSibling): Added `SiblingType' argument.
2003-08-07 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowBranchingType): This is now nested in the
`FlowBranching' class and called `BranchingType'.
2003-08-07 Martin Baulig <martin@ximian.com>
* flowanalysis.cs: Moved all the control flow analysis code into
its own file.
2003-08-07 Martin Baulig <martin@ximian.com>
* assign.cs (Assign.DoResolve): `target' must either be an
IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
#37319.
2003-08-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (BinaryMethod): This kind of expression is created by the
Binary class if it determines that the operator has to be handled
by a method.
(BinaryDelegate): This kind of expression is created if we are
dealing with a + or - operator on delegates.
(Binary): remove method, argumetns, and DelegateOperator: when
dealing with methods,
* ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
* statement.cs (Block): use bitfields for the three extra booleans
we had in use. Remove unused topblock parameter.
* codegen.cs: Remove unecessary argument to Block.EmitTopBlock
* assign.cs: Drop extra unneeded tests.
2003-08-06 Miguel de Icaza <miguel@ximian.com>
* iterators.cs (Mapvariable): provide a mechanism to use prefixes.
* statement.cs (Foreach): Use VariableStorage instead of
LocalBuilders.
* codegen.cs (VariableStorage): New class used by clients that
require a variable stored: locals or fields for variables that
need to live across yield.
Maybe provide a convenience api for EmitThis+EmitLoad?
(GetTemporaryLocal, FreeTemporaryLocal): Recycle
these bad boys.
2003-08-05 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
RemapParameterLValue): New methods that are used to turn a
precomputed FieldInfo into an expression like this:
instance.FieldInfo
The idea is to use this instead of making LocalVariableReference
have more than one meaning.
* cs-parser.jay: Add error production to BASE.
* ecore.cs: Deal with TypeManager.GetField returning null, which
is now a valid return value.
(FieldExprNoAddress): New expression for Fields whose address can
not be taken.
* expression.cs (LocalVariableReference): During the resolve
phases, create new expressions if we are in a remapping context.
Remove code that dealt with remapping here.
(ParameterReference): same.
(ProxyInstance): New expression, like the `This' expression, but
it is born fully resolved. We know what we are doing, so remove
the errors that are targeted to user-provided uses of `this'.
* statement.cs (Foreach): our variable is now stored as an
Expression; During resolution, follow the protocol, dont just
assume it will return this.
2003-08-06 Martin Baulig <martin@ximian.com>
* support.cs (SeekableStreamReader.cs): New public class.
* cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
SeekableStreamReader instead of the normal StreamReader.
2003-08-04 Martin Baulig <martin@ximian.com>
* cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
deambiguate casts and delegate invocations.
(parenthesized_expression): Use the new tokens to ensure this is
not a cast of method invocation.
* cs-tokenizer.cs (is_punct): Return one of the new special tokens
when reading a `)' and Deambiguate_CloseParens () was previously
called.
* expression.cs (ParenthesizedExpression): New class. This is
just used for the CS0075 test.
(Binary.DoResolve): Check for CS0075.
2003-07-29 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation.MakeUnionSet): Patch from Lluis
Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
reference comparison.
(TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
examine the ReturnType for equality - this is necessary in the
cases of implicit and explicit operators whose signature also
includes the return type.
2003-07-26 Miguel de Icaza <miguel@ximian.com>
* namespace.cs: Cache the result of the namespace computation,
instead of computing it every time.
2003-07-24 Miguel de Icaza <miguel@ximian.com>
* decl.cs: Use a global arraylist that we reuse over invocations
to avoid excesive memory consumption. Reduces memory usage on an
mcs compile by one meg (45 average).
* typemanager.cs (LookupTypeReflection): In .NET pointers are
private, work around that.
2003-07-23 Miguel de Icaza <miguel@ximian.com>
* literal.cs (IntLiteral): Define Zero and One static literals.
* cs-parser.jay (integer_literal): use static literals to reduce
memory usage for the most used literals (0, 1 and -1). 211kb
reduced in memory usage.
Replace all calls to `new ArrayList' with `new
ArrayList(4)' which is a good average number for most allocations,
and also requires only 16 bytes of memory for its buffer by
default.
This reduced MCS memory usage in seven megabytes for the RSS after
bootstrapping.
2003-07-28 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation.OverloadResolve): Fix the algorithm to
handle params methods the correct way by forming only one
applicable set with params and normal methods in them. Earlier we
were looking at params methods only if we found no normal methods
which was not the correct thing to do.
(Invocation.BetterFunction): Take separate arguments indicating
when candidate and the best method are params methods in their
expanded form.
This fixes bugs #43367 and #46199.
* attribute.cs: Documentation updates.
(CheckAttribute): Rename to CheckAttributeTarget.
(GetValidPlaces): Rename to GetValidTargets.
* expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
Fixes bug #44468.
2003-07-28 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Compute IsGeneric correctly.
* cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
resolution.
Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
regressions, and I was chasing more bugs than I required.
* interface.cs: Use expressions for base type names (like classes
and structs have been doing for a while now), and resolve that.
This patch should probably go into head as well.
This makes it one less user of FindType.
2003-07-24 Miguel de Icaza <miguel@ximian.com>
This compiler can not self host currently. Need to fix that.
* Makefile: compile to `gmcs.exe'
* driver.cs: Turn on v2 by default on gmcs.
* generic.cs (ConstructedType): Does no longer take a container
type argument; That will be taken care of later.
(ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
Use SimpleName to resolve for now, so we can continue the work on
the parser, until we get Type.GetType that understands generics.
(ConstructedType.ToString): Implement
(TypeArguments.Resolve): Resolve the child expressions as types.
* cs-parser.jay: Rename interface_constraints to
type_parameter_constraints
(namespace_or_type_name): Only use constructed types for the basic
construction, we will deal with identifier<...> later.
(type/type_name): No longer call DecomposeQI, as
namespace_or_type_name is always decoded now.
2003-07-22 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation.OverloadResolve): Follow the spec more
closely: we eliminate methods in base types when we have an
applicable method in a top-level type.
Please see section 14.5.5.1 for an exact description of what goes
on.
This fixes bug #45127 and a host of other related to corlib compilation.
* ecore.cs (MethodGroupExpr.DeclaringType): The element in the
array is the method corresponding to the top-level type (this is
because of the changes made to icall.c) so we change this
accordingly.
(MethodGroupExpr.Name): This too.
* typemanager.cs (GetElementType): New method which does the right
thing when compiling corlib.
* everywhere: Make use of the above in the relevant places.
2003-07-22 Martin Baulig <martin@ximian.com>
* cs-parser.jay (invocation_expression): Moved
`OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
`cast_expression', but create a InvocationOrCast which later
resolves to either an Invocation or a Cast.
* ecore.cs (ExpressionStatement.ResolveStatement): New virtual
method; call this before EmitStatement() to make sure that this
expression can be used as a statement.
* expression.cs (InvocationOrCast): New class; resolves to either
an Invocation or a Cast.
* statement.cs (StatementExpression): Call ResolveStatement() on
the ExpressionStatement before emitting it.
2003-07-21 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.VerifyArgumentsCompat): Check whether
`ref' and `out' attributes match; fixes #46220.
(MemberAccess.ResolveMemberAccess): You can't reference a type
through an expression; fixes #33180.
(Indexers.GetIndexersForType): Don't return the indexers from
interfaces the class implements; fixes #46502.
2003-07-21 Martin Baulig <martin@ximian.com>
* class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
CS0661 checks; fixes bug #30442.
2003-07-21 Martin Baulig <martin@ximian.com>
* decl.cs (AdditionResult): Added `Error'.
* enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
* typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
cs0031.cs actually work.
2003-07-20 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (namespace_name): do not use
namespace_or_type_name, use qualified_identifier, because
namespace_or_type_name will soon return a composed expression
instead of a string.
(namespace_or_type_name): Instead of returning a string, now this
production returns an expression.
* codegen.cs (EmitContext): Setup IsGeneric property based on
whether our DeclSpace is generic, our the method is generic.
* modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
the method is generic.
* cs-parser.jay (type_arguments, opt_type_argument_list,
type_parameters, type_parameter_list, opt_type_parameter_list,
type_parameter,, opt_type_parameter_constraints_clauses,
type_parameter_constraints_clauses,
type_parameter_constraint_clause, type_parameter_constraint,
interface_constraints): Add new production
* decl.cs (DeclSpace): IsGeneric, flag to track whether this
DeclSpace is generic or not.
(DeclSpace.SetParameterInfo): New routine, used to set the
parameter info for a type.
(DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
returns a GenericTypeExpr
* ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
generic, lookup the generic argument.
* attribute.cs: Do not allow TypeParameterExpressions in
Attributes.
* class.cs: Do not allow the Main method to be defined in a
Generic container.
* expression.cs (SizeOf): Do not allow generic types to be used as
arguments to sizeof.
* typemanager.cs (IsGeneric): Wrapper for Reflection when we have
it: whether a type is generic or not. Only works for types we are
currently building for now.
2003-07-20 Martin Baulig <martin@ximian.com>
* namespace.cs: Fixed that bug which caused a crash when compiling
the debugger's GUI.
2003-07-20 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (LookupTypeReflection): Never expose types which
are NotPublic, NestedPrivate, NestedAssembly, or
NestedFamANDAssem. We used to return these, and later do a check
that would report a meaningful error, but the problem is that we
would not get the real match, if there was a name override.
2003-07-18 Miguel de Icaza <miguel@ximian.com>
* namespace.cs (Namespace, Name): Do not compute the namespace
name dynamically, compute it in the constructor. This reduced
memory usage by 1697 KB.
* driver.cs: Use --pause to pause at the end.
2003-07-17 Peter Williams <peter@newton.cx>
* Makefile: Change the name of the test target so that it doesn't
conflict with the recursive test target.
2003-07-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LocalVariableReference.Emit, EmitAssign,
AddressOf): Do not use EmitThis, that was wrong, use the actual
this pointer.
2003-07-15 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodData.Define): While checking if a method is an
interface implementation, improve the test: If we are not public
(use new test here: use the computed MethodAttributes directly,
instead of the parsed modifier flags) check if the `implementing'
method comes from an interface or not.
* pending.cs (VerifyPendingMethods): Slightly better error
message.
* makefile: add test target that does the mcs bootstrap.
2003-07-16 Ravi Pratap <ravi@ximian.com>
* interface.cs (Define): Do nothing here since there are no
members to populate etc. Move the attribute emission out of here
since this was just totally the wrong place to put it. Attribute
application happens during the 'Emit' phase, not in the 'Define'
phase.
(Emit): Add this method and move the attribute emission here
* rootcontext.cs (EmitCode): Call the Emit method on interface
types too.
2003-07-14 Ravi Pratap M <ravi@ximian.com>
* expression.cs (OverloadResolve): Report error only if Location
is not 'Null' which means that there was a probe going on.
2003-07-14 Martin Baulig <martin@ximian.com>
* expression.cs (ConditionalLogicalOperator): New public class to
implement user defined conditional logical operators.
This is section 14.11.2 in the spec and bug #40505.
2003-07-14 Martin Baulig <martin@ximian.com>
* ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
2003-07-14 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext.InFixedInitializer): New public field.
* ecore.cs (IVariable.VerifyFixed): New interface method.
* expression.cs (Unary.ResolveOperator): When resolving the `&'
operator, check whether the variable is actually fixed. Fixes bug
#36055. Set a variable definitely assigned when taking its
address as required by the spec.
* statement.cs (LocalInfo.IsFixed): New field.
(LocalInfo.MakePinned): Set `IsFixed' to true.
2003-07-14 Ravi Pratap M <ravi@ximian.com>
* attribute.cs (Attribute.Resolve): While doing a Member lookup
for .ctors, ensure that we only ask for members declared in the
attribute type (BindingFlags.DeclaredOnly).
Fixes bug #43632.
* expression.cs (Error_WrongNumArguments): Report error 1501
correctly the way CSC does.
2003-07-13 Martin Baulig <martin@ximian.com>
* expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
lookup on the fully qualified name, to make things like "X.X" work
where "X.X" is a fully qualified type name, but we also have a
namespace "X" in the using list. Fixes #41975.
2003-07-13 Martin Baulig <martin@ximian.com>
* assign.cs (Assign.GetEmbeddedAssign): New protected virtual
function. If we're a CompoundAssign, we need to create an embedded
CompoundAssign, not an embedded Assign.
(Assign.DoResolve): Make this work for embedded CompoundAssign's.
Fixes #45854.
2003-07-13 Martin Baulig <martin@ximian.com>
* typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
work to fix bug #46088.
2003-07-13 Ravi Pratap <ravi@ximian.com>
* class.cs (Operator.Emit): Do not emit attributes here - it is
taken care of by the Method class that we delegate too. This takes
care of bug #45876.
2003-07-10 Martin Baulig <martin@ximian.com>
* expression.cs (TypeOfVoid): New class.
(TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
2003-07-10 Martin Baulig <martin@ximian.com>
* class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
bug #35957.
2003-07-10 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
* decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
* typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
2003-07-10 Martin Baulig <martin@ximian.com>
* expression.cs (ArrayCreation): Don't use a byte blob for arrays
of decimal. Fixes #42850.
NOTE: I also fixed the created byte blob, but this doesn't work on
the MS runtime and csc never produces any byte blobs for decimal
arrays.
2003-07-10 Martin Baulig <martin@ximian.com>
* statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
structs; fixes #32068.
(Block.AddChildVariableNames): Fixed #44302.
2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* namespace.cs: fixed compilation with csc. It's bugzilla #44302.
2003-07-07 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: And this test is onger needed.
2003-07-08 Martin Baulig <martin@ximian.com>
* rootcontext.cs (RootContext.NamespaceLookup): Ignore
inaccessible types. Fixes #36313.
* decl.cs (DeclSpace.FindType): Ignore inaccessible types.
* namespace.cs (NamespaceEntry): Create implicit entries for all
namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
implicit entries for N1.N2 and N1.
2003-07-08 Martin Baulig <martin@ximian.com>
Rewrote the handling of namespaces to fix a lot of the issues
wrt. `using' aliases etc.
* namespace.cs (Namespace): Splitted this class into a
per-assembly `Namespace' and a per-file `NamespaceEntry'.
* typemanager.cs (TypeManager.IsNamespace): Removed.
(TypeManager.ComputeNamespaces): Only compute namespaces from
loaded assemblies here, not the namespaces from the assembly we're
currently compiling.
2003-07-08 Martin Baulig <martin@ximian.com>
* rootcontext.cs, class.cs: Fixed the CS1530 reporting.
2003-07-07 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Reverted patch from Gonzalo, my previous patch
already fixed it.
I thought about the memory savings here, but LookupTypeReflection
is used under already very constrained scenarios. Compiling
corlib or mcs only exposes one hit, so it would not really reduce
any memory consumption.
2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* typemanager.cs: fixes bug #45889 by only adding public types from
other assemblies to the list of known types.
2003-07-07 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
on the type we resolved.
2003-07-05 Martin Baulig <martin@ximian.com>
* pending.cs (PendingImplementation.ParentImplements): Don't
create the proxy if the parent is abstract.
* class.cs (TypeContainer.DefineIndexers): Process explicit
interface implementations first. Fixes #37714.
2003-07-04 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberAccess.ResolveMemberAccess): Events are
defined recursively; but since we modify the input parameters
(left is set to `this' temporarily), we reset this value if the
left_is_explicit is false, which gives the original semantics to
the code.
* literal.cs (NullPointer): new class used to represent a null
literal in a pointer context.
* convert.cs (Convert.ImplicitReferenceConversion): Is the target
type is a pointer, use a NullPointer object instead of a
NullLiteral. Closes 43687
(ExplicitConversion): Convert pointer values using
the conv opcode to the proper type.
* ecore.cs (New): change ValueTypeVariable property into a method,
that returns whether the valuetype is suitable for being used.
* expression.cs (Binary.DoNumericPromotions): Only return if we
the int constant was a valid uint, and we can return both left and
right as uints. If not, we continue processing, to trigger the
type conversion. This fixes 39018.
* statement.cs (Block.EmitMeta): During constant resolution, set
the CurrentBlock property on the emitcontext, so that we resolve
constants propertly.
2003-07-02 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
(EmitContext.EmitTopBlock): Emit an explicit return if it's set.
* statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
than emitting it here.
* statement.cs: Fixed some more flow analysis bugs.
2003-07-02 Martin Baulig <martin@ximian.com>
* class.cs (MethodData.Define): When implementing interface
methods, set Final unless we're Virtual.
* decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
check work for interface methods.
2003-07-01 Martin Baulig <martin@ximian.com>
* ecore.cs (EmitContext.This): Replaced this property with a
GetThis() method which takes a Location argument. This ensures
that we get the correct error location for a CS0188.
2003-07-01 Miguel de Icaza <miguel@ximian.com>
* ecore.cs: (Convert.ConvertIntLiteral): Add test for
ImplicitStandardConversion.
* class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
2003-07-01 Zoltan Varga <vargaz@freemail.hu>
* expression.cs (ResolveOperator): Fix Concat (string, string, string)
optimization.
2003-06-30 Miguel de Icaza <miguel@ximian.com>
* class.cs (Constructor.Define): Turn off initlocals for unsafe
constructors.
(MethodData.Define): Turn off initlocals for unsafe methods.
2003-06-29 Miguel de Icaza <miguel@ximian.com>
* decl.cs (DeclSpace.CheckAccessLevel): Make this routine
complete; Fixes #37521.
* delegate.cs: Use Modifiers.TypeAttr to compute the
TypeAttributes, instead of rolling our own. This makes the flags
correct for the delegates.
2003-06-28 Miguel de Icaza <miguel@ximian.com>
* class.cs (Constructor.Define): Set the private flag for static
constructors as well.
* cs-parser.jay (statement_expression): Set the return value to
null, to avoid a crash when we catch an error.
2003-06-24 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Applied patch from Jackson that adds support for
extern and unsafe modifiers to destructor declarations.
* expression.cs: Report error 21 if the user is trying to index a
System.Array.
* driver.cs: Add an error message, suggested by the bug report.
* class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
if we do not have a ": this ()" constructor initializer. Fixes 45149
2003-06-14 Miguel de Icaza <miguel@ximian.com>
* namespace.cs: Add some information to reduce FAQs.
2003-06-13 Miguel de Icaza <miguel@ximian.com>
* cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
underlying enumeration types. Fixes #43915.
* expression.cs: Treat ushort/short as legal values to be used in
bitwise operations.
Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
* delegate.cs: transfer custom attributes for paramenters from
the delegate declaration to Invoke and BeginInvoke.
Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
* attribute.cs: handle custom marshalers and emit marshal info
for fields, too.
2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
* makefile.gnu: Added anonymous.cs to the compiler sources.
2003-05-28 Miguel de Icaza <miguel@ximian.com>
* iterators.cs: Change the name of the proxy class to include two
underscores.
* cs-parser.jay: Update grammar to include anonymous methods.
* anonymous.cs: new file.
2003-05-27 Miguel de Icaza <miguel@ximian.com>
* class.cs (Field.Define): Add missing test for pointers and
safety.
2003-05-27 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
we use the stobj opcode.
(ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
since it wasn't the correct fix.
It still is puzzling that we are required to use stobj for IntPtr
which seems to be a ValueType.
2003-05-26 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
during regular simple name resolution. Now, the trick is that
instead of returning for processing the simplename, we do a
TypeManager.LookupType (ie, a rooted lookup as opposed to a
contextual lookup type). If a match is found, return that, if
not, return for further composition.
This fixes long-standing 30485.
* expression.cs (ArrayCreation.EmitDynamicInitializers): When
using the address to initialize an object, do an Stobj instead of
using the regular Stelem.
(IndexerAccess.Emit, IndexerAccess.EmitAssign):
Pass `is_base_indexer' to Invocation.EmitCall instead of false.
Because if we are a BaseIndexerAccess that value will be true.
Fixes 43643.
* statement.cs (GotoCase.Resolve): Return after reporting an
error, do not attempt to continue.
* expression.cs (PointerArithmetic.Emit): If our operand is a
long, convert our constants to match the operand before
multiplying. Convert to I type before adding. Fixes 43670.
2003-05-14 Ravi Pratap <ravi@ximian.com>
* enum.cs (ImplicitConversionExists) : Rename to
ImplicitEnumConversionExists to remove ambiguity.
* ecore.cs (NullCast): New type of cast expression class which
basically is very similar to EmptyCast with the difference being
it still is a constant since it is used only to cast a null to
something else
(eg. (string) null)
* convert.cs (ImplicitReferenceConversion): When casting a null
literal, we return a NullCast.
* literal.cs (NullLiteralTyped): Remove - I don't see why this
should be around anymore.
The renaming (reported was slightly wrong). Corrections:
ConvertImplicitStandard -> ImplicitConversionStandard
ConvertExplicitStandard -> ExplicitConversionStandard
* expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
before passing them in !
* convert.cs (ImplicitConversionStandard): When comparing for
equal expr and target types, ensure that expr is not a
NullLiteral.
In general, we must not be checking (expr_type ==
target_type) in the top level conversion methods
(ImplicitConversion, ExplicitConversion etc). This checking is
done in the methods that they delegate to.
2003-05-20 Miguel de Icaza <miguel@ximian.com>
* convert.cs: Move Error_CannotConvertType,
ImplicitReferenceConversion, ImplicitReferenceConversionExists,
ImplicitNumericConversion, ImplicitConversionExists,
ImplicitUserConversionExists, StandardConversionExists,
FindMostEncompassedType, FindMostSpecificSource,
FindMostSpecificTarget, ImplicitUserConversion,
ExplicitUserConversion, GetConversionOperators,
UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
TryImplicitIntConversion, Error_CannotConvertImplicit,
ConvertImplicitRequired, ConvertNumericExplicit,
ExplicitReferenceConversionExists, ConvertReferenceExplicit,
ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
its own file.
Perform the following renames:
StandardConversionExists -> ImplicitStandardConversionExists
ConvertImplicit -> ImplicitConversion
ConvertImplicitStandard -> ImplicitStandardConversion
TryImplicitIntConversion -> ImplicitIntConversion
ConvertImplicitRequired -> ImplicitConversionRequired
ConvertNumericExplicit -> ExplicitNumericConversion
ConvertReferenceExplicit -> ExplicitReferenceConversion
ConvertExplicit -> ExplicitConversion
ConvertExplicitStandard -> ExplicitStandardConversion
2003-05-19 Martin Baulig <martin@ximian.com>
* statement.cs (TypeInfo.StructInfo): Made this type protected.
(TypeInfo): Added support for structs having structs as fields.
* ecore.cs (FieldExpr): Implement IVariable.
(FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
VariableInfo for the field.
2003-05-18 Martin Baulig <martin@ximian.com>
* expression.cs (This.DoResolve): Report a CS0027 if we're
emitting a field initializer.
2003-05-18 Martin Baulig <martin@ximian.com>
* expression.cs (This.ResolveBase): New public function.
(This.DoResolve): Check for CS0188.
* codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
This.Resolve().
* ecore.cs (MethodGroupExpr.DoResolve): Set the
`instance_expression' to null if we don't have any non-static
methods.
2003-05-18 Martin Baulig <martin@ximian.com>
Reworked the way how local variables and parameters are handled by
the flow analysis code.
* statement.cs (TypeInfo, VariableMap): New public classes.
(VariableInfo): New public class. This is now responsible for
checking whether a variable has been assigned. It is used for
parameters and local variables.
(Block.EmitMeta): Take the InternalParameters as argument; compute
the layout of the flow vectors here.
(Block.LocalMap, Block.ParameterMap): New public properties.
(FlowBranching): The .ctor doesn't get the InternalParameters
anymore since Block.EmitMeta() now computes the layout of the flow
vector.
(MyStructInfo): This class is now known as `StructInfo' and nested
in `TypeInfo'; we don't access this directly anymore.
* ecore.cs (IVariable): Added `VariableInfo VariableInfo'
property and removed IsAssigned(), IsFieldAssigned(),
SetAssigned() and SetFieldAssigned(); we now call them on the
VariableInfo so we don't need to duplicate this code everywhere.
* expression.cs (ParameterReference): Added `Block block' argument
to the .ctor.
(LocalVariableReference, ParameterReference, This): The new
VariableInfo class is now responsible for all the definite
assignment stuff.
* codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
IsParameterAssigned, SetParameterAssigned): Removed.
2003-05-18 Martin Baulig <martin@ximian.com>
* typemanager.cs (InitCoreTypes): Try calling
SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
the 3-args-version. Corlib now also needs our `void_type'.
(GetMethod): Added overloaded version which takes an optional
`bool report_errors' to allow lookups of optional methods.
2003-05-12 Martin Baulig <martin@ximian.com>
* statement.cs (VariableInfo): Renamed to LocalInfo since it's
only used for locals and not for parameters.
2003-05-12 Miguel de Icaza <miguel@ximian.com>
* support.cs (InternalParameters.ParameterType): Return the
ExternalType of the parameter.
* parameter.cs (Parameter.ExternalType): drop the two arguments,
they were unused.
2003-05-11 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodData.Define): Do not set the `newslot' on
interface members, if they are also flagged as "override".
* expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
better code for ++i and i++. This only works for static fields
and local variables.
* typemanager.cs (LookupDeclSpace): Add new method, sometimes we
want to pull the DeclSpace out of the builder_to_declspace instead
of the TypeBuilder (like in TypeContainer.FindMembers).
* class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
instead of LookupTypeContainer. Fixes the crash on .NET for
looking up interface members.
* const.cs: Create our own emit context during the Definition
stage, so that constants are evaluated in the proper context, when
a recursive definition happens.
2003-05-11 Martin Baulig <martin@ximian.com>
* statement.cs (Block.CreateSwitchBlock): New method. Creates a
new block for a switch section.
(Block.AddLabel, Block.LookupLabel): If we're a switch section, do
the adding/lookup in the switch block. Fixes #39828.
2003-05-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
functionality: I needed to convert the data after I had performed
the add/sub operation into the operands type size.
* ecore.cs (ImplicitReferenceConversion): When boxing an interface
pass the type for the box operation, otherwise the resulting
object would have been of type object.
(BoxedCast): Add constructor to specify the type to box as.
2003-05-07 Miguel de Icaza <miguel@ximian.com>
* iterators.cs: I was reusing the `count' variable inadvertently,
take steps to not allow this to happen.
2003-05-06 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attribute.Resolve): Params attributes are encoded
by creating an array at the point where the params starts and
putting all those arguments there, then adjusting the size of the
array.
2003-05-05 Miguel de Icaza <miguel@ximian.com>
* expression.cs (New.AddressOf): Implement interface
IMemoryLocation. This is used when the `new' operator is used in
the context of an invocation to a method on a value type.
See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
example.
* namespace.cs: Also check the using aliases here.
* driver.cs: Move the test for using validity after the types have
been entered, so we do a single pass that also includes the using
aliases.
* statement.cs (Try.Resolve): Avoid crashing if there is a failure
in the regular case. CreateSiblingForFinally is doing extra
error checking.
* attribute.cs (GetAttributeArgumentExpression): Store the result
on an out value, and use the return value to indicate failure
instead of using null (which is a valid return for Constant.GetValue).
* statement.cs: Perform the analysis flow for the increment
portion after the statement, because this will be the real flow of
execution. Fixes #42385
* codegen.cs (EmitContext.EmitArgument,
EmitContext.EmitStoreArgument): New helper functions when the
RemapToProxy flag is set.
* expression.cs (ParameterReference.EmitLdarg): Expose this useful
function.
Add support for remapping parameters.
* iterators.cs: Propagate parameter values; Store parameter
values in the proxy classes.
2003-05-04 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
need a proxy reference; I do not know what I was thinking
* cs-parser.jay (constructor_initializer): catch another error,
and display nice message.
(field_declaration): catch void field declaration
to flag a better error.
* class.cs (MemberBase.CheckBase): Report an error instead of a
warning if a new protected member is declared in a struct.
(Field.Define): catch the error of readonly/volatile.
* ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
(FieldExpr.AddressOf): ditto. Catch error where the address of a
volatile variable is taken
2003-05-02 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Fixed.Resolve): Report an error if we are not in
an unsafe context.
2003-05-01 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: reuse the code that handles type clashes for
delegates and enumerations.
* class.cs (Report28): Always report.
* expression.cs (EncodeAsAttribute): Allow nulls here.
2003-04-28 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
the functionality for testing whether an expression is valid for
an attribute here. Also handle the case of arrays of elements
being stored.
* expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
encoding a linear array into an array of objects that are suitable
to be passed to an CustomAttributeBuilder.
* delegate.cs: Check unsafe types being used outside of an Unsafe context.
* ecore.cs: (FieldExpr): Handle field remapping here.
* iteratators.cs: Pass the instance variable (if the method is an
instance method) to the constructors, so we can access the field
variables on the class.
TODO: Test this with structs. I think the THIS variable on
structs might have to be a pointer, and not a refenrece
2003-04-27 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
local variables to fields in a proxy class.
* iterators.cs (PopulateProxy): Rename our internal fields to
<XXX>.
Create a <THIS> field if we are an instance method, so we can
reference our parent container variables.
(MapVariable): Called back from the EmitContext code to enter a
new variable to field mapping into the proxy class (we just create
a FieldBuilder).
* expression.cs
(LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
for using the remapped locals to fields.
I placed the code here, because that gives the same semantics to
local variables, and only changes the Emit code.
* statement.cs (Fixed.Resolve): it is not allowed to have fixed
statements inside iterators.
(VariableInfo): Add a FieldBuilder for the cases when we are
remapping local variables to fields in a proxy class
* ecore.cs (SimpleNameResolve): Avoid testing two times for
current_block != null.
* statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
not cope with strings, as it has been moved to the
TableSwitchEmit. Fixed bug in switch generation.
* expression.cs (New.DoResolve): Provide more context for the user
when reporting an error.
* ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
pointers.
* expression.cs (MemberAccess.DoResolve): When we get a type back,
check the permissions for it. Note than in a type-resolution
context the check was already present in DeclSpace.ResolveType,
but was missing from the MemberAccess.
(ArrayCreation.CheckIndices): warn if the user has
more nested levels of expressions, but there are no more
dimensions specified. Avoids crash on bug 41906.
2003-04-26 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Block): replace Implicit bool, for a generic
flags.
New flag: `Unchecked'. This is used during the EmitMeta phase
(which is out-of-line with the regular Resolve/Emit process for a
statement, as this is done ahead of time, but still gets a chance
to call constant resolve).
(Block.Flags): new enum for adding a new flag.
(Block.EmitMeta): track the state of unchecked.
(Unchecked): Set the "UnChecked" flags on any blocks we enclose,
to enable constant resolution to work there as well.
2003-04-22 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (ienumerable_type): Also look up
System.Collections.IEnumerable.
2003-04-21 Miguel de Icaza <miguel@ximian.com>
TODO: Test more than one conditional per method.
* class.cs (Indexer.Define): Report the location where the user is
referencing the unsupported feature.
(MethodData): Overload the use of `conditionals' to
minimize the creation of needless ArrayLists. This saves roughly
212kb on my machine.
(Method): Implement the new IIteratorContainer interface.
(Method.SetYields): Implement the method by setting the ModFlags
to contain METHOD_YIELDS.
* expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
which just got set to null.
* iterators.cs: New file.
(Yield, YieldBreak): New statements.
* statement.cs (Return.Resolve): Flag an error if we are used in
an iterator method.
* codegen.cs (InIterator): New flag set if the code is being
compiled in an iterator method.
* modifiers.cs: New flag METHOD_YIELDS. This modifier is an
internal modifier, and we just use it to avoid adding extra
fields, as this is seldom used.
* cs-parser.jay: Add yield_statement (yield and yield break).
* driver.cs: New flag -v2 to turn on version 2 features.
* cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
hashtable when v2 is enabled.
2003-04-20 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (TypeManager.NamespaceClash): Use to check if
there is already a namespace defined with this name.
(TypeManager.InitCoreTypes): Remove the temporary workaround, as
people upgraded their corlibs.
(TypeManager.CoreLookupType): Use LookupTypeDirect, as we
always use fully qualified types, no need to use the compiler
front end.
(TypeManager.IsNamespace): Use binarysearch.
* class.cs (AddClass, AddStruct, AddInterface, AddEvent,
AddDelegate): I did not quite use the new IsValid API properly: I
have to pass the short-name and the fullname. I was passing only
the basename instead of the fullname sometimes.
(TypeContainer.DefineType): call NamespaceClash.
* interface.cs (Interface.DefineType): use NamespaceClash before
defining the type.
* delegate.cs (Delegate.DefineType): use NamespaceClash before
defining the type.
* enum.cs: (Enum.DefineType): use NamespaceClash before
defining the type.
* typemanager.cs (: 3-line patch that gives us some tasty 11%
speed increase. First, use the negative_hits cache when we get a
negative. Second, add the type with its full original name
instead of the new . and + encoded name (reflection uses + to
separate type from a nested type). Use LookupTypeReflection
directly which bypasses the type->name hashtable (that we already
know does not contain the type.
* decl.cs (DeclSpace.ResolveTypeExpr): track the
location/container type.
* driver.cs: When passing utf8, use directly the UTF8Encoding.
2003-04-19 Miguel de Icaza <miguel@ximian.com>
* decl.cs (ResolveTypeExpr): Mirror check acess here too.
* delegate.cs (NewDelegate.Resolve): Test whether an instance
method is being referenced in the method group from a static
context, and report error 120 if so.
* expression.cs, ecore.cs (Error_UnexpectedKind): New name for
Error118.
* typemanager.cs: Add intermediate namespaces (if a namespace A.B
is created, we create the A namespace).
* cs-parser.jay: A namespace also introduces a DeclarationFound.
Fixes #41591
2003-04-18 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (GetReferenceType, GetPointerType): In .NET each
invocation to ModuleBuilder.GetType with the same values will
return a new type instance, so we need to cache its return
values.
* expression.cs (Binary.ResolveOperator): Only allow the compare
operators on enums if they are of the same type.
* ecore.cs (Expression.ImplicitReferenceConversion): handle target
types of ValueType on their own case. Before we were giving them
the same treatment as objects.
* decl.cs (DeclSpace.IsValid): IsValid takes the short name and
fullname. Short name is used to compare against container name.
Fullname is used to check against defined namespace names.
* class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
(Method.CheckBase): Call parent.
(MemberBase.CheckBase): Check for protected members on sealed
classes.
(PropertyBase.CheckBase): Call parent.
(Field.Define): Call parent.
* report.cs: Negative error codes are now mapped to 8000 - code,
so that the display is render more nicely.
* typemanager.cs: Do not use try/catch, instead report a regular
error.
(GetPointerType, GetReferenceType): These methods provide
mechanisms to obtain the T* and T& from a T. We had the code
previously scattered around the code base, and it also used
TypeManager.LookupType that would go through plenty of caches.
This one goes directly to the type source.
In some places we did the Type.GetType followed by
ModuleBuilder.GetType, but not in others, so this unifies the
processing as well.
* namespace.cs (VerifyUsing): Perform a non-lazy approach to using
statements now that we have namespace information.
* typemanager.cs (IsNamespace): New method, returns whether the
string presented is a namespace or not.
(ComputeNamespaces): New public entry point, computes the list of
available namespaces, using the GetNamespaces API call in Mono, or
the slower version in MS.NET.
Now before we start the semantic analysis phase, we have a
complete list of namespaces including everything that the user has
provided.
Deleted old code to cache namespaces in .nsc files.
2003-04-17 Miguel de Icaza <miguel@ximian.com>
* class.cs: (TypeContainer.DefineDefaultConstructor): Use the
class/struct location definition Location for the implicit
constructor location.
(Operator.Define): Use the location of the operator for the
implicit Method definition.
(Constructor.Emit): use the constructor location for the implicit
base initializer constructor.
* ecore.cs: Remove ITypeExpression. This interface is now gone,
and the Expression class now contains two new methods:
ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
isolate type lookup from the rest of the resolution process.
Since we use Expressions to hold type definitions due to the way
we parse the input we have historically overloaded Resolve to
perform the Type lookups if a special flag is passed. Now this is
eliminated and two methods take their place.
The differences in the two methods between xStep and xTerminal is
that xStep is involved in our current lookup system that uses
SimpleNames to compose a name, while xTerminal is used just to
catch the case where the simplename lookup failed.
2003-04-16 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ResolveMemberAccess): Remove redundant code.
TypeExpr expressions are always born fully resolved.
* interface.cs (PopulateMethod): Do not lookup the types twice.
We were doing it once during SemanticAnalysis and once during
PopulateMethod.
* cs-parser.jay: Due to our hack in the grammar, things like A.B[]
in local variable type definitions, were being returned as a
SimpleName (we decomposed everything into a string), that is
because primary_expression was being used instead of a type in the
grammar (reduce/reduce conflicts).
The part that was wrong is that we converted the expression into a
string (an oversimplification in one hand, compounded with primary
expressions doing string concatenation).
So things like:
A.B.C [] x;
Would return "A.B.C[]" as a SimpleName. This stopped things like
using clauses from working on this particular context. And a type
was being matched directly against "A.B.C[]".
We now use the correct approach, and allow for ComposedCast to be
part of the unary expression. So the "A.B.C []" become a composed
cast of "A.B.C" (as a nested group of MemberAccess with a
SimpleName at the end) plus the rank composition "[]".
Also fixes 35567
2003-04-10 Miguel de Icaza <miguel@ximian.com>
* decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
for the access level checking.
* class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
`TypeContainer container', because I kept getting confused when I
was debugging this code.
* expression.cs (Indexers): Instead of tracking getters/setters,
we now track them in parallel. We create one arraylist less, but
most importantly it is possible now for the LValue code to find a
matching get for a set.
(IndexerAccess.DoResolveLValue): Update the code.
GetIndexersForType has been modified already to extract all the
indexers from a type. The code assumed it did not.
Also make the code set the correct return type for the indexer.
This was fixed a long time ago for properties, but was missing for
indexers. It used to be void_type.
(Binary.Emit): Test first for doubles instead of
floats, as they are more common.
(Binary.EmitBranchable): Use the .un version of the branch opcodes
when dealing with floats and the <=, >= operators. This fixes bug
#39314
* statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
to load the array value by emitting a load on the foreach variable
type. This was incorrect.
We now emit the code to load an element using the the array
variable type, and then we emit the conversion operator.
Fixed #40176
2003-04-10 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs: Avoid allocation of ArrayLists in the common case.
2003-04-09 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodSignature.InheritableMemberSignatureCompare):
test for protection before we test for signatures.
(MethodSignature.ToString): implement.
* expression.cs (Unary.TryReduceNegative): Add missing minus sign
to the case where we reduced into a LongConstant.
* decl.cs (CheckAccessLevel): If the type is an array, we can not
depend on whether the information is acurrate, because the
Microsoft runtime will always claim that the array type is public,
regardless of the real state.
If the type is a pointer, another problem happens: the type is
reported as non-public in Microsoft.
In both cases we have to call CheckAccessLevel recursively with
the underlying type as the argument to be tested.
2003-04-08 Miguel de Icaza <miguel@ximian.com>
* assign.cs (Assign.Emit): If we are dealing with a compound
assignment expression, we should use the code path that stores the
intermediate result in a temporary value. This fixes #40903.
*expression.cs (Indirection.ToString): Provide ToString method for
debugging.
2003-04-08 Zoltan Varga <vargaz@freemail.hu>
* class.cs: Null out fields holding references to Block objects so
they can be garbage collected.
* expression.cs (OverloadResolve): Remove unused local.
2003-04-07 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext.CurrentFile): New public field.
(EmitContext.Mark): Use the CurrentFile to check whether the
location is in the correct file.
(EmitContext.EmitTopBlock): Initialize CurrentFile here.
2003-04-07 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
* codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
location. [FIXME: The location argument which gets passed to this
method is sometimes wrong!]
2003-04-07 Nick Drochak <ndrochak@gol.com>
* codegen.cs: Be more verbose when we can't find the symbol writer dll.
2003-04-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Indirection.EmitAssign): We were using the
temporary, but returning immediately instead of continuing the
EmitAssing flow.
2003-04-06 Martin Baulig <martin@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
if it's a nested child, but also deriving from the outer class.
See test 190.cs.
* typemanager.cs (IsNestedChildOf): Make this work if it's a
nested child, but also deriving from the outer class. See
test-190.cs.
(FilterWithClosure): We may access private members of the outer
class if we're a nested child and deriving from the outer class.
(RealMemberLookup): Only set `closure_private_ok' if the
`original_bf' contained BindingFlags.NonPublic.
2003-04-05 Martin Baulig <martin@ximian.com>
* expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
probe if its a type parameter, and if so, flag an error.
* decl.cs: Move here the SetParameterInfo code from class.cs.
Handle IsGeneric here.
Handle a variety of errors in the parameter info definition.
* ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
type parameters here.
* cs-parser.jay (class_declaration): report errors for parameters
here as well.
2003-01-21 Miguel de Icaza <miguel@ximian.com>
* generic.cs: New file, contains support code for generics.
* cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
Update parser for the above removals.
* cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
now taken care of in the parser.
2003-04-02 Miguel de Icaza <miguel@ximian.com>
* class.cs (Event.Define): Do not allow abstract events to have
initializers.
2003-04-01 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add error productions for ADD/REMOVE missing a
block in event declarations.
* ecore.cs (FieldExpr.AddressOf): If our instance expression is a
value type, get its address.
* expression.cs (Is.Emit): For action `LeaveOnStack' we were
leaving a class on the stack instead of a boolean value (int
0/1). Change the code so we compare against null, and then the
result against zero.
* class.cs (TypeContainer.GetClassBases): We were checking for the
parent class being sealed too late.
* expression.cs (Binary.Emit): For <= and >= when dealing with
floating point values, use cgt.un and clt.un instead of cgt and
clt alone.
2003-04-01 Zoltan Varga <vargaz@freemail.hu>
* statement.cs: Apply the same optimization as MS: skip the
GetEnumerator returning an IEnumerator, and use the one returning a
CharEnumerator instead. This allows us to avoid the try-finally block
and the boxing.
2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
* cs-parser.jay: Attributes cannot be applied to
namespaces. Fixes #40473
2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* class.cs:
(Add*): check if the name is valid using the full name for constants,
fields, properties and events.
2003-03-28 Miguel de Icaza <miguel@ximian.com>
* enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
char constants to be part of the enumeration.
* expression.cs (Conditional.DoResolve): Add support for operator
true. Implements the missing functionality from 14.12
* class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
operator true/false as required by the spec.
* expression.cs (Unary.ResolveOperator): In LogicalNot, do an
implicit conversion to boolean.
* statement.cs (Statement.ResolveBoolean): A boolean expression is
also one where the type implements `operator true'.
* ecore.cs (Expression.GetOperatorTrue): New helper routine to
get an expression that will invoke operator true based on an
expression.
(GetConversionOperators): Removed the hack that called op_True
here.
(Expression.ResolveBoolean): Move this from Statement.
2003-03-17 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr): do not allow initialization of initonly
fields on derived classes
2003-03-13 Martin Baulig <martin@ximian.com>
* statement.cs (Block.Emit): Call ig.BeginScope() and
ig.EndScope() when compiling with debugging info; call
LocalBuilder.SetLocalSymInfo _after_ opening the scope.
2003-03-08 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Indexers): Do not construct immediately, allow
for new members to be appended as we go. Fixes 38143
2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* expression.cs: save/restore context when resolving an unchecked
expression.
2003-03-05 Miguel de Icaza <miguel@ximian.com>
* cfold.cs: Catch division by zero in modulus operator during
constant folding.
2003-03-03 Miguel de Icaza <miguel@ximian.com>
* interface.cs (Interface.DefineMembers): Avoid defining members
twice.
2003-02-27 Miguel de Icaza <miguel@ximian.com>
* driver.cs: handle the +/- options for -noconfig
* statement.cs (Unckeched.Resolve): Also track the state of
unchecked in the Resolve phase.
2003-02-27 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.MemberLookup): Don't create a
MethodGroupExpr for something which is not a method. Fixes #38291.
2003-02-25 Miguel de Icaza <miguel@ximian.com>
* class.cs (MemberBase.CheckParameters): Also check that the type
is unmanaged if it is a pointer.
* expression.cs (SizeOf.Resolve): Add location information.
* statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
a managed type is declared.
* expression.cs (Invocation.VerifyArgumentsCompat): Check for the
parameter modifiers as well. Fixes bug 38606
* class.cs: Very sad. Am backing out the speed up changes
introduced by the ArrayList -> Array in the TypeContainer, as they
were not actually that much faster, and introduced a bug (no error
reports on duplicated methods).
* assign.cs (CompoundAssign.DoLResolve): Resolve the original
source first, this will guarantee that we have a valid expression
before calling in lower levels functions that will require a
resolved object. Then use this original_source in the
target.ResolveLValue instead of the original source that was
passed to us.
Another change. Use target.Resolve instead of LValueResolve.
Although we are resolving for LValues, we will let the Assign code
take care of that (it will be called again from Resolve). This
basically allows code like this:
class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
class Y { void A (X x) { x [0] += o; }
The problem was that the indexer was trying to resolve for
set_Item (idx, object o) and never finding one. The real set_Item
was set_Item (idx, X). By delaying the process we get the right
semantics.
Fixes bug 36505
2003-02-23 Martin Baulig <martin@ximian.com>
* statement.cs (Block.Emit): Override this and set ec.CurrentBlock
while calling DoEmit ().
* codegen.cs (EmitContext.Mark): Don't mark locations in other
source files; if you use the #line directive inside a method, the
compiler stops emitting line numbers for the debugger until it
reaches the end of the method or another #line directive which
restores the original file.
2003-02-23 Martin Baulig <martin@ximian.com>
* statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
2003-02-23 Martin Baulig <martin@ximian.com>
* statement.cs (Block.AddChildVariableNames): We need to call this
recursively, not just for our immediate children.
2003-02-23 Martin Baulig <martin@ximian.com>
* class.cs (Event.Define): Always make the field private, like csc does.
* typemanager.cs (TypeManager.RealMemberLookup): Make events
actually work, fixes bug #37521.
2003-02-23 Miguel de Icaza <miguel@ximian.com>
* delegate.cs: When creating the various temporary "Parameters"
classes, make sure that we call the ComputeAndDefineParameterTypes
on those new parameters (just like we do with the formal ones), to
allow them to be resolved in the context of the DeclSpace.
This fixes the bug that Dick observed in Bugzilla #38530.
2003-02-22 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ResolveMemberAccess): When resolving a constant,
do not attempt to pull a constant if the value was not able to
generate a valid constant.
* const.cs (LookupConstantValue): Do not report more errors than required.
2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* expression.cs: fixes bug #38328.
2003-02-18 Miguel de Icaza <miguel@ximian.com>
* class.cs: Changed all the various members that can be part of a
class from being an ArrayList to be an Array of the right type.
During the DefineType type_list, interface_list, delegate_list and
enum_list are turned into types, interfaces, delegates and enums
arrays.
And during the member population, indexer_list, event_list,
constant_list, field_list, instance_constructor_list, method_list,
operator_list and property_list are turned into their real arrays.
Although we could probably perform this operation earlier, for
good error reporting we need to keep the lists and remove the
lists for longer than required.
This optimization was triggered by Paolo profiling the compiler
speed on the output of `gen-sample-program.pl' perl script.
* decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
not crash in methods like MemberLookupFailed that use this field.
This problem arises when the compiler fails to resolve a type
during interface type definition for example.
2003-02-18 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Indexers.GetIndexersForType): Interfaces do not
inherit from System.Object, so we have to stop at null, not only
when reaching System.Object.
2003-02-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs: (Indexers.GetIndexersForType): Martin's fix used
DeclaredOnly because the parent indexer might have had a different
name, but did not loop until the top of the hierarchy was reached.
The problem this one fixes is 35492: when a class implemented an
indexer from an interface, we were getting the interface method
(which was abstract) and we were flagging an error (can not invoke
abstract method).
This also keeps bug 33089 functioning, and test-148 functioning.
* typemanager.cs (IsSpecialMethod): The correct way of figuring
out if a method is special is to see if it is declared in a
property or event, or whether it is one of the predefined operator
names. This should fix correctly #36804.
2003-02-15 Miguel de Icaza <miguel@ximian.com>
The goal here is to remove the dependency on EmptyCast.Peel ().
Killing it completely.
The problem is that currently in a number of places where
constants are expected, we have to "probe" for an EmptyCast, and
Peel, which is not the correct thing to do, as this will be
repetitive and will likely lead to errors.
The idea is to remove any EmptyCasts that are used in casts that
can be reduced to constants, so we only have to cope with
constants.
This bug hunt was triggered by Bug 37363 and the desire to remove
the duplicate pattern where we were "peeling" emptycasts to check
whether they were constants. Now constants will always be
constants.
* ecore.cs: Use an enumconstant here instead of wrapping with
EmptyCast.
* expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
throwing me off. By handling this we can get rid of a few hacks.
* statement.cs (Switch): Removed Peel() code.
2003-02-14 Miguel de Icaza <miguel@ximian.com>
* class.cs: Location information for error 508
* expression.cs (New.DoResolve): Add a guard against double
resolution of an expression.
The New DoResolve might be called twice when initializing field
expressions (see EmitFieldInitializers, the call to
GetInitializerExpression will perform a resolve on the expression,
and later the assign will trigger another resolution
This leads to bugs (#37014)
* delegate.cs: The signature for EndInvoke should contain any ref
or out parameters as well. We were not doing this in the past.
* class.cs (Field.Define): Do not overwrite the type definition
inside the `volatile' group. Turns out that volatile enumerations
were changing the type here to perform a validity test, which
broke conversions.
2003-02-12 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.AddressOf): In the particular case of This
and structs, we do not want to load the instance variable
(ImplicitReferenceConversion, ImplicitReferenceConversionExists):
enum_type has to be handled like an object reference (implicit
conversions exists from this to object), but the regular IsClass
and IsValueType tests will never return true for this one.
Also we use TypeManager.IsValueType instead of type.IsValueType,
just for consistency with the rest of the code (this is only
needed if we ever use the construct exposed by test-180.cs inside
corlib, which we dont today).
2003-02-12 Zoltan Varga <vargaz@freemail.hu>
* attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
just InternalCall.
2003-02-09 Martin Baulig <martin@ximian.com>
* namespace.cs (Namespace..ctor): Added SourceFile argument.
(Namespace.DefineNamespaces): New static public method; this is
called when we're compiling with debugging to add all namespaces
to the symbol file.
* tree.cs (Tree.RecordNamespace): Added SourceFile argument and
pass it to the Namespace's .ctor.
* symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
and MethodBase arguments; pass the namespace ID to the symwriter;
pass the MethodBase instead of the token to the symwriter.
(SymbolWriter.DefineNamespace): New method to add a namespace to
the symbol file.
2003-02-09 Martin Baulig <martin@ximian.com>
* symbolwriter.cs: New file. This is a wrapper around
ISymbolWriter with a cleaner API. We'll dynamically Invoke()
methods here in near future.
2003-02-09 Martin Baulig <martin@ximian.com>
* codegen.cs (EmitContext.Mark): Just pass the arguments to
ILGenerator.MarkSequencePoint() which are actually used by the
symbol writer.
2003-02-09 Martin Baulig <martin@ximian.com>
* location.cs (SourceFile): New public sealed class. This
contains the name and an index which is used in the location's token.
(Location): Reserve an appropriate number of bits in the token for
the source file instead of walking over that list, this gives us a
really huge performance improvement when compiling with debugging.
* driver.cs (Driver.parse, Driver.tokenize_file): Take a
`SourceFile' argument instead of a string.
(Driver.ProcessFile): Add all the files via Location.AddFile(),
but don't parse/tokenize here, we need to generate the list of all
source files before we do that.
(Driver.ProcessFiles): New static function. Parses/tokenizes all
the files.
* cs-parser.jay (CSharpParser): Take a `SourceFile' argument
instead of a string.
* cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
of a string.
2003-02-09 Martin Baulig <martin@ximian.com>
* cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
filename on `#line default'.
Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
* statement.cs: don't clear the pinned var when the fixed statement
returns from the method (fixes bug#37752).
Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
* typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
to IsValueType.
2003-02-07 Martin Baulig <martin@ximian.com>
* driver.cs: Removed the `--debug-args' command line argument.
* codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
automatically by the AsssemblyBuilder.
(CodeGen.InitializeSymbolWriter): We don't need to call any
initialization function on the symbol writer anymore. This method
doesn't take any arguments.
2003-02-03 Miguel de Icaza <miguel@ximian.com>
* driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
from referenced assemblies as well.
2003-02-02 Martin Baulig <martin@ximian.com>
* class.cs (MethodData.Emit): Generate debugging info for external methods.
2003-02-02 Martin Baulig <martin@ximian.com>
* class.cs (Constructor.Emit): Open the symbol writer before
emitting the constructor initializer.
(ConstructorInitializer.Emit): Call ec.Mark() to allow
single-stepping through constructor initializers.
2003-01-30 Miguel de Icaza <miguel@ximian.com>
* class.cs: Handle error 549: do not allow virtual methods in
sealed classes.
2003-02-01 Jackson Harper <jackson@latitudegeo.com>
* decl.cs: Check access levels when resolving types
2003-01-31 Jackson Harper <jackson@latitudegeo.com>
* statement.cs: Add parameters and locals set in catch blocks that might
return to set vector
2003-01-29 Miguel de Icaza <miguel@ximian.com>
* class.cs (Operator): Set the SpecialName flags for operators.
* expression.cs (Invocation.DoResolve): Only block calls to
accessors and operators on SpecialName methods.
(Cast.TryReduce): Handle conversions from char constants.
Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
* statement.cs: small memory and time optimization in FlowBranching.
2003-01-28 Pedro Mart <yoros@wanadoo.es>
* expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
problem that the last fix but in the other sid (Set).
* expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
access when there is no indexer in the hierarchy.
2003-01-27 Jackson Harper <jackson@latitudegeo.com>
* class.cs: Combine some if statements.
2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* driver.cs: fixed bug #37187.
2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
* expression.cs (IndexerAccess.DoResolve): Before trying to resolve
any indexer, it's needed to build a list with all the indexers in the
hierarchy (AllGetters), else we have problems. Fixes #35653.
2003-01-23 Miguel de Icaza <miguel@ximian.com>
* class.cs (MethodData.Define): It is wrong for an interface
implementation to be static in both cases: explicit and implicit.
We were only handling this in one case.
Improve the if situation there to not have negations.
* class.cs (Field.Define): Turns out that we do not need to check
the unsafe bit on field definition, only on usage. Remove the test.
2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* driver.cs: use assembly.Location instead of Codebase (the latest
patch made mcs fail when using MS assemblies).
2003-01-21 Tim Haynes <thaynes@openlinksw.com>
* driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
get the path to *corlib.dll.
2003-01-21 Nick Drochak <ndrochak@gol.com>
* cs-tokenizer.cs:
* pending.cs:
* typemanager.cs: Remove compiler warnings
2003-01-20 Duncan Mak <duncan@ximian.com>
* AssemblyInfo.cs: Bump the version number to 0.19.
2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-tokenizer.cs: little fixes to line numbering when #line is used.
2003-01-18 Zoltan Varga <vargaz@freemail.hu>
* class.cs (Constructor::Emit): Emit debugging info for constructors.
2003-01-17 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Small fix: we were not comparing the constructor
name correctly. Thanks to Zoltan for the initial pointer.
2003-01-16 Jackson Harper <jackson@latitudegeo.com>
* cs-tokenizer.cs: Set file name when specified with #line
2003-01-15 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Only perform the constructor checks here if we
are named like the class; This will help provider a better
error. The constructor path is taken when a type definition is
not found, but most likely the user forgot to add the type, so
report that rather than the constructor error.
Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
* class.cs, rootcontext.cs: small changes to avoid unnecessary memory
allocations.
2003-01-13 Jackson Harper <jackson@latitudegeo.com>
* cs-parser.jay: Add cleanup call.
2003-01-13 Duncan Mak <duncan@ximian.com>
* cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
consistent with other methods.
2003-01-13 Jackson Harper <jackson@latitudegeo.com>
* cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
* attribute.cs: only set GuidAttr to true when we have a
GuidAttribute.
2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ecore.cs:
* expression.cs:
* typemanager.cs: fixes to allow mcs compile corlib with the new
Type.IsSubclassOf fix.
2003-01-08 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LocalVariableReference.DoResolve): Classify a
constant as a value, not as a variable. Also, set the type for
the variable.
* cs-parser.jay (fixed_statement): take a type instead of a
pointer_type, so we can produce a better error message later.
* statement.cs (Fixed.Resolve): Flag types that are not pointers
as an error.
(For.DoEmit): Make inifinite loops have a
non-conditional branch back.
(Fixed.DoEmit): First populate the pinned variables, then emit the
statement, then clear the variables. Before I was emitting the
code once for each fixed piece.
2003-01-08 Martin Baulig <martin@ximian.com>
* statement.cs (FlowBranching.MergeChild): A break in a
SWITCH_SECTION does not leave a loop. Fixes #36155.
2003-01-08 Martin Baulig <martin@ximian.com>
* statement.cs (FlowBranching.CheckOutParameters): `struct_params'
lives in the same number space than `param_map'. Fixes #36154.
2003-01-07 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (constructor_declaration): Set the
Constructor.ModFlags before probing for it. This makes the
compiler report 514, 515 and 132 (the code was there, but got
broken).
* statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
(GotoDefault.Resolve): Set `Returns' to ALWAYS.
(GotoCase.Resolve): Set `Returns' to ALWAYS.
Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
* enum.cs: create the enum static fields using the enum type.
Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
* class.cs: don't try to create the ParamBuilder for the return
type if it's not needed (and handle it breaking for the ms runtime
anyway).
2003-01-06 Jackson Harper <jackson@latitudegeo.com>
* cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
2002-12-29 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
the command. This showed up while compiling the JANET source
code, which used \r as its only newline separator.
2002-12-28 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method.Define): If we are an operator (because it
reuses our code), then set the SpecialName and HideBySig. #36128
2002-12-22 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.DoResolve): Instead of throwing an
exception, report error 120 `object reference required'.
* driver.cs: Add --pause option, used during to measure the size
of the process as it goes with --timestamp.
* expression.cs (Invocation.DoResolve): Do not allow methods with
SpecialName to be invoked.
2002-12-21 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Small fix to the parser: compute the ascii
number before adding it.
2002-12-21 Ravi Pratap <ravi@ximian.com>
* ecore.cs (StandardImplicitConversion): When in an unsafe
context, we allow conversion between void * to any other pointer
type. This fixes bug #35973.
2002-12-20 Jackson Harper <jackson@latitudegeo.com>
* codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
is not thrown when extensionless outputs are used
2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* rootcontext.cs: fixed compilation of corlib.
2002-12-19 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (Attributes.Contains): Add new method.
* class.cs (MethodCore.LabelParameters): if the parameter is an
`out' parameter, check that no attribute `[In]' has been passed.
* enum.cs: Handle the `value__' name in an enumeration.
2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
* decl.cs: Added special case to allow overrides on "protected
internal" methods
2002-12-18 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attributes.AddAttributeSection): Rename to this
since it makes much more sense.
(Attributes.ctor): Don't require a Location parameter.
* rootcontext.cs (AddGlobalAttributeSection): Rename again.
* attribute.cs (ApplyAttributes): Remove extra Location parameters
since we already have that information per attribute.
* everywhere : make appropriate changes.
* class.cs (LabelParameters): Write the code which actually
applies attributes to the return type. We can't do this on the MS
.NET runtime so we flag a warning in the case an exception is
thrown.
2002-12-18 Miguel de Icaza <miguel@ximian.com>
* const.cs: Handle implicit null conversions here too.
2002-12-17 Ravi Pratap <ravi@ximian.com>
* class.cs (MethodCore.LabelParameters): Remove the extra
Type [] parameter since it is completely unnecessary. Instead
pass in the method's attributes so that we can extract
the "return" attribute.
2002-12-17 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (parse): Use Report.Error to flag errors instead
of ignoring it and letting the compile continue.
* typemanager.cs (ChangeType): use an extra argument to return an
error condition instead of throwing an exception.
2002-12-15 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Unary.TryReduce): mimic the code for the regular
code path. Perform an implicit cast in the cases where we can
implicitly convert to one of the integral types, and then reduce
based on that constant. This fixes bug #35483.
2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* typemanager.cs: fixed cut & paste error in GetRemoveMethod.
2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* namespace.cs: fixed bug #35489.
2002-12-12 Miguel de Icaza <miguel@ximian.com>
* class.cs: Remove some dead code.
* cs-parser.jay: Estimate the number of methods needed
(RootContext.MethodCount);
* cs-tokenizer.cs: Use char arrays for parsing identifiers and
numbers instead of StringBuilders.
* support.cs (PtrHashtable): Add constructor with initial size;
We can now reduce reallocations of the method table.
2002-12-10 Ravi Pratap <ravi@ximian.com>
* attribute.cs (ApplyAttributes): Keep track of the emitted
attributes on a per-target basis. This fixes bug #35413.
2002-12-10 Miguel de Icaza <miguel@ximian.com>
* driver.cs (MainDriver): On rotor encoding 28591 does not exist,
default to the Windows 1252 encoding.
(UnixParseOption): Support version, thanks to Alp for the missing
pointer.
* AssemblyInfo.cs: Add nice assembly information.
* cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
(bug 35169).
* cs-parser.jay: Allow a trailing comma before the close bracked
in the attribute_section production.
* ecore.cs (FieldExpr.AddressOf): Until I figure out why the
address of the instance was being taken, I will take this out,
because we take the address of the object immediately here.
2002-12-09 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (AreMultipleAllowed): Take care of the most
obvious case where attribute type is not in the current assembly -
stupid me ;-)
2002-12-08 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleName.DoResolve): First perform lookups on using
definitions, instead of doing that afterwards.
Also we use a nice little hack, depending on the constructor, we
know if we are a "composed" name or a simple name. Hence, we
avoid the IndexOf test, and we avoid
* codegen.cs: Add code to assist in a bug reporter to track down
the source of a compiler crash.
2002-12-07 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
types have been emitted for a given element and flag an error
if something which does not have AllowMultiple set is used more
than once.
* typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
attribute types and their corresponding AllowMultiple properties
(AreMultipleAllowed): Check the property for a given type.
* attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
property in the case we have a TypeContainer.
(Attributes.AddAttribute): Detect duplicates and just skip on
adding them. This trivial fix catches a pretty gross error in our
attribute emission - global attributes were being emitted twice!
Bugzilla bug #33187 is now fixed.
2002-12-06 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
instead of pp_and).
* expression.cs (Binary.ResolveOperator): I can only use the
Concat (string, string, string) and Concat (string, string,
string, string) if the child is actually a concatenation of
strings.
2002-12-04 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Small fix, because decimal_digits is used in a
context where we need a 2-character lookahead.
* pending.cs (PendingImplementation): Rework so we can keep track
of interface types all the time, and flag those which were
implemented by parents as optional.
2002-12-03 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.ResolveOperator): Use
String.Concat(string,string,string) or
String.Concat(string,string,string,string) when possible.
* typemanager: More helper methods.
Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
* pending.cs: remove the bogus return from GetMissingInterfaces()
(see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* namespace.cs: avoid duplicated 'using xxx' being added to
using_clauses. This prevents mcs from issuing and 'ambiguous type' error
when we get more than one 'using' statement for the same namespace.
Report a CS0105 warning for it.
2002-11-30 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (consume_identifier): use read directly, instead
of calling getChar/putback, uses internal knowledge of it.
(xtoken): Reorder tokenizer so most common patterns are checked
first. This reduces the compilation time in another 5% (from 8.11s
average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
The parsing time is 22% of the compilation in mcs, and from that
64% is spent on the tokenization process.
I tried using a binary search for keywords, but this is slower
than the hashtable. Another option would be to do a couple of
things:
* Not use a StringBuilder, instead use an array of chars,
with a set value. Notice that this way we could catch
the 645 error without having to do it *afterwards*.
* We could write a hand-parser to avoid the hashtable
compares altogether.
The identifier consumption process takes 37% of the tokenization
time. Another 15% is spent on is_number. 56% of the time spent
on is_number is spent on Int64.Parse:
* We could probably choose based on the string length to
use Int32.Parse or Int64.Parse and avoid all the 64-bit
computations.
Another 3% is spend on wrapping `xtoken' in the `token' function.
Handle 0xa0 as whitespace (#34752)
2002-11-26 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (IsCLRType): New routine to tell whether a type
is one of the builtin types.
Maybe it needs to use TypeCodes to be faster. Maybe we could use
typecode in more places instead of doing pointer comparissions.
We could leverage some knowledge about the way the typecodes are
laid out.
New code to cache namespaces in assemblies, it is currently not
invoked, to be used soon.
* decl.cs (DeclSpace.MakeFQN): Simple optimization.
* expression.cs (Binary.ResolveOperator): specially handle
strings, and do not perform user-defined operator overloading for
built-in types.
2002-11-24 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
internalcall as it is a pretty simple operation; Avoid whenever
possible to call Char.IsLetter.
(consume_identifier): Cut by half the number of
hashtable calls by merging the is_keyword and GetKeyword behavior.
Do not short-circuit, because if we do, we
report errors (ie, #if false && true would produce an invalid
directive error);
2002-11-24 Martin Baulig <martin@ximian.com>
* expression.cs (Cast.TryReduce): If we're in checked syntax,
check constant ranges and report a CS0221. Fixes #33186.
2002-11-24 Martin Baulig <martin@ximian.com>
* cs-parser.jay: Make this work for uninitialized variable
declarations in the `for' initializer. Fixes #32416.
2002-11-24 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.ConvertExplicit): Make casting from/to
System.Enum actually work. Fixes bug #32269, added verify-6.cs.
2002-11-24 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
argument; if true, we also check for user-defined conversions.
This is only needed if both arguments are of a user-defined type.
Fixes #30443, added test-175.cs.
(Binary.ForceConversion): Pass the location argument to ConvertImplicit.
* ecore.cs (Expression.ImplicitUserConversionExists): New method.
2002-11-24 Martin Baulig <martin@ximian.com>
* expression.cs (ArrayAccess.GetStoreOpcode): New public static
function to get the store opcode.
(Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
only emit the Ldelema if the store opcode is Stobj. You must run
both test-34 and test-167 to test this. Fixes #34529.
2002-11-23 Martin Baulig <martin@ximian.com>
* ecore.cs (Expression.MemberLookup): Added additional
`qualifier_type' argument which is used when we're being called
from MemberAccess.DoResolve() and null if we're called from a
SimpleName lookup.
(Expression.MemberLookupFailed): New method to report errors; this
does the CS1540 check and reports the correct error message.
* typemanager.cs (MemberLookup): Added additional `qualifier_type'
argument for the CS1540 check and redone the way how we're dealing
with private members. See the comment in the source code for details.
(FilterWithClosure): Reverted this back to revision 1.197; renamed
`closure_start_type' to `closure_qualifier_type' and check whether
it's not null. It was not this filter being broken, it was just
being called with the wrong arguments.
* expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
and pass it the correct `qualifier_type'; this also does the error
handling for us.
2002-11-22 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation.EmitParams): If the we are dealing
with a non-built-in value type, load its address as well.
(ArrayCreation): Use a a pretty constant instead
of the hardcoded value 2. Use 6 instead of 2 for the number of
static initializers.
(ArrayCreation.EmitDynamicInitializers): Peel enumerations,
because they are not really value types, just glorified integers.
* driver.cs: Do not append .exe, the CSC compiler does not do it.
* ecore.cs: Remove redundant code for enumerations, make them use
the same code path as everything else, fixes the casting issue
with enumerations in Windows.Forms.
* attribute.cs: Do only cast to string if it is a string, the
validation happens later.
* typemanager.cs: Temproary hack to avoid a bootstrap issue until
people upgrade their corlibs.
* ecore.cs: Oops, enumerations were not following the entire code path
2002-11-21 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (FilterWithClosure): Commented out the test for
1540 in typemanager.cs, as it has problems when accessing
protected methods from a parent class (see test-174.cs).
* attribute.cs (Attribute.ValidateGuid): new method.
(Attribute.Resolve): Use above.
2002-11-19 Miguel de Icaza <miguel@ximian.com>
* enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
* ecore.cs (SimpleName.SimpleNameResolve): Remove the special
handling for enumerations, as we only needed the TypeContainer
functionality to begin with (this is required for the fix below to
work for enums that reference constants in a container class for
example).
* codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
* enum.cs (Enum.Define): Use `this' instead of parent, so we have
a valid TypeBuilder to perform lookups on.o
* class.cs (InheritableMemberSignatureCompare): Use true in the
call to GetGetMethod and GetSetMethod, because we are comparing
the signature, and we need to get the methods *even* if they are
private.
(PropertyBase.CheckBase): ditto.
* statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
GotoCase.Resolve): Use Peel on EmpytCasts.
* ecore.cs (EmptyCast): drop child, add Peel method.
2002-11-17 Martin Baulig <martin@ximian.com>
* ecore.cs (EmptyCast.Child): New public property.
* statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
label resolved to an EmptyCast. Fixes #34162.
(GotoCase.Resolve): Likewise.
(Block.EmitMeta): Likewise.
2002-11-17 Martin Baulig <martin@ximian.com>
* expression.cs (Invocation.BetterConversion): Prefer int over
uint; short over ushort; long over ulong for integer literals.
Use ImplicitConversionExists instead of StandardConversionExists
since we also need to check for user-defined implicit conversions.
Fixes #34165. Added test-173.cs.
2002-11-16 Martin Baulig <martin@ximian.com>
* expression.cs (Binary.EmitBranchable): Eliminate comparisions
with the `true' and `false' literals. Fixes #33151.
2002-11-16 Martin Baulig <martin@ximian.com>
* typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
October 22nd; don't do the cs1540 check for static members.
* ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
now using our own filter here and doing the cs1540 check again.
2002-11-16 Martin Baulig <martin@ximian.com>
* support.cs (InternalParameters): Don't crash if we don't have
any fixed parameters. Fixes #33532.
2002-11-16 Martin Baulig <martin@ximian.com>
* decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
when looking up static methods to make this work on Windows.
Fixes #33773.
2002-11-16 Martin Baulig <martin@ximian.com>
* ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
a setter rather than using PropertyInfo.CanWrite.
2002-11-15 Nick Drochak <ndrochak@gol.com>
* class.cs: Allow acces to block member by subclasses. Fixes build
breaker.
2002-11-14 Martin Baulig <martin@ximian.com>
* class.cs (Constructor.Emit): Added the extern/block check.
Fixes bug #33678.
2002-11-14 Martin Baulig <martin@ximian.com>
* expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
iteration while looking for indexers, this is needed because the
indexer may have a different name in our base classes. Fixed the
error reporting (no indexers at all, not get accessor, no
overloaded match). Fixes bug #33089.
(IndexerAccess.DoResolveLValue): Likewise.
2002-11-14 Martin Baulig <martin@ximian.com>
* class.cs (PropertyBase.CheckBase): Make this work for multiple
indexers. Fixes the first part of bug #33089.
(MethodSignature.InheritableMemberSignatureCompare): Added support
for properties.
2002-11-13 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attribute.Resolve): Catch the
NullReferenceException and report it since it isn't supposed to
happen.
2002-11-12 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.EmitBranchable): Also handle the cases for
LogicalOr and LogicalAnd that can benefit from recursively
handling EmitBranchable. The code now should be nice for Paolo.
2002-11-08 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (LookupType): Added a negative-hit hashtable for
the Type lookups, as we perform quite a number of lookups on
non-Types. This can be removed once we can deterministically tell
whether we have a type or a namespace in advance.
But this might require special hacks from our corlib.
* TODO: updated.
* ecore.cs (TryImplicitIntConversion): Handle conversions to float
and double which avoids a conversion from an integer to a double.
* expression.cs: tiny optimization, avoid calling IsConstant,
because it effectively performs the lookup twice.
2002-11-06 Miguel de Icaza <miguel@ximian.com>
But a bogus return here to keep the semantics of the old code
until the Mono runtime is fixed.
* pending.cs (GetMissingInterfaces): New method used to remove all
the interfaces that are already implemented by our parent
classes from the list of pending methods.
* interface.cs: Add checks for calls after ResolveTypeExpr.
2002-11-05 Miguel de Icaza <miguel@ximian.com>
* class.cs (Class.Emit): Report warning 67: event not used if the
warning level is beyond 3.
* ecore.cs (Expression.ConvertExplicit): Missed a check for expr
being a NullLiteral.
* cs-parser.jay: Fix, Gonzalo reverted the order of the rank
specifiers.
* class.cs (TypeContainer.GetClassBases): Cover a missing code
path that might fail if a type can not be resolved.
* expression.cs (Binary.Emit): Emit unsigned versions of the
operators.
* driver.cs: use error 5.
2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
* cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2002-11-01 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (switch_section): A beautiful patch from Martin
Baulig that fixed 33094.
2002-10-31 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
Check whether the base is abstract and report an error if so.
* expression.cs (IndexerAccess.DoResolveLValue,
IndexerAccess.DoResolve): ditto.
(Invocation.DoResolve): ditto.
(Invocation.FullMethodDesc): Improve the report string.
* statement.cs (Block): Eliminate IsVariableDefined as it is
basically just a wrapper for GetVariableInfo.
* ecore.cs (SimpleName): Use new
* support.cs (ReflectionParamter.ParameterType): We unwrap the
type, as we return the actual parameter ref/unref state on a
different call.
2002-10-30 Miguel de Icaza <miguel@ximian.com>
* support.cs: Return proper flags REF/OUT fixing the previous
commit.
* expression.cs: Reverted last patch, that was wrong. Is_ref is
not used to mean `ref' but `ref or out' in ParameterReference
* delegate.cs (FullDelegateDesc): use ParameterDesc to get the
full type signature instead of calling TypeManger.CSharpName
ourselves.
* support.cs (InternalParameters.ParameterDesc): Do not compare
directly to the modflags, because REF/OUT will actually be bitsets
if set.
* delegate.cs (VerifyMethod): Check also the modifiers.
* cs-tokenizer.cs: Fix bug where floating point values with an
exponent where a sign was missing was ignored.
* driver.cs: Allow multiple assemblies to be specified in a single
/r: argument
2002-10-28 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Ugly. We had to add a multiplicative_expression,
because identifiers after a parenthesis would end up in this kind
of production, and we needed to desamiguate it for having casts
like:
(UserDefinedType *) xxx
2002-10-24 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (RealMemberLookup): when we deal with a subclass,
we should set on the Bindingflags.NonPublic, but not turn on
private_ok. private_ok controls whether a Private member is
returned (this is chekced on the filter routine), while the
BindingFlags.NonPublic just controls whether private/protected
will be allowed. This fixes the problem part of the problem of
private properties being allowed to be used in derived classes.
* expression.cs (BaseAccess): Provide an DoResolveLValue method,
so we can call the children DoResolveLValue method (this will
properly signal errors on lvalue assignments to base properties)
* ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
getter are null, and we have a property info, we know that this
happened because the lookup failed, so we report an error 122 for
protection level violation.
We also silently return if setter and getter are null in the
resolve functions, this condition only happens if we have flagged
the error before. This is the other half of the problem.
(PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
not have accessibility information, that is why we were returning
true in the filter function in typemanager.cs.
To properly report 122 (property is inaccessible because of its
protection level) correctly, we report this error in ResolveAccess
by failing if both the setter and the getter are lacking (ie, the
lookup failed).
DoResolve and DoLResolve have been modified to check for both
setter/getter being null and returning silently, the reason being
that I did not want to put the knowledge about this error in upper
layers, like:
int old = Report.Errors;
x = new PropertyExpr (...);
if (old != Report.Errors)
return null;
else
return x;
So the property expr is returned, but it is invalid, so the error
will be flagged during the resolve process.
* class.cs: Remove InheritablePropertySignatureCompare from the
class, as we no longer depend on the property signature to compute
whether it is possible to implement a method or not.
The reason is that calling PropertyInfo.GetGetMethod will return
null (in .NET, in Mono it works, and we should change this), in
cases where the Get Method does not exist in that particular
class.
So this code:
class X { public virtual int A { get { return 1; } } }
class Y : X { }
class Z : Y { public override int A { get { return 2; } } }
Would fail in Z because the parent (Y) would not have the property
defined. So we avoid this completely now (because the alternative
fix was ugly and slow), and we now depend exclusively on the
method names.
(PropertyBase.CheckBase): Use a method-base mechanism to find our
reference method, instead of using the property.
* typemanager.cs (GetPropertyGetter, GetPropertySetter): These
routines are gone now.
* typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
names, they were incorrectly named.
* cs-tokenizer.cs: Return are more gentle token on failure.
* pending.cs (PendingImplementation.InterfaceMethod): This routine
had an out-of-sync index variable, which caused it to remove from
the list of pending methods the wrong method sometimes.
2002-10-22 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
CanWrite, because those refer to this particular instance of the
property, and do not take into account the fact that we can
override single members of a property.
Constructor requires an EmitContext. The resolution process does
not happen here, but we need to compute the accessors before,
because the resolution does not always happen for properties.
* typemanager.cs (RealMemberLookup): Set private_ok if we are a
subclass, before we did not update this flag, but we did update
bindingflags.
(GetAccessors): Drop this routine, as it did not work in the
presence of partially overwritten set/get methods.
Notice that this broke the cs1540 detection, but that will require
more thinking.
2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* class.cs:
* codegen.cs:
* driver.cs: issue a warning instead of an error if we don't support
debugging for the platform. Also ignore a couple of errors that may
arise when trying to write the symbols. Undo my previous patch.
2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* driver.cs: ignore /debug switch except for Unix platforms.
2002-10-23 Nick Drochak <ndrochak@gol.com>
* makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
2002-10-21 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Do not make mcs-debug conditional, so we do not break
builds that use it.
* statement.cs (UsageVector.MergeChildren): I would like Martin to
review this patch. But basically after all the children variables
have been merged, the value of "Breaks" was not being set to
new_breaks for Switch blocks. I think that it should be set after
it has executed. Currently I set this to the value of new_breaks,
but only if new_breaks is FlowReturn.ALWAYS, which is a bit
conservative, but I do not understand this code very well.
I did not break anything in the build, so that is good ;-)
* cs-tokenizer.cs: Also allow \r in comments as a line separator.
2002-10-20 Mark Crichton <crichton@gimp.org>
* cfold.cs: Fixed compile blocker. Really fixed it this time.
2002-10-20 Nick Drochak <ndrochak@gol.com>
* cfold.cs: Fixed compile blocker.
2002-10-20 Miguel de Icaza <miguel@ximian.com>
* driver.cs: I was chekcing the key, not the file.
2002-10-19 Ravi Pratap <ravi@ximian.com>
* ecore.cs (UserDefinedConversion): Get rid of the bogus error
message that we were generating - we just need to silently return
a null.
2002-10-19 Miguel de Icaza <miguel@ximian.com>
* class.cs (Event.Define): Change my previous commit, as this
breaks the debugger. This is a temporary hack, as it seems like
the compiler is generating events incorrectly to begin with.
* expression.cs (Binary.ResolveOperator): Added support for
"U operator - (E x, E y)"
* cfold.cs (BinaryFold): Added support for "U operator - (E x, E
y)".
* ecore.cs (FieldExpr.AddressOf): We had a special code path for
init-only variables, but this path did not take into account that
there might be also instance readonly variables. Correct this
problem.
This fixes bug 32253
* delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
delegates as well.
* driver.cs: Change the extension for modules to `netmodule'
* cs-parser.jay: Improved slightly the location tracking for
the debugger symbols.
* class.cs (Event.Define): Use Modifiers.FieldAttr on the
modifiers that were specified instead of the hardcoded value
(FamAndAssem). This was basically ignoring the static modifier,
and others. Fixes 32429.
* statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
fixed a bug in the process (32476)
* expression.cs (ArrayAccess.EmitAssign): Patch from
hwang_rob@yahoo.ca that fixes bug 31834.3
2002-10-18 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Make the module extension .netmodule.
2002-10-16 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Report an error if the resource file is not found
instead of crashing.
* ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
false, like Emit does.
2002-10-16 Nick Drochak <ndrochak@gol.com>
* typemanager.cs: Remove unused private member. Also reported mcs
bug to report this as a warning like csc.
2002-10-15 Martin Baulig <martin@gnome.org>
* statement.cs (Statement.Emit): Made this a virtual method; emits
the line number info and calls DoEmit().
(Statement.DoEmit): New protected abstract method, formerly knows
as Statement.Emit().
* codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
2002-10-11 Miguel de Icaza <miguel@ximian.com>
* class.cs: Following the comment from 2002-09-26 to AddMethod, I
have fixed a remaining problem: not every AddXXXX was adding a
fully qualified name.
Now everyone registers a fully qualified name in the DeclSpace as
being defined instead of the partial name.
Downsides: we are slower than we need to be due to the excess
copies and the names being registered this way.
The reason for this is that we currently depend (on the corlib
bootstrap for instance) that types are fully qualified, because
we dump all the types in the namespace, and we should really have
types inserted into the proper namespace, so we can only store the
basenames in the defined_names array.
2002-10-10 Martin Baulig <martin@gnome.org>
* expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
from bug #31834, see the bug report for a testcase which is
miscompiled.
2002-10-10 Martin Baulig <martin@gnome.org>
* codegen.cs (EmitContext.Breaks): Removed, we're now using the
flow analysis code for this.
* statement.cs (Do, While, For): Tell the flow analysis code about
infinite loops.
(FlowBranching.UsageVector): Added support for infinite loops.
(Block.Resolve): Moved the dead code elimination here and use flow
analysis to do it.
2002-10-09 Miguel de Icaza <miguel@ximian.com>
* class.cs (Field.Define): Catch cycles on struct type
definitions.
* typemanager.cs (IsUnmanagedtype): Do not recursively check
fields if the fields are static. We only need to check instance
fields.
* expression.cs (As.DoResolve): Test for reference type.
* statement.cs (Using.ResolveExpression): Use
ConvertImplicitRequired, not ConvertImplicit which reports an
error on failture
(Using.ResolveLocalVariableDecls): ditto.
* expression.cs (Binary.ResolveOperator): Report errors in a few
places where we had to.
* typemanager.cs (IsUnmanagedtype): Finish implementation.
2002-10-08 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Use StoreFromPtr instead of extracting the type
and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
* ecore.cs (ImplicitReferenceConversion): It is possible to assign
an enumeration value to a System.Enum, but System.Enum is not a
value type, but an class type, so we need to box.
(Expression.ConvertExplicit): One codepath could return
errors but not flag them. Fix this. Fixes #31853
* parameter.cs (Resolve): Do not allow void as a parameter type.
2002-10-06 Martin Baulig <martin@gnome.org>
* statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
if it's a class type and not a struct. Fixes #31815.
2002-10-06 Martin Baulig <martin@gnome.org>
* statement.cs: Reworked the flow analysis code a bit to make it
usable for dead code elimination.
2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-parser.jay: allow empty source files. Fixes bug #31781.
2002-10-04 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ComposedCast.DoResolveType): A quick workaround
to fix the test 165, will investigate deeper.
2002-10-04 Martin Baulig <martin@gnome.org>
* statement.cs (FlowBranching.UsageVector.MergeChildren): Make
finally blocks actually work.
(Try.Resolve): We don't need to create a sibling for `finally' if
there is no finally block.
2002-10-04 Martin Baulig <martin@gnome.org>
* class.cs (Constructor.Define): The default accessibility for a
non-default constructor is private, not public.
2002-10-04 Miguel de Icaza <miguel@ximian.com>
* class.cs (Constructor): Make AllowedModifiers public, add
EXTERN.
* cs-parser.jay: Perform the modifiers test here, as the
constructor for the Constructor class usually receives a zero
because of the way we create it (first we create, later we
customize, and we were never checking the modifiers).
* typemanager.cs (Typemanager.LookupTypeDirect): This new function
is a version of LookupTypeReflection that includes the type-name
cache. This can be used as a fast path for functions that know
the fully qualified name and are only calling into *.GetType() to
obtain a composed type.
This is also used by TypeManager.LookupType during its type
composition.
(LookupType): We now also track the real type name, as sometimes
we can get a quey for the real type name from things like
ComposedCast. This fixes bug 31422.
* expression.cs (ComposedCast.Resolve): Since we are obtaining a
complete type fullname, it does not have to go through the type
resolution system to obtain the composed version of the type (for
obtaining arrays or pointers).
(Conditional.Emit): Use the EmitBoolExpression to
generate nicer code, as requested by Paolo.
(ArrayCreation.CheckIndices): Use the patch from
hwang_rob@yahoo.ca to validate the array initializers.
2002-10-03 Miguel de Icaza <miguel@ximian.com>
* class.cs (ConstructorInitializer.Emit): simplify code by using
Invocation.EmitCall, and at the same time, fix the bugs in calling
parent constructors that took variable arguments.
* ecore.cs (Expression.ConvertNumericExplicit,
Expression.ImplicitNumericConversion): Remove the code that
manually wrapped decimal (InternalTypeConstructor call is now gone
as well).
* expression.cs (Cast.TryReduce): Also handle decimal types when
trying to perform a constant fold on the type.
* typemanager.cs (IsUnmanagedtype): Partially implemented.
* parameter.cs: Removed ResolveAndDefine, as it was not needed, as
that only turned off an error report, and did nothing else.
2002-10-02 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Handle and ignore /fullpaths
2002-10-01 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.ResolveOperator): Catch the case where
DoNumericPromotions returns true,
(Binary.DoNumericPromotions): Simplify the code, and the tests.
2002-09-27 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (EventExpr.Emit): Instead of emitting an exception,
report error 70.
2002-09-26 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (ConvertNumericExplicit): It is not enough that the
conversion exists, but it is also required that the conversion be
performed. This manifested in "(Type64Enum) 2".
* class.cs (TypeManager.AddMethod): The fix is not to change
AddEnum, because that one was using a fully qualified name (every
DeclSpace derivative does), but to change the AddMethod routine
that was using an un-namespaced name. This now correctly reports
the duplicated name.
Revert patch until I can properly fix it. The issue
is that we have a shared Type space across all namespaces
currently, which is wrong.
Options include making the Namespace a DeclSpace, and merge
current_namespace/current_container in the parser.
2002-09-25 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Improve error reporting when we get a different
kind of expression in local_variable_type and
local_variable_pointer_type.
Propagate this to avoid missleading errors being reported.
* ecore.cs (ImplicitReferenceConversion): treat
TypeManager.value_type as a target just like object_type. As
code like this:
ValueType v = 1;
Is valid, and needs to result in the int 1 being boxed before it
is assigned to the value type v.
* class.cs (TypeContainer.AddEnum): Use the basename, not the name
to validate the enumeration name.
* expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
EmitDynamicInitializers for the criteria to use Ldelema. Thanks
to hwang_rob@yahoo.ca for finding the bug and providing a patch.
* ecore.cs (TryImplicitIntConversion): When doing an
implicit-enumeration-conversion, check if the type is 64-bits and
perform a conversion before passing to EnumConstant.
2002-09-23 Miguel de Icaza <miguel@ximian.com>
* decl.cs (Error_AmbiguousTypeReference); New routine used to
report ambiguous type references. Unlike the MS version, we
report what the ambiguity is. Innovation at work ;-)
(DeclSpace.FindType): Require a location argument to
display when we display an ambiguous error.
* ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
* interface.cs (GetInterfaceTypeByName): Pass location to FindType.
* expression.cs (EmitDynamicInitializers): Apply patch from
hwang_rob@yahoo.ca that fixes the order in which we emit our
initializers.
2002-09-21 Martin Baulig <martin@gnome.org>
* delegate.cs (Delegate.VerifyApplicability): Make this work if the
delegate takes no arguments.
2002-09-20 Miguel de Icaza <miguel@ximian.com>
* constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
from integers.
* expression.cs: Extract the underlying type.
* ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
* decl.cs (FindType): Sorry about this, fixed the type lookup bug.
2002-09-19 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.DefineType): We can not use the nice
PackingSize with the size set to 1 DefineType method, because it
will not allow us to define the interfaces that the struct
implements.
This completes the fixing of bug 27287
* ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
means also structs. This fixes part of the problem.
(Expresion.ImplicitReferenceConversionExists): ditto.
* decl.cs (DeclSparce.ResolveType): Only report the type-not-found
error if there were no errors reported during the type lookup
process, to avoid duplicates or redundant errors. Without this
you would get an ambiguous errors plus a type not found. We have
beaten the user enough with the first error.
(DeclSparce.FindType): Emit a warning if we have an ambiguous
reference.
* ecore.cs (SimpleName.DoResolveType): If an error is emitted
during the resolution process, stop the lookup, this avoids
repeated error reports (same error twice).
* rootcontext.cs: Emit a warning if we have an ambiguous reference.
* typemanager.cs (LookupType): Redo the type lookup code to match
the needs of System.Reflection.
The issue is that System.Reflection requires references to nested
types to begin with a "+" sign instead of a dot. So toplevel
types look like: "NameSpace.TopLevelClass", and nested ones look
like "Namespace.TopLevelClass+Nested", with arbitrary nesting
levels.
2002-09-19 Martin Baulig <martin@gnome.org>
* codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
says that a method always returns or always throws an exception,
don't report the CS0161.
* statement.cs (FlowBranching.UsageVector.MergeChildren): Always
set `Returns = new_returns'.
2002-09-19 Martin Baulig <martin@gnome.org>
* expression.cs (MemberAccess.ResolveMemberAccess): When resolving
to an enum constant, check for a CS0176.
2002-09-18 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.CheckPairedOperators): Now we check
for operators that must be in pairs and report errors.
* ecore.cs (SimpleName.DoResolveType): During the initial type
resolution process, when we define types recursively, we must
check first for types in our current scope before we perform
lookups in the enclosing scopes.
* expression.cs (MakeByteBlob): Handle Decimal blobs.
(Invocation.VerifyArgumentsCompat): Call
TypeManager.TypeToCoreType on the parameter_type.GetElementType.
I thought we were supposed to always call this, but there are a
few places in the code where we dont do it.
2002-09-17 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add support in -linkres and -resource to specify the
name of the identifier.
2002-09-16 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (StandardConversionExists): Sync with the conversion
code: allow anything-* to void* conversions.
(FindMostSpecificSource): Use an Expression argument
instead of a Type, because we might be handed over a Literal which
gets a few more implicit conversions that plain types do not. So
this information was being lost.
Also, we drop the temporary type-holder expression when not
required.
2002-09-17 Martin Baulig <martin@gnome.org>
* class.cs (PropertyBase.CheckBase): Don't check the base class if
this is an explicit interface implementation.
2002-09-17 Martin Baulig <martin@gnome.org>
* class.cs (PropertyBase.CheckBase): Make this work for indexers with
different `IndexerName' attributes.
* expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
(IndexerAccess): Added special protected ctor for BaseIndexerAccess and
virtual CommonResolve().
2002-09-16 Miguel de Icaza <miguel@ximian.com>
* enum.cs (LookupEnumValue): Use the EnumConstant declared type,
and convert that to the UnderlyingType.
* statement.cs (Foreach.Resolve): Indexers are just like variables
or PropertyAccesses.
* cs-tokenizer.cs (consume_string): Track line numbers and columns
inside quoted strings, we were not doing this before.
2002-09-16 Martin Baulig <martin@gnome.org>
* ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
resolve it. This is needed for the definite assignment check of the
instance expression, fixes bug #29846.
(PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
2002-09-16 Nick Drochak <ndrochak@gol.com>
* parameter.cs: Fix compile error. Cannot reference static member
from an instance object. Is this an mcs bug?
2002-09-14 Martin Baulig <martin@gnome.org>
* decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
multiple times. Fixes bug #30295, added test-166.cs.
2002-09-14 Martin Baulig <martin@gnome.org>
* statement.cs (Block.Emit): Don't emit unreachable code.
(Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
`break' statements.
(Goto.Emit, Continue.Emit): Set ec.Breaks = true.
2002-09-14 Martin Baulig <martin@gnome.org>
* parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
is set.
2002-09-14 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.IsNestedChildOf): This must return false
if `type == parent' since in this case `type.IsSubclassOf (parent)' will
be false on the ms runtime.
2002-09-13 Martin Baulig <martin@gnome.org>
* ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
the CS0038 error message.
2002-09-12 Miguel de Icaza <miguel@ximian.com>
* expression.cs (CheckedExpr, UnCheckedExpr): If we have a
constant inside, return it.
2002-09-12 Martin Baulig <martin@gnome.org>
* cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
implicit conversion can be done between enum types.
* enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
check whether an implicit conversion to the current enum's UnderlyingType
exists and report an error if not.
* codegen.cs (CodeGen.Init): Delete the symbol file when compiling
without debugging support.
* delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
2002-09-12 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.IsNestedChildOf): New method.
* ecore.cs (IMemberExpr.DeclaringType): New property.
(SimpleName.SimpleNameResolve): Check whether we're accessing a
nonstatic member of an outer type (CS0038).
2002-09-11 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Activate the using-error detector at warning level
4 (at least for MS-compatible APIs).
* namespace.cs (VerifyUsing): Small buglett fix.
* pending.cs (PendingImplementation): pass the container pointer.
* interface.cs (GetMethods): Allow for recursive definition. Long
term, I would like to move every type to support recursive
definitions, not the current ordering mechanism that we have right
now.
The situation is this: Attributes are handled before interfaces,
so we can apply attributes to interfaces. But some attributes
implement interfaces, we will now handle the simple cases
(recursive definitions will just get an error).
* parameter.cs: Only invalidate types at the end if we fail to
lookup all types.
2002-09-09 Martin Baulig <martin@gnome.org>
* ecore.cs (PropertyExpr.Emit): Also check for
TypeManager.system_int_array_get_length so this'll also work when
compiling corlib. Fixes #30003.
2002-09-09 Martin Baulig <martin@gnome.org>
* expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
and throw an exception if we can't get the type's size. Fixed #30040,
added test-165.cs.
2002-09-09 Martin Baulig <martin@gnome.org>
* ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
* expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
context. Fixes bug #30027.
* delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
virtual functions. Fixes bug #30043, added test-164.cs.
2002-09-08 Ravi Pratap <ravi@ximian.com>
* attribute.cs : Fix a small NullRef crash thanks to my stupidity.
2002-09-08 Nick Drochak <ndrochak@gol.com>
* driver.cs: Use an object to get the windows codepage since it's not a
static property.
2002-09-08 Miguel de Icaza <miguel@ximian.com>
* statement.cs (For.Emit): for infinite loops (test == null)
return whether there is a break inside, not always "true".
* namespace.cs (UsingEntry): New struct to hold the name of the
using definition, the location where it is defined, and whether it
has been used in a successful type lookup.
* rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
strings.
* decl.cs: ditto.
2002-09-06 Ravi Pratap <ravi@ximian.com>
* attribute.cs : Fix incorrect code which relied on catching
a NullReferenceException to detect a null being passed in
where an object was expected.
2002-09-06 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Try): flag the catch variable as assigned
* expression.cs (Cast): Simplified by using ResolveType instead of
manually resolving.
* statement.cs (Catch): Fix bug by using ResolveType.
2002-09-06 Ravi Pratap <ravi@ximian.com>
* expression.cs (BetterConversion): Special case for when we have
a NullLiteral as the argument and we have to choose between string
and object types - we choose string the way csc does.
* attribute.cs (Attribute.Resolve): Catch the
NullReferenceException and report error #182 since the Mono
runtime no more has the bug and having this exception raised means
we tried to select a constructor which takes an object and is
passed a null.
2002-09-05 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation.OverloadResolve): Flag a nicer error
message (1502, 1503) when we can't locate a method after overload
resolution. This is much more informative and closes the bug
Miguel reported.
* interface.cs (PopulateMethod): Return if there are no argument
types. Fixes a NullReferenceException bug.
* attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
expressions too. Previously we were checking only in one place for
positional arguments leaving out named arguments.
* ecore.cs (ImplicitNumericConversion): Conversion from underlying
type to the enum type is not allowed. Remove code corresponding to
that.
(ConvertNumericExplicit): Allow explicit conversions from
the underlying type to enum type. This precisely follows the spec
and closes a bug filed by Gonzalo.
2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* compiler.csproj:
* compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
2002-09-03 Miguel de Icaza <miguel@ximian.com>
* statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
it was important that we stored the right value after the
reduction in `converted'.
2002-09-04 Martin Baulig <martin@gnome.org>
* location.cs (Location.SymbolDocument): Use full pathnames for the
source files.
2002-08-30 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
of the expression resolve mechanism, because that will catch the
SimpleName error failures.
(Conditional): If we can not resolve the
expression, return, do not crash.
2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-tokenizer.cs:
(location): display token name instead of its number.
2002-08-28 Martin Baulig <martin@gnome.org>
* expression.cs (Binary.ResolveOperator): Don't silently return
but return an error if an operator cannot be applied between two
enum types.
2002-08-28 Martin Baulig <martin@gnome.org>
* class.cs (Constructor.Define): Set the permission attributes
correctly instead of making all constructors public.
2002-08-28 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
for private members before reporting a CS0103; if we find anything,
it's a CS0122.
2002-08-28 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.FilterWithClosure): It's not enough
to check whether `closure_start_type == closure_invocation_type',
we also need to check whether `m.DeclaringType == closure_invocation_type'
before bypassing the permission checks. We might be accessing
protected/private members from the base class.
(TypeManager.RealMemberLookup): Only set private_ok if private
members were requested via BindingFlags.NonPublic.
* ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
* expression.cs (MemberAccess.ResolveMemberAccess): Set
MethodGroupExpr.IsExplicitImpl if appropriate.
(Invocation.DoResolve): Don't report the CS0120 for explicit
interface implementations.
2002-08-27 Martin Baulig <martin@gnome.org>
* expression.cs (Invocation.DoResolve): If this is a static
method and we don't have an InstanceExpression, we must report
a CS0120.
2002-08-25 Martin Baulig <martin@gnome.org>
* expression.cs (Binary.ResolveOperator): Don't allow `!=' and
`==' between a valuetype and an object.
2002-08-25 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (TypeExpr): Provide a ToString method.
2002-08-24 Martin Baulig <martin@gnome.org>
* codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
now called proggie.dbg and it's a binary file.
2002-08-23 Martin Baulig <martin@gnome.org>
* decl.cs (MemberCache.AddMethods): Ignore varargs methods.
2002-08-23 Martin Baulig <martin@gnome.org>
* struct.cs (MyStructInfo.ctor): Make this work with empty
structs; it's not allowed to use foreach() on null.
2002-08-23 Martin Baulig <martin@gnome.org>
* codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
writer the full pathname of the generated assembly.
2002-08-23 Martin Baulig <martin@gnome.org>
* statements.cs (FlowBranching.UsageVector.MergeChildren):
A `finally' block never returns or breaks; improved handling of
unreachable code.
2002-08-23 Martin Baulig <martin@gnome.org>
* statement.cs (Throw.Resolve): Allow `throw null'.
2002-08-23 Martin Baulig <martin@gnome.org>
* expression.cs (MemberAccess.ResolveMemberAccess): If this is an
EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
`ee.EventInfo.DeclaringType == ec.ContainerType'. The
MemberLookup would return a wrong event if this is an explicit
interface implementation and the class has an event with the same
name.
2002-08-23 Martin Baulig <martin@gnome.org>
* statement.cs (Block.AddChildVariableNames): New public method.
(Block.AddChildVariableName): Likewise.
(Block.IsVariableNameUsedInChildBlock): Likewise.
(Block.AddVariable): Check whether a variable name has already
been used in a child block.
* cs-parser.jay (declare_local_variables): Mark all variable names
from the current block as being used in a child block in the
implicit block.
2002-08-23 Martin Baulig <martin@gnome.org>
* codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
find the symbol writer.
* driver.cs: csc also allows the arguments to /define being
separated by commas, not only by semicolons.
2002-08-23 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.GetMembers): Added static check for events.
2002-08-15 Martin Baulig <martin@gnome.org>
* class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
call, use ec.ContainerType.BaseType as queried_type and invocation_type.
* ecore.cs (Expression.MemberLookup): Added documentation and explained
why the MethodData.EmitDestructor() change was necessary.
2002-08-20 Martin Baulig <martin@gnome.org>
* class.cs (TypeContainer.FindMembers): Added static check for events.
* decl.cs (MemberCache.AddMembers): Handle events like normal members.
* typemanager.cs (TypeHandle.GetMembers): When queried for events only,
use Type.GetEvents(), not Type.FindMembers().
2002-08-20 Martin Baulig <martin@gnome.org>
* decl.cs (MemberCache): Added a special method cache which will
be used for method-only searched. This ensures that a method
search will return a MethodInfo with the correct ReflectedType for
inherited methods.
2002-08-20 Martin Baulig <martin@gnome.org>
* decl.cs (DeclSpace.FindMembers): Made this public.
2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* delegate.cs: fixed build on windows.
[FIXME: Filed as bug #29150: MCS must report these errors.]
2002-08-19 Ravi Pratap <ravi@ximian.com>
* ecore.cs (StandardConversionExists): Return a false
if we are trying to convert the void type to anything else
since that is not allowed.
* delegate.cs (DelegateInvocation.DoResolve): Ensure that
we flag error 70 in the event an event is trying to be accessed
directly from outside the declaring type.
2002-08-20 Martin Baulig <martin@gnome.org>
* typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
MemberCache from typemanager.cs to decl.cs.
2002-08-19 Martin Baulig <martin@gnome.org>
* class.cs (TypeContainer): Implement IMemberContainer.
(TypeContainer.DefineMembers): Create the MemberCache.
(TypeContainer.FindMembers): Do better BindingFlags checking; only
return public members if BindingFlags.Public was given, check
whether members are static.
2002-08-16 Martin Baulig <martin@gnome.org>
* decl.cs (DeclSpace.Define): Splitted this in Define and
DefineMembers. DefineMembers is called first and initializes the
MemberCache.
* rootcontext.cs (RootContext.DefineMembers): New function. Calls
DefineMembers() on all our DeclSpaces.
* class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
but call DefineMembers() on all nested interfaces. We call their
Define() in our new Define() function.
* interface.cs (Interface): Implement IMemberContainer.
(Interface.Define): Moved all code except the attribute stuf to
DefineMembers().
(Interface.DefineMembers): Initialize the member cache.
* typemanager.cs (IMemberFinder): Removed this interface, we don't
need this anymore since we can use MemberCache.FindMembers directly.
2002-08-19 Martin Baulig <martin@gnome.org>
* typemanager.cs (MemberCache): When creating the cache for an
interface type, add all inherited members.
(TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
to `out bool used_cache' and documented it.
(TypeManager.MemberLookup): If we already used the cache in the first
iteration, we don't need to do the interfaces check.
2002-08-19 Martin Baulig <martin@gnome.org>
* decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
here from IMemberFinder and don't implement this interface anymore.
(DeclSpace.MemberCache): Moved here from IMemberFinder.
* typemanager.cs (IMemberFinder): This interface is now only used by
classes which actually support the member cache.
(TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
since we only put DeclSpaces into this Hashtable.
(MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
a dynamic type and TypeHandle.GetTypeHandle() otherwise.
2002-08-16 Martin Baulig <martin@gnome.org>
* typemanager.cs (ICachingMemberFinder): Removed.
(IMemberFinder.MemberCache): New property.
(TypeManager.FindMembers): Merged this with RealFindMembers().
This function will never be called from TypeManager.MemberLookup()
so we can't use the cache here, just the IMemberFinder.
(TypeManager.MemberLookup_FindMembers): Check whether the
IMemberFinder has a MemberCache and call the cache's FindMembers
function.
(MemberCache): Rewrote larger parts of this yet another time and
cleaned it up a bit.
2002-08-15 Miguel de Icaza <miguel@ximian.com>
* driver.cs (LoadArgs): Support quoting.
(Usage): Show the CSC-like command line arguments.
Improved a few error messages.
2002-08-15 Martin Baulig <martin@gnome.org>
* typemanager.cs (IMemberContainer.Type): New property.
(IMemberContainer.IsInterface): New property.
The following changes are conditional to BROKEN_RUNTIME, which is
defined at the top of the file.
* typemanager.cs (MemberCache.MemberCache): Don't add the base
class'es members, but add all members from TypeHandle.ObjectType
if we're an interface.
(MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
is the current type.
(MemberCache.CacheEntry.Container): Removed this field.
(TypeHandle.GetMembers): Include inherited members.
2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* typemanager.cs: fixed compilation and added a comment on a field that
is never used.
2002-08-15 Martin Baulig <martin@gnome.org>
* class.cs (ConstructorInitializer.Resolve): In the
Expression.MemberLookup call, use the queried_type as
invocation_type.
* typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
declared' attribute, it's always true.
(IMemberContainer.Parent, IMemberContainer.Name): New properties.
(TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
temporary wrapper for FindMembers which tells MemberLookup whether
members from the base classes are included in the return value.
This will go away soon.
(TypeManager.MemberLookup): Use this temporary hack here; once the
new MemberCache is completed, we don't need to do the DeclaredOnly
looping here anymore since the MemberCache will take care of this.
(TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
(MemberCache): When creating the MemberCache for a class, get
members from the current class and all its base classes.
(MemberCache.CacheEntry.Container): New field. This is a
temporary hack until the Mono runtime is fixed to distinguish
between ReflectedType and DeclaringType. It allows us to use MCS
with both the MS runtime and the unfixed Mono runtime without
problems and without accecting performance.
(MemberCache.SearchMembers): The DeclaredOnly looping from
TypeManager.MemberLookup is now done here.
2002-08-14 Martin Baulig <martin@gnome.org>
* statement.cs (MyStructInfo.MyStructInfo): Don't call
Type.GetFields on dynamic types but get the fields from the
corresponding TypeContainer.
(MyStructInfo.GetStructInfo): Added check for enum types.
* typemanager.cs (MemberList.IsSynchronized): Implemented.
(MemberList.SyncRoot): Implemented.
(TypeManager.FilterWithClosure): No need to check permissions if
closure_start_type == closure_invocation_type, don't crash if
closure_invocation_type is null.
2002-08-13 Martin Baulig <martin@gnome.org>
Rewrote TypeContainer.FindMembers to use a member cache. This
gives us a speed increase of about 35% for the self-hosting MCS
build and of about 15-20% for the class libs (both on GNU/Linux).
* report.cs (Timer): New class to get enhanced profiling. This
whole class is "TIMER" conditional since it remarkably slows down
compilation speed.
* class.cs (MemberList): New class. This is an IList wrapper
which we're now using instead of passing MemberInfo[]'s around to
avoid copying this array unnecessarily.
(IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
(ICachingMemberFinder, IMemberContainer): New interface.
(TypeManager.FilterWithClosure): If `criteria' is null, the name
has already been checked, otherwise use it for the name comparision.
(TypeManager.FindMembers): Renamed to RealMemberFinder and
provided wrapper which tries to use ICachingMemberFinder.FindMembers
if possible. Returns a MemberList, not a MemberInfo [].
(TypeHandle): New class, implements IMemberContainer. We create
one instance of this class per type, it contains a MemberCache
which is used to do the member lookups.
(MemberCache): New class. Each instance of this class contains
all members of a type and a name-based hash table.
(MemberCache.FindMembers): This is our new member lookup
function. First, it looks up all members of the requested name in
the hash table. Then, it walks this list and sorts out all
applicable members and returns them.
2002-08-13 Martin Baulig <martin@gnome.org>
In addition to a nice code cleanup, this gives us a performance
increase of about 1.4% on GNU/Linux - not much, but it's already
half a second for the self-hosting MCS compilation.
* typemanager.cs (IMemberFinder): New interface. It is used by
TypeManager.FindMembers to call FindMembers on a TypeContainer,
Enum, Delegate or Interface.
(TypeManager.finder_to_member_finder): New PtrHashtable.
(TypeManager.finder_to_container): Removed.
(TypeManager.finder_to_delegate): Removed.
(TypeManager.finder_to_interface): Removed.
(TypeManager.finder_to_enum): Removed.
* interface.cs (Interface): Implement IMemberFinder.
* delegate.cs (Delegate): Implement IMemberFinder.
* enum.cs (Enum): Implement IMemberFinder.
* class.cs (TypeContainer): Implement IMemberFinder.
2002-08-12 Martin Baulig <martin@gnome.org>
* ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
2002-08-12 Martin Baulig <martin@gnome.org>
* ecore.cs (ITypeExpression): New interface for expressions which
resolve to a type.
(TypeExpression): Renamed to TypeLookupExpression.
(Expression.DoResolve): If we're doing a types-only lookup, the
expression must implement the ITypeExpression interface and we
call DoResolveType() on it.
(SimpleName): Implement the new ITypeExpression interface.
(SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
hack, the situation that we're only looking up types can't happen
anymore when this method is called. Moved the type lookup code to
DoResolveType() and call it.
(SimpleName.DoResolveType): This ITypeExpression interface method
is now doing the types-only lookup.
(TypeExpr, TypeLookupExpression): Implement ITypeExpression.
(ResolveFlags): Added MaskExprClass.
* expression.cs (MemberAccess): Implement the ITypeExpression
interface.
(MemberAccess.DoResolve): Added support for a types-only lookup
when we're called via ITypeExpression.DoResolveType().
(ComposedCast): Implement the ITypeExpression interface.
* codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
Expression.Resolve() with ResolveFlags.Type instead.
2002-08-12 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.Define): Apply attributes.
* attribute.cs (Attribute.ApplyAttributes): Added support for
interface attributes.
2002-08-11 Martin Baulig <martin@gnome.org>
* statement.cs (Block.Emit): Only check the "this" variable if we
do not always throw an exception.
* ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
whether the property has a set accessor.
2002-08-11 Martin Baulig <martin@gnome.org>
Added control flow analysis support for structs.
* ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
with control flow analysis turned off.
(IVariable): New interface.
(SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
(FieldExpr.DoResolve): Resolve the instance expression with flow
analysis turned off and do the definite assignment check after the
resolving when we know what the expression will resolve to.
* expression.cs (LocalVariableReference, ParameterReference):
Implement the new IVariable interface, only call the flow analysis
code if ec.DoFlowAnalysis is true.
(This): Added constructor which takes a Block argument. Implement
the new IVariable interface.
(MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
This does the definite assignment checks for struct members.
* class.cs (Constructor.Emit): If this is a non-static `struct'
constructor which doesn't have any initializer, call
Block.AddThisVariable() to tell the flow analysis code that all
struct elements must be initialized before control returns from
the constructor.
* statement.cs (MyStructInfo): New public class.
(UsageVector.this [VariableInfo vi]): Added `int field_idx'
argument to this indexer. If non-zero, check an individual struct
member, not the whole struct.
(FlowBranching.CheckOutParameters): Check struct members.
(FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
overloaded versions of these methods which take an additional
`int field_idx' argument to check struct members.
(FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
overloaded versions of these methods which take an additional
`string field_name' argument to check struct member.s
(VariableInfo): Implement the IVariable interface.
(VariableInfo.StructInfo): New public property. Returns the
MyStructInfo instance of the variable if it's a struct or null.
(Block.AddThisVariable): New public method. This is called from
Constructor.Emit() for non-static `struct' constructor which do
not have any initializer. It creates a special variable for the
"this" instance variable which will be checked by the flow
analysis code to ensure that all of the struct's fields are
initialized before control returns from the constructor.
(UsageVector): Added support for struct members. If a
variable/parameter is a struct with N members, we reserve a slot
in the usage vector for each member. A struct is considered fully
initialized if either the struct itself (slot 0) or all its
members are initialized.
2002-08-08 Martin Baulig <martin@gnome.org>
* driver.cs (Driver.MainDriver): Only report an error CS5001
if there were no compilation errors.
* codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
`UnsafeContext' property to determine whether the parent is in
unsafe context rather than checking the parent's ModFlags:
classes nested in an unsafe class are unsafe as well.
2002-08-08 Martin Baulig <martin@gnome.org>
* statement.cs (UsageVector.MergeChildren): Distinguish between
`Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
we return. Added test17() and test18() to test-154.cs.
2002-08-08 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.FilterWithClosure): If we have
Family access, make sure the invoking type isn't a subclass of the
queried type (that'd be a CS1540).
* ecore.cs (Expression.MemberLookup): Added overloaded version of
this method which takes an additional `Type invocation_type'.
* expression.cs (BaseAccess.DoResolve): Use the base type as
invocation and query type.
(MemberAccess.DoResolve): If the lookup failed and we're about to
report a CS0122, try a lookup with the ec.ContainerType - if this
succeeds, we must report a CS1540.
2002-08-08 Martin Baulig <martin@gnome.org>
* ecore.cs (IMemberExpr): Added `bool IsInstance' property.
(MethodGroupExpr): Implement the IMemberExpr interface.
* expression (MemberAccess.ResolveMemberAccess): No need to have
any special code for MethodGroupExprs anymore, they're now
IMemberExprs.
2002-08-08 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
Family, FamANDAssem and FamORAssem permissions.
(TypeManager.IsSubclassOrNestedChildOf): New public method.
2002-08-08 Martin Baulig <martin@gnome.org>
* statement.cs (FlowBranchingType): Added LOOP_BLOCK.
(UsageVector.MergeChildren): `break' breaks unless we're in a switch
or loop block.
Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
* driver.cs: implemented /resource option to embed managed resources.
2002-08-07 Martin Baulig <martin@gnome.org>
* class.cs (FieldBase.Initializer): Renamed to `init' and made private.
(FieldBase.HasFieldInitializer): New public property.
(FieldBase.GetInitializerExpression): New public method. Resolves and
returns the field initializer and makes sure it is only resolved once.
(TypeContainer.EmitFieldInitializers): Call
FieldBase.GetInitializerExpression to get the initializer, this ensures
that it isn't resolved multiple times.
* codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
the resolving process (SimpleName/MemberLookup) that we're currently
emitting a field initializer (which must not access any instance members,
this is an error CS0236).
* ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
argument, if the `IsFieldInitializer' flag is set, we must report and
error CS0236 and not an error CS0120.
2002-08-07 Martin Baulig <martin@gnome.org>
* ecore.cs (IMemberExpr): New public interface.
(FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
(SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
if the expression is an IMemberExpr.
* expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
to be null, implicitly default to `this' if we're non-static in
this case. Simplified the code a lot by using the new IMemberExpr
interface. Also fixed bug #28176 here.
2002-08-06 Martin Baulig <martin@gnome.org>
* cs-parser.jay (SimpleLookup): Removed. We need to create
ParameterReferences during semantic analysis so that we can do a
type-only search when resolving Cast, TypeOf and SizeOf.
(block): Pass the `current_local_parameters' to the Block's
constructor.
* class.cs (ConstructorInitializer): Added `Parameters parameters'
argument to the constructor.
(ConstructorInitializer.Resolve): Create a temporary implicit
block with the parameters.
* ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
references here if we aren't doing a type-only search.
* statement.cs (Block): Added constructor which takes a
`Parameters parameters' argument.
(Block.Parameters): New public property.
* support.cs (InternalParameters.Parameters): Renamed `parameters'
to `Parameters' and made it public readonly.
2002-08-06 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.Warning): Made this public as well.
* report.cs (Report.Debug): Print the contents of collections.
2002-08-06 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
used to tell Resolve() which kinds of expressions it may return.
(Expression.Resolve): Added overloaded version of this method which
takes a `ResolveFlags flags' argument. This can be used to tell
Resolve() which kinds of expressions it may return. Reports a
CS0118 on error.
(Expression.ResolveWithSimpleName): Removed, use Resolve() with
ResolveFlags.SimpleName.
(Expression.Error118): Added overloaded version of this method which
takes a `ResolveFlags flags' argument. It uses the flags to determine
which kinds of expressions are allowed.
* expression.cs (Argument.ResolveMethodGroup): New public method.
Resolves an argument, but allows a MethodGroup to be returned.
This is used when invoking a delegate.
* TODO: Updated a bit.
2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Fixed compilation with csc.
* ecore.cs: Expression.Error made public. Is this correct? Should
Warning be made public too?
* expression.cs: use ea.Location instead of ea.loc.
[FIXME: Filed as bug #28607: MCS must report these errors.]
2002-08-06 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.loc): Moved the location here instead of
duplicating it in all derived classes.
(Expression.Location): New public property.
(Expression.Error, Expression.Warning): Made them non-static and
removed the location argument.
(Expression.Warning): Added overloaded version which takes an
`int level' argument.
(Expression.Error118): Make this non-static and removed the
expression and location arguments.
(TypeExpr): Added location argument to the constructor.
* expression.cs (StaticCallExpr): Added location argument to
the constructor.
(Indirection, PointerArithmetic): Likewise.
(CheckedExpr, UnCheckedExpr): Likewise.
(ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
(StringPtr): Likewise.
2002-08-05 Martin Baulig <martin@gnome.org>
* expression.cs (BaseAccess.DoResolve): Actually report errors.
* assign.cs (Assign.DoResolve): Check whether the source
expression is a value or variable.
* statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
while resolving the corresponding blocks.
* interface.cs (Interface.GetInterfaceTypeByName): Actually report
an error, don't silently return null.
* statement.cs (Block.AddVariable): Do the error reporting here
and distinguish between CS0128 and CS0136.
(Block.DoResolve): Report all unused labels (warning CS0164).
(LabeledStatement): Pass the location to the constructor.
(LabeledStatement.HasBeenReferenced): New property.
(LabeledStatement.Resolve): Set it to true here.
* statement.cs (Return.Emit): Return success even after reporting
a type mismatch error (CS0126 or CS0127), this is what csc does and
it avoids confusing the users with any consecutive errors.
2002-08-05 Martin Baulig <martin@gnome.org>
* enum.cs (Enum.LookupEnumValue): Catch circular definitions.
* const.cs (Const.LookupConstantValue): Catch circular definitions.
* expression.cs (MemberAccess.DoResolve): Silently return if an
error has already been reported.
* ecore.cs (Expression.MemberLookupFinal): Silently return if an
error has already been reported.
2002-08-05 Martin Baulig <martin@gnome.org>
* statement.cs (UsageVector): Only initialize the `parameters'
vector if we actually have any "out" parameters.
2002-08-05 Martin Baulig <martin@gnome.org>
* expression.cs (Binary.ResolveOperator): When combining delegates,
they must have the same type.
2002-08-05 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.GetArgumentTypes): Don't call
PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
work with the ms runtime and we also don't need it: if we're a
PropertyBuilder and not in the `indexer_arguments' hash, then we
are a property and not an indexer.
* class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
Type.IsPointer and Type.IsByRef instead of Type.HasElementType
since the latter one doesn't work with the ms runtime.
2002-08-03 Martin Baulig <martin@gnome.org>
Fixed bugs #27998 and #22735.
* class.cs (Method.IsOperator): New public field.
(Method.CheckBase): Report CS0111 if there's already a method
with the same parameters in the current class. Report CS0508 when
attempting to change the return type of an inherited method.
(MethodData.Emit): Report CS0179 if a method doesn't have a body
and it's not marked abstract or extern.
(PropertyBase): New abstract base class for Property and Indexer.
(PropertyBase.CheckBase): Moved here from Property and made it work
for indexers.
(PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
the same so we can reuse it there.
(Property, Indexer): Derive from PropertyBase.
(MethodSignature.inheritable_property_signature_filter): New delegate
to find properties and indexers.
* decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
argument and improved error reporting.
* parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
EmptyReadOnlyParameters and made it a property.
* typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
version of this method which takes a `PropertyInfo indexer'.
(TypeManager.RegisterIndexer): New method.
* class.cs: Added myself as author of this file :-)
2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* class.cs: fixed compilation on windoze.
2002-08-03 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.GetInterfaceBases): Check whether all
base interfaces are at least as accessible than the current one.
* class.cs (TypeContainer.GetClassBases): Check whether base types
are at least as accessible than the current type.
(TypeContainer.AsAccessible): Implemented and made non-static.
(MemberBase.CheckParameters): Report errors if the accessibility
checks fail.
* delegate.cs (Delegate.Delegate): The default visibility is
internal for top-level types and private for nested types.
(Delegate.Define): Report errors if the accessibility checks fail.
* enum.cs (Enum.Enum): The default visibility is internal for
top-level types and private for nested types.
(Enum.DefineType): Compute the correct visibility.
* modifiers.cs (Modifiers.TypeAttr): Added a version of this
function which takes a `bool is_toplevel' instead of a TypeContainer.
* typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
builtin type.
2002-08-02 Martin Baulig <martin@gnome.org>
* expression.cs (LocalVariableReferenc): Added constructor which
takes additional `VariableInfo vi' and `bool is_readonly' arguments.
(LocalVariableReference.IsReadOnly): New property.
(LocalVariableReference.DoResolveLValue): Report a CS1604 if the
variable is readonly, use our own readonly flag to do this; you can
use the new constructor to get a writable reference to a read-only
variable.
* cs-parser.jay (foreach_statement, using_statement): Get a writable
reference to the local variable.
2002-08-01 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (ResolveCore): Also include System.Exception
* statement.cs (Block.Emit): Do not emit the dead-code warnings if
we reach an EmptyStatement.
(Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
is also fine.
* expression.cs (Binary.ResolveOperator): Check error result in
two places.
use brtrue/brfalse directly and avoid compares to null.
2002-08-02 Martin Baulig <martin@gnome.org>
* class.cs (TypeContainer.Define): Define all nested interfaces here.
Fixes bug #28407, added test-155.cs.
2002-08-01 Martin Baulig <martin@gnome.org>
* class.cs (Event.EmitDefaultMethod): Make this work with static
events. Fixes #28311, added verify-3.cs.
2002-08-01 Martin Baulig <martin@gnome.org>
* statement.cs (ForeachHelperMethods): Added `enumerator_type' and
`is_disposable' fields.
(Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
`hm.is_disposable' if we're using the collection pattern.
(Foreach.EmitCollectionForeach): Use the correct type for the
enumerator's local variable, only emit the try/finally block if
necessary (fixes #27713).
2002-08-01 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.report118): Renamed to Error118 and made
it public static.
* statement.cs (Throw.Resolve): Check whether the expression is of
the correct type (CS0118) and whether the type derives from
System.Exception (CS0155).
(Catch.Resolve): New method. Do the type lookup here and check
whether it derives from System.Exception (CS0155).
(Catch.CatchType, Catch.IsGeneral): New public properties.
* typemanager.cs (TypeManager.exception_type): Added.
2002-07-31 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Updated About function.
2002-07-31 Martin Baulig <martin@gnome.org>
Implemented Control Flow Analysis.
* codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
(EmitContext.CurrentBranching): Added.
(EmitContext.StartFlowBranching): Added.
(EmitContext.EndFlowBranching): Added.
(EmitContext.KillFlowBranching): Added.
(EmitContext.IsVariableAssigned): Added.
(EmitContext.SetVariableAssigned): Added.
(EmitContext.IsParameterAssigned): Added.
(EmitContext.SetParameterAssigned): Added.
(EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
Added control flow analysis stuff here.
* expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
resolve the expression as lvalue.
(LocalVariableReference.DoResolve): Check whether the variable has
already been assigned.
(ParameterReference.DoResolveLValue): Override lvalue resolve to mark
the parameter as assigned here.
(ParameterReference.DoResolve): Check whether the parameter has already
been assigned.
(Argument.Resolve): If it's a `ref' or `out' argument, resolve the
expression as lvalue.
* statement.cs (FlowBranching): New class for the flow analysis code.
(Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
(LabeledStatement.IsDefined): New public property.
(LabeledStatement.AddUsageVector): New public method to tell flow
analyis that the label may be reached via a forward jump.
(GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
flow analysis.
(VariableInfo.Number): New public field. This is used by flow analysis
to number all locals of a block.
(Block.CountVariables): New public property. This is the number of
local variables in this block (including the locals from all parent
blocks).
(Block.EmitMeta): Number all the variables.
* statement.cs: Added flow analysis support to all classes.
2002-07-31 Martin Baulig <martin@gnome.org>
* driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
To get debugging messages, compile mcs with /define:MCS_DEBUG and
then use this argument.
* report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
* makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
use this to specify /define options.
2002-07-29 Martin Baulig <martin@gnome.org>
* statement.cs (Fixed): Moved all code that does variable lookups
and resolvings from Emit to Resolve.
* statement.cs (For): Moved all code that does variable lookups
and resolvings from Emit to Resolve.
* statement.cs (Using): Moved all code that does variable lookups
and resolvings from Emit to Resolve.
2002-07-29 Martin Baulig <martin@gnome.org>
* attribute.cs (Attribute.Resolve): Explicitly catch a
System.NullReferenceException when creating the
CustromAttributeBuilder and report a different warning message.
2002-07-29 Martin Baulig <martin@gnome.org>
* support.cs (ParameterData.ParameterName): Added method to
get the name of a parameter.
* typemanager.cs (TypeManager.IsValueType): New public method.
2002-07-29 Martin Baulig <martin@gnome.org>
* parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
is a flag which specifies that it's either ref or out.
(Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
the out parameter to `out Parameter.Modifier mod', also set the
Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
* support.cs (InternalParameters.ParameterModifier): Distinguish
between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
Parameter.Modifier.ISBYREF flag if it's either ref or out.
* expression.cs (Argument.GetParameterModifier): Distinguish
between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
Parameter.Modifier.ISBYREF flag if it's either ref or out.
2002-07-29 Martin Baulig <martin@gnome.org>
* expression.cs (ParameterReference.ParameterReference): Added
`Location loc' argument to the constructor.
* cs-parser.jay: Pass location to ParameterReference.
2002-07-28 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Try): Initialize the location.
* cs-parser.jay: pass location to Try.
* expression.cs (Unary.Reduce): Change the prototype to return
whether a constant fold could be performed or not. The result is
returned in an out parameters. In the case of Indirection and
AddressOf, we want to perform the full tests.
2002-07-26 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Statement.Emit): Flag dead code.
2002-07-27 Andrew Birkett <andy@nobugs.org>
* expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
2002-07-27 Martin Baulig <martin@gnome.org>
* class.cs (MethodData.Define): Put back call to
TypeManager.AddMethod(), accidentally commented this out.
* report.cs (Debug): New public method to print debugging information,
this is `[Conditional ("DEBUG")]'.
2002-07-26 Martin Baulig <martin@gnome.org>
* cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
(switch_statement): Push the current_block to the switch_stack and
pop it again when we're done with the switch.
(switch_section): The new block is a child of the current_block.
Fixes bug #24007, added test-152.cs.
2002-07-27 Martin Baulig <martin@gnome.org>
* expression.cs (Invocation.EmitArguments): When calling a varargs
function with only its fixed arguments, we need to pass an empty
array.
2002-07-27 Martin Baulig <martin@gnome.org>
Mono 0.13 has been released.
2002-07-25 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Rename --resource to --linkres, because that is what
we do currently, we dont support --resource yet.
* cs-tokenizer.cs: Fix test for reporting endif mismatches.
2002-07-25 Martin Baulig <martin@gnome.org>
* class.cs (MethodData): New public class. This is a `method builder'
class for a method or one accessor of a Property/Indexer/Event.
(MethodData.GetMethodFlags): Moved here from MemberBase.
(MethodData.ApplyAttributes): Likewise.
(MethodData.ApplyObsoleteAttribute): Likewise.
(MethodData.ApplyConditionalAttribute): Likewise.
(MethodData.ApplyDllImportAttribute): Likewise.
(MethodData.CheckAbstractAndExternal): Likewise.
(MethodData.Define): Formerly knows as MemberBase.DefineMethod().
(MethodData.Emit): Formerly known as Method.Emit().
(MemberBase): Moved everything which was specific to a single
accessor/method to MethodData.
(Method): Create a new MethodData and call Define() and Emit() on it.
(Property, Indexer, Event): Create a new MethodData objects for each
accessor and call Define() and Emit() on them.
2002-07-25 Martin Baulig <martin@gnome.org>
Made MethodCore derive from MemberBase to reuse the code from there.
MemberBase now also checks for attributes.
* class.cs (MethodCore): Derive from MemberBase, not MemberCore.
(MemberBase.GetMethodFlags): Moved here from class Method and marked
as virtual.
(MemberBase.DefineAccessor): Renamed to DefineMethod(), added
`CallingConventions cc' and `Attributes opt_attrs' arguments.
(MemberBase.ApplyAttributes): New virtual method; applies the
attributes to a method or accessor.
(MemberBase.ApplyObsoleteAttribute): New protected virtual method.
(MemberBase.ApplyConditionalAttribute): Likewise.
(MemberBase.ApplyDllImportAttribute): Likewise.
(MemberBase.CheckAbstractAndExternal): Likewise.
(MethodCore.ParameterTypes): This is now a property instead of a
method, it's initialized from DoDefineParameters().
(MethodCore.ParameterInfo): Removed the set accessor.
(MethodCore.DoDefineParameters): New protected virtual method to
initialize ParameterTypes and ParameterInfo.
(Method.GetReturnType): We can now simply return the MemberType.
(Method.GetMethodFlags): Override the MemberBase version and add
the conditional flags.
(Method.CheckBase): Moved some code from Define() here, call
DoDefineParameters() here.
(Method.Define): Use DoDefine() and DefineMethod() from MemberBase
here to avoid some larger code duplication.
(Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
ensure that abstract and external accessors don't declare a body.
* attribute.cs (Attribute.GetValidPieces): Make this actually work:
`System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
lookup in the attribute's parent classes, so we need to abort as soon
as we found the first match.
(Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
the attribute has no arguments.
* typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
of a Method.
2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-parser.jay: reverted previous patch.
2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-parser.jay: fixed bug #22119.
2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* attribute.cs: fixed compilation. The error was:
"attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
be assigned to before control leaves the current method."
[FIXME: Filed as bug #28186: MCS must report this error.]
2002-07-25 Martin Baulig <martin@gnome.org>
* attribute.cs (Attribute.Conditional_GetConditionName): New static
method to pull the condition name ouf of a Conditional attribute.
(Attribute.Obsolete_GetObsoleteMessage): New static method to pull
the obsolete message and error flag out of an Obsolete attribute.
* class.cs (Method.GetMethodFlags): New public method to get the
TypeManager.MethodFlags for this method.
(Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
private methods.
(Method.Define): Get and apply the Obsolete and Conditional attributes;
if we're overriding a virtual function, set the new private variable
`parent_method'; call the new TypeManager.AddMethod().
* typemanager.cs (TypeManager.AddMethod): New static method. Stores
the MethodBuilder and the Method in a PtrHashtable.
(TypeManager.builder_to_method): Added for this purpose.
(TypeManager.MethodFlags): Added IsObsoleteError.
(TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
Obsolete and Conditional arguments in MethodBuilders. If we discover
an Obsolete attribute, emit an appropriate warning 618 / error 619 with
the message from the attribute.
2002-07-24 Martin Baulig <martin@gnome.org>
* cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
preprocessor directives, ensure that the argument to #define/#undef is
exactly one identifier and that it's actually an identifier.
Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
did not work ....
2002-07-24 Martin Baulig <martin@gnome.org>
* statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
initialize it to TypeManager.object_type in the constructor.
(Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
of the `hm.get_current' method if we're using the collection pattern.
(Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
for the explicit conversion to make it work when we're using the collection
pattern and the `Current' property has a different return type than `object'.
Fixes #27713.
2002-07-24 Martin Baulig <martin@gnome.org>
* delegate.cs (Delegate.VerifyMethod): Simply return null if the method
does not match, but don't report any errors. This method is called in
order for all methods in a MethodGroupExpr until a matching method is
found, so we don't want to bail out if the first method doesn't match.
(NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
matches, report the 123. Fixes #28070.
2002-07-24 Martin Baulig <martin@gnome.org>
* expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
TypeManager.TypeToCoreType() to the top of the method so the
following equality checks will work. Fixes #28107.
2002-07-24 Martin Baulig <martin@gnome.org>
* cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
operand is of type uint, and the other operand is of type sbyte,
short or int, the operands are converted to type long." -
Actually do what this comment already told us. Fixes bug #28106,
added test-150.cs.
2002-07-24 Martin Baulig <martin@gnome.org>
* class.cs (MethodBase): New abstract class. This is now a base
class for Property, Indexer and Event to avoid some code duplication
in their Define() and DefineMethods() methods.
(MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
generic methods for Define() and DefineMethods().
(FieldBase): Derive from MemberBase, not MemberCore.
(Property): Derive from MemberBase, not MemberCore.
(Property.DefineMethod): Moved all the code from this method to the
new MethodBase.DefineAccessor(), just call it with appropriate
argumetnts.
(Property.Define): Call the new Property.DoDefine(), this does some
sanity checks and we don't need to duplicate the code everywhere.
(Event): Derive from MemberBase, not MemberCore.
(Event.Define): Use the new MethodBase.DefineAccessor() to define the
accessors, this will also make them work with interface events.
(Indexer): Derive from MemberBase, not MemberCore.
(Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
(Indexer.Define): Use the new MethodBase functions.
* interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
argument to the constructor.
(Interface.FindMembers): Added support for interface events.
(Interface.PopluateEvent): Implemented.
Added test-149.cs for this. This also fixes bugs #26067 and #24256.
2002-07-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
but this is required to check for a method name being the same as
the containing class.
Handle this now.
2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* interface.cs: initialize variable.
2002-07-23 Martin Baulig <martin@gnome.org>
Implemented the IndexerName attribute in interfaces.
* class.cs (TypeContainer.DefineIndexers): Don't set the indexer
name if this is an explicit interface implementation.
(Indexer.InterfaceIndexerName): New public variable. If we're
implementing an interface indexer, this is the IndexerName in that
interface. Otherwise, it's the IndexerName.
(Indexer.DefineMethod): If we're implementing interface indexer,
set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
and Pending.ImplementIndexer methods.
(Indexer.Define): Also define the PropertyBuilder if we're
implementing an interface indexer and this is neither an explicit
interface implementation nor do the IndexerName match the one in
the interface.
* pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
If a method is defined here, then we always need to create a proxy
for it. This is used when implementing interface indexers.
(Pending.IsInterfaceIndexer): New public method.
(Pending.ImplementIndexer): New public method.
(Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
This is used when implementing interface indexers to define a proxy
if necessary.
(Pending.VerifyPendingMethods): Look in the `need_proxy' array and
define a proxy if necessary.
* interface.cs (Interface.IndexerName): New public variable.
(Interface.PopulateIndexer): Set the IndexerName.
(Interface.DefineIndexers): New private method. Populate all the
indexers and make sure their IndexerNames match.
* typemanager.cs (IndexerPropertyName): Added support for interface
indexers.
2002-07-22 Martin Baulig <martin@gnome.org>
* codegen.cs (EmitContext.HasReturnLabel): New public variable.
(EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
ret if HasReturnLabel.
(EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
variables.
* statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
and set the ec.LoopBeginTryCatchLevel.
(Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
(Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
the current ec.TryCatchLevel, the branch goes out of an exception
block. In this case, we need to use Leave and not Br.
2002-07-22 Martin Baulig <martin@gnome.org>
* statement.cs (Try.Emit): Emit an explicit ret after the end of the
block unless the block does not always return or it is contained in
another try { ... } catch { ... } block. Fixes bug #26506.
Added verify-1.cs to the test suite.
2002-07-22 Martin Baulig <martin@gnome.org>
* statement.cs (Switch.TableSwitchEmit): If we don't have a default,
then we do not always return. Fixes bug #24985.
2002-07-22 Martin Baulig <martin@gnome.org>
* expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
lookup on a per-class level; ie. walk up the class hierarchy until we
found at least one applicable method, then choose the best among them.
Fixes bug #24463 and test-29.cs.
2002-07-22 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
return types of the methods. The return type is not part of the
signature and we must not check it to make the `new' modifier work.
Fixes bug #27999, also added test-147.cs.
(TypeManager.TypeToCoreType): Added TypeManager.type_type.
* expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
on the method's return type.
2002-07-21 Martin Baulig <martin@gnome.org>
* assign.cs: Make this work if the rightmost source is a constant and
we need to do an implicit type conversion. Also adding a few more tests
to test-38.cs which should have caught this.
* makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
target in the makefile for this. The makefile.gnu is primarily intended
for end-users who don't want to debug the compiler.
2002-07-21 Martin Baulig <martin@gnome.org>
* assign.cs: Improved the Assign class so it can now handle embedded
assignments (X = Y = Z = something). As a side-effect this'll now also
consume less local variables. test-38.cs now passes with MCS, added
a few new test cases to that test.
2002-07-20 Martin Baulig <martin@gnome.org>
* expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
instructions. Fixes bug #27977, also added test-146.cs.
2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* cs-tokenizer.cs: fixed getHex ().
2002-07-19 Martin Baulig <martin@gnome.org>
* expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
not Type.GetType() to lookup the array type. This is needed when
we're constructing an array of a user-defined type.
(ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
single-dimensional arrays, but also for single-dimensial arrays of
type decimal.
2002-07-19 Martin Baulig <martin@gnome.org>
* expression.cs (New.DoEmit): Create a new LocalTemporary each time
this function is called, it's not allowed to share LocalBuilders
among ILGenerators.
2002-07-19 Martin Baulig <martin@gnome.org>
* expression.cs (Argument.Resolve): Report an error 118 when trying
to pass a type as argument.
2002-07-18 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
Conv_R_Un for the signed `long' type.
2002-07-15 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberAccess.DoResolve): Do not reuse the field
`expr' for the temporary result, as that will fail if we do
multiple resolves on the same expression.
2002-07-05 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
ec.TypeContainer for looking up aliases.
* class.cs (TypeContainer): Remove LookupAlias from here.
* decl.cs (DeclSpace); Move here.
2002-07-01 Miguel de Icaza <miguel@ximian.com>
* class.cs (FindMembers): Only call filter if the constructor
bulider is not null.
Also handle delegates in `NestedTypes' now. Now we will perform
type lookups using the standard resolution process. This also
fixes a bug.
* decl.cs (DeclSpace.ResolveType): New type resolution routine.
This uses Expressions (the limited kind that can be parsed by the
tree) instead of strings.
* expression.cs (ComposedCast.ToString): Implement, used to flag
errors since now we have to render expressions.
(ArrayCreation): Kill FormElementType. Use ComposedCasts in
FormArrayType.
* ecore.cs (SimpleName.ToString): ditto.
* cs-parser.jay: Instead of using strings to assemble types, use
Expressions to assemble the type (using SimpleName, ComposedCast,
MemberAccess). This should fix the type lookups in declarations,
because we were using a different code path for this.
* statement.cs (Block.Resolve): Continue processing statements
even when there is an error.
2002-07-17 Miguel de Icaza <miguel@ximian.com>
* class.cs (Event.Define): Also remove the `remove' method from
the list of pending items.
* expression.cs (ParameterReference): Use ldarg.N (0..3) to
generate more compact code.
2002-07-17 Martin Baulig <martin@gnome.org>
* const.cs (Const.LookupConstantValue): Add support for constant
`unchecked' and `checked' expressions.
Also adding test case test-140.cs for this.
2002-07-17 Martin Baulig <martin@gnome.org>
* statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
check whether mi.ReturnType implements the IEnumerator interface; the
`==' and the IsAssignableFrom() will fail in this situation.
2002-07-16 Ravi Pratap <ravi@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
here too.
2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* expression.cs: fixed bug #27811.
2002-07-14 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ParameterReference.AddressOf): Patch from Paolo
Molaro: when we are a ref, the value already contains a pointer
value, do not take the address of it.
2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* removed mb-parser.jay and mb-tokenizer.cs
Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs: check against the building corlib void type.
Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs: fix for valuetype static readonly fields: when
initializing them, we need their address, not the address of a copy.
Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs: register also enum_type in corlib.
Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: allow calling this (but not base) initializers in structs.
Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs: make sure we compare against the building base types
in GetTypeSize ().
Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs: fix TypeToCoreType() to handle void and object
(corlib gets no more typerefs after this change).
2002-07-12 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayCreation.EmitArrayArguments): use
Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
(ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
array indexes, the runtime actually forbids them.
* ecore.cs (ExpressionToArrayArgument): Move the conversion code
for array arguments here.
* expression.cs (EmitLoadOpcode): System.Char is a U2, use that
instead of the default for ValueTypes.
(New.DoEmit): Use IsValueType instead of
IsSubclassOf (value_type)
(New.DoResolve): ditto.
(Invocation.EmitCall): ditto.
* assign.cs (Assign): ditto.
* statement.cs (Unsafe): Ok, so I got the semantics wrong.
Statements *are* currently doing part of their resolution during
Emit.
Expressions do always resolve during resolve, but statements are
only required to propagate resolution to their children.
2002-07-11 Miguel de Icaza <miguel@ximian.com>
* driver.cs (CSCParseOption): Finish the /r: and /lib: support.
(LoadAssembly): Do not add the dll if it is already specified
(MainDriver): Add the System directory to the link path at the end,
after all the other -L arguments.
* expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
wrong opcode for loading bytes and bools (ldelem.i1 instead of
ldelem.u1) and using the opposite for sbytes.
This fixes Digger, and we can finally run it.
* driver.cs (UnixParseOption): Move the option parsing here.
(CSCParseOption): Implement CSC-like parsing of options.
We now support both modes of operation, the old Unix way, and the
new CSC-like way. This should help those who wanted to make cross
platform makefiles.
The only thing broken is that /r:, /reference: and /lib: are not
implemented, because I want to make those have the same semantics
as the CSC compiler has, and kill once and for all the confussion
around this. Will be doing this tomorrow.
* statement.cs (Unsafe.Resolve): The state is checked during
resolve, not emit, so we have to set the flags for IsUnsfe here.
2002-07-10 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberAccess.ResolveMemberAccess): Since we can
not catch the Error_ObjectRefRequired in SimpleName (as it is
possible to have a class/instance variable name that later gets
deambiguated), we have to check this here.
2002-07-10 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
make static and put into Expression.
(Event.Define): Register the private field of the event with the
TypeManager so that GetFieldFromEvent can get at it.
(TypeManager.RegisterPrivateFieldOfEvent): Implement to
keep track of the private field associated with an event which
has no accessors.
(TypeManager.GetPrivateFieldOfEvent): Implement to get at the
private field.
* ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
2002-07-10 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.EmitBranchable): this routine emits the
Binary expression in a branchable context. This basically means:
we need to branch somewhere, not just get the value on the stack.
This works together with Statement.EmitBoolExpression.
* statement.cs (Statement.EmitBoolExpression): Use
EmitBranchable.
2002-07-09 Miguel de Icaza <miguel@ximian.com>
* statement.cs (For): Reduce the number of jumps in loops.
(For): Implement loop inversion for the For statement.
(Break): We can be breaking out of a Try/Catch controlled section
(foreach might have an implicit try/catch clause), so we need to
use Leave instead of Br.
* ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
now). If the instace expression supports IMemoryLocation, we use
the AddressOf method from the IMemoryLocation to extract the
address instead of emitting the instance.
This showed up with `This', as we were emitting the instance
always (Emit) instead of the Address of This. Particularly
interesting when This is a value type, as we dont want the Emit
effect (which was to load the object).
2002-07-08 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Pass the entry point to the DefinePInvokeMethod
* statement.cs (Checked): Set the CheckedState during the resolve
process too, as the ConvCast operations track the checked state on
the resolve process, and not emit.
* cs-parser.jay (namespace_member_declaration): Flag that we have
found a declaration when we do. This is used to flag error 1529
* driver.cs: Report ok when we display the help only.
2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
* cs-tokenizer.cs (xtoken): Improve handling of string literals.
2002-07-04 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (define): We also have to track locally the
defines. AllDefines is just used for the Conditional Attribute,
but we also need the local defines for the current source code.
2002-07-03 Miguel de Icaza <miguel@ximian.com>
* statement.cs (While, For, Do): These loops can exit through a
Break statement, use this information to tell whether the
statement is the last piece of code.
(Break): Flag that we break.
* codegen.cs (EmitContexts): New `Breaks' state variable.
2002-07-03 Martin Baulig <martin@gnome.org>
* class.cs (TypeContainer.MethodModifiersValid): Allow override
modifiers in method declarations in structs. Otherwise, you won't
be able to override things like Object.Equals().
2002-07-02 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method, Property, Indexer): Do not allow the public
modifier to be used in explicit interface implementations.
(TypeContainer.MethodModifiersValid): Catch virtual, abstract and
override modifiers in method declarations in structs
2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
* cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
integer or real overflow, report an error
2002-07-02 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.InitCoreTypes): When compiling
corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
to tell the runtime about our newly created System.Object and
System.ValueType types.
2002-07-02 Miguel de Icaza <miguel@ximian.com>
* expression.cs (This): Use Stobj/Ldobj when we are a member of a
struct instead of Ldarg/Starg.
2002-07-02 Martin Baulig <martin@gnome.org>
* expression.cs (Indirection.Indirection): Call
TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
2002-07-02 Martin Baulig <martin@gnome.org>
* expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
ValueType, call TypeManager.TypeToCoreType() on it.
(Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
the OpCodes.Newarr argument.
2002-07-02 Martin Baulig <martin@gnome.org>
* expression.cs (Invocation.EmitCall): When compiling corlib,
replace all calls to the system's System.Array type to calls to
the newly created one.
* typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
System.Array methods.
(TypeManager.InitCoreTypes): When compiling corlib, get the methods
from the system's System.Array type which must be replaced.
Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs: load unverifiable_code_ctor so we can build
corlib using the correct type. Avoid using GetTypeCode() with
TypeBuilders.
* rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
TypeManager.object_type to allow building corlib.
Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs: handle System.Enum separately in LoadFromPtr().
2002-07-01 Martin Baulig <martin@gnome.org>
* class.cs: Make the last change actually work, we need to check
whether `ifaces != null' to avoid a crash.
Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: when we build structs without fields that implement
interfaces, we need to add the interfaces separately, since there is
no API to both set the size and add the interfaces at type creation
time.
Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs: the dimension arguments to the array constructors
need to be converted if they are a long.
Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: don't emit ldarg.0 if there is no parent constructor
(fixes showstopper for corlib).
2002-06-29 Martin Baulig <martin@gnome.org>
MCS now compiles corlib on GNU/Linux :-)
* attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
ie. check for MethodImplOptions.InternalCall.
* class.cs (TypeContainer.DefineType): When compiling corlib, both parent
and TypeManager.attribute_type are null, so we must explicitly check
whether parent is not null to find out whether it's an attribute type.
(Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
and SetBuilder, not only if the property is neither abstract nor external.
This is necessary to set the MethodImplOptions on the accessor methods.
(Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
SetBuilder, see Property.Emit().
* rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
populate "System.Object", "System.ValueType" and "System.Attribute" since
they've already been populated from BootCorlib_PopulateCoreTypes().
2002-06-29 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
is the NullLiteral, we also need to make sure that target_type is not
an enum type.
2002-06-29 Martin Baulig <martin@gnome.org>
* rootcontext.cs (RootContext.ResolveCore): We must initialize
`TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
before calling BootstrapCorlib_ResolveDelegate ().
2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* statement.cs: fixed build-breaker. All tests passed ok.
2002-06-27 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
for System.Decimal when compiling corlib.
2002-06-27 Martin Baulig <martin@gnome.org>
* statement.cs (Switch.TableSwitchEmit): Make this work with empty
switch blocks which contain nothing but a default clause.
2002-06-26 Andrew <adb@tardis.ed.ac.uk>
* ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
2002-06-27 Martin Baulig <martin@gnome.org>
* ecore.cs (PropertyExpr.PropertyExpr): Call
TypeManager.TypeToCoreType() on the `pi.PropertyType'.
* typemanager.cs (TypeManager.TypeToCoreType): Return if the type
is already a TypeBuilder.
2002-06-27 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.ImplicitReferenceConversionExists): Use
`target_type == TypeManager.array_type', not IsAssignableFrom() in
the "from an array-type to System.Array" case. This makes it work
when compiling corlib.
2002-06-27 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.SimpleNameResolve): If the expression is a
non-static PropertyExpr, set its InstanceExpression. This makes
the `ICollection.Count' property work in System/Array.cs.
2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
* driver.cs: Made error handling more consistent. Errors now
tracked by Report class, so many methods which used to return int
now return void. Main() now prints success/failure and
errors/warnings message.
Renamed '--probe' compiler argument to '--expect-error'. Removed
the magic number return values (123 and 124). Now, if the
expected error occurs, the compiler exits with success (exit value
0). If the compilation completes without seeing that particular
error, the compiler exits with failure (exit value 1). The
makefile in mcs/errors has been changed to handle the new behaviour.
* report.cs: Made 'expected error' number a property and renamed
it from 'Probe' to 'ExpectedError'.
* genericparser.cs: Removed error handling support, since it is
now all done by Report class.
* cs-parser.jay, mb-parser.jay: Errors are tracked by Report
class, so parse() no longer returns an int.
* namespace.cs: Use Report.Error instead of GenericParser.error
2002-06-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
TypeContainer.AddOperator): At the front of the list put the
explicit implementations, so they get resolved/defined first.
2002-06-21 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.VerifyImplements): Verifies that a given
interface type is implemented by this TypeContainer. Used during
explicit interface implementation.
(Property.Define, Indexer.Define, Method.Define): Validate that
the given interface in the explicit implementation is one of the
base classes for the containing type.
Also if we are explicitly implementing an interface, but there is
no match in the pending implementation table, report an error.
(Property.Define): Only define the property if we are
not explicitly implementing a property from an interface. Use the
correct name also for those properties (the same CSC uses,
although that is really not needed).
(Property.Emit): Do not emit attributes for explicitly implemented
properties, as there is no TypeBuilder.
(Indexer.Emit): ditto.
Hiding then means that we do not really *implement* a pending
implementation, which makes code fail.
2002-06-22 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
the return value of Object.GetType(). [FIXME: we need to do this whenever
we get a type back from the reflection library].
Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
2002-06-20 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Return null if we can not look up the type.
* class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
the interface types found.
* interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
interface types found.
* typemanager.cs (GetInterfaces): Make this routine returns alll
the interfaces and work around the lame differences between
System.Type and System.Reflection.Emit.TypeBuilder in the results
result for GetInterfaces.
(ExpandInterfaces): Given an array of interface types, expand and
eliminate repeated ocurrences of an interface. This expands in
context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
be IA, IB, IC.
2002-06-21 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
on System.Enum.
2002-06-21 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
and called with one of the core types, return the corresponding typebuilder for
that type.
* expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
element type.
2002-06-21 Martin Baulig <martin@gnome.org>
* ecore.cs (Expression.ExplicitReferenceConversionExists): Use
`target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
(Expression.ConvertReferenceExplicit): Likewise.
* expression.cs (ElementAccess.DoResolve): Likewise.
(ElementAccess.DoResolveLValue): Likewise.
2002-06-10 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
add the "value" parameter to the parameter list.
* statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
to our caller.
2002-06-19 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
the argument to an int, uint, long or ulong, per the spec. Also
catch negative constants in array creation.
Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: do not allow the same interface to appear twice in
the definition list.
Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs: don't use ldlen with System.Array.
Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
* modifiers.cs: produce correct field attributes for protected
internal. Easy fix so miguel can work on ther harder stuff:-)
2002-06-18 Miguel de Icaza <miguel@ximian.com>
* pending.cs: New file. Move the code from class.cs here.
Support clearning the pending flag for all methods (when not doing
explicit interface implementation).
Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
* rootcontext.cs: added a couple more types needed to bootstrap.
2002-06-17 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (GetConstructor): Use DeclaredOnly to look the
constructor in the type, instead of any constructor in the type
hierarchy. Thanks to Paolo for finding this bug (it showed up as
a bug in the Mono runtime when applying the params attribute).
2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
2002-06-14 Rachel Hestilow <hestilow@ximian.com>
* expression.cs (Unary.ResolveOperator): Use TypeManager
to resolve the type.
2002-06-13 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (enum_member_declaration): Pass in the attributes
attached.
* enum.cs (AddEnumMember): Add support to store the attributes associated
with each member too.
* attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
field builders too - this takes care of the enum member case.
2002-06-10 Rachel Hestilow <hestilow@ximian.com>
* typemanager.cs (TypeManager.VerifyUnManaged): Allow
address-of operator on both value types and pointers.
2002-06-10 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.PopulateIndexer): Add the indexer's
PropertyBuilder to the `property_builders' list.
* expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
(Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
`lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
find any indexers which are inherited from an interface.
2002-06-09 Martin Baulig <martin@gnome.org>
* const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
the same type as the constant if necessary. There's also a test-130.cs
for this.
* enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
* typemanager.cs (TypeManager.ChangeType): Previously known as
Enum.ChangeEnumType().
2002-06-09 Martin Baulig <martin@gnome.org>
* expression.cs (Cast.TryReduce): Added support for consts.
2002-06-08 Ravi Pratap <ravi@ximian.com>
* class.cs (Accessor): Hold attributes information so we can pass
it along.
* cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
Modify to pass in attributes attached to the methods.
(add_accessor_declaration, remove_accessor_declaration): Ditto.
* attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
to handle the Accessor kind :-)
* class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
2002-06-08 Martin Baulig <martin@gnome.org>
* expression.cs (Unary.TryReduceNegative): Added support for
ULongConstants.
2002-06-08 Martin Baulig <martin@gnome.org>
* enum.cs (Enum.LookupEnumValue): Don't report an error if the
name can't be found in the `defined_names' - the caller will do a
MemberLookup in this case and thus find methods in System.Enum
such as Enum.IsDefined().
2002-06-08 Martin Baulig <martin@gnome.org>
* enum.cs (Enum.ChangeEnumType): This is a custom version of
Convert.ChangeType() which works with TypeBuilder created types.
(Enum.LookupEnumValue, Enum.Define): Use it here.
* class.cs (TypeContainer.RegisterRequiredImplementations): Added
`TypeBuilder.BaseType != null' check.
(TypeContainer.FindMembers): Only lookup parent members if we
actually have a parent.
(Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
(ConstructorInitializer.Resolve): Likewise.
* interface.cs (Interface.FindMembers): Added
`TypeBuilder.BaseType != null' check.
* rootcontext.cs (RootContext.ResolveCore): Added
"System.Runtime.CompilerServices.IndexerNameAttribute" to
classes_second_stage.
* typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
debug_type and trace_type when compiling with --nostdlib.
2002-06-07 Martin Baulig <martin@gnome.org>
* class.cs (TypeContainer): Added `have_nonstatic_fields' field.
(AddField): Set it to true when adding a non-static field.
(DefineType): Use `have_nonstatic_fields' to find out whether we
have non-static fields, not `Fields != null'.
2002-06-02 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleNameResolve): Removed simple bug (we were
dereferencing a null on the static-field code path)
2002-05-30 Martin Baulig <martin@gnome.org>
* codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
to take command line arguments. Use reflection to call the new
custom `Initialize' function on the symbol writer and pass it the
command line arguments.
* driver.cs (--debug-args): New command line argument to pass command
line arguments to the symbol writer.
2002-05-28 Miguel de Icaza <miguel@ximian.com>
* assign.cs (DoResolve): Forgot to do the implicit conversion to
the target type for indexers and properties. Thanks to Joe for
catching this.
2002-05-27 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (MethodFlags): returns the method flags
(Obsolete/ShouldIgnore) that control warning emission and whether
the invocation should be made, or ignored.
* expression.cs (Invocation.Emit): Remove previous hack, we should
not do this on matching a base type, we should do this based on an attribute
Only emit calls to System.Diagnostics.Debug and
System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
on the command line.
* rootcontext.cs: Global settings for tracing and debugging.
* cs-tokenizer.cs (define): New utility function to track
defines. Set the global settings for TRACE and DEBUG if found.
2002-05-25 Ravi Pratap <ravi@ximian.com>
* interface.cs (Populate*): Pass in the TypeContainer as well as
the DeclSpace as parameters so that we can create EmitContexts and
then use that to apply attributes etc.
(PopulateMethod, PopulateEvent, PopulateProperty)
(PopulateIndexer): Apply attributes everywhere.
* attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
etc.
(ApplyAttributes): Update accordingly.
We now apply interface attributes for all members too.
2002-05-26 Miguel de Icaza <miguel@ximian.com>
* class.cs (Indexer.Define); Correctly check if we are explicit
implementation (instead of checking the Name for a ".", we
directly look up if the InterfaceType was specified).
Delay the creation of the PropertyBuilder.
Only create the PropertyBuilder if we are not an explicit
interface implementation. This means that explicit interface
implementation members do not participate in regular function
lookups, and hence fixes another major ambiguity problem in
overload resolution (that was the visible effect).
(DefineMethod): Return whether we are doing an interface
implementation.
* typemanager.cs: Temporary hack until we get attributes in
interfaces (Ravi is working on that) and we get IndexerName
support in interfaces.
* interface.cs: Register the indexers as properties.
* attribute.cs (Attribute.Resolve): Catch the error, and emit a
warning, I have verified that this is a bug in the .NET runtime
(JavaScript suffers of the same problem).
* typemanager.cs (MemberLookup): When looking up members for
interfaces, the parent of an interface is the implicit
System.Object (so we succeed in searches of Object methods in an
interface method invocation. Example: IEnumerable x; x.ToString
())
2002-05-25 Miguel de Icaza <miguel@ximian.com>
* class.cs (Event): Events should also register if they do
implement the methods that an interface requires.
* typemanager.cs (MemberLookup); use the new GetInterfaces
method.
(GetInterfaces): The code used to lookup interfaces for a type is
used in more than one place, factor it here.
* driver.cs: Track the errors at the bottom of the file, we kept
on going.
* delegate.cs (NewDelegate.Emit): We have to emit a null as the
instance if the method we are calling is static!
2002-05-24 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (ApplyAttributes): Make this function filter out
the IndexerName attribute (as that attribute in reality is never
applied) and return the string constant for the IndexerName
attribute.
* class.cs (TypeContainer.Emit): Validate that all the indexers
have the same IndexerName attribute, and if so, set the
DefaultName attribute on the class.
* typemanager.cs: The return value might contain other stuff (not
only methods). For instance, consider a method with an "Item"
property and an Item method.
* class.cs: If there is a problem with the parameter types,
return.
2002-05-24 Ravi Pratap <ravi@ximian.com>
* ecore.cs (ImplicitConversionExists): Wrapper function which also
looks at user defined conversion after making a call to
StandardConversionExists - we need this for overload resolution.
* expression.cs : Update accordingly the various method calls.
This fixes 2 bugs filed against implicit user defined conversions
2002-05-22 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Track the result of the assignment.
2002-05-21 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberAccess): Improved error reporting for
inaccessible members.
2002-05-22 Martin Baulig <martin@gnome.org>
* makefile (mcs-mono2.exe): New target. This is mcs compiled with
itself with debugging support.
2002-05-22 Martin Baulig <martin@gnome.org>
* typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
Removed, this isn't needed anymore.
2002-05-20 Martin Baulig <martin@gnome.org>
* typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
be underlying type for an enum.
2002-05-20 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (InitEnumUnderlyingTypes): New helper function
that splits out the loading of just the core types.
* rootcontext.cs (ResolveCore): Split the struct resolution in
two, so we can load the enumeration underlying types before any
enums are used.
* expression.cs (Is): Bandaid until we fix properly Switch (see
bug #24985 for details).
* typemanager.cs (ImplementsInterface): The hashtable will contain
a null if there are no interfaces implemented.
2002-05-18 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (indexer_declarator): It is fine to have array
parameters
2002-05-17 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: (RegisterBuilder): New function used to register
TypeBuilders that implement interfaces. Since
TypeBuilder.GetInterfaces (as usual) does not work with lame
Reflection.Emit.
(AddUserType): register interfaces.
(ImplementsInterface): Use the builder_to_ifaces hash if we are
dealing with TypeBuilder. Also, arrays are showing up as
SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
methods can not be invoked on them!
* ecore.cs (ExplicitReferenceConversionExists): Made public.
(ImplicitReferenceConversionExists): Split out from
StandardConversionExists.
* expression.cs (As): We were only implementing one of the three
cases for the as operator. We now implement them all.
(Is): Implement the various other cases for Is as well.
* typemanager.cs (CACHE): New define used to control if we want or
not the FindMembers cache. Seems to have a negative impact on
performance currently
(MemberLookup): Nested types have full acess to
enclosing type members
Remove code that coped with instance/static returns for events, we
now catch this in RealFindMembers.
(RealFindMembers): only perform static lookup if the instance
lookup did not return a type or an event.
2002-05-17 Miguel de Icaza <miguel@ximian.com>
* assign.cs (CompoundAssign): We pass more semantic information
now to Compound Assignments than we did before: now we have all
the information at hand, and now we resolve the target *before* we
do the expression expansion, which allows the "CacheValue" method
to have the effect we intended (before, a [x] += 1 would generate
two differen ArrayAccess expressions from the ElementAccess,
during the resolution process).
(CompoundAssign.DoResolve): Resolve target and original_source here.
2002-05-16 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayAccess): dropped debugging information.
* typemanager.cs: Small bug fix: I was always returning i_members,
instead of one of i_members or s_members (depending on which had
the content).
* assign.cs (IAssignMethod.CacheTemporaries): New method. This
method is invoked before any code generation takes place, and it
is a mechanism to inform that the expression will be invoked more
than once, and that the method should use temporary values to
avoid having side effects
(Assign.Emit): Call CacheTemporaries in the IAssignMethod.
* ecore.cs (Expression.CacheTemporaries): Provide empty default
implementation.
* expression.cs (Indirection, ArrayAccess): Add support for
CacheTemporaries in these two bad boys.
* ecore.cs (LoadFromPtr): figure out on our own if we need to use
ldobj or ldind_ref.
(StoreFromPtr): Handle stobj as well.
* expression.cs (UnaryMutator): Share more code.
* typemanager.cs (FindMembers): Thanks to Paolo for tracking this
down: I was not tracking the Filter function as well, which
was affecting the results of the cache.
2002-05-15 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Remove the hack to handle the CharSet property on
StructLayouts.
2002-05-14 Miguel de Icaza <miguel@ximian.com>
* attribute.cs (DoResolve): More uglyness, we now only try to
resolve the attribute partially, to extract the CharSet
information (only if we are a StructLayout attribute). Otherwise
(GetExtraTypeInfo): Add some code to conditionally kill in the
future this. I am more and more convinced that the .NET
framework has special code to handle the attribute setting on
certain elements.
* expression.cs (IsParamsMethodApplicable): Revert my previous
foreach change here, it was wrong.
2002-05-13 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
(pp_expr): do not abort on unknown input, just return.
(eval): abort if there are pending chars.
* attribute.cs (Attribute.Resolve): Positional parameters are
optional. Deal with that case.
* class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
the Ansi/Unicode/Auto information for the type.
(TypeContainer.DefineType): instantiate the EmitContext here, as
we will be using it during the type definition (to resolve
attributes) and during the emit phase.
* attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
to pull type information out of the attributes
(Attribute.Resolve): track the constructor builder, and allow for
multiple invocations (structs and classes will use this).
* ecore.cs (MemberLookupFinal): new version with all the
parameters customizable.
* expression.cs (New.DoResolve): Use MemberLookupFinal to locate
constructors. Return if the result value is null (as the error
would have been flagged already by MemberLookupFinal)
Do not allow instances of abstract classes or interfaces to be
created.
* class.cs: (MethodSignature.InheritableMemberSignatureCompare):
We have to compare the assembly property here when dealing with
FamANDAssem and Assembly access modifiers, because we might be
creating an assembly from *modules* (that means that we are not
getting TypeBuilders for types defined in other modules that are
part of this assembly).
(Method.Emit): If the method is marked abstract and has a body,
emit an error.
(TypeContainer.DefineMembers): If both the defined member and the
parent name match are methods, then do not emit any warnings: let
the Method.Define routine take care of flagging warnings. But if
there is a mismatch (method overrides something else, or method is
overriwritten by something, then emit warning).
(MethodSignature.MemberSignatureCompare): If the sig.ret_type is
set to null, this means `do not check for the return type on the
signature'.
(Method.Define): set the return type for the method signature to
null, so that we get methods with the same name and parameters and
different return types. This is used to flag warning 114 (you are
hiding a method, and you probably want to use the new/override
keywords instead).
* typemanager.cs (MemberLookup): Implemented proper access
control, closing a long standing set of bug reports. The problem
was that the Framework only has two bits: Public and NonPublic,
and NonPublic includes private and protected methods, but we need
to enforce the FamANDAssem, FamOrAssem and Family.
2002-05-11 Miguel de Icaza <miguel@ximian.com>
* statement.cs (GotoCase): Return true: Ammounts to giving up
knowledge on whether we return or not, and letting the other case
be responsible for it.
2002-05-10 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Do not load directories for each file processed, only
do it if there is a pattern.
* ecore.cs: Report readonly assigns here as well, as we might have
been resolved only by MemberAccess.
(SimpleName.SimpleNameResolve): Also be useful for LValue
resolution. We need this to propagate assign to local readonly variables
* typemanager.cs: Use a ptrhashtable for the criteria, because we
do not want to reuse potential criteria memory.
* class.cs (MyEventBuilder): Set reflected_type;
* ecore.cs (Constantify): Added support for constifying bools.
(RootContext.LookupType): Added a cache for values looked up in
the declaration space.
* typemanager.cs (FindMembers): Now is a front-end to
RealFindMembers, and provides a two-level hashtable-based cache to
the request.
15% performance improvement: from 22.5 to 19.2 seconds.
* expression.cs (IsParamsMethodApplicable): use foreach.
(Invocation.DoResolve): ditto.
(New.DoResolve): ditto.
(ArrayCreation.DoResolve): ditto.
* ecore.cs (FindMostEncompassingType): use foreach.
* delegate.cs (NewDelegate.DoResolve): Use foreach
* ecore.cs (Expression.FindMostSpecificSource): Use foreach.
(RemoveMethods): use foreach.
* expression.cs (Invocation.MakeUnionSet): Optimization: Use two
nested foreach statements instead of for, and also break out of
the inner loop once a match is found.
(Invocation.OverloadResolve): Use foreach, simplify the code.
2002-05-08 Miguel de Icaza <miguel@ximian.com>
* cfold.cs (BinaryFold): During an enumeration evaluation context,
we actually unwrap the expression to allow for extra information
to be extracted.
* expression.cs: Use Shr_Un on unsigned operations.
2002-05-08 Ravi Pratap <ravi@ximian.com>
* ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
applicable operators was not being considered correctly. This closes
the bug Miguel reported.
Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
* attribute.cs: check that the type derives from System.Attribute
and report the correct error in that case (moved the duplicate code to
its own method, too).
Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
* attribute.cs: lookup attribute type name as the spec says: first the
bare attribute name and then name + "Attribute" (nant compiles with
mcs after this fix).
2002-05-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
Because of the way we parse things, we should try to see if a
UIntConstant can fit in an integer.
2002-05-07 Ravi Pratap <ravi@ximian.com>
* ecore.cs (GetConversionOperators): Do not pick up op_True operators
when we are in an explicit context.
(ConvertReferenceExplicit): When converting from Iface type S to Class
T make sure the rules are implemented as an OR.
* parameter.cs (ParameterType): Make it a property for now although the
purpose really isn't anything immediate.
* expression.cs (Is*Applicable): Do better checking on the parameter type
of a ref/out parameter. The ones from the system assemblies are already
marked with the correct type so we don't need to do any correction.
* ecore.cs (StandardConversionExists): Conversion from Interface types to
the object type is standard too so include that.
2002-05-06 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (StandardConversionExists): Augment with missing code:
deal with IntConstant, LongConstants and Enumerations.
* assign.cs: Report the error, instead of failing silently
* rootcontext.cs (AddGlobalAttributes): Track attributes on the
typecontainer that they are declared, because the
typecontainer/namespace will have the list of using clauses that
need to be applied.
Assembly Attributes were escaping the normal registration
mechanism.
(EmitCode): Apply attributes within an EmitContext that represents
the container they were declared on.
* cs-parser.jay: Track bases for structs. How did I get this wrong?
2002-05-06 Ravi Pratap <ravi@ximian.com>
* ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
Revamp completely - make much cleaner as we now operate only
on a set of Types.
(FindMostSpecificSource, FindMostSpecificTarget): New methods
to implement the logic detailed in the spec more correctly.
(UserDefinedConversion): Update accordingly.
2002-05-06 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Return flow analysis information up.
* cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
and the default.
(token): Do not consume an extra character before calling
decimal_digits.
2002-05-06 Piers Haken <piersh@friskit.com>
* cs-parser.jay: add 'override' attribute to System.Object.Finalize
2002-05-06 Miguel de Icaza <miguel@ximian.com>
* class.cs (Constructor.Emit): Set the IsStatic flag in the
EmitContext during the instance constructor initializer
resolution, to stop access to instance variables.
This is mandated by the spec, last paragraph of the `constructor
initializers' section.
2002-05-05 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay, class.cs (Accessor): new class used to represent
an accessor (get or set). In the past we used `null' to represent
a missing accessor. But this is ambiguous because there was no
way to tell in abstract indexers/properties if one of them was
specified.
Now there is a way of addressing that.
* expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
instead of FindMembers.
* class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
* attribute.cs: Treat indexers and properties as the same in terms
of applying attributes
* ecore.cs (FindMostEncompassedType): Use statically initialized
EmptyExpressions()s like we do elsewhere to avoid creating useless
objects (and we take this out of the tight loop).
(GetConversionOperators): Move the code to extract the actual
operators to a separate routine to clean things up.
2002-05-04 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr): Remove un-needed tests for null, since now
events are always registered FieldBuilders.
* class.cs (FieldBase): New class shared by Fields
* delegate.cs: If we are a toplevel delegate, use our full name.
If we are a nested delegate, then only use our tail name.
2002-05-02 Ravi Pratap <ravi@ximian.com>
* expression.cs (IsApplicable): Ensure that we add the "&" to
ref/out types before comparing it with the type of the argument.
(IsParamsMethodApplicable): Ditto.
(Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
silly me ;-)
* delegate.cs : Handle the case when we have more than one applicable
method. Flag an error only when we finish checking all.
2002-05-02 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Add support for boolean static initializers.
2002-05-01 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
* parameter.cs (ComputeParameterTypes,
ComputeAndDefineParameterTypes): Better error handling: now we
clear the `types' cache if we fail during any of the type lookups.
We also return the status code correctly to our caller
* delegate.cs: If we fail to define a delegate, abort the extra
steps.
* expression.cs (Binary.ResolveOperator): for
operator==(object,object) and operator !=(object, object) we also
have to verify that there is an implicit conversion from one to
the other.
(ArrayAccess.DoResolve): Array Access can operate on
non-variables.
2002-04-30 Miguel de Icaza <miguel@ximian.com>
* assign.cs (CompoundAssign): A new class used as a "flag" that
the assignment actually is happening as part of a compound
assignment operator.
During compound assignment, a few new rules exist to enable things
like:
byte b |= 1 + 2
From the spec:
x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
to the type of x) if y is implicitly convertible to the type of x,
and the operator is a builtin operator and the return type of the
operator is explicitly convertible to the type of x.
* rootcontext.cs: Reset warning level to 2. 4 catches various
"interesting" features in mcs, we must clean this up at some
point, but currently am trying to kill other bugs ;-)
* ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
in container classes as well.
* expression.cs (Binary.ResolveOperator): Handle string case
before anything else (as operator overloading does emit an error
before doing anything else).
This code could go away when we move to a table driven model, but
i could not come up with a good plan last night.
2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
* typemanager.cs (CSharpName): reimplementation using regex.
* class.cs: added null check for fields in Emit
* rootcontext.cs: set warninglevel to 4
2002-04-29 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (CSharpName): reimplemented with Lupus
suggestion.
2002-04-28 Miguel de Icaza <miguel@ximian.com>
* statement.cs (If): correclty implement Resolve, because we were
not catching sem errors in there. The same process is needed
everywhere else.
(Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
(Statement.Warning_DeadCodeFound): Factorize code.
(While): Report dead code here too.
(Statement): Added Resolve virtual method to allow
for resolution split from the emit code.
2002-04-26 Miguel de Icaza <miguel@ximian.com>
* statement.cs (EmitBoolExpression): No longer try to resolve the
expression here.
(MakeBoolean): New utility function that resolve, implicitly
converts to boolean and tags the expression.
(If, Do): Implement dead code elimination.
(While): Implement loop inversion
(Do, While, For, If): Resolve the expression prior to calling our
code generation.
2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
* class.cs:
- added method Report28 (warning: program has more than one entry point)
- added method IsEntryPoint, implements paragraph 10.1 of the spec
- modified method Method.Define, the part at the end of the method
* rootcontext.cs: added static public Location EntryPointLocation;
* ../errors/cs0028.cs : Add test case for the above warning.
* typemanager.cs:
- modified method CSharpName to allow arrays of primitive type to
be printed nicely (e.g. instead of System.Int32[][] it now prints
int[][])
- added method CSharpSignature: returns the signature of a method
in string format to be used in reporting errors, warnings, etc.
* support.cs: InternalParameters.ParameterDesc variable tmp initialized
with String.Empty.
2002-04-26 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Define): Fix extremely silly bug where I was
setting the type of the 'object' parameter of the BeginInvoke
method to System.IAsyncResult instead of System.Object ;-)
2002-04-26 Miguel de Icaza <miguel@ximian.com>
* class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
here.
(Constructor.Emit): return if we fail to initialize the
constructor. Another door closed!
* expression.cs (New.DoResolve): Improve error message (from -6 to
1501). Use DeclaredOnly lookup to find the exact constructor.
* typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
loop. This is useful.
* cs-parser.jay: Adjust the default parameters so that destructors
have the proper signature.
2002-04-26 Martin Baulig <martin@gnome.org>
* driver.cs (LoadAssembly): If `assembly' contains any characters
which are only valid in path names and not in assembly names
(currently slash, backslash and point), use Assembly.LoadFrom ()
instead of Assembly.Load () on the `assembly' (before iteration
over the link_paths).
2002-04-26 Martin Baulig <martin@gnome.org>
* cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
2002-04-25 Miguel de Icaza <miguel@ximian.com>
* class.cs (Property): use the new typemanager.MemberLookup
(TypeContainer.MemberLookup): Implement using the
TypeManager.MemberLookup now.
* typemanager.cs: Make MemberLookup a function of the TypeManager,
and return MemberInfos, so that these can be used without an
EmitContext (what we had before).
2002-04-24 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Fix the case where the argument to params if the
type of the params. I omitted handling this before. Fixed
2002-04-22 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Call BootCorlib_PopulateCoreType
* class.cs (Property.CheckBase): Check for properties only, not
for all members.
* interface.cs: Temporary hack: try/catch around the
CustomAttributeBuilder, because I am getting an exception that I
do not understand.
* rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
types whose definitions are required to be there (attributes are
defined before standard types).
Compute definitions as we boot the various types, as they are used
immediately (value_type class will need object_type, but if we do
not initialize object_type, we will pass a null, which will let
the runtime pick the System.Object from the existing corlib, which
is not what we want).
2002-04-22 Patrik Torstensson <totte@labs2.com>
* cs-tokenizer.cs: fixed a number of trim() issues.
2002-04-22 Ravi Pratap <ravi@ximian.com>
* expression.cs (Argument.Type): Ensure that we return the correct
type when we have out or ref parameters [in which case we
append a "&"].
2002-04-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (Property, Indexer): Allow extern modifier in there.
* typemanager.cs (InitBaseTypes): Initializes object_type and
value_type, since those will be used early on during the bootstrap
process to compile corlib.
(InitCoreTypes): Move code from here to InitBaseTypes.
2002-04-21 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
single-dimension arrays as using the ldlen opcode.
Daniel Lewis discovered this optimization.
* typemanager.cs: Add signature for System.Array::get_Length
2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* statement.cs: report the error when the foreach does not apply to an
array nor a collection.
2002-04-19 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Add implicit conversions to the operator ~.
* constant.cs (DecimalConstant.Emit): Emit decimal value.
* typemanager.cs: Locate the decimal constructor.
2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* attribute.cs: use the new property of TypeOf.
* expression.cs: added 'get' property around typearg.
These changes fix a build breaker reported by NickD. Is this the
correct way to fix? If not, please, revert my changes and make it
work :-).
2002-04-17 Miguel de Icaza <miguel@ximian.com>
* attribute.cs: Add support for typeof in attribute invocations.
I am not sure that this is right though.
2002-04-14 Duncan Mak <duncan@ximian.com>
* cfold.cs (BinaryFold): Catch DivideByZeroException in the
Binary.Operator.Division case.
2002-04-13 Ravi Pratap <ravi@ximian.com>
* class.cs (DefineType): Ensure that we do a proper check on
attribute types and also register it with the TypeManager.
(TypeContainer.Targets): The default for attribute types is
AttributeTargets.All.
* attribute.cs (ApplyAttributes): Registering the attribute type
is done elsewhere, not when we discover we have a Usage attribute.
2002-04-12 Ravi Pratap <ravi@ximian.com>
* expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
and get rid of is_delegate parameter.
* everywhere : update.
2002-04-12 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (compilation_unit): Revamp completely to use
some new ideas that I got from Rhys' grammar to solve the problems
with assembly level attributes.
(outer_declaration): New grammar production.
(attribute_sections): Add.
(opt_attributes): Base on attribute_sections
(namespace_declaration): Allow opt_attributes to tackle the case
when we have assembly level attributes - we are clever in this
regard now ;-)
* attribute.cs (ApplyAttributes): Do not worry about assembly
attributes in the non-global context.
* rootcontext.cs (AddGlobalAttributes): Go back to using this
instead of SetGlobalAttributes.
* class.cs, rootcontext.cs : Ensure we define and generate
attribute types before anything else.
* attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
and flag the new error -20 for the case when the attribute type
does not have valid targets specified. csc does not catch this.
* ../errors/errors.txt : update for error # -20
2002-04-11 Ravi Pratap <ravi@ximian.com>
* support.cs (InternalParameters.ParameterModifier): Do some null
checking and return sane values.
* class.cs (Method.Define): If we are a PInvoke method, ensure
that we are static and extern. Report error # 601
* ../errors/cs0601.cs : Add test case for the above error.
2002-04-07 Ravi Pratap <ravi@ximian.com>
* rootcontext.cs (attribute_types): We need to keep type of
all attribute types separately and emit code for them first.
(RegisterAttribute) : Implement.
* class.cs (DefineType): Check if the current Type is a custom
attribute type and register it accordingly.
* rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
adding the first attribute twice and rename to
(SetGlobalAttributes): this.
* rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
lookups.
* attribute.cs (ApplyAttributes): Take an additional argument telling us
if we are processing global arguments. Hmm, I am unsure of this.
2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* expression.cs: added static array of strings to avoid calling
Enum.ToString () for Operator in Binary. Significant recover of
performance.
2002-04-10 Miguel de Icaza <miguel@ximian.com>
* class.cs (FindMembers): Allow the Builders of the various
members to be null. If they are skip them. This only happens
during the PInvoke declaration.
2002-04-09 Miguel de Icaza <miguel@ximian.com>
* parameter.cs (Parameters.ComputeParameterTypes): Flag the
failure, so we do not keep going afterwards.
* expression.cs: (Invocation.OverloadResolve): I believe Ravi
wanted to pass `false' as the `is_delegate' argument. If this is
the case, why not use delegate_type == null to mean `is_delegate =
false' and anything else as is_delegate = true.
Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
* statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
code for the section, not the beginning of the tests.
2002-04-08 Miguel de Icaza <miguel@ximian.com>
* cfold.cs: Handle operator + (Enum x, Underlying x)
* expression.cs (Binary): same. Warn about errors where we have
Enum/Enum in operator + as well.
Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
* statement.cs:
- added support for switch(bool)
- optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
- add TableSwitchEmit() to handle table-based switch statements
2002-04-05 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation.OverloadResolve): Factor out code which
does parameter compatibility checking with arguments so that we can
re-use the code even from Delegate.VerifyApplicability
(VerifyArgumentsCompat): Move above code here.
* delegate.cs (VerifyApplicability): Get rid of duplicate code
and instead make a call to the above method.
2002-03-31 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (attribute_type): Corresponds to System.Attribute.
We use it to keep track of classes which are attribute types.
2002-04-02 Miguel de Icaza <miguel@ximian.com>
* delegate.cs (Delegate.Define): Correctly define the types in the
presence of fixed and array parameters.
* class.cs (TypeContainers.FindMembers): Use NonPublic flag while
doing FindMembers.
* ecore.cs (Expression.MemberLookup): Reset binding flags to not
include NonPublic after the first iteration.
* class.cs (Indexer.CheckBase): Only check if both parents are
non-null.
* cs-parser.jay (accessor_body): If empty, set to null.
* ecore.cs (SimpleName.SimpleNameResolve): We did not have the
same code path here to resolve constants names that we did have in
MemberAccess.DoResolve. There is too much code duplicated here.
2002-04-01 Miguel de Icaza <miguel@ximian.com>
* statement.cs, makefile: Drop Statementcollection and just use ArrayLists
* ecore.cs: Optimize UserDefinedConversion by minimizing the calls
to MakeUnionSet.
* cs-tokenizer.cs: Reuse a single StringBuilder for assembling
tokens, numbers and strings.
* ecore.cs (MethodGroupExpr): Make Emit warn about missing
parenthesis.
* delegate.cs: Use ComputeAndDefineParameterTypes for both the
asyncronous parameters and the regular parameters.
* codegen.cs (CodeGen.Init): Use the constructor that allows us to
specify the target directory.
* expression.cs: (This.DoResolve): Simplify
(As.Emit): Optimize, do not generate IsInst if the expression is
always of the given type.
(Is.DoResolve): Bug fix, we were reporting both always/never for
the is expression.
* (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
creating too many unnecessary arrays.
2002-03-31 Miguel de Icaza <miguel@ximian.com>
* class.cs (EmitFieldInitializer): Use Assign expression to assign
fields instead of rolling our own initializer. Takes care of all
implicit conversions, and drops unnecessary static checks/argument.
2002-03-31 Dick Porter <dick@ximian.com>
* driver.cs: use the GetDirectories() return values properly, and
use "/" as path separator.
2002-03-30 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Unary): Optimize - - expr into expr.
(Binary): Optimize a + (-b) into a -b.
* codegen.cs (CodeGen): Made all methods static.
2002-03-29 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs:
* decl.cs: Rename `definition' into `TypeBuilder' and drop the
TypeBuilder property.
* cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
instead.
* tree.cs: Removed the various RecordXXXX, and replaced with a
single RecordDecl. Removed all the accessor methods, and just
left a single access point Type
* enum.cs: Rename DefineEnum to DefineType.
* decl.cs: New abstract method `DefineType' used to unify the
Defines for Enumerations, Interfaces, TypeContainers and
Delegates.
(FindType): Moved LookupInterfaceOrClass here. Moved the
LookupBaseClasses method that used to live in class.cs and
interface.cs here, and renamed to FindType.
* delegate.cs: Implement DefineType. Take advantage of the
refactored pattern for locating the parent builder without taking
the parent_builder argument (which we know does not work if we are
nested, and triggering a toplevel definition).
2002-03-28 Miguel de Icaza <miguel@ximian.com>
* decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
accessibility of a member has changed during override and report
an error if so.
* class.cs (Method.Define, Property.Define): Only complain on
overrides if the method is private, any other accessibility is
fine (and since we just checked the permission is the same, we are
good to go).
* cs-tokenizer.cs: only line, region, endregion, if, endif, else
and elif are processed always. The other pre-processing
directives are only processed if we are "taking" the path
2002-03-29 Martin Baulig <martin@gnome.org>
* class.cs (Method.Emit): Only emit symbolic debugging info if the
current location is not Null.
* codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
a separate method so we can profile it.
* driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
`span.Seconds' are just seconds, but no minutes or hours.
(MainDriver): Profile the CodeGen.SaveSymbols calls.
2002-03-28 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method.Define), (Property.Define), (Indexer.Define):
Remove the gratuitous set of Final:
// If an interface implementation, then we can set Final.
if (((flags & MethodAttributes.Abstract) == 0) &&
implementing.DeclaringType.IsInterface)
flags |= MethodAttributes.Final;
I do not know what I was smoking when I used that.
* cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
step into fixing the name resolution issues for delegates and
unifying the toplevel name resolution.
2002-03-28 Martin Baulig <martin@gnome.org>
* class.cs (Method.Emit): If we have a symbol writer, call its
OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
tell it about the current method.
* codegen.cs (EmitContext.Mark): New public method. Tell the symbol
writer that we're going to emit the first byte of IL code for a new
statement (a new source line).
(EmitContext.EmitTopBlock): If we have a symbol writer, call
EmitContext.Mark() before emitting any code.
* location.cs (SymbolDocument): Return null when we're Null.
* statement.cs (Statement): Moved the `Location loc' variable here.
(Statement.EmitBoolExpression): If we have a symbol writer, call
ec.Mark() before emitting any code to tell it that we're at the
beginning of a new statement.
(StatementExpression): Added `Location' argument to the constructor.
(Block): Added public readonly variable `StartLocation' and public
variable `EndLocation'. The latter is to be set using SetEndLocation().
(Block): Added constructor which takes a start and end location.
(Block.SetEndLocation): New method. This sets the end location.
(Block.EmitMeta): If we have a symbol writer, tell it the names of the
local variables we create.
(Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
each statement and do also mark the begin and end of the block.
* cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
tell it the current lexer.Location, use Location.Null for the end of the
block.
(block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
current block, set its end location using SetEndLocation().
(statement_expression): StatementExpression constructor now takes the
lexer.Location as additional argument.
(for_statement, declare_local_variables): Likewise.
(declare_local_variables): When creating a new implicit block, use the
new Block constructor and pass it the lexer.Location.
2002-03-28 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.MemberLookup): On interfaces, lookup
members also on the parent interfaces recursively.
2002-03-27 Miguel de Icaza <miguel@ximian.com>
* report.cs: Use new formats, since Gonzalo finished the missing
bits.
* expression.cs (Binary.ResolveOperator): added missing operator|
operator& and operator^ for bool/bool.
* cs-parser.jay: CheckDef now takes a Location argument that is
used to report errors more precisly (instead of reporting the end
of a definition, we try to track something which is a lot closer
to the source of the problem).
* cs-tokenizer.cs: Track global token use, so we can properly flag
the use of #define/#undef after the first token has been seen.
Also, rename the reportXXXX to Error_DescriptiveName
* decl.cs (DeclSpace.IsTopLevel): Move property here from
TypeContainer, so that Enum and Interface can use this too.
* class.cs (TypeContainer.LookupInterfaceOrClass,
GetInterfaceOrClass, GetClassBases, DefineType): Drop the
`builder' argument. Typically this was used to pass the parent
builder (a ModuleBuilder or a TypeBuilder from whoever triggered
the definition).
The problem is that a nested class could trigger the definition of
a toplevel class, and the builder would be obviously wrong in that
case.
So we drop this argument, and we compute dynamically the
TypeBuilder/ModuleBuilder (the correct information was available
to us anyways from DeclSpace.Parent)
* interface.cs (Interface.DefineInterface): Drop builder
parameter cleanup like class.cs
* enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
like class.cs
* statement.cs (Switch.EmitObjectInteger): Emit short/ushort
values.
(Try.Emit): Propagate the returns value from the statement.
(Return.Emit): Even if we are leavning
* driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
* modifiers.cs: Fix the computation of MethodAttributes flags.
Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
* driver.cs: allow compilation of files that start with '/'.
Add a default case when checking the argument of --target.
2002-03-25 Miguel de Icaza <miguel@ximian.com>
* interface.cs: Implement the same search algorithm for types in
the interface code.
* delegate.cs: Do not allow multiple definition.
* Recovered ChangeLog that got accidentally amputated
* interface.cs (Interface.DefineInterface): Prevent from double definitions.
* rootcontext.cs: Load manually enum to allow core classes to
contain enumerations.
* enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
Update to new static methods in TypeManager.
* typemanager.cs (GetMethod, GetConstructor): Use our
implementation of FindMembers to find the members, since during
corlib compilation, the types are TypeBuilders and GetMethod and
GetConstructor do not work.
Make all methods in TypeManager static.
(InitCodeHelpers): Split the functionality from
the InitCodeTypes function.
* driver.cs: Call InitCodeHelpers after we have populated the
types.
* cs-parser.jay (delegate_declaration): we did not used to compute
the delegate name correctly for void delegates.
2002-03-24 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext): Init the interface_resolve_order
and type_container_resolve_order always.
(ResolveCore, BootstrapCorlib_ResolveClass,
BootstrapCorlib_ResolveStruct): New functions to bootstrap the
compiler when compiling with --nostdlib
* class.cs (TypeContainer.DefineType): Check that our parent is
not null. This test is most important when we are bootstraping
the core types.
* codegen.cs: Split out the symbol writing code.
2002-03-25 Martin Baulig <martin@gnome.org>
* driver.cs (-g): Made -g an alias for --debug.
2002-03-24 Martin Baulig <martin@gnome.org>
* codegen.cs (SymbolWriter): New public variable. Returns the
current symbol writer.
(CodeGen): Added `bool want_debugging_support' argument to the
constructor. If true, tell the ModuleBuild that we want debugging
support and ask it for the ISymbolWriter.
(Save): If we have a symbol writer, call it's Close() method after
saving the assembly.
* driver.c (--debug): New command line argument to create a
debugger information file.
* location.cs (SymbolDocument): New public property. Returns an
ISymbolDocumentWriter object for the current source file or null
if we don't have a symbol writer.
2002-03-21 Miguel de Icaza <miguel@ximian.com>
* driver.cs (LoadAssembly): Correctly return when all the paths
have been tried and not before.
* statement.cs (Switch.Emit): return the actual coverage for this
statement (returns/not-returns)
(Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
switch of the statement if we are the last switch section. That
kills two problems: try/catch problems (we used to emit an empty
nop at the end) and switch statements where all branches would
return.
2002-03-19 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add default assemblies (the equivalent to the
Microsoft CSC.RSP file)
* cs-tokenizer.cs: When updating `cols and setting it to zero,
also update tokens_seen and set it to false.
* driver.cs: Implement --recurse for Mike.
* driver.cs (SplitPathAndPattern): Small bug fix, I was not
correctly splitting out the paths.
2002-03-18 Miguel de Icaza <miguel@ximian.com>
* interface.cs (Interface.PopulateProperty): Instead of using
`parent' as the declaration space for the set parameters, use
`this'
* support.cs (InternalParameters): InternalParameters constructor
takes a DeclSpace instead of a TypeContainer.
* expression.cs (ArrayCreation.EmitDynamicInitializers): If value
types are being initialized, load the address of it before calling
the function.
(New): Provide a mechanism to disable the generation of local
value type temporaries when the caller will be providing us with
an address to store it.
(ArrayCreation.EmitDynamicInitializers): Use it.
2002-03-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation.EmitArguments): Only probe for array
property if there is more than one argument. Sorry about that.
* class.cs (Invocation.EmitArguments): Fix to emit arguments for
empty param arrays.
* class.cs (Method.LabelParameters): Fix incorrect code path that
prevented the `ParamArrayAttribute' from being applied to the
params attribute.
2002-03-16 Miguel de Icaza <miguel@ximian.com>
* support.cs (ReflectionParameters): Correctly compute whether the
last argument is a params array. Fixes the problem with
string.Split ('a')
* typemanager.cs: Make the assemblies array always be non-null
(empty, but non-null)
* tree.cs (RecordDecl): New function that abstracts the recording
of names. This reports error 101, and provides a pointer to the
previous declaration. Fixes a crash in the compiler.
* cs-parser.jay (constructor_declaration): Update to new grammar,
and provide a constructor_body that can be empty.
2002-03-15 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add support for --resources.
* expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
Make all types for the various array helper methods be integer.
* ecore.cs (Expression.ConvertNumericExplicit): Pass the
CheckState to ConvCast.
(ConvCast): Now it takes a `checked' state argument, to avoid
depending on the emit context for the conversion, and just using
the resolve time setting.
* expression.cs (ArrayCreation.EmitArrayArguments): New function,
instead of Invocation.EmitArguments. We do not emit the original
arguments, instead we emit those which have been converted to
unsigned int expressions.
* statement.cs (Block.EmitMeta): Drop tracking of indexes.
* codegen.cs: ditto.
* expression.cs (LocalVariableReference): Drop the use of the
Store function that depended on the variable index.
* statement.cs (VariableInfo): Drop the `Idx' property from this
class, as this is not taking into account the indexes for
temporaries tat we generate during the execution, getting the
indexes wrong.
* class.cs: First emit class initializers, then call the parent
constructor.
* expression.cs (Binary): Fix opcode emision.
(UnaryMutator.EmitCode): Support checked code generation
* ecore.cs (MemberLookup): TypeManager.FindMembers will return
matches for events for both the Static and Instance scans,
pointing to the same element. Fix that.
2002-03-14 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (ResolveTree): Always set the
interface_resolve_order, because nested interfaces will be calling
into us.
* class.cs (GetInterfaceOrClass): Track the same resolution
process used by TypeManager.LookupType. This fixes the nested
type lookups in class declarations (separate path from
LookupType).
(TypeContainer.DefineType): Also define nested interfaces.
(TypeContainer.RegisterOrder): New public function used to
register the order in which child interfaces need to be closed.
Nested interfaces need to be closed after their parents have been
created.
* interface.cs (InterfaceAttr): Put all the logic for computing
the interface attribute here.
(DefineInterface): Register our interface order with the
RootContext or with the TypeContainer depending on the case.
2002-03-12 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: rework foreach statement to work with the new
changes to the policy on SimpleNames.
* report.cs: support Stacktrace on warnings as well.
* makefile: drop --unsafe and /unsafe from the compile.
2002-03-13 Ravi Pratap <ravi@ximian.com>
* ecore.cs (StandardConversionExists): Modify to take an Expression
as the first parameter. Ensure we do null -> reference type conversion
checking.
* Everywhere : update calls accordingly, making use of MyEmptyExpr to store
temporary Expression objects.
Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
* interface.cs: workaround bug in method overloading resolution
(there is already a bugzilla bug for it).
2002-03-12 Miguel de Icaza <miguel@ximian.com>
We could also solve this problem by having a separate path for
performing type lookups, instead of DoResolve, we could have a
ResolveType entry point, and only participating pieces of the
production (simplename, deref, array) would implement this.
* codegen.cs (EmitContext): New field OnlyLookupTypes used to
signal SimpleName to only resolve type names and not attempt to
resolve anything else.
* expression.cs (Cast): Set the flag.
* ecore.cs (SimpleName): Use the OnlyLookupTypes flag
* class.cs: Only report 108 if there is no `new' modifier.
* cs-parser.jay: rework foreach statement to work with the new
changes to the policy on SimpleNames.
* report.cs: support Stacktrace on warnings as well.
* makefile: drop --unsafe and /unsafe from the compile.
2002-03-11 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
lookups here, instead of doing that at parse time. This means
that our grammar will not introduce `LocalVariableReferences' as
expressions at this point. That solves the problem of code like
this:
class X {
static void Main ()
{ int X = 1;
{ X x = null }}}
This is only half the fix. The full fix requires parameters to
also be handled in this way.
* Everywhere: Use ec.DeclSpace on calls to LookupType, as this
makes the use more obvious of the DeclSpace. The
ec.TypeContainer.TypeBuilder is now only used to pull the
TypeBuilder for it.
My theory is that I can get rid of the TypeBuilder completely from
the EmitContext, and have typecasts where it is used (from
DeclSpace to where it matters).
The only pending problem is that the code that implements Aliases
is on TypeContainer, and probably should go in DeclSpace.
* ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
lookups here, instead of doing that at parse time. This means
that our grammar will not introduce `LocalVariableReferences' as
expressions at this point. That solves the problem of code like
this:
class X {
static void Main ()
{ int X = 1;
{ X x = null }}}
This is only half the fix. The full fix requires parameters to
also be handled in this way.
* class.cs (Property.DefineMethod): When implementing an interface
method, set newslot, when implementing an abstract method, do not
set the flag (before we tried never setting it, or always setting
it, which is the difference).
(Indexer.DefineMethod): same.
(Method.DefineMethod): same.
* ecore.cs: Only set the status used flag if we get back a Field.
* attribute.cs: Temporary hack, so Paolo can keep working.
2002-03-08 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attribute.UnmanagedType): This is to keep track of
the unmanaged type in the case we have a MarshalAs attribute.
(Resolve): Handle the case when we are parsing the special MarshalAs
attribute [we need to store the unmanaged type to use later]
* typemanager.cs (marshal_as_attr_type): Built in type for the
MarshalAs Attribute.
* attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
on parameters and accordingly set the marshalling info.
2002-03-09 Miguel de Icaza <miguel@ximian.com>
* class.cs: Optimizing slightly by removing redundant code after
we switched to the `NoTypes' return value.
(Property.DefineMethod): use NoTypes here too.
This fixes the bug I introduced in my last batch of changes.
2002-03-05 Ravi Pratap <ravi@ximian.com>
* tree.cs (RecordEnum): Add. We now keep track of enums too.
* class.cs (LookupInterfaceOrClass): Check against the list of recorded
Enums since those are types too.
* cs-parser.jay (enum_declaration): Record enums as we parse them.
* enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
thanks to a call during the lookup process.
2002-03-07 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Foreach): Lots of work to accomodate a particular
kind of foreach statement that I had not kept in mind. It is
possible to have foreachs on classes that provide a GetEnumerator
method that return objects that implement the "pattern" for using
a foreach, there is no need to support GetEnumerator
specifically.
This is needed to compile nant.
* decl.cs: Only report 114 if the member is not `Finalize' and if
the warning level is at least 2.
* class.cs: Moved the compare function from Method to
MethodSignature.
(MethodSignature.InheritableMemberSignatureCompare): Add new
filter function that is used to extract inheritable methods from a
class.
(Method.Define): Use the new `inheritable_method_signature_filter'
delegate
* cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
command.
2002-03-06 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
* cs-parser.jay: Add opt_semicolon to the interface declaration.
* expression.cs: Pass location information to
ConvertImplicitStandard.
* class.cs: Added debugging code to track return values from
interfaces.
2002-03-05 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Is.DoResolve): If either side of the `is' is an
interface, do not flag the warning.
* ecore.cs (ImplicitReferenceConversion): We need a separate test
for interfaces
* report.cs: Allow for --fatal to be used with --probe.
* typemanager.cs (NoTypes): Move the definition for the empty Type
array here.
* class.cs (TypeContainer.FindMembers): Also look for methods defined by
properties.
(TypeContainer.DefineProxy): New function used to proxy to parent
implementations when implementing interfaces.
(TypeContainer.ParentImplements): used to lookup if our parent
implements a public function that is required by an interface.
(TypeContainer.VerifyPendingMethods): Hook this up.
* typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
`modules' and `assemblies' arraylists into arrays. We only grow
these are the very early start up of the program, so this improves
the speedof LookupType (nicely measured).
* expression.cs (MakeByteBlob): Replaced unsafe code with
BitConverter, as suggested by Paolo.
* cfold.cs (ConstantFold.Binary): Special case: perform constant
folding of string concatenation, but if either side is a string,
and the other is not, then return null, and let the runtime use
the concatenation on the string plus the object (using
`Object.ToString').
2002-03-04 Miguel de Icaza <miguel@ximian.com>
Constant Folding has been implemented now.
* expression.cs (Unary.Reduce): Do not throw an exception, catch
the error instead on types that are not supported in one's
complement.
* constant.cs (Constant and all children): New set of functions to
perform implict and explicit conversions.
* ecore.cs (EnumConstant): Implement the new functions to perform
conversion by proxying to the child expression.
* codegen.cs: (ConstantCheckState): Constant evaluation has its
own separate setting that can not be turned off from the command
line using --unchecked or --checked and is only controlled using
the checked/unchecked statements and expressions. This setting is
used by the constant folder to flag errors.
* expression.cs (CheckedExpr, UncheckedExpr): Set the
ConstantCheckState as well.
During Resolve, they also have to flag the state, because the
constant folder runs completely in the Resolve phase.
* statement.cs (Checked, Unchecked): Set the ConstantCheckState as
well.
2002-03-01 Miguel de Icaza <miguel@ximian.com>
* cfold.cs: New file, this file contains the constant folder.
* ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
argument to track whether we are using the resulting address to
load or store a value and provide better error messages.
(FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
new AddressOf arguments.
* statement.cs (Foreach.EmitCollectionForeach): Update
* expression.cs (Argument.Emit): Call AddressOf with proper
arguments to track usage.
(New.DoEmit): Call AddressOf with new arguments.
(Unary.Emit): Adjust AddressOf call.
2002-03-01 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (member_access): Change the case for pre-defined types
to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
this suggestion.
* class.cs (Operator::Emit): If we are abstract or extern, we don't have
a method body.
* attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
essentially like methods and apply attributes like MethodImplOptions to them too.
* ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
not being null.
* codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
is the DeclSpace.
* Update code everywhere accordingly.
* ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
* cs-parser.jay (enum_declaration): Set the current namespace of the enum.
2002-02-28 Ravi Pratap <ravi@ximian.com>
* rootcontext.cs (LookupType): As we cycle through the chain of namespaces
try performing lookups against those instead of jumping straight into using
the 'using' clauses.
(ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
(LookupType): Perform lookups in implicit parents too.
* class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
sequence as RootContext.LookupType.
* rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
the various cases of namespace lookups into this method.
2002-03-01 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add support for [Attribute ()] (empty arguments
in positional arguments)
* class.cs (Operator): Update the AllowedModifiers to contain
extern.
* cs-parser.jay: Update operator declaration to allow for the
operator body to be empty.
* cs-tokenizer.cs: Added '\u' unicode support in strings and hex
values.
2002-02-27 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method.Emit): Label parameters.
* driver.cs: Return 1 or 0 as the program exit code.
2002-02-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Special case the `null' object when trying to
auto-compute the type, as anything can be explicitly converted to
that.
* ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
spotting this Paolo.
(Expression.ImplicitNumericConversion): Perform comparissions of
the type using the underlying type in the case of an enumeration
rather than using the enumeration type for the compare.
Cope with the underlying == type case, which is not possible to
catch before.
(Expression.ConvertNumericExplicit): Perform comparissions of
the type using the underlying type in the case of an enumeration
rather than using the enumeration type for the compare.
* driver.cs: If the user does not supply an extension, assume .exe
* cs-parser.jay (if_statement): Rewrote so that we can track the
location for the if statement.
* expression.cs (Binary.ConstantFold): Only concat strings when
the operation is "+", not everything ;-)
* statement.cs (Statement.EmitBoolExpression): Take a location
argument.
(If, While, Do): Track location.
* expression.cs (Binary.ResolveOperator): In the object + string
case, I was missing a call to ConvertImplicit
2002-02-25 Ravi Pratap <ravi@ximian.com>
* parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
Location arguments. Ensure we use RootContext.LookupType to do our work
and not try to do a direct Type.GetType and ModuleBuilder.GetType
* interface.cs (PopulateMethod): Handle the type of the parameter being
null gracefully.
* expression.cs (Invocation.BetterFunction): Handle the case when we
have a params method with no fixed arguments and a call is made with no
arguments.
2002-02-25 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Add support for the quote-escape-sequence in
the verbatim-string-literal
* support.cs (InternalParameters.ParameterModifier): handle null
fixed parameters.
(InternalParameters.ParameterType): ditto.
* parameter.cs (VerifyArgs): Also check if the fixed parameter is
duplicating the name of the variable parameter.
(GetParameterByName): Fix bug where we were not looking up array
paramters if they were the only present (thanks Paolo!).
(GetParameterInfo): We only have an empty set of types if both
fixed and array are set to null.
(GetParameterInfo-idx): Handle FixedParameter == null
* cs-parser.jay: Handle the case where there is no catch
statements (missing null test).
2002-02-22 Miguel de Icaza <miguel@ximian.com>
* driver.cs (MainDriver): Be conservative on our command line
handling.
Catch DirectoryNotFoundException when calling GetFiles.
(SplitPathAndPattern): Used to split the input specification into
a path and a pattern that we can feed to Directory.GetFiles.
2002-02-21 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Fixed): Implement the last case of the Fixed
statement (string handling).
* expression.cs (StringPtr): New class used to return a char * to
a string; Used by the Fixed statement.
* typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
* expression.cs (Binary.ResolveOperator): Remove redundant
MemberLookup pn parent type.
Optimize union call, we do not need a union if the types are the same.
(Unary.ResolveOperator): REmove redundant MemberLookup on parent
type.
Specialize the use of MemberLookup everywhere, instead of using
the default settings.
(StackAlloc): Implement stackalloc keyword.
* cs-parser.jay: Add rule to parse stackalloc.
* driver.cs: Handle /h, /help, /?
* expression.cs (MakeByteBlob): Removed the hacks we had in place
before we supported unsafe code.
* makefile: add --unsafe to the self compilation of mcs.
2002-02-20 Miguel de Icaza <miguel@ximian.com>
* expression.cs (PointerArithmetic): New class that is used to
perform pointer arithmetic.
(Binary.Resolve): Handle pointer arithmetic
Handle pointer comparission.
(ArrayPtr): Utility expression class that is used to take the
address of an array.
(ElementAccess): Implement array access for pointers
* statement.cs (Fixed): Implement fixed statement for arrays, we
are missing one more case before we are done.
* expression.cs (Indirection): Implement EmitAssign and set the
ExprClass to Variable. This allows pointer dereferences to be
treated as variables, and to have values assigned to them.
* ecore.cs (Expression.StoreFromPtr): New utility function to
store values dereferencing.
2002-02-20 Ravi Pratap <ravi@ximian.com>
* expression.cs (Binary.ResolveOperator): Ensure that we are
not trying to operate on a void type - this fixes the reported
bug.
* decl.cs (CheckMethodAgainstBase): Do not allow overriding if
the parent implementation is sealed.
* ../errors/cs0239.cs : Add.
* attribute.cs (ApplyAttributes): Handle Modulebuilders too.
* typemanager.cs (unverifiable_code_type): Corresponds to
System.Security.UnverifiableCodeAttribute. We need to emit this for modules
which have unsafe code in them.
* rootcontext.cs (EmitCode): Emit the above attribute when we are in an
unsafe context.
2002-02-19 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Add support for @"litreal strings"
Make tokenizer accept pre-processor directives
on any column (remove the old C-like limitation).
* rootcontext.cs (EmitCode): Emit any global attributes.
(AddGlobalAttributes): Used to keep track of assembly attributes.
* attribute.cs (ApplyAttributes): Support AssemblyAttributes.
* cs-parser.jay: Add support for global attributes.
2002-02-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Indirection): New helper class. Unary will
create Indirection classes to be able to implement the
IMemoryLocation interface on it.
2002-02-16 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (fixed_statement): reference the right statement.
* statement.cs (Fixed.Emit): Finish implementing the fixed
statement for the &x case.
2002-02-14 Miguel de Icaza <miguel@ximian.com>
* class.cs (Property.Define, Method.Define): Remove newslot when
`implementing'.
* modifiers.cs: My use of NewSlot when `Abstract' was set was
wrong. NewSlot should only be used if the `new' keyword is present.
* driver.cs (GetSystemDir): Use CodeBase instead of FullName for
locating our system dir. Sorry about this.
2002-02-13 Miguel de Icaza <miguel@ximian.com>
* driver.cs (GetSystemDir): Compute correctly the location of our
system assemblies. I was using the compiler directory instead of
the library directory.
2002-02-13 Ravi Pratap <ravi@ximian.com>
* expression.cs (BetterFunction): Put back in what Miguel commented out
since it is the correct fix. The problem is elsewhere ;-)
(IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
parameters of the parms method are themselves compatible or not !
(StandardConversionExists): Fix very dangerous bug where we were forgetting
to check that a class implements an interface before saying that an implicit
conversion was allowed. Use ImplementsInterface to do the checking.
2002-02-13 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method.Define): Track whether we are an explicit
implementation or not. And only call DefineMethodOverride if we
are an explicit implementation.
(Property.DefineMethod): Ditto.
2002-02-11 Ravi Pratap <ravi@ximian.com>
* expression.cs (BetterFunction): Catch hideous bug which was
preventing us from detecting ambiguous calls due to implicit casts i.e
cs0121.
2002-01-29 Miguel de Icaza <miguel@ximian.com>
* support.cs (Pair): Remove un-needed method. I figured why I was
getting the error in cs-parser.jay, the variable in a foreach loop
is readonly, and the compiler does not really treat this as a variable.
* cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
instead of EQUALS in grammar.
* typemanager.cs (VerifyUnmanaged): Report correct error (208)
* expression.cs (Unary.DoResolve): Check whether the argument is
managed or not.
2002-01-28 Miguel de Icaza <miguel@ximian.com>
* support.cs: Api for Pair to set a value. Despite the fact that
the variables are public the MS C# compiler refuses to compile
code that accesses the field if the variable is part of a foreach
statement.
* statement.cs (Fixed): Begin implementation of the fixed
statement.
(Block.AddVariable): Return the VariableInfo on success and null
on failure instead of true/false.
* cs-parser.jay (foreach): Catch errors on variables already
defined (we were ignoring this value before) and properly unwind
the block hierarchy
(fixed_statement): grammar for the fixed statement.
2002-01-25 Miguel de Icaza <miguel@ximian.com>
* expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
pointer types to be incretemented.
(SizeOf): Implement.
* cs-parser.jay (pointer_member_access): Implement
expr->IDENTIFIER production.
* expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
on safe contexts.
(Unary): Implement indirection.
* ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
use in non-unsafe context).
(SimpleName.DoResolve): Check for pointers in field access on safe
contexts.
(Expression.LoadFromPtr): Factor the load-indirect code in this
function. This was duplicated in UnboxCast and ParameterReference
2002-01-24 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ComposedCast): report an error if a pointer cast
is used in a safe region.
* ecore.cs (Expression.ConvertExplicit): Add rules for implicit
pointer type casts in unsafe context.
* codegen.cs (EmitContext): Set up IsUnsafe.
* cs-parser.jay (non_expression_type): Add productions for pointer
casts.
* expression.cs (Invocation.EmitCall): Remove chunk of buggy
code. We should not use force into static mode if the method is
not virtual. Fixes bug in MIS
* statement.cs (Do.Emit, While.Emit, For.Emit,
Statement.EmitBoolExpression): Add support to Do and While to
propagate infinite loop as `I do return' semantics.
Improve the For case to also test for boolean constants.
* attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
to the list of attributes we can add.
Remove `EmitContext' argument.
* class.cs (Method.Define): Apply parameter attributes.
(Constructor.Define): Apply parameter attributes.
(MethodCore.LabelParameters): Move here the core of labeling
parameters.
* support.cs (ReflectionParameters.ParameterModifier,
InternalParameters.ParameterModifier): Use IsByRef on the type and
only return the OUT bit for these parameters instead of in/out/ref
flags.
This is because I miss-understood things. The ParameterInfo.IsIn
and IsOut represent whether the parameter has the [In] and [Out]
attributes set.
2002-01-22 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.Emit): Release temporaries.
* assign.cs (LocalTemporary.Release): new function.
* codegen.cs (EmitContext.GetTemporaryStorage,
EmitContext.FreeTemporaryStorage): Rework the way we deal with
temporary storage. Now we can "put back" localbuilders when we
are done with them
2002-01-21 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
need to make a copy of the variable to generate verifiable code.
2002-01-19 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Compute dynamically the system directory.
* ecore.cs (CopyNewMethods): reworked, exposed, made public.
Slower, but more generally useful. Used by the abstract
registering implementation.
* expression.cs (ResolveMemberAccess): Reorder the way we evaluate
the rules for the special rule on Type/instances. First check if
we have the same name, and if so, try that special static path
rather than the instance path.
2002-01-18 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Emit 642 (warning: possible empty statement) for
for, while and if.
* class.cs (TypeBuilder.DefineType): Do not allow inheritance from
Enum, ValueType, Delegate or Array for non-corlib compiles.
* cs-tokenizer.cs: Catch long identifiers (645)
* typemanager.cs (IndexerPropetyName): Ravi never tested this
piece of code.
* class.cs (TypeContainer.RegisterRequiredImplementations): Bug
fix, we were returning too early, so we were not registering
pending methods from abstract classes.
Do not register pending methods if the class is abstract.
* expression.cs (Conditional.DoResolve): Report circular implicit
conversions when we neecd to compute it for conditional
expressions.
(Is.DoResolve): If the expression is always of the provided type,
flag warning 183. If the expression can not ever be of the
provided type flag warning 184.
* class.cs: Catch 169 as well.
* ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
read.
2002-01-18 Nick Drochak <ndrochak@gol.com>
* makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
2002-01-17 Miguel de Icaza <miguel@ximian.com>
* interface.cs: (PopulateMethod): Check for pointers being defined
only if the unsafe context is active.
(PopulateProperty): ditto.
(PopulateIndexer): ditto.
* class.cs (Method, Method.Define): Allow `unsafe' modifier to be
specified. If pointers are present, make sure that they are
present in an unsafe context.
(Constructor, Constructor.Define): ditto.
(Field, Field.Define): ditto.
(Property, Property.Define): ditto.
(Event, Event.Define): ditto.
* interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
hashtable if there are classes or structs defined.
* expression.cs (LocalVariableReference.DoResolve): Simplify this
code, as the constant resolution moved.
* statement.cs (Block.EmitMeta): Resolve all constants as we emit
the metadata, so we can flag error 133.
* decl.cs (MemberCore.UnsafeOK): New function to test that a
pointer is being declared in an unsafe context.
2002-01-16 Miguel de Icaza <miguel@ximian.com>
* modifiers.cs (Modifiers.Check): Require a Location argument.
Report error 227 for Unsafe use.
* typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
* statement.cs (For.Emit): If the test is null, then report that
we do `return', as we wont reach anything afterwards.
(Switch.SwitchGoverningType): Track the expression that matched
the conversion.
* driver.cs: Allow negative numbers as an error code to flag.
* cs-parser.jay: Handle 1551.
* namespace.cs: Add 1537 checking (repeated using alias namespaces).
2002-01-15 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Report 1518 (type declaration can only contain
class, struct, interface, enum or delegate)
(switch_label): Report 1523 (keywords `case' or `default' must
preced code)
(opt_switch_sections): Report 1522 (empty switch)
* driver.cs: Report 1515 (response file specified multiple times)
Report 1516 (Source file specified multiple times).
* expression.cs (Argument.Resolve): Signal 1510
(BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
access not allowed in static code)
2002-01-11 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IsPointerType): Utility method which we are going
to need a lot.
* ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
the object type, so we take care of that.
* expression.cs (FullMethodDesc): Also include the return type in descriptions.
* support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
added to non-params parameters :-)
* typemanager.cs (CSharpName): Include 'void' type too.
(void_ptr_type): Include in the set of core types.
* ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
duplicating code.
(ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
an unsafe context.
* cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
completely forgotten about it.
2002-01-10 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (pointer_type): Add. This begins our implementation
of parsing rules for unsafe code.
(unsafe_statement): Implement.
(embedded_statement): Modify to include the above.
* statement.cs (Unsafe): Implement new class for unsafe blocks.
* codegen.cs (EmitContext.InUnsafe): Add. This determines
if the current context is an unsafe one.
* cs-parser.jay (local_variable_pointer_type): Since local variable types
are handled differently, we need separate rules for them.
(local_variable_declaration): Update to use local_variable_pointer_type
to allow variable declarations of unmanaged pointer types.
* expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
in unsafe contexts.
* ../errors/cs0214.cs : Add.
2002-01-16 Nick Drochak <ndrochak@gol.com>
* makefile: remove 'response' file when cleaning.
2002-01-15 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Report 1524.
2002-01-14 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (RegisterMethod): drop checking if we have
registered this from here
2002-01-12 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method.EmitDestructor): Implement calling our base
destructor.
* statement.cs (Try.Emit): Fix to reset the InFinally to the old
value of InFinally.
* codegen.cs (EmitContext.EmitTopBlock): Destructors will call
this routine and will wrap the call in a try/catch block. Deal
with the case.
2002-01-11 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.MemberLookup): instead of taking a
parameter `same_type' that was used to tell whether we could
access private members we compute our containing type from the
EmitContext.
(FieldExpr): Added partial support for volatile fields. This does
not work for volatile fields exposed from assemblies, as I can not
figure out how to extract the modreq from it.
Updated all the source files to use this.
* codegen.cs (EmitContext): Compute ContainerType ahead of time,
because it is referenced by MemberLookup very often.
2002-01-09 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
TypeBuilder.GetCustomAttributes to retrieve what we need.
Get rid of redundant default_member_attr_type as this is the same as
default_member_type which already exists.
* interface.cs, attribute.cs : Update accordingly.
2002-01-08 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Enable IndexerPropertyName again. It does not
work for TYpeBuilders though. Ravi, can you please fix this?
* cs-tokenizer.cs: Accept _ as a name in pp-expressions.
* expression.cs (Argument.Emit): Handle the case of ref objects
being passed to ref functions;
(ParameterReference.EmitLoad): Loads the content of the pointer
without dereferencing.
2002-01-07 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Implemented the pre-processing expressions.
2002-01-08 Ravi Pratap <ravi@ximian.com>
* class.cs (Indexer.DefineMethod): Incorporate the interface
type in the name of the method if we are doing explicit interface
implementation.
* expression.cs (ConversionExists): Remove as it is completely obsolete.
(BetterConversion): Fix extremely trivial bug where we were referring to
ConversionExists instead of StandardConversionExists ! Hooray, things are fine
again !
* ../errors/bug16.cs : Add although we have fixed it.
2002-01-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (BaseIndexer): Begin implementation.
* class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
* cs-parser.jay (indexer_declarator): Use qualified_identifier
production directly to remove a shift/reduce, and implement
explicit interface implementation.
* cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
after a floating point suffix.
* expression.cs (DoNumericPromotions): Improved the conversion for
uint/uint. If we have a constant, we avoid doing a typecast to a
larger type.
* class.cs (Indexer): Implement explicit interface implementation
for indexers.
Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: make the default instance constructor public and hidebysig.
2001-01-03 Ravi Pratap <ravi@ximian.com>
* interface.cs (EmitDefaultMemberAttr): Make this helper method static
so we can call it from elsewhere.
* class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
we emit it internally if the class has a defined indexer; otherwise the user
emits it by decorating the class definition with the DefaultMemberAttribute.
* attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
attribute is not used on a type which defines an indexer.
* cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
character when we skip whitespace.
* ../errors/cs0646.cs : Add.
2002-01-03 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (SimpleName.ResolveSimpleName): Report error 120
again.
* makefile: Add practical target `mcs3.exe' which builds the third
generation compiler.
* expression.cs (New): Fix structures constructor calling.
* class.cs (Property, Method, Indexer): Emit Final flag on the
method if we are an interface implementation and we are not
abstract.
* ecore.cs (PropertyExpr): New public field `IsBase', tells
whether this property is referencing a `base' method.
* expression.cs (Invocation.EmitCall): take an extra argument:
is_base, this is used to determine whether the `call' or
`callvirt' opcode should be used.
* delegate.cs: update EmitCall.
* class.cs (Method.Define): Set NewSlot for the cases where we are
not implementing an interface method.
(Property.Define): ditto.
2002-01-02 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
'r'. Allows mcs to parse itself fully.
2002-01-02 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation.num_automatic_initializers): Keep track
of the number of initializers that require the InitializeArray method.
(CheckIndices): Store the Expression in all cases - not the plain value. Also
update the above field where necessary.
(MakeByteBlob): Update accordingly.
(DoEmit): Call EmitStaticInitializers only if the number of initializers is
greater than 2.
(EmitDynamicInitializers): Update in accordance with the new optimization.
(ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
same OpCode applies.
* cs-parser.jay : Fix some glaring errors I introduced.
2002-01-01 Ravi Pratap <ravi@ximian.com>
* parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
so that we can check for name clashes there too.
* typemanager.cs (default_member_attr_type): The attribute that we need to emit
for interface indexers.
* interfaces.cs (Define): Emit the default member attribute.
* expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
variable was being referred to while setting the value ;-)
2002-01-01 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MakeByteBlob): Optimize: we do not need to fill
byte-by-byte information when we know the data is zero.
Make the block always a multiple of 4, because
DefineInitializedData has a bug.
* assign.cs: Fix, we should assign from the temporary, not from
the source.
* expression.cs (MakeByteBlob): Fix my incorrect code.
2001-12-31 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (EnumToUnderlying): This function is used to get
the underlying type from an enumeration, because it does not
always work.
* constant.cs: Use the I4_S form for values between -128 and 127.
* statement.cs (Block.LookupLabel): Looks up a label.
(Block): Drop support for labeled blocks.
(LabeledStatement): New kind of statement that represents a label
only.
(Goto): Finally implement this bad boy.
* cs-parser.jay: Update to reflect new mechanism to implement
labels.
2001-12-30 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitContext.This): a codegen property that keeps the
a single instance of this instead of creating many different this
instances.
* delegate.cs (Delegate.DoResolve): Update to use the property;
* ecore.cs (SimpleName.SimpleNameResolve): Ditto
* expression.cs (BaseAccess.DoResolve): Ditto.
2001-12-29 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (methodimpl_attr_type): Add to hold the type
corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
(InitCoreTypes): Update accordingly.
* attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
so we can quickly store the state.
(ApplyAttributes): Set the correct implementation flags
for InternalCall methods.
2001-12-29 Miguel de Icaza <miguel@ximian.com>
* expression.cs (EmitCall): if a method is not virtual, then do
not use callvirt on it.
(ArrayAccess.EmitAssign): storing non-builtin value types (ie,
user defined stuff) requires the use of stobj, which takes an
address on the stack instead of an array and an index. So emit
the Ldelema operation for it.
(EmitStoreOpcode): Use stobj for valuetypes.
(UnaryMutator.EmitCode): Use the right 1 value depending on
whether we are dealing with int64/uint64, float or doubles.
* class.cs (TypeContainer.AddConstructor): Fix the logic to define
constructors that I implemented last night.
(Constructor.IsDefault): Fix to work properly for static
constructors.
* cs-parser.jay (CheckDef): report method signature errors.
Update error number 103 to be 132.
* decl.cs: New AdditionResult enumeration value: MethodExists.
Although we do this check for methods later on in the semantic
analysis, catching repeated default constructors is so easy that
we catch these here.
* expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
promotions code.
(ParameterReference.EmitAssign, Emit): handle
bools as bytes.
(ArrayAccess.EmitLoadOpcode): Handle bool type here.
(ArrayAccess.EmitStoreOpcode): ditto.
* cs-tokenizer.cs (is_punct): Eliminated empty computation.
* expression.cs (MakeByteBlob): Complete all the missing types
(uint, short, ushort, byte, sbyte)
* class.cs: Only init instance field initializers on instance
constructors.
Rename `constructors' to instance_constructors.
(TypeContainer.AddConstructor): Only add constructors to the list
if it is not static.
Make sure that we handle default_static_constructor independently
everywhere where we handle instance_constructors
2001-12-28 Miguel de Icaza <miguel@ximian.com>
* class.cs: Do not lookup or create a base initializer for a
static constructor.
(ConstructorInitializer.Resolve): use the proper type to lookup
for constructors.
* cs-parser.jay: Report error 1585 (modifiers between type and name).
* enum.cs, interface.cs: Remove CloseType, this is taken care by
in DeclSpace.
* decl.cs: CloseType is now an virtual method, the default
implementation just closes this type.
2001-12-28 Ravi Pratap <ravi@ximian.com>
* attribute.cs (DefinePInvokeMethod): Set the implementation flags
to PreserveSig by default. Also emit HideBySig on such methods.
Basically, set the defaults to standard values.
* expression.cs (Invocation.BetterFunction): We need to make sure that for each
argument, if candidate is better, it can't be worse than the best !
(Invocation): Re-write bits to differentiate between methods being
applicable in their expanded form and their normal form - for params
methods of course.
Get rid of use_standard everywhere as only standard conversions are allowed
in overload resolution.
More spec conformance.
2001-12-27 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add --timestamp, to see where the compiler spends
most of its time.
* ecore.cs (SimpleName.DoResolve): Do not create an implicit
`this' in static code.
(SimpleName.DoResolve): Implement in terms of a helper function
that allows static-references to be passed upstream to
MemberAccess.
(Expression.ResolveWithSimpleName): Resolve specially simple
names when called by MemberAccess to implement the special
semantics.
(Expression.ImplicitReferenceConversion): Handle conversions from
Null to reference types before others, as Null's type is
System.Object.
* expression.cs (Invocation.EmitCall): Handle the special case of
calling methods declared on a reference type from a ValueType
(Base classes System.Object and System.Enum)
(MemberAccess.Resolve): Only perform lookups on Enumerations if
the left hand side is a TypeExpr, not on every enumeration.
(Binary.Resolve): If types are reference types, then do a cast to
object on operators != and == of both arguments.
* typemanager.cs (FindMembers): Extract instance and static
members if requested.
* interface.cs (PopulateProperty): Use void_type instead of null
as the return type for the setter method.
(PopulateIndexer): ditto.
2001-12-27 Ravi Pratap <ravi@ximian.com>
* support.cs (ReflectionParameters): Fix minor bug where we
were examining the wrong parameter for the ParamArray attribute.
Cope with requests for the type of the parameter at position
greater than the params parameter's. We now return the element
type of the params array as that makes more sense.
* expression.cs (Invocation.IsParamsMethodApplicable): Update
accordingly as we no longer have to extract the element type
ourselves.
(Invocation.OverloadResolve): Update.
2001-12-27 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Foreach.GetEnumeratorFilter): Do not compare
against IEnumerator, test whether the return value is a descendant
of the IEnumerator interface.
* class.cs (Indexer.Define): Use an auxiliary method to implement
the other bits of the method definition. Begin support for
explicit interface implementation.
(Property.DefineMethod): Use TypeManager.void_type instead of null
for an empty return value.
2001-12-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberAccess.ResolveMemberAccess): if we are
dealing with a FieldExpr which is composed of a FieldBuilder, in
the code path we did extract the constant, but we should have
obtained the underlying value to be able to cast it (otherwise we
end up in an infinite loop, this is what Ravi was running into).
(ArrayCreation.UpdateIndices): Arrays might be empty.
(MemberAccess.ResolveMemberAccess): Add support for section
14.5.4.1 that deals with the special case of E.I when E is a type
and something else, that I can be a reference to a static member.
(ArrayCreation.MakeByteBlob): It is not an error to not be able to
handle a particular array type to create byte blobs, it is just
something we dont generate byteblobs for.
* cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
arguments.
* location.cs (Push): remove the key from the hashtable that we
are about to add. This happens for empty files.
* driver.cs: Dispose files after we have parsed them.
(tokenize): new function that only runs the tokenizer on its
input, for speed testing.
2001-12-26 Ravi Pratap <ravi@ximian.com>
* class.cs (Event.Define): Define the private field only if there
are no accessors defined.
* expression.cs (ResolveMemberAccess): If there is no associated
field with the event, that means we have an event defined with its
own accessors and we should flag error cs0070 since transforming
ourselves into a field is not valid in that case.
* ecore.cs (SimpleName.DoResolve): Same as above.
* attribute.cs (DefinePInvokeMethod): Set the default calling convention
and charset to sane values.
2001-12-25 Ravi Pratap <ravi@ximian.com>
* assign.cs (DoResolve): Perform check on events only if they
are being accessed outside the declaring type.
* cs-parser.jay (event_declarations): Update rules to correctly
set the type of the implicit parameter etc.
(add_accessor, remove_accessor): Set current local parameters.
* expression.cs (Binary): For delegate addition and subtraction,
cast the return value from the method into the appropriate delegate
type.
2001-12-24 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
of these as the workaround is unnecessary.
* delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
delegate data - none of that is needed at all.
Re-write bits to extract the instance expression and the delegate method
correctly.
* expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
on delegates too.
* attribute.cs (ApplyAttributes): New method to take care of common tasks
of attaching attributes instead of duplicating code everywhere.
* everywhere : Update code to do attribute emission using the above method.
2001-12-23 Miguel de Icaza <miguel@ximian.com>
* expression.cs (IsParamsMethodApplicable): if there are not
parameters, return immediately.
* ecore.cs: The 0 literal can be implicity converted to an enum
type.
(SimpleName.DoResolve): First lookup the type, then lookup the
members.
(FieldExpr.Emit): If the InstanceExpression is a ValueType, we
want to get its address. If the InstanceExpression is not
addressable, store the result in a temporary variable, then get
the address of it.
* codegen.cs: Only display 219 errors on warning level or above.
* expression.cs (ArrayAccess): Make it implement the
IMemoryLocation interface.
(Binary.DoResolve): handle the operator == (object a, object b)
and operator != (object a, object b) without incurring into a
BoxedCast (because 5 != o should never be performed).
Handle binary enumerator operators.
(EmitLoadOpcode): Use Ldelema if the object we are loading is a
value type, otherwise use Ldelem_ref.
Use precomputed names;
(AddressOf): Implement address of
* cs-parser.jay (labeled_statement): Fix recursive block
addition by reworking the production.
* expression.cs (New.DoEmit): New has a special case:
If we are dealing with a ValueType, we have a few
situations to deal with:
* The target of New is a ValueType variable, that is
easy, we just pass this as the variable reference
* The target of New is being passed as an argument,
to a boxing operation or a function that takes a
ValueType.
In this case, we need to create a temporary variable
that is the argument of New.
2001-12-23 Ravi Pratap <ravi@ximian.com>
* rootcontext.cs (LookupType): Check that current_type is not null before
going about looking at nested types.
* ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
not implement the IAssignMethod interface any more.
* expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
where we tranform them into FieldExprs if they are being resolved from within
the declaring type.
* ecore.cs (SimpleName.DoResolve): Do the same here.
* assign.cs (DoResolve, Emit): Clean up code considerably.
* ../errors/bug10.cs : Add.
* ../errors/cs0070.cs : Add.
* typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
* assign.cs : Get rid of EventIsLocal everywhere.
2001-12-23 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (ConvertIntLiteral): finished the implementation.
* statement.cs (SwitchLabel): Convert the value we are using as a
key before looking up the table.
2001-12-22 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitTopBlock): Require a Location argument now.
* cs-parser.jay (constructor_declarator): We need to setup
current_local_parameters before we parse the
opt_constructor_initializer, to allow the variables to be bound
to the constructor arguments.
* rootcontext.cs (LookupType): First lookup nested classes in our
class and our parents before we go looking outside our class.
* expression.cs (ConstantFold): Extract/debox the values at the
beginnning.
* rootcontext.cs (EmitCode): Resolve the constants first before we
resolve the types. This is not really needed, but it helps debugging.
* statement.cs: report location.
* cs-parser.jay: pass location to throw statement.
* driver.cs: Small bug fix.
* report.cs: Updated format to be 4-zero filled digits.
2001-12-22 Ravi Pratap <ravi@ximian.com>
* expression.cs (CheckIndices): Fix minor bug where the wrong
variable was being referred to ;-)
(DoEmit): Do not call EmitStaticInitializers when the
underlying type is System.Object.
2001-12-21 Ravi Pratap <ravi@ximian.com>
* ecore.cs (EventExpr.Resolve): Implement to correctly set the type
and do the usual workaround for SRE.
* class.cs (MyEventBuilder.EventType): New member to get at the type
of the event, quickly.
* expression.cs (Binary.ResolveOperator): Handle delegate addition.
* assign.cs (Assign.DoResolve): Handle the case when the target
is an EventExpr and perform the necessary checks.
* ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
interface.
(SimpleName.MemberStaticCheck): Include check for EventExpr.
(EventExpr): Set the type in the constructor itself since we
are meant to be born fully resolved.
(EventExpr.Define): Revert code I wrote earlier.
* delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
instance expression is null. The instance expression is a This in that case
or a null, depending on whether it is a static method or not.
Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
refers to more than one method.
* assign.cs (DoResolve): Check whether the event belongs to the same Type container
and accordingly flag errors.
2001-12-21 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Throw.Emit): Add support for re-throwing exceptions.
2001-12-22 Miguel de Icaza <miguel@ximian.com>
* location.cs (ToString): Provide useful rutine.
2001-12-21 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
objects, return the actual integral boxed.
* statement.cs (SwitchLabel): define an ILLabel for each
SwitchLabel.
(Switch.CheckSwitch): If the value is a Literal, extract
the underlying literal.
Also in the unused hashtable we had, add the SwitchLabel so we can
quickly look this value up.
* constant.cs: Implement a bunch of new constants. Rewrite
Literal based on this. Made changes everywhere to adapt to this.
* expression.cs (Expression.MakeByteBlob): Optimize routine by
dereferencing array only once, and also copes with enumrations.
bytes are two bytes wide, not one.
(Cast): Perform constant conversions.
* ecore.cs (TryImplicitIntConversion): Return literals instead of
wrappers to the literals here.
* expression.cs (DoNumericPromotions): long literals can converted
to ulong implicity (this is taken care of elsewhere, but I was
missing this spot).
* ecore.cs (Expression.Literalize): Make the return type Literal,
to improve type checking.
* rootcontext.cs: Lookup for nested classes in our class hierarchy.
2001-12-20 Miguel de Icaza <miguel@ximian.com>
* literal.cs: Revert code from ravi that checked the bounds. The
bounds are sane by the definition of the type itself.
* typemanager.cs: Fix implementation of ImplementsInterface. We
need to actually look up in our parent hierarchy for interfaces
implemented.
* const.cs: Use the underlying type for enumerations
* delegate.cs: Compute the basename for the delegate creation,
that should fix the delegate test case, and restore the correct
Type Lookup semantics in rootcontext
* rootcontext.cs: Revert Ravi's last patch. The correct way of
referencing a nested type with the Reflection API is using the "+"
sign.
* cs-parser.jay: Do not require EOF token at the end.
2001-12-20 Ravi Pratap <ravi@ximian.com>
* rootcontext.cs (LookupType): Concatenate type names with
a '.' instead of a '+' The test suite passes again.
* enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
field of the enumeration.
* expression.cs (MemberAccess.ResolveMemberAccess): Add support for
the case when the member is an EventExpr.
* ecore.cs (EventExpr.InstanceExpression): Every event which is not
static has an associated instance expression.
* typemanager.cs (RegisterEvent): The usual workaround, now for events.
(GetAddMethod, GetRemoveMethod): Workarounds, as usual.
* class.cs (Event.Define): Register event and perform appropriate checks
for error #111.
We define the Add and Remove methods even if the use provides none because
in that case, we provide default implementations ourselves.
Define a private field of the type of the event. This is done by the CSC compiler
and we should be doing it too ;-)
* typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
More methods we use in code we generate.
(multicast_delegate_type, delegate_type): Two separate types since the distinction
is important.
(InitCoreTypes): Update accordingly for the above.
* class.cs (Event.Emit): Generate code for default accessors that we provide
(EmitDefaultMethod): Do the job in the above.
* delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
appropriate place.
2001-12-20 Miguel de Icaza <miguel@ximian.com>
* class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
builders even if we were missing one.
* interface.cs, class.cs, enum.cs: When calling DefineNestedType
pass the Basename as our class name instead of the Name. The
basename will be correctly composed for us.
* parameter.cs (Paramters): Now takes a Location argument.
* decl.cs (DeclSpace.LookupType): Removed convenience function and
make all the code call directly LookupType in RootContext and take
this chance to pass the Location information everywhere.
* Everywhere: pass Location information.
2001-12-19 Miguel de Icaza <miguel@ximian.com>
* class.cs (Constructor.Define): Updated way of detecting the
length of the parameters.
(TypeContainer.DefineType): Use basename as the type name for
nested types.
(TypeContainer.Define): Do not recursively define types here, as
definition is taken care in order by the RootContext.
* tree.cs: Keep track of namespaces in a per-file basis.
* parameter.cs (Parameter.ComputeSignature): Update to use
DeclSpace.
(Parameters.GetSignature): ditto.
* interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
instead of a TypeContainer.
(Interface.SemanticAnalysis): Use `this' instead of our parent to
resolve names. Because we need to be resolve in our context, not
our parents.
* driver.cs: Implement response files.
* class.cs (TypeContainer.DefineType): If we are defined, do not
redefine ourselves.
(Event.Emit): Emit the code for add/remove handlers.
(Event.Define): Save the MethodBuilders for add/remove.
* typemanager.cs: Use pair here too.
* cs-parser.jay: Replaced use of DictionaryEntry for Pair because
DictionaryEntry requires the first argument to be non-null.
(enum_declaration): Compute full name for registering the
enumeration.
(delegate_declaration): Instead of using
formal_parameter_list, use opt_formal_parameter_list as the list
can be empty.
* cs-tokenizer.cs (PropertyParsing): renamed from `properties'
(EventParsing): New property that controls whether `add' and
`remove' are returned as tokens or identifiers (for events);
2001-12-19 Ravi Pratap <ravi@ximian.com>
* class.cs (Event.Define): Revamp use of EventBuilder completely. We now
use MyEventBuilder only and let it wrap the real builder for us.
(MyEventBuilder): Revamp constructor etc.
Implement all operations that we perform on EventBuilder in precisely the same
way here too.
(FindMembers): Update to use the EventBuilder member.
(Event.Emit): Update accordingly.
2001-12-18 Ravi Pratap <ravi@ximian.com>
* class.cs (MyEventBuilder.Set*): Chain to the underlying builder
by calling the appropriate methods.
(GetCustomAttributes): Make stubs as they cannot possibly do anything
useful.
(Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
2001-12-17 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Delegate.Populate): Check that the return type
and various parameters types are indeed accessible.
* class.cs (Constructor.Define): Same here.
(Field.Define): Ditto.
(Event.Define): Ditto.
(Operator.Define): Check that the underlying Method defined itself
correctly - so it's MethodBuilder should not be null.
* delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
expression happens to be null.
* class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
members but as of now we don't seem to be able to do anything really useful with it.
(FindMembers): Handle events separately by returning the MyEventBuilder of the event,
not the EventBuilder.
2001-12-18 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Add support for defines.
Add support for #if, #elif, #else, #endif
(eval_var): evaluates a variable.
(eval): stubbed for evaluating functions.
* cs-parser.jay: Pass the defines information
* driver.cs: Add --define command line option.
* decl.cs: Move MemberCore here.
Make it the base class for DeclSpace. This allows us to catch and
report 108 and 109 for everything now.
* class.cs (TypeContainer.Define): Extract all the members
before populating and emit the warning 108 (new keyword required
to override) instead of having each member implement this.
(MemberCore.Define): New abstract method, we will be using this in
the warning reporting engine in Populate.
(Operator.Define): Adjust to new MemberCore protocol.
* const.cs (Const): This does not derive from Expression, it is a
temporary object we use to create fields, it is a MemberCore.
* class.cs (Method.Define): Allow the entry point to be in a
specific class.
* driver.cs: Rewrite the argument handler to clean it up a bit.
* rootcontext.cs: Made it just an auxiliary namespace feature by
making everything static.
* driver.cs: Adapt code to use RootContext type name instead of
instance variable.
* delegate.cs: Remove RootContext argument.
* class.cs: (Struct, TypeContainer, Class): Remove RootContext
argument.
* class.cs (Event.Define): The lookup can fail.
* cs-tokenizer.cs: Begin implementation of pre-procesor.
* expression.cs: Resolve the this instance before invoking the code.
2001-12-17 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add a production in element_access that allows
the thing to become a "type" reference. This way we can parse
things like "(string [])" as a type.
Note that this still does not handle the more complex rules of
casts.
* delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
* ecore.cs: (CopyNewMethods): new utility function used to
assemble the list of methods from running FindMembers.
(MemberLookup): Rework FindMembers so that
2001-12-16 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer): Remove Delegates who fail to be
defined.
* delegate.cs (Populate): Verify that we dont get null return
values. TODO: Check for AsAccessible.
* cs-parser.jay: Use basename to emit error 574 (destructor should
have the same name as container class), not the full name.
* cs-tokenizer.cs (adjust_int): Fit the integer in the best
possible representation.
Also implements integer type suffixes U and L.
2001-12-15 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayCreation.DoResolve): We need to do the
argument resolution *always*.
* decl.cs: Make this hold the namespace. Hold the root context as
well.
(LookupType): Move here.
* enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
* location.cs (Row, Name): Fixed the code, it was always returning
references to the first file.
* interface.cs: Register properties defined through interfaces.
* driver.cs: Add support for globbing on the command line
* class.cs (Field): Make it derive from MemberCore as well.
(Event): ditto.
2001-12-15 Ravi Pratap <ravi@ximian.com>
* class.cs (Event::Define): Check that the type of the event is a delegate
type else flag error #66.
Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
same.
* attribute.cs (DefinePInvokeMethod): Handle named arguments and process
values of EntryPoint, CharSet etc etc.
Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
* class.cs (FindMembers): If a method is in transit, its MethodBuilder will
be null and we should ignore this. I am not sure if this is really clean. Apparently,
there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
which needs this to do its work.
* ../errors/cs0066.cs : Add.
2001-12-14 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
helper functions.
* class.cs: (MethodSignature.MethodSignature): Removed hack that
clears out the parameters field.
(MemberSignatureCompare): Cleanup
(MemberCore): New base class used to share code between MethodCore
and Property.
(RegisterRequiredImplementations) BindingFlags.Public requires
either BindingFlags.Instace or Static. Use instance here.
(Property): Refactored code to cope better with the full spec.
* parameter.cs (GetParameterInfo): Return an empty array instead
of null on error.
* class.cs (Property): Abstract or extern properties have no bodies.
* parameter.cs (GetParameterInfo): return a zero-sized array.
* class.cs (TypeContainer.MethodModifiersValid): Move all the
method modifier validation to the typecontainer so we can reuse
this on properties.
(MethodCore.ParameterTypes): return an empty sized array of types.
(Property.Define): Test property modifier validity.
Add tests for sealed/override too.
(Method.Emit): abstract or extern methods have no bodies.
2001-12-14 Ravi Pratap <ravi@ximian.com>
* class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
thing.
(Method::Define, ::Emit): Modify accordingly.
* expression.cs (Invocation::OverloadResolve): Handle error # 121.
(ArrayCreation::MakeByteBlob): Handle floats and doubles.
* makefile: Pass in /unsafe.
2001-12-13 Miguel de Icaza <miguel@ximian.com>
* class.cs (MakeKey): Kill routine.
* class.cs (TypeContainer.Define): Correctly define explicit
method implementations (they require the full interface name plus
the method name).
* typemanager.cs: Deply the PtrHashtable here and stop using the
lame keys. Things work so much better.
This of course broke everyone who depended on `RegisterMethod' to
do the `test for existance' test. This has to be done elsewhere.
* support.cs (PtrHashtable): A hashtable that avoid comparing with
the object stupid Equals method (because, that like fails all over
the place). We still do not use it.
* class.cs (TypeContainer.SetRequiredInterface,
TypeContainer.RequireMethods): Killed these two routines and moved
all the functionality to RegisterRequiredImplementations.
(TypeContainer.RegisterRequiredImplementations): This routine now
registers all the implementations required in an array for the
interfaces and abstract methods. We use an array of structures
which can be computed ahead of time to reduce memory usage and we
also assume that lookups are cheap as most classes will not
implement too many interfaces.
We also avoid creating too many MethodSignatures.
(TypeContainer.IsInterfaceMethod): Update and optionally does not
clear the "pending" bit if we find that there are problems with
the declaration.
(TypeContainer.VerifyPendingMethods): Update to report errors of
methods that look like implementations but are not.
(TypeContainer.Define): Add support for explicit interface method
implementation.
2001-12-12 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Keep track of the parameters here instead of
being a feature of the TypeContainer.
* class.cs: Drop the registration of parameters here, as
InterfaceMethods are also interface declarations.
* delegate.cs: Register methods with the TypeManager not only with
the TypeContainer. This code was buggy.
* interface.cs: Full registation here.
2001-12-11 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Remove reducer for binary expressions, it can not
be done this way.
* const.cs: Put here the code that used to go into constant.cs
* constant.cs: Put here the code for constants, this is a new base
class for Literals.
* literal.cs: Make Literal derive from Constant.
2001-12-09 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Return.Emit): Report error 157 if the user
attempts to return from a finally block.
(Return.Emit): Instead of emitting a return, jump to the end of
the function.
* codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
LocalBuilder to store the result of the function. ReturnLabel is
the target where we jump.
2001-12-09 Radek Doulik <rodo@ximian.com>
* cs-parser.jay: remember alias in current namespace
* ecore.cs (SimpleName::DoResolve): use aliases for types or
namespaces
* class.cs (LookupAlias): lookup alias in my_namespace
* namespace.cs (UsingAlias): add alias, namespace_or_type pair to
aliases hashtable
(LookupAlias): lookup alias in this and if needed in parent
namespaces
2001-12-08 Miguel de Icaza <miguel@ximian.com>
* support.cs:
* rootcontext.cs: (ModuleBuilder) Made static, first step into
making things static. I need this to avoid passing the
TypeContainer when calling ParameterType.
* support.cs (InternalParameters.ParameterType): Remove ugly hack
that did string manipulation to compute the type and then call
GetType. Use Parameter.ParameterType instead.
* cs-tokenizer.cs: Consume the suffix for floating values.
* expression.cs (ParameterReference): figure out whether this is a
reference parameter or not. Kill an extra variable by computing
the arg_idx during emission.
* parameter.cs (Parameters.GetParameterInfo): New overloaded
function that returns whether a parameter is an out/ref value or not.
(Parameter.ParameterType): The type of the parameter (base,
without ref/out applied).
(Parameter.Resolve): Perform resolution here.
(Parameter.ExternalType): The full type (with ref/out applied).
* statement.cs (Using.Emit, Using.EmitExpression): Implement
support for expressions on the using statement.
2001-12-07 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Using.EmitLocalVariableDecls): Split the
localvariable handling of the using statement.
(Block.EmitMeta): Keep track of variable count across blocks. We
were reusing slots on separate branches of blocks.
(Try.Emit): Emit the general code block, we were not emitting it.
Check the type of the declaration to be an IDisposable or
something that can be implicity converted to it.
Emit conversions if required.
* ecore.cs (EmptyExpression): New utility class.
(Expression.ImplicitConversionExists): New utility function.
2001-12-06 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Using): Implement.
* expression.cs (LocalVariableReference): Support read only variables.
* statement.cs: Remove the explicit emit for the Leave opcode.
(VariableInfo): Add a readonly field.
2001-12-05 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (ConvCast): new class used to encapsulate the various
explicit integer conversions that works in both checked and
unchecked contexts.
(Expression.ConvertNumericExplicit): Use new ConvCast class to
properly generate the overflow opcodes.
2001-12-04 Miguel de Icaza <miguel@ximian.com>
* statement.cs: The correct type for the EmptyExpression is the
element_type, not the variable type. Ravi pointed this out.
2001-12-04 Ravi Pratap <ravi@ximian.com>
* class.cs (Method::Define): Handle PInvoke methods specially
by using DefinePInvokeMethod instead of the usual one.
* attribute.cs (DefinePInvokeMethod): Implement as this is what is called
above to do the task of extracting information and defining the method.
2001-12-04 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
of the condition for string type.
(Emit): Move that here.
(ArrayCreation::CheckIndices): Keep string literals in their expression
form.
(EmitDynamicInitializers): Handle strings appropriately.
2001-12-04 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitContext): Replace multiple variables with a
single pointer to the current Switch statement.
* statement.cs (GotoDefault, Switch): Adjust to cleaned up
EmitContext.
2001-12-03 Miguel de Icaza <miguel@ximian.com>
* statement.cs
* statement.cs (GotoDefault), cs-parser.jay: Implement `goto
default'.
(Foreach.Emit): Foreach on arrays was not setting
up the loop variables (for break/continue).
(GotoCase): Semi-implented.
2001-12-03 Ravi Pratap <ravi@ximian.com>
* attribute.cs (CheckAttribute): Handle system attributes by using
Attribute.GetAttributes to examine information we need.
(GetValidPlaces): Same here.
* class.cs (Method::Define): Catch invalid use of extern and abstract together.
* typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
* class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
(Method::Define): Set appropriate flags if we have a DllImport attribute.
(Method::Emit): Handle the case when we are a PInvoke method.
2001-12-03 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Use ResolveWithSimpleName on compound names.
2001-12-02 Ravi Pratap <ravi@ximian.com>
* constant.cs (EmitConstant): Make sure we resolve the associated expression
before trying to reduce it.
* typemanager.cs (RegisterConstant, LookupConstant): Implement.
* constant.cs (LookupConstantValue): Implement.
(EmitConstant): Use the above in emitting the constant.
* expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
that are user-defined by doing a LookupConstantValue on them.
(SimpleName::DoResolve): When we have a FieldExpr, cope with constants
too, like above.
2001-11-29 Miguel de Icaza <miguel@ximian.com>
* expression.cs (BaseAccess, BaseIndexer): Also split this out.
(BaseAccess.DoResolve): Implement.
(MemberAccess.DoResolve): Split this routine into a
ResolveMemberAccess routine that can be used independently
2001-11-28 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Probe, Is, As): Split Probe in two classes Is and
As that share bits of the implementation. Is returns a boolean,
while As returns the Type that is being probed.
2001-12-01 Ravi Pratap <ravi@ximian.com>
* enum.cs (LookupEnumValue): Re-write various bits, return an object value
instead of a Literal - much easier.
(EnumInTransit): Remove - utterly useless :-)
(Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
* expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
* enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
chain when we have no associated expression.
2001-11-30 Ravi Pratap <ravi@ximian.com>
* constant.cs (Define): Use Location while reporting the errror.
Also emit a warning when 'new' is used and there is no inherited
member to hide.
* enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
populated.
(LookupEnumValue): Implement to lookup an enum member's value and define it
if necessary.
(Populate): Re-write accordingly to use the above routine.
2001-11-27 Miguel de Icaza <miguel@ximian.com>
* expression.cs (This): Fix prototype for DoResolveLValue to
override the base class DoResolveLValue.
* cs-parser.cs: Report errors cs574 and cs575 (destructor
declarations)
* ecore.cs (FieldExpr.EmitAssign): Handle value types specially
(we need to load the address of the field here). This fixes
test-22.
(FieldExpr.DoResolveLValue): Call the DoResolve
function to initialize the Instance expression.
* statement.cs (Foreach.Emit): Fix the bug where we did not invoke
correctly the GetEnumerator operation on a value type.
* cs-parser.jay: Add more simple parsing error catches.
* statement.cs (Switch): Add support for string switches.
Handle null specially.
* literal.cs (NullLiteral): Make NullLiteral objects singletons.
2001-11-28 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (local_constant_declaration): Use declare_local_constant.
(declare_local_constant): New helper function.
* statement.cs (AddConstant): Keep a separate record of constants
(IsConstant): Implement to determine if a variable is a constant.
(GetConstantExpression): Implement.
* expression.cs (LocalVariableReference): Handle the case when it is a constant.
* statement.cs (IsVariableDefined): Re-write.
2001-11-27 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::FindMembers): Look for constants
in the case when we are looking for MemberTypes.Field
* expression.cs (MemberAccess::DoResolve): Check that in the
case we are a FieldExpr and a Literal, we are not being accessed
by an instance reference.
* cs-parser.jay (local_constant_declaration): Implement.
(declaration_statement): Implement for constant declarations.
2001-11-26 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Switch): Catch double defaults.
(Switch): More work on the switch() statement
implementation. It works for integral values now, need to finish
string support.
2001-11-24 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (Expression.ConvertIntLiteral): New function to convert
integer literals into other integer literals. To be used by
switch.
2001-11-24 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
some memory.
(EmitDynamicInitializers): Cope with the above since we extract data
directly from ArrayData now.
(ExpectInitializers): Keep track of whether initializers are mandatory
or not.
(Bounds): Make it a hashtable to prevent the same dimension being
recorded for every element in that dimension.
(EmitDynamicInitializers): Fix bug which prevented the Set array method
from being found.
Also fix bug which was causing the indices to be emitted in the reverse
order.
2001-11-24 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayCreation): Implement the bits that Ravi left
unfinished. They do not work, because the underlying code is
sloppy.
2001-11-22 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Remove bogus fixme.
* statement.cs (Switch, SwitchSection, SwithLabel): Started work
on Switch statement.
2001-11-23 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
the same.
* expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
parameter. Apparently, any expression is allowed.
(ValidateInitializers): Update accordingly.
(CheckIndices): Fix some tricky bugs thanks to recursion.
* delegate.cs (NewDelegate::DoResolve): Re-write large portions as
I was being completely brain-dead.
(VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
and re-write acordingly.
(DelegateInvocation): Re-write accordingly.
* expression.cs (ArrayCreation::Emit): Handle string initialization separately.
(MakeByteBlob): Handle types more correctly.
* expression.cs (ArrayCreation:Emit): Write preliminary code to do
initialization from expressions but it is incomplete because I am a complete
Dodo :-|
2001-11-22 Miguel de Icaza <miguel@ximian.com>
* statement.cs (If.Emit): Fix a bug that generated incorrect code
on If. Basically, we have to return `true' (ie, we do return to
our caller) only if both branches of the if return.
* expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
short-circuit operators, handle them as short circuit operators.
(Cast.DoResolve): Resolve type.
(Cast.Cast): Take an expression as the target type.
* cs-parser.jay (cast_expression): Remove old hack that only
allowed a limited set of types to be handled. Now we take a
unary_expression and we resolve to a type during semantic
analysis.
Use the grammar productions from Rhys to handle casts (this is
not complete like Rhys syntax yet, we fail to handle that corner
case that C# has regarding (-x), but we will get there.
2001-11-22 Ravi Pratap <ravi@ximian.com>
* class.cs (EmitFieldInitializer): Take care of the case when we have a
field which is an array type.
* cs-parser.jay (declare_local_variables): Support array initialization too.
* typemanager.cs (MakeKey): Implement.
(everywhere): Use the above appropriately.
* cs-parser.jay (for_statement): Update for array initialization while
declaring variables.
* ecore.cs : The error message was correct, it's the variable's names that
were misleading ;-) Make the code more readable.
(MemberAccess::DoResolve): Fix the code which handles Enum literals to set
the correct type etc.
(ConvertExplicit): Handle Enum types by examining the underlying type.
2001-11-21 Ravi Pratap <ravi@ximian.com>
* parameter.cs (GetCallingConvention): Always return
CallingConventions.Standard for now.
2001-11-22 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary.ResolveOperator): Update the values of `l'
and `r' after calling DoNumericPromotions.
* ecore.cs: Fix error message (the types were in the wrong order).
* statement.cs (Foreach.ProbeCollectionType): Need to pass
BindingFlags.Instance as well
* ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
implicit int literal conversion in an empty cast so that we
propagate the right type upstream.
(UnboxCast): new class used to unbox value types.
(Expression.ConvertExplicit): Add explicit type conversions done
by unboxing.
(Expression.ImplicitNumericConversion): Oops, forgot to test for
the target type before applying the implicit LongLiterals to ULong
literal cast.
2001-11-21 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (for_statement): Reworked the way For works: now
we declare manually any variables that are introduced in
for_initializer to solve the problem of having out-of-band code
emition (that is what got for broken).
(declaration_statement): Perform the actual variable declaration
that used to be done in local_variable_declaration here.
(local_variable_declaration): Do not declare anything, just pass
the information on a DictionaryEntry
2001-11-20 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
re-write of the logic to now make it recursive.
(UpdateIndices): Re-write accordingly.
Store element data in a separate ArrayData list in the above methods.
(MakeByteBlob): Implement to dump the array data into a byte array.
2001-11-19 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
into CheckIndices.
* constant.cs (Define): Implement.
(EmitConstant): Re-write fully.
Pass in location info.
* class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
respectively.
* cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
DictionaryEntry since we need location info too.
(constant_declaration): Update accordingly.
* expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
code into another method : UpdateIndices.
2001-11-18 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::ValidateInitializers): Update to perform
some type checking etc.
2001-11-17 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::ValidateInitializers): Implement
bits to provide dimension info if the user skips doing that.
Update second constructor to store the rank correctly.
2001-11-16 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::ValidateInitializers): Poke around
and try to implement.
* ../errors/cs0150.cs : Add.
* ../errors/cs0178.cs : Add.
2001-11-16 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Implement foreach on multi-dimensional arrays.
* parameter.cs (Parameters.GetParameterByName): Also lookup the
name of the params argument.
* expression.cs: Use EmitStoreOpcode to get the right opcode while
initializing the array.
(ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
we can use this elsewhere.
* statement.cs: Finish implementation of foreach for single
dimension arrays.
* cs-parser.jay: Use an out-of-band stack to pass information
around, I wonder why I need this.
foreach_block: Make the new foreach_block the current_block.
* parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
function used to return a static Parameters structure. Used for
empty parameters, as those are created very frequently.
* cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
2001-11-15 Ravi Pratap <ravi@ximian.com>
* interface.cs : Default modifier is private, not public. The
make verify test passes again.
2001-11-15 Ravi Pratap <ravi@ximian.com>
* support.cs (ReflectionParameters): Fix logic to determine
whether the last parameter is a params one. Test 9 passes again.
* delegate.cs (Populate): Register the builders we define with
RegisterParameterForBuilder. Test 19 passes again.
* cs-parser.jay (property_declaration): Reference $6 instead
of $$ to get at the location.
(indexer_declaration): Similar stuff.
(attribute): Ditto.
* class.cs (Property): Register parameters for the Get and Set methods
if they exist. Test 23 passes again.
* expression.cs (ArrayCreation::Emit): Pass null for the method in the
call to EmitArguments as we are sure there aren't any params arguments.
Test 32 passes again.
* suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
IndexOutOfRangeException.
* class.cs (Property::Define): Register property using TypeManager.RegisterProperty
Test 33 now passes again.
2001-11-15 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
broke a bunch of things. Will have to come up with a better way
of tracking locations.
* statement.cs: Implemented foreach for single dimension arrays.
2001-11-09 Miguel de Icaza <miguel@ximian.com>
* enum.cs (Enum.Emit): Delay the lookup of loc until we run into
an error. This removes the lookup from the critical path.
* cs-parser.jay: Removed use of temporary_loc, which is completely
broken.
2001-11-14 Miguel de Icaza <miguel@ximian.com>
* support.cs (ReflectionParameters.ParameterModifier): Report
whether the argument is a PARAMS argument or not.
* class.cs: Set the attribute `ParamArrayAttribute' on the
parameter argument.
* typemanager.cs: Define param_array_type (ParamArrayAttribute)
and cons_param_array_attribute (ConstructorInfo for
ParamArrayAttribute).,
* codegen.cs: Emit the return using the `Return' statement, that
way we can report the error correctly for missing return values.
* class.cs (Method.Emit): Clean up.
* expression.cs (Argument.Resolve): Take another argument: the
location where this argument is used. Notice that this is not
part of the "Argument" class as to reduce the size of the
structure (we know the approximate location anyways).
Test if the argument is a variable-reference, if not, then
complain with a 206.
(Argument.Emit): Emit addresses of variables.
(Argument.FullDesc): Simplify.
(Invocation.DoResolve): Update for Argument.Resolve.
(ElementAccess.DoResolve): ditto.
* delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
method should be virtual, as this method is always virtual.
(NewDelegate.DoResolve): Update for Argument.Resolve.
* class.cs (ConstructorInitializer.DoResolve): ditto.
* attribute.cs (Attribute.Resolve): ditto.
2001-11-13 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
* expression.cs (ParameterReference): Drop IStackStorage and implement
IAssignMethod instead.
(LocalVariableReference): ditto.
* ecore.cs (FieldExpr): Drop IStackStorage and implement
IAssignMethod instead.
2001-11-13 Miguel de Icaza <miguel@ximian.com>
* parameter.cs, expression.cs, class.cs, ecore.cs: Made all
enumerations that are used in heavily used structures derive from
byte in a laughable and pathetic attempt to reduce memory usage.
This is the kind of pre-optimzations that you should not do at
home without adult supervision.
* expression.cs (UnaryMutator): New class, used to handle ++ and
-- separatedly from the other unary operators. Cleans up the
code, and kills the ExpressionStatement dependency in Unary.
(Unary): Removed `method' and `Arguments' from this class, making
it smaller, and moving it all to SimpleCall, so I can reuse this
code in other locations and avoid creating a lot of transient data
strucutres when not required.
* cs-parser.jay: Adjust for new changes.
2001-11-11 Miguel de Icaza <miguel@ximian.com>
* enum.cs (Enum.Populate): If there is a failure during
definition, return
* cs-parser.jay (opt_enum_base): we used to catch type errors
here, but this is really incorrect. The type error should be
catched during semantic analysis.
2001-12-11 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
current_local_parameters as expected since I, in my stupidity, had forgotten
to do this :-)
* attribute.cs (GetValidPlaces): Fix stupid bug.
* class.cs (Method::Emit): Perform check on applicability of attributes.
(Constructor::Emit): Ditto.
(Field::Emit): Ditto.
(Field.Location): Store location information.
(Property, Event, Indexer, Operator): Ditto.
* cs-parser.jay (field_declaration): Pass in location for each field.
* ../errors/cs0592.cs : Add.
2001-11-12 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
(InitCoreTypes): Update accordingly.
(RegisterAttrType, LookupAttr): Implement.
* attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
info about the same.
(Resolve): Update to populate the above as necessary.
(Error592): Helper.
(GetValidPlaces): Helper to the above.
(CheckAttribute): Implement to perform validity of attributes on declarative elements.
* class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
2001-11-12 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
* ../errors/cs0617.cs : Add.
2001-11-11 Ravi Pratap <ravi@ximian.com>
* enum.cs (Emit): Rename to Populate to be more consistent with what
we expect it to do and when exactly it is called.
* class.cs, rootcontext.cs : Update accordingly.
* typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
* enum.cs (Populate): Register fields with TypeManager.RegisterField.
* expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
of a fieldinfo using the above, when dealing with a FieldBuilder.
2001-11-10 Ravi Pratap <ravi@ximian.com>
* ../errors/cs0031.cs : Add.
* ../errors/cs1008.cs : Add.
* ../errrors/cs0543.cs : Add.
* enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
enum type.
(FindMembers): Implement.
* typemanager.cs (FindMembers): Re-write to call the appropriate methods for
enums and delegates too.
(enum_types): Rename to builder_to_enum.
(delegate_types): Rename to builder_to_delegate.
* delegate.cs (FindMembers): Implement.
2001-11-09 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IsEnumType): Implement.
* enum.cs (Emit): Re-write parts to account for the underlying type
better and perform checking etc.
(GetNextDefaultValue): Helper to ensure we don't overshoot max value
of the underlying type.
* literal.cs (GetValue methods everywhere): Perform bounds checking and return
value
* enum.cs (error31): Helper to report error #31.
* cs-parser.jay (enum_declaration): Store location of each member too.
* enum.cs (member_to_location): New hashtable.
(AddEnumMember): Update location hashtable.
(Emit): Use the location of each member while reporting errors.
2001-11-09 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: A for_initializer if is a
local_variable_declaration really ammount to have an implicit
block with the variable declaration and no initializer for for.
* statement.cs (For.Emit): Cope with null initializers.
This fixes the infinite loop on for initializers.
2001-11-08 Miguel de Icaza <miguel@ximian.com>
* enum.cs: More cleanup.
* ecore.cs: Remove dead code.
* class.cs (Property.Emit): More simplification.
(Event.Emit): ditto.
Reworked to have less levels of indentation.
2001-11-08 Ravi Pratap <ravi@ximian.com>
* class.cs (Property): Emit attributes.
(Field): Ditto.
(Event): Ditto.
(Indexer): Ditto.
(Operator): Ditto.
* enum.cs (Emit): Ditto.
* rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
Enums too.
* class.cs (Field, Event, etc.): Move attribute generation into the
Emit method everywhere.
* enum.cs (Enum): Revamp to use the same definition semantics as delegates so
we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
as we had no way of defining nested enums !
* rootcontext.cs : Adjust code accordingly.
* typemanager.cs (AddEnumType): To keep track of enum types separately.
2001-11-07 Ravi Pratap <ravi@ximian.com>
* expression.cs (EvalConstantExpression): Move into ecore.cs
* enum.cs (Enum): Rename some members and make them public and readonly
according to our convention.
* modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
nothing else.
* enum.cs (Enum::Define): Use the above instead of TypeAttr.
(Enum::Emit): Write a simple version for now which doesn't try to compute
expressions. I shall modify this to be more robust in just a while.
* class.cs (TypeContainer::Emit): Make sure we include Enums too.
(TypeContainer::CloseType): Create the Enum types too.
* attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
* expression.cs (EvalConstantExpression): Get rid of completely.
* enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
user-defined values and other cases.
(IsValidEnumLiteral): Helper function.
* expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
out there in the case we had a literal FieldExpr.
(MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
(Literalize): Revamp a bit to take two arguments.
(EnumLiteral): New class which derives from Literal to wrap enum literals.
2001-11-06 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
* expression.cs (ArrayCreation::ValidateInitializers): Implement.
(Resolve): Use the above to ensure we have proper initializers.
2001-11-05 Ravi Pratap <ravi@ximian.com>
* expression.cs (Expression::EvalConstantExpression): New method to
evaluate constant expressions.
* attribute.cs (Attribute::Resolve): Modify bits to use the above function.
2001-11-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ArrayCreation.Emit): Some bits to initialize data
in an array.
(Binary.ResolveOperator): Handle operator != (object a, object b)
and operator == (object a, object b);
(Binary.DoNumericPromotions): Indicate whether the numeric
promotion was possible.
(ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
Implement.
Made the ArrayAccess implement interface IAssignMethod instead of
IStackStore as the order in which arguments are passed reflects
this.
* assign.cs: Instead of using expr.ExprClass to select the way of
assinging, probe for the IStackStore/IAssignMethod interfaces.
* typemanager.cs: Load InitializeArray definition.
* rootcontext.cs (RootContext.MakeStaticData): Used to define
static data that can be used to initialize arrays.
2001-11-05 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Handle operator== and operator!= for booleans.
(Conditioal.Reduce): Implement reducer for the ?: operator.
(Conditional.Resolve): Implement dead code elimination.
(Binary.Resolve): Catch string literals and return a new
concatenated string.
(Unary.Reduce): Implement reduction of unary expressions.
* ecore.cs: Split out the expression core handling here.
(Expression.Reduce): New method used to perform constant folding
and CSE. This is needed to support constant-expressions.
* statement.cs (Statement.EmitBoolExpression): Pass true and false
targets, and optimize for !x.
2001-11-04 Ravi Pratap <ravi@ximian.com>
* attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
of an attribute gives us a CustomAttributeBuilder which we use accordingly to
set custom atttributes.
* literal.cs (Literal::GetValue): New abstract method to return the actual
value of the literal, cast as an object.
(*Literal): Implement GetValue method.
* cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
expressions to the arraylist but objects of type Argument.
* class.cs (TypeContainer::Emit): Emit our attributes too.
(Method::Emit, Constructor::Emit): Ditto.
* cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
to be ignoring earlier.
2001-11-03 Ravi Pratap <ravi@ximian.com>
* attribute.cs (AttributeSection::Define): Implement to do the business
of constructing a CustomAttributeBuilder.
(Attribute): New trivial class. Increases readability of code.
* cs-parser.jay : Update accordingly.
(positional_argument_list, named_argument_list, named_argument): New rules
(attribute_arguments): Use the above so that we are more correct.
2001-11-02 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::IsParamsMethodApplicable): Implement
to perform all checks for a method with a params parameter.
(Invocation::OverloadResolve): Update to use the above method and therefore
cope correctly with params method invocations.
* support.cs (InternalParameters::ParameterDesc): Provide a desc for
params too.
* class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
constructors in our parent too because we can't afford to miss out on
protected ones ;-)
* attribute.cs (AttributeSection): New name for the class Attribute
Other trivial changes to improve readability.
* cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
use the new class names.
2001-11-01 Ravi Pratap <ravi@ximian.com>
* class.cs (Method::Define): Complete definition for params types too
(Indexer::Define): Ditto.
* support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
Cope everywhere with a request for info about the array parameter.
2001-11-01 Ravi Pratap <ravi@ximian.com>
* tree.cs (RecordNamespace): Fix up to check for the correct key.
* cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
local_variable_type to extract the string corresponding to the type.
(local_variable_type): Fixup the action to use the new helper method.
* codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
go.
* expression.cs : Clean out code which uses the above.
2001-10-31 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (RegisterMethod): Check if we already have an existing key
and bale out if necessary by returning a false.
(RegisterProperty): Ditto.
* class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
and print out appropriate error messages.
* interface.cs (everywhere): Ditto.
* cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
location to constructor.
* class.cs (Property, Event, Indexer): Update accordingly.
* ../errors/cs111.cs : Added.
* expression.cs (Invocation::IsApplicable): New static method to determine applicability
of a method, as laid down by the spec.
(Invocation::OverloadResolve): Use the above method.
2001-10-31 Ravi Pratap <ravi@ximian.com>
* support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
now take a TypeContainer and a Parameters object.
(ParameterData): Modify return type of ParameterModifier method to be
Parameter.Modifier and not a string.
(ReflectionParameters, InternalParameters): Update accordingly.
* expression.cs (Argument::GetParameterModifier): Same here.
* support.cs (InternalParameters::ParameterType): Find a better way of determining
if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
symbol in it at all so maybe this is only for now.
2001-10-30 Ravi Pratap <ravi@ximian.com>
* support.cs (InternalParameters): Constructor now takes an extra argument
which is the actual Parameters class.
(ParameterDesc): Update to provide info on ref/out modifiers.
* class.cs (everywhere): Update call to InternalParameters to pass in
the second argument too.
* support.cs (ParameterData): Add ParameterModifier, which is a method
to return the modifier info [ref/out etc]
(InternalParameters, ReflectionParameters): Implement the above.
* expression.cs (Argument::ParameterModifier): Similar function to return
info about the argument's modifiers.
(Invocation::OverloadResolve): Update to take into account matching modifiers
too.
* class.cs (Indexer::Define): Actually define a Parameter object and put it onto
a new SetFormalParameters object which we pass to InternalParameters.
2001-10-30 Ravi Pratap <ravi@ximian.com>
* expression.cs (NewArray): Merge into the ArrayCreation class.
2001-10-29 Ravi Pratap <ravi@ximian.com>
* expression.cs (NewArray): Merge classes NewBuiltinArray and
NewUserdefinedArray into one as there wasn't much of a use in having
two separate ones.
* expression.cs (Argument): Change field's name to ArgType from Type.
(Type): New readonly property which returns the proper type, taking into
account ref/out modifiers.
(everywhere): Adjust code accordingly for the above.
* codegen.cs (EmitContext.RefOrOutParameter): New field to determine
whether we are emitting for a ref or out parameter.
* expression.cs (Argument::Emit): Use the above field to set the state.
(LocalVariableReference::Emit): Update to honour the flag and emit the
right stuff.
* parameter.cs (Attributes): Set the correct flags for ref parameters.
* expression.cs (Argument::FullDesc): New function to provide a full desc.
* support.cs (ParameterData): Add method ParameterDesc to the interface.
(ReflectionParameters, InternalParameters): Implement the above method.
* expression.cs (Invocation::OverloadResolve): Use the new desc methods in
reporting errors.
(Invocation::FullMethodDesc): Ditto.
2001-10-29 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add extra production for the second form of array
creation.
* expression.cs (ArrayCreation): Update to reflect the above
change.
* Small changes to prepare for Array initialization.
2001-10-28 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (ImplementsInterface): interface might be null;
Deal with this problem;
Also, we do store negative hits on the cache (null values), so use
this instead of calling t.GetInterfaces on the type everytime.
2001-10-28 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IsBuiltinType): New method to help determine the same.
* expression.cs (New::DoResolve): Get rid of array creation code and instead
split functionality out into different classes.
(New::FormArrayType): Move into NewBuiltinArray.
(Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
quite useless.
(NewBuiltinArray): New class to handle creation of built-in arrays.
(NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
account creation of one-dimensional arrays.
(::Emit): Implement to use Newarr and Newobj opcodes accordingly.
(NewUserdefinedArray::DoResolve): Implement.
* cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
* typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
we maintain inside the TypeManager. This is necessary to perform lookups on the
module builder.
(LookupType): Update to perform GetType on the module builders too.
* driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
* exprssion.cs (NewUserdefinedArray::Emit): Implement.
2001-10-23 Ravi Pratap <ravi@ximian.com>
* expression.cs (New::DoResolve): Implement guts of array creation.
(New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
2001-10-27 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Fix bug I introduced lsat night that broke
Delegates.
(Expression.Resolve): Report a 246 error (can not resolve name)
if we find a SimpleName in the stream.
(Expression.ResolveLValue): Ditto.
(Expression.ResolveWithSimpleName): This function is a variant of
ResolveName, this one allows SimpleNames to be returned without a
warning. The only consumer of SimpleNames is MemberAccess
2001-10-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Invocation::DoResolve): Catch SimpleNames that
might arrive here. I have my doubts that this is correct.
* statement.cs (Lock): Implement lock statement.
* cs-parser.jay: Small fixes to support `lock' and `using'
* cs-tokenizer.cs: Remove extra space
* driver.cs: New flag --checked, allows to turn on integer math
checking.
* typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
Threading.Monitor.Exit
2001-10-23 Miguel de Icaza <miguel@ximian.com>
* expression.cs (IndexerAccess::DoResolveLValue): Set the
Expression Class to be IndexerAccess.
Notice that Indexer::DoResolve sets the eclass to Value.
2001-10-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer::Emit): Emit code for indexers.
* assign.cs (IAssignMethod): New interface implemented by Indexers
and Properties for handling assignment.
(Assign::Emit): Simplify and reuse code.
* expression.cs (IndexerAccess, PropertyExpr): Implement
IAssignMethod, clean up old code.
2001-10-22 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (ImplementsInterface): New method to determine if a type
implements a given interface. Provides a nice cache too.
* expression.cs (ImplicitReferenceConversion): Update checks to use the above
method.
(ConvertReferenceExplicit): Ditto.
* delegate.cs (Delegate::Populate): Update to define the parameters on the
various methods, with correct names etc.
* class.cs (Operator::OpType): New members Operator.UnaryPlus and
Operator.UnaryNegation.
* cs-parser.jay (operator_declarator): Be a little clever in the case where
we have a unary plus or minus operator.
* expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
UnaryMinus.
* everywhere : update accordingly.
* everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
respectively.
* class.cs (Method::Define): For the case where we are implementing a method
inherited from an interface, we need to set the MethodAttributes.Final flag too.
Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
2001-10-21 Ravi Pratap <ravi@ximian.com>
* interface.cs (FindMembers): Implement to work around S.R.E
lameness.
* typemanager.cs (IsInterfaceType): Implement.
(FindMembers): Update to handle interface types too.
* expression.cs (ImplicitReferenceConversion): Re-write bits which
use IsAssignableFrom as that is not correct - it doesn't work.
* delegate.cs (DelegateInvocation): Derive from ExpressionStatement
and accordingly override EmitStatement.
* expression.cs (ConvertReferenceExplicit): Re-write similary, this time
using the correct logic :-)
2001-10-19 Ravi Pratap <ravi@ximian.com>
* ../errors/cs-11.cs : Add to demonstrate error -11
2001-10-17 Miguel de Icaza <miguel@ximian.com>
* assign.cs (Assign::Resolve): Resolve right hand side first, and
then pass this as a hint to ResolveLValue.
* expression.cs (FieldExpr): Add Location information
(FieldExpr::LValueResolve): Report assignment to readonly
variable.
(Expression::ExprClassFromMemberInfo): Pass location information.
(Expression::ResolveLValue): Add new method that resolves an
LValue.
(Expression::DoResolveLValue): Default invocation calls
DoResolve.
(Indexers): New class used to keep track of indexers in a given
Type.
(IStackStore): Renamed from LValue, as it did not really describe
what this did. Also ResolveLValue is gone from this interface and
now is part of Expression.
(ElementAccess): Depending on the element access type
* typemanager.cs: Add `indexer_name_type' as a Core type
(System.Runtime.CompilerServices.IndexerNameAttribute)
* statement.cs (Goto): Take a location.
2001-10-18 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Delegate::VerifyDelegate): New method to verify
if two delegates are compatible.
(NewDelegate::DoResolve): Update to take care of the case when
we instantiate a delegate from another delegate.
* typemanager.cs (FindMembers): Don't even try to look up members
of Delegate types for now.
2001-10-18 Ravi Pratap <ravi@ximian.com>
* delegate.cs (NewDelegate): New class to take care of delegate
instantiation.
* expression.cs (New): Split the delegate related code out into
the NewDelegate class.
* delegate.cs (DelegateInvocation): New class to handle delegate
invocation.
* expression.cs (Invocation): Split out delegate related code into
the DelegateInvocation class.
2001-10-17 Ravi Pratap <ravi@ximian.com>
* expression.cs (New::DoResolve): Implement delegate creation fully
and according to the spec.
(New::DoEmit): Update to handle delegates differently.
(Invocation::FullMethodDesc): Fix major stupid bug thanks to me
because of which we were printing out arguments in reverse order !
* delegate.cs (VerifyMethod): Implement to check if the given method
matches the delegate.
(FullDelegateDesc): Implement.
(VerifyApplicability): Implement.
* expression.cs (Invocation::DoResolve): Update to accordingly handle
delegate invocations too.
(Invocation::Emit): Ditto.
* ../errors/cs1593.cs : Added.
* ../errors/cs1594.cs : Added.
* delegate.cs (InstanceExpression, TargetMethod): New properties.
2001-10-16 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (intptr_type): Core type for System.IntPtr
(InitCoreTypes): Update for the same.
(iasyncresult_type, asynccallback_type): Ditto.
* delegate.cs (Populate): Fix to use System.Intptr as it is indeed
correct.
* typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
too.
* delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
the builders for the 4 members of a delegate type :-)
(Populate): Define the BeginInvoke and EndInvoke methods on the delegate
type.
* expression.cs (New::DoResolve): Implement guts for delegate creation.
* ../errors/errors.txt : Update for an error (-11) which only we catch :-)
2001-10-15 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Break::Emit): Implement.
(Continue::Emit): Implement.
(For::Emit): Track old being/end loops; Set Begin loop, ack end loop
(While::Emit): Track old being/end loops; Set Begin loop, ack end loop
(Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
(Foreach::Emit): Track old being/end loops; Set Begin loop, ack
end loop
* codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
properties that track the label for the current loop (begin of the
loop and end of the loop).
2001-10-15 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
use of emitting anything at all.
* class.cs, rootcontext.cs : Get rid of calls to the same.
* delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
(Populate): Define the constructor correctly and set the implementation
attributes.
* typemanager.cs (delegate_types): New hashtable to hold delegates that
have been defined.
(AddDelegateType): Implement.
(IsDelegateType): Implement helper method.
* delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
* expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
and accordingly handle it.
* delegate.cs (Populate): Take TypeContainer argument.
Implement bits to define the Invoke method. However, I still haven't figured out
how to take care of the native int bit :-(
* cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
Qualify the name of the delegate, not its return type !
* expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
conversion.
(StandardConversionExists): Checking for array types turns out to be recursive.
(ConvertReferenceExplicit): Implement array conversion.
(ExplicitReferenceConversionExists): New method to determine precisely that :-)
2001-10-12 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (delegate_declaration): Store the fully qualified
name as it is a type declaration.
* delegate.cs (ReturnType, Name): Rename members to these. Make them
readonly.
(DefineDelegate): Renamed from Define. Does the same thing essentially,
as TypeContainer::DefineType.
(Populate): Method in which all the definition of the various methods (Invoke)
etc is done.
(Emit): Emit any code, if necessary. I am not sure about this really, but let's
see.
(CloseDelegate): Finally creates the delegate.
* class.cs (TypeContainer::DefineType): Update to define delegates.
(Populate, Emit and CloseType): Do the same thing here too.
* rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
delegates in all these operations.
2001-10-14 Miguel de Icaza <miguel@ximian.com>
* expression.cs: LocalTemporary: a new expression used to
reference a temporary that has been created.
* assign.cs: Handle PropertyAccess back here, so that we can
provide the proper semantic access to properties.
* expression.cs (Expression::ConvertReferenceExplicit): Implement
a few more explicit conversions.
* modifiers.cs: `NEW' modifier maps to HideBySig.
* expression.cs (PropertyExpr): Make this into an
ExpressionStatement, and support the EmitStatement code path.
Perform get/set error checking, clean up the interface.
* assign.cs: recognize PropertyExprs as targets, and if so, turn
them into toplevel access objects.
2001-10-12 Miguel de Icaza <miguel@ximian.com>
* expression.cs: PropertyExpr::PropertyExpr: use work around the
SRE.
* typemanager.cs: Keep track here of our PropertyBuilders again to
work around lameness in SRE.
2001-10-11 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LValue::LValueResolve): New method in the
interface, used to perform a second resolution pass for LValues.
(This::DoResolve): Catch the use of this in static methods.
(This::LValueResolve): Implement.
(This::Store): Remove warning, assigning to `this' in structures
is
(Invocation::Emit): Deal with invocation of
methods on value types. We need to pass the address to structure
methods rather than the object itself. (The equivalent code to
emit "this" for structures leaves the entire structure on the
stack instead of a pointer to it).
(ParameterReference::DoResolve): Compute the real index for the
argument based on whether the method takes or not a `this' pointer
(ie, the method is static).
* codegen.cs (EmitContext::GetTemporaryStorage): Used to store
value types returned from functions when we need to invoke a
method on the sturcture.
2001-10-11 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::DefineType): Method to actually do the business of
defining the type in the Modulebuilder or Typebuilder. This is to take
care of nested types which need to be defined on the TypeBuilder using
DefineNestedMethod.
(TypeContainer::GetClassBases): Implement. Essentially the code from the
methods in RootContext, only ported to be part of TypeContainer.
(TypeContainer::GetInterfaceOrClass): Ditto.
(TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
* interface.cs (Interface::DefineInterface): New method. Does exactly
what RootContext.CreateInterface did earlier, only it takes care of nested types
too.
(Interface::GetInterfaces): Move from RootContext here and port.
(Interface::GetInterfaceByName): Same here.
* rootcontext.cs (ResolveTree): Re-write.
(PopulateTypes): Re-write.
* class.cs (TypeContainer::Populate): Populate nested types too.
(TypeContainer::Emit): Emit nested members too.
* typemanager.cs (AddUserType): Do not make use of the FullName property,
instead just use the name argument passed in as it is already fully
qualified.
(FindMembers): Check in the Builders to TypeContainer mapping instead of the name
to TypeContainer mapping to see if a type is user-defined.
* class.cs (TypeContainer::CloseType): Implement.
(TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
the default constructor.
(TypeContainer::Populate): Fix minor bug which led to creating default constructors
twice.
(Constructor::IsDefault): Fix up logic to determine if it is the default constructor
* interface.cs (CloseType): Create the type here.
* rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
the hierarchy.
Remove all the methods which are now in TypeContainer.
2001-10-10 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Define): Re-write bits to define the delegate
correctly.
2001-10-10 Miguel de Icaza <miguel@ximian.com>
* makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
* expression.cs (ImplicitReferenceConversion): handle null as well
as a source to convert to any reference type.
* statement.cs (Return): Perform any implicit conversions to
expected return type.
Validate use of return statement.
* codegen.cs (EmitContext): Pass the expected return type here.
* class.cs (Method, Constructor, Property): Pass expected return
type to EmitContext.
2001-10-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Make DoResolve take an EmitContext instead of a
TypeContainer.
Replaced `l' and `location' for `loc', for consistency.
(Error, Warning): Remove unneeded Tc argument.
* assign.cs, literal.cs, constant.cs: Update to new calling
convention.
* codegen.cs: EmitContext now contains a flag indicating whether
code is being generated in a static method or not.
* cs-parser.jay: DecomposeQI, new function that replaces the old
QualifiedIdentifier. Now we always decompose the assembled
strings from qualified_identifier productions into a group of
memberaccesses.
2001-10-08 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Deal with field-less struct types correctly now
by passing the size option to Define Type.
* class.cs: Removed hack that created one static field.
2001-10-07 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Moved most of the code generation here.
2001-10-09 Ravi Pratap <ravi@ximian.com>
* expression.cs (New::DoResolve): Revert changes for array creation, doesn't
seem very right.
(ElementAccess): Remove useless bits for now - keep checks as the spec
says.
2001-10-08 Ravi Pratap <ravi@ximian.com>
* expression.cs (ElementAccess::DoResolve): Remove my crap code
and start performing checks according to the spec.
2001-10-07 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (type_suffix*): Remove - they are redundant. Use
rank_specifiers instead.
(rank_specifiers): Change the order in which the rank specifiers are stored
(local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
* expression.cs (ElementAccess): Implement the LValue interface too.
2001-10-06 Ravi Pratap <ravi@ximian.com>
* expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
except that user defined conversions are not included.
(UserDefinedConversion): Update to use the ConvertExplicitStandard to
perform the conversion of the return type, if necessary.
(New::DoResolve): Check whether we are creating an array or an object
and accordingly do the needful.
(New::Emit): Same here.
(New::DoResolve): Implement guts of array creation.
(New::FormLookupType): Helper function.
2001-10-07 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Removed most of the code generation here, and move the
corresponding code generation bits to the statement classes.
Added support for try/catch/finalize and throw.
* cs-parser.jay: Added support for try/catch/finalize.
* class.cs: Catch static methods having the flags override,
virtual or abstract.
* expression.cs (UserCast): This user cast was not really doing
what it was supposed to do. Which is to be born in fully resolved
state. Parts of the resolution were being performed at Emit time!
Fixed this code.
2001-10-05 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Implicity convert the result from UserCast.
2001-10-05 Ravi Pratap <ravi@ximian.com>
* expression.cs (Expression::FindMostEncompassingType): Fix bug which
prevented it from working correctly.
(ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
merely ConvertImplicit.
2001-10-05 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Make the LookupTypeContainer function static,
and not per-instance.
* class.cs: Make static FindMembers (the one that takes a Type
argument).
* codegen.cs: Add EmitForeach here.
* cs-parser.jay: Make foreach a toplevel object instead of the
inline expansion, as we need to perform semantic analysis on it.
2001-10-05 Ravi Pratap <ravi@ximian.com>
* expression.cs (Expression::ImplicitUserConversion): Rename to
UserDefinedConversion.
(Expression::UserDefinedConversion): Take an extra argument specifying
whether we look for explicit user conversions too.
(Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
(UserDefinedConversion): Incorporate support for user defined explicit conversions.
(ExplicitUserConversion): Make it a call to UserDefinedConversion
with the appropriate arguments.
* cs-parser.jay (cast_expression): Record location too.
* expression.cs (Cast): Record location info.
(Expression::ConvertExplicit): Take location argument.
(UserImplicitCast): Change name to UserCast. Take an extra constructor argument
to determine if we are doing explicit conversions.
(UserCast::Emit): Update accordingly.
(Expression::ConvertExplicit): Report an error if everything fails.
* ../errors/cs0030.cs : Add.
2001-10-04 Miguel de Icaza <miguel@ximian.com>
* modifiers.cs: If the ABSTRACT keyword is present, also set the
virtual and newslot bits.
* class.cs (TypeContainer::RegisterRequiredImplementations):
Record methods we need.
(TypeContainer::MakeKey): Helper function to make keys for
MethodBases, since the Methodbase key is useless.
(TypeContainer::Populate): Call RegisterRequiredImplementations
before defining the methods.
Create a mapping for method_builders_to_methods ahead of time
instead of inside a tight loop.
(::RequireMethods): Accept an object as the data to set into the
hashtable so we can report interface vs abstract method mismatch.
2001-10-03 Miguel de Icaza <miguel@ximian.com>
* report.cs: Make all of it static.
* rootcontext.cs: Drop object_type and value_type computations, as
we have those in the TypeManager anyways.
Drop report instance variable too, now it is a global.
* driver.cs: Use try/catch on command line handling.
Add --probe option to debug the error reporting system with a test
suite.
* report.cs: Add support for exiting program when a probe
condition is reached.
2001-10-03 Ravi Pratap <ravi@ximian.com>
* expression.cs (Binary::DoNumericPromotions): Fix the case when
we do a forcible conversion regardless of type, to check if
ForceConversion returns a null.
(Binary::error19): Use location to report error.
(Unary::error23): Use location here too.
* ../errors/cs0019.cs : Check in.
* ../errors/cs0023.cs : Check in.
* expression.cs (Expression.MemberLookup): Return null for a rather esoteric
case of a non-null MethodInfo object with a length of 0 !
(Binary::ResolveOperator): Flag error if overload resolution fails to find
an applicable member - according to the spec :-)
Also fix logic to find members in base types.
(Unary::ResolveOperator): Same here.
(Unary::report23): Change name to error23 and make first argument a TypeContainer
as I was getting thoroughly confused between this and error19 :-)
* expression.cs (Expression::ImplicitUserConversion): Re-write fully
(::FindMostEncompassedType): Implement.
(::FindMostEncompassingType): Implement.
(::StandardConversionExists): Implement.
(UserImplicitCast): Re-vamp. We now need info about most specific
source and target types so that we can do the necessary conversions.
(Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
mathematical union with no duplicates.
2001-10-03 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext::PopulateTypes): Populate containers
in order from base classes to child classes, so that we can in
child classes look up in our parent for method names and
attributes (required for handling abstract, virtual, new, override
constructs: we need to instrospect our base class, and if we dont
populate the classes in order, the introspection might be
incorrect. For example, a method could query its parent before
the parent has any methods and would determine that the parent has
no abstract methods (while it could have had them)).
(RootContext::CreateType): Record the order in which we define the
classes.
2001-10-02 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer::Populate): Also method definitions can
fail now, keep track of this.
(TypeContainer::FindMembers): Implement support for
DeclaredOnly/noDeclaredOnly flag.
(Constructor::Emit) Return the ConstructorBuilder.
(Method::Emit) Return the MethodBuilder.
Check for abstract or virtual methods to be public.
* rootcontext.cs (RootContext::CreateType): Register all the
abstract methods required for the class to be complete and the
interface methods that must be implemented.
* cs-parser.jay: Report error 501 (method requires body if it is
not marked abstract or extern).
* expression.cs (TypeOf::Emit): Implement.
* typemanager.cs: runtime_handle_type, new global type.
* class.cs (Property::Emit): Generate code for properties.
2001-10-02 Ravi Pratap <ravi@ximian.com>
* expression.cs (Unary::ResolveOperator): Find operators on base type
too - we now conform exactly to the spec.
(Binary::ResolveOperator): Same here.
* class.cs (Operator::Define): Fix minor quirk in the tests.
* ../errors/cs0215.cs : Added.
* ../errors/cs0556.cs : Added.
* ../errors/cs0555.cs : Added.
2001-10-01 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs: Reimplemented Location to be a struct with a
single integer which is really efficient
2001-10-01 Ravi Pratap <ravi@ximian.com>
* expression.cs (Expression::ImplicitUserConversion): Use location
even in the case when we are examining True operators.
* class.cs (Operator::Define): Perform extensive checks to conform
with the rules for operator overloading in the spec.
* expression.cs (Expression::ImplicitReferenceConversion): Implement
some of the other conversions mentioned in the spec.
* typemanager.cs (array_type): New static member for the System.Array built-in
type.
(cloneable_interface): For System.ICloneable interface.
* driver.cs (Driver::Driver): Initialize TypeManager's core types even before
we start resolving the tree and populating types.
* ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
2001-10-01 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Expression::ExprClassFromMemberInfo,
Expression::Literalize): Create literal expressions from
FieldInfos which are literals.
(ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
type casts, because they were wrong. The test suite in tests
caught these ones.
(ImplicitNumericConversion): ushort to ulong requires a widening
cast.
Int32 constant to long requires widening cast as well.
* literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
for integers because the type on the stack is not i4.
2001-09-30 Miguel de Icaza <miguel@ximian.com>
* expression.cs (report118): require location argument.
* parameter.cs: Do not dereference potential null value.
* class.cs: Catch methods that lack the `new' keyword when
overriding a name. Report warnings when `new' is used without
anything being there to override.
* modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
* class.cs: Only add constructor to hashtable if it is non-null
(as now constructors can fail on define).
(TypeManager, Class, Struct): Take location arguments.
Catch field instance initialization in structs as errors.
accepting_filter: a new filter for FindMembers that is static so
that we dont create an instance per invocation.
(Constructor::Define): Catch errors where a struct constructor is
parameterless
* cs-parser.jay: Pass location information for various new
constructs.
* delegate.cs (Delegate): take a location argument.
* driver.cs: Do not call EmitCode if there were problesm in the
Definition of the types, as many Builders wont be there.
* decl.cs (Decl::Decl): Require a location argument.
* cs-tokenizer.cs: Handle properly hex constants that can not fit
into integers, and find the most appropiate integer for it.
* literal.cs: Implement ULongLiteral.
* rootcontext.cs: Provide better information about the location of
failure when CreateType fails.
2001-09-29 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext::PopulateTypes): Populates structs
as well.
* expression.cs (Binary::CheckShiftArguments): Add missing type
computation.
(Binary::ResolveOperator): Add type to the logical and and logical
or, Bitwise And/Or and Exclusive Or code paths, it was missing
before.
(Binary::DoNumericPromotions): In the case where either argument
is ulong (and most signed types combined with ulong cause an
error) perform implicit integer constant conversions as well.
2001-09-28 Miguel de Icaza <miguel@ximian.com>
* expression.cs (UserImplicitCast): Method should always be
non-null.
(Invocation::BetterConversion): Simplified test for IntLiteral.
(Expression::ImplicitNumericConversion): Split this routine out.
Put the code that performs implicit constant integer conversions
here.
(Expression::Resolve): Become a wrapper around DoResolve so we can
check eclass and type being set after resolve.
(Invocation::Badness): Remove this dead function
(Binary::ResolveOperator): Do not compute the expensive argumnets
unless we have a union for it.
(Probe::Emit): Is needs to do an isinst and then
compare against null.
(::CanConvert): Added Location argument. If the Location argument
is null (Location.Null), then we do not report errors. This is
used by the `probe' mechanism of the Explicit conversion. We do
not want to generate an error for something that the user
explicitly requested to be casted. But the pipeline for an
explicit cast first tests for potential implicit casts.
So for now, if the Location is null, it means `Probe only' to
avoid adding another argument. Might have to revise this
strategy later.
(ClassCast): New class used to type cast objects into arbitrary
classes (used in Explicit Reference Conversions).
Implement `as' as well.
Reverted all the patches from Ravi below: they were broken:
* The use of `level' as a mechanism to stop recursive
invocations is wrong. That was there just to catch the
bug with a strack trace but not as a way of addressing
the problem.
To fix the problem we have to *understand* what is going
on and the interactions and come up with a plan, not
just get things going.
* The use of the type conversion cache that I proposed
last night had an open topic: How does this work across
protection domains. A user defined conversion might not
be public in the location where we are applying the
conversion, a different conversion might be selected
(ie, private A->B (better) but public B->A (worse),
inside A, A->B applies, but outside it, B->A will
apply).
* On top of that (ie, even if the above is solved),
conversions in a cache need to be abstract. Ie, `To
convert from an Int to a Short use an OpcodeCast', not
`To convert from an Int to a Short use the OpcodeCast on
the variable 5' (which is what this patch was doing).
2001-09-28 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::ConversionExists): Re-write to use
the conversion cache
(Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
cache all conversions done, not just user-defined ones.
(Invocation::BetterConversion): The real culprit. Use ConversionExists
to determine if a conversion exists instead of acutually trying to
perform the conversion. It's faster too.
(Expression::ConvertExplicit): Modify to use ConversionExists to check
and only then attempt the implicit conversion.
2001-09-28 Ravi Pratap <ravi@ximian.com>
* expression.cs (ConvertImplicit): Use a cache for conversions
already found. Check level of recursion and bail out if necessary.
2001-09-28 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (string_concat_string_string, string_concat_object_object):
Export standard methods that we expect for string operations.
* statement.cs (Block::UsageWarning): Track usage of variables and
report the errors for not used variables.
* expression.cs (Conditional::Resolve, ::Emit): Implement ?:
operator.
2001-09-27 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: remove unnneded code
* expression.cs: Removed BuiltinTypeAccess class
Fix the order in which implicit conversions are
done.
The previous fixed dropped support for boxed conversions (adding a
test to the test suite now)
(UserImplicitCast::CanConvert): Remove test for source being null,
that code is broken. We should not feed a null to begin with, if
we do, then we should track the bug where the problem originates
and not try to cover it up here.
Return a resolved expression of type UserImplicitCast on success
rather than true/false. Ravi: this is what I was talking about,
the pattern is to use a static method as a "constructor" for
objects.
Also, do not create arguments until the very last minute,
otherwise we always create the arguments even for lookups that
will never be performed.
(UserImplicitCast::Resolve): Eliminate, objects of type
UserImplicitCast are born in a fully resolved state.
* typemanager.cs (InitCoreTypes): Init also value_type
(System.ValueType).
* expression.cs (Cast::Resolve): First resolve the child expression.
(LValue): Add new method AddressOf to be used by
the `&' operator.
Change the argument of Store to take an EmitContext instead of an
ILGenerator, because things like FieldExpr need to be able to call
their children expression to generate the instance code.
(Expression::Error, Expression::Warning): Sugar functions for
reporting errors.
(Expression::MemberLookup): Accept a TypeContainer instead of a
Report as the first argument.
(Expression::ResolvePrimary): Killed. I still want to improve
this as currently the code is just not right.
(Expression::ResolveMemberAccess): Simplify, but it is still
wrong.
(Unary::Resolve): Catch errors in AddressOf operators.
(LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
index to a byte for the short-version, or the compiler will choose
the wrong Emit call, which generates the wrong data.
(ParameterReference::Emit, ::Store): same.
(FieldExpr::AddressOf): Implement.
* typemanager.cs: TypeManager: made public variable instead of
property.
* driver.cs: document --fatal.
* report.cs (ErrorMessage, WarningMessage): new names for the old
Error and Warning classes.
* cs-parser.jay (member_access): Turn built-in access to types
into a normal simplename
2001-09-27 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::BetterConversion): Fix to cope
with q being null, since this was introducing a bug.
* expression.cs (ConvertImplicit): Do built-in conversions first.
2001-09-27 Ravi Pratap <ravi@ximian.com>
* expression.cs (UserImplicitCast::Resolve): Fix bug.
2001-09-27 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::AddConstructor): Fix a stupid bug
I had introduced long ago (what's new ?).
* expression.cs (UserImplicitCast::CanConvert): Static method to do
the work of all the checking.
(ConvertImplicit): Call CanConvert and only then create object if necessary.
(UserImplicitCast::CanConvert, ::Resolve): Re-write.
(Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
that is the right way.
(Invocation::MakeUnionSet): Convenience function to make unions of sets for
overloading resolution. Use everywhere instead of cutting and pasting code.
(Binary::ResolveOperator): Use MakeUnionSet.
(UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
we have to convert to bool types. Not complete yet.
2001-09-27 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (TypeManager::CSharpName): support ushort.
* expression.cs (Expression::TryImplicitIntConversion): Attempts
to provide an expression that performsn an implicit constant int
conversion (section 6.1.6).
(Expression::ConvertImplicitRequired): Reworked to include
implicit constant expression conversions.
(Expression::ConvertNumericExplicit): Finished.
(Invocation::Emit): If InstanceExpression is null, then it means
that we perform a call on this.
2001-09-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Unary::Emit): Remove some dead code.
(Probe): Implement Resolve and Emit for `is'.
(Expression::ConvertImplicitRequired): Attempt to do constant
expression conversions here. Maybe should be moved to
ConvertImplicit, but I am not sure.
(Expression::ImplicitLongConstantConversionPossible,
Expression::ImplicitIntConstantConversionPossible): New functions
that tell whether is it possible to apply an implicit constant
expression conversion.
(ConvertNumericExplicit): Started work on explicit numeric
conversions.
* cs-parser.jay: Update operator constants.
* parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
(Parameters::GetSignature): Hook up VerifyArgs here.
(Parameters::VerifyArgs): Verifies that no two arguments have the
same name.
* class.cs (Operator): Update the operator names to reflect the
ones that the spec expects (as we are just stringizing the
operator names).
* expression.cs (Unary::ResolveOperator): Fix bug: Use
MethodInfo's ReturnType instead of LookupMethodByBuilder as the
previous usage did only work for our methods.
(Expression::ConvertImplicit): Handle decimal implicit numeric
conversions as well.
(Expression::InternalTypeConstructor): Used to invoke constructors
on internal types for default promotions.
(Unary::Emit): Implement special handling for the pre/post
increment/decrement for overloaded operators, as they need to have
the same semantics as the other operators.
(Binary::ResolveOperator): ditto.
(Invocation::ConversionExists): ditto.
(UserImplicitCast::Resolve): ditto.
2001-09-26 Ravi Pratap <ravi@ximian.com>
* expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
operator, return after emitting body. Regression tests pass again !
* expression.cs (ConvertImplicit): Take TypeContainer as first argument
(Unary::ForceConversion, Binary::ForceConversion): Ditto.
(Invocation::OverloadResolve): Ditto.
(Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
* everywhere : update calls to the above methods accordingly.
2001-09-26 Miguel de Icaza <miguel@ximian.com>
* assign.cs (Assign): Make it inherit from ExpressionStatement.
* expression.cs (ExpressionStatement): New base class used for
expressions that can appear in statements, so that we can provide
an alternate path to generate expression that do not leave a value
on the stack.
(Expression::Emit, and all the derivatives): We no longer return
whether a value is left on the stack or not. Every expression
after being emitted leaves a single value on the stack.
* codegen.cs (EmitContext::EmitStatementExpression): Use the
facilties of ExpressionStatement if possible.
* cs-parser.jay: Update statement_expression.
2001-09-25 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Change the wording of message
2001-09-25 Ravi Pratap <ravi@ximian.com>
* expression.cs (Binary::ResolveOperator): Had forgottten to set
the type of the expression to the return type of the method if
we have an overloaded operator match ! The regression tests pass again !
(Unary::ResolveOperator): Ditto.
* expression.cs (Invocation::ConversionExists): Correct the member lookup
to find "op_Implicit", not "implicit" ;-)
(UserImplicitCast): New class to take care of user-defined implicit conversions.
(ConvertImplicit, ForceConversion): Take TypeContainer argument
* everywhere : Correct calls to the above accordingly.
* expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
(ConvertImplicit): Do user-defined conversion if it exists.
2001-09-24 Miguel de Icaza <miguel@ximian.com>
* assign.cs: track location.
(Resolve): Use implicit conversions on assignment.
* literal.cs: Oops. Not good, Emit of short access values should
pass (Bytes) or the wrong argument will be selected.
* expression.cs (Unary::Emit): Emit code for -expr.
(Unary::ResolveOperator): Handle `Substract' for non-constants
(substract from zero from the non-constants).
Deal with Doubles as well.
(Expression::ConvertImplicitRequired): New routine that reports an
error if no implicit conversion exists.
(Invocation::OverloadResolve): Store the converted implicit
expressions if we make them
2001-09-24 Ravi Pratap <ravi@ximian.com>
* class.cs (ConstructorInitializer): Take a Location argument.
(ConstructorBaseInitializer): Same here.
(ConstructorThisInitializer): Same here.
* cs-parser.jay : Update all calls accordingly.
* expression.cs (Unary, Binary, New): Take location argument.
Update accordingly everywhere.
* cs-parser.jay : Update all calls to the above to take a location
argument.
* class.cs : Ditto.
2001-09-24 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::BetterFunction): Take TypeContainer argument
(Invocation::BetterConversion): Same here
(Invocation::ConversionExists): Ditto.
(Invocation::ConversionExists): Implement.
2001-09-22 Ravi Pratap <ravi@ximian.com>
* expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
Also take an additional TypeContainer argument.
* All over : Pass in TypeContainer as argument to OverloadResolve.
* typemanager.cs (CSharpName): Update to check for the string type and return
that too.
* expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
a given method.
2001-09-21 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
(Invocation::BetterFunction): Implement.
(Invocation::BetterConversion): Implement.
(Invocation::ConversionExists): Skeleton, no implementation yet.
Okay, things work fine !
2001-09-21 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: declare and load enum_type, delegate_type and
void_type.
* expression.cs (Expression::Emit): Now emit returns a value that
tells whether a value is left on the stack or not. This strategy
might be reveted tomorrow with a mechanism that would address
multiple assignments.
(Expression::report118): Utility routine to report mismatches on
the ExprClass.
(Unary::Report23): Report impossible type/operator combination
utility function.
(Unary::IsIncrementableNumber): Whether the type can be
incremented or decremented with add.
(Unary::ResolveOperator): Also allow enumerations to be bitwise
complemented.
(Unary::ResolveOperator): Implement ++, !, ~,
(Invocation::Emit): Deal with new Emit convetion.
* All Expression derivatives: Updated their Emit method to return
whether they leave values on the stack or not.
* codegen.cs (CodeGen::EmitStatement): Pop values left on the
stack for expressions that are statements.
2001-09-20 Miguel de Icaza <miguel@ximian.com>
* expression.cs (LValue): New interface. Must be implemented by
LValue objects.
(LocalVariableReference, ParameterReference, FieldExpr): Implement
LValue interface.
* assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
interface for generating code, simplifies the code.
2001-09-20 Ravi Pratap <ravi@ximian.com>
* expression.cs (everywhere): Comment out return statements in ::Resolve
methods to avoid the warnings.
2001-09-20 Miguel de Icaza <miguel@ximian.com>
* driver.cs (parse): Report error 2001 if we can not open the
source file.
* expression.cs (SimpleName::ResolveSimpleName): Error if we can
not resolve it.
* cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
object.
* statement.cs (Block::EmitMeta): Reuse the count across all the variables,
otherwise nested blocks end up with the same index.
* codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
* expression.cs: Instead of having FIXMEs in the Resolve
functions, throw exceptions so it is obvious that we are facing a
bug.
* cs-parser.jay (invocation_expression): Pass Location information.
* codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
Use a basename for those routines because .NET does not like paths
on them.
* class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
already defined.
2001-09-19 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
are loading the correct data types (throws an exception if not).
(TypeManager::InitCoreTypes): Use CoreLookupType
* expression.cs (Unary::ResolveOperator): return the child
expression for expressions which are just +expr.
(Unary::ResolveOperator): Return negative literals for -LITERAL
expressions (otherwise they are Unary {Literal}).
(Invocation::Badness): Take into account `Implicit constant
expression conversions'.
* literal.cs (LongLiteral): Implement long literal class.
(IntLiteral): export the `Value' of the intliteral.
2001-09-19 Ravi Pratap <ravi@ximian.com>
* expression.cs (Binary::Emit): Finally get the emission right ! Woo!
* class.cs (Operator::Define): Change the methodname prefix to 'op_'
instead of 'Operator'
* expression.cs (Binary::ResolveOperator): Update accordingly.
(Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
and 'Minus'
* cs-parser.jay (unary_expression): Update to use the new names.
* gen-treedump.cs (GetUnary): Same here.
* expression.cs (Unary::Resolve): Implement.
(Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
operators are found instead of making noise ;-)
(Unary::ResolveOperator): New method to do precisely the same thing which
Binary::ResolveOperator does for Binary expressions.
(Unary.method, .Arguments): Add.
(Unary::OperName): Implement.
(Unary::ForceConversion): Copy and Paste !
* class.cs (Operator::Define): Fix a small bug for the case when we have
a unary operator.
* expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
for the inbuilt operators. Only overloading works for now ;-)
2001-09-18 Miguel de Icaza <miguel@ximian.com>
* expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
* expression.cs (This::Emit): Implement.
(This::Resolve): Implement.
(TypeOf:Resolve): Implement.
(Expression::ResolveSimpleName): Add an implicit this to instance
field references.
(MemberAccess::Resolve): Deal with Parameters and Fields.
Bind instance variable to Field expressions.
(FieldExpr::Instance): New field used to track the expression that
represents the object instance.
(FieldExpr::Resolve): Track potential errors from MemberLookup not
binding
(FieldExpr::Emit): Implement.
* codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
the last instruction contains a return opcode to avoid generating
the last `ret' instruction (this generates correct code, and it is
nice to pass the peverify output).
* class.cs (TypeContainer::EmitFieldInitializers): Implement field
initializer for static and instance variables.
(Constructor::Emit): Allow initializer to be null in the case of
static constructors. Only emit initializer for instance
constructors.
(TypeContainer::FindMembers): Return a null array if there are no
matches.
Also fix the code for the MemberTypes.Method branch, as it was not
scanning that for operators (or tried to access null variables before).
* assign.cs (Assign::Emit): Handle instance and static fields.
* TODO: Updated.
* driver.cs: Stop compilation if there are parse errors.
* cs-parser.jay (constructor_declaration): Provide default base
initializer for non-static constructors.
(constructor_declarator): Do not provide a default base
initializers if none was specified.
Catch the fact that constructors should not have parameters.
* class.cs: Do not emit parent class initializers for static
constructors, that should be flagged as an error.
2001-09-18 Ravi Pratap <ravi@ximian.com>
* class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
Move back code into TypeContainer::Populate.
2001-09-18 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::AddConstructor): Fix the check to
compare against Name, not Basename.
(Operator::OpType): Change Plus and Minus to Add and Subtract.
* cs-parser.jay : Update accordingly.
* class.cs (TypeContainer::FindMembers): For the case where we are searching
for methods, don't forget to look into the operators too.
(RegisterMethodBuilder): Helper method to take care of this for
methods, constructors and operators.
(Operator::Define): Completely revamp.
(Operator.OperatorMethod, MethodName): New fields.
(TypeContainer::Populate): Move the registering of builders into
RegisterMethodBuilder.
(Operator::Emit): Re-write.
* expression.cs (Binary::Emit): Comment out code path to emit method
invocation stuff for the case when we have a user defined operator. I am
just not able to get it right !
2001-09-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Expression::OverloadResolve): Drop TypeContainer
argument.
(Expression::MemberLookup): Provide a version that allows to
specify the MemberTypes and BindingFlags.
* statement.cs (Block::GetVariableInfo): Forgot to recurse here,
so it was not fetching variable information from outer blocks.
* modifiers.cs: (Modifiers::TypeAttr): Invert condition on
Beforefieldinit as it was buggy.
* rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
that Ravi put here.
* class.cs (Constructor::Emit): Only emit if block is not null.
(TypeContainer::EmitDefaultConstructor): Removed routine, now we
deal with this by semantically definining it as if the user had
done it.
(TypeContainer::FindMembers): Removed ad-hoc hack to deal with
constructors as we now "emit" them at a higher level.
(TypeContainer::DefineDefaultConstructor): Used to define the
default constructors if none was provided.
(ConstructorInitializer): Add methods Resolve and Emit.
* expression.cs: Cast to ConstructorInfo instead of MethodInfo
2001-09-17 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::EmitDefaultConstructor): Register
the default constructor builder with our hashtable for methodbuilders
to methodcores.
* expression.cs (Invocation::OverloadResolve): Add a check for pd == null
and argument_count is 0 in which case we have a match.
(Binary::ResolveOperator): More null checking and miscellaneous coding
style cleanup.
2001-09-17 Ravi Pratap <ravi@ximian.com>
* rootcontext.cs (IsNameSpace): Compare against null.
* everywhere : Correct spelling to 'Greater' and to 'Subtract'
* class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
and Unary::Operator.
* cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
accordingly.
* expression.cs (Binary::method): New member to hold the MethodBase for the case when
we have overloaded operators.
(Binary::ResolveOperator): Implement the part which does the operator overload
resolution.
* class.cs (Operator::Emit): Implement.
(TypeContainer::Emit): Emit the operators we have too.
* expression.cs (Binary::Emit): Update to emit the appropriate code for
the case when we have a user-defined operator.
2001-09-17 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Fix bug: tree.Namespaces might be null.
2001-09-16 Ravi Pratap <ravi@ximian.com>
* class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
(TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
(Constructor::Emit): Implement.
(EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
if we have no work to do.
(TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
Emit method.
* interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
(Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
* class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
of parent.parent.
2001-09-15 Ravi Pratap <ravi@ximian.com>
* tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
in the source.
(Tree::RecordNamespace): Method to do what the name says ;-)
(Tree::Namespaces): Property to get at the namespaces hashtable.
* cs-parser.jay (namespace_declaration): Call RecordNamespace to
keep track.
* rootcontext.cs (IsNamespace): Fixed it :-)
2001-09-14 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer::FindMembers): Add support for
constructors.
(MethodCore): New class that encapsulates both the shared aspects
of a Constructor and a Method.
(Method, Constructor): Factored pieces into MethodCore.
* driver.cs: Added --fatal which makes errors throw exceptions.
Load System assembly as well as part of the standard library.
* report.cs: Allow throwing exceptions on errors for debugging.
* modifiers.cs: Do not use `parent', instead use the real type
container to evaluate permission settings.
* class.cs: Put Ravi's patch back in. He is right, and we will
have to cope with the
2001-09-14 Ravi Pratap <ravi@ximian.com>
* modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
FamORAssem, not FamANDAssem.
2001-09-14 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Added --parse option that only parses its input files
and terminates.
* class.cs: Reverted last change from Ravi to IsTopLevel. That is
incorrect. IsTopLevel is not used to tell whether an object is
root_types or not (that can be achieved by testing this ==
root_types). But to see if this is a top-level *class* (not
necessarly our "toplevel" container).
2001-09-14 Ravi Pratap <ravi@ximian.com>
* enum.cs (Enum::Define): Modify to call the Lookup method on the
parent instead of a direct call to GetType.
2001-09-14 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::TypeAttr): Remove property code and move it into
Modifiers.TypeAttr. This should just be a call to that method.
* modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
object so that we can determine if we are top-level or not.
* delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
TypeContainer too.
* enum.cs (Enum::Define): Ditto.
* modifiers.cs (FieldAttr): Re-write.
* class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
(TypeContainer::HaveStaticConstructor): New property to provide access
to precisely that info.
* modifiers.cs (MethodAttr): Re-write.
(EventAttr): Remove altogether as there seems to be no ostensible use for it.
* class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
of top-level types as claimed.
2001-09-13 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberLookup): Fruitless attempt to lookup
constructors. Maybe I need to emit default constructors? That
might be it (currently .NET emits this for me automatically).
(Invocation::OverloadResolve): Cope with Arguments == null.
(Invocation::EmitArguments): new function, shared by the new
constructor and us.
(Invocation::Emit): Handle static and instance methods. Emit
proper call instruction for virtual or non-virtual invocations.
(New::Emit): Implement.
(New::Resolve): Implement.
(MemberAccess:Resolve): Implement.
(MethodGroupExpr::InstanceExpression): used conforming to the spec
to track instances.
(FieldExpr::Resolve): Set type.
* support.cs: Handle empty arguments.
* cs-parser.jay (CompositeLookup, QualifierIdentifier,
SimpleLookup): Auxiliary routines to help parse a qualifier
identifier.
Update qualifier_identifier rule.
* codegen.cs: Removed debugging messages.
* class.cs: Make this a global thing, this acts just as a "key" to
objects that we might have around.
(Populate): Only initialize method_builders_to_methods once.
* expression.cs (PropertyExpr): Initialize type from the
PropertyType.
* codegen.cs (EmitContext::EmitBoolExpression): Use propper
Resolve pattern. Attempt to implicitly convert value to boolean.
Emit code.
* expression.cs: Set the type for the int32/int32 argument case.
(Binary::ResolveOperator): Set the return type to boolean for
comparission operators
* typemanager.cs: Remove debugging print code.
(Invocation::Resolve): resolve type.
* class.cs: Allocate a MemberInfo of the correct size, as the code
elsewhere depends on the test to reflect the correct contents.
(Method::) Keep track of parameters, due to System.Reflection holes
(TypeContainer::Populate): Keep track of MethodBuilders to Method
mapping here.
(TypeContainer::FindMembers): Use ArrayList and then copy an array
of the exact size and return that.
(Class::LookupMethodByBuilder): New function that maps
MethodBuilders to its methods. Required to locate the information
on methods because System.Reflection bit us again.
* support.cs: New file, contains an interface ParameterData and
two implementations: ReflectionParameters and InternalParameters
used to access Parameter information. We will need to grow this
as required.
* expression.cs (Invocation::GetParameterData): implement a cache
and a wrapper around the ParameterData creation for methods.
(Invocation::OverloadResolve): Use new code.
2001-09-13 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::EmitField): Remove and move into
(Field::Define): here and modify accordingly.
(Field.FieldBuilder): New member.
(TypeContainer::Populate): Update accordingly.
(TypeContainer::FindMembers): Implement.
2001-09-13 Miguel de Icaza <miguel@ximian.com>
* statement.cs: (VariableInfo::VariableType): New field to be
initialized with the full type once it is resolved.
2001-09-12 Miguel de Icaza <miguel@ximian.com>
* parameter.cs (GetParameterInfo): Use a type cache to compute
things only once, and to reuse this information
* expression.cs (LocalVariableReference::Emit): Implement.
(OpcodeCast::Emit): fix.
(ParameterReference::Resolve): Implement.
(ParameterReference::Emit): Implement.
* cs-parser.jay: Fix bug introduced by Ravi, variable initializers
that are expressions need to stay as Expressions.
* typemanager.cs (CSharpName): Returns the C# name of a type if
possible.
* expression.cs (Expression::ConvertImplicit): New function that
implements implicit type conversions.
(Expression::ImplicitReferenceConversion): Implements implicit
reference conversions.
(EmptyCast): New type for transparent casts.
(OpcodeCast): New type for casts of types that are performed with
a sequence of bytecodes.
(BoxedCast): New type used for casting value types into reference
types. Emits a box opcode.
(Binary::DoNumericPromotions): Implements numeric promotions of
and computation of the Binary::Type.
(Binary::EmitBranchable): Optimization.
(Binary::Emit): Implement code emission for expressions.
* typemanager.cs (TypeManager): Added two new core types: sbyte
and byte.
2001-09-12 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::FindMembers): Method which does exactly
what Type.FindMembers does, only we don't have to use reflection. No
implementation yet.
* typemanager.cs (typecontainers): New hashtable to hold the corresponding
typecontainer objects as we need to get at them.
(TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
* rootcontext.cs : Correspondingly modify called to AddUserType to pass the
typecontainer object.
* expression.cs (MemberLookup): Modify signature to take a RootContext object instead
of just a Report object.
2001-09-11 Ravi Pratap <ravi@ximian.com>
* class.cs (Event::Define): Go back to using the prefixes "add_" and
"remove_"
(TypeContainer::Populate): Now define the delegates of the type too.
(TypeContainer.Delegates): Property to access the list of delegates defined
in the type.
* delegates.cs (Delegate::Define): Implement partially.
* modifiers.cs (TypeAttr): Handle more flags.
2001-09-11 Ravi Pratap <ravi@ximian.com>
* class.cs (Indexer::Define): Fix for loop iteration condition to be just <
and not <=
(Operator::Define): Re-write logic to get types by using the LookupType method
instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
(Indexer::Define): Ditto.
(Event::Define): Ditto.
(Property::Define): Ditto.
2001-09-10 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::Populate): Now define operators too.
(TypeContainer.Operators): New property to access the list of operators
in a type.
(Operator.OperatorMethodBuilder): New member to hold the method builder
for the operator we are defining.
(Operator::Define): Implement.
2001-09-10 Ravi Pratap <ravi@ximian.com>
* class.cs (Event::Define): Make the prefixes of the accessor methods
addOn_ and removeOn_
* genericparser.cs (GenericParser::error): Overloaded method to handle the case
of the location being passed in too. Ideally, this should go later since all
error reporting should be done through the Report object.
* class.cs (TypeContainer.Indexers): New property to access the list of indexers.
(Populate): Iterate thru the indexers we have and define them too.
(Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
for the get and set accessors.
(Indexer::Define): Implement.
2001-09-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary::Resolve): Beginning of it. I scratched
my previous implementation, did not work.
* typemanager.cs: Add a couple of missing types (the longs).
* literal.cs: Use TypeManager.bool_type instead of getting it.
* expression.cs (EventExpr): New kind of expressions.
(Expressio::ExprClassFromMemberInfo): finish
2001-09-08 Miguel de Icaza <miguel@ximian.com>
* assign.cs: Emit stores to static fields differently.
2001-09-08 Ravi Pratap <ravi@ximian.com>
* Merge in changes and adjust code to tackle conflicts. Backed out my
code in Assign::Resolve ;-)
2001-09-08 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (CheckAttributeTarget): Modify call to error to use
instead Report.Error and also pass in the location.
(CSharpParser::Lexer): New readonly property to return the reference
to the Tokenizer object.
(declare_local_variables): Use Report.Error with location instead of plain
old error.
(CheckDef): Ditto.
* class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
(Operator.CheckBinaryOperator): Ditto.
* cs-parser.jay (operator_declarator): Update accordingly.
* cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
(CheckBinaryOperator): Same here.
* rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
on the name without any prefixes of namespace names etc. This is because we
already might have something already fully qualified like
'System.Console.WriteLine'
* assign.cs (Resolve): Begin implementation. Stuck ;-)
2001-09-07 Ravi Pratap <ravi@ximian.com>
* cs-tokenizer.cs (location): Return a string which also contains
the file name.
* expression.cs (ElementAccess): New class for expressions of the
type 'element access.'
(BaseAccess): New class for expressions of the type 'base access.'
(CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
respectively.
* cs-parser.jay (element_access): Implement action.
(base_access): Implement actions.
(checked_expression, unchecked_expression): Implement.
* cs-parser.jay (local_variable_type): Correct and implement.
(type_suffixes, type_suffix_list, type_suffix): Implement actions.
* cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
* cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
name and the specifiers.
* interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
* rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
making them all public ;-)
* cs-parser.jay (error): Remove entirely as we have an implementation in the base
class anyways.
2001-09-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
PropertyExprs.
(FieldExpr, PropertyExprs): New resolved expressions.
(SimpleName::MemberStaticCheck): Perform static checks for access
to non-static fields on static methods. Maybe this should be
generalized for MemberAccesses.
(SimpleName::ResolveSimpleName): More work on simple name
resolution.
* cs-parser.jay (primary_expression/qualified_identifier): track
the parameter index.
* codegen.cs (CodeGen::Save): Catch save exception, report error.
(EmitContext::EmitBoolExpression): Chain to expression generation
instead of temporary hack.
(::EmitStatementExpression): Put generic expression code generation.
* assign.cs (Assign::Emit): Implement variable assignments to
local variables, parameters and fields.
2001-09-06 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Block::GetVariableInfo): New method, returns the
VariableInfo for a variable name in a block.
(Block::GetVariableType): Implement in terms of GetVariableInfo
* literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
2001-09-06 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (operator_declaration): Continue on my quest : update
to take attributes argument.
(event_declaration): Ditto.
(enum_declaration): Ditto.
(indexer_declaration): Ditto.
* class.cs (Operator::Operator): Update constructor accordingly.
(Event::Event): Ditto.
* delegate.cs (Delegate::Delegate): Same here.
* enum.cs (Enum::Enum): Same here.
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
* ../tests/cs0658.cs : New file to demonstrate error 0658.
* attribute.cs (Attributes): New class to encapsulate all attributes which were
being passed around as an arraylist.
(Attributes::AddAttribute): Method to add attribute sections.
* cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
(struct_declaration): Update accordingly.
(constant_declaration): Update.
(field_declaration): Update.
(method_header): Update.
(fixed_parameter): Update.
(parameter_array): Ditto.
(property_declaration): Ditto.
(destructor_declaration): Ditto.
* class.cs (Struct::Struct): Update constructors accordingly.
(Class::Class): Ditto.
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
(TypeContainer::OptAttribute): update property's return type.
* interface.cs (Interface.opt_attributes): New member.
(Interface::Interface): Update to take the extra Attributes argument.
* parameter.cs (Parameter::Parameter): Ditto.
* constant.cs (Constant::Constant): Ditto.
* interface.cs (InterfaceMemberBase): New OptAttributes field.
(InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
the attributes as a parameter.
(InterfaceProperty): Update constructor call.
(InterfaceEvent): Ditto.
(InterfaceMethod): Ditto.
(InterfaceIndexer): Ditto.
* cs-parser.jay (interface_indexer_declaration): Update call to constructor to
pass the attributes too.
(interface_event_declaration): Ditto.
(interface_property_declaration): Ditto.
(interface_method_declaration): Ditto.
(interface_declaration): Ditto.
2001-09-05 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method::Define): Track the "static Main" definition to
create an entry point.
* rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
EntryPoint if we find it.
* codegen.cs (EmitContext::EmitInvocation): Emit invocations.
(EmitContext::ig): Make this variable public.
* driver.cs: Make the default output file be the first file name
with the .exe extension.
Detect empty compilations
Handle various kinds of output targets. Handle --target and
rename -t to --dumper.
* expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
methods inherited from Expression return now an Expression. This
will is used during the tree rewriting as we resolve them during
semantic analysis.
(Expression::MemberLookup): Implements the MemberLookup (7.3) from
the spec. Missing entirely is the information about
accessability of elements of it.
(Expression::ExprClassFromMemberInfo): New constructor for
Expressions that creates a fully initialized Expression based on
a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
a Type.
(Invocation::Resolve): Begin implementing resolution of invocations.
* literal.cs (StringLiteral): Implement Emit.
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (error): Add new modifier because we are hiding an inherited
member.
2001-09-04 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (attribute_arguments): Implement actions.
(attribute): Fix bug in production. Implement action.
(attribute_list): Implement.
(attribute_target): Implement.
(attribute_target_specifier, opt_target_specifier): Implement
(CheckAttributeTarget): New method to check if the attribute target
is valid.
(attribute_section): Implement.
(opt_attributes): Implement.
* attribute.cs : New file to handle attributes.
(Attribute): Class to hold attribute info.
* cs-parser.jay (opt_attribute_target_specifier): Remove production
(attribute_section): Modify production to use 2 different rules to
achieve the same thing. 1 s/r conflict down !
Clean out commented, useless, non-reducing dimension_separator rules.
* class.cs (TypeContainer.attributes): New member to hold list
of attributes for a type.
(Struct::Struct): Modify to take one more argument, the attribute list.
(Class::Class): Ditto.
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
* cs-parser.jay (struct_declaration): Update constructor call to
pass in the attributes too.
(class_declaration): Ditto.
(constant_declaration): Ditto.
(field_declaration): Ditto.
(method_header): Ditto.
(fixed_parameter): Ditto.
(parameter_array): Ditto.
(property_declaration): Ditto.
* constant.cs (Constant::Constant): Update constructor similarly.
Use System.Collections.
* parameter.cs (Parameter::Parameter): Update as above.
2001-09-02 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::AddDelegate): New method to add a delegate.
(TypeContainer.delegates): New member to hold list of delegates.
* cs-parser.jay (delegate_declaration): Implement the action correctly
this time as I seem to be on crack ;-)
2001-09-02 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext::IsNamespace): new function, used to
tell whether an identifier represents a namespace.
* expression.cs (NamespaceExpr): A namespace expression, used only
temporarly during expression resolution.
(Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
utility functions to resolve names on expressions.
2001-09-01 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Add hook for StatementExpressions.
* class.cs: Fix inverted test for static flag in methods.
2001-09-02 Ravi Pratap <ravi@ximian.com>
* class.cs (Operator::CheckUnaryOperator): Correct error number used
to make it coincide with MS' number.
(Operator::CheckBinaryOperator): Ditto.
* ../errors/errors.txt : Remove error numbers added earlier.
* ../errors/cs1019.cs : Test case for error # 1019
* ../errros/cs1020.cs : Test case for error # 1020
* cs-parser.jay : Clean out commented cruft.
(dimension_separators, dimension_separator): Comment out. Ostensibly not
used anywhere - non-reducing rule.
(namespace_declarations): Non-reducing rule - comment out.
* enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
with TypeContainer::AddEnum.
* delegate.cs : New file for delegate handling classes.
(Delegate): Class for declaring delegates.
* makefile : Update.
* cs-parser.jay (delegate_declaration): Implement.
2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Event::Define): Implement.
(Event.EventBuilder): New member.
* class.cs (TypeContainer::Populate): Update to define all enums and events
we have.
(Events): New property for the events arraylist we hold. Shouldn't we move to using
readonly fields for all these cases ?
2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Property): Revamp to use the convention of making fields readonly.
Accordingly modify code elsewhere.
* class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
the Define method of the Property class.
* class.cs : Clean up applied patch and update references to variables etc. Fix
trivial bug.
(TypeContainer::Populate): Update to define all the properties we have. Also
define all enumerations.
* enum.cs (Define): Implement.
2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (overloadable_operator): The semantic value is an
enum of the Operator class.
(operator_declarator): Implement actions.
(operator_declaration): Implement.
* class.cs (Operator::CheckUnaryOperator): New static method to help in checking
validity of definitions.
(Operator::CheckBinaryOperator): Static method to check for binary operators
(TypeContainer::AddOperator): New method to add an operator to a type.
* cs-parser.jay (indexer_declaration): Added line to actually call the
AddIndexer method so it gets added ;-)
* ../errors/errors.txt : Update to include new error numbers. Are these numbers
already taken care of by the MS compiler ?
2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Operator): New class for operator declarations.
(Operator::OpType): Enum for the various operators.
2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
ostensibly handle this in semantic analysis.
* cs-parser.jay (general_catch_clause): Comment out
(specific_catch_clauses, specific_catch_clause): Ditto.
(opt_general_catch_clause, opt_specific_catch_clauses): Ditto
(catch_args, opt_catch_args): New productions.
(catch_clause): Rewrite to use the new productions above
(catch_clauses): Modify accordingly.
(opt_catch_clauses): New production to use in try_statement
(try_statement): Revamp. Basically, we get rid of one unnecessary rule
and re-write the code in the actions to extract the specific and
general catch clauses by being a little smart ;-)
* ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
Hooray, try and catch statements parse fine !
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* statement.cs (Block::GetVariableType): Fix logic to extract the type
string from the hashtable of variables.
* cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
I end up making that mistake ;-)
(catch_clauses): Fixed gross error which made Key and Value of the
DictionaryEntry the same : $1 !!
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
* cs-parser.jay (event_declaration): Correct to remove the semicolon
when the add and remove accessors are specified.
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (IndexerDeclaration): New helper class to hold
information about indexer_declarator.
(indexer_declarator): Implement actions.
(parsing_indexer): New local boolean used to keep track of whether
we are parsing indexers or properties. This is necessary because
implicit_parameters come into picture even for the get accessor in the
case of an indexer.
(get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
* class.cs (Indexer): New class for indexer declarations.
(TypeContainer::AddIndexer): New method to add an indexer to a type.
(TypeContainer::indexers): New member to hold list of indexers for the
type.
2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (add_accessor_declaration): Implement action.
(remove_accessor_declaration): Implement action.
(event_accessors_declaration): Implement
(variable_declarators): swap statements for first rule - trivial.
* class.cs (Event): New class to hold information about event
declarations.
(TypeContainer::AddEvent): New method to add an event to a type
(TypeContainer::events): New member to hold list of events.
* cs-parser.jay (event_declaration): Implement actions.
2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (dim_separators): Implement. Make it a string
concatenating all the commas together, just as they appear.
(opt_dim_separators): Modify accordingly
(rank_specifiers): Update accordingly. Basically do the same
thing - instead, collect the brackets here.
(opt_rank_sepcifiers): Modify accordingly.
(array_type): Modify to actually return the complete type string
instead of ignoring the rank_specifiers.
(expression_list): Implement to collect the expressions
(variable_initializer): Implement. We make it a list of expressions
essentially so that we can handle the array_initializer case neatly too.
(variable_initializer_list): Implement.
(array_initializer): Make it a list of variable_initializers
(opt_array_initializer): Modify accordingly.
* expression.cs (New::NType): Add enumeration to help us
keep track of whether we have an object/delegate creation
or an array creation.
(New:NewType, New::Rank, New::Indices, New::Initializers): New
members to hold data about array creation.
(New:New): Modify to update NewType
(New:New): New Overloaded contructor for the array creation
case.
* cs-parser.jay (array_creation_expression): Implement to call
the overloaded New constructor.
2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (TypeContainer::Constructors): Return member
constructors instead of returning null.
2001-08-26 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (InitCoreTypes): Initialize the various core
types after we have populated the type manager with the user
defined types (this distinction will be important later while
compiling corlib.dll)
* expression.cs, literal.cs, assign.cs, constant.cs: Started work
on Expression Classification. Now all expressions have a method
`Resolve' and a method `Emit'.
* codegen.cs, cs-parser.jay: Fixed the bug that stopped code
generation from working. Also add some temporary debugging
code.
2001-08-24 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Lots of code generation pieces. This is only the
beginning, will continue tomorrow with more touches of polish. We
handle the fundamentals of if, while, do, for, return. Others are
trickier and I need to start working on invocations soon.
* gen-treedump.cs: Bug fix, use s.Increment here instead of
s.InitStatement.
* codegen.cs (EmitContext): New struct, used during code
emission to keep a context. Most of the code generation will be
here.
* cs-parser.jay: Add embedded blocks to the list of statements of
this block. So code generation proceeds in a top down fashion.
2001-08-23 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Add support for multiple child blocks.
2001-08-22 Miguel de Icaza <miguel@ximian.com>
* codegen.cs (EmitCode): New function, will emit the code for a
Block of code given a TypeContainer and its ILGenerator.
* statement.cs (Block): Standard public readonly optimization.
(Block::Block constructors): Link children.
(Block::Child): Child Linker.
(Block::EmitVariables): Emits IL variable declarations.
* class.cs: Drop support for MethodGroups here, delay until
Semantic Analysis.
(Method::): Applied the same simplification that I did before, and
move from Properties to public readonly fields.
(Method::ParameterTypes): Returns the parameter types for the
function, and implements a cache that will be useful later when I
do error checking and the semantic analysis on the methods is
performed.
(Constructor::GetCallingConvention): Renamed from CallingConvetion
and made a method, optional argument tells whether this is a class
or a structure to apply the `has-this' bit.
(Method::GetCallingConvention): Implement, returns the calling
convention.
(Method::Define): Defines the type, a second pass is performed
later to populate the methods.
(Constructor::ParameterTypes): implement a cache similar to the
one on Method::ParameterTypes, useful later when we do semantic
analysis.
(TypeContainer::EmitMethod): New method. Emits methods.
* expression.cs: Removed MethodGroup class from here.
* parameter.cs (Parameters::GetCallingConvention): new method.
2001-08-21 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer::Populate): Drop RootContext from the
argument.
(Constructor::CallingConvention): Returns the calling convention.
(Constructor::ParameterTypes): Returns the constructor parameter
types.
(TypeContainer::AddConstructor): Keep track of default constructor
and the default static constructor.
(Constructor::) Another class that starts using `public readonly'
instead of properties.
(Constructor::IsDefault): Whether this is a default constructor.
(Field::) use readonly public fields instead of properties also.
(TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
track of static constructors; If none is used, turn on
BeforeFieldInit in the TypeAttributes.
* cs-parser.jay (opt_argument_list): now the return can be null
for the cases where there are no arguments.
(constructor_declarator): If there is no implicit `base' or
`this', then invoke the default parent constructor.
* modifiers.cs (MethodAttr): New static function maps a set of
modifiers flags into a MethodAttributes enum
(FieldAttr): renamed from `Map'. So now we have FieldAttr,
MethodAttr, TypeAttr to represent the various mappings where the
modifiers are used.
(FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
2001-08-19 Miguel de Icaza <miguel@ximian.com>
* parameter.cs (GetParameterInfo): Fix bug where there would be no
method arguments.
* interface.cs (PopulateIndexer): Implemented the code generator
for interface indexers.
2001-08-17 Miguel de Icaza <miguel@ximian.com>
* interface.cs (InterfaceMemberBase): Now we track the new status
here.
(PopulateProperty): Implement property population. Woohoo! Got
Methods and Properties going today.
Removed all the properties for interfaces, and replaced them with
`public readonly' fields.
2001-08-16 Miguel de Icaza <miguel@ximian.com>
* interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
initialize their hashtables/arraylists only when they are needed
instead of doing this always.
* parameter.cs: Handle refs and out parameters.
* cs-parser.jay: Use an ArrayList to construct the arguments
instead of the ParameterCollection, and then cast that to a
Parameter[] array.
* parameter.cs: Drop the use of ParameterCollection and use
instead arrays of Parameters.
(GetParameterInfo): Use the Type, not the Name when resolving
types.
2001-08-13 Miguel de Icaza <miguel@ximian.com>
* parameter.cs: Eliminate the properties Name, Type and ModFlags,
and instead use public readonly fields.
* class.cs: Put back walking code for type containers.
2001-08-11 Miguel de Icaza <miguel@ximian.com>
* class.cs (MakeConstant): Code to define constants.
* rootcontext.cs (LookupType): New function. Used to locate types
2001-08-08 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: OH MY! My trick works! It is amazing how nice
this System.Reflection code is. Kudos to Microsoft
* typemanager.cs: Implement a type cache and avoid loading all
types at boot time. Wrap in LookupType the internals. This made
the compiler so much faster. Wow. I rule!
* driver.cs: Make sure we always load mscorlib first (for
debugging purposes, nothing really important).
* Renamespaced things that were on `CSC' to `CIR'. Maybe I should
have moved to `CSC' rather than `CIR'. Oh man! The confussion!
* rootcontext.cs: Lookup types on their namespace; Lookup types
on namespaces that have been imported using the `using' keyword.
* class.cs (TypeContainer::TypeAttr): Virtualize.
(Class::TypeAttr): Return attributes suitable for this bad boy.
(Struct::TypeAttr): ditto.
Handle nested classes.
(TypeContainer::) Remove all the type visiting code, it is now
replaced with the rootcontext.cs code
* rootcontext.cs (GetClassBases): Added support for structs.
2001-08-06 Miguel de Icaza <miguel@ximian.com>
* interface.cs, statement.cs, class.cs, parameter.cs,
rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
Drop use of TypeRefs, and use strings instead.
2001-08-04 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs:
* class.cs (Struct::Struct): set the SEALED flags after
checking the modifiers.
(TypeContainer::TypeAttr): new property, returns the
TypeAttributes for a class.
* cs-parser.jay (type_list): Oops, list production was creating a
new list of base types.
* rootcontext.cs (StdLib): New property.
(GetInterfaceTypeByName): returns an interface by type name, and
encapsulates error handling here.
(GetInterfaces): simplified.
(ResolveTree): Encapsulated all the tree resolution here.
(CreateClass, GetClassBases, GetInterfaceOrClass): Create class
types.
* driver.cs: Add support for --nostdlib, to avoid loading the
default assemblies.
(Main): Do not put tree resolution here.
* rootcontext.cs: Beginning of the class resolution.
2001-08-03 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Provide better error reporting.
* cs-parser.jay (interface_base): set our $$ to be interfaces.
* rootcontext.cs (CreateInterface): Handle the case where there
are no parent interfaces.
(CloseTypes): Routine to flush types at the end.
(CreateInterface): Track types.
(GetInterfaces): Returns an array of Types from the list of
defined interfaces.
* typemanager.c (AddUserType): Mechanism to track user types (puts
the type on the global type hash, and allows us to close it at the
end).
2001-08-02 Miguel de Icaza <miguel@ximian.com>
* tree.cs: Removed RecordType, added RecordClass, RecordStruct and
RecordInterface instead.
* cs-parser.jay: Updated to reflect changes above.
* decl.cs (Definition): Keep track of the TypeBuilder type that
represents this type here. Not sure we will use it in the long
run, but wont hurt for now.
* driver.cs: Smaller changes to accomodate the new code.
Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
when done.
* rootcontext.cs (CreateInterface): New method, used to create
the System.TypeBuilder type for interfaces.
(ResolveInterfaces): new entry point to resolve the interface
hierarchy.
(CodeGen): Property, used to keep track of the code generator.
2001-07-26 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Add a second production for delegate_declaration
with `VOID'.
(enum_body): Put an opt_comma here instead of putting it on
enum_body or enum_member_declarations so we can handle trailing
commas on enumeration members. Gets rid of a shift/reduce.
(type_list): Need a COMMA in the middle.
(indexer_declaration): Tell tokenizer to recognize get/set
* Remove old targets.
* Re-add the parser target.
2001-07-13 Simon Cozens <simon@simon-cozens.org>
* cs-parser.jay: Add precendence rules for a number of operators
ot reduce the number of shift/reduce conflicts in the grammar.
2001-07-17 Miguel de Icaza <miguel@ximian.com>
* tree.cs: moved IGenerator interface and renamed it to ITreeDump
and put it here.
Get rid of old crufty code.
* rootcontext.cs: Use this to keep track of the parsed
representation and the defined types available to the program.
* gen-treedump.cs: adjust for new convention.
* type.cs: Split out the type manager, and the assembly builder
from here.
* typemanager.cs: the type manager will live here now.
* cil-codegen.cs: And the code generator here.
2001-07-14 Sean MacIsaac <macisaac@ximian.com>
* makefile: Fixed up for easy making.
2001-07-13 Simon Cozens <simon@simon-cozens.org>
* cs-parser.jay (rank_specifier): Remove a conflict by reordering
the
(unary_expression): Expand pre_increment_expression and
post_decrement_expression to reduce a shift/reduce.
2001-07-11 Simon Cozens
* cs-tokenizer.cs: Hex numbers should begin with a 0.
Improve allow_keyword_as_indent name.
2001-06-19 Miguel de Icaza <miguel@ximian.com>
* Adjustments for Beta2.
2001-06-13 Miguel de Icaza <miguel@ximian.com>
* decl.cs: Added `Define' abstract method.
(InTransit): new property, used to catch recursive definitions.
* interface.cs: Implement `Define'.
* modifiers.cs: Map Modifiers.constants to
System.Reflection.TypeAttribute flags.
* class.cs: Keep track of types and user-defined types.
(BuilderInit): New method for creating an assembly
(ResolveType): New function to launch the resolution process, only
used by interfaces for now.
* cs-parser.jay: Keep track of Classes, Structs and Interfaces
that are inserted into the name space.
2001-06-08 Miguel de Icaza <miguel@ximian.com>
* ARGH. I have screwed up my tree so many times due to the use of
rsync rather than using CVS. Going to fix this at once.
* driver.cs: Objetify driver. Load assemblies, use assemblies to
load types.
2001-06-07 Miguel de Icaza <miguel@ximian.com>
* Experiment successful: Use System.Type rather that our own
version of Type.
2001-05-25 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Removed nsAliases from here.
Use new namespaces, handle `using XXX;'
* namespace.cs: Reimplemented namespace handling, use a recursive
definition of the class. Now we can keep track of using clauses
and catch invalid using clauses.
2001-05-24 Miguel de Icaza <miguel@ximian.com>
* gen-treedump.cs: Adapted for all the renaming.
* expression.cs (Expression): this class now has a Type property
which returns an expression Type.
(Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
`Type', as this has a different meaning now in the base
2001-05-22 Miguel de Icaza <miguel@ximian.com>
* interface.cs, class.cs: Removed from all the sources the
references to signature computation, as we can not do method
signature computation during the parsing time, as we are not
trying to solve at that point distinguishing:
class X {
void a (Blah x) {}
void a (NS.Blah x) {}
}
Which depending on the context might be valid or not, as we do not
know if Blah is the same thing as NS.Blah at that point.
* Redid everything so the code uses TypeRefs now instead of
Types. TypeRefs are just temporary type placeholders, that need
to be resolved. They initially have a pointer to a string and the
current scope in which they are used. This is used later by the
compiler to resolve the reference to an actual Type.
* DeclSpace is no longer a CIR.Type, and neither are
TypeContainers (Class and Struct) nor Interfaces nor Enums. They
are all DeclSpaces, but no Types.
* type.cs (TypeRefManager): This implements the TypeRef manager,
which keeps track of all the types that need to be resolved after
the parsing has finished.
2001-05-13 Miguel de Icaza <miguel@ximian.com>
* ARGH. We are going to have to store `foreach' as a class rather
than resolving it, as we need to verify error 1579 after name
resolution. *OR* we could keep a flag that says `This request to
IEnumerator comes from a foreach statement' which we can then use
to generate the error.
2001-05-10 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.AddMethod): we now add methods to the
MethodGroup instead of the method hashtable.
* expression.cs: Add MethodGroup abstraction, which gets us one
step closer to the specification in the way we handle method
declarations.
* cs-parser.jay (primary_expression): qualified_identifier now
tried to match up an identifier to a local variable reference or
to a parameter reference.
current_local_parameters is now a parser global variable that
points to the current parameters for the block, used during name
lookup.
(property_declaration): Now creates an implicit `value' argument to
the set accessor.
2001-05-09 Miguel de Icaza <miguel@ximian.com>
* parameter.cs: Do not use `param' arguments as part of the
signature, per the spec.
2001-05-08 Miguel de Icaza <miguel@ximian.com>
* decl.cs: Base class for classes, structs and interfaces. This
is the "Declaration Space"
* cs-parser.jay: Use CheckDef for checking declaration errors
instead of having one on each function.
* class.cs: Factor out some code for handling error handling in
accordance to the "Declarations" section in the "Basic Concepts"
chapter in the ECMA C# spec.
* interface.cs: Make all interface member classes derive from
InterfaceMemberBase.
2001-05-07 Miguel de Icaza <miguel@ximian.com>
* Many things: all interfaces are parsed and generated in
gen-treedump. Support for member variables, constructors,
destructors, properties, constants is there.
Beginning of the IL backend, but very little done, just there for
testing purposes.
2001-04-29 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Fix labeled statement.
* cs-tokenizer.cs (escape): Escape " and ' always.
ref_line, ref_name: keep track of the line/filename as instructed
by #line by the compiler.
Parse #line.
2001-04-27 Miguel de Icaza <miguel@ximian.com>
* System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
to match the values in System.CodeDOM.
Divid renamed to Divide.
* System.CodeDOM/CodeForLoopStatement.cs: Always have valid
statements.
(Statements.set): remove.
* System.CodeDOM/CodeCatchClause.cs: always have a valid
statements.
* System.CodeDOM/CodeIfStatement.cs: trueStatements and
falseStatements always have valid values.
* cs-parser.jay: Use System.CodeDOM now.
|