]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_codegen_llvm/src/context.rs
Rollup merge of #102578 - lukas-code:ilog-panic, r=m-ou-se
[rust.git] / compiler / rustc_codegen_llvm / src / context.rs
index 2ab69d2541169fc51580a1f83cf77ea1cd23224f..79ddfd884dfac69f29fca10fed4063dda0c7c226 100644 (file)
@@ -458,7 +458,7 @@ pub fn coverage_context(&self) -> Option<&coverageinfo::CrateCoverageContext<'ll
         self.coverage_cx.as_ref()
     }
 
-    fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'ll Value]) {
+    pub(crate) fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'ll Value]) {
         let section = cstr!("llvm.metadata");
         let array = self.const_array(self.type_ptr_to(self.type_i8()), values);
 
@@ -556,14 +556,6 @@ fn codegen_unit(&self) -> &'tcx CodegenUnit<'tcx> {
         self.codegen_unit
     }
 
-    fn used_statics(&self) -> &RefCell<Vec<&'ll Value>> {
-        &self.used_statics
-    }
-
-    fn compiler_used_statics(&self) -> &RefCell<Vec<&'ll Value>> {
-        &self.compiler_used_statics
-    }
-
     fn set_frame_pointer_type(&self, llfn: &'ll Value) {
         if let Some(attr) = attributes::frame_pointer_type_attr(self) {
             attributes::apply_to_llfn(llfn, llvm::AttributePlace::Function, &[attr]);
@@ -577,17 +569,6 @@ fn apply_target_cpu_attr(&self, llfn: &'ll Value) {
         attributes::apply_to_llfn(llfn, llvm::AttributePlace::Function, &attrs);
     }
 
-    fn create_used_variable(&self) {
-        self.create_used_variable_impl(cstr!("llvm.used"), &*self.used_statics.borrow());
-    }
-
-    fn create_compiler_used_variable(&self) {
-        self.create_used_variable_impl(
-            cstr!("llvm.compiler.used"),
-            &*self.compiler_used_statics.borrow(),
-        );
-    }
-
     fn declare_c_main(&self, fn_type: Self::Type) -> Option<Self::Function> {
         if self.get_declared_value("main").is_none() {
             Some(self.declare_cfn("main", llvm::UnnamedAddr::Global, fn_type))