about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2022-04-30 21:20:08 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2022-04-30 21:20:08 +0200
commit78c65a52db0016f489862ecea92a09ad66a2b960 (patch)
treeb5e4db99724f287f91fdfa5ab9fe7939fe6af7ce /compiler/rustc_codegen_llvm/src
parentfab72301d9089761766b389df209986c2bc38e5d (diff)
downloadrust-78c65a52db0016f489862ecea92a09ad66a2b960.tar.gz
rust-78c65a52db0016f489862ecea92a09ad66a2b960.zip
Merge new_metadata into codegen_allocator
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/lib.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index b48c738124d..b0359239569 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -104,19 +104,18 @@ impl Drop for TimeTraceProfiler {
 }
 
 impl ExtraBackendMethods for LlvmCodegenBackend {
-    fn new_metadata(&self, tcx: TyCtxt<'_>, mod_name: &str) -> ModuleLlvm {
-        ModuleLlvm::new_metadata(tcx, mod_name)
-    }
-
     fn codegen_allocator<'tcx>(
         &self,
         tcx: TyCtxt<'tcx>,
-        module_llvm: &mut ModuleLlvm,
         module_name: &str,
         kind: AllocatorKind,
         has_alloc_error_handler: bool,
-    ) {
-        unsafe { allocator::codegen(tcx, module_llvm, module_name, kind, has_alloc_error_handler) }
+    ) -> ModuleLlvm {
+        let mut module_llvm = ModuleLlvm::new_metadata(tcx, module_name);
+        unsafe {
+            allocator::codegen(tcx, &mut module_llvm, module_name, kind, has_alloc_error_handler);
+        }
+        module_llvm
     }
     fn compile_codegen_unit(
         &self,