diff options
| author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2024-03-16 11:11:53 -0400 |
|---|---|---|
| committer | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2024-03-16 11:11:53 -0400 |
| commit | a7d4258e00543a9a62fcfabbed4f27121f8f48ce (patch) | |
| tree | 4d63b0abc75149e7575f25368f394393c6b7c91f /compiler/rustc_codegen_ssa | |
| parent | 129b5e48f029779c57b46c72add9db03678d7cb5 (diff) | |
| download | rust-a7d4258e00543a9a62fcfabbed4f27121f8f48ce.tar.gz rust-a7d4258e00543a9a62fcfabbed4f27121f8f48ce.zip | |
revert changes and just delete the fixme
Avoiding the naming didn't have any meaningful perf impact.
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/block.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/builder.rs | 10 |
2 files changed, 6 insertions, 15 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index 3db6bc5b426..02e7bb05b77 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -83,11 +83,8 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> { // Cross-funclet jump - need a trampoline debug_assert!(base::wants_new_eh_instructions(fx.cx.tcx().sess)); debug!("llbb_with_cleanup: creating cleanup trampoline for {:?}", target); - let trampoline_llbb = Bx::append_block( - fx.cx, - fx.llfn, - format_args!("{:?}_cleanup_trampoline_{:?}", self.bb, target), - ); + let name = &format!("{:?}_cleanup_trampoline_{:?}", self.bb, target); + let trampoline_llbb = Bx::append_block(fx.cx, fx.llfn, name); let mut trampoline_bx = Bx::build(fx.cx, trampoline_llbb); trampoline_bx.cleanup_ret(self.funclet(fx).unwrap(), Some(lltarget)); trampoline_llbb @@ -1568,7 +1565,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { fn landing_pad_for_uncached(&mut self, bb: mir::BasicBlock) -> Bx::BasicBlock { let llbb = self.llbb(bb); if base::wants_new_eh_instructions(self.cx.sess()) { - let cleanup_bb = Bx::append_block(self.cx, self.llfn, format_args!("funclet_{bb:?}")); + let cleanup_bb = Bx::append_block(self.cx, self.llfn, &format!("funclet_{bb:?}")); let mut cleanup_bx = Bx::build(self.cx, cleanup_bb); let funclet = cleanup_bx.cleanup_pad(None, &[]); cleanup_bx.br(llbb); @@ -1691,7 +1688,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { pub fn try_llbb(&mut self, bb: mir::BasicBlock) -> Option<Bx::BasicBlock> { match self.cached_llbbs[bb] { CachedLlbb::None => { - let llbb = Bx::append_block(self.cx, self.llfn, format_args!("{bb:?}")); + let llbb = Bx::append_block(self.cx, self.llfn, &format!("{bb:?}")); self.cached_llbbs[bb] = CachedLlbb::Some(llbb); Some(llbb) } diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs index 49c3101bc5e..36f37e3791b 100644 --- a/compiler/rustc_codegen_ssa/src/traits/builder.rs +++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs @@ -22,8 +22,6 @@ use rustc_target::abi::call::FnAbi; use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange}; use rustc_target::spec::HasTargetSpec; -use std::fmt::Display; - #[derive(Copy, Clone)] pub enum OverflowOp { Add, @@ -51,13 +49,9 @@ pub trait BuilderMethods<'a, 'tcx>: fn set_span(&mut self, span: Span); // FIXME(eddyb) replace uses of this with `append_sibling_block`. - fn append_block( - cx: &'a Self::CodegenCx, - llfn: Self::Function, - name: impl Display, - ) -> Self::BasicBlock; + fn append_block(cx: &'a Self::CodegenCx, llfn: Self::Function, name: &str) -> Self::BasicBlock; - fn append_sibling_block(&mut self, name: impl Display) -> Self::BasicBlock; + fn append_sibling_block(&mut self, name: &str) -> Self::BasicBlock; fn switch_to_block(&mut self, llbb: Self::BasicBlock); |
