Struct cranelift_codegen_meta::cdsl::typevar::TypeVar
source · pub(crate) struct TypeVar {
content: Rc<RefCell<TypeVarContent>>,
}
Fields§
§content: Rc<RefCell<TypeVarContent>>
Implementations§
source§impl TypeVar
impl TypeVar
pub fn new( name: impl Into<String>, doc: impl Into<String>, type_set: TypeSet ) -> Self
pub fn new_singleton(value_type: ValueType) -> Self
sourcepub fn copy_from(other: &TypeVar, name: String) -> TypeVar
pub fn copy_from(other: &TypeVar, name: String) -> TypeVar
Get a fresh copy of self, named after name
. Can only be called on non-derived typevars.
sourcepub fn get_typeset(&self) -> TypeSet
pub fn get_typeset(&self) -> TypeSet
Returns the typeset for this TV. If the TV is derived, computes it recursively from the derived function and the base’s typeset. Note this can’t be done non-lazily in the constructor, because the TypeSet of the base may change over time.
sourcepub fn get_raw_typeset(&self) -> &TypeSet
pub fn get_raw_typeset(&self) -> &TypeSet
Returns this typevar’s type set, assuming this type var has no parent.
sourcepub fn singleton_type(&self) -> Option<ValueType>
pub fn singleton_type(&self) -> Option<ValueType>
If the associated typeset has a single type return it. Otherwise return None.
sourcepub fn free_typevar(&self) -> Option<TypeVar>
pub fn free_typevar(&self) -> Option<TypeVar>
Get the free type variable controlling this one.
sourcepub fn derived(&self, derived_func: DerivedFunc) -> TypeVar
pub fn derived(&self, derived_func: DerivedFunc) -> TypeVar
Create a type variable that is a function of another.
pub fn lane_of(&self) -> TypeVar
pub fn as_truthy(&self) -> TypeVar
pub fn half_width(&self) -> TypeVar
pub fn double_width(&self) -> TypeVar
pub fn split_lanes(&self) -> TypeVar
pub fn merge_lanes(&self) -> TypeVar
pub fn dynamic_to_vector(&self) -> TypeVar
Trait Implementations§
source§impl From<&TypeVar> for OperandKind
impl From<&TypeVar> for OperandKind
source§impl PartialEq for TypeVar
impl PartialEq for TypeVar
impl Eq for TypeVar
Auto Trait Implementations§
impl Freeze for TypeVar
impl !RefUnwindSafe for TypeVar
impl !Send for TypeVar
impl !Sync for TypeVar
impl Unpin for TypeVar
impl !UnwindSafe for TypeVar
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