summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp2
-rw-r--r--llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp10
-rw-r--r--llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp2
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeDumper.cpp110
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp16
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp28
6 files changed, 81 insertions, 87 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 3590d937643..5f1e6714ba7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -263,7 +263,7 @@ void CodeViewDebug::emitTypeInformation() {
// type here.
unsigned ArgListIndex = getNextTypeIndex();
OS.AddComment("Type record length");
- OS.EmitIntValue(StringListRecord::getLayoutSize(), 2);
+ OS.EmitIntValue(ArgListRecord::getLayoutSize(), 2);
OS.AddComment("Leaf type: LF_ARGLIST");
OS.EmitIntValue(LF_ARGLIST, 2);
OS.AddComment("Number of arguments");
diff --git a/llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp b/llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp
index 9b016bdf1ce..62bc4c481cb 100644
--- a/llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp
+++ b/llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp
@@ -31,7 +31,7 @@ void FieldListRecordBuilder::writeEnumerate(MemberAccess Access, uint64_t Value,
StringRef Name) {
TypeRecordBuilder &Builder = getBuilder();
- Builder.writeTypeRecordKind(TypeRecordKind::Enumerate);
+ Builder.writeTypeRecordKind(TypeRecordKind::Enumerator);
Builder.writeUInt16(static_cast<uint16_t>(Access));
Builder.writeEncodedUnsignedInteger(Value);
Builder.writeNullTerminatedString(Name);
@@ -43,7 +43,7 @@ void FieldListRecordBuilder::writeMember(MemberAccess Access, TypeIndex Type,
uint64_t Offset, StringRef Name) {
TypeRecordBuilder &Builder = getBuilder();
- Builder.writeTypeRecordKind(TypeRecordKind::Member);
+ Builder.writeTypeRecordKind(TypeRecordKind::DataMember);
Builder.writeUInt16(static_cast<uint16_t>(Access));
Builder.writeTypeIndex(Type);
Builder.writeEncodedUnsignedInteger(Offset);
@@ -114,7 +114,7 @@ void FieldListRecordBuilder::writeStaticMember(MemberAccess Access,
TypeIndex Type, StringRef Name) {
TypeRecordBuilder &Builder = getBuilder();
- Builder.writeTypeRecordKind(TypeRecordKind::StaticMember);
+ Builder.writeTypeRecordKind(TypeRecordKind::StaticDataMember);
Builder.writeUInt16(static_cast<uint16_t>(Access));
Builder.writeTypeIndex(Type);
Builder.writeNullTerminatedString(Name);
@@ -157,9 +157,9 @@ void FieldListRecordBuilder::writeVirtualBaseClass(
void FieldListRecordBuilder::writeVirtualFunctionTablePointer(TypeIndex Type) {
TypeRecordBuilder &Builder = getBuilder();
- Builder.writeTypeRecordKind(TypeRecordKind::VirtualFunctionTablePointer);
+ Builder.writeTypeRecordKind(TypeRecordKind::VFPtr);
Builder.writeUInt16(0);
Builder.writeTypeIndex(Type);
finishSubRecord();
-} \ No newline at end of file
+}
diff --git a/llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp b/llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp
index 889302556b2..ae089a35208 100644
--- a/llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp
+++ b/llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp
@@ -14,7 +14,7 @@ using namespace llvm;
using namespace codeview;
MethodListRecordBuilder::MethodListRecordBuilder()
- : ListRecordBuilder(TypeRecordKind::MethodList) {}
+ : ListRecordBuilder(TypeRecordKind::MethodOverloadList) {}
void MethodListRecordBuilder::writeMethod(MemberAccess Access, MethodKind Kind,
MethodOptions Options, TypeIndex Type,
diff --git a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
index d7f21d227ed..6a42fc42433 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
@@ -200,12 +200,12 @@ public:
: CVTD(CVTD), W(W), PrintRecordBytes(PrintRecordBytes) {}
/// CVTypeVisitor overrides.
-#define TYPE_RECORD(EnumName, EnumVal, ClassName, PrintName) \
- void visit##ClassName(TypeLeafKind LeafType, ClassName &Record);
-#define TYPE_RECORD_ALIAS(EnumName, EnumVal, ClassName, PrintName)
-#define MEMBER_RECORD(EnumName, EnumVal, ClassName, PrintName) \
- void visit##ClassName(TypeLeafKind LeafType, ClassName &Record);
-#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, ClassName, PrintName)
+#define TYPE_RECORD(EnumName, EnumVal, Name) \
+ void visit##Name(TypeLeafKind LeafType, Name##Record &Record);
+#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
+#define MEMBER_RECORD(EnumName, EnumVal, Name) \
+ void visit##Name(TypeLeafKind LeafType, Name##Record &Record);
+#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
void visitUnknownMember(TypeLeafKind Leaf);
@@ -239,9 +239,9 @@ private:
static StringRef getLeafTypeName(TypeLeafKind LT) {
switch (LT) {
-#define TYPE_RECORD(ename, value, class_name, print_name) \
+#define TYPE_RECORD(ename, value, name) \
case ename: \
- return #print_name;
+ return #name;
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
default:
break;
@@ -273,15 +273,14 @@ void CVTypeDumperImpl::visitTypeEnd(TypeLeafKind Leaf,
W.startLine() << "}\n";
}
-void CVTypeDumperImpl::visitStringIdRecord(TypeLeafKind Leaf,
+void CVTypeDumperImpl::visitStringId(TypeLeafKind Leaf,
StringIdRecord &String) {
printTypeIndex("Id", String.getId());
W.printString("StringData", String.getString());
// Put this in CVUDTNames so it gets printed with LF_UDT_SRC_LINE.
Name = String.getString();
}
-void CVTypeDumperImpl::visitStringListRecord(TypeLeafKind Leaf,
- StringListRecord &Args) {
+void CVTypeDumperImpl::visitArgList(TypeLeafKind Leaf, ArgListRecord &Args) {
auto Indices = Args.getIndices();
uint32_t Size = Indices.size();
W.printNumber("NumArgs", Size);
@@ -298,7 +297,7 @@ void CVTypeDumperImpl::visitStringListRecord(TypeLeafKind Leaf,
Name = CVTD.saveName(TypeName);
}
-void CVTypeDumperImpl::visitClassRecord(TypeLeafKind Leaf, ClassRecord &Class) {
+void CVTypeDumperImpl::visitClass(TypeLeafKind Leaf, ClassRecord &Class) {
uint16_t Props = static_cast<uint16_t>(Class.getOptions());
W.printNumber("MemberCount", Class.getMemberCount());
W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames));
@@ -312,7 +311,7 @@ void CVTypeDumperImpl::visitClassRecord(TypeLeafKind Leaf, ClassRecord &Class) {
Name = Class.getName();
}
-void CVTypeDumperImpl::visitUnionRecord(TypeLeafKind Leaf, UnionRecord &Union) {
+void CVTypeDumperImpl::visitUnion(TypeLeafKind Leaf, UnionRecord &Union) {
uint16_t Props = static_cast<uint16_t>(Union.getOptions());
W.printNumber("MemberCount", Union.getMemberCount());
W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames));
@@ -324,7 +323,7 @@ void CVTypeDumperImpl::visitUnionRecord(TypeLeafKind Leaf, UnionRecord &Union) {
Name = Union.getName();
}
-void CVTypeDumperImpl::visitEnumRecord(TypeLeafKind Leaf, EnumRecord &Enum) {
+void CVTypeDumperImpl::visitEnum(TypeLeafKind Leaf, EnumRecord &Enum) {
W.printNumber("NumEnumerators", Enum.getMemberCount());
W.printFlags("Properties", uint16_t(Enum.getOptions()),
makeArrayRef(ClassOptionNames));
@@ -334,7 +333,7 @@ void CVTypeDumperImpl::visitEnumRecord(TypeLeafKind Leaf, EnumRecord &Enum) {
Name = Enum.getName();
}
-void CVTypeDumperImpl::visitArrayRecord(TypeLeafKind Leaf, ArrayRecord &AT) {
+void CVTypeDumperImpl::visitArray(TypeLeafKind Leaf, ArrayRecord &AT) {
printTypeIndex("ElementType", AT.getElementType());
printTypeIndex("IndexType", AT.getIndexType());
W.printNumber("SizeOf", AT.getSize());
@@ -342,8 +341,7 @@ void CVTypeDumperImpl::visitArrayRecord(TypeLeafKind Leaf, ArrayRecord &AT) {
Name = AT.getName();
}
-void CVTypeDumperImpl::visitVirtualTableRecord(TypeLeafKind Leaf,
- VirtualTableRecord &VFT) {
+void CVTypeDumperImpl::visitVFTable(TypeLeafKind Leaf, VFTableRecord &VFT) {
printTypeIndex("CompleteClass", VFT.getCompleteClass());
printTypeIndex("OverriddenVFTable", VFT.getOverriddenVTable());
W.printHex("VFPtrOffset", VFT.getVFPtrOffset());
@@ -353,16 +351,16 @@ void CVTypeDumperImpl::visitVirtualTableRecord(TypeLeafKind Leaf,
Name = VFT.getName();
}
-void CVTypeDumperImpl::visitMemberFunctionIdRecord(TypeLeafKind Leaf,
- MemberFunctionIdRecord &Id) {
+void CVTypeDumperImpl::visitMemberFuncId(TypeLeafKind Leaf,
+ MemberFuncIdRecord &Id) {
printTypeIndex("ClassType", Id.getClassType());
printTypeIndex("FunctionType", Id.getFunctionType());
W.printString("Name", Id.getName());
Name = Id.getName();
}
-void CVTypeDumperImpl::visitProcedureRecord(TypeLeafKind Leaf,
- ProcedureRecord &Proc) {
+void CVTypeDumperImpl::visitProcedure(TypeLeafKind Leaf,
+ ProcedureRecord &Proc) {
printTypeIndex("ReturnType", Proc.getReturnType());
W.printEnum("CallingConvention", uint8_t(Proc.getCallConv()),
makeArrayRef(CallingConventions));
@@ -379,8 +377,8 @@ void CVTypeDumperImpl::visitProcedureRecord(TypeLeafKind Leaf,
Name = CVTD.saveName(TypeName);
}
-void CVTypeDumperImpl::visitMemberFunctionRecord(TypeLeafKind Leaf,
- MemberFunctionRecord &MF) {
+void CVTypeDumperImpl::visitMemberFunction(TypeLeafKind Leaf,
+ MemberFunctionRecord &MF) {
printTypeIndex("ReturnType", MF.getReturnType());
printTypeIndex("ClassType", MF.getClassType());
printTypeIndex("ThisType", MF.getThisType());
@@ -403,8 +401,8 @@ void CVTypeDumperImpl::visitMemberFunctionRecord(TypeLeafKind Leaf,
Name = CVTD.saveName(TypeName);
}
-void CVTypeDumperImpl::visitMethodOverloadListRecord(TypeLeafKind Leaf,
- MethodOverloadListRecord &MethodList) {
+void CVTypeDumperImpl::visitMethodOverloadList(
+ TypeLeafKind Leaf, MethodOverloadListRecord &MethodList) {
for (auto &M : MethodList.getMethods()) {
ListScope S(W, "Method");
printMemberAttributes(M.getAccess(), M.getKind(), M.getOptions());
@@ -414,24 +412,22 @@ void CVTypeDumperImpl::visitMethodOverloadListRecord(TypeLeafKind Leaf,
}
}
-void CVTypeDumperImpl::visitFuncIdRecord(TypeLeafKind Leaf,
- FuncIdRecord &Func) {
+void CVTypeDumperImpl::visitFuncId(TypeLeafKind Leaf, FuncIdRecord &Func) {
printTypeIndex("ParentScope", Func.getParentScope());
printTypeIndex("FunctionType", Func.getFunctionType());
W.printString("Name", Func.getName());
Name = Func.getName();
}
-void CVTypeDumperImpl::visitTypeServer2Record(TypeLeafKind Leaf,
- TypeServer2Record &TS) {
+void CVTypeDumperImpl::visitTypeServer2(TypeLeafKind Leaf,
+ TypeServer2Record &TS) {
W.printBinary("Signature", TS.getGuid());
W.printNumber("Age", TS.getAge());
W.printString("Name", TS.getName());
Name = TS.getName();
}
-void CVTypeDumperImpl::visitPointerRecord(TypeLeafKind Leaf,
- PointerRecord &Ptr) {
+void CVTypeDumperImpl::visitPointer(TypeLeafKind Leaf, PointerRecord &Ptr) {
printTypeIndex("PointeeType", Ptr.getReferentType());
W.printHex("PointerAttributes", uint32_t(Ptr.getOptions()));
W.printEnum("PtrType", unsigned(Ptr.getPointerKind()),
@@ -479,8 +475,7 @@ void CVTypeDumperImpl::visitPointerRecord(TypeLeafKind Leaf,
}
}
-void CVTypeDumperImpl::visitModifierRecord(TypeLeafKind Leaf,
- ModifierRecord &Mod) {
+void CVTypeDumperImpl::visitModifier(TypeLeafKind Leaf, ModifierRecord &Mod) {
uint16_t Mods = static_cast<uint16_t>(Mod.getModifiers());
printTypeIndex("ModifiedType", Mod.getModifiedType());
W.printFlags("Modifiers", Mods, makeArrayRef(TypeModifierNames));
@@ -497,20 +492,20 @@ void CVTypeDumperImpl::visitModifierRecord(TypeLeafKind Leaf,
Name = CVTD.saveName(TypeName);
}
-void CVTypeDumperImpl::visitVirtualTableShapeRecord(
- TypeLeafKind Leaf, VirtualTableShapeRecord &Shape) {
+void CVTypeDumperImpl::visitVFTableShape(TypeLeafKind Leaf,
+ VFTableShapeRecord &Shape) {
W.printNumber("VFEntryCount", Shape.getEntryCount());
}
-void CVTypeDumperImpl::visitUdtSourceLineRecord(TypeLeafKind Leaf,
- UdtSourceLineRecord &Line) {
+void CVTypeDumperImpl::visitUdtSourceLine(TypeLeafKind Leaf,
+ UdtSourceLineRecord &Line) {
printTypeIndex("UDT", Line.getUDT());
printTypeIndex("SourceFile", Line.getSourceFile());
W.printNumber("LineNumber", Line.getLineNumber());
}
-void CVTypeDumperImpl::visitBuildInfoRecord(TypeLeafKind Leaf,
- BuildInfoRecord &Args) {
+void CVTypeDumperImpl::visitBuildInfo(TypeLeafKind Leaf,
+ BuildInfoRecord &Args) {
W.printNumber("NumArgs", static_cast<uint32_t>(Args.getArgs().size()));
ListScope Arguments(W, "Arguments");
@@ -542,16 +537,16 @@ void CVTypeDumperImpl::visitUnknownMember(TypeLeafKind Leaf) {
W.printHex("UnknownMember", unsigned(Leaf));
}
-void CVTypeDumperImpl::visitNestedTypeRecord(TypeLeafKind Leaf,
- NestedTypeRecord &Nested) {
+void CVTypeDumperImpl::visitNestedType(TypeLeafKind Leaf,
+ NestedTypeRecord &Nested) {
DictScope S(W, "NestedType");
printTypeIndex("Type", Nested.getNestedType());
W.printString("Name", Nested.getName());
Name = Nested.getName();
}
-void CVTypeDumperImpl::visitOneMethodRecord(TypeLeafKind Leaf,
- OneMethodRecord &Method) {
+void CVTypeDumperImpl::visitOneMethod(TypeLeafKind Leaf,
+ OneMethodRecord &Method) {
DictScope S(W, "OneMethod");
MethodKind K = Method.getKind();
printMemberAttributes(Method.getAccess(), K, Method.getOptions());
@@ -563,8 +558,8 @@ void CVTypeDumperImpl::visitOneMethodRecord(TypeLeafKind Leaf,
Name = Method.getName();
}
-void CVTypeDumperImpl::visitOverloadedMethodRecord(
- TypeLeafKind Leaf, OverloadedMethodRecord &Method) {
+void CVTypeDumperImpl::visitOverloadedMethod(TypeLeafKind Leaf,
+ OverloadedMethodRecord &Method) {
DictScope S(W, "OverloadedMethod");
W.printHex("MethodCount", Method.getNumOverloads());
printTypeIndex("MethodListIndex", Method.getMethodList());
@@ -572,8 +567,8 @@ void CVTypeDumperImpl::visitOverloadedMethodRecord(
Name = Method.getName();
}
-void CVTypeDumperImpl::visitDataMemberRecord(TypeLeafKind Leaf,
- DataMemberRecord &Field) {
+void CVTypeDumperImpl::visitDataMember(TypeLeafKind Leaf,
+ DataMemberRecord &Field) {
DictScope S(W, "DataMember");
printMemberAttributes(Field.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
@@ -583,8 +578,8 @@ void CVTypeDumperImpl::visitDataMemberRecord(TypeLeafKind Leaf,
Name = Field.getName();
}
-void CVTypeDumperImpl::visitStaticDataMemberRecord(
- TypeLeafKind Leaf, StaticDataMemberRecord &Field) {
+void CVTypeDumperImpl::visitStaticDataMember(TypeLeafKind Leaf,
+ StaticDataMemberRecord &Field) {
DictScope S(W, "StaticDataMember");
printMemberAttributes(Field.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
@@ -593,14 +588,13 @@ void CVTypeDumperImpl::visitStaticDataMemberRecord(
Name = Field.getName();
}
-void CVTypeDumperImpl::visitVirtualFunctionPointerRecord(
- TypeLeafKind Leaf, VirtualFunctionPointerRecord &VFTable) {
- DictScope S(W, "VirtualFunctionPointer");
+void CVTypeDumperImpl::visitVFPtr(TypeLeafKind Leaf, VFPtrRecord &VFTable) {
+ DictScope S(W, "VFPtr");
printTypeIndex("Type", VFTable.getType());
}
-void CVTypeDumperImpl::visitEnumeratorRecord(TypeLeafKind Leaf,
- EnumeratorRecord &Enum) {
+void CVTypeDumperImpl::visitEnumerator(TypeLeafKind Leaf,
+ EnumeratorRecord &Enum) {
DictScope S(W, "Enumerator");
printMemberAttributes(Enum.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
@@ -609,8 +603,8 @@ void CVTypeDumperImpl::visitEnumeratorRecord(TypeLeafKind Leaf,
Name = Enum.getName();
}
-void CVTypeDumperImpl::visitBaseClassRecord(TypeLeafKind Leaf,
- BaseClassRecord &Base) {
+void CVTypeDumperImpl::visitBaseClass(TypeLeafKind Leaf,
+ BaseClassRecord &Base) {
DictScope S(W, "BaseClass");
printMemberAttributes(Base.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
@@ -618,8 +612,8 @@ void CVTypeDumperImpl::visitBaseClassRecord(TypeLeafKind Leaf,
W.printHex("BaseOffset", Base.getBaseOffset());
}
-void CVTypeDumperImpl::visitVirtualBaseClassRecord(
- TypeLeafKind Leaf, VirtualBaseClassRecord &Base) {
+void CVTypeDumperImpl::visitVirtualBaseClass(TypeLeafKind Leaf,
+ VirtualBaseClassRecord &Base) {
DictScope S(W, "VirtualBaseClass");
printMemberAttributes(Base.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
diff --git a/llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp b/llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp
index cbf464fd766..3cc56ba2c19 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp
@@ -60,33 +60,33 @@ void TypeRecordBuilder::writeEncodedInteger(int64_t Value) {
void TypeRecordBuilder::writeEncodedSignedInteger(int64_t Value) {
if (Value >= std::numeric_limits<int8_t>::min() &&
Value <= std::numeric_limits<int8_t>::max()) {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::SByte));
+ writeUInt16(LF_CHAR);
writeInt16(static_cast<int8_t>(Value));
} else if (Value >= std::numeric_limits<int16_t>::min() &&
Value <= std::numeric_limits<int16_t>::max()) {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::Int16));
+ writeUInt16(LF_SHORT);
writeInt16(static_cast<int16_t>(Value));
} else if (Value >= std::numeric_limits<int32_t>::min() &&
Value <= std::numeric_limits<int32_t>::max()) {
- writeUInt16(static_cast<uint32_t>(TypeRecordKind::Int32));
+ writeUInt16(LF_LONG);
writeInt32(static_cast<int32_t>(Value));
} else {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::Int64));
+ writeUInt16(LF_QUADWORD);
writeInt64(Value);
}
}
void TypeRecordBuilder::writeEncodedUnsignedInteger(uint64_t Value) {
- if (Value < static_cast<uint16_t>(TypeRecordKind::SByte)) {
+ if (Value < LF_CHAR) {
writeUInt16(static_cast<uint16_t>(Value));
} else if (Value <= std::numeric_limits<uint16_t>::max()) {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::UInt16));
+ writeUInt16(LF_USHORT);
writeUInt16(static_cast<uint16_t>(Value));
} else if (Value <= std::numeric_limits<uint32_t>::max()) {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::UInt32));
+ writeUInt16(LF_ULONG);
writeUInt32(static_cast<uint32_t>(Value));
} else {
- writeUInt16(static_cast<uint16_t>(TypeRecordKind::UInt64));
+ writeUInt16(LF_UQUADWORD);
writeUInt64(Value);
}
}
diff --git a/llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp b/llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
index faf177b658f..39e2a82f40a 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
@@ -22,7 +22,7 @@ TypeTableBuilder::TypeTableBuilder() {}
TypeTableBuilder::~TypeTableBuilder() {}
TypeIndex TypeTableBuilder::writeModifier(const ModifierRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::Modifier);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getModifiedType());
Builder.writeUInt16(static_cast<uint16_t>(Record.getModifiers()));
@@ -31,7 +31,7 @@ TypeIndex TypeTableBuilder::writeModifier(const ModifierRecord &Record) {
}
TypeIndex TypeTableBuilder::writeProcedure(const ProcedureRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::Procedure);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getReturnType());
Builder.writeUInt8(static_cast<uint8_t>(Record.getCallConv()));
@@ -44,7 +44,7 @@ TypeIndex TypeTableBuilder::writeProcedure(const ProcedureRecord &Record) {
TypeIndex
TypeTableBuilder::writeMemberFunction(const MemberFunctionRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::MemberFunction);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getReturnType());
Builder.writeTypeIndex(Record.getClassType());
@@ -58,8 +58,8 @@ TypeTableBuilder::writeMemberFunction(const MemberFunctionRecord &Record) {
return writeRecord(Builder);
}
-TypeIndex TypeTableBuilder::writeArgumentList(const StringListRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::ArgumentList);
+TypeIndex TypeTableBuilder::writeArgList(const ArgListRecord &Record) {
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeUInt32(Record.getIndices().size());
for (TypeIndex TI : Record.getIndices()) {
@@ -70,7 +70,7 @@ TypeIndex TypeTableBuilder::writeArgumentList(const StringListRecord &Record) {
}
TypeIndex TypeTableBuilder::writePointer(const PointerRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::Pointer);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getReferentType());
uint32_t flags = static_cast<uint32_t>(Record.getOptions()) |
@@ -91,7 +91,7 @@ TypeIndex TypeTableBuilder::writePointer(const PointerRecord &Record) {
}
TypeIndex TypeTableBuilder::writeArray(const ArrayRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::Array);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getElementType());
Builder.writeTypeIndex(Record.getIndexType());
@@ -102,7 +102,7 @@ TypeIndex TypeTableBuilder::writeArray(const ArrayRecord &Record) {
}
TypeIndex TypeTableBuilder::writeClass(const ClassRecord &Record) {
- assert((Record.getKind() == TypeRecordKind::Structure) ||
+ assert((Record.getKind() == TypeRecordKind::Struct) ||
(Record.getKind() == TypeRecordKind::Class) ||
(Record.getKind() == TypeRecordKind::Union));
@@ -129,7 +129,7 @@ TypeIndex TypeTableBuilder::writeClass(const ClassRecord &Record) {
}
TypeIndex TypeTableBuilder::writeEnum(const EnumRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::Enum);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeUInt16(Record.getMemberCount());
Builder.writeUInt16(static_cast<uint16_t>(Record.getOptions()));
@@ -145,7 +145,7 @@ TypeIndex TypeTableBuilder::writeEnum(const EnumRecord &Record) {
}
TypeIndex TypeTableBuilder::writeBitField(const BitFieldRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::BitField);
+ TypeRecordBuilder Builder(Record.getKind());
Builder.writeTypeIndex(Record.getType());
Builder.writeUInt8(Record.getBitSize());
@@ -154,11 +154,11 @@ TypeIndex TypeTableBuilder::writeBitField(const BitFieldRecord &Record) {
return writeRecord(Builder);
}
-TypeIndex TypeTableBuilder::writeVirtualTableShape(
- const VirtualTableShapeRecord &Record) {
- TypeRecordBuilder Builder(TypeRecordKind::VirtualTableShape);
+TypeIndex
+TypeTableBuilder::writeVFTableShape(const VFTableShapeRecord &Record) {
+ TypeRecordBuilder Builder(Record.getKind());
- ArrayRef<VirtualTableSlotKind> Slots = Record.getSlots();
+ ArrayRef<VFTableSlotKind> Slots = Record.getSlots();
Builder.writeUInt16(Slots.size());
for (size_t SlotIndex = 0; SlotIndex < Slots.size(); SlotIndex += 2) {
OpenPOWER on IntegriCloud