diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-04-29 12:00:43 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-04-29 12:00:43 +0000 |
| commit | a8697f95659dae497c30f5ee4b73badd271cf77d (patch) | |
| tree | 0a438b657b7dd8ef2b68629ff16be26fd873a3a0 /compiler/rustc_codegen_cranelift/src/abi/comments.rs | |
| parent | f2299490c11b0c53ece5f6a13dd092fc9c99d264 (diff) | |
| parent | ef07e8e60f994ec014d049a95591426fb92ebb79 (diff) | |
| download | rust-a8697f95659dae497c30f5ee4b73badd271cf77d.tar.gz rust-a8697f95659dae497c30f5ee4b73badd271cf77d.zip | |
Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_clif-2023-04-29
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/abi/comments.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/abi/comments.rs | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/abi/comments.rs b/compiler/rustc_codegen_cranelift/src/abi/comments.rs index abf63e33c35..364503fd363 100644 --- a/compiler/rustc_codegen_cranelift/src/abi/comments.rs +++ b/compiler/rustc_codegen_cranelift/src/abi/comments.rs @@ -6,8 +6,6 @@ use std::borrow::Cow; use rustc_middle::mir; use rustc_target::abi::call::PassMode; -use cranelift_codegen::entity::EntityRef; - use crate::prelude::*; pub(super) fn add_args_header_comment(fx: &mut FunctionCx<'_, '_, '_>) { @@ -91,35 +89,7 @@ pub(super) fn add_local_place_comments<'tcx>( largest_niche: _, } = layout.0.0; - let (kind, extra) = match *place.inner() { - CPlaceInner::Var(place_local, var) => { - assert_eq!(local, place_local); - ("ssa", Cow::Owned(format!(",var={}", var.index()))) - } - CPlaceInner::VarPair(place_local, var1, var2) => { - assert_eq!(local, place_local); - ("ssa", Cow::Owned(format!("var=({}, {})", var1.index(), var2.index()))) - } - CPlaceInner::VarLane(_local, _var, _lane) => unreachable!(), - CPlaceInner::Addr(ptr, meta) => { - let meta = if let Some(meta) = meta { - Cow::Owned(format!("meta={}", meta)) - } else { - Cow::Borrowed("") - }; - match ptr.debug_base_and_offset() { - (crate::pointer::PointerBase::Addr(addr), offset) => { - ("reuse", format!("storage={}{}{}", addr, offset, meta).into()) - } - (crate::pointer::PointerBase::Stack(stack_slot), offset) => { - ("stack", format!("storage={}{}{}", stack_slot, offset, meta).into()) - } - (crate::pointer::PointerBase::Dangling(align), offset) => { - ("zst", format!("align={},offset={}", align.bytes(), offset).into()) - } - } - } - }; + let (kind, extra) = place.debug_comment(); fx.add_global_comment(format!( "{:<5} {:5} {:30} {:4}b {}, {}{}{}", |
