From 9903c75f82637f0990ef2222c80ee76d0dcb16b5 Mon Sep 17 00:00:00 2001 From: "Oliver Scherer @ Cosmian" <52913081+oli-cosmian@users.noreply.github.com> Date: Tue, 22 Oct 2019 14:53:10 +0200 Subject: [PATCH] Update variable.rs --- cranelift/frontend/src/variable.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cranelift/frontend/src/variable.rs b/cranelift/frontend/src/variable.rs index e96fe7d949..f83c5ad6a3 100644 --- a/cranelift/frontend/src/variable.rs +++ b/cranelift/frontend/src/variable.rs @@ -1,7 +1,12 @@ //! 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 an array containing +//! information about your mutable variables. Thus, when you create a new +//! `Variable` you should make sure that the index is provided by a counter +//! incremented by 1 each time you encounter a new mutable variable. use core::u32; use cranelift_codegen::entity::EntityRef;