llvm_lib::core::context

Struct MetadataKindId

source
pub struct MetadataKindId(pub u32);
Expand description

Wrapper for MetadataKindId

Tuple Fields§

§0: u32

Implementations§

source§

impl MetadataKindId

source

pub fn get_md_kind_id_in_context(context: &ContextRef, name: &str) -> Self

Get MetadataKindId by name in current Context. Useful for working with Metadata.

§Details

Retrieves the metadata kind ID associated with a given name within a specific LLVM context.

This function wraps the LLVMGetMDKindIDInContext function from the LLVM core library. It returns the metadata kind ID corresponding to the provided name within the specified LLVM context. Metadata kinds in LLVM IR are used to attach additional information to various IR constructs, such as instructions or functions. Using this function allows for context-specific retrieval of metadata kind IDs.

§Parameters
  • context: A reference to the ContextRef in which the metadata kind ID will be retrieved.
  • name: A string slice (&str) representing the name of the metadata kind.
§Returns

Returns a MetadataKindId representing the ID associated with the provided metadata kind name within the specified context.

source

pub fn get_md_kind_id(name: &str) -> Self

Get Metadata KindId by name. Useful for working with Metadata.

§Details

Retrieves the metadata kind ID associated with a given name.

This function wraps the LLVMGetMDKindID function from the LLVM core library. It returns the metadata kind ID corresponding to the provided name. Metadata kinds in LLVM IR are used to attach additional information to various IR constructs, such as instructions or functions.

§Parameters
  • name: A string slice (&str) representing the name of the metadata kind.
§Returns

Returns a MetadataKindId representing the ID associated with the provided metadata kind name.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.