Skip to content

Commit 8cde110

Browse files
Add support for 32 bit Addresses in MCCAS debug info
1 parent 39ad1cf commit 8cde110

File tree

8 files changed

+188
-42
lines changed

8 files changed

+188
-42
lines changed

llvm/include/llvm/MC/MCMachOCASWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class MachOCASWriter : public MCObjectWriter {
5555
std::optional<MCTargetOptions::ResultCallBackTy> CallBack,
5656
raw_pwrite_stream *CasIDOS = nullptr);
5757

58+
uint8_t getAddressSize() { return Target.isArch32Bit() ? 4 : 8; }
59+
5860
void recordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout,
5961
const MCFragment *Fragment, const MCFixup &Fixup,
6062
MCValue Target, uint64_t &FixedValue) override {

llvm/include/llvm/MCCAS/MCCASObjectV1.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ class MCCASReader {
639639

640640
Triple::ArchType getArch() { return Target.getArch(); }
641641

642+
uint8_t getAddressSize() { return Target.isArch32Bit() ? 4 : 8; }
643+
642644
Expected<uint64_t> materializeGroup(cas::ObjectRef ID);
643645
Expected<uint64_t> materializeDebugAbbrevUnopt(ArrayRef<cas::ObjectRef> Refs);
644646
Expected<uint64_t> materializeSection(cas::ObjectRef ID, raw_ostream *Stream);
@@ -740,7 +742,7 @@ Error visitDebugInfo(
740742
std::function<void(dwarf::Tag, uint64_t)> StartTagCallback,
741743
std::function<void(dwarf::Attribute, dwarf::Form, StringRef, bool)>
742744
AttrCallback,
743-
std::function<void(bool)> EndTagCallback,
745+
std::function<void(bool)> EndTagCallback, uint8_t AddressSize,
744746
std::function<void(StringRef)> NewBlockCallback = [](StringRef) {});
745747

746748
} // namespace v1

llvm/lib/MCCAS/MCCASObjectV1.cpp

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static Error materializeDebugInfoOpt(MCCASReader &Reader,
505505
StringRef FormData, bool) {
506506
if (Form == dwarf::Form::DW_FORM_ref4_cas ||
507507
Form == dwarf::Form::DW_FORM_strp_cas) {
508-
DataExtractor Extractor(FormData, true, 8);
508+
DataExtractor Extractor(FormData, true, Reader.getAddressSize());
509509
DataExtractor::Cursor Cursor(0);
510510
uint64_t Data64 = Extractor.getULEB128(Cursor);
511511
if (!Cursor)
@@ -529,7 +529,7 @@ static Error materializeDebugInfoOpt(MCCASReader &Reader,
529529

530530
if (auto E = visitDebugInfo(TotAbbrevEntries, std::move(MaybeTopRef),
531531
HeaderCallback, StartTagCallback, AttrCallback,
532-
EndTagCallback))
532+
EndTagCallback, Reader.getAddressSize()))
533533
return E;
534534
}
535535
return Error::success();
@@ -826,10 +826,11 @@ getLineTableLengthInfoAndVersion(DWARFDataExtractor &LineTableDataReader,
826826
auto AddressSize = LineTableDataReader.getU8(OffsetPtr, &Err);
827827
if (Err)
828828
return std::move(Err);
829-
if (AddressSize != 8)
829+
if (AddressSize != LineTableDataReader.getAddressSize())
830830
return createStringError(
831831
inconvertibleErrorCode(),
832-
"Address size is not 8 bytes, unsupported architecture for MCCAS!");
832+
"Address size in line table header is not the same as Address size "
833+
"for the target architecture, something went really wrong!");
833834
LineTableDataReader.getU8(OffsetPtr, &Err);
834835
if (Err)
835836
return std::move(Err);
@@ -956,9 +957,12 @@ handleStandardOpcodesForLineTable(DWARFDataExtractor &LineTableDataReader,
956957
static Expected<std::pair<uint64_t, uint64_t>>
957958
getOpcodeAndOperandSize(StringRef DistinctData, StringRef LineTableData,
958959
uint64_t DistinctOffset, uint64_t LineTableOffset,
959-
bool IsLittleEndian, uint8_t OpcodeBase) {
960-
DWARFDataExtractor LineTableDataReader(LineTableData, IsLittleEndian, 8);
961-
DWARFDataExtractor DistinctDataReader(DistinctData, IsLittleEndian, 8);
960+
bool IsLittleEndian, uint8_t OpcodeBase,
961+
uint8_t AddressSize) {
962+
DWARFDataExtractor LineTableDataReader(LineTableData, IsLittleEndian,
963+
AddressSize);
964+
DWARFDataExtractor DistinctDataReader(DistinctData, IsLittleEndian,
965+
AddressSize);
962966
DWARFDataExtractor::Cursor LineTableCursor(LineTableOffset);
963967
DWARFDataExtractor::Cursor DistinctCursor(DistinctOffset);
964968

@@ -1068,7 +1072,7 @@ materializeDebugLineSection(MCCASReader &Reader,
10681072
assert((Endian == endianness::big || Endian == endianness::little) &&
10691073
"Endian must be either big or little");
10701074
DWARFDataExtractor LineTableDataReader(Data, Endian == endianness::little,
1071-
8);
1075+
Reader.getAddressSize());
10721076
auto Prologue = parseLineTableHeaderAndSkip(LineTableDataReader);
10731077
if (!Prologue)
10741078
return Prologue.takeError();
@@ -1093,7 +1097,7 @@ materializeDebugLineSection(MCCASReader &Reader,
10931097
"Endian must be either big or little");
10941098
auto Sizes = getOpcodeAndOperandSize(
10951099
toStringRef(DistinctData), Data, DistinctOffset, LineTableOffset,
1096-
Endian == endianness::little, OpcodeBase);
1100+
Endian == endianness::little, OpcodeBase, Reader.getAddressSize());
10971101
if (!Sizes)
10981102
return Sizes.takeError();
10991103
// Copy opcode and operand, only in the case of DW_LNS_set_file, the
@@ -1732,11 +1736,11 @@ static Expected<size_t> getSizeFromDwarfHeader(DataExtractor &Extractor,
17321736
/// contained in CUData, as well as the total number of bytes taken by the CU.
17331737
/// Note: this is different from the length field of the Dwarf header, which
17341738
/// does not account for the header size.
1735-
static Expected<CUInfo>
1736-
getAndSetDebugAbbrevOffsetAndSkip(MutableArrayRef<char> CUData,
1737-
endianness Endian,
1738-
std::optional<uint32_t> NewOffset) {
1739-
DataExtractor Extractor(toStringRef(CUData), Endian == endianness::little, 8);
1739+
static Expected<CUInfo> getAndSetDebugAbbrevOffsetAndSkip(
1740+
MutableArrayRef<char> CUData, endianness Endian,
1741+
std::optional<uint32_t> NewOffset, uint8_t AddressSize) {
1742+
DataExtractor Extractor(toStringRef(CUData), Endian == endianness::little,
1743+
AddressSize);
17401744
DataExtractor::Cursor Cursor(0);
17411745
Expected<size_t> Size = getSizeFromDwarfHeader(Extractor, Cursor);
17421746
if (!Size)
@@ -1760,13 +1764,14 @@ getAndSetDebugAbbrevOffsetAndSkip(MutableArrayRef<char> CUData,
17601764
return createStringError(
17611765
inconvertibleErrorCode(),
17621766
"Unit type is not DW_UT_compile, and is incompatible with MCCAS!");
1763-
uint8_t AddressSize = Extractor.getU8(Cursor);
1767+
uint8_t HeaderAddressSize = Extractor.getU8(Cursor);
17641768
if (!Cursor)
17651769
return Cursor.takeError();
1766-
if (AddressSize != 8)
1770+
if (HeaderAddressSize != AddressSize)
17671771
return createStringError(
17681772
inconvertibleErrorCode(),
1769-
"Address size is not 8 bytes, unsupported architecture for MCCAS!");
1773+
"Address size in Compile Unit header is not the same as Address size "
1774+
"for the target architecture, something went really wrong!");
17701775
}
17711776

17721777
// TODO: Handle Dwarf 64 format, which uses 8 bytes.
@@ -1821,7 +1826,8 @@ MCCASBuilder::splitDebugInfoSectionData(MutableArrayRef<char> DebugInfoData) {
18211826
// CU splitting loop.
18221827
while (!DebugInfoData.empty()) {
18231828
Expected<CUInfo> Info = getAndSetDebugAbbrevOffsetAndSkip(
1824-
DebugInfoData, Asm.getBackend().Endian, /*NewOffset*/ 0);
1829+
DebugInfoData, Asm.getBackend().Endian, /*NewOffset*/ 0,
1830+
ObjectWriter.getAddressSize());
18251831
if (!Info)
18261832
return Info.takeError();
18271833
Split.SplitCUData.push_back(DebugInfoData.take_front(Info->CUSize));
@@ -1987,13 +1993,16 @@ Error InMemoryCASDWARFObject::partitionCUData(ArrayRef<char> DebugInfoData,
19871993
uint16_t DwarfVersion) {
19881994
StringRef AbbrevSectionContribution =
19891995
getAbbrevSection().drop_front(AbbrevOffset);
1990-
DataExtractor Data(AbbrevSectionContribution, isLittleEndian(), 8);
1996+
DataExtractor Data(AbbrevSectionContribution, isLittleEndian(),
1997+
Builder.ObjectWriter.getAddressSize());
19911998
DWARFDebugAbbrev Abbrev(Data);
19921999
uint64_t OffsetPtr = 0;
19932000
DWARFUnitHeader Header;
19942001
DWARFSection Section = {toStringRef(DebugInfoData), 0 /*Address*/};
19952002
if (Error E = Header.extract(
1996-
*Ctx, DWARFDataExtractor(*this, Section, isLittleEndian(), 8),
2003+
*Ctx,
2004+
DWARFDataExtractor(*this, Section, isLittleEndian(),
2005+
Builder.ObjectWriter.getAddressSize()),
19972006
&OffsetPtr, DWARFSectionKind::DW_SECT_INFO))
19982007
return E;
19992008

@@ -2096,7 +2105,8 @@ MCCASBuilder::createOptimizedLineSection(StringRef DebugLineStrRef) {
20962105
assert((Endian == endianness::big || Endian == endianness::little) &&
20972106
"Endian must be either big or little");
20982107
DWARFDataExtractor LineTableDataReader(DebugLineStrRef,
2099-
Endian == endianness::little, 8);
2108+
Endian == endianness::little,
2109+
ObjectWriter.getAddressSize());
21002110
auto Prologue = parseLineTableHeaderAndSkip(LineTableDataReader);
21012111
if (!Prologue)
21022112
return Prologue.takeError();
@@ -3138,20 +3148,19 @@ Error DIEVisitor::visitDIEAttrs(DataExtractor &Extractor,
31383148
StringRef DIEData,
31393149
ArrayRef<AbbrevContent> DIEContents) {
31403150
constexpr auto IsLittleEndian = true;
3141-
constexpr auto AddrSize = 8;
3142-
auto FormParams =
3143-
dwarf::FormParams{DwarfVersion, AddrSize, dwarf::DwarfFormat::DWARF32};
3151+
auto FormParams = dwarf::FormParams{DwarfVersion, Extractor.getAddressSize(),
3152+
dwarf::DwarfFormat::DWARF32};
31443153

31453154
for (auto Contents : DIEContents) {
31463155
bool DataInDistinct = Contents.FormInDistinctData;
31473156
auto &ExtractorForData = DataInDistinct ? DistinctExtractor : Extractor;
31483157
auto &CursorForData = DataInDistinct ? DistinctCursor : Cursor;
31493158
StringRef DataToUse = DataInDistinct ? DistinctData : DIEData;
31503159
Expected<uint64_t> FormSize =
3151-
Contents.FormSize
3152-
? *Contents.FormSize
3153-
: getFormSize(Contents.Form, FormParams, DataToUse,
3154-
CursorForData.tell(), IsLittleEndian, AddrSize);
3160+
Contents.FormSize ? *Contents.FormSize
3161+
: getFormSize(Contents.Form, FormParams, DataToUse,
3162+
CursorForData.tell(), IsLittleEndian,
3163+
Extractor.getAddressSize());
31553164
if (!FormSize)
31563165
return FormSize.takeError();
31573166

@@ -3252,9 +3261,9 @@ static std::optional<uint8_t> getNonULEBFormSize(dwarf::Form Form,
32523261
}
32533262

32543263
Error DIEVisitor::materializeAbbrevDIE(unsigned AbbrevIdx) {
3255-
constexpr auto AddrSize = 8;
32563264
auto FormParams =
3257-
dwarf::FormParams{DwarfVersion, AddrSize, dwarf::DwarfFormat::DWARF32};
3265+
dwarf::FormParams{DwarfVersion, DistinctExtractor.getAddressSize(),
3266+
dwarf::DwarfFormat::DWARF32};
32583267

32593268
AbbrevEntryReader AbbrevReader =
32603269
getAbbrevEntryReader(AbbrevEntries, AbbrevIdx);
@@ -3292,9 +3301,10 @@ Error DIEVisitor::materializeAbbrevDIE(unsigned AbbrevIdx) {
32923301
/// previous stack frame.
32933302
static void popStack(DataExtractor &Extractor, DataExtractor::Cursor &Cursor,
32943303
StringRef &Data,
3295-
std::stack<std::pair<StringRef, unsigned>> &StackOfNodes) {
3304+
std::stack<std::pair<StringRef, unsigned>> &StackOfNodes,
3305+
uint8_t AddressSize) {
32963306
auto DataAndOffset = StackOfNodes.top();
3297-
Extractor = DataExtractor(DataAndOffset.first, true, 8);
3307+
Extractor = DataExtractor(DataAndOffset.first, true, AddressSize);
32983308
Data = DataAndOffset.first;
32993309
Cursor.seek(DataAndOffset.second);
33003310
StackOfNodes.pop();
@@ -3310,7 +3320,7 @@ Error DIEVisitor::visitDIERef(ArrayRef<DIEDataRef> &DIEChildrenStack) {
33103320
std::stack<std::pair<StringRef, unsigned>> StackOfNodes;
33113321
auto Data = DIEChildrenStack.empty() ? StringRef()
33123322
: DIEChildrenStack.front().getData();
3313-
DataExtractor Extractor(Data, true, 8);
3323+
DataExtractor Extractor(Data, true, DistinctExtractor.getAddressSize());
33143324
DataExtractor::Cursor Cursor(0);
33153325

33163326
while (!DistinctExtractor.eof(DistinctCursor)) {
@@ -3327,7 +3337,8 @@ Error DIEVisitor::visitDIERef(ArrayRef<DIEDataRef> &DIEChildrenStack) {
33273337
if (AbbrevIdx == getEndOfDIESiblingsMarker()) {
33283338
EndTagCallback(true /*HadChildren*/);
33293339
if (!StackOfNodes.empty() && Extractor.eof(Cursor))
3330-
popStack(Extractor, Cursor, Data, StackOfNodes);
3340+
popStack(Extractor, Cursor, Data, StackOfNodes,
3341+
DistinctExtractor.getAddressSize());
33313342
continue;
33323343
}
33333344

@@ -3339,7 +3350,7 @@ Error DIEVisitor::visitDIERef(ArrayRef<DIEDataRef> &DIEChildrenStack) {
33393350
DIEChildrenStack = DIEChildrenStack.drop_front();
33403351
Data = DIEChildrenStack.front().getData();
33413352
NewBlockCallback(DIEChildrenStack.front().getID().toString());
3342-
Extractor = DataExtractor(Data, true, 8);
3353+
Extractor = DataExtractor(Data, true, DistinctExtractor.getAddressSize());
33433354
Cursor.seek(0);
33443355
continue;
33453356
}
@@ -3358,7 +3369,8 @@ Error DIEVisitor::visitDIERef(ArrayRef<DIEDataRef> &DIEChildrenStack) {
33583369
// parent's siblings that may exist.
33593370
if (!AbbrevEntryCacheVal.HasChildren) {
33603371
if (!StackOfNodes.empty() && Extractor.eof(Cursor))
3361-
popStack(Extractor, Cursor, Data, StackOfNodes);
3372+
popStack(Extractor, Cursor, Data, StackOfNodes,
3373+
DistinctExtractor.getAddressSize());
33623374
EndTagCallback(false /*HadChildren*/);
33633375
}
33643376
}
@@ -3398,7 +3410,7 @@ Error mccasformats::v1::visitDebugInfo(
33983410
std::function<void(dwarf::Tag, uint64_t)> StartTagCallback,
33993411
std::function<void(dwarf::Attribute, dwarf::Form, StringRef, bool)>
34003412
AttrCallback,
3401-
std::function<void(bool)> EndTagCallback,
3413+
std::function<void(bool)> EndTagCallback, uint8_t AddressSize,
34023414
std::function<void(StringRef)> NewBlockCallback) {
34033415

34043416
Expected<LoadedDIETopLevel> LoadedTopRef =
@@ -3417,7 +3429,7 @@ Error mccasformats::v1::visitDebugInfo(
34173429
return E;
34183430
DistinctData = toStringRef(OutBuff);
34193431
#endif
3420-
DataExtractor DistinctExtractor(DistinctData, true, 8);
3432+
DataExtractor DistinctExtractor(DistinctData, true, AddressSize);
34213433
DataExtractor::Cursor DistinctCursor(0);
34223434

34233435
auto Size = getSizeFromDwarfHeader(DistinctExtractor, DistinctCursor);

llvm/test/CAS/armv7-cas-dwarf5.ll

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: rm -rf %t && mkdir -p %t
2+
; RUN: llc --filetype=obj --mccas-verify --cas-backend --cas=%t/cas %s -o %t/watchos-cas-dwarf5.o
3+
; RUN: llvm-dwarfdump %t/watchos-cas-dwarf5.o | FileCheck %s
4+
; CHECK: .debug_info contents:
5+
; CHECK-NEXT: 0x{{[0-9a-f]+}}: Compile Unit: length = 0x{{[0-9a-f]+}}, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x04
6+
; REQUIRES: arm-registered-target
7+
8+
; ModuleID = '/tmp/a.cpp'
9+
source_filename = "/tmp/a.cpp"
10+
target datalayout = "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
11+
target triple = "thumbv7-apple-ios5.0.0"
12+
13+
@a = global i32 0, align 4, !dbg !0
14+
15+
!llvm.dbg.cu = !{!2}
16+
!llvm.module.flags = !{!7, !8, !9, !10, !11, !12}
17+
!llvm.ident = !{!13}
18+
19+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
20+
!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true)
21+
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0git ([email protected]:apple/llvm-project.git 6fa917db4566cab002b856a66e8ebba16f0e20a4)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")
22+
!3 = !DIFile(filename: "/tmp/a.cpp", directory: "/Users/shubham/Development/llvm-project-cas/llvm-project/build_ninja", checksumkind: CSK_MD5, checksum: "5b8ff0b44df608b9bb47431c2b46f6ce")
23+
!4 = !{!0}
24+
!5 = !DIFile(filename: "/tmp/a.cpp", directory: "", checksumkind: CSK_MD5, checksum: "5b8ff0b44df608b9bb47431c2b46f6ce")
25+
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
26+
!7 = !{i32 7, !"Dwarf Version", i32 5}
27+
!8 = !{i32 2, !"Debug Info Version", i32 3}
28+
!9 = !{i32 1, !"wchar_size", i32 4}
29+
!10 = !{i32 1, !"min_enum_size", i32 4}
30+
!11 = !{i32 8, !"PIC Level", i32 2}
31+
!12 = !{i32 7, !"frame-pointer", i32 2}
32+
!13 = !{!"clang version 19.0.0git ([email protected]:apple/llvm-project.git 6fa917db4566cab002b856a66e8ebba16f0e20a4)"}

llvm/test/CAS/armv7-cas.ll

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: rm -rf %t && mkdir -p %t
2+
; RUN: llc --filetype=obj --mccas-verify --cas-backend --cas=%t/cas %s -o %t/watchos-cas.o
3+
; RUN: llvm-dwarfdump %t/watchos-cas.o | FileCheck %s
4+
; CHECK: .debug_info contents:
5+
; CHECK-NEXT: 0x{{[0-9a-f]+}}: Compile Unit: length = 0x{{[0-9a-f]+}}, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x04
6+
; REQUIRES: arm-registered-target
7+
8+
; ModuleID = '/tmp/a.cpp'
9+
source_filename = "/tmp/a.cpp"
10+
target datalayout = "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
11+
target triple = "thumbv7-apple-ios5.0.0"
12+
13+
@a = global i32 0, align 4, !dbg !0
14+
15+
!llvm.dbg.cu = !{!2}
16+
!llvm.module.flags = !{!7, !8, !9, !10, !11, !12}
17+
!llvm.ident = !{!13}
18+
19+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
20+
!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true)
21+
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0git ([email protected]:apple/llvm-project.git 6fa917db4566cab002b856a66e8ebba16f0e20a4)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")
22+
!3 = !DIFile(filename: "/tmp/a.cpp", directory: "/Users/shubham/Development/llvm-project-cas/llvm-project/build_ninja")
23+
!4 = !{!0}
24+
!5 = !DIFile(filename: "/tmp/a.cpp", directory: "")
25+
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
26+
!7 = !{i32 7, !"Dwarf Version", i32 4}
27+
!8 = !{i32 2, !"Debug Info Version", i32 3}
28+
!9 = !{i32 1, !"wchar_size", i32 4}
29+
!10 = !{i32 1, !"min_enum_size", i32 4}
30+
!11 = !{i32 8, !"PIC Level", i32 2}
31+
!12 = !{i32 7, !"frame-pointer", i32 2}
32+
!13 = !{!"clang version 19.0.0git ([email protected]:apple/llvm-project.git 6fa917db4566cab002b856a66e8ebba16f0e20a4)"}

llvm/test/CAS/watchos-cas-dwarf5.ll

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: rm -rf %t && mkdir -p %t
2+
; RUN: llc --filetype=obj --mccas-verify --cas-backend --cas=%t/cas %s -o %t/watchos-cas-dwarf5.o
3+
; RUN: llvm-dwarfdump %t/watchos-cas-dwarf5.o | FileCheck %s
4+
; CHECK: .debug_info contents:
5+
; CHECK-NEXT: 0x{{[0-9a-f]+}}: Compile Unit: length = 0x{{[0-9a-f]+}}, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x04
6+
; REQUIRES: arm-registered-target
7+
8+
; ModuleID = '/tmp/a.cpp'
9+
source_filename = "/tmp/a.cpp"
10+
target datalayout = "e-m:o-p:32:32-i64:64-i128:128-n32:64-S128"
11+
target triple = "arm64_32-apple-watchos11.0.0"
12+
13+
@a = global i32 0, align 4, !dbg !0
14+
15+
!llvm.dbg.cu = !{!2}
16+
!llvm.module.flags = !{!7, !8, !9, !10, !11, !12}
17+
!llvm.ident = !{!13}
18+
19+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
20+
!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true)
21+
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0git ([email protected]:apple/llvm-project.git eb2f92059e91645250d108b3331cc28243aeadbc)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")
22+
!3 = !DIFile(filename: "/tmp/a.cpp", directory: "/Users/shubham/Development/llvm-project-cas/llvm-project/build_ninja", checksumkind: CSK_MD5, checksum: "5b8ff0b44df608b9bb47431c2b46f6ce")
23+
!4 = !{!0}
24+
!5 = !DIFile(filename: "/tmp/a.cpp", directory: "", checksumkind: CSK_MD5, checksum: "5b8ff0b44df608b9bb47431c2b46f6ce")
25+
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
26+
!7 = !{i32 7, !"Dwarf Version", i32 5}
27+
!8 = !{i32 2, !"Debug Info Version", i32 3}
28+
!9 = !{i32 1, !"wchar_size", i32 4}
29+
!10 = !{i32 8, !"PIC Level", i32 2}
30+
!11 = !{i32 7, !"uwtable", i32 1}
31+
!12 = !{i32 7, !"frame-pointer", i32 1}
32+
!13 = !{!"clang version 19.0.0git ([email protected]:apple/llvm-project.git eb2f92059e91645250d108b3331cc28243aeadbc)"}

0 commit comments

Comments
 (0)