diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index b0e78a243a3c2..479a8724e2ade 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -32,7 +32,7 @@ class ClassRecord; class EnumRecord; class ModifierRecord; class PointerRecord; -struct UnionRecord; +class UnionRecord; } // namespace codeview } // namespace llvm diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h index 84cef520a2f46..3de138f37be2d 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h +++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h @@ -50,6 +50,20 @@ class ContinuationRecordBuilder { std::vector end(TypeIndex Index); }; + +// Needed by RandomAccessVisitorTest.cpp +#define TYPE_RECORD(EnumName, EnumVal, Name) +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) +#define MEMBER_RECORD(EnumName, EnumVal, Name) \ + extern template LLVM_TEMPLATE_ABI void \ + ContinuationRecordBuilder::writeMemberType(Name##Record &Record); +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def" +#undef TYPE_RECORD +#undef TYPE_RECORD_ALIAS +#undef MEMBER_RECORD +#undef MEMBER_RECORD_ALIAS + } // namespace codeview } // namespace llvm diff --git a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h index fcc0452a6ae9a..f79b0dbb3d91f 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h +++ b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h @@ -32,6 +32,19 @@ class SimpleTypeSerializer { ArrayRef serialize(const FieldListRecord &Record) = delete; }; +// Needed by RandomAccessVisitorTest.cpp +#define TYPE_RECORD(EnumName, EnumVal, Name) \ + class Name##Record; \ + extern template LLVM_TEMPLATE_ABI ArrayRef \ + llvm::codeview::SimpleTypeSerializer::serialize(Name##Record &Record); +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) +#define MEMBER_RECORD(EnumName, EnumVal, Name) +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def" +#undef TYPE_RECORD +#undef TYPE_RECORD_ALIAS +#undef MEMBER_RECORD +#undef MEMBER_RECORD_ALIAS } // end namespace codeview } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h index 5a84fac5f5903..484e05b5adc67 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h +++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h @@ -495,7 +495,8 @@ class ClassRecord : public TagRecord { }; // LF_UNION -struct UnionRecord : public TagRecord { +class UnionRecord : public TagRecord { +public: UnionRecord() = default; explicit UnionRecord(TypeRecordKind Kind) : TagRecord(Kind) {} UnionRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList,