about summary refs log tree commit diff
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
commitdc824452a9cb52f5eba09d768079bdbb68cbe3c8 (patch)
treea3fb59dc3ee8891af2937647deba1870f32dba83
parentc00ecf5d5dbc21db83eb1cd3e30ddda1f11079e3 (diff)
downloadrust-dc824452a9cb52f5eba09d768079bdbb68cbe3c8.tar.gz
rust-dc824452a9cb52f5eba09d768079bdbb68cbe3c8.zip
Merge new_metadata into codegen_allocator
-rw-r--r--src/lib.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 684b845c38a..58996a9db78 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -139,14 +139,12 @@ impl CodegenBackend for GccCodegenBackend {
 }
 
 impl ExtraBackendMethods for GccCodegenBackend {
-    fn new_metadata<'tcx>(&self, _tcx: TyCtxt<'tcx>, _mod_name: &str) -> Self::Module {
-        GccContext {
+    fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) -> Self::Module {
+        let mut mods = GccContext {
             context: Context::default(),
-        }
-    }
-
-    fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, mods: &mut Self::Module, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) {
-        unsafe { allocator::codegen(tcx, mods, module_name, kind, has_alloc_error_handler) }
+        };
+        unsafe { allocator::codegen(tcx, &mut mods, module_name, kind, has_alloc_error_handler); }
+        mods
     }
 
     fn compile_codegen_unit<'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: Symbol) -> (ModuleCodegen<Self::Module>, u64) {