From fdce82a814c05b1f89ae50c494845b27ec043891 Mon Sep 17 00:00:00 2001 From: Ali Tamur Date: Mon, 25 Mar 2019 21:09:07 +0000 Subject: Revert "[llvm] Prevent duplicate files in debug line header in dwarf 5." This reverts commit 312ab05887d0e2caa29aaf843cefe39379a98d36. My commit broke the build; I will revert and find out what happened. llvm-svn: 356951 --- llvm/lib/MC/MCContext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/MC/MCContext.cpp') diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 348436f4bd0..49fad131a2c 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -603,8 +603,7 @@ Expected MCContext::getDwarfFile(StringRef Directory, MD5::MD5Result *Checksum, Optional Source, unsigned CUID) { - MCDwarfLineTable &Table = - MCDwarfLineTablesCUMap.emplace(CUID, DwarfVersion).first->second; + MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID]; return Table.tryGetFile(Directory, FileName, Checksum, Source, FileNumber); } @@ -613,7 +612,7 @@ Expected MCContext::getDwarfFile(StringRef Directory, bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) { const MCDwarfLineTable &LineTable = getMCDwarfLineTable(CUID); if (FileNumber == 0) - return getDwarfVersion() >= 5; + return getDwarfVersion() >= 5 && LineTable.hasRootFile(); if (FileNumber >= LineTable.getMCDwarfFiles().size()) return false; -- cgit v1.2.3