Sha256: ad628b3c6de9a8c008dc31f869bf9d853f2dd3b590dc4e2e3c6da70ba6bf7adf

Contents?: true

Size: 796 Bytes

Versions: 30

Compression:

Stored size: 796 Bytes

Contents

//! A basic `Variable` implementation.
//!
//! Frontends can use any indexing scheme they see fit and
//! generate the appropriate `Variable` instances.
//!
//! Note: The `Variable` is used by Cranelift to index into densely allocated
//! arrays containing information about your mutable variables
//! Thus, make sure that Variable's indexes are allocated contiguously and
//! starting at `0`.

use core::u32;
use cranelift_codegen::entity::entity_impl;

/// An opaque reference to a variable.
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Variable(u32);

entity_impl!(Variable, "var");

impl Variable {
    /// Create a new Variable with the given index.
    #[deprecated = "Use Variable::from_u32 instead"]
    pub fn with_u32(index: u32) -> Self {
        Variable::from_u32(index)
    }
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
wasmtime-23.0.2 ./ext/cargo-vendor/cranelift-frontend-0.110.2/src/variable.rs
wasmtime-22.0.0 ./ext/cargo-vendor/cranelift-frontend-0.109.0/src/variable.rs
wasmtime-21.0.1 ./ext/cargo-vendor/cranelift-frontend-0.108.1/src/variable.rs
wasmtime-20.0.2 ./ext/cargo-vendor/cranelift-frontend-0.107.2/src/variable.rs
wasmtime-20.0.0 ./ext/cargo-vendor/cranelift-frontend-0.107.2/src/variable.rs
wasmtime-18.0.3 ./ext/cargo-vendor/cranelift-frontend-0.105.3/src/variable.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cranelift-frontend-0.104.1/src/variable.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cranelift-frontend-0.104.0/src/variable.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cranelift-frontend-0.103.0/src/variable.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cranelift-frontend-0.102.1/src/variable.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cranelift-frontend-0.102.1/src/variable.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cranelift-frontend-0.101.4/src/variable.rs
wasmtime-14.0.3 ./ext/cargo-vendor/cranelift-frontend-0.101.4/src/variable.rs
wasmtime-14.0.1 ./ext/cargo-vendor/cranelift-frontend-0.101.1/src/variable.rs
wasmtime-14.0.0 ./ext/cargo-vendor/cranelift-frontend-0.101.1/src/variable.rs
wasmtime-13.0.0 ./ext/cargo-vendor/cranelift-frontend-0.100.0/src/variable.rs
wasmtime-12.0.1 ./ext/cargo-vendor/cranelift-frontend-0.99.1/src/variable.rs
wasmtime-12.0.0 ./ext/cargo-vendor/cranelift-frontend-0.99.1/src/variable.rs
wasmtime-11.0.0 ./ext/cargo-vendor/cranelift-frontend-0.98.1/src/variable.rs
wasmtime-10.0.1 ./ext/cargo-vendor/cranelift-frontend-0.97.1/src/variable.rs