Skip to content

Commit e862efa

Browse files
authored
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
Remove statics field from CodegenCx It doesnt seem to be used anywhere.
2 parents 11484c6 + 44af068 commit e862efa

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

src/librustc_codegen_llvm/consts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ pub fn get_static(cx: &CodegenCx<'ll, '_>, def_id: DefId) -> &'ll Value {
230230
}
231231

232232
cx.instances.borrow_mut().insert(instance, g);
233-
cx.statics.borrow_mut().insert(g, def_id);
234233
g
235234
}
236235

src/librustc_codegen_llvm/context.rs

-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use common;
1313
use llvm;
1414
use rustc::dep_graph::DepGraphSafe;
1515
use rustc::hir;
16-
use rustc::hir::def_id::DefId;
1716
use debuginfo;
1817
use callee;
1918
use base;
@@ -78,9 +77,6 @@ pub struct CodegenCx<'a, 'tcx: 'a> {
7877
/// Cache of emitted const globals (value -> global)
7978
pub const_globals: RefCell<FxHashMap<&'a Value, &'a Value>>,
8079

81-
/// Mapping from static definitions to their DefId's.
82-
pub statics: RefCell<FxHashMap<&'a Value, DefId>>,
83-
8480
/// List of globals for static variables which need to be passed to the
8581
/// LLVM function ReplaceAllUsesWith (RAUW) when codegen is complete.
8682
/// (We have to make sure we don't invalidate any Values referring
@@ -297,7 +293,6 @@ impl<'a, 'tcx> CodegenCx<'a, 'tcx> {
297293
const_cstr_cache: RefCell::new(FxHashMap()),
298294
const_unsized: RefCell::new(FxHashMap()),
299295
const_globals: RefCell::new(FxHashMap()),
300-
statics: RefCell::new(FxHashMap()),
301296
statics_to_rauw: RefCell::new(Vec::new()),
302297
used_statics: RefCell::new(Vec::new()),
303298
lltypes: RefCell::new(FxHashMap()),

src/librustc_codegen_llvm/mono_item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ fn predefine_static<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
143143
}
144144

145145
cx.instances.borrow_mut().insert(instance, g);
146-
cx.statics.borrow_mut().insert(g, def_id);
147146
}
148147

149148
fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,

0 commit comments

Comments
 (0)