Log function definition unconditionally
Don't log inside the `.map_err` call, which resulted in only logging function definitions on codegen errors.
This commit is contained in:
committed by
Benjamin Bouvier
parent
689771caf3
commit
fcf0ad1d5d
@@ -547,14 +547,14 @@ where
|
|||||||
func: FuncId,
|
func: FuncId,
|
||||||
ctx: &mut Context,
|
ctx: &mut Context,
|
||||||
) -> ModuleResult<binemit::CodeOffset> {
|
) -> ModuleResult<binemit::CodeOffset> {
|
||||||
let CodeInfo { total_size, .. } = ctx.compile(self.backend.isa()).map_err(|e| {
|
info!(
|
||||||
info!(
|
"defining function {}: {}",
|
||||||
"defining function {}: {}",
|
func,
|
||||||
func,
|
ctx.func.display(self.backend.isa())
|
||||||
ctx.func.display(self.backend.isa())
|
);
|
||||||
);
|
let CodeInfo { total_size, .. } = ctx
|
||||||
ModuleError::Compilation(e)
|
.compile(self.backend.isa())
|
||||||
})?;
|
.map_err(ModuleError::Compilation)?;
|
||||||
let info = &self.contents.functions[func];
|
let info = &self.contents.functions[func];
|
||||||
if info.compiled.is_some() {
|
if info.compiled.is_some() {
|
||||||
return Err(ModuleError::DuplicateDefinition(info.decl.name.clone()));
|
return Err(ModuleError::DuplicateDefinition(info.decl.name.clone()));
|
||||||
|
|||||||
Reference in New Issue
Block a user