Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose functions for working with LLVMContextRef for interoperability with other libraries #518

Merged
merged 4 commits into from
Jul 27, 2024

Conversation

gavrilikhin-d
Copy link
Contributor

Description

This makes some functions in Context and ContextRef pub instead of pub(crate).
Also adds getter for raw LLVMContextRef

How This Has Been Tested

Tested with llvm18-0 in my code that uses melior, mlir-sys and inkwell together.

Checklist

@gavrilikhin-d
Copy link
Contributor Author

Obviously, tests are failing not due to this PR :/

src/context.rs Outdated Show resolved Hide resolved
src/context.rs Outdated Show resolved Hide resolved
@gavrilikhin-d
Copy link
Contributor Author

gavrilikhin-d commented Jul 21, 2024 via email

@TheDan64
Copy link
Owner

We should not mark the raw methods as unsafe since there's no unsafety that can result from using them alone. See the std lib for example which has safe methods which return raw ptrs: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.into_raw_parts

@gavrilikhin-d
Copy link
Contributor Author

Fixed

@TheDan64 TheDan64 added this to the 0.5.0 milestone Jul 27, 2024
Copy link
Owner

@TheDan64 TheDan64 left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheDan64 TheDan64 merged commit 89e06af into TheDan64:master Jul 27, 2024
16 checks passed
@gavrilikhin-d gavrilikhin-d deleted the pub branch July 29, 2024 18:55
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.

2 participants