Skip to content

Commit 79a068d

Browse files
committed
Parse status
1 parent 4a22762 commit 79a068d

File tree

26 files changed

+698
-712
lines changed

26 files changed

+698
-712
lines changed

hs-bindgen/examples/golden/fun_attributes.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ int square (int) __attribute__ ((const));
4343
// deprecated
4444
// deprecated (msg)
4545

46-
int old_fn () __attribute__ ((deprecated));
46+
int old_fn_deprecated () __attribute__ ((deprecated("Use new_function instead")));
47+
48+
// unavailable
49+
// unavailable (msg)
50+
51+
int old_fn_unavailable () __attribute__((unavailable("Use new_function instead")));
4752

4853
// format (archetype, string-index, first-to-check)
4954

hs-bindgen/fixtures/fun_attributes.hs

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,18 +1019,18 @@
10191019
ForeignImportDecl {
10201020
foreignImportName = Name
10211021
"@NsVar"
1022-
"old_fn",
1022+
"old_fn_deprecated",
10231023
foreignImportParameters = [],
10241024
foreignImportResultType =
10251025
NormalResultType
10261026
(HsIO (HsPrimType HsPrimCInt)),
10271027
foreignImportOrigName =
1028-
"hs_bindgen_test_fun_attributes_1040c24c74db8069",
1028+
"hs_bindgen_test_fun_attributes_e9647b9c99c68776",
10291029
foreignImportCallConv =
10301030
CallConvUserlandCAPI
10311031
UserlandCapiWrapper {
10321032
capiWrapperDefinition =
1033-
"signed int hs_bindgen_test_fun_attributes_1040c24c74db8069 (void) { return old_fn(); }",
1033+
"signed int hs_bindgen_test_fun_attributes_e9647b9c99c68776 (void) { return old_fn_deprecated(); }",
10341034
capiWrapperImport =
10351035
"fun_attributes.h"},
10361036
foreignImportOrigin = Function
@@ -1044,7 +1044,8 @@
10441044
foreignImportComment = Just
10451045
Comment {
10461046
commentTitle = Nothing,
1047-
commentOrigin = Just "old_fn",
1047+
commentOrigin = Just
1048+
"old_fn_deprecated",
10481049
commentLocation = Just
10491050
"fun_attributes.h:46:5",
10501051
commentHeaderInfo = Just
@@ -1141,7 +1142,7 @@
11411142
commentOrigin = Just
11421143
"my_dgettext",
11431144
commentLocation = Just
1144-
"fun_attributes.h:57:1",
1145+
"fun_attributes.h:62:1",
11451146
commentHeaderInfo = Just
11461147
HeaderInfo {
11471148
headerMainHeaders = NE.fromList
@@ -1219,7 +1220,7 @@
12191220
commentTitle = Nothing,
12201221
commentOrigin = Just "fdopen",
12211222
commentLocation = Just
1222-
"fun_attributes.h:68:9",
1223+
"fun_attributes.h:73:9",
12231224
commentHeaderInfo = Just
12241225
HeaderInfo {
12251226
headerMainHeaders = NE.fromList
@@ -1258,7 +1259,7 @@
12581259
commentTitle = Nothing,
12591260
commentOrigin = Just "f2",
12601261
commentLocation = Just
1261-
"fun_attributes.h:72:65",
1262+
"fun_attributes.h:77:65",
12621263
commentHeaderInfo = Just
12631264
HeaderInfo {
12641265
headerMainHeaders = NE.fromList
@@ -1362,7 +1363,7 @@
13621363
commentOrigin = Just
13631364
"my_memcpy",
13641365
commentLocation = Just
1365-
"fun_attributes.h:78:1",
1366+
"fun_attributes.h:83:1",
13661367
commentHeaderInfo = Just
13671368
HeaderInfo {
13681369
headerMainHeaders = NE.fromList
@@ -1401,7 +1402,7 @@
14011402
commentTitle = Nothing,
14021403
commentOrigin = Just "fatal",
14031404
commentLocation = Just
1404-
"fun_attributes.h:95:6",
1405+
"fun_attributes.h:100:6",
14051406
commentHeaderInfo = Just
14061407
HeaderInfo {
14071408
headerMainHeaders = NE.fromList
@@ -1454,7 +1455,7 @@
14541455
commentTitle = Nothing,
14551456
commentOrigin = Just "hash",
14561457
commentLocation = Just
1457-
"fun_attributes.h:103:5",
1458+
"fun_attributes.h:108:5",
14581459
commentHeaderInfo = Just
14591460
HeaderInfo {
14601461
headerMainHeaders = NE.fromList
@@ -1528,7 +1529,7 @@
15281529
commentTitle = Nothing,
15291530
commentOrigin = Just "mymalloc",
15301531
commentLocation = Just
1531-
"fun_attributes.h:108:1",
1532+
"fun_attributes.h:113:1",
15321533
commentHeaderInfo = Just
15331534
HeaderInfo {
15341535
headerMainHeaders = NE.fromList
@@ -1567,7 +1568,7 @@
15671568
commentTitle = Nothing,
15681569
commentOrigin = Just "foobar",
15691570
commentLocation = Just
1570-
"fun_attributes.h:112:13",
1571+
"fun_attributes.h:117:13",
15711572
commentHeaderInfo = Just
15721573
HeaderInfo {
15731574
headerMainHeaders = NE.fromList
@@ -1608,7 +1609,7 @@
16081609
commentOrigin = Just
16091610
"core2_func",
16101611
commentLocation = Just
1611-
"fun_attributes.h:119:5",
1612+
"fun_attributes.h:124:5",
16121613
commentHeaderInfo = Just
16131614
HeaderInfo {
16141615
headerMainHeaders = NE.fromList
@@ -1649,7 +1650,7 @@
16491650
commentOrigin = Just
16501651
"sse3_func",
16511652
commentLocation = Just
1652-
"fun_attributes.h:120:5",
1653+
"fun_attributes.h:125:5",
16531654
commentHeaderInfo = Just
16541655
HeaderInfo {
16551656
headerMainHeaders = NE.fromList
@@ -1688,7 +1689,7 @@
16881689
commentTitle = Nothing,
16891690
commentOrigin = Just "f3",
16901691
commentLocation = Just
1691-
"fun_attributes.h:124:49",
1692+
"fun_attributes.h:129:49",
16921693
commentHeaderInfo = Just
16931694
HeaderInfo {
16941695
headerMainHeaders = NE.fromList
@@ -1728,7 +1729,7 @@
17281729
commentTitle = Nothing,
17291730
commentOrigin = Just "fn",
17301731
commentLocation = Just
1731-
"fun_attributes.h:129:5",
1732+
"fun_attributes.h:134:5",
17321733
commentHeaderInfo = Just
17331734
HeaderInfo {
17341735
headerMainHeaders = NE.fromList
@@ -1768,7 +1769,7 @@
17681769
commentTitle = Nothing,
17691770
commentOrigin = Just "y",
17701771
commentLocation = Just
1771-
"fun_attributes.h:135:12",
1772+
"fun_attributes.h:140:12",
17721773
commentHeaderInfo = Just
17731774
HeaderInfo {
17741775
headerMainHeaders = NE.fromList
@@ -1808,7 +1809,7 @@
18081809
commentTitle = Nothing,
18091810
commentOrigin = Just "x1",
18101811
commentLocation = Just
1811-
"fun_attributes.h:138:12",
1812+
"fun_attributes.h:143:12",
18121813
commentHeaderInfo = Just
18131814
HeaderInfo {
18141815
headerMainHeaders = NE.fromList
@@ -1848,7 +1849,7 @@
18481849
commentTitle = Nothing,
18491850
commentOrigin = Just "x2",
18501851
commentLocation = Just
1851-
"fun_attributes.h:141:12",
1852+
"fun_attributes.h:146:12",
18521853
commentHeaderInfo = Just
18531854
HeaderInfo {
18541855
headerMainHeaders = NE.fromList
@@ -2311,18 +2312,18 @@
23112312
ForeignImportDecl {
23122313
foreignImportName = Name
23132314
"@NsVar"
2314-
"old_fn",
2315+
"old_fn_deprecated",
23152316
foreignImportParameters = [],
23162317
foreignImportResultType =
23172318
NormalResultType
23182319
(HsIO (HsPrimType HsPrimCInt)),
23192320
foreignImportOrigName =
2320-
"hs_bindgen_test_fun_attributes_febe1b1c3f69ce2f",
2321+
"hs_bindgen_test_fun_attributes_c48f18f4f06068eb",
23212322
foreignImportCallConv =
23222323
CallConvUserlandCAPI
23232324
UserlandCapiWrapper {
23242325
capiWrapperDefinition =
2325-
"signed int hs_bindgen_test_fun_attributes_febe1b1c3f69ce2f (void) { return old_fn(); }",
2326+
"signed int hs_bindgen_test_fun_attributes_c48f18f4f06068eb (void) { return old_fn_deprecated(); }",
23262327
capiWrapperImport =
23272328
"fun_attributes.h"},
23282329
foreignImportOrigin = Function
@@ -2336,7 +2337,8 @@
23362337
foreignImportComment = Just
23372338
Comment {
23382339
commentTitle = Nothing,
2339-
commentOrigin = Just "old_fn",
2340+
commentOrigin = Just
2341+
"old_fn_deprecated",
23402342
commentLocation = Just
23412343
"fun_attributes.h:46:5",
23422344
commentHeaderInfo = Just
@@ -2433,7 +2435,7 @@
24332435
commentOrigin = Just
24342436
"my_dgettext",
24352437
commentLocation = Just
2436-
"fun_attributes.h:57:1",
2438+
"fun_attributes.h:62:1",
24372439
commentHeaderInfo = Just
24382440
HeaderInfo {
24392441
headerMainHeaders = NE.fromList
@@ -2511,7 +2513,7 @@
25112513
commentTitle = Nothing,
25122514
commentOrigin = Just "fdopen",
25132515
commentLocation = Just
2514-
"fun_attributes.h:68:9",
2516+
"fun_attributes.h:73:9",
25152517
commentHeaderInfo = Just
25162518
HeaderInfo {
25172519
headerMainHeaders = NE.fromList
@@ -2550,7 +2552,7 @@
25502552
commentTitle = Nothing,
25512553
commentOrigin = Just "f2",
25522554
commentLocation = Just
2553-
"fun_attributes.h:72:65",
2555+
"fun_attributes.h:77:65",
25542556
commentHeaderInfo = Just
25552557
HeaderInfo {
25562558
headerMainHeaders = NE.fromList
@@ -2654,7 +2656,7 @@
26542656
commentOrigin = Just
26552657
"my_memcpy",
26562658
commentLocation = Just
2657-
"fun_attributes.h:78:1",
2659+
"fun_attributes.h:83:1",
26582660
commentHeaderInfo = Just
26592661
HeaderInfo {
26602662
headerMainHeaders = NE.fromList
@@ -2693,7 +2695,7 @@
26932695
commentTitle = Nothing,
26942696
commentOrigin = Just "fatal",
26952697
commentLocation = Just
2696-
"fun_attributes.h:95:6",
2698+
"fun_attributes.h:100:6",
26972699
commentHeaderInfo = Just
26982700
HeaderInfo {
26992701
headerMainHeaders = NE.fromList
@@ -2746,7 +2748,7 @@
27462748
commentTitle = Nothing,
27472749
commentOrigin = Just "hash",
27482750
commentLocation = Just
2749-
"fun_attributes.h:103:5",
2751+
"fun_attributes.h:108:5",
27502752
commentHeaderInfo = Just
27512753
HeaderInfo {
27522754
headerMainHeaders = NE.fromList
@@ -2820,7 +2822,7 @@
28202822
commentTitle = Nothing,
28212823
commentOrigin = Just "mymalloc",
28222824
commentLocation = Just
2823-
"fun_attributes.h:108:1",
2825+
"fun_attributes.h:113:1",
28242826
commentHeaderInfo = Just
28252827
HeaderInfo {
28262828
headerMainHeaders = NE.fromList
@@ -2859,7 +2861,7 @@
28592861
commentTitle = Nothing,
28602862
commentOrigin = Just "foobar",
28612863
commentLocation = Just
2862-
"fun_attributes.h:112:13",
2864+
"fun_attributes.h:117:13",
28632865
commentHeaderInfo = Just
28642866
HeaderInfo {
28652867
headerMainHeaders = NE.fromList
@@ -2900,7 +2902,7 @@
29002902
commentOrigin = Just
29012903
"core2_func",
29022904
commentLocation = Just
2903-
"fun_attributes.h:119:5",
2905+
"fun_attributes.h:124:5",
29042906
commentHeaderInfo = Just
29052907
HeaderInfo {
29062908
headerMainHeaders = NE.fromList
@@ -2941,7 +2943,7 @@
29412943
commentOrigin = Just
29422944
"sse3_func",
29432945
commentLocation = Just
2944-
"fun_attributes.h:120:5",
2946+
"fun_attributes.h:125:5",
29452947
commentHeaderInfo = Just
29462948
HeaderInfo {
29472949
headerMainHeaders = NE.fromList
@@ -2980,7 +2982,7 @@
29802982
commentTitle = Nothing,
29812983
commentOrigin = Just "f3",
29822984
commentLocation = Just
2983-
"fun_attributes.h:124:49",
2985+
"fun_attributes.h:129:49",
29842986
commentHeaderInfo = Just
29852987
HeaderInfo {
29862988
headerMainHeaders = NE.fromList
@@ -3020,7 +3022,7 @@
30203022
commentTitle = Nothing,
30213023
commentOrigin = Just "fn",
30223024
commentLocation = Just
3023-
"fun_attributes.h:129:5",
3025+
"fun_attributes.h:134:5",
30243026
commentHeaderInfo = Just
30253027
HeaderInfo {
30263028
headerMainHeaders = NE.fromList
@@ -3060,7 +3062,7 @@
30603062
commentTitle = Nothing,
30613063
commentOrigin = Just "y",
30623064
commentLocation = Just
3063-
"fun_attributes.h:135:12",
3065+
"fun_attributes.h:140:12",
30643066
commentHeaderInfo = Just
30653067
HeaderInfo {
30663068
headerMainHeaders = NE.fromList
@@ -3100,7 +3102,7 @@
31003102
commentTitle = Nothing,
31013103
commentOrigin = Just "x1",
31023104
commentLocation = Just
3103-
"fun_attributes.h:138:12",
3105+
"fun_attributes.h:143:12",
31043106
commentHeaderInfo = Just
31053107
HeaderInfo {
31063108
headerMainHeaders = NE.fromList
@@ -3140,7 +3142,7 @@
31403142
commentTitle = Nothing,
31413143
commentOrigin = Just "x2",
31423144
commentLocation = Just
3143-
"fun_attributes.h:141:12",
3145+
"fun_attributes.h:146:12",
31443146
commentHeaderInfo = Just
31453147
HeaderInfo {
31463148
headerMainHeaders = NE.fromList
@@ -3457,7 +3459,7 @@
34573459
ForeignImportDecl {
34583460
foreignImportName = Name
34593461
"@NsVar"
3460-
"hs_bindgen_test_fun_attributes_3add0261fa83e1dd",
3462+
"hs_bindgen_test_fun_attributes_17f68fdc3f464b20",
34613463
foreignImportParameters = [],
34623464
foreignImportResultType =
34633465
NormalResultType
@@ -3466,12 +3468,12 @@
34663468
(HsIO
34673469
(HsPrimType HsPrimCInt)))),
34683470
foreignImportOrigName =
3469-
"hs_bindgen_test_fun_attributes_3add0261fa83e1dd",
3471+
"hs_bindgen_test_fun_attributes_17f68fdc3f464b20",
34703472
foreignImportCallConv =
34713473
CallConvUserlandCAPI
34723474
UserlandCapiWrapper {
34733475
capiWrapperDefinition =
3474-
"/* get_old_fn_ptr */ __attribute__ ((const)) signed int (*hs_bindgen_test_fun_attributes_3add0261fa83e1dd (void)) (void) { return &old_fn; } ",
3476+
"/* get_old_fn_deprecated_ptr */ __attribute__ ((const)) signed int (*hs_bindgen_test_fun_attributes_17f68fdc3f464b20 (void)) (void) { return &old_fn_deprecated; } ",
34753477
capiWrapperImport =
34763478
"fun_attributes.h"},
34773479
foreignImportOrigin = Global

0 commit comments

Comments
 (0)