about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-10 22:50:17 +0000
committerbors <bors@rust-lang.org>2022-06-10 22:50:17 +0000
commitb9f3bdf5ce37c50c71dd7cee969a14e15f14130a (patch)
treef81239d56cc87f858ae19c9b3f3b485cf8fe0329 /compiler/rustc_codegen_llvm/src
parentec55c61305eaf385fc1b93ac9a78284b4d887fe5 (diff)
parent5d04bc828e511d548f57656940ead49e3e897650 (diff)
downloadrust-b9f3bdf5ce37c50c71dd7cee969a14e15f14130a.tar.gz
rust-b9f3bdf5ce37c50c71dd7cee969a14e15f14130a.zip
Auto merge of #97968 - matthiaskrgr:rollup-qtd4i5h, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #93331 (refactor write_output_file to merge two invocation paths into one.)
 - #97928 (Removes debug settings from wasm32_unknown_emscripten default link args)
 - #97940 (Use relative links instead of linking to doc.rust-lang.org when possible)
 - #97941 (nit: Fixed several error_codes/Exxxx.md messages which used UpperCamelCase…)
 - #97953 (Add regression test for #54378)
 - #97957 (Make `std::` prefix suggestion test `run-rustfix`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs32
1 files changed, 14 insertions, 18 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index 99e30531c22..50f8949c897 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -56,28 +56,24 @@ pub fn write_output_file<'ll>(
     file_type: llvm::FileType,
     self_profiler_ref: &SelfProfilerRef,
 ) -> Result<(), FatalError> {
+    debug!("write_output_file output={:?} dwo_output={:?}", output, dwo_output);
     unsafe {
         let output_c = path_to_c_string(output);
-        let result = if let Some(dwo_output) = dwo_output {
-            let dwo_output_c = path_to_c_string(dwo_output);
-            llvm::LLVMRustWriteOutputFile(
-                target,
-                pm,
-                m,
-                output_c.as_ptr(),
-                dwo_output_c.as_ptr(),
-                file_type,
-            )
+        let dwo_output_c;
+        let dwo_output_ptr = if let Some(dwo_output) = dwo_output {
+            dwo_output_c = path_to_c_string(dwo_output);
+            dwo_output_c.as_ptr()
         } else {
-            llvm::LLVMRustWriteOutputFile(
-                target,
-                pm,
-                m,
-                output_c.as_ptr(),
-                std::ptr::null(),
-                file_type,
-            )
+            std::ptr::null()
         };
+        let result = llvm::LLVMRustWriteOutputFile(
+            target,
+            pm,
+            m,
+            output_c.as_ptr(),
+            dwo_output_ptr,
+            file_type,
+        );
 
         // Record artifact sizes for self-profiling
         if result == llvm::LLVMRustResult::Success {