aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-10-29 15:23:46 +0000
committerGitHub <noreply@github.com>2025-10-29 15:23:46 +0000
commitaa5fe56db4777dc1dbd8e114090711068e76c770 (patch)
treed603e0645fe182c2ba17e817c917e44cd4f55c3d /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent9b513ad505ff606f66efe8ece35351eeabc4133a (diff)
downloadllvm-aa5fe56db4777dc1dbd8e114090711068e76c770.zip
llvm-aa5fe56db4777dc1dbd8e114090711068e76c770.tar.gz
llvm-aa5fe56db4777dc1dbd8e114090711068e76c770.tar.bz2
[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@ericsson.com>
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 61aa7c2f5..f17656c 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1925,6 +1925,7 @@ void ModuleBitcodeWriter::writeDIBasicType(const DIBasicType *N,
Record.push_back(N->getEncoding());
Record.push_back(N->getFlags());
Record.push_back(N->getNumExtraInhabitants());
+ Record.push_back(N->getDataSizeInBits());
Stream.EmitRecord(bitc::METADATA_BASIC_TYPE, Record, Abbrev);
Record.clear();