diff options
| author | bors <bors@rust-lang.org> | 2018-12-13 12:36:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-13 12:36:13 +0000 |
| commit | 7489ee9c6f92050a12a3a3097df0a7d3737d82ec (patch) | |
| tree | ed427440d561cfc0f7bcd420e7386e86d9f1893f /src/librustc_codegen_llvm | |
| parent | 9fe5cb5342244a716055fa0162e795deabd4985c (diff) | |
| parent | 7181aa176393d601f43704d886e8e7afa4b14e45 (diff) | |
| download | rust-7489ee9c6f92050a12a3a3097df0a7d3737d82ec.tar.gz rust-7489ee9c6f92050a12a3a3097df0a7d3737d82ec.zip | |
Auto merge of #56461 - oli-obk:alloc_ids, r=RalfJung
Some cleanups around `AllocId` management r? @eddyb cc @RalfJung
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/common.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_codegen_llvm/common.rs b/src/librustc_codegen_llvm/common.rs index 55f286eb0be..ad14ca7caf6 100644 --- a/src/librustc_codegen_llvm/common.rs +++ b/src/librustc_codegen_llvm/common.rs @@ -21,7 +21,7 @@ use value::Value; use rustc_codegen_ssa::traits::*; use rustc::ty::layout::{HasDataLayout, LayoutOf, self, TyLayout, Size}; -use rustc::mir::interpret::{Scalar, AllocType, Allocation}; +use rustc::mir::interpret::{Scalar, AllocKind, Allocation}; use consts::const_alloc_to_llvm; use rustc_codegen_ssa::mir::place::PlaceRef; @@ -316,9 +316,9 @@ 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 { - Some(AllocType::Memory(alloc)) => { + 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 { self.static_addr_of_mut(init, alloc.align, None) @@ -326,10 +326,10 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { self.static_addr_of(init, alloc.align, None) } } - Some(AllocType::Function(fn_instance)) => { + Some(AllocKind::Function(fn_instance)) => { self.get_fn(fn_instance) } - Some(AllocType::Static(def_id)) => { + Some(AllocKind::Static(def_id)) => { assert!(self.tcx.is_static(def_id).is_some()); self.get_static(def_id) } |
