Index: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1765,7 +1765,14 @@ EnumRecord ER(EnumeratorCount, CO, FTI, FullName, Ty->getIdentifier(), getTypeIndex(Ty->getBaseType())); - return TypeTable.writeLeafType(ER); + TypeIndex EnumTI = TypeTable.writeLeafType(ER); + + StringIdRecord SIR(TypeIndex(0x0), getFullFilepath(Ty->getFile())); + TypeIndex SIRI = TypeTable.writeLeafType(SIR); + UdtSourceLineRecord USLR(EnumTI, SIRI, Ty->getLine()); + TypeTable.writeLeafType(USLR); + + return EnumTI; } //===----------------------------------------------------------------------===// Index: test/DebugInfo/COFF/enum.ll =================================================================== --- test/DebugInfo/COFF/enum.ll +++ test/DebugInfo/COFF/enum.ll @@ -23,6 +23,17 @@ ; CHECK-NEXT: FieldListType: (0x1000) ; CHECK-NEXT: Name: E ; CHECK-NEXT: } +; CHECK-NEXT: StringId (0x1002) { +; CHECK-NEXT: TypeLeafKind: LF_STRING_ID (0x1605) +; CHECK-NEXT: Id: 0x0 +; CHECK-NEXT: StringData: \ +; CHECK-NEXT: } +; CHECK-NEXT: UdtSourceLine (0x1003) { +; CHECK-NEXT: TypeLeafKind: LF_UDT_SRC_LINE (0x1606) +; CHECK-NEXT: UDT: E (0x1001) +; CHECK-NEXT: SourceFile: \ (0x1002) +; CHECK-NEXT: LineNumber: 1 +; CHECK_NEXT } source_filename = "test/DebugInfo/COFF/enum.ll" target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" Index: test/DebugInfo/COFF/nested-types.ll =================================================================== --- test/DebugInfo/COFF/nested-types.ll +++ test/DebugInfo/COFF/nested-types.ll @@ -134,7 +134,7 @@ ; CHECK-NEXT: } ; CHECK-NEXT: } ; -; CHECK: Struct (0x1007) { +; CHECK: Struct (0x{{.*}}) { ; CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505) ; CHECK-NEXT: MemberCount: 4 ; CHECK-NEXT: Properties [ (0x210)