Replace instance param of write_clif_file with symbol_name

This commit is contained in:
bjorn3 2022-08-17 13:07:18 +00:00
parent 701b2747c3
commit b181f2b376
2 changed files with 5 additions and 5 deletions

View File

@ -119,9 +119,9 @@ fn codegen_fn<'tcx>(
crate::pretty_clif::write_clif_file(
tcx,
symbol_name.name,
"unopt",
module.isa(),
instance,
&func,
&clif_comments,
);
@ -201,9 +201,9 @@ fn compile_fn<'tcx>(
// Write optimized function to file for debugging
crate::pretty_clif::write_clif_file(
tcx,
codegened_func.symbol_name.name,
"opt",
module.isa(),
codegened_func.instance,
&context.func,
&clif_comments,
);
@ -211,7 +211,7 @@ fn compile_fn<'tcx>(
if let Some(disasm) = &context.mach_compile_result.as_ref().unwrap().disasm {
crate::pretty_clif::write_ir_file(
tcx,
|| format!("{}.vcode", tcx.symbol_name(codegened_func.instance).name),
|| format!("{}.vcode", codegened_func.symbol_name.name),
|file| file.write_all(disasm.as_bytes()),
)
}

View File

@ -231,16 +231,16 @@ pub(crate) fn write_ir_file(
pub(crate) fn write_clif_file<'tcx>(
tcx: TyCtxt<'tcx>,
symbol_name: &str,
postfix: &str,
isa: &dyn cranelift_codegen::isa::TargetIsa,
instance: Instance<'tcx>,
func: &cranelift_codegen::ir::Function,
mut clif_comments: &CommentWriter,
) {
// FIXME work around filename too long errors
write_ir_file(
tcx,
|| format!("{}.{}.clif", tcx.symbol_name(instance).name, postfix),
|| format!("{}.{}.clif", symbol_name, postfix),
|file| {
let mut clif = String::new();
cranelift_codegen::write::decorate_function(&mut clif_comments, &mut clif, func)