Remove CPlaceInner::Stack
This commit is contained in:
parent
3d363d54fd
commit
ad72afaad3
4 changed files with 5 additions and 26 deletions
|
@ -75,17 +75,6 @@ pub fn add_local_place_comments<'tcx>(
|
||||||
align.pref.bytes(),
|
align.pref.bytes(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
CPlaceInner::Stack(stack_slot) => fx.add_entity_comment(
|
|
||||||
stack_slot,
|
|
||||||
format!(
|
|
||||||
"{:?}: {:?} size={} align={},{}",
|
|
||||||
local,
|
|
||||||
ty,
|
|
||||||
size.bytes(),
|
|
||||||
align.abi.bytes(),
|
|
||||||
align.pref.bytes(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
CPlaceInner::NoPlace => fx.add_global_comment(format!(
|
CPlaceInner::NoPlace => fx.add_global_comment(format!(
|
||||||
"zst {:5} {:20} {:4}b {}, {}",
|
"zst {:5} {:20} {:4}b {}, {}",
|
||||||
format!("{:?}", local),
|
format!("{:?}", local),
|
||||||
|
|
|
@ -345,9 +345,9 @@ fn place_location<'a, 'tcx>(
|
||||||
// FIXME implement this (used by arguments and returns)
|
// FIXME implement this (used by arguments and returns)
|
||||||
|
|
||||||
AttributeValue::Exprloc(Expression(vec![]))
|
AttributeValue::Exprloc(Expression(vec![]))
|
||||||
}
|
|
||||||
CPlaceInner::Stack(stack_slot) => {
|
// For PointerBase::Stack:
|
||||||
AttributeValue::Exprloc(Expression(translate_loc(ValueLoc::Stack(*stack_slot), &context.func.stack_slots).unwrap()))
|
//AttributeValue::Exprloc(Expression(translate_loc(ValueLoc::Stack(*stack_slot), &context.func.stack_slots).unwrap()))
|
||||||
}
|
}
|
||||||
CPlaceInner::NoPlace => AttributeValue::Exprloc(Expression(vec![])),
|
CPlaceInner::NoPlace => AttributeValue::Exprloc(Expression(vec![])),
|
||||||
}
|
}
|
||||||
|
|
|
@ -669,7 +669,7 @@ pub fn codegen_intrinsic_call<'tcx>(
|
||||||
fx.bcx.set_val_label(val, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32()));
|
fx.bcx.set_val_label(val, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32()));
|
||||||
fx.bcx.def_var(mir_var(var), val);
|
fx.bcx.def_var(mir_var(var), val);
|
||||||
}
|
}
|
||||||
CPlaceInner::Addr(_, _) | CPlaceInner::Stack(_) => {
|
CPlaceInner::Addr(_, _) => {
|
||||||
// Don't write to `ret`, as the destination memory is already uninitialized.
|
// Don't write to `ret`, as the destination memory is already uninitialized.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,6 @@ pub struct CPlace<'tcx> {
|
||||||
pub enum CPlaceInner {
|
pub enum CPlaceInner {
|
||||||
Var(Local),
|
Var(Local),
|
||||||
Addr(Pointer, Option<Value>),
|
Addr(Pointer, Option<Value>),
|
||||||
Stack(StackSlot),
|
|
||||||
NoPlace,
|
NoPlace,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +271,7 @@ impl<'tcx> CPlace<'tcx> {
|
||||||
offset: None,
|
offset: None,
|
||||||
});
|
});
|
||||||
CPlace {
|
CPlace {
|
||||||
inner: CPlaceInner::Stack(stack_slot),
|
inner: CPlaceInner::Addr(Pointer::stack_slot(stack_slot), None),
|
||||||
layout,
|
layout,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,10 +315,6 @@ impl<'tcx> CPlace<'tcx> {
|
||||||
assert!(extra.is_none(), "unsized values are not yet supported");
|
assert!(extra.is_none(), "unsized values are not yet supported");
|
||||||
CValue::by_ref(ptr, layout)
|
CValue::by_ref(ptr, layout)
|
||||||
}
|
}
|
||||||
CPlaceInner::Stack(stack_slot) => CValue::by_ref(
|
|
||||||
Pointer::stack_slot(stack_slot),
|
|
||||||
layout,
|
|
||||||
),
|
|
||||||
CPlaceInner::NoPlace => CValue::by_ref(
|
CPlaceInner::NoPlace => CValue::by_ref(
|
||||||
Pointer::const_addr(fx, i64::try_from(self.layout.align.pref.bytes()).unwrap()),
|
Pointer::const_addr(fx, i64::try_from(self.layout.align.pref.bytes()).unwrap()),
|
||||||
layout,
|
layout,
|
||||||
|
@ -340,10 +335,6 @@ impl<'tcx> CPlace<'tcx> {
|
||||||
) -> (Pointer, Option<Value>) {
|
) -> (Pointer, Option<Value>) {
|
||||||
match self.inner {
|
match self.inner {
|
||||||
CPlaceInner::Addr(ptr, extra) => (ptr, extra),
|
CPlaceInner::Addr(ptr, extra) => (ptr, extra),
|
||||||
CPlaceInner::Stack(stack_slot) => (
|
|
||||||
Pointer::stack_slot(stack_slot),
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
CPlaceInner::NoPlace => {
|
CPlaceInner::NoPlace => {
|
||||||
(
|
(
|
||||||
Pointer::const_addr(fx, i64::try_from(self.layout.align.pref.bytes()).unwrap()),
|
Pointer::const_addr(fx, i64::try_from(self.layout.align.pref.bytes()).unwrap()),
|
||||||
|
@ -431,7 +422,6 @@ impl<'tcx> CPlace<'tcx> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CPlaceInner::Addr(ptr, None) => ptr,
|
CPlaceInner::Addr(ptr, None) => ptr,
|
||||||
CPlaceInner::Stack(stack_slot) => Pointer::stack_slot(stack_slot),
|
|
||||||
CPlaceInner::NoPlace => {
|
CPlaceInner::NoPlace => {
|
||||||
if dst_layout.abi != Abi::Uninhabited {
|
if dst_layout.abi != Abi::Uninhabited {
|
||||||
assert_eq!(dst_layout.size.bytes(), 0, "{:?}", dst_layout);
|
assert_eq!(dst_layout.size.bytes(), 0, "{:?}", dst_layout);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue