#[non_exhaustive]pub struct MapCtx<'ctx> {
pub version: u64,
pub datalayout: &'ctx DataLayout,
pub section_table: &'ctx [String],
pub gc_table: &'ctx [String],
pub strtab: &'ctx Strtab,
pub attribute_groups: &'ctx AttributeGroups,
pub attributes: &'ctx Attributes,
pub type_table: &'ctx TypeTable,
pub comdats: &'ctx [Comdat],
}
Expand description
A handle for various bits of state that are necessary for correct block and record mapping in the context of a particular IR module.
Block and record mapping operations are expected to update the supplied context, as appropriate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.version: u64
The MODULE_CODE_VERSION
for the IR module being mapped.
datalayout: &'ctx DataLayout
The datalayout specification.
section_table: &'ctx [String]
The section table.
gc_table: &'ctx [String]
The GC table.
strtab: &'ctx Strtab
The string table.
attribute_groups: &'ctx AttributeGroups
Any attribute groups.
attributes: &'ctx Attributes
Any raw attributes.
type_table: &'ctx TypeTable
The type table.
comdats: &'ctx [Comdat]
The COMDAT list.
Implementations§
Source§impl MapCtx<'_>
impl MapCtx<'_>
Sourcepub fn use_strtab(&self) -> bool
pub fn use_strtab(&self) -> bool
A helper function for whether or not to use an associated string table for string lookups.
This corresponds to MODULE_CODE_VERSION
s of 2 and higher.
Sourcepub fn use_relative_ids(&self) -> bool
pub fn use_relative_ids(&self) -> bool
A helper function for determining how operands are encoded.
This corresponds to MODULE_CODE_VERSION
s of 1 and higher.
Trait Implementations§
Auto Trait Implementations§
impl<'ctx> Freeze for MapCtx<'ctx>
impl<'ctx> RefUnwindSafe for MapCtx<'ctx>
impl<'ctx> Send for MapCtx<'ctx>
impl<'ctx> Sync for MapCtx<'ctx>
impl<'ctx> Unpin for MapCtx<'ctx>
impl<'ctx> UnwindSafe for MapCtx<'ctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more