Skip to content

Commit 41fcfb0

Browse files
committed
[llvm] IDS auto codemod for DebugInfo library
1 parent a28d753 commit 41fcfb0

File tree

166 files changed

+1251
-1086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+1251
-1086
lines changed

llvm/include/llvm/DebugInfo/BTF/BTFContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
#ifndef LLVM_DEBUGINFO_BTF_BTFCONTEXT_H
1515
#define LLVM_DEBUGINFO_BTF_BTFCONTEXT_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/DebugInfo/BTF/BTFParser.h"
1819
#include "llvm/DebugInfo/DIContext.h"
1920

2021
namespace llvm {
2122

22-
class BTFContext final : public DIContext {
23+
class LLVM_ABI BTFContext final : public DIContext {
2324
BTFParser BTF;
2425

2526
public:

llvm/include/llvm/DebugInfo/BTF/BTFParser.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifndef LLVM_DEBUGINFO_BTF_BTFPARSER_H
2323
#define LLVM_DEBUGINFO_BTF_BTFPARSER_H
2424

25+
#include "llvm/Support/Compiler.h"
2526
#include "llvm/ADT/DenseMap.h"
2627
#include "llvm/DebugInfo/BTF/BTF.h"
2728
#include "llvm/Object/ObjectFile.h"
@@ -74,32 +75,32 @@ class BTFParser {
7475
public:
7576
// Looks-up a string in the .BTF section's string table.
7677
// Offset is relative to string table start.
77-
StringRef findString(uint32_t Offset) const;
78+
LLVM_ABI StringRef findString(uint32_t Offset) const;
7879

7980
// Search for line information for a specific address,
8081
// address match is exact (contrary to DWARFContext).
8182
// Return nullptr if no information found.
8283
// If information is present, return a pointer to object
8384
// owned by this class.
84-
const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
85+
LLVM_ABI const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
8586

8687
// Search for CO-RE relocation information for a specific address.
8788
// Return nullptr if no information found.
8889
// If information is present, return a pointer to object
8990
// owned by this class.
90-
const BTF::BPFFieldReloc *findFieldReloc(SectionedAddress Address) const;
91+
LLVM_ABI const BTF::BPFFieldReloc *findFieldReloc(SectionedAddress Address) const;
9192

9293
// Return a human readable representation of the CO-RE relocation
9394
// record, this is for display purpose only.
9495
// See implementation for details.
95-
void symbolize(const BTF::BPFFieldReloc *Reloc,
96+
LLVM_ABI void symbolize(const BTF::BPFFieldReloc *Reloc,
9697
SmallVectorImpl<char> &Result) const;
9798

9899
// Lookup BTF type definition with a specific index.
99100
// Return nullptr if no information found.
100101
// If information is present, return a pointer to object
101102
// owned by this class.
102-
const BTF::CommonType *findType(uint32_t Id) const;
103+
LLVM_ABI const BTF::CommonType *findType(uint32_t Id) const;
103104

104105
// Return total number of known BTF types.
105106
size_t typesCount() const { return Types.size(); }
@@ -120,11 +121,11 @@ class BTFParser {
120121
// - state of the BTFParser might be incomplete but is not invalid,
121122
// queries might be run against it, but some (or all) information
122123
// might be unavailable;
123-
Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
124+
LLVM_ABI Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
124125
Error parse(const ObjectFile &Obj) { return parse(Obj, {true, true, true}); }
125126

126127
// Return true if `Obj` has .BTF and .BTF.ext sections.
127-
static bool hasBTFSections(const ObjectFile &Obj);
128+
LLVM_ABI static bool hasBTFSections(const ObjectFile &Obj);
128129
};
129130

130131
} // namespace llvm

llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_APPENDINGTYPETABLEBUILDER_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_APPENDINGTYPETABLEBUILDER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/ADT/SmallVector.h"
1415
#include "llvm/DebugInfo/CodeView/CVRecord.h"
@@ -23,7 +24,7 @@ namespace codeview {
2324

2425
class ContinuationRecordBuilder;
2526

26-
class AppendingTypeTableBuilder : public TypeCollection {
27+
class LLVM_ABI AppendingTypeTableBuilder : public TypeCollection {
2728

2829
BumpPtrAllocator &RecordStorage;
2930
SimpleTypeSerializer SimpleSerializer;

llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/DebugInfo/CodeView/CVRecord.h"
1314
#include "llvm/Support/Error.h"
1415

@@ -24,13 +25,13 @@ class CVSymbolVisitor {
2425
std::optional<uint32_t> ChildRecursiveDepth;
2526
};
2627

27-
CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
28+
LLVM_ABI CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
2829

29-
Error visitSymbolRecord(CVSymbol &Record);
30-
Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
31-
Error visitSymbolStream(const CVSymbolArray &Symbols);
32-
Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
33-
Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
30+
LLVM_ABI Error visitSymbolRecord(CVSymbol &Record);
31+
LLVM_ABI Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
32+
LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols);
33+
LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
34+
LLVM_ABI Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
3435
const FilterOptions &Filter);
3536

3637
private:

llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_CVTYPEVISITOR_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_CVTYPEVISITOR_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/DebugInfo/CodeView/CVRecord.h"
1415
#include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -30,24 +31,24 @@ enum VisitorDataSource {
3031
// supply the bytes.
3132
};
3233

33-
Error visitTypeRecord(CVType &Record, TypeIndex Index,
34+
LLVM_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
3435
TypeVisitorCallbacks &Callbacks,
3536
VisitorDataSource Source = VDS_BytesPresent);
36-
Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
37+
LLVM_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
3738
VisitorDataSource Source = VDS_BytesPresent);
3839

39-
Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
40+
LLVM_ABI Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
4041
VisitorDataSource Source = VDS_BytesPresent);
41-
Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
42+
LLVM_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
4243
TypeVisitorCallbacks &Callbacks);
4344

44-
Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
45+
LLVM_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
4546
TypeVisitorCallbacks &Callbacks);
4647

