s/alloc_type/alloc_kind/

This commit is contained in:
Oliver Scherer 2018-12-04 09:39:09 +01:00
parent 2e00d648c0
commit d6250191a6
3 changed files with 11 additions and 11 deletions

View file

@ -103,9 +103,9 @@ pub fn specialized_encode_alloc_id<
tcx: TyCtxt<'a, 'tcx, 'tcx>,
alloc_id: AllocId,
) -> Result<(), E::Error> {
let alloc_type: AllocKind<'tcx> =
let alloc_kind: AllocKind<'tcx> =
tcx.alloc_map.lock().get(alloc_id).expect("no value for AllocId");
match alloc_type {
match alloc_kind {
AllocKind::Memory(alloc) => {
trace!("encoding {:?} with {:#?}", alloc_id, alloc);
AllocDiscriminant::Alloc.encode(encoder)?;
@ -339,14 +339,14 @@ impl<'tcx> AllocMap<'tcx> {
next
}
fn intern(&mut self, alloc_type: AllocKind<'tcx>) -> AllocId {
if let Some(&alloc_id) = self.type_interner.get(&alloc_type) {
fn intern(&mut self, alloc_kind: AllocKind<'tcx>) -> AllocId {
if let Some(&alloc_id) = self.type_interner.get(&alloc_kind) {
return alloc_id;
}
let id = self.reserve();
debug!("creating alloc_type {:?} with id {}", alloc_type, id);
self.id_to_type.insert(id, alloc_type.clone());
self.type_interner.insert(alloc_type, id);
debug!("creating alloc_kind {:?} with id {}", alloc_kind, id);
self.id_to_type.insert(id, alloc_kind.clone());
self.type_interner.insert(alloc_kind, id);
id
}

View file

@ -316,8 +316,8 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
}
},
Scalar::Ptr(ptr) => {
let alloc_type = self.tcx.alloc_map.lock().get(ptr.alloc_id);
let base_addr = match alloc_type {
let alloc_kind = self.tcx.alloc_map.lock().get(ptr.alloc_id);
let base_addr = match alloc_kind {
Some(AllocKind::Memory(alloc)) => {
let init = const_alloc_to_llvm(self, alloc);
if alloc.mutability == Mutability::Mutable {

View file

@ -1161,8 +1161,8 @@ fn collect_miri<'a, 'tcx>(
alloc_id: AllocId,
output: &mut Vec<MonoItem<'tcx>>,
) {
let alloc_type = tcx.alloc_map.lock().get(alloc_id);
match alloc_type {
let alloc_kind = tcx.alloc_map.lock().get(alloc_id);
match alloc_kind {
Some(AllocKind::Static(did)) => {
let instance = Instance::mono(tcx, did);
if should_monomorphize_locally(tcx, &instance) {