Skip to content

Commit 627ed58

Browse files
committed
[llvm] IDS auto codemod for ObjectYAML library
1 parent c2f0af5 commit 627ed58

File tree

8 files changed

+116
-108
lines changed

8 files changed

+116
-108
lines changed

llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_OBJECTYAML_CODEVIEWYAMLDEBUGSECTIONS_H
1515
#define LLVM_OBJECTYAML_CODEVIEWYAMLDEBUGSECTIONS_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/ADT/ArrayRef.h"
1819
#include "llvm/ADT/StringRef.h"
1920
#include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -108,22 +109,22 @@ struct InlineeInfo {
108109
};
109110

110111
struct YAMLDebugSubsection {
111-
static Expected<YAMLDebugSubsection>
112+
LLVM_ABI static Expected<YAMLDebugSubsection>
112113
fromCodeViewSubection(const codeview::StringsAndChecksumsRef &SC,
113114
const codeview::DebugSubsectionRecord &SS);
114115

115116
std::shared_ptr<detail::YAMLSubsectionBase> Subsection;
116117
};
117118

118-
Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
119+
LLVM_ABI Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
119120
toCodeViewSubsectionList(BumpPtrAllocator &Allocator,
120121
ArrayRef<YAMLDebugSubsection> Subsections,
121122
const codeview::StringsAndChecksums &SC);
122123

123-
std::vector<YAMLDebugSubsection>
124+
LLVM_ABI std::vector<YAMLDebugSubsection>
124125
fromDebugS(ArrayRef<uint8_t> Data, const codeview::StringsAndChecksumsRef &SC);
125126

126-
void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
127+
LLVM_ABI void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
127128
codeview::StringsAndChecksums &SC);
128129

129130
} // end namespace CodeViewYAML

llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_OBJECTYAML_CODEVIEWYAMLSYMBOLS_H
1515
#define LLVM_OBJECTYAML_CODEVIEWYAMLSYMBOLS_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/DebugInfo/CodeView/CodeView.h"
1819
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
1920
#include "llvm/Support/Error.h"
@@ -32,11 +33,11 @@ struct SymbolRecordBase;
3233
struct SymbolRecord {
3334
std::shared_ptr<detail::SymbolRecordBase> Symbol;
3435

35-
codeview::CVSymbol
36+
LLVM_ABI codeview::CVSymbol
3637
toCodeViewSymbol(BumpPtrAllocator &Allocator,
3738
codeview::CodeViewContainer Container) const;
3839

39-
static Expected<SymbolRecord> fromCodeViewSymbol(codeview::CVSymbol Symbol);
40+
LLVM_ABI static Expected<SymbolRecord> fromCodeViewSymbol(codeview::CVSymbol Symbol);
4041
};
4142

4243
} // end namespace CodeViewYAML

llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
1515
#define LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/ADT/ArrayRef.h"
1819
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
1920
#include "llvm/Support/Allocator.h"
@@ -45,14 +46,14 @@ struct MemberRecord {
4546
struct LeafRecord {
4647
std::shared_ptr<detail::LeafRecordBase> Leaf;
4748

48-
codeview::CVType
49+
LLVM_ABI codeview::CVType
4950
toCodeViewRecord(codeview::AppendingTypeTableBuilder &Serializer) const;
50-
static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
51+
LLVM_ABI static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
5152
};
5253

53-
std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
54+
LLVM_ABI std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
5455
StringRef SectionName);
55-
ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
56+
LLVM_ABI ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
5657
StringRef SectionName);
5758

5859
} // end namespace CodeViewYAML

llvm/include/llvm/ObjectYAML/DWARFEmitter.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef LLVM_OBJECTYAML_DWARFEMITTER_H
1313
#define LLVM_OBJECTYAML_DWARFEMITTER_H
1414

