diff --git a/lib/codegen/src/write.rs b/lib/codegen/src/write.rs index 4a70574caa..6629f0f3be 100644 --- a/lib/codegen/src/write.rs +++ b/lib/codegen/src/write.rs @@ -41,6 +41,16 @@ pub trait FuncWriter { w: &mut Write, func: &Function, regs: Option<&RegInfo>, + ) -> Result { + self.super_preamble(w, func, regs) + } + + /// Default impl of `write_preamble` + fn super_preamble( + &mut self, + w: &mut Write, + func: &Function, + regs: Option<&RegInfo>, ) -> Result { let mut any = false; @@ -91,13 +101,24 @@ pub trait FuncWriter { } /// Write an entity definition defined in the preamble to `w`. - #[allow(unused_variables)] fn write_entity_definition( &mut self, w: &mut Write, func: &Function, entity: AnyEntity, value: &fmt::Display, + ) -> fmt::Result { + self.super_entity_definition(w, func, entity, value) + } + + /// Default impl of `write_entity_definition` + #[allow(unused_variables)] + fn super_entity_definition( + &mut self, + w: &mut Write, + func: &Function, + entity: AnyEntity, + value: &fmt::Display, ) -> fmt::Result { writeln!(w, " {} = {}", entity, value) }