-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[llvm] annotate interfaces in llvm/DebugInfo for DLL export #140778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
39796b9
to
b2a25bd
Compare
b2a25bd
to
5ed2549
Compare
@llvm/pr-subscribers-llvm-binary-utilities Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with The following manual adjustments were also applied after running IDS on Linux:
ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Patch is 348.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140778.diff 168 Files Affected:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
index e3f7f57749ff1..ce2295a8711bd 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
@@ -16,10 +16,11 @@
#include "llvm/DebugInfo/BTF/BTFParser.h"
#include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
-class BTFContext final : public DIContext {
+class LLVM_ABI BTFContext final : public DIContext {
BTFParser BTF;
public:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
index 53f39919950e5..f8b5b29738b3f 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/DebugInfo/BTF/BTF.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataExtractor.h"
namespace llvm {
@@ -74,32 +75,33 @@ class BTFParser {
public:
// Looks-up a string in the .BTF section's string table.
// Offset is relative to string table start.
- StringRef findString(uint32_t Offset) const;
+ LLVM_ABI StringRef findString(uint32_t Offset) const;
// Search for line information for a specific address,
// address match is exact (contrary to DWARFContext).
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
// Search for CO-RE relocation information for a specific address.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFFieldReloc *findFieldReloc(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFFieldReloc *
+ findFieldReloc(SectionedAddress Address) const;
// Return a human readable representation of the CO-RE relocation
// record, this is for display purpose only.
// See implementation for details.
- void symbolize(const BTF::BPFFieldReloc *Reloc,
- SmallVectorImpl<char> &Result) const;
+ LLVM_ABI void symbolize(const BTF::BPFFieldReloc *Reloc,
+ SmallVectorImpl<char> &Result) const;
// Lookup BTF type definition with a specific index.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::CommonType *findType(uint32_t Id) const;
+ LLVM_ABI const BTF::CommonType *findType(uint32_t Id) const;
// Return total number of known BTF types.
size_t typesCount() const { return Types.size(); }
@@ -120,11 +122,11 @@ class BTFParser {
// - state of the BTFParser might be incomplete but is not invalid,
// queries might be run against it, but some (or all) information
// might be unavailable;
- Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
+ LLVM_ABI Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
Error parse(const ObjectFile &Obj) { return parse(Obj, {true, true, true}); }
// Return true if `Obj` has .BTF and .BTF.ext sections.
- static bool hasBTFSections(const ObjectFile &Obj);
+ LLVM_ABI static bool hasBTFSections(const ObjectFile &Obj);
};
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index fa2277343d5d4..3a36863ac7e32 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -16,6 +16,7 @@
#include "llvm/DebugInfo/CodeView/TypeCollection.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
namespace llvm {
@@ -23,7 +24,7 @@ namespace codeview {
class ContinuationRecordBuilder;
-class AppendingTypeTableBuilder : public TypeCollection {
+class LLVM_ABI AppendingTypeTableBuilder : public TypeCollection {
BumpPtrAllocator &RecordStorage;
SimpleTypeSerializer SimpleSerializer;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index c629018fd109f..7b230efe695af 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -10,6 +10,7 @@
#define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
#include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -24,14 +25,15 @@ class CVSymbolVisitor {
std::optional<uint32_t> ChildRecursiveDepth;
};
- CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
+ LLVM_ABI CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
- Error visitSymbolRecord(CVSymbol &Record);
- Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
- Error visitSymbolStream(const CVSymbolArray &Symbols);
- Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
- Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
- const FilterOptions &Filter);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols,
+ uint32_t InitialOffset);
+ LLVM_ABI Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
+ const FilterOptions &Filter);
private:
SymbolVisitorCallbacks &Callbacks;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index 7780e233cab3b..c80cf2d6801a6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -30,24 +31,28 @@ enum VisitorDataSource {
// supply the bytes.
};
-Error visitTypeRecord(CVType &Record, TypeIndex Index,
- TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-
-Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
-Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+
+LLVM_ABI Error visitMemberRecord(CVMemberRecord Record,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitTypeStream(const CVTypeArray &Types,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeStream(CVTypeRange Types,
+ TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeStream(TypeCollection &Types,
+ TypeVisitorCallbacks &Callbacks);
} // end namespace codeview
} // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
index 5cdff5ff0e82f..cf253e70a6d56 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -13,6 +13,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
+#include "llvm/Support/Compiler.h"
#include <cinttypes>
#include <type_traits>
@@ -555,9 +556,10 @@ enum class EncodedFramePtrReg : uint8_t {
BasePtr = 3,
};
-RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
+LLVM_ABI RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg,
+ CPUType CPU);
-EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
+LLVM_ABI EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
/// These values correspond to the THUNK_ORDINAL enumeration.
enum class ThunkOrdinal : uint8_t {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
index 17eb06c242a95..bb73a95f9eadd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -31,7 +32,7 @@ struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
namespace llvm {
namespace codeview {
-const std::error_category &CVErrorCategory();
+LLVM_ABI const std::error_category &CVErrorCategory();
inline std::error_code make_error_code(cv_error_code E) {
return std::error_code(static_cast<int>(E), CVErrorCategory());
@@ -43,7 +44,7 @@ class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
using ErrorInfo<CodeViewError,
StringError>::ErrorInfo; // inherit constructors
CodeViewError(const Twine &S) : ErrorInfo(S, cv_error_code::unspecified) {}
- static char ID;
+ LLVM_ABI static char ID;
};
} // namespace codeview
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index 29ba0c3eb7850..668428e487e11 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -14,6 +14,7 @@
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cassert>
#include <cstdint>
@@ -61,10 +62,10 @@ class CodeViewRecordIO {
explicit CodeViewRecordIO(CodeViewRecordStreamer &Streamer)
: Streamer(&Streamer) {}
- Error beginRecord(std::optional<uint32_t> MaxLength);
- Error endRecord();
+ LLVM_ABI Error beginRecord(std::optional<uint32_t> MaxLength);
+ LLVM_ABI Error endRecord();
- Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
+ LLVM_ABI Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
bool isStreaming() const {
return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr);
@@ -76,7 +77,7 @@ class CodeViewRecordIO {
return (Writer != nullptr) && (Streamer == nullptr) && (Reader == nullptr);
}
- uint32_t maxFieldLength() const;
+ LLVM_ABI uint32_t maxFieldLength() const;
template <typename T> Error mapObject(T &Value) {
if (isStreaming()) {
@@ -130,14 +131,14 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
- Error mapStringZ(StringRef &Value, const Twine &Comment = "");
- Error mapGuid(GUID &Guid, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapStringZ(StringRef &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapGuid(GUID &Guid, const Twine &Comment = "");
- Error mapStringZVectorZ(std::vector<StringRef> &Value,
- const Twine &Comment = "");
+ LLVM_ABI Error mapStringZVectorZ(std::vector<StringRef> &Value,
+ const Twine &Comment = "");
template <typename SizeType, typename T, typename ElementMapper>
Error mapVectorN(T &Items, const ElementMapper &Mapper,
@@ -197,12 +198,13 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
- Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
- const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes,
+ const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
+ const Twine &Comment = "");
- Error padToAlignment(uint32_t Align);
- Error skipPadding();
+ LLVM_ABI Error padToAlignment(uint32_t Align);
+ LLVM_ABI Error skipPadding();
uint64_t getStreamedLen() {
if (isStreaming())
diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 84cef520a2f46..805cedf1a879e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
#include <vector>
@@ -38,17 +39,17 @@ class ContinuationRecordBuilder {
std::optional<TypeIndex> RefersTo);
public:
- ContinuationRecordBuilder();
- ~ContinuationRecordBuilder();
+ LLVM_ABI ContinuationRecordBuilder();
+ LLVM_ABI ~ContinuationRecordBuilder();
- void begin(ContinuationRecordKind RecordKind);
+ LLVM_ABI void begin(ContinuationRecordKind RecordKind);
// This template is explicitly instantiated in the implementation file for all
// supported types. The method itself is ugly, so inlining it into the header
// file clutters an otherwise straightforward interface.
template <typename RecordType> void writeMemberType(RecordType &Record);
- std::vector<CVType> end(TypeIndex Index);
+ LLVM_ABI std::vector<CVType> end(TypeIndex Index);
};
} // namespace codeview
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 615fd216e6550..8f6b413ad8ae3 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -17,6 +17,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <vector>
@@ -42,8 +43,8 @@ template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::FileChecksumEntry &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::FileChecksumEntry &Item);
};
namespace codeview {
@@ -62,8 +63,8 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
bool valid() const { return Checksums.valid(); }
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return Checksums.begin(); }
Iterator end() const { return Checksums.end(); }
@@ -74,7 +75,7 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
FileChecksumArray Checksums;
};
-class DebugChecksumsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugChecksumsSubsection final : public DebugSubsection {
public:
explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings);
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index e21873a3af8f7..d0e391779abe0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <map>
@@ -34,8 +35,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeExports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return References.begin(); }
Iterator end() const { return References.end(); }
@@ -44,7 +45,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
FixedStreamArray<CrossModuleExport> References;
};
-class DebugCrossModuleExportsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugCrossModuleExportsSubsection final
+ : public DebugSubsection {
public:
DebugCrossModuleExportsSubsection()
: DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index 198ce4a8b4e4c..49ea04c4ecd69 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include <cstdint>
@@ -37,8 +38,8 @@ template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::CrossModuleImportItem &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::CrossModuleImportItem &Item);
};
namespace codeview {
@@ -57,8 +58,8 @@ class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeImports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ ...
[truncated]
|
@llvm/pr-subscribers-debuginfo Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with The following manual adjustments were also applied after running IDS on Linux:
ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Patch is 348.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140778.diff 168 Files Affected:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
index e3f7f57749ff1..ce2295a8711bd 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
@@ -16,10 +16,11 @@
#include "llvm/DebugInfo/BTF/BTFParser.h"
#include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
-class BTFContext final : public DIContext {
+class LLVM_ABI BTFContext final : public DIContext {
BTFParser BTF;
public:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
index 53f39919950e5..f8b5b29738b3f 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/DebugInfo/BTF/BTF.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataExtractor.h"
namespace llvm {
@@ -74,32 +75,33 @@ class BTFParser {
public:
// Looks-up a string in the .BTF section's string table.
// Offset is relative to string table start.
- StringRef findString(uint32_t Offset) const;
+ LLVM_ABI StringRef findString(uint32_t Offset) const;
// Search for line information for a specific address,
// address match is exact (contrary to DWARFContext).
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
// Search for CO-RE relocation information for a specific address.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFFieldReloc *findFieldReloc(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFFieldReloc *
+ findFieldReloc(SectionedAddress Address) const;
// Return a human readable representation of the CO-RE relocation
// record, this is for display purpose only.
// See implementation for details.
- void symbolize(const BTF::BPFFieldReloc *Reloc,
- SmallVectorImpl<char> &Result) const;
+ LLVM_ABI void symbolize(const BTF::BPFFieldReloc *Reloc,
+ SmallVectorImpl<char> &Result) const;
// Lookup BTF type definition with a specific index.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::CommonType *findType(uint32_t Id) const;
+ LLVM_ABI const BTF::CommonType *findType(uint32_t Id) const;
// Return total number of known BTF types.
size_t typesCount() const { return Types.size(); }
@@ -120,11 +122,11 @@ class BTFParser {
// - state of the BTFParser might be incomplete but is not invalid,
// queries might be run against it, but some (or all) information
// might be unavailable;
- Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
+ LLVM_ABI Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
Error parse(const ObjectFile &Obj) { return parse(Obj, {true, true, true}); }
// Return true if `Obj` has .BTF and .BTF.ext sections.
- static bool hasBTFSections(const ObjectFile &Obj);
+ LLVM_ABI static bool hasBTFSections(const ObjectFile &Obj);
};
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index fa2277343d5d4..3a36863ac7e32 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -16,6 +16,7 @@
#include "llvm/DebugInfo/CodeView/TypeCollection.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
namespace llvm {
@@ -23,7 +24,7 @@ namespace codeview {
class ContinuationRecordBuilder;
-class AppendingTypeTableBuilder : public TypeCollection {
+class LLVM_ABI AppendingTypeTableBuilder : public TypeCollection {
BumpPtrAllocator &RecordStorage;
SimpleTypeSerializer SimpleSerializer;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index c629018fd109f..7b230efe695af 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -10,6 +10,7 @@
#define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
#include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -24,14 +25,15 @@ class CVSymbolVisitor {
std::optional<uint32_t> ChildRecursiveDepth;
};
- CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
+ LLVM_ABI CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
- Error visitSymbolRecord(CVSymbol &Record);
- Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
- Error visitSymbolStream(const CVSymbolArray &Symbols);
- Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
- Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
- const FilterOptions &Filter);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols,
+ uint32_t InitialOffset);
+ LLVM_ABI Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
+ const FilterOptions &Filter);
private:
SymbolVisitorCallbacks &Callbacks;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index 7780e233cab3b..c80cf2d6801a6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -30,24 +31,28 @@ enum VisitorDataSource {
// supply the bytes.
};
-Error visitTypeRecord(CVType &Record, TypeIndex Index,
- TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-
-Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
-Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+
+LLVM_ABI Error visitMemberRecord(CVMemberRecord Record,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitTypeStream(const CVTypeArray &Types,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeStream(CVTypeRange Types,
+ TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeStream(TypeCollection &Types,
+ TypeVisitorCallbacks &Callbacks);
} // end namespace codeview
} // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
index 5cdff5ff0e82f..cf253e70a6d56 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -13,6 +13,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
+#include "llvm/Support/Compiler.h"
#include <cinttypes>
#include <type_traits>
@@ -555,9 +556,10 @@ enum class EncodedFramePtrReg : uint8_t {
BasePtr = 3,
};
-RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
+LLVM_ABI RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg,
+ CPUType CPU);
-EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
+LLVM_ABI EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
/// These values correspond to the THUNK_ORDINAL enumeration.
enum class ThunkOrdinal : uint8_t {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
index 17eb06c242a95..bb73a95f9eadd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -31,7 +32,7 @@ struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
namespace llvm {
namespace codeview {
-const std::error_category &CVErrorCategory();
+LLVM_ABI const std::error_category &CVErrorCategory();
inline std::error_code make_error_code(cv_error_code E) {
return std::error_code(static_cast<int>(E), CVErrorCategory());
@@ -43,7 +44,7 @@ class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
using ErrorInfo<CodeViewError,
StringError>::ErrorInfo; // inherit constructors
CodeViewError(const Twine &S) : ErrorInfo(S, cv_error_code::unspecified) {}
- static char ID;
+ LLVM_ABI static char ID;
};
} // namespace codeview
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index 29ba0c3eb7850..668428e487e11 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -14,6 +14,7 @@
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cassert>
#include <cstdint>
@@ -61,10 +62,10 @@ class CodeViewRecordIO {
explicit CodeViewRecordIO(CodeViewRecordStreamer &Streamer)
: Streamer(&Streamer) {}
- Error beginRecord(std::optional<uint32_t> MaxLength);
- Error endRecord();
+ LLVM_ABI Error beginRecord(std::optional<uint32_t> MaxLength);
+ LLVM_ABI Error endRecord();
- Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
+ LLVM_ABI Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
bool isStreaming() const {
return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr);
@@ -76,7 +77,7 @@ class CodeViewRecordIO {
return (Writer != nullptr) && (Streamer == nullptr) && (Reader == nullptr);
}
- uint32_t maxFieldLength() const;
+ LLVM_ABI uint32_t maxFieldLength() const;
template <typename T> Error mapObject(T &Value) {
if (isStreaming()) {
@@ -130,14 +131,14 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
- Error mapStringZ(StringRef &Value, const Twine &Comment = "");
- Error mapGuid(GUID &Guid, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapStringZ(StringRef &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapGuid(GUID &Guid, const Twine &Comment = "");
- Error mapStringZVectorZ(std::vector<StringRef> &Value,
- const Twine &Comment = "");
+ LLVM_ABI Error mapStringZVectorZ(std::vector<StringRef> &Value,
+ const Twine &Comment = "");
template <typename SizeType, typename T, typename ElementMapper>
Error mapVectorN(T &Items, const ElementMapper &Mapper,
@@ -197,12 +198,13 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
- Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
- const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes,
+ const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
+ const Twine &Comment = "");
- Error padToAlignment(uint32_t Align);
- Error skipPadding();
+ LLVM_ABI Error padToAlignment(uint32_t Align);
+ LLVM_ABI Error skipPadding();
uint64_t getStreamedLen() {
if (isStreaming())
diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 84cef520a2f46..805cedf1a879e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
#include <vector>
@@ -38,17 +39,17 @@ class ContinuationRecordBuilder {
std::optional<TypeIndex> RefersTo);
public:
- ContinuationRecordBuilder();
- ~ContinuationRecordBuilder();
+ LLVM_ABI ContinuationRecordBuilder();
+ LLVM_ABI ~ContinuationRecordBuilder();
- void begin(ContinuationRecordKind RecordKind);
+ LLVM_ABI void begin(ContinuationRecordKind RecordKind);
// This template is explicitly instantiated in the implementation file for all
// supported types. The method itself is ugly, so inlining it into the header
// file clutters an otherwise straightforward interface.
template <typename RecordType> void writeMemberType(RecordType &Record);
- std::vector<CVType> end(TypeIndex Index);
+ LLVM_ABI std::vector<CVType> end(TypeIndex Index);
};
} // namespace codeview
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 615fd216e6550..8f6b413ad8ae3 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -17,6 +17,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <vector>
@@ -42,8 +43,8 @@ template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::FileChecksumEntry &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::FileChecksumEntry &Item);
};
namespace codeview {
@@ -62,8 +63,8 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
bool valid() const { return Checksums.valid(); }
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return Checksums.begin(); }
Iterator end() const { return Checksums.end(); }
@@ -74,7 +75,7 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
FileChecksumArray Checksums;
};
-class DebugChecksumsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugChecksumsSubsection final : public DebugSubsection {
public:
explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings);
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index e21873a3af8f7..d0e391779abe0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <map>
@@ -34,8 +35,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeExports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return References.begin(); }
Iterator end() const { return References.end(); }
@@ -44,7 +45,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
FixedStreamArray<CrossModuleExport> References;
};
-class DebugCrossModuleExportsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugCrossModuleExportsSubsection final
+ : public DebugSubsection {
public:
DebugCrossModuleExportsSubsection()
: DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index 198ce4a8b4e4c..49ea04c4ecd69 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include <cstdint>
@@ -37,8 +38,8 @@ template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::CrossModuleImportItem &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::CrossModuleImportItem &Item);
};
namespace codeview {
@@ -57,8 +58,8 @@ class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeImports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ ...
[truncated]
|
@llvm/pr-subscribers-platform-windows Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with The following manual adjustments were also applied after running IDS on Linux:
ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Patch is 348.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140778.diff 168 Files Affected:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
index e3f7f57749ff1..ce2295a8711bd 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFContext.h
@@ -16,10 +16,11 @@
#include "llvm/DebugInfo/BTF/BTFParser.h"
#include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
-class BTFContext final : public DIContext {
+class LLVM_ABI BTFContext final : public DIContext {
BTFParser BTF;
public:
diff --git a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
index 53f39919950e5..f8b5b29738b3f 100644
--- a/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
+++ b/llvm/include/llvm/DebugInfo/BTF/BTFParser.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/DebugInfo/BTF/BTF.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataExtractor.h"
namespace llvm {
@@ -74,32 +75,33 @@ class BTFParser {
public:
// Looks-up a string in the .BTF section's string table.
// Offset is relative to string table start.
- StringRef findString(uint32_t Offset) const;
+ LLVM_ABI StringRef findString(uint32_t Offset) const;
// Search for line information for a specific address,
// address match is exact (contrary to DWARFContext).
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFLineInfo *findLineInfo(SectionedAddress Address) const;
// Search for CO-RE relocation information for a specific address.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::BPFFieldReloc *findFieldReloc(SectionedAddress Address) const;
+ LLVM_ABI const BTF::BPFFieldReloc *
+ findFieldReloc(SectionedAddress Address) const;
// Return a human readable representation of the CO-RE relocation
// record, this is for display purpose only.
// See implementation for details.
- void symbolize(const BTF::BPFFieldReloc *Reloc,
- SmallVectorImpl<char> &Result) const;
+ LLVM_ABI void symbolize(const BTF::BPFFieldReloc *Reloc,
+ SmallVectorImpl<char> &Result) const;
// Lookup BTF type definition with a specific index.
// Return nullptr if no information found.
// If information is present, return a pointer to object
// owned by this class.
- const BTF::CommonType *findType(uint32_t Id) const;
+ LLVM_ABI const BTF::CommonType *findType(uint32_t Id) const;
// Return total number of known BTF types.
size_t typesCount() const { return Types.size(); }
@@ -120,11 +122,11 @@ class BTFParser {
// - state of the BTFParser might be incomplete but is not invalid,
// queries might be run against it, but some (or all) information
// might be unavailable;
- Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
+ LLVM_ABI Error parse(const ObjectFile &Obj, const ParseOptions &Opts);
Error parse(const ObjectFile &Obj) { return parse(Obj, {true, true, true}); }
// Return true if `Obj` has .BTF and .BTF.ext sections.
- static bool hasBTFSections(const ObjectFile &Obj);
+ LLVM_ABI static bool hasBTFSections(const ObjectFile &Obj);
};
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index fa2277343d5d4..3a36863ac7e32 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -16,6 +16,7 @@
#include "llvm/DebugInfo/CodeView/TypeCollection.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
namespace llvm {
@@ -23,7 +24,7 @@ namespace codeview {
class ContinuationRecordBuilder;
-class AppendingTypeTableBuilder : public TypeCollection {
+class LLVM_ABI AppendingTypeTableBuilder : public TypeCollection {
BumpPtrAllocator &RecordStorage;
SimpleTypeSerializer SimpleSerializer;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index c629018fd109f..7b230efe695af 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -10,6 +10,7 @@
#define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
#include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -24,14 +25,15 @@ class CVSymbolVisitor {
std::optional<uint32_t> ChildRecursiveDepth;
};
- CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
+ LLVM_ABI CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
- Error visitSymbolRecord(CVSymbol &Record);
- Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
- Error visitSymbolStream(const CVSymbolArray &Symbols);
- Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
- Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
- const FilterOptions &Filter);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record);
+ LLVM_ABI Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols);
+ LLVM_ABI Error visitSymbolStream(const CVSymbolArray &Symbols,
+ uint32_t InitialOffset);
+ LLVM_ABI Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols,
+ const FilterOptions &Filter);
private:
SymbolVisitorCallbacks &Callbacks;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index 7780e233cab3b..c80cf2d6801a6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -30,24 +31,28 @@ enum VisitorDataSource {
// supply the bytes.
};
-Error visitTypeRecord(CVType &Record, TypeIndex Index,
- TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-
-Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
- TypeVisitorCallbacks &Callbacks);
-
-Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
- VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
-Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+
+LLVM_ABI Error visitMemberRecord(CVMemberRecord Record,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
+ TypeVisitorCallbacks &Callbacks);
+
+LLVM_ABI Error visitTypeStream(const CVTypeArray &Types,
+ TypeVisitorCallbacks &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
+LLVM_ABI Error visitTypeStream(CVTypeRange Types,
+ TypeVisitorCallbacks &Callbacks);
+LLVM_ABI Error visitTypeStream(TypeCollection &Types,
+ TypeVisitorCallbacks &Callbacks);
} // end namespace codeview
} // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
index 5cdff5ff0e82f..cf253e70a6d56 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -13,6 +13,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
+#include "llvm/Support/Compiler.h"
#include <cinttypes>
#include <type_traits>
@@ -555,9 +556,10 @@ enum class EncodedFramePtrReg : uint8_t {
BasePtr = 3,
};
-RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
+LLVM_ABI RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg,
+ CPUType CPU);
-EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
+LLVM_ABI EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
/// These values correspond to the THUNK_ORDINAL enumeration.
enum class ThunkOrdinal : uint8_t {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
index 17eb06c242a95..bb73a95f9eadd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
#define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -31,7 +32,7 @@ struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
namespace llvm {
namespace codeview {
-const std::error_category &CVErrorCategory();
+LLVM_ABI const std::error_category &CVErrorCategory();
inline std::error_code make_error_code(cv_error_code E) {
return std::error_code(static_cast<int>(E), CVErrorCategory());
@@ -43,7 +44,7 @@ class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
using ErrorInfo<CodeViewError,
StringError>::ErrorInfo; // inherit constructors
CodeViewError(const Twine &S) : ErrorInfo(S, cv_error_code::unspecified) {}
- static char ID;
+ LLVM_ABI static char ID;
};
} // namespace codeview
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index 29ba0c3eb7850..668428e487e11 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -14,6 +14,7 @@
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cassert>
#include <cstdint>
@@ -61,10 +62,10 @@ class CodeViewRecordIO {
explicit CodeViewRecordIO(CodeViewRecordStreamer &Streamer)
: Streamer(&Streamer) {}
- Error beginRecord(std::optional<uint32_t> MaxLength);
- Error endRecord();
+ LLVM_ABI Error beginRecord(std::optional<uint32_t> MaxLength);
+ LLVM_ABI Error endRecord();
- Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
+ LLVM_ABI Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
bool isStreaming() const {
return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr);
@@ -76,7 +77,7 @@ class CodeViewRecordIO {
return (Writer != nullptr) && (Streamer == nullptr) && (Reader == nullptr);
}
- uint32_t maxFieldLength() const;
+ LLVM_ABI uint32_t maxFieldLength() const;
template <typename T> Error mapObject(T &Value) {
if (isStreaming()) {
@@ -130,14 +131,14 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
- Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
- Error mapStringZ(StringRef &Value, const Twine &Comment = "");
- Error mapGuid(GUID &Guid, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapStringZ(StringRef &Value, const Twine &Comment = "");
+ LLVM_ABI Error mapGuid(GUID &Guid, const Twine &Comment = "");
- Error mapStringZVectorZ(std::vector<StringRef> &Value,
- const Twine &Comment = "");
+ LLVM_ABI Error mapStringZVectorZ(std::vector<StringRef> &Value,
+ const Twine &Comment = "");
template <typename SizeType, typename T, typename ElementMapper>
Error mapVectorN(T &Items, const ElementMapper &Mapper,
@@ -197,12 +198,13 @@ class CodeViewRecordIO {
return Error::success();
}
- Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
- Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
- const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes,
+ const Twine &Comment = "");
+ LLVM_ABI Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
+ const Twine &Comment = "");
- Error padToAlignment(uint32_t Align);
- Error skipPadding();
+ LLVM_ABI Error padToAlignment(uint32_t Align);
+ LLVM_ABI Error skipPadding();
uint64_t getStreamedLen() {
if (isStreaming())
diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 84cef520a2f46..805cedf1a879e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
#include <vector>
@@ -38,17 +39,17 @@ class ContinuationRecordBuilder {
std::optional<TypeIndex> RefersTo);
public:
- ContinuationRecordBuilder();
- ~ContinuationRecordBuilder();
+ LLVM_ABI ContinuationRecordBuilder();
+ LLVM_ABI ~ContinuationRecordBuilder();
- void begin(ContinuationRecordKind RecordKind);
+ LLVM_ABI void begin(ContinuationRecordKind RecordKind);
// This template is explicitly instantiated in the implementation file for all
// supported types. The method itself is ugly, so inlining it into the header
// file clutters an otherwise straightforward interface.
template <typename RecordType> void writeMemberType(RecordType &Record);
- std::vector<CVType> end(TypeIndex Index);
+ LLVM_ABI std::vector<CVType> end(TypeIndex Index);
};
} // namespace codeview
} // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 615fd216e6550..8f6b413ad8ae3 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -17,6 +17,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <vector>
@@ -42,8 +43,8 @@ template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::FileChecksumEntry &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::FileChecksumEntry &Item);
};
namespace codeview {
@@ -62,8 +63,8 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
bool valid() const { return Checksums.valid(); }
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return Checksums.begin(); }
Iterator end() const { return Checksums.end(); }
@@ -74,7 +75,7 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
FileChecksumArray Checksums;
};
-class DebugChecksumsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugChecksumsSubsection final : public DebugSubsection {
public:
explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings);
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index e21873a3af8f7..d0e391779abe0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <map>
@@ -34,8 +35,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeExports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ LLVM_ABI Error initialize(BinaryStreamReader Reader);
+ LLVM_ABI Error initialize(BinaryStreamRef Stream);
Iterator begin() const { return References.begin(); }
Iterator end() const { return References.end(); }
@@ -44,7 +45,8 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
FixedStreamArray<CrossModuleExport> References;
};
-class DebugCrossModuleExportsSubsection final : public DebugSubsection {
+class LLVM_ABI DebugCrossModuleExportsSubsection final
+ : public DebugSubsection {
public:
DebugCrossModuleExportsSubsection()
: DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index 198ce4a8b4e4c..49ea04c4ecd69 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -15,6 +15,7 @@
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include <cstdint>
@@ -37,8 +38,8 @@ template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
public:
using ContextType = void;
- Error operator()(BinaryStreamRef Stream, uint32_t &Len,
- codeview::CrossModuleImportItem &Item);
+ LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len,
+ codeview::CrossModuleImportItem &Item);
};
namespace codeview {
@@ -57,8 +58,8 @@ class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
return S->kind() == DebugSubsectionKind::CrossScopeImports;
}
- Error initialize(BinaryStreamReader Reader);
- Error initialize(BinaryStreamRef Stream);
+ ...
[truncated]
|
Purpose
This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the
llvm/DebugInfo
library. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build.Background
This effort is tracked in #109483. Additional context is provided in this discourse, and documentation for
LLVM_ABI
and related annotations is found in the LLVM repo here.The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with
git clang-format
.The following manual adjustments were also applied after running IDS on Linux:
#include "llvm/Support/Compiler.h"
to files where it was not auto-added by IDS due to no pre-existing block of include statements.LLVM_TEMPLATE_ABI
andLLVM_EXPORT_TEMPLATE
to exported instantiated templates defined via X-macroValidation
Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: