summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm
diff options
context:
space:
mode:
authorWeihang Lo <me@weihanglo.tw>2023-11-15 23:07:37 -0500
committerWeihang Lo <me@weihanglo.tw>2023-12-11 14:58:02 -0500
commit1667f3d2cc131e1f39d4314296b7cafa9dbfa0f4 (patch)
treed2784e0038b6e72c4a5c63ce2708a119505bd8bf /compiler/rustc_codegen_llvm/src/llvm
parenta2d328fa12ca66edb47398c4a620523d252ff727 (diff)
downloadrust-1667f3d2cc131e1f39d4314296b7cafa9dbfa0f4.tar.gz
rust-1667f3d2cc131e1f39d4314296b7cafa9dbfa0f4.zip
fix: stop emitting `.debug_pubnames` and `.debug_pubtypes`
`.debug_pubnames` and `.debug_pubtypes` are poorly designed and people
seldom use them. However, they take a considerable portion of size in
the final binary. This tells LLVM stop emitting those sections on
DWARFv4 or lower. DWARFv5 use `.debug_names` which is more concise
in size and performant for name lookup.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index 432cfe203c8..81702baa8c0 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -5,7 +5,7 @@ use super::debuginfo::{
     DIArray, DIBasicType, DIBuilder, DICompositeType, DIDerivedType, DIDescriptor, DIEnumerator,
     DIFile, DIFlags, DIGlobalVariableExpression, DILexicalBlock, DILocation, DINameSpace,
     DISPFlags, DIScope, DISubprogram, DISubrange, DITemplateTypeParameter, DIType, DIVariable,
-    DebugEmissionKind,
+    DebugEmissionKind, DebugNameTableKind,
 };
 
 use libc::{c_char, c_int, c_uint, size_t};
@@ -794,6 +794,15 @@ pub mod debuginfo {
             }
         }
     }
+
+    /// LLVMRustDebugNameTableKind
+    #[derive(Clone, Copy)]
+    #[repr(C)]
+    pub enum DebugNameTableKind {
+        Default,
+        Gnu,
+        None,
+    }
 }
 
 use bitflags::bitflags;
@@ -1812,6 +1821,7 @@ extern "C" {
         kind: DebugEmissionKind,
         DWOId: u64,
         SplitDebugInlining: bool,
+        DebugNameTableKind: DebugNameTableKind,
     ) -> &'a DIDescriptor;
 
     pub fn LLVMRustDIBuilderCreateFile<'a>(