15+
#include "llvm/Support/Compiler.h"
1516
#include "llvm/ADT/StringMap.h"
1617
#include "llvm/ADT/StringRef.h"
1718
#include "llvm/Support/Error.h"
@@ -27,26 +28,26 @@ namespace DWARFYAML {
2728

2829
struct Data;
2930

30-
Error emitDebugAbbrev(raw_ostream &OS, const Data &DI);
31-
Error emitDebugStr(raw_ostream &OS, const Data &DI);
32-
33-
Error emitDebugAranges(raw_ostream &OS, const Data &DI);
34-
Error emitDebugRanges(raw_ostream &OS, const Data &DI);
35-
Error emitDebugPubnames(raw_ostream &OS, const Data &DI);
36-
Error emitDebugPubtypes(raw_ostream &OS, const Data &DI);
37-
Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI);
38-
Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI);
39-
Error emitDebugInfo(raw_ostream &OS, const Data &DI);
40-
Error emitDebugLine(raw_ostream &OS, const Data &DI);
41-
Error emitDebugAddr(raw_ostream &OS, const Data &DI);
42-
Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
43-
Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
44-
Error emitDebugLoclists(raw_ostream &OS, const Data &DI);
45-
Error emitDebugNames(raw_ostream &OS, const Data &DI);
46-
47-
std::function<Error(raw_ostream &, const Data &)>
31+
LLVM_ABI Error emitDebugAbbrev(raw_ostream &OS, const Data &DI);
32+
LLVM_ABI Error emitDebugStr(raw_ostream &OS, const Data &DI);
33+
34+
LLVM_ABI Error emitDebugAranges(raw_ostream &OS, const Data &DI);
35+
LLVM_ABI Error emitDebugRanges(raw_ostream &OS, const Data &DI);
36+
LLVM_ABI Error emitDebugPubnames(raw_ostream &OS, const Data &DI);
37+
LLVM_ABI Error emitDebugPubtypes(raw_ostream &OS, const Data &DI);
38+
LLVM_ABI Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI);
39+
LLVM_ABI Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI);
40+
LLVM_ABI Error emitDebugInfo(raw_ostream &OS, const Data &DI);
41+
LLVM_ABI Error emitDebugLine(raw_ostream &OS, const Data &DI);
42+
LLVM_ABI Error emitDebugAddr(raw_ostream &OS, const Data &DI);
43+
LLVM_ABI Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
44+
LLVM_ABI Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
45+
LLVM_ABI Error emitDebugLoclists(raw_ostream &OS, const Data &DI);
46+
LLVM_ABI Error emitDebugNames(raw_ostream &OS, const Data &DI);
47+
48+
LLVM_ABI std::function<Error(raw_ostream &, const Data &)>
4849
getDWARFEmitterByName(StringRef SecName);
49-
Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
50+
LLVM_ABI Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
5051
emitDebugSections(StringRef YAMLString,
5152
bool IsLittleEndian = sys::IsLittleEndianHost,
5253
bool Is64BitAddrSize = true);

llvm/include/llvm/ObjectYAML/DWARFYAML.h

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_OBJECTYAML_DWARFYAML_H
1616
#define LLVM_OBJECTYAML_DWARFYAML_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/ADT/SetVector.h"
1920
#include "llvm/ADT/StringRef.h"
2021
#include "llvm/BinaryFormat/Dwarf.h"
@@ -255,16 +256,16 @@ struct Data {
255256
std::optional<std::vector<ListTable<LoclistEntry>>> DebugLoclists;
256257
std::optional<DebugNamesSection> DebugNames;
257258

258-
bool isEmpty() const;
259+
LLVM_ABI bool isEmpty() const;
259260

260-
SetVector<StringRef> getNonEmptySectionNames() const;
261+
LLVM_ABI SetVector<StringRef> getNonEmptySectionNames() const;
261262

262263
struct AbbrevTableInfo {
263264
uint64_t Index;
264265
uint64_t Offset;
265266
};
266-
Expected<AbbrevTableInfo> getAbbrevTableInfoByID(uint64_t ID) const;
267-
StringRef getAbbrevTableContentByIndex(uint64_t Index) const;
267+
LLVM_ABI Expected<AbbrevTableInfo> getAbbrevTableInfoByID(uint64_t ID) const;
268+
LLVM_ABI StringRef getAbbrevTableContentByIndex(uint64_t Index) const;
268269

269270
private:
270271
mutable std::unordered_map<uint64_t, AbbrevTableInfo> AbbrevTableInfoMap;
@@ -310,88 +311,88 @@ namespace llvm {
310311
namespace yaml {
311312

312313
template <> struct MappingTraits<DWARFYAML::Data> {
313-
static void mapping(IO &IO, DWARFYAML::Data &DWARF);
314+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::Data &DWARF);
314315
};
315316

316317
template <> struct MappingTraits<DWARFYAML::AbbrevTable> {
317-
static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable);
318+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable);
318319
};
319320

320321
template <> struct MappingTraits<DWARFYAML::Abbrev> {
321-
static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
322+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
322323
};
323324

324325
template <> struct MappingTraits<DWARFYAML::AttributeAbbrev> {
325-
static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
326+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
326327
};
327328

328329
template <> struct MappingTraits<DWARFYAML::ARangeDescriptor> {
329-
static void mapping(IO &IO, DWARFYAML::ARangeDescriptor &Descriptor);
330+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::ARangeDescriptor &Descriptor);
330331
};
331332

332333
template <> struct MappingTraits<DWARFYAML::ARange> {
333-
static void mapping(IO &IO, DWARFYAML::ARange &ARange);
334+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::ARange &ARange);
334335
};
335336

