1747ad3c4Slazypassion //! A basic `Variable` implementation. 2747ad3c4Slazypassion //! 3d8fa5dcbSOliver Scherer @ Cosmian //! Frontends can use any indexing scheme they see fit and 4d8fa5dcbSOliver Scherer @ Cosmian //! generate the appropriate `Variable` instances. 59903c75fSOliver Scherer @ Cosmian //! 6e1b0f1f9SOliver Scherer //! Note: The `Variable` is used by Cranelift to index into densely allocated 7e1b0f1f9SOliver Scherer //! arrays containing information about your mutable variables 8e1b0f1f9SOliver Scherer //! Thus, make sure that Variable's indexes are allocated contiguously and 9e1b0f1f9SOliver Scherer //! starting at `0`. 10747ad3c4Slazypassion 11747ad3c4Slazypassion use core::u32; 12*d35c5084SJamey Sharp use cranelift_codegen::entity::entity_impl; 13747ad3c4Slazypassion 1405ace6c0Swackbyte /// An opaque reference to a variable. 15*d35c5084SJamey Sharp #[derive(Copy, Clone, PartialEq, Eq)] 16747ad3c4Slazypassion pub struct Variable(u32); 17747ad3c4Slazypassion 18*d35c5084SJamey Sharp entity_impl!(Variable, "var"); 19