]> git.lizzy.rs Git - rust.git/commitdiff
Move emit_module call
authorbjorn3 <bjorn3@users.noreply.github.com>
Sat, 7 Mar 2020 11:45:05 +0000 (12:45 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Sat, 7 Mar 2020 11:45:05 +0000 (12:45 +0100)
src/driver.rs

index e67c2a50bc8aaf52dddc7bd4e9413f05a566c736..b6cc3a98257f04347c6af8f8ac8d9c001aade3f9 100644 (file)
@@ -231,6 +231,14 @@ fn emit_module<B: Backend>(
     });
     crate::main_shim::maybe_create_entry_wrapper(tcx, &mut module);
 
+    let modules = vec![emit_module(
+        tcx,
+        "some_file".to_string(),
+        ModuleKind::Regular,
+        module,
+        debug,
+    )];
+
     tcx.sess.abort_if_errors();
 
     let mut allocator_module = new_module("allocator_shim".to_string());
@@ -277,13 +285,7 @@ fn emit_module<B: Backend>(
 
     Box::new(CodegenResults {
         crate_name: tcx.crate_name(LOCAL_CRATE),
-        modules: vec![emit_module(
-            tcx,
-            "some_file".to_string(),
-            ModuleKind::Regular,
-            module,
-            debug,
-        )],
+        modules,
         allocator_module: if created_alloc_shim {
             Some(emit_module(
                 tcx,