336337
template <> struct MappingTraits<DWARFYAML::RangeEntry> {
337-
static void mapping(IO &IO, DWARFYAML::RangeEntry &Entry);
338+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::RangeEntry &Entry);
338339
};
339340

340341
template <> struct MappingTraits<DWARFYAML::Ranges> {
341-
static void mapping(IO &IO, DWARFYAML::Ranges &Ranges);
342+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::Ranges &Ranges);
342343
};
343344

344345
template <> struct MappingTraits<DWARFYAML::PubEntry> {
345-
static void mapping(IO &IO, DWARFYAML::PubEntry &Entry);
346+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::PubEntry &Entry);
346347
};
347348

348349
template <> struct MappingTraits<DWARFYAML::PubSection> {
349-
static void mapping(IO &IO, DWARFYAML::PubSection &Section);
350+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::PubSection &Section);
350351
};
351352

352353
template <> struct MappingTraits<DWARFYAML::Unit> {
353-
static void mapping(IO &IO, DWARFYAML::Unit &Unit);
354+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::Unit &Unit);
354355
};
355356

356357
template <> struct MappingTraits<DWARFYAML::DebugNamesSection> {
357-
static void mapping(IO &IO, DWARFYAML::DebugNamesSection &);
358+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNamesSection &);
358359
};
359360
template <> struct MappingTraits<DWARFYAML::DebugNameEntry> {
360-
static void mapping(IO &IO, DWARFYAML::DebugNameEntry &);
361+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNameEntry &);
361362
};
362363
template <> struct MappingTraits<DWARFYAML::DebugNameAbbreviation> {
363-
static void mapping(IO &IO, DWARFYAML::DebugNameAbbreviation &);
364+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNameAbbreviation &);
364365
};
365366
template <> struct MappingTraits<DWARFYAML::IdxForm> {
366-
static void mapping(IO &IO, DWARFYAML::IdxForm &);
367+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::IdxForm &);
367368
};
368369

369370
template <> struct MappingTraits<DWARFYAML::Entry> {
370-
static void mapping(IO &IO, DWARFYAML::Entry &Entry);
371+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::Entry &Entry);
371372
};
372373

373374
template <> struct MappingTraits<DWARFYAML::FormValue> {
374-
static void mapping(IO &IO, DWARFYAML::FormValue &FormValue);
375+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::FormValue &FormValue);
375376
};
376377

377378
template <> struct MappingTraits<DWARFYAML::File> {
378-
static void mapping(IO &IO, DWARFYAML::File &File);
379+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::File &File);
379380
};
380381

381382
template <> struct MappingTraits<DWARFYAML::LineTableOpcode> {
382-
static void mapping(IO &IO, DWARFYAML::LineTableOpcode &LineTableOpcode);
383+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::LineTableOpcode &LineTableOpcode);
383384
};
384385

385386
template <> struct MappingTraits<DWARFYAML::LineTable> {
386-
static void mapping(IO &IO, DWARFYAML::LineTable &LineTable);
387+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::LineTable &LineTable);
387388
};
388389

389390
template <> struct MappingTraits<DWARFYAML::SegAddrPair> {
390-
static void mapping(IO &IO, DWARFYAML::SegAddrPair &SegAddrPair);
391+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::SegAddrPair &SegAddrPair);
391392
};
392393

393394
template <> struct MappingTraits<DWARFYAML::DWARFOperation> {
394-
static void mapping(IO &IO, DWARFYAML::DWARFOperation &DWARFOperation);
395+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::DWARFOperation &DWARFOperation);
395396
};
396397

397398
template <typename EntryType>
@@ -407,19 +408,19 @@ struct MappingTraits<DWARFYAML::ListEntries<EntryType>> {
407408
};
408409

409410
template <> struct MappingTraits<DWARFYAML::RnglistEntry> {
410-
static void mapping(IO &IO, DWARFYAML::RnglistEntry &RnglistEntry);
411+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::RnglistEntry &RnglistEntry);
411412
};
412413

413414
template <> struct MappingTraits<DWARFYAML::LoclistEntry> {
414-
static void mapping(IO &IO, DWARFYAML::LoclistEntry &LoclistEntry);
415+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::LoclistEntry &LoclistEntry);
415416
};
416417

417418
template <> struct MappingTraits<DWARFYAML::AddrTableEntry> {
418-
static void mapping(IO &IO, DWARFYAML::AddrTableEntry &AddrTable);
419+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::AddrTableEntry &AddrTable);
419420
};
420421

421422
template <> struct MappingTraits<DWARFYAML::StringOffsetsTable> {
422-
static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
423+
LLVM_ABI static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
423424
};
424425

425426
template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {

0 commit comments

Comments
 (0)