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:
parent
a2d328fa12
commit
1667f3d2cc
4 changed files with 44 additions and 5 deletions
|
@ -697,6 +697,25 @@ static DICompileUnit::DebugEmissionKind fromRust(LLVMRustDebugEmissionKind Kind)
|
|||
}
|
||||
}
|
||||
|
||||
enum class LLVMRustDebugNameTableKind {
|
||||
Default,
|
||||
GNU,
|
||||
None,
|
||||
};
|
||||
|
||||
static DICompileUnit::DebugNameTableKind fromRust(LLVMRustDebugNameTableKind Kind) {
|
||||
switch (Kind) {
|
||||
case LLVMRustDebugNameTableKind::Default:
|
||||
return DICompileUnit::DebugNameTableKind::Default;
|
||||
case LLVMRustDebugNameTableKind::GNU:
|
||||
return DICompileUnit::DebugNameTableKind::GNU;
|
||||
case LLVMRustDebugNameTableKind::None:
|
||||
return DICompileUnit::DebugNameTableKind::None;
|
||||
default:
|
||||
report_fatal_error("bad DebugNameTableKind.");
|
||||
}
|
||||
}
|
||||
|
||||
enum class LLVMRustChecksumKind {
|
||||
None,
|
||||
MD5,
|
||||
|
@ -765,13 +784,15 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateCompileUnit(
|
|||
const char *Flags, unsigned RuntimeVer,
|
||||
const char *SplitName, size_t SplitNameLen,
|
||||
LLVMRustDebugEmissionKind Kind,
|
||||
uint64_t DWOId, bool SplitDebugInlining) {
|
||||
uint64_t DWOId, bool SplitDebugInlining,
|
||||
LLVMRustDebugNameTableKind TableKind) {
|
||||
auto *File = unwrapDI<DIFile>(FileRef);
|
||||
|
||||
return wrap(Builder->createCompileUnit(Lang, File, StringRef(Producer, ProducerLen),
|
||||
isOptimized, Flags, RuntimeVer,
|
||||
StringRef(SplitName, SplitNameLen),
|
||||
fromRust(Kind), DWOId, SplitDebugInlining));
|
||||
fromRust(Kind), DWOId, SplitDebugInlining,
|
||||
false, fromRust(TableKind)));
|
||||
}
|
||||
|
||||
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFile(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue