Remove a couple of uses of interior mutability around statics
This commit is contained in:
@@ -411,7 +411,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||
g
|
||||
}
|
||||
|
||||
fn codegen_static_item(&self, def_id: DefId) {
|
||||
fn codegen_static_item(&mut self, def_id: DefId) {
|
||||
unsafe {
|
||||
assert!(
|
||||
llvm::LLVMGetInitializer(
|
||||
@@ -571,18 +571,18 @@ impl<'ll> StaticCodegenMethods for CodegenCx<'ll, '_> {
|
||||
self.const_pointercast(gv, self.type_ptr())
|
||||
}
|
||||
|
||||
fn codegen_static(&self, def_id: DefId) {
|
||||
fn codegen_static(&mut self, def_id: DefId) {
|
||||
self.codegen_static_item(def_id)
|
||||
}
|
||||
|
||||
/// Add a global value to a list to be stored in the `llvm.used` variable, an array of ptr.
|
||||
fn add_used_global(&self, global: &'ll Value) {
|
||||
self.used_statics.borrow_mut().push(global);
|
||||
fn add_used_global(&mut self, global: &'ll Value) {
|
||||
self.used_statics.push(global);
|
||||
}
|
||||
|
||||
/// Add a global value to a list to be stored in the `llvm.compiler.used` variable,
|
||||
/// an array of ptr.
|
||||
fn add_compiler_used_global(&self, global: &'ll Value) {
|
||||
self.compiler_used_statics.borrow_mut().push(global);
|
||||
fn add_compiler_used_global(&mut self, global: &'ll Value) {
|
||||
self.compiler_used_statics.push(global);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user