@@ -214,7 +214,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
214
214
self . allocate_raw_ptr ( alloc, kind) . unwrap ( )
215
215
}
216
216
217
- /// This can fail only of `alloc` contains relocations .
217
+ /// This can fail only of `alloc` contains provenance .
218
218
pub fn allocate_raw_ptr (
219
219
& mut self ,
220
220
alloc : Allocation ,
@@ -794,10 +794,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
794
794
todo. extend ( static_roots) ;
795
795
while let Some ( id) = todo. pop ( ) {
796
796
if reachable. insert ( id) {
797
- // This is a new allocation, add its relocations to `todo`.
797
+ // This is a new allocation, add the allocation it points to to `todo`.
798
798
if let Some ( ( _, alloc) ) = self . memory . alloc_map . get ( id) {
799
799
todo. extend (
800
- alloc. relocations ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) ,
800
+ alloc. provenance ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) ,
801
801
) ;
802
802
}
803
803
}
@@ -833,7 +833,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
833
833
allocs_to_print : & mut VecDeque < AllocId > ,
834
834
alloc : & Allocation < Prov , Extra > ,
835
835
) -> std:: fmt:: Result {
836
- for alloc_id in alloc. relocations ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) {
836
+ for alloc_id in alloc. provenance ( ) . values ( ) . filter_map ( |prov| prov. get_alloc_id ( ) ) {
837
837
allocs_to_print. push_back ( alloc_id) ;
838
838
}
839
839
write ! ( fmt, "{}" , display_allocation( tcx, alloc) )
@@ -960,9 +960,9 @@ impl<'tcx, 'a, Prov: Provenance, Extra> AllocRef<'a, 'tcx, Prov, Extra> {
960
960
. map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
961
961
}
962
962
963
- /// Returns whether the allocation has relocations for the entire range of the `AllocRef`.
964
- pub ( crate ) fn has_relocations ( & self ) -> bool {
965
- self . alloc . has_relocations ( & self . tcx , self . range )
963
+ /// Returns whether the allocation has provenance anywhere in the range of the `AllocRef`.
964
+ pub ( crate ) fn has_provenance ( & self ) -> bool {
965
+ self . alloc . range_has_provenance ( & self . tcx , self . range )
966
966
}
967
967
}
968
968
@@ -1078,17 +1078,17 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1078
1078
return Ok ( ( ) ) ;
1079
1079
} ;
1080
1080
1081
- // This checks relocation edges on the src, which needs to happen before
1082
- // `prepare_relocation_copy `.
1081
+ // This checks provenance edges on the src, which needs to happen before
1082
+ // `prepare_provenance_copy `.
1083
1083
let src_bytes = src_alloc
1084
1084
. get_bytes_with_uninit_and_ptr ( & tcx, src_range)
1085
1085
. map_err ( |e| e. to_interp_error ( src_alloc_id) ) ?
1086
1086
. as_ptr ( ) ; // raw ptr, so we can also get a ptr to the destination allocation
1087
- // first copy the relocations to a temporary buffer, because
1088
- // `get_bytes_mut` will clear the relocations , which is correct,
1089
- // since we don't want to keep any relocations at the target.
1090
- let relocations =
1091
- src_alloc. prepare_relocation_copy ( self , src_range, dest_offset, num_copies) ;
1087
+ // first copy the provenance to a temporary buffer, because
1088
+ // `get_bytes_mut` will clear the provenance , which is correct,
1089
+ // since we don't want to keep any provenance at the target.
1090
+ let provenance =
1091
+ src_alloc. prepare_provenance_copy ( self , src_range, dest_offset, num_copies) ;
1092
1092
// Prepare a copy of the initialization mask.
1093
1093
let compressed = src_alloc. compress_uninit_range ( src_range) ;
1094
1094
@@ -1117,7 +1117,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1117
1117
dest_alloc
1118
1118
. write_uninit ( & tcx, dest_range)
1119
1119
. map_err ( |e| e. to_interp_error ( dest_alloc_id) ) ?;
1120
- // We can forget about the relocations , this is all not initialized anyway.
1120
+ // We can forget about the provenance , this is all not initialized anyway.
1121
1121
return Ok ( ( ) ) ;
1122
1122
}
1123
1123
@@ -1161,8 +1161,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1161
1161
alloc_range ( dest_offset, size) , // just a single copy (i.e., not full `dest_range`)
1162
1162
num_copies,
1163
1163
) ;
1164
- // copy the relocations to the destination
1165
- dest_alloc. mark_relocation_range ( relocations ) ;
1164
+ // copy the provenance to the destination
1165
+ dest_alloc. mark_provenance_range ( provenance ) ;
1166
1166
1167
1167
Ok ( ( ) )
1168
1168
}
0 commit comments