Skip to content

Commit 06a1141

Browse files
committed
[perf experiment] Disable track_caller
1 parent ac77e88 commit 06a1141

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

-4
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
6060

6161
let attrs = tcx.hir().attrs(tcx.local_def_id_to_hir_id(did));
6262
let mut codegen_fn_attrs = CodegenFnAttrs::new();
63-
if tcx.should_inherit_track_caller(did) {
64-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::TRACK_CALLER;
65-
}
6663

6764
// When `no_builtins` is applied at the crate level, we should add the
6865
// `no-builtins` attribute to each function to ensure it takes effect in LTO.
@@ -241,7 +238,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
241238
)
242239
.emit();
243240
}
244-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::TRACK_CALLER
245241
}
246242
sym::export_name => {
247243
if let Some(s) = attr.value_str() {

compiler/rustc_codegen_ssa/src/mir/block.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -681,28 +681,25 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
681681
bx.switch_to_block(panic_block);
682682
self.set_debug_loc(bx, terminator.source_info);
683683

684-
// Get the location information.
685-
let location = self.get_caller_location(bx, terminator.source_info).immediate();
686-
687684
// Put together the arguments to the panic entry point.
688685
let (lang_item, args) = match msg {
689686
AssertKind::BoundsCheck { ref len, ref index } => {
690687
let len = self.codegen_operand(bx, len).immediate();
691688
let index = self.codegen_operand(bx, index).immediate();
692689
// It's `fn panic_bounds_check(index: usize, len: usize)`,
693690
// and `#[track_caller]` adds an implicit third argument.
694-
(LangItem::PanicBoundsCheck, vec![index, len, location])
691+
(LangItem::PanicBoundsCheck, vec![index, len])
695692
}
696693
AssertKind::MisalignedPointerDereference { ref required, ref found } => {
697694
let required = self.codegen_operand(bx, required).immediate();
698695
let found = self.codegen_operand(bx, found).immediate();
699696
// It's `fn panic_misaligned_pointer_dereference(required: usize, found: usize)`,
700697
// and `#[track_caller]` adds an implicit third argument.
701-
(LangItem::PanicMisalignedPointerDereference, vec![required, found, location])
698+
(LangItem::PanicMisalignedPointerDereference, vec![required, found])
702699
}
703700
_ => {
704701
// It's `pub fn panic_...()` and `#[track_caller]` adds an implicit argument.
705-
(msg.panic_function(), vec![location])
702+
(msg.panic_function(), vec![])
706703
}
707704
};
708705

0 commit comments

Comments
 (0)