about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-08-14 23:59:15 +0800
committerGitHub <noreply@github.com>2018-08-14 23:59:15 +0800
commite862efa65d24673be1471c2a41f45ed81f52cea1 (patch)
treee461059bf33dff77357da7fdc3842eac14b4b401
parent11484c6a6a713754214feb82f753e76d05caef74 (diff)
parent44af0683883b0c1ce2a4d5f360cc9f50062dc9d1 (diff)
downloadrust-e862efa65d24673be1471c2a41f45ed81f52cea1.tar.gz
rust-e862efa65d24673be1471c2a41f45ed81f52cea1.zip
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
Remove statics field from CodegenCx

It doesnt seem to be used anywhere.
-rw-r--r--src/librustc_codegen_llvm/consts.rs1
-rw-r--r--src/librustc_codegen_llvm/context.rs5
-rw-r--r--src/librustc_codegen_llvm/mono_item.rs1
3 files changed, 0 insertions, 7 deletions
diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs
index 5501e915976..770a22ad658 100644
--- a/src/librustc_codegen_llvm/consts.rs
+++ b/src/librustc_codegen_llvm/consts.rs
@@ -230,7 +230,6 @@ pub fn get_static(cx: &CodegenCx<'ll, '_>, def_id: DefId) -> &'ll Value {
     }
 
     cx.instances.borrow_mut().insert(instance, g);
-    cx.statics.borrow_mut().insert(g, def_id);
     g
 }
 
diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs
index 781f8ebbb78..32ea2c5eb8f 100644
--- a/src/librustc_codegen_llvm/context.rs
+++ b/src/librustc_codegen_llvm/context.rs
@@ -13,7 +13,6 @@ use common;
 use llvm;
 use rustc::dep_graph::DepGraphSafe;
 use rustc::hir;
-use rustc::hir::def_id::DefId;
 use debuginfo;
 use callee;
 use base;
@@ -78,9 +77,6 @@ pub struct CodegenCx<'a, 'tcx: 'a> {
     /// Cache of emitted const globals (value -> global)
     pub const_globals: RefCell<FxHashMap<&'a Value, &'a Value>>,
 
-    /// Mapping from static definitions to their DefId's.
-    pub statics: RefCell<FxHashMap<&'a Value, DefId>>,
-
     /// List of globals for static variables which need to be passed to the
     /// LLVM function ReplaceAllUsesWith (RAUW) when codegen is complete.
     /// (We have to make sure we don't invalidate any Values referring
@@ -297,7 +293,6 @@ impl<'a, 'tcx> CodegenCx<'a, 'tcx> {
             const_cstr_cache: RefCell::new(FxHashMap()),
             const_unsized: RefCell::new(FxHashMap()),
             const_globals: RefCell::new(FxHashMap()),
-            statics: RefCell::new(FxHashMap()),
             statics_to_rauw: RefCell::new(Vec::new()),
             used_statics: RefCell::new(Vec::new()),
             lltypes: RefCell::new(FxHashMap()),
diff --git a/src/librustc_codegen_llvm/mono_item.rs b/src/librustc_codegen_llvm/mono_item.rs
index a528008e3b4..80c4df1d6b0 100644
--- a/src/librustc_codegen_llvm/mono_item.rs
+++ b/src/librustc_codegen_llvm/mono_item.rs
@@ -143,7 +143,6 @@ fn predefine_static<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
     }
 
     cx.instances.borrow_mut().insert(instance, g);
-    cx.statics.borrow_mut().insert(g, def_id);
 }
 
 fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,