inkwell icon indicating copy to clipboard operation
inkwell copied to clipboard

Implement safe API for operand bundles.

Open airwoodix opened this issue 1 year ago • 2 comments

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 avatar Aug 14 '24 16:08 airwoodix

There's no CI environment for LLVM18 (was mentioned in https://github.com/TheDan64/inkwell/pull/483#issuecomment-2028912400). Should this be added in a separate PR?

airwoodix avatar Aug 14 '24 16:08 airwoodix

Yes, separate PR please

TheDan64 avatar Aug 15 '24 02:08 TheDan64