Skip to content

Commit 1028fbb

Browse files
committed
Fix release builds
1 parent b62e892 commit 1028fbb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/abi.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> {
274274
.module
275275
.declare_func_in_func(func_id, &mut self.bcx.func);
276276
let call_inst = self.bcx.ins().call(func_ref, args);
277-
self.add_comment(call_inst, format!("easy_call {}", name));
277+
#[cfg(debug_assertions)] {
278+
self.add_comment(call_inst, format!("easy_call {}", name));
279+
}
278280
let results = self.bcx.inst_results(call_inst);
279281
assert!(results.len() <= 2, "{}", results.len());
280282
results

src/trap.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms
77
returns: vec![],
88
}).unwrap();
99
let puts = fx.module.declare_func_in_func(puts, &mut fx.bcx.func);
10-
fx.add_entity_comment(puts, "puts");
10+
#[cfg(debug_assertions)] {
11+
fx.add_entity_comment(puts, "puts");
12+
}
1113

1214
let symbol_name = fx.tcx.symbol_name(fx.instance);
1315
let real_msg = format!("trap at {:?} ({}): {}\0", fx.instance, symbol_name, msg);
@@ -19,7 +21,9 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms
1921
let _ = fx.module.define_data(msg_id, &data_ctx);
2022

2123
let local_msg_id = fx.module.declare_data_in_func(msg_id, fx.bcx.func);
22-
fx.add_entity_comment(local_msg_id, msg);
24+
#[cfg(debug_assertions)] {
25+
fx.add_entity_comment(local_msg_id, msg);
26+
}
2327
let msg_ptr = fx.bcx.ins().global_value(pointer_ty(fx.tcx), local_msg_id);
2428
fx.bcx.ins().call(puts, &[msg_ptr]);
2529
}

0 commit comments

Comments
 (0)