From 9a519a099e232c618dd290c8b845bad28fda69df Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 22 Jun 2016 21:22:13 +0000 Subject: [codeview] Write LF_UDT_SRC_LINE records (PR28251) Differential Revision: http://reviews.llvm.org/D21621 llvm-svn: 273495 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 3e4563947a1a..4edc6aece16e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1406,10 +1406,17 @@ TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) { getFullyQualifiedName(Ty->getScope().resolve(), Ty->getName()); uint64_t SizeInBytes = Ty->getSizeInBits() / 8; - return TypeTable.writeClass(ClassRecord( + + TypeIndex ClassTI = TypeTable.writeClass(ClassRecord( Kind, FieldCount, CO, HfaKind::None, WindowsRTClassKind::None, FieldTI, TypeIndex(), VShapeTI, SizeInBytes, FullName, Ty->getIdentifier())); - // FIXME: Make an LF_UDT_SRC_LINE record. + + TypeTable.writeUdtSourceLine(UdtSourceLineRecord( + ClassTI, TypeTable.writeStringId(StringIdRecord( + TypeIndex(0x0), getFullFilepath(Ty->getFile()))), + Ty->getLine())); + + return ClassTI; } TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) { @@ -1433,10 +1440,17 @@ TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) { uint64_t SizeInBytes = Ty->getSizeInBits() / 8; std::string FullName = getFullyQualifiedName(Ty->getScope().resolve(), Ty->getName()); - return TypeTable.writeUnion(UnionRecord(FieldCount, CO, HfaKind::None, - FieldTI, SizeInBytes, FullName, - Ty->getIdentifier())); - // FIXME: Make an LF_UDT_SRC_LINE record. + + TypeIndex UnionTI = TypeTable.writeUnion( + UnionRecord(FieldCount, CO, HfaKind::None, FieldTI, SizeInBytes, FullName, + Ty->getIdentifier())); + + TypeTable.writeUdtSourceLine(UdtSourceLineRecord( + UnionTI, TypeTable.writeStringId(StringIdRecord( + TypeIndex(0x0), getFullFilepath(Ty->getFile()))), + Ty->getLine())); + + return UnionTI; } std::tuple -- cgit v1.2.3