interpret: rename base_pointer -> root_pointer
also in Miri, "base tag" -> "root tag"
This commit is contained in:
@@ -165,7 +165,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
///
|
||||
/// This function can fail only if `ptr` points to an `extern static`.
|
||||
#[inline]
|
||||
pub fn global_base_pointer(
|
||||
pub fn global_root_pointer(
|
||||
&self,
|
||||
ptr: Pointer<CtfeProvenance>,
|
||||
) -> InterpResult<'tcx, Pointer<M::Provenance>> {
|
||||
@@ -178,7 +178,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
bug!("global memory cannot point to thread-local static")
|
||||
}
|
||||
Some(GlobalAlloc::Static(def_id)) if self.tcx.is_foreign_item(def_id) => {
|
||||
return M::extern_static_base_pointer(self, def_id);
|
||||
return M::extern_static_pointer(self, def_id);
|
||||
}
|
||||
None => {
|
||||
assert!(
|
||||
@@ -189,7 +189,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
_ => {}
|
||||
}
|
||||
// And we need to get the provenance.
|
||||
M::adjust_alloc_base_pointer(self, ptr, M::GLOBAL_KIND.map(MemoryKind::Machine))
|
||||
M::adjust_alloc_root_pointer(self, ptr, M::GLOBAL_KIND.map(MemoryKind::Machine))
|
||||
}
|
||||
|
||||
pub fn fn_ptr(&mut self, fn_val: FnVal<'tcx, M::ExtraFnVal>) -> Pointer<M::Provenance> {
|
||||
@@ -203,9 +203,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
id
|
||||
}
|
||||
};
|
||||
// Functions are global allocations, so make sure we get the right base pointer.
|
||||
// Functions are global allocations, so make sure we get the right root pointer.
|
||||
// We know this is not an `extern static` so this cannot fail.
|
||||
self.global_base_pointer(Pointer::from(id)).unwrap()
|
||||
self.global_root_pointer(Pointer::from(id)).unwrap()
|
||||
}
|
||||
|
||||
pub fn allocate_ptr(
|
||||
@@ -246,7 +246,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
);
|
||||
let alloc = M::adjust_allocation(self, id, Cow::Owned(alloc), Some(kind))?;
|
||||
self.memory.alloc_map.insert(id, (kind, alloc.into_owned()));
|
||||
M::adjust_alloc_base_pointer(self, Pointer::from(id), Some(kind))
|
||||
M::adjust_alloc_root_pointer(self, Pointer::from(id), Some(kind))
|
||||
}
|
||||
|
||||
pub fn reallocate_ptr(
|
||||
|
||||
Reference in New Issue
Block a user