Skip to content

Commit

Permalink
add missing comment
Browse files Browse the repository at this point in the history
Signed-off-by: xermicus <cyrill@parity.io>
  • Loading branch information
xermicus committed Nov 21, 2024
1 parent 4bc5303 commit 152b742
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/llvm-context/src/polkavm/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ where
let Some(debug_info) = self.debug_info() else {
anyhow::bail!("expected debug-info builders");
};

let builder = debug_info.builder();
let file = debug_info.compilation_unit().get_file();
let scope = file.as_debug_info_scope();
Expand All @@ -544,6 +543,11 @@ where
))
}

/// Set the debug info location.
///
/// No-op if the emitting debug info is disabled.
///
/// If `scope` is `None` the top scope will be used.
pub fn set_debug_location(
&self,
line: u32,
Expand All @@ -553,7 +557,6 @@ where
let Some(debug_info) = self.debug_info() else {
return Ok(());
};

let scope = match scope {
Some(scp) => scp,
None => debug_info.top_scope().expect("expected a debug-info scope"),
Expand All @@ -562,6 +565,7 @@ where
debug_info
.builder()
.create_debug_location(self.llvm(), line, column, scope, None);

self.builder().set_current_debug_location(location);

Ok(())
Expand Down

0 comments on commit 152b742

Please sign in to comment.