Skip to content

Commit 1001412

Browse files
fsfodvgvassilev
authored andcommitted
[DebugInfo] Add explicit visibility macros to CodeView template functions
These will be needed for when llvm is built as a shared library on windows with explicit visibility macros enabled. Change UnionRecord to class instead of a struct so we can use X macros from CodeViewTypes.def to forward declare all record classes. This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.
1 parent 5ee9c2c commit 1001412

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ClassRecord;
3232
class EnumRecord;
3333
class ModifierRecord;
3434
class PointerRecord;
35-
struct UnionRecord;
35+
class UnionRecord;
3636
} // namespace codeview
3737
} // namespace llvm
3838

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ class ContinuationRecordBuilder {
5050

5151
std::vector<CVType> end(TypeIndex Index);
5252
};
53+
54+
// Needed by RandomAccessVisitorTest.cpp
55+
#define TYPE_RECORD(EnumName, EnumVal, Name)
56+
#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
57+
#define MEMBER_RECORD(EnumName, EnumVal, Name) \
58+
extern template LLVM_TEMPLATE_ABI void ContinuationRecordBuilder::writeMemberType( \
59+
Name##Record &Record);
60+
#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
61+
#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
62+
#undef TYPE_RECORD
63+
#undef TYPE_RECORD_ALIAS
64+
#undef MEMBER_RECORD
65+
#undef MEMBER_RECORD_ALIAS
66+
5367
} // namespace codeview
5468
} // namespace llvm
5569

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ class SimpleTypeSerializer {
3232
ArrayRef<uint8_t> serialize(const FieldListRecord &Record) = delete;
3333
};
3434

35+
// Needed by RandomAccessVisitorTest.cpp
36+
#define TYPE_RECORD(EnumName, EnumVal, Name) \
37+
class Name##Record; \
38+
extern template LLVM_TEMPLATE_ABI ArrayRef<uint8_t> llvm::codeview::SimpleTypeSerializer::serialize( \
39+
Name##Record &Record);
40+
#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
41+
#define MEMBER_RECORD(EnumName, EnumVal, Name)
42+
#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
43+
#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
44+
#undef TYPE_RECORD
45+
#undef TYPE_RECORD_ALIAS
46+
#undef MEMBER_RECORD
47+
#undef MEMBER_RECORD_ALIAS
3548
} // end namespace codeview
3649
} // end namespace llvm
3750

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ class ClassRecord : public TagRecord {
495495
};
496496

497497
// LF_UNION
498-
struct UnionRecord : public TagRecord {
498+
class UnionRecord : public TagRecord {
499+
public:
499500
UnionRecord() = default;
500501
explicit UnionRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
501502
UnionRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList,

0 commit comments

Comments
 (0)