From 865c1d3231fd57c648121d961be91793d0bfe690 Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 5 Mar 2023 20:47:28 +0000 Subject: deploy: 1ea7de2ba46b58b4afe3e65b95d8a45160218a5c --- src/juicebox_asm/label.rs.html | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/juicebox_asm/label.rs.html') diff --git a/src/juicebox_asm/label.rs.html b/src/juicebox_asm/label.rs.html index cf7e7ae..aff9f8f 100644 --- a/src/juicebox_asm/label.rs.html +++ b/src/juicebox_asm/label.rs.html @@ -70,7 +70,20 @@ 70 71 72 -
use std::collections::HashSet;
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
//! Definition of the lable type which can be used as jump target and can be bound to a location in
+//! the emitted code.
+
+use std::collections::HashSet;
 
 /// A label which is used as target for jump instructions.
 ///
@@ -107,7 +120,11 @@
         }
     }
 
-    /// Bind the label to the `location`.
+    /// Bind the label to the `location`, can only be bound once.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the lable is already bound.
     pub(crate) fn bind(&mut self, loc: usize) {
         // A label can only be bound once!
         assert!(!self.is_bound());
@@ -120,11 +137,14 @@
         self.offsets.insert(off);
     }
 
-    pub(crate) fn location(&self) -> Option<usize> {
+    /// Get the location of the lable if already bound, `None` else.
+    pub(crate) fn location(&self) -> Option<usize> {
         self.location
     }
 
-    pub(crate) fn offsets_mut(&mut self) -> &mut HashSet<usize> {
+    /// Get the offsets which refer to the label. These are used to patch the jump instructions to
+    /// the label location.
+    pub(crate) fn offsets_mut(&mut self) -> &mut HashSet<usize> {
         &mut self.offsets
     }
 
-- 
cgit v1.2.3