Attribute Macro inkwell_internals::llvm_versions

source ·
#[llvm_versions]
Expand description

This macro can be used to specify version constraints for an enum/struct/union or other item which can be decorated with an attribute.

It takes one argument which is any range of major or major.minor LLVM versions.

To use with enum variants or struct fields, you need to decorate the parent item with the #[llvm_versioned_item] attribute, as this is the hook we need to modify the AST of those items.

§Examples

// Inclusive range from 15 up to and including 18.
#[llvm_versions(15..=18)]

// Exclusive range from 15 up to but not including 18.
#[llvm_versions(15..18)]

// Inclusive range from 15.1 up to and including the latest release.
#[llvm_versions(15.1..)]