about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-10-06 11:49:03 +0200
committerljedrz <ljedrz@gmail.com>2018-11-10 19:25:22 +0100
commit3dbb2cc864db144154a5f4c349bcbc017533ee07 (patch)
treeb5448c1c4f2e3ba8dc37d3cb270759f5bbcf63a5 /src/librustc_codegen_utils
parent4286c3c1b0a4eb508483c915120a875966ac27c9 (diff)
downloadrust-3dbb2cc864db144154a5f4c349bcbc017533ee07.tar.gz
rust-3dbb2cc864db144154a5f4c349bcbc017533ee07.zip
codegen_llvm_back: improve common patterns
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/linker.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/librustc_codegen_utils/linker.rs b/src/librustc_codegen_utils/linker.rs
index 501166af906..8485ccd8f3d 100644
--- a/src/librustc_codegen_utils/linker.rs
+++ b/src/librustc_codegen_utils/linker.rs
@@ -343,17 +343,13 @@ impl<'a> Linker for GccLinker<'a> {
     }
 
     fn debuginfo(&mut self) {
-        match self.sess.opts.debuginfo {
-            DebugInfo::None => {
-                // If we are building without debuginfo enabled and we were called with
-                // `-Zstrip-debuginfo-if-disabled=yes`, tell the linker to strip any debuginfo
-                // found when linking to get rid of symbols from libstd.
-                match self.sess.opts.debugging_opts.strip_debuginfo_if_disabled {
-                    Some(true) => { self.linker_arg("-S"); },
-                    _ => {},
-                }
-            },
-            _ => {},
+        if let DebugInfo::None = self.sess.opts.debuginfo {
+            // If we are building without debuginfo enabled and we were called with
+            // `-Zstrip-debuginfo-if-disabled=yes`, tell the linker to strip any debuginfo
+            // found when linking to get rid of symbols from libstd.
+            if let Some(true) = self.sess.opts.debugging_opts.strip_debuginfo_if_disabled {
+                self.linker_arg("-S");
+            }
         };
     }