@@ -2,7 +2,7 @@ use std::borrow::Borrow;
22use std:: cell:: { Cell , RefCell } ;
33use std:: ffi:: { CStr , c_char, c_uint} ;
44use std:: marker:: PhantomData ;
5- use std:: ops:: Deref ;
5+ use std:: ops:: { Deref , DerefMut } ;
66use std:: str;
77
88use rustc_abi:: { HasDataLayout , Size , TargetDataLayout , VariantIdx } ;
@@ -77,6 +77,13 @@ impl<'ll, T: Borrow<SCx<'ll>>> Deref for GenericCx<'ll, T> {
7777 }
7878}
7979
80+ impl < ' ll , T : Borrow < SCx < ' ll > > > DerefMut for GenericCx < ' ll , T > {
81+ #[ inline]
82+ fn deref_mut ( & mut self ) -> & mut Self :: Target {
83+ & mut self . 0
84+ }
85+ }
86+
8087pub ( crate ) type SimpleCx < ' ll > = GenericCx < ' ll , SCx < ' ll > > ;
8188
8289/// There is one `CodegenCx` per codegen unit. Each one has its own LLVM
@@ -110,11 +117,11 @@ pub(crate) struct FullCx<'ll, 'tcx> {
110117
111118 /// Statics that will be placed in the llvm.used variable
112119 /// See <https://llvm.org/docs/LangRef.html#the-llvm-used-global-variable> for details
113- pub used_statics : RefCell < Vec < & ' ll Value > > ,
120+ pub used_statics : Vec < & ' ll Value > ,
114121
115122 /// Statics that will be placed in the llvm.compiler.used variable
116123 /// See <https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable> for details
117- pub compiler_used_statics : RefCell < Vec < & ' ll Value > > ,
124+ pub compiler_used_statics : Vec < & ' ll Value > ,
118125
119126 /// Mapping of non-scalar types to llvm types.
120127 pub type_lowering : RefCell < FxHashMap < ( Ty < ' tcx > , Option < VariantIdx > ) , & ' ll Type > > ,
@@ -606,8 +613,8 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
606613 const_str_cache : Default :: default ( ) ,
607614 const_globals : Default :: default ( ) ,
608615 statics_to_rauw : RefCell :: new ( Vec :: new ( ) ) ,
609- used_statics : RefCell :: new ( Vec :: new ( ) ) ,
610- compiler_used_statics : RefCell :: new ( Vec :: new ( ) ) ,
616+ used_statics : Vec :: new ( ) ,
617+ compiler_used_statics : Vec :: new ( ) ,
611618 type_lowering : Default :: default ( ) ,
612619 scalar_lltypes : Default :: default ( ) ,
613620 coverage_cx,
0 commit comments