Skip to content

Commit d6f4a2f

Browse files
committed
rustc_codegen_llvm: don't generate static and vtable debuginfo for -Cdebuginfo=1.
1 parent c923f04 commit d6f4a2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

+10
Original file line numberDiff line numberDiff line change
@@ -2299,6 +2299,11 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
22992299
return;
23002300
}
23012301

2302+
// Only create type information if full debuginfo is enabled
2303+
if cx.sess().opts.debuginfo != DebugInfo::Full {
2304+
return;
2305+
}
2306+
23022307
let tcx = cx.tcx;
23032308
let attrs = tcx.codegen_fn_attrs(def_id);
23042309

@@ -2358,6 +2363,11 @@ pub fn create_vtable_metadata(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>, vtable: &
23582363
return;
23592364
}
23602365

2366+
// Only create type information if full debuginfo is enabled
2367+
if cx.sess().opts.debuginfo != DebugInfo::Full {
2368+
return;
2369+
}
2370+
23612371
let type_metadata = type_metadata(cx, ty, rustc_span::DUMMY_SP);
23622372

23632373
unsafe {

0 commit comments

Comments
 (0)