Skip to content

Commit 629d4d3

Browse files
committed
[llvm-debuginfo-analyzer] Add support for DWARF DW_AT_byte_size
1 parent 491619a commit 629d4d3

File tree

19 files changed

+139
-31
lines changed

19 files changed

+139
-31
lines changed

llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ toolchain name, binary file format, etc.
161161
transformations, in order to display built-in types (int, bool, etc.);
162162
parameters and arguments used during template instantiation; parent
163163
name hierarchy; array dimensions information; compiler generated
164-
elements and the underlying types associated with the types aliases.
164+
elements; type sizes and the underlying types associated with the types
165+
aliases.
165166

166167
.. code-block:: text
167168
@@ -171,6 +172,7 @@ toolchain name, binary file format, etc.
171172
=encoded: Template arguments encoded in the template name.
172173
=qualified: The element type include parents in its name.
173174
=reference: Element declaration and definition references.
175+
=size: Sizes for compound and base types.
174176
=subrange: Subrange encoding information for arrays.
175177
=typename: Template parameters.
176178
=underlying: Underlying type for type definitions.
@@ -258,6 +260,7 @@ toolchain name, binary file format, etc.
258260
=qualified
259261
=qualifier
260262
=register
263+
=size
261264
=subrange
262265
=system
263266
=typename

llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
1818
#include "llvm/Support/Casting.h"
19+
#include "llvm/Support/MathExtras.h"
1920
#include <map>
2021
#include <set>
2122
#include <vector>
@@ -65,6 +66,10 @@ using LVElementKindSet = std::set<LVElementKind>;
6566
using LVElementDispatch = std::map<LVElementKind, LVElementGetFunction>;
6667
using LVElementRequest = std::vector<LVElementGetFunction>;
6768

