1
Fork 0

use AllocId instead of Allocation in ConstValue::ByRef

This commit is contained in:
Ralf Jung 2023-09-11 20:01:48 +02:00
parent c728bf3963
commit 551f481ffb
15 changed files with 80 additions and 63 deletions

View file

@ -116,7 +116,9 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
let b_llval = bx.const_usize((end - start) as u64);
OperandValue::Pair(a_llval, b_llval)
}
ConstValue::ByRef { alloc, offset } => {
ConstValue::ByRef { alloc_id, offset } => {
let alloc = bx.tcx().global_alloc(alloc_id).unwrap_memory();
// FIXME: should we attempt to avoid building the same AllocId multiple times?
return Self::from_const_alloc(bx, layout, alloc, offset);
}
};