diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
| -rw-r--r-- | lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 12 | 
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 786b11618d75b..87b45c001de40 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -469,7 +469,7 @@ void CodeViewDebug::emitTypeInformation() {      CommentPrefix += ' ';    } -  TypeDatabase TypeDB; +  TypeDatabase TypeDB(TypeTable.records().size());    CVTypeDumper CVTD(TypeDB);    TypeTable.ForEachRecord([&](TypeIndex Index, ArrayRef<uint8_t> Record) {      if (OS.isVerboseAsm()) { @@ -1705,10 +1705,12 @@ TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) {                   SizeInBytes, FullName, Ty->getIdentifier());    TypeIndex ClassTI = TypeTable.writeKnownType(CR); -  StringIdRecord SIDR(TypeIndex(0x0), getFullFilepath(Ty->getFile())); -  TypeIndex SIDI = TypeTable.writeKnownType(SIDR); -  UdtSourceLineRecord USLR(ClassTI, SIDI, Ty->getLine()); -  TypeTable.writeKnownType(USLR); +  if (const auto *File = Ty->getFile()) { +    StringIdRecord SIDR(TypeIndex(0x0), getFullFilepath(File)); +    TypeIndex SIDI = TypeTable.writeKnownType(SIDR); +    UdtSourceLineRecord USLR(ClassTI, SIDI, Ty->getLine()); +    TypeTable.writeKnownType(USLR); +  }    addToUDTs(Ty, ClassTI);  | 
