mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 11:53:44 +00:00
Pass only the Function to write_clif_file
This commit is contained in:
parent
f3b2d37e77
commit
5f6c59e63f
12
src/base.rs
12
src/base.rs
@ -105,19 +105,19 @@ pub(crate) fn codegen_fn<'tcx>(
|
||||
|
||||
fx.constants_cx.finalize(fx.tcx, &mut *fx.module);
|
||||
|
||||
// Store function in context
|
||||
let context = &mut cx.cached_context;
|
||||
context.func = func;
|
||||
|
||||
crate::pretty_clif::write_clif_file(
|
||||
tcx,
|
||||
"unopt",
|
||||
module.isa(),
|
||||
instance,
|
||||
&context,
|
||||
&func,
|
||||
&clif_comments,
|
||||
);
|
||||
|
||||
// Store function in context
|
||||
let context = &mut cx.cached_context;
|
||||
context.func = func;
|
||||
|
||||
// Verify function
|
||||
verify_func(tcx, &clif_comments, &context.func);
|
||||
|
||||
@ -156,7 +156,7 @@ pub(crate) fn codegen_fn<'tcx>(
|
||||
"opt",
|
||||
module.isa(),
|
||||
instance,
|
||||
&context,
|
||||
&context.func,
|
||||
&clif_comments,
|
||||
);
|
||||
|
||||
|
@ -15,6 +15,6 @@ pub(crate) fn optimize_function<'tcx>(
|
||||
) {
|
||||
// FIXME classify optimizations over opt levels once we have more
|
||||
|
||||
crate::pretty_clif::write_clif_file(tcx, "preopt", isa, instance, &ctx, &*clif_comments);
|
||||
crate::pretty_clif::write_clif_file(tcx, "preopt", isa, instance, &ctx.func, &*clif_comments);
|
||||
crate::base::verify_func(tcx, &*clif_comments, &ctx.func);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ pub(crate) fn write_clif_file<'tcx>(
|
||||
postfix: &str,
|
||||
isa: &dyn cranelift_codegen::isa::TargetIsa,
|
||||
instance: Instance<'tcx>,
|
||||
context: &cranelift_codegen::Context,
|
||||
func: &cranelift_codegen::ir::Function,
|
||||
mut clif_comments: &CommentWriter,
|
||||
) {
|
||||
write_ir_file(
|
||||
@ -245,7 +245,7 @@ pub(crate) fn write_clif_file<'tcx>(
|
||||
cranelift_codegen::write::decorate_function(
|
||||
&mut clif_comments,
|
||||
&mut clif,
|
||||
&context.func,
|
||||
func,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user