pub struct Module {Show 17 fields
pub types: Vec<Type>,
pub values: Vec<Value>,
pub value_types: Vec<TypeId>,
pub names: Vec<(ValueId, String)>,
pub triple: Option<String>,
pub datalayout: Option<String>,
pub asm: Option<String>,
pub metadata: Vec<Metadata>,
pub metadata_at: Vec<usize>,
pub named_metadata: Vec<(String, Vec<MetadataId>)>,
pub named_metadata_at: Vec<usize>,
pub at: usize,
pub functions: Vec<Function>,
pub precise_kind: Option<u64>,
pub kinds: Vec<(u64, String)>,
pub attribute_groups: Vec<AttributeGroup>,
pub attribute_lists: Vec<Vec<u64>>,
}Expand description
A module: its types, values, metadata and function bodies.
Fields§
§types: Vec<Type>The type table.
values: Vec<Value>The module’s values by id (globals, functions, module constants); a function body’s own values continue the
numbering in its Function.
value_types: Vec<TypeId>Each value’s type.
names: Vec<(ValueId, String)>The module’s symbol table: the names of the module values that have one (a function body’s own are in its
Function::names).
triple: Option<String>The target triple (dxil-ms-dx), where the module states one.
datalayout: Option<String>The data layout, where the module states one.
asm: Option<String>The module’s inline assembly, where it has any.
metadata: Vec<Metadata>The metadata records, by MetadataId.
metadata_at: Vec<usize>The bit of the bitcode each metadata record (by id) starts at, for the locations of reflection errors.
named_metadata: Vec<(String, Vec<MetadataId>)>The named metadata (dx.entryPoints, …): the name and the records it lists.
named_metadata_at: Vec<usize>The bit each named metadata record (by index in named_metadata) starts at.
at: usizeThe bit of the bitcode the module block starts at: where a record the module lacks would be.
functions: Vec<Function>The function bodies, in the order of their definitions.
precise_kind: Option<u64>The id of the module’s dx.precise metadata kind (the kind Instruction::precise reads), where it names one.
kinds: Vec<(u64, String)>The module’s metadata kinds: each id and its name, in the order stored.
attribute_groups: Vec<AttributeGroup>The attribute groups, in the order stored.
attribute_lists: Vec<Vec<u64>>The attribute lists, in the order stored: the ids of the groups each lists. A function value’s attributes is an
index into this.
Implementations§
Source§impl Module
impl Module
Sourcepub fn name(&self, value: ValueId) -> Option<&str>
pub fn name(&self, value: ValueId) -> Option<&str>
The module’s name for a value, where its symbol table has one.
Sourcepub fn kind_name(&self, kind: u64) -> Option<&str>
pub fn kind_name(&self, kind: u64) -> Option<&str>
The name of a metadata kind id, where the module names it.
Sourcepub fn attachment(
&self,
attachments: &[Attachment],
name: &str,
) -> Option<MetadataId>
pub fn attachment( &self, attachments: &[Attachment], name: &str, ) -> Option<MetadataId>
The node of the attachment among attachments whose kind is called name.
Sourcepub fn function_attributes(&self, function: ValueId) -> Vec<&Attribute>
pub fn function_attributes(&self, function: ValueId) -> Vec<&Attribute>
The attributes a function value carries on itself (the groups of its list whose slot is FUNCTION_SLOT); none
for a value that is not a function or names no list.