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

@@ -115,14 +115,11 @@ pub(crate) fn compile_codegen_unit(
}
// Create the llvm.used and llvm.compiler.used variables.
if !cx.used_statics.borrow().is_empty() {
cx.create_used_variable_impl(c"llvm.used", &*cx.used_statics.borrow());
if !cx.used_statics.is_empty() {
cx.create_used_variable_impl(c"llvm.used", &cx.used_statics);
}
if !cx.compiler_used_statics.borrow().is_empty() {
cx.create_used_variable_impl(
c"llvm.compiler.used",
&*cx.compiler_used_statics.borrow(),
);
if !cx.compiler_used_statics.is_empty() {
cx.create_used_variable_impl(c"llvm.compiler.used", &cx.compiler_used_statics);
}
// Run replace-all-uses-with for statics that need it. This must