|
| 1 | +use std::borrow::Cow; |
1 | 2 | use cranelift_module::*;
|
2 | 3 | use crate::prelude::*;
|
3 | 4 | use crate::rustc::mir::interpret::{
|
@@ -225,7 +226,7 @@ fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
225 | 226 |
|
226 | 227 | data_ctx.define(alloc.bytes.to_vec().into_boxed_slice());
|
227 | 228 |
|
228 |
| - for &(offset, reloc) in alloc.relocations.iter() { |
| 229 | + for &(offset, (_tag, reloc)) in alloc.relocations.iter() { |
229 | 230 | let reloc_offset = {
|
230 | 231 | let endianness = tcx.data_layout.endian;
|
231 | 232 | let offset = offset.bytes() as usize;
|
@@ -279,7 +280,9 @@ struct TransPlaceInterpreter;
|
279 | 280 | impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
280 | 281 | type MemoryData = ();
|
281 | 282 | type MemoryKinds = ();
|
282 |
| - const MUT_STATIC_KIND: Option<()> = None; |
| 283 | + type MemoryMap = FxHashMap<AllocId, (MemoryKind<()>, Allocation<()>)>; |
| 284 | + type PointerTag = (); |
| 285 | + const STATIC_KIND: Option<()> = None; |
283 | 286 | const ENFORCE_VALIDITY: bool = true;
|
284 | 287 |
|
285 | 288 | fn before_terminator(_: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx> {
|
@@ -308,10 +311,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
308 | 311 | fn find_foreign_static(
|
309 | 312 | _: crate::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>,
|
310 | 313 | _: DefId,
|
311 |
| - ) -> EvalResult<'tcx, &'tcx Allocation> { |
| 314 | + ) -> EvalResult<'tcx, Cow<'tcx, Allocation>> { |
312 | 315 | panic!();
|
313 | 316 | }
|
314 | 317 |
|
| 318 | + fn static_with_default_tag(alloc: &Allocation) -> Cow<Allocation<()>> { |
| 319 | + Cow::Borrowed(alloc) |
| 320 | + } |
| 321 | + |
315 | 322 | fn ptr_op(
|
316 | 323 | _: &EvalContext<'a, 'mir, 'tcx, Self>,
|
317 | 324 | _: mir::BinOp,
|
|
0 commit comments