69+
// Assume 8-bit bytes; this is consistent, e.g. with
70+
// lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp.
71+
constexpr unsigned int DWARF_CHAR_BIT = 8u;
72+
6873
class LVElement : public LVObject {
6974
enum class Property {
7075
IsLine, // A logical line.
@@ -240,6 +245,9 @@ class LVElement : public LVObject {
240245
virtual bool isBase() const { return false; }
241246
virtual bool isTemplateParam() const { return false; }
242247

248+
uint32_t getStorageSizeInBytes() const {
249+
return llvm::divideCeil(getBitSize(), DWARF_CHAR_BIT);
250+
}
243251
virtual uint32_t getBitSize() const { return 0; }
244252
virtual void setBitSize(uint32_t Size) {}
245253

llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ enum class LVAttributeKind {
119119
Range, // --attribute=range
120120
Reference, // --attribute=reference
121121
Register, // --attribute=register
122+
Size, // --attribute=size
122123
Standard, // --attribute=standard
123124
Subrange, // --attribute=subrange
124125
System, // --attribute=system
@@ -349,6 +350,7 @@ class LVOptions {
349350
ATTRIBUTE_OPTION(Range);
350351
ATTRIBUTE_OPTION(Reference);
351352
ATTRIBUTE_OPTION(Register);
353+
ATTRIBUTE_OPTION(Size);
352354
ATTRIBUTE_OPTION(Standard);
353355
ATTRIBUTE_OPTION(Subrange);
354356
ATTRIBUTE_OPTION(System);

llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class LVScope : public LVElement {
9494
LVProperties<Property> Properties;
9595
static LVScopeDispatch Dispatch;
9696

97+
// Size in bits if this scope represents also a compound type.
98+
uint32_t BitSize = 0;
99+
97100
// Coverage factor in units (bytes).
98101
unsigned CoverageFactor = 0;
99102

@@ -271,6 +274,9 @@ class LVScope : public LVElement {
271274
bool removeElement(LVElement *Element) override;
272275
void updateLevel(LVScope *Parent, bool Moved) override;
273276

277+
uint32_t getBitSize() const override { return BitSize; }
278+
void setBitSize(uint32_t Size) override { BitSize = Size; }
279+
274280
void resolve() override;
275281
void resolveName() override;
276282
void resolveReferences() override;

llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class LVType : public LVElement {
5656
LVProperties<Property> Properties;
5757
static LVTypeDispatch Dispatch;
5858

59+
// Size in bits of a symbol of this type.
60+
uint32_t BitSize = 0;
61+
5962
// Find the current type in the given 'Targets'.
6063
LVType *findIn(const LVTypes *Targets) const;
6164

@@ -109,6 +112,10 @@ class LVType : public LVElement {
109112
virtual LVElement *getUnderlyingType() { return nullptr; }
110113
virtual void setUnderlyingType(LVElement *Element) {}
111114

115+
// Return the size in bits of an entity of this type.
116+
uint32_t getBitSize() const override { return BitSize; }
117+
void setBitSize(uint32_t Size) override { BitSize = Size; }
118+
112119
void resolveName() override;
113120
void resolveReferences() override;
114121

llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ void LVOptions::resolveDependencies() {
6767
setAttributeQualified();
6868
setAttributeQualifier();
6969
setAttributeRegister();
70+
setAttributeSize();
7071
setAttributeSubrange();
7172
setAttributeSystem();
7273
setAttributeTypename();
@@ -208,7 +209,7 @@ void LVOptions::resolveDependencies() {
208209
// 1) Sort the CUs, to get a fast compare.
209210
// 2) Encode template instantiations, so the names include template
210211
// parameter information.
211-
// 3) Include qualified types.
212+
// 3) Include qualified types and their sizes.
212213
// 4) Include any inserted abstract references.
213214
// 5) For added/missing elements add the '+' or '-' tags.
214215
if (getCompareExecute()) {
@@ -221,6 +222,7 @@ void LVOptions::resolveDependencies() {
221222
setAttributeInserted();
222223
setAttributeMissing();
223224
setAttributeQualified();
225+
setAttributeSize();
224226
}
225227

226228
// Enable formatting for printing (indentation, print children).
@@ -312,9 +314,10 @@ void LVOptions::print(raw_ostream &OS) const {
312314
<< "Range: " << getAttributeRange() << ", "
313315
<< "Reference: " << getAttributeReference() << "\n"
314316
<< "Register: " << getAttributeRegister() << ", "
317+
<< "Size: " << getAttributeSize() << ", "
315318
<< "Standard: " << getAttributeStandard() << ", "
316-
<< "Subrange: " << getAttributeSubrange() << ", "
317-
<< "System: " << getAttributeSystem() << "\n"
319+
<< "Subrange: " << getAttributeSubrange() << "\n"
320+
<< "System: " << getAttributeSystem() << ", "
318321
<< "Typename: " << getAttributeTypename() << ", "
319322
<< "Underlying: " << getAttributeUnderlying() << ", "
320323
<< "Zero: " << getAttributeZero() << "\n";

llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,9 +1018,13 @@ void LVScope::printExtra(raw_ostream &OS, bool Full) const {
10181018
// Do not print any type or name for a lexical block.
10191019
if (!getIsBlock()) {
10201020
OS << " " << formattedName(getName());
1021-
if (!getIsAggregate())
1021+
if (!getIsAggregate()) {
10221022
OS << " -> " << typeOffsetAsString()
10231023
<< formattedNames(getTypeQualifiedName(), typeAsString());
1024+
}
1025+
if (options().getAttributeSize())
1026+
if (uint32_t Size = getStorageSizeInBytes())
1027+
OS << " [Size = " << Size << "]";
10241028
}
10251029
OS << "\n";
10261030

llvm/lib/DebugInfo/LogicalView/Core/LVType.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@ void LVType::print(raw_ostream &OS, bool Full) const {
292292
}
293293

294294
void LVType::printExtra(raw_ostream &OS, bool Full) const {
295-
OS << formattedKind(kind()) << " " << formattedName(getName()) << "\n";
295+
OS << formattedKind(kind()) << " " << formattedName(getName());
296+
if (options().getAttributeSize())
297+
if (uint32_t Size = getStorageSizeInBytes())
298+
OS << " [Size = " << Size << "]";
299+
OS << "\n";
296300
}
297301

298302
//===----------------------------------------------------------------------===//

llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,7 @@ Error LVLogicalVisitor::visitKnownRecord(CVType &Record, ClassRecord &Class,
19871987
Scope->setName(Class.getName());
19881988
if (Class.hasUniqueName())
19891989
Scope->setLinkageName(Class.getUniqueName());
1990+
Scope->setBitSize(Class.getSize() * DWARF_CHAR_BIT);
19901991

19911992
if (Class.isNested()) {
19921993
Scope->setIsNested();
@@ -2455,6 +2456,7 @@ Error LVLogicalVisitor::visitKnownRecord(CVType &Record, UnionRecord &Union,
24552456
Scope->setName(Union.getName());
24562457
if (Union.hasUniqueName())
24572458
Scope->setLinkageName(Union.getUniqueName());
2459+
Scope->setBitSize(Union.getSize() * DWARF_CHAR_BIT);
24582460

24592461
if (Union.isNested()) {
24602462
Scope->setIsNested();
@@ -3208,6 +3210,7 @@ LVType *LVLogicalVisitor::createBaseType(TypeIndex TI, StringRef TypeName) {
32083210

32093211
if (createElement(TIR, SimpleKind)) {
32103212
CurrentType->setName(TypeName);
3213+
CurrentType->setBitSize(getSizeInBytesForTypeIndex(TIR) * DWARF_CHAR_BIT);
32113214
Reader->getCompileUnit()->addElement(CurrentType);
32123215
}
32133216
return CurrentType;

llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
310310
case dwarf::DW_AT_bit_size:
311311
CurrentElement->setBitSize(GetAsUnsignedConstant());
312312
break;
313+
case dwarf::DW_AT_byte_size:
314+
CurrentElement->setBitSize(GetAsUnsignedConstant() * DWARF_CHAR_BIT);
315+
break;
313316
case dwarf::DW_AT_call_file:
314317
CurrentElement->setCallFilenameIndex(IncrementFileIndex
315318
? GetAsUnsignedConstant() + 1

llvm/test/tools/llvm-debuginfo-analyzer/COFF/04-coff-missing-nested-enumerators.test

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
; references to the enumerators 'RED' and 'BLUE'. The CodeView generated
2626
; by GCC and MSVC, does include such references.
2727

28-
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
28+
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer,size \
2929
; RUN: --output-sort=name \
3030
; RUN: --print=symbols,types \
3131
; RUN: %p/Inputs/pr-46466-codeview-clang.o \
@@ -38,9 +38,9 @@
3838
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
3939
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
4040
; ONE-NEXT: [002] {Variable} extern 'S' -> 'Struct'
41-
; ONE-NEXT: [002] 1 {Struct} 'Struct'
41+
; ONE-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
4242
; ONE-NEXT: [003] {Member} public 'U' -> 'Union'
43-
; ONE-NEXT: [003] 2 {Union} 'Union'
43+
; ONE-NEXT: [003] 2 {Union} 'Union' [Size = 1]
4444
; ONE-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'int'
4545
; ONE-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
4646
; ONE-NEXT: [005] {Enumerator} 'RED' = '0x0'
@@ -51,9 +51,9 @@
5151
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
5252
; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'
5353
; ONE-NEXT: [002] {Variable} extern 'S' -> 'Struct'
54-
; ONE-NEXT: [002] 1 {Struct} 'Struct'
54+
; ONE-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
5555
; ONE-NEXT: [003] {Member} public 'U' -> 'Union'
56-
; ONE-NEXT: [003] 2 {Union} 'Union'
56+
; ONE-NEXT: [003] 2 {Union} 'Union' [Size = 1]
5757
; ONE-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'int'
5858
; ONE-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
5959
; ONE-NEXT: [005] {Enumerator} 'RED' = '0x0'
@@ -62,7 +62,7 @@
6262
; showing just the logical types that are 'Enumerator' and its
6363
; parents. The logical view is sorted by the types name.
6464

65-
; RUN: llvm-debuginfo-analyzer --attribute=level,format \
65+
; RUN: llvm-debuginfo-analyzer --attribute=level,format,size \
6666
; RUN: --output-sort=name \
6767
; RUN: --select-types=Enumerator \
6868
; RUN: --report=parents \
@@ -74,8 +74,8 @@
7474
; TWO-NEXT: [000] {File} 'pr-46466-codeview-clang.o' -> COFF-x86-64
7575
; TWO-EMPTY:
7676
; TWO-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
77-
; TWO-NEXT: [002] 1 {Struct} 'Struct'
78-
; TWO-NEXT: [003] 2 {Union} 'Union'
77+
; TWO-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
78+
; TWO-NEXT: [003] 2 {Union} 'Union' [Size = 1]
7979
; TWO-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'int'
8080
; TWO-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
8181
; TWO-NEXT: [005] {Enumerator} 'RED' = '0x0'
@@ -84,8 +84,8 @@
8484
; TWO-NEXT: [000] {File} 'pr-46466-codeview-msvc.o' -> COFF-x86-64
8585
; TWO-EMPTY:
8686
; TWO-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
87-
; TWO-NEXT: [002] 1 {Struct} 'Struct'
88-
; TWO-NEXT: [003] 2 {Union} 'Union'
87+
; TWO-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
88+
; TWO-NEXT: [003] 2 {Union} 'Union' [Size = 1]
8989
; TWO-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'int'
9090
; TWO-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
9191
; TWO-NEXT: [005] {Enumerator} 'RED' = '0x0'

llvm/test/tools/llvm-debuginfo-analyzer/COFF/06-coff-full-logical-view.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
; ONE-NEXT: {File} 'test.cpp'
3535
; ONE-NEXT: {Public} 'foo' [0x0000000000:0x0000000046]
3636
; ONE-NEXT: [0x0000000000][002] {TypeAlias} 'INTPTR' -> [0x0000001001]'* const int'
37-
; ONE-NEXT: [0x0000000030][002] {BaseType} 'bool'
37+
; ONE-NEXT: [0x0000000030][002] {BaseType} 'bool' [Size = 1]
3838
; ONE-NEXT: [0x0000000000][002] {Function} extern not_inlined 'foo' -> [0x0000000074]'int'
3939
; ONE-NEXT: [0x0000000000][003] {Range} Lines 2:9 [0x0000000000:0x0000000046]
4040
; ONE-NEXT: [0x0000000000][003] {Linkage} 0x1 '?foo@@YAHPEBHI_N@Z'
@@ -80,8 +80,8 @@
8080
; ONE-NEXT: [0x000000003e][003] {Code} 'movl 0x1c(%rsp), %eax'
8181
; ONE-NEXT: [0x0000000042][003] {Code} 'addq $0x20, %rsp'
8282
; ONE-NEXT: [0x0000000046][003] {Code} 'retq'
83-
; ONE-NEXT: [0x0000000074][002] {BaseType} 'int'
84-
; ONE-NEXT: [0x0000000075][002] {BaseType} 'unsigned'
83+
; ONE-NEXT: [0x0000000074][002] {BaseType} 'int' [Size = 4]
84+
; ONE-NEXT: [0x0000000075][002] {BaseType} 'unsigned' [Size = 4]
8585
; ONE-EMPTY:
8686
; ONE-NEXT: -----------------------------
8787
; ONE-NEXT: Element Total Printed

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
; references to the enumerators 'RED' and 'BLUE'. The DWARF generated
2626
; by GCC, does include such references.
2727

28-
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
28+
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer,size \
2929
; RUN: --output-sort=name \
3030
; RUN: --print=symbols,types \
3131
; RUN: %p/Inputs/pr-46466-dwarf-clang.o \
@@ -38,7 +38,7 @@
3838
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
3939
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
4040
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
41-
; ONE-NEXT: [002] 1 {Struct} 'Struct'
41+
; ONE-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
4242
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
4343
; ONE-EMPTY:
4444
; ONE-NEXT: Logical View:
@@ -47,9 +47,9 @@
4747
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
4848
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
4949
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
50-
; ONE-NEXT: [002] 1 {Struct} 'Struct'
50+
; ONE-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
5151
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
52-
; ONE-NEXT: [003] 2 {Union} 'Union'
52+
; ONE-NEXT: [003] 2 {Union} 'Union' [Size = 1]
5353
; ONE-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'unsigned int'
5454
; ONE-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
5555
; ONE-NEXT: [005] {Enumerator} 'RED' = '0x0'
@@ -58,7 +58,7 @@
5858
; showing just the logical types that are 'Enumerator' and its
5959
; parents. The logical view is sorted by the types name.
6060

61-
; RUN: llvm-debuginfo-analyzer --attribute=level,format \
61+
; RUN: llvm-debuginfo-analyzer --attribute=level,format,size \
6262
; RUN: --output-sort=name \
6363
; RUN: --select-types=Enumerator \
6464
; RUN: --report=parents \
@@ -75,8 +75,8 @@
7575
; TWO-NEXT: [000] {File} 'pr-46466-dwarf-gcc.o' -> elf64-x86-64
7676
; TWO-EMPTY:
7777
; TWO-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
78-
; TWO-NEXT: [002] 1 {Struct} 'Struct'
79-
; TWO-NEXT: [003] 2 {Union} 'Union'
78+
; TWO-NEXT: [002] 1 {Struct} 'Struct' [Size = 1]
79+
; TWO-NEXT: [003] 2 {Union} 'Union' [Size = 1]
8080
; TWO-NEXT: [004] 3 {Enumeration} 'NestedEnum' -> 'unsigned int'
8181
; TWO-NEXT: [005] {Enumerator} 'BLUE' = '0x1'
8282
; TWO-NEXT: [005] {Enumerator} 'RED' = '0x0'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
; ONE-NEXT: {File} 'test.cpp'
3333
; ONE-NEXT: {Public} 'foo' [0x0000000000:0x000000003a]
3434
; ONE-NEXT: [0x000000000b][002] {Range} Lines 2:9 [0x0000000000:0x000000003a]
35-
; ONE-NEXT: [0x00000000bc][002] {BaseType} 'bool'
36-
; ONE-NEXT: [0x0000000099][002] {BaseType} 'int'
37-
; ONE-NEXT: [0x00000000b5][002] {BaseType} 'unsigned int'
35+
; ONE-NEXT: [0x00000000bc][002] {BaseType} 'bool' [Size = 1]
36+
; ONE-NEXT: [0x0000000099][002] {BaseType} 'int' [Size = 4]
37+
; ONE-NEXT: [0x00000000b5][002] {BaseType} 'unsigned int' [Size = 4]
3838
; ONE-EMPTY:
3939
; ONE-NEXT: [0x00000000a0][002] {Source} '/data/projects/tests/input/general/test.cpp'
4040
; ONE-NEXT: [0x00000000a0][002] 1 {TypeAlias} 'INTPTR' -> [0x00000000ab]'* const int'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/dw-at-specification.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
; an assert in the LVDWARFReader:
1414
; $ clang++ -g -c dw-at-specification.cpp -o dw-at-specification.o
1515

16-
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
16+
; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer,size \
1717
; RUN: --output-sort=name \
1818
; RUN: --print=symbols \
1919
; RUN: %p/Inputs/dw-at-specification.o 2>&1 | \
@@ -25,5 +25,5 @@
2525
; CHECK: [001] {CompileUnit} 'a.cpp'
2626
; CHECK: [002] {Producer} 'clang version 11.0.0 ({{.*}})'
2727
; CHECK: [002] {Variable} 'Arr' -> 'const int [3]'
28-
; CHECK: [002] 1 {Struct} 'S'
28+
; CHECK: [002] 1 {Struct} 'S' [Size = 1]
2929
; CHECK: [003] 2 {Member} extern public 'Arr' -> 'const int [1]'

llvm/tools/llvm-debuginfo-analyzer/Options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ cl::list<LVAttributeKind> cmdline::AttributeOptions(
114114
"Element declaration and definition references."),
115115
clEnumValN(LVAttributeKind::Register, "register",
116116
"Processor register names."),
117+
clEnumValN(LVAttributeKind::Size, "size", "Type sizes."),
117118
clEnumValN(LVAttributeKind::Standard, "standard",
118119
"Basic attributes alias."),
119120
clEnumValN(LVAttributeKind::Subrange, "subrange",

0 commit comments

Comments
 (0)