47-
Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
48+
LLVM_ABI Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
4849
VisitorDataSource Source = VDS_BytesPresent);
49-
Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
50-
Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
50+
LLVM_ABI Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
51+
LLVM_ABI Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
5152

5253
} // end namespace codeview
5354
} // end namespace llvm

llvm/include/llvm/DebugInfo/CodeView/CodeView.h

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

16+
#include "llvm/Support/Compiler.h"
1617
#include <cinttypes>
1718
#include <type_traits>
1819

@@ -555,9 +556,9 @@ enum class EncodedFramePtrReg : uint8_t {
555556
BasePtr = 3,
556557
};
557558

558-
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
559+
LLVM_ABI RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
559560

560-
EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
561+
LLVM_ABI EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
561562

562563
/// These values correspond to the THUNK_ORDINAL enumeration.
563564
enum class ThunkOrdinal : uint8_t {

llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/Support/Error.h"
1314

1415
namespace llvm {
@@ -31,7 +32,7 @@ struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
3132

3233
namespace llvm {
3334
namespace codeview {
34-
const std::error_category &CVErrorCategory();
35+
LLVM_ABI const std::error_category &CVErrorCategory();
3536

3637
inline std::error_code make_error_code(cv_error_code E) {
3738
return std::error_code(static_cast<int>(E), CVErrorCategory());
@@ -43,7 +44,7 @@ class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
4344
using ErrorInfo<CodeViewError,
4445
StringError>::ErrorInfo; // inherit constructors
4546
CodeViewError(const Twine &S) : ErrorInfo(S, cv_error_code::unspecified) {}
46-
static char ID;
47+
LLVM_ABI static char ID;
4748
};
4849

4950
} // namespace codeview

llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWRECORDIO_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWRECORDIO_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/SmallVector.h"
1314
#include "llvm/ADT/StringRef.h"
1415
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
@@ -61,10 +62,10 @@ class CodeViewRecordIO {
6162
explicit CodeViewRecordIO(CodeViewRecordStreamer &Streamer)
6263
: Streamer(&Streamer) {}
6364

64-
Error beginRecord(std::optional<uint32_t> MaxLength);
65-
Error endRecord();
65+
LLVM_ABI Error beginRecord(std::optional<uint32_t> MaxLength);
66+
LLVM_ABI Error endRecord();
6667

67-
Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
68+
LLVM_ABI Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
6869

6970
bool isStreaming() const {
7071
return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr);
@@ -76,7 +77,7 @@ class CodeViewRecordIO {
7677
return (Writer != nullptr) && (Streamer == nullptr) && (Reader == nullptr);
7778
}
7879

79-
uint32_t maxFieldLength() const;
80+
LLVM_ABI uint32_t maxFieldLength() const;
8081

8182
template <typename T> Error mapObject(T &Value) {
8283
if (isStreaming()) {
@@ -130,13 +131,13 @@ class CodeViewRecordIO {
130131
return Error::success();
131132
}
132133

133-
Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
134-
Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
135-
Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
136-
Error mapStringZ(StringRef &Value, const Twine &Comment = "");
137-
Error mapGuid(GUID &Guid, const Twine &Comment = "");
134+
LLVM_ABI Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
135+
LLVM_ABI Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
136+
LLVM_ABI Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
137+
LLVM_ABI Error mapStringZ(StringRef &Value, const Twine &Comment = "");
138+
LLVM_ABI Error mapGuid(GUID &Guid, const Twine &Comment = "");
138139

139-
Error mapStringZVectorZ(std::vector<StringRef> &Value,
140+
LLVM_ABI Error mapStringZVectorZ(std::vector<StringRef> &Value,
140141
const Twine &Comment = "");
141142

142143
template <typename SizeType, typename T, typename ElementMapper>
@@ -197,12 +198,12 @@ class CodeViewRecordIO {
197198
return Error::success();
198199
}
199200

200-
Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
201-
Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
201+
LLVM_ABI Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
202+
LLVM_ABI Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
202203
const Twine &Comment = "");
203204

204-
Error padToAlignment(uint32_t Align);
205-
Error skipPadding();
205+
LLVM_ABI Error padToAlignment(uint32_t Align);
206+
LLVM_ABI Error skipPadding();
206207

207208
uint64_t getStreamedLen() {
208209
if (isStreaming())

llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/ADT/SmallVector.h"
1415
#include "llvm/DebugInfo/CodeView/CVRecord.h"
@@ -38,17 +39,17 @@ class ContinuationRecordBuilder {
3839
std::optional<TypeIndex> RefersTo);
3940

4041
public:
41-
ContinuationRecordBuilder();
42-
~ContinuationRecordBuilder();
42+
LLVM_ABI ContinuationRecordBuilder();
43+
LLVM_ABI ~ContinuationRecordBuilder();
4344

44-
void begin(ContinuationRecordKind RecordKind);
45+
LLVM_ABI void begin(ContinuationRecordKind RecordKind);
4546

4647
// This template is explicitly instantiated in the implementation file for all
4748
// supported types. The method itself is ugly, so inlining it into the header
4849
// file clutters an otherwise straightforward interface.
4950
template <typename RecordType> void writeMemberType(RecordType &Record);
5051

51-
std::vector<CVType> end(TypeIndex Index);
52+
LLVM_ABI std::vector<CVType> end(TypeIndex Index);
5253
};
5354
} // namespace codeview
5455
} // namespace llvm

llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/ADT/ArrayRef.h"
1314
#include "llvm/ADT/DenseMap.h"
1415
#include "llvm/ADT/StringRef.h"
@@ -42,7 +43,7 @@ template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
4243
public:
4344
using ContextType = void;
4445

45-
Error operator()(BinaryStreamRef Stream, uint32_t &Len,
46+
LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
4647
codeview::FileChecksumEntry &Item);
4748
};
4849

@@ -62,8 +63,8 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
6263

6364
bool valid() const { return Checksums.valid(); }
6465

65-
Error initialize(BinaryStreamReader Reader);
66-
Error initialize(BinaryStreamRef Stream);
66+
LLVM_ABI Error initialize(BinaryStreamReader Reader);
67+
LLVM_ABI Error initialize(BinaryStreamRef Stream);
6768

6869
Iterator begin() const { return Checksums.begin(); }
6970
Iterator end() const { return Checksums.end(); }
@@ -74,7 +75,7 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
7475
FileChecksumArray Checksums;
7576
};
7677

77-
class DebugChecksumsSubsection final : public DebugSubsection {
78+
class LLVM_ABI DebugChecksumsSubsection final : public DebugSubsection {
7879
public:
7980
explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings);
8081

llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/DebugInfo/CodeView/CodeView.h"
1314
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1415
#include "llvm/Support/BinaryStreamArray.h"
@@ -34,8 +35,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
3435
return S->kind() == DebugSubsectionKind::CrossScopeExports;
3536
}
3637

37-
Error initialize(BinaryStreamReader Reader);
38-
Error initialize(BinaryStreamRef Stream);
38+
LLVM_ABI Error initialize(BinaryStreamReader Reader);
39+
LLVM_ABI Error initialize(BinaryStreamRef Stream);
3940

4041
Iterator begin() const { return References.begin(); }
4142
Iterator end() const { return References.end(); }
@@ -44,7 +45,7 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
4445
FixedStreamArray<CrossModuleExport> References;
4546
};
4647

47-
class DebugCrossModuleExportsSubsection final : public DebugSubsection {
48+
class LLVM_ABI DebugCrossModuleExportsSubsection final : public DebugSubsection {
4849
public:
4950
DebugCrossModuleExportsSubsection()
5051
: DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}

0 commit comments

Comments
 (0)