Remove a couple of uses of interior mutability around statics

This commit is contained in:
bjorn3
2024-12-13 09:52:38 +00:00
parent a4cb1c72c5
commit 0fd257d66c
8 changed files with 33 additions and 28 deletions

View File

@@ -67,7 +67,7 @@ impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {
}
#[cfg_attr(not(feature = "master"), allow(unused_mut))]
fn codegen_static(&self, def_id: DefId) {
fn codegen_static(&mut self, def_id: DefId) {
let attrs = self.tcx.codegen_fn_attrs(def_id);
let Ok((value, alloc)) = codegen_static_initializer(self, def_id) else {
@@ -162,11 +162,11 @@ impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {
}
/// Add a global value to a list to be stored in the `llvm.used` variable, an array of i8*.
fn add_used_global(&self, _global: RValue<'gcc>) {
fn add_used_global(&mut self, _global: RValue<'gcc>) {
// TODO(antoyo)
}
fn add_compiler_used_global(&self, global: RValue<'gcc>) {
fn add_compiler_used_global(&mut self, global: RValue<'gcc>) {
// NOTE: seems like GCC does not make the distinction between compiler.used and used.
self.add_used_global(global);
}