|
1 | 1 | use std::borrow::Cow;
|
2 | 2 |
|
3 | 3 | use rustc::mir::interpret::{
|
4 |
| - read_target_uint, AllocId, AllocKind, Allocation, ConstValue, EvalResult, GlobalId, Scalar, |
| 4 | + read_target_uint, AllocId, GlobalAlloc, Allocation, ConstValue, EvalResult, GlobalId, Scalar, |
5 | 5 | };
|
6 | 6 | use rustc::ty::Const;
|
7 | 7 | use rustc_mir::interpret::{
|
@@ -171,7 +171,7 @@ fn trans_const_place<'a, 'tcx: 'a>(
|
171 | 171 | let alloc = result().expect("unable to convert ConstValue to Allocation");
|
172 | 172 |
|
173 | 173 | //println!("const value: {:?} allocation: {:?}", value, alloc);
|
174 |
| - let alloc_id = fx.tcx.alloc_map.lock().allocate(alloc); |
| 174 | + let alloc_id = fx.tcx.alloc_map.lock().create_memory_alloc(alloc); |
175 | 175 | fx.constants.todo.insert(TodoItem::Alloc(alloc_id));
|
176 | 176 | let data_id = data_id_for_alloc_id(fx.module, alloc_id);
|
177 | 177 | cplace_for_dataid(fx, const_.ty, data_id)
|
@@ -296,18 +296,18 @@ fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
296 | 296 | };
|
297 | 297 |
|
298 | 298 | let data_id = match tcx.alloc_map.lock().get(reloc).unwrap() {
|
299 |
| - AllocKind::Function(instance) => { |
| 299 | + GlobalAlloc::Function(instance) => { |
300 | 300 | assert_eq!(addend, 0);
|
301 | 301 | let func_id = crate::abi::import_function(tcx, module, instance);
|
302 | 302 | let local_func_id = module.declare_func_in_data(func_id, &mut data_ctx);
|
303 | 303 | data_ctx.write_function_addr(offset.bytes() as u32, local_func_id);
|
304 | 304 | continue;
|
305 | 305 | }
|
306 |
| - AllocKind::Memory(_) => { |
| 306 | + GlobalAlloc::Memory(_) => { |
307 | 307 | cx.todo.insert(TodoItem::Alloc(reloc));
|
308 | 308 | data_id_for_alloc_id(module, reloc)
|
309 | 309 | }
|
310 |
| - AllocKind::Static(def_id) => { |
| 310 | + GlobalAlloc::Static(def_id) => { |
311 | 311 | cx.todo.insert(TodoItem::Static(def_id));
|
312 | 312 | let linkage = crate::linkage::get_static_ref_linkage(tcx, def_id);
|
313 | 313 | data_id_for_static(tcx, module, def_id, linkage)
|
|
0 commit comments