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

Implement safe API for operand bundles. #524

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

airwoodix
Copy link
Contributor

@airwoodix airwoodix commented Aug 14, 2024

Description

Implement a safe API wrapping the operand bundles manipulation calls in llvm-sys. The feature requires llvm18+.

Building call instructions is done with the new Builder::build_direct_call_with_operand_bundles and Builder::build_indirect_call_with_operand_bundles.

Since only call and invoke instructions support operand bundles, introspection methods are implemented on CallSiteValue. CallSiteValue::get_operand_bundles() produces an iterator of OperandBundle values, and OperandBundle::get_args() iterates over a bundle's arguments. OperandBundle::tag() retrieves the bundle's tag as a string slice.

Related Issue

Resolves #523

How This Has Been Tested

Ran tests for LLVM 16 and 18.

Checklist

@airwoodix
Copy link
Contributor Author

airwoodix commented Aug 14, 2024

There's no CI environment for LLVM18 (was mentioned in #483 (comment)). Should this be added in a separate PR?

@TheDan64
Copy link
Owner

Yes, separate PR please

@airwoodix airwoodix mentioned this pull request Aug 19, 2024
1 task
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.

Sorry for the delay, looks good

@TheDan64 TheDan64 merged commit 22c0477 into TheDan64:master Sep 19, 2024
18 checks passed
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.

Implement safe API for operand bundles manipulation
2 participants