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.
This commit is contained in:
Weihang Lo 2023-11-15 23:07:37 -05:00
parent a2d328fa12
commit 1667f3d2cc
No known key found for this signature in database
GPG key ID: D7DBF189825E82E7
4 changed files with 44 additions and 5 deletions

View file

@ -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>(