Skip to content

Commit c770c08

Browse files
committed
[WIP] Disable debuginfo generation
1 parent 32a7045 commit c770c08

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

src/base.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub(crate) struct CodegenedFunction {
3232
pub(crate) fn codegen_fn<'tcx>(
3333
tcx: TyCtxt<'tcx>,
3434
cx: &mut crate::CodegenCx,
35-
type_dbg: &mut TypeDebugContext<'tcx>,
35+
//type_dbg: &mut TypeDebugContext<'tcx>,
3636
cached_func: Function,
3737
module: &mut dyn Module,
3838
instance: Instance<'tcx>,
@@ -63,9 +63,9 @@ pub(crate) fn codegen_fn<'tcx>(
6363
func.clear();
6464
func.name = UserFuncName::user(0, func_id.as_u32());
6565
func.signature = sig;
66-
if cx.debug_context.is_some() {
67-
func.collect_debug_info();
68-
}
66+
//if cx.debug_context.is_some() {
67+
// func.collect_debug_info();
68+
//}
6969

7070
let mut bcx = FunctionBuilder::new(&mut func, &mut func_ctx);
7171

@@ -81,11 +81,11 @@ pub(crate) fn codegen_fn<'tcx>(
8181
let pointer_type = target_config.pointer_type();
8282
let clif_comments = crate::pretty_clif::CommentWriter::new(tcx, instance, fn_abi);
8383

84-
let func_debug_cx = if let Some(debug_context) = &mut cx.debug_context {
85-
Some(debug_context.define_function(tcx, type_dbg, instance, fn_abi, &symbol_name, mir.span))
84+
let func_debug_cx = None; /* if let Some(debug_context) = &mut cx.debug_context {
85+
Some(debug_context.define_function(tcx, type_dbg, instance, fn_abi, &symbol_name, mir.span))
8686
} else {
87-
None
88-
};
87+
None
88+
};*/
8989

9090
let exception_slot = bcx.declare_var(pointer_type);
9191

@@ -243,6 +243,7 @@ pub(crate) fn compile_fn(
243243
}
244244
}
245245

246+
/*
246247
// Define debuginfo for function
247248
let debug_context = &mut cx.debug_context;
248249
profiler.generic_activity("generate debug info").run(|| {
@@ -254,6 +255,7 @@ pub(crate) fn compile_fn(
254255
);
255256
}
256257
});
258+
*/
257259
}
258260

259261
fn verify_func(tcx: TyCtxt<'_>, writer: &crate::pretty_clif::CommentWriter, func: &Function) {

src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,14 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
404404
}
405405

406406
pub(crate) fn set_debug_loc(&mut self, source_info: mir::SourceInfo) {
407-
if let Some(debug_context) = &mut self.cx.debug_context {
407+
/*if let Some(debug_context) = &mut self.cx.debug_context {
408408
let (file_id, line, column) =
409409
debug_context.get_span_loc(self.tcx, self.mir.span, source_info.span);
410410
411411
let source_loc =
412412
self.func_debug_cx.as_mut().unwrap().add_dbg_loc(file_id, line, column);
413413
self.bcx.set_srcloc(source_loc);
414-
}
414+
}*/
415415
}
416416

417417
pub(crate) fn get_caller_location(&mut self, source_info: mir::SourceInfo) -> CValue<'tcx> {

src/driver/aot.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ fn codegen_cgu_content(
552552
let codegened_function = crate::base::codegen_fn(
553553
tcx,
554554
&mut cx,
555-
&mut type_dbg,
555+
//&mut type_dbg,
556556
Function::new(),
557557
module,
558558
instance,
@@ -561,9 +561,9 @@ fn codegen_cgu_content(
561561
}
562562
MonoItem::Static(def_id) => {
563563
let data_id = crate::constant::codegen_static(tcx, module, def_id);
564-
if let Some(debug_context) = &mut cx.debug_context {
565-
debug_context.define_static(tcx, &mut type_dbg, def_id, data_id);
566-
}
564+
// if let Some(debug_context) = &mut cx.debug_context {
565+
// debug_context.define_static(tcx, &mut type_dbg, def_id, data_id);
566+
// }
567567
}
568568
MonoItem::GlobalAsm(item_id) => {
569569
rustc_codegen_ssa::base::codegen_global_asm(
@@ -637,7 +637,7 @@ fn module_codegen(
637637
&profiler,
638638
cgu_name,
639639
module,
640-
cx.debug_context,
640+
None, //cx.debug_context,
641641
global_asm_object_file,
642642
&producer,
643643
)

src/driver/jit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn codegen_and_compile_fn<'tcx>(
144144
let codegened_func = crate::base::codegen_fn(
145145
tcx,
146146
cx,
147-
&mut TypeDebugContext::default(),
147+
//&mut TypeDebugContext::default(),
148148
cached_func,
149149
module,
150150
instance,

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ impl<F: Fn() -> String> Drop for PrintOnPanic<F> {
127127
/// inside a single codegen unit with the exception of the Cranelift [`Module`](cranelift_module::Module).
128128
struct CodegenCx {
129129
should_write_ir: bool,
130-
debug_context: Option<DebugContext>,
130+
//debug_context: Option<DebugContext>,
131131
cgu_name: Symbol,
132132
}
133133

134134
impl CodegenCx {
135135
fn new(tcx: TyCtxt<'_>, isa: &dyn TargetIsa, debug_info: bool, cgu_name: Symbol) -> Self {
136136
assert_eq!(pointer_ty(tcx), isa.pointer_type());
137137

138-
let debug_context = if debug_info && !tcx.sess.target.options.is_like_windows {
138+
/*let debug_context = if debug_info && !tcx.sess.target.options.is_like_windows {
139139
Some(DebugContext::new(tcx, isa, cgu_name.as_str()))
140140
} else {
141141
None
142-
};
142+
};*/
143143
CodegenCx {
144144
should_write_ir: crate::pretty_clif::should_write_ir(tcx),
145-
debug_context,
145+
//debug_context: None,
146146
cgu_name,
147147
}
148148
}

0 commit comments

Comments
 (0)