[all-commits] [llvm/llvm-project] aa5fe5: [DebugInfo] Add dataSize to DIBasicType to add DW_...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Wed Oct 29 08:24:09 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aa5fe56db4777dc1dbd8e114090711068e76c770
      https://github.com/llvm/llvm-project/commit/aa5fe56db4777dc1dbd8e114090711068e76c770
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2025-10-29 (Wed, 29 Oct 2025)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    A clang/test/DebugInfo/Generic/bit-int.c
    M llvm/include/llvm/IR/DIBuilder.h
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/Bitcode/Reader/MetadataLoader.cpp
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/DIBuilder.cpp
    M llvm/lib/IR/DebugInfoMetadata.cpp
    M llvm/lib/IR/LLVMContextImpl.h
    A llvm/test/Bitcode/dbg-data-size-roundtrip.ll
    M llvm/test/DebugInfo/X86/base-type-size.ll
    A llvm/test/DebugInfo/bit-int-size.ll

  Log Message:
  -----------
  [DebugInfo] Add dataSize to DIBasicType to add DW_AT_bit_size to _BitInt types (#164372)

DW_TAG_base_type DIEs are permitted to have both byte_size and bit_size
attributes "If the value of an object of the given type does not fully
occupy the storage described by a byte size attribute"

* Add DataSizeInBits to DIBasicType (`DIBasicType(... dataSize: n ...)` in IR).
* Change Clang to add DataSizeInBits to _BitInt type metadata.
* Change LLVM to add DW_AT_bit_size to base_type DIEs that have non-zero
  DataSizeInBits.

TODO: Do we need to emit DW_AT_data_bit_offset for big endian targets?
See discussion on the PR.

Fixes [#61952](https://github.com/llvm/llvm-project/issues/61952)

---------

Co-authored-by: David Stenberg <david.stenberg at ericsson.com>



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