pub struct CraneliftDebugInfo {
pub source_file: Option<String>,
pub source_function: Option<String>,
pub location_map: Vec<(usize, u32, u32)>,
pub var_names: HashMap<String, String>,
}Expand description
Debug information attached to a Cranelift function.
Fields§
§source_file: Option<String>Source file name.
source_function: Option<String>Source function name (may differ from IR name).
location_map: Vec<(usize, u32, u32)>Mapping from instruction offset to (line, column) in source.
var_names: HashMap<String, String>Local variable names: (ir_value, source_name).
Implementations§
Source§impl CraneliftDebugInfo
impl CraneliftDebugInfo
Sourcepub fn new(
source_file: impl Into<String>,
source_function: impl Into<String>,
) -> Self
pub fn new( source_file: impl Into<String>, source_function: impl Into<String>, ) -> Self
Create a new debug info record.
Sourcepub fn add_location(&mut self, offset: usize, line: u32, column: u32)
pub fn add_location(&mut self, offset: usize, line: u32, column: u32)
Record a source location for an instruction.
Sourcepub fn add_var_name(
&mut self,
ir_name: impl Into<String>,
source_name: impl Into<String>,
)
pub fn add_var_name( &mut self, ir_name: impl Into<String>, source_name: impl Into<String>, )
Record a variable name mapping.
Sourcepub fn emit_comments(&self) -> String
pub fn emit_comments(&self) -> String
Emit debug info as comments.
Trait Implementations§
Source§impl Clone for CraneliftDebugInfo
impl Clone for CraneliftDebugInfo
Source§fn clone(&self) -> CraneliftDebugInfo
fn clone(&self) -> CraneliftDebugInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CraneliftDebugInfo
impl Debug for CraneliftDebugInfo
Source§impl Default for CraneliftDebugInfo
impl Default for CraneliftDebugInfo
Source§fn default() -> CraneliftDebugInfo
fn default() -> CraneliftDebugInfo
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CraneliftDebugInfo
impl RefUnwindSafe for CraneliftDebugInfo
impl Send for CraneliftDebugInfo
impl Sync for CraneliftDebugInfo
impl Unpin for CraneliftDebugInfo
impl UnsafeUnpin for CraneliftDebugInfo
impl UnwindSafe for CraneliftDebugInfo
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