[all-commits] [llvm/llvm-project] 4a5f82: [MC] Fix DWARF file table for files with empty DWA...

Aleksei Vetrov via All-commits all-commits at lists.llvm.org
Thu Dec 12 08:52:13 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a5f82b43be7328d7b7b4cd9912487fd3f284b49
      https://github.com/llvm/llvm-project/commit/4a5f82b43be7328d7b7b4cd9912487fd3f284b49
  Author: Aleksei Vetrov <vetaleha at gmail.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M llvm/lib/MC/MCParser/AsmParser.cpp
    A llvm/test/MC/ELF/debug-hash-file-empty-dwarf.s
    M llvm/test/MC/ELF/debug-hash-file.s

  Log Message:
  -----------
  [MC] Fix DWARF file table for files with empty DWARF (#119572)

Update root file in DWARF file/line table as soon as we see the first
"#line" directive.

This was moved from "enabledGenDwarfForAssembly", which is called right
before we emit DWARF information. But if the file is empty or contains
expressions that doesn't need DWARF, it is never called, leaving an
original root file and not the file in the "#line" directive.

Add a test checking for this case.

This is reapply of #119229 with the following fix:

"MCContext::setMCLineTableRootFile" has the effect of adding
".debug_line" section to the output, even if DWARF generation is
disabled. Add a check and a test for this case.

Fixes: #119020
Fixes: #119229



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list