]> git.lizzy.rs Git - rust.git/commitdiff
rustc_codegen_llvm: don't generate static and vtable debuginfo for -Cdebuginfo=1.
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Tue, 11 Feb 2020 22:20:02 +0000 (00:20 +0200)
committerEduard-Mihai Burtescu <edy.burt@gmail.com>
Mon, 23 Mar 2020 00:36:36 +0000 (02:36 +0200)
src/librustc_codegen_llvm/debuginfo/metadata.rs

index f35220cc6666ad059c4bb47d980f6918e5b6749f..c867d8cf3c481021653549c266a17085e05cf4a0 100644 (file)
@@ -2299,6 +2299,11 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
         return;
     }
 
+    // Only create type information if full debuginfo is enabled
+    if cx.sess().opts.debuginfo != DebugInfo::Full {
+        return;
+    }
+
     let tcx = cx.tcx;
     let attrs = tcx.codegen_fn_attrs(def_id);
 
@@ -2358,6 +2363,11 @@ pub fn create_vtable_metadata(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>, vtable: &
         return;
     }
 
+    // Only create type information if full debuginfo is enabled
+    if cx.sess().opts.debuginfo != DebugInfo::Full {
+        return;
+    }
+
     let type_metadata = type_metadata(cx, ty, rustc_span::DUMMY_SP);
 
     unsafe {