Skip to content

Commit dc82445

Browse files
committed
Merge new_metadata into codegen_allocator
1 parent c00ecf5 commit dc82445

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,12 @@ impl CodegenBackend for GccCodegenBackend {
139139
}
140140

141141
impl ExtraBackendMethods for GccCodegenBackend {
142-
fn new_metadata<'tcx>(&self, _tcx: TyCtxt<'tcx>, _mod_name: &str) -> Self::Module {
143-
GccContext {
142+
fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) -> Self::Module {
143+
let mut mods = GccContext {
144144
context: Context::default(),
145-
}
146-
}
147-
148-
fn codegen_allocator<'tcx>(&self, tcx: TyCtxt<'tcx>, mods: &mut Self::Module, module_name: &str, kind: AllocatorKind, has_alloc_error_handler: bool) {
149-
unsafe { allocator::codegen(tcx, mods, module_name, kind, has_alloc_error_handler) }
145+
};
146+
unsafe { allocator::codegen(tcx, &mut mods, module_name, kind, has_alloc_error_handler); }
147+
mods
150148
}
151149

152150
fn compile_codegen_unit<'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: Symbol) -> (ModuleCodegen<Self::Module>, u64) {

0 commit comments

Comments
 (0)