Skip to content

Commit

Permalink
cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 14, 2023
1 parent d1ea699 commit a5b81fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub(crate) fn codegen_const_value<'tcx>(
}

match const_val {
ConstValue::ZeroSized => unreachable!(), // we already handles ZST above
ConstValue::ZeroSized => unreachable!(), // we already handled ZST above
ConstValue::Scalar(x) => match x {
Scalar::Int(int) => {
if fx.clif_type(layout.ty).is_some() {
Expand Down Expand Up @@ -200,7 +200,7 @@ pub(crate) fn codegen_const_value<'tcx>(
CValue::by_val(val, layout)
}
},
ConstValue::ByRef { alloc_id, offset } => {
ConstValue::Indirect { alloc_id, offset } => {
let alloc = fx.tcx.global_alloc(alloc_id).unwrap_memory();
// FIXME: avoid creating multiple allocations for the same AllocId?
CValue::by_ref(
Expand Down
2 changes: 1 addition & 1 deletion src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
.expect("simd_shuffle idx not const");

let idx_bytes = match idx_const {
ConstValue::ByRef { alloc_id, offset } => {
ConstValue::Indirect { alloc_id, offset } => {
let alloc = fx.tcx.global_alloc(alloc_id).unwrap_memory();
let size = Size::from_bytes(
4 * ret_lane_count, /* size_of([u32; ret_lane_count]) */
Expand Down

0 comments on commit a5b81fa

Please sign in to comment.