Mark check_return_args as #[cfg(debug_assertions)].

This commit is contained in:
Dan Gohman
2017-11-02 12:28:01 -07:00
parent 1cbf921d9d
commit e21479a843

View File

@@ -122,7 +122,7 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short
// instruction being inserted to add related info to the DFG and the SSA building system, // instruction being inserted to add related info to the DFG and the SSA building system,
// and perform debug sanity checks. // and perform debug sanity checks.
fn build(self, data: InstructionData, ctrl_typevar: Type) -> (Inst, &'short mut DataFlowGraph) { fn build(self, data: InstructionData, ctrl_typevar: Type) -> (Inst, &'short mut DataFlowGraph) {
if data.opcode().is_return() { if cfg!(debug_assertions) && data.opcode().is_return() {
self.builder self.builder
.check_return_args(data.arguments(&self.builder.func.dfg.value_lists)); .check_return_args(data.arguments(&self.builder.func.dfg.value_lists));
} }
@@ -569,6 +569,7 @@ where
); );
} }
#[cfg(debug_assertions)]
fn check_return_args(&self, args: &[Value]) { fn check_return_args(&self, args: &[Value]) {
debug_assert_eq!( debug_assert_eq!(
args.len(), args.len(),