Skip to content

Commit f890e42

Browse files
revert change
1 parent 5f44530 commit f890e42

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/compiler.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,20 @@ fn compile_func(
527527
0,
528528
);
529529

530+
#[cfg(feature = "with-debug-utils")]
531+
{
532+
// If this env var exists and is a valid statement, insert a debug trap before the libfunc call.
533+
// Only on when using with-debug-utils feature.
534+
if let Ok(x) = std::env::var("NATIVE_DEBUG_TRAP_AT_STMT") {
535+
if x.eq_ignore_ascii_case(&statement_idx.0.to_string()) {
536+
block.append_operation(
537+
melior::dialect::ods::llvm::intr_debugtrap(context, location)
538+
.into(),
539+
);
540+
}
541+
}
542+
}
543+
530544
let libfunc_name = if invocation.libfunc_id.debug_name.is_some() {
531545
format!("{}(stmt_idx={})", invocation.libfunc_id, statement_idx)
532546
} else {

0 commit comments

Comments
 (0)