From d6f4a2fbf937c4033a51bee1c74c329259041dd1 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 12 Feb 2020 00:20:02 +0200 Subject: [PATCH 1/1] rustc_codegen_llvm: don't generate static and vtable debuginfo for -Cdebuginfo=1. --- src/librustc_codegen_llvm/debuginfo/metadata.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index f35220cc666..c867d8cf3c4 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -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 { -- 2.44.0