Skip to content

Commit 6ef41ae

Browse files
committed
Bumb libclang version
Closes #1220.
1 parent 705310c commit 6ef41ae

File tree

17 files changed

+405
-17
lines changed

17 files changed

+405
-17
lines changed

cabal.project.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ index-state: 2025-09-16T04:55:58Z
44
source-repository-package
55
type: git
66
location: https://github.com/well-typed/libclang
7-
tag: 41f70874b0f803366144059c0ed0f65809e8c385
7+
tag: 6c0867cd6f627b07c7cf20e396a0b1528907bdbb
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Empty lines in this file are significant!
2+
3+
4+
__MATHCALL_VEC;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define __MATHCALL_VEC extern double _ ## acos (double x)
2+
3+
#include <ordinary_anon_child.h>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module Example () where
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{-# LANGUAGE CApiFFI #-}
2+
{-# LANGUAGE NoImplicitPrelude #-}
3+
{-# LANGUAGE TemplateHaskell #-}
4+
{-# OPTIONS_HADDOCK prune #-}
5+
6+
module Example.FunPtr where
7+
8+
import qualified Foreign.C as FC
9+
import qualified GHC.IO.Unsafe
10+
import qualified GHC.Ptr as Ptr
11+
import qualified HsBindgen.Runtime.Prelude
12+
import Prelude (IO)
13+
14+
$(HsBindgen.Runtime.Prelude.addCSource (HsBindgen.Runtime.Prelude.unlines
15+
[ "#include <ordinary_anon_parent.h>"
16+
, "/* get__acos_ptr */"
17+
, "__attribute__ ((const))"
18+
, "double (*hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b (void)) ("
19+
, " double arg1"
20+
, ")"
21+
, "{"
22+
, " return &_acos;"
23+
, "}"
24+
]))
25+
26+
foreign import ccall unsafe "hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b" hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b ::
27+
IO (Ptr.FunPtr (FC.CDouble -> IO FC.CDouble))
28+
29+
{-# NOINLINE _acos_ptr #-}
30+
31+
{-| __C declaration:__ @_acos@
32+
33+
__defined at:__ @ordinary_anon_child.h:4:1@
34+
35+
__exported by:__ @ordinary_anon_parent.h@
36+
-}
37+
_acos_ptr :: Ptr.FunPtr (FC.CDouble -> IO FC.CDouble)
38+
_acos_ptr =
39+
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module Example.Global () where
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{-# LANGUAGE CApiFFI #-}
2+
{-# LANGUAGE NoImplicitPrelude #-}
3+
{-# LANGUAGE TemplateHaskell #-}
4+
{-# OPTIONS_HADDOCK prune #-}
5+
6+
module Example.Safe where
7+
8+
import qualified Foreign.C as FC
9+
import qualified HsBindgen.Runtime.Prelude
10+
import Prelude (IO)
11+
12+
$(HsBindgen.Runtime.Prelude.addCSource (HsBindgen.Runtime.Prelude.unlines
13+
[ "#include <ordinary_anon_parent.h>"
14+
, "double hs_bindgen_test_ordinary_anon_parent_49d2dc050c5f231a ("
15+
, " double arg1"
16+
, ")"
17+
, "{"
18+
, " return _acos(arg1);"
19+
, "}"
20+
]))
21+
22+
{-| __C declaration:__ @_acos@
23+
24+
__defined at:__ @ordinary_anon_child.h:4:1@
25+
26+
__exported by:__ @ordinary_anon_parent.h@
27+
-}
28+
foreign import ccall safe "hs_bindgen_test_ordinary_anon_parent_49d2dc050c5f231a" _acos ::
29+
FC.CDouble
30+
{- ^ __C declaration:__ @x@
31+
-}
32+
-> IO FC.CDouble
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{-# LANGUAGE CApiFFI #-}
2+
{-# LANGUAGE NoImplicitPrelude #-}
3+
{-# LANGUAGE TemplateHaskell #-}
4+
{-# OPTIONS_HADDOCK prune #-}
5+
6+
module Example.Unsafe where
7+
8+
import qualified Foreign.C as FC
9+
import qualified HsBindgen.Runtime.Prelude
10+
import Prelude (IO)
11+
12+
$(HsBindgen.Runtime.Prelude.addCSource (HsBindgen.Runtime.Prelude.unlines
13+
[ "#include <ordinary_anon_parent.h>"
14+
, "double hs_bindgen_test_ordinary_anon_parent_faad0266dab4d429 ("
15+
, " double arg1"
16+
, ")"
17+
, "{"
18+
, " return _acos(arg1);"
19+
, "}"
20+
]))
21+
22+
{-| __C declaration:__ @_acos@
23+
24+
__defined at:__ @ordinary_anon_child.h:4:1@
25+
26+
__exported by:__ @ordinary_anon_parent.h@
27+
-}
28+
foreign import ccall unsafe "hs_bindgen_test_ordinary_anon_parent_faad0266dab4d429" _acos ::
29+
FC.CDouble
30+
{- ^ __C declaration:__ @x@
31+
-}
32+
-> IO FC.CDouble
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version:
2+
hs_bindgen: 0.1.0
3+
binding_specification: '1.0'
4+
hsmodule: Example
5+
types: []
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
[
2+
DeclForeignImport
3+
ForeignImportDecl {
4+
foreignImportName = Name
5+
"@NsVar"
6+
"_acos",
7+
foreignImportParameters = [
8+
FunctionParameter {
9+
functionParameterName = Just
10+
(Name "@NsVar" "x"),
11+
functionParameterType =
12+
HsPrimType HsPrimCDouble,
13+
functionParameterComment = Just
14+
Comment {
15+
commentTitle = Nothing,
16+
commentOrigin = Just "x",
17+
commentLocation = Nothing,
18+
commentHeaderInfo = Nothing,
19+
commentChildren = []}}],
20+
foreignImportResultType =
21+
NormalResultType
22+
(HsIO
23+
(HsPrimType HsPrimCDouble)),
24+
foreignImportOrigName =
25+
"hs_bindgen_test_ordinary_anon_parent_49d2dc050c5f231a",
26+
foreignImportCallConv =
27+
CallConvUserlandCAPI
28+
UserlandCapiWrapper {
29+
capiWrapperDefinition =
30+
concat
31+
[
32+
"double hs_bindgen_test_ordinary_anon_parent_49d2dc050c5f231a (\n",
33+
" double arg1\n",
34+
")\n",
35+
"{\n",
36+
" return _acos(arg1);\n",
37+
"}"],
38+
capiWrapperImport =
39+
"ordinary_anon_parent.h"},
40+
foreignImportOrigin = Function
41+
Function {
42+
functionArgs = [
43+
_×_
44+
(Just
45+
NamePair {
46+
nameC = Name "x",
47+
nameHsIdent = Identifier "x"})
48+
(TypePrim
49+
(PrimFloating PrimDouble))],
50+
functionAttrs =
51+
FunctionAttributes
52+
ImpureFunction,
53+
functionRes = TypePrim
54+
(PrimFloating PrimDouble)},
55+
foreignImportComment = Just
56+
Comment {
57+
commentTitle = Nothing,
58+
commentOrigin = Just "_acos",
59+
commentLocation = Just
60+
"ordinary_anon_child.h:4:1",
61+
commentHeaderInfo = Just
62+
HeaderInfo {
63+
headerMainHeaders = NE.fromList
64+
["ordinary_anon_parent.h"],
65+
headerInclude =
66+
"ordinary_anon_child.h"},
67+
commentChildren = []},
68+
foreignImportSafety = Safe},
69+
DeclForeignImport
70+
ForeignImportDecl {
71+
foreignImportName = Name
72+
"@NsVar"
73+
"_acos",
74+
foreignImportParameters = [
75+
FunctionParameter {
76+
functionParameterName = Just
77+
(Name "@NsVar" "x"),
78+
functionParameterType =
79+
HsPrimType HsPrimCDouble,
80+
functionParameterComment = Just
81+
Comment {
82+
commentTitle = Nothing,
83+
commentOrigin = Just "x",
84+
commentLocation = Nothing,
85+
commentHeaderInfo = Nothing,
86+
commentChildren = []}}],
87+
foreignImportResultType =
88+
NormalResultType
89+
(HsIO
90+
(HsPrimType HsPrimCDouble)),
91+
foreignImportOrigName =
92+
"hs_bindgen_test_ordinary_anon_parent_faad0266dab4d429",
93+
foreignImportCallConv =
94+
CallConvUserlandCAPI
95+
UserlandCapiWrapper {
96+
capiWrapperDefinition =
97+
concat
98+
[
99+
"double hs_bindgen_test_ordinary_anon_parent_faad0266dab4d429 (\n",
100+
" double arg1\n",
101+
")\n",
102+
"{\n",
103+
" return _acos(arg1);\n",
104+
"}"],
105+
capiWrapperImport =
106+
"ordinary_anon_parent.h"},
107+
foreignImportOrigin = Function
108+
Function {
109+
functionArgs = [
110+
_×_
111+
(Just
112+
NamePair {
113+
nameC = Name "x",
114+
nameHsIdent = Identifier "x"})
115+
(TypePrim
116+
(PrimFloating PrimDouble))],
117+
functionAttrs =
118+
FunctionAttributes
119+
ImpureFunction,
120+
functionRes = TypePrim
121+
(PrimFloating PrimDouble)},
122+
foreignImportComment = Just
123+
Comment {
124+
commentTitle = Nothing,
125+
commentOrigin = Just "_acos",
126+
commentLocation = Just
127+
"ordinary_anon_child.h:4:1",
128+
commentHeaderInfo = Just
129+
HeaderInfo {
130+
headerMainHeaders = NE.fromList
131+
["ordinary_anon_parent.h"],
132+
headerInclude =
133+
"ordinary_anon_child.h"},
134+
commentChildren = []},
135+
foreignImportSafety = Unsafe},
136+
DeclForeignImport
137+
ForeignImportDecl {
138+
foreignImportName = Name
139+
"@NsVar"
140+
"hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b",
141+
foreignImportParameters = [],
142+
foreignImportResultType =
143+
NormalResultType
144+
(HsIO
145+
(HsFunPtr
146+
(HsFun
147+
(HsPrimType HsPrimCDouble)
148+
(HsIO
149+
(HsPrimType HsPrimCDouble))))),
150+
foreignImportOrigName =
151+
"hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b",
152+
foreignImportCallConv =
153+
CallConvUserlandCAPI
154+
UserlandCapiWrapper {
155+
capiWrapperDefinition =
156+
concat
157+
[
158+
"/* get__acos_ptr */\n",
159+
"__attribute__ ((const))\n",
160+
"double (*hs_bindgen_test_ordinary_anon_parent_c6a8256d628dc56b (void)) (\n",
161+
" double arg1\n",
162+
")\n",
163+
"{\n",
164+
" return &_acos;\n",
165+
"}"],
166+
capiWrapperImport =
167+
"ordinary_anon_parent.h"},
168+
foreignImportOrigin = Global
169+
(TypeFun
170+
[
171+
TypePrim
172+
(PrimFloating PrimDouble)]
173+
(TypePrim
174+
(PrimFloating PrimDouble))),
175+
foreignImportComment = Nothing,
176+
foreignImportSafety = Unsafe},
177+
DeclSimple,
178+
DeclSimple]

0 commit comments

Comments
 (0)