#include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
#include "llvm/DebugInfo/CodeView/EnumTables.h"
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/ScopedPrinter.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>
usingnamespacellvm;
usingnamespacellvm::codeview;
namespace {
#define error(X) …
static const EnumEntry<TypeLeafKind> LeafTypeNames[] = …;
static StringRef getLeafTypeName(TypeLeafKind LT) { … }
template <typename T>
static bool compEnumNames(const EnumEntry<T> &lhs, const EnumEntry<T> &rhs) { … }
template <typename T, typename TFlag>
static std::string getFlagNames(CodeViewRecordIO &IO, T Value,
ArrayRef<EnumEntry<TFlag>> Flags) { … }
template <typename T, typename TEnum>
static StringRef getEnumName(CodeViewRecordIO &IO, T Value,
ArrayRef<EnumEntry<TEnum>> EnumValues) { … }
static std::string getMemberAttributes(CodeViewRecordIO &IO,
MemberAccess Access, MethodKind Kind,
MethodOptions Options) { … }
struct MapOneMethodRecord { … };
}
static void computeHashString(StringRef Name,
SmallString<32> &StringifiedHash) { … }
static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name,
StringRef &UniqueName, bool HasUniqueName) { … }
Error TypeRecordMapping::visitTypeBegin(CVType &CVR) { … }
Error TypeRecordMapping::visitTypeBegin(CVType &CVR, TypeIndex Index) { … }
Error TypeRecordMapping::visitTypeEnd(CVType &Record) { … }
Error TypeRecordMapping::visitMemberBegin(CVMemberRecord &Record) { … }
Error TypeRecordMapping::visitMemberEnd(CVMemberRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
ProcedureRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
MemberFunctionRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArgListRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
StringListRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, PointerRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArrayRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ClassRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, BitFieldRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
VFTableShapeRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, VFTableRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, StringIdRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
UdtSourceLineRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
UdtModSourceLineRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, FuncIdRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
MemberFuncIdRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
BuildInfoRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
MethodOverloadListRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
FieldListRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
TypeServer2Record &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR, LabelRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
BaseClassRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
EnumeratorRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
DataMemberRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
OverloadedMethodRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
OneMethodRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
NestedTypeRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
StaticDataMemberRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
VirtualBaseClassRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
VFPtrRecord &Record) { … }
Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
ListContinuationRecord &Record) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
PrecompRecord &Precomp) { … }
Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
EndPrecompRecord &EndPrecomp) { … }