Skip to content

Commit

Permalink
rustc_codegen_llvm: don't generate static and vtable debuginfo for -C…
Browse files Browse the repository at this point in the history
…debuginfo=1.
  • Loading branch information
eddyb committed Mar 23, 2020
1 parent c923f04 commit d6f4a2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d6f4a2f

Please sign in to comment.