From 8b44562bc8e2072eb60550b24cb0ca4e6715a8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 27 Mar 2026 16:57:47 +0100 Subject: [PATCH] Revert "Rollup merge of #154200 - resrever:enable-dwarf-call-sites, r=dingxiangfei2009" This reverts commit 2f1603077b249819ec6ab6ba2a73b2f5b8079382, reversing changes made to 6e3c17424d5c97770f1de534fb1bec496de4d9cf. --- .../rustc_codegen_llvm/src/debuginfo/mod.rs | 7 ++----- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 - .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 3 +-- tests/codegen-llvm/debuginfo-callsite-flag.rs | 20 ------------------- 4 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 tests/codegen-llvm/debuginfo-callsite-flag.rs diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index a667877e8e51d..c3fa86f8a2ad3 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -471,7 +471,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { // FIXME(eddyb) does this need to be separate from `loc.line` for some reason? let scope_line = loc.line; - let mut flags = DIFlags::FlagPrototyped | DIFlags::FlagAllCallsDescribed; + let mut flags = DIFlags::FlagPrototyped; if fn_abi.ret.layout.is_uninhabited() { flags |= DIFlags::FlagNoReturn; @@ -494,9 +494,6 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { // LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. // When we use this `decl` below, the subprogram definition gets created at the CU level // with a DW_AT_specification pointing back to the type's declaration. - // FlagAllCallsDescribed cannot appear on the method declaration DIE - // because it has no body, which LLVM's verifier rejects. - let decl_flags = flags & !DIFlags::FlagAllCallsDescribed; let decl = is_method.then(|| unsafe { llvm::LLVMRustDIBuilderCreateMethod( DIB(self), @@ -508,7 +505,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { file_metadata, loc.line, function_type_metadata, - decl_flags, + flags, spflags & !DISPFlags::SPFlagDefinition, template_parameters, ) diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index c6c04acc4631a..7355d11367920 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -781,7 +781,6 @@ pub(crate) mod debuginfo { const FlagNonTrivial = (1 << 26); const FlagBigEndian = (1 << 27); const FlagLittleEndian = (1 << 28); - const FlagAllCallsDescribed = (1 << 29); } } diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 392cd0601391d..63ff0b2a0a0df 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -779,7 +779,6 @@ ASSERT_DIFLAG_VALUE(FlagThunk, 1 << 25); ASSERT_DIFLAG_VALUE(FlagNonTrivial, 1 << 26); ASSERT_DIFLAG_VALUE(FlagBigEndian, 1 << 27); ASSERT_DIFLAG_VALUE(FlagLittleEndian, 1 << 28); -static_assert(DINode::DIFlags::FlagAllCallsDescribed == (1 << 29)); ASSERT_DIFLAG_VALUE(FlagIndirectVirtualBase, (1 << 2) | (1 << 5)); #undef ASSERT_DIFLAG_VALUE @@ -792,7 +791,7 @@ ASSERT_DIFLAG_VALUE(FlagIndirectVirtualBase, (1 << 2) | (1 << 5)); // to copying each bit/subvalue. static DINode::DIFlags fromRust(LLVMDIFlags Flags) { // Check that all set bits are covered by the static assertions above. - const unsigned UNKNOWN_BITS = (1 << 31) | (1 << 30) | (1 << 21); + const unsigned UNKNOWN_BITS = (1 << 31) | (1 << 30) | (1 << 29) | (1 << 21); if (Flags & UNKNOWN_BITS) { report_fatal_error("bad LLVMDIFlags"); } diff --git a/tests/codegen-llvm/debuginfo-callsite-flag.rs b/tests/codegen-llvm/debuginfo-callsite-flag.rs deleted file mode 100644 index f86adfcc36266..0000000000000 --- a/tests/codegen-llvm/debuginfo-callsite-flag.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Check that DIFlagAllCallsDescribed is set on subprogram definitions. - -//@ ignore-msvc (CodeView does not use DIFlagAllCallsDescribed) -//@ compile-flags: -C debuginfo=2 -C opt-level=1 -C no-prepopulate-passes - -// CHECK: {{.*}}DISubprogram{{.*}}name: "foo"{{.*}}DIFlagAllCallsDescribed{{.*}} - -#[no_mangle] -#[inline(never)] -pub fn foo(x: i32) -> i32 { - bar(x + 1) -} - -#[no_mangle] -#[inline(never)] -pub fn bar(x: i32) -> i32 { - x * 2 -} - -fn main() {}