Skip to content

Generate foreign imports related to tokens automatically using clang-bootstrap#44

Merged
jorisdral merged 5 commits into
mainfrom
jdral/clarify-cxtoken-representation
Mar 20, 2026
Merged

Generate foreign imports related to tokens automatically using clang-bootstrap#44
jorisdral merged 5 commits into
mainfrom
jdral/clarify-cxtoken-representation

Conversation

@jorisdral

@jorisdral jorisdral commented Mar 11, 2026

Copy link
Copy Markdown
Member

Resolves #41

I first had to change the code a bit to explain better why handling of the CXToken struct has to be different from the handling of other structs. The short story is: CXTokens are allocated by libclang and maintained by C. Memory for other structs are typically allocated on the Haskell side. But once that was in place, automatically generating the foreign imports was simple.

Comment thread src/Clang/Internal/ByValue.hs
Comment thread src/Clang/Internal/ByValue.hs
Comment thread src/Clang/LowLevel/Core.hs Outdated
Comment thread src/Clang/LowLevel/Core.hs Outdated
Comment thread src/Clang/LowLevel/Core.hs Outdated
Comment thread src/Clang/LowLevel/Core.hs Outdated

@edsko edsko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge once the changes we discussed are done.

@jorisdral
jorisdral force-pushed the jdral/clarify-cxtoken-representation branch from 4598fea to 6353423 Compare March 20, 2026 11:11
@jorisdral
jorisdral enabled auto-merge March 20, 2026 11:12
@jorisdral
jorisdral added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit ea43e2a Mar 20, 2026
11 checks passed
@jorisdral
jorisdral deleted the jdral/clarify-cxtoken-representation branch March 20, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use clang-bootstrap to generate foreign imports for the CXToken API

2 participants