[all-commits] [llvm/llvm-project] 549219: [llvm][AsmWriter] Don't skip zero-valued DwarfEnum...

Michael Buch via All-commits all-commits at lists.llvm.org
Thu Feb 6 10:56:12 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5492199a9aa4b5d31c38e36928ac153570091d6d
      https://github.com/llvm/llvm-project/commit/5492199a9aa4b5d31c38e36928ac153570091d6d
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-02-06 (Thu, 06 Feb 2025)

  Changed paths:
    M llvm/lib/IR/AsmWriter.cpp

  Log Message:
  -----------
  [llvm][AsmWriter] Don't skip zero-valued DwarfEnum MDField when ShouldSkipZero is not set (#126044)

I ran into this while working on a different patch where I'm emitting a
zero-valued DWARF enum field which shouldn't be skipped.

This patch checks the (currently unused) `ShouldSkipZero` before
deciding to skip printing this field. Based on git history this seems
like an oversight from the initial refactor that introduced this. We
have a similar check in `printInt`.

Wasn't sure how to best test this, but tests in an upcoming patch rely
on this functionality (see
https://github.com/llvm/llvm-project/pull/126045).

Currently the only place `ShouldSkipZero` is set to `false` is when
emitting the `DW_LANG_` enum. But the language codes start at `0x1`. So
it never exercised this codepath (and we should probably just make it
not pass this parameter).



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