Struct cranelift_codegen::ir::dynamic_type::DynamicTypeData
source · pub struct DynamicTypeData {
pub base_vector_ty: Type,
pub dynamic_scale: GlobalValue,
}Expand description
A dynamic type object which has a base vector type and a scaling factor.
Fields§
§base_vector_ty: TypeBase vector type, this is the minimum size of the type.
dynamic_scale: GlobalValueThe dynamic scaling factor of the base vector type.
Implementations§
source§impl DynamicTypeData
impl DynamicTypeData
sourcepub fn new(base_vector_ty: Type, dynamic_scale: GlobalValue) -> Self
pub fn new(base_vector_ty: Type, dynamic_scale: GlobalValue) -> Self
Create a new dynamic type.
sourcepub fn concrete(&self) -> Option<Type>
pub fn concrete(&self) -> Option<Type>
Convert ‘base_vector_ty’ into a concrete dynamic vector type.
Examples found in repository?
More examples
src/ir/dfg.rs (line 1164)
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
pub fn check_dynamic_type(&mut self, ty: Type) -> Option<Type> {
debug_assert!(ty.is_dynamic_vector());
if self
.dynamic_types
.values()
.any(|dyn_ty_data| dyn_ty_data.concrete().unwrap() == ty)
{
Some(ty)
} else {
None
}
}Trait Implementations§
source§impl Clone for DynamicTypeData
impl Clone for DynamicTypeData
source§fn clone(&self) -> DynamicTypeData
fn clone(&self) -> DynamicTypeData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Hash for DynamicTypeData
impl Hash for DynamicTypeData
source§impl PartialEq<DynamicTypeData> for DynamicTypeData
impl PartialEq<DynamicTypeData> for DynamicTypeData
source§fn eq(&self, other: &DynamicTypeData) -> bool
fn eq(&self, other: &DynamicTypeData) -> bool
This method tests for
self and other values to be equal, and is used
by ==.