diff options
author | Ali Tamur <tamur@google.com> | 2019-03-25 21:09:07 +0000 |
---|---|---|
committer | Ali Tamur <tamur@google.com> | 2019-03-25 21:09:07 +0000 |
commit | fdce82a814c05b1f89ae50c494845b27ec043891 (patch) | |
tree | f1eb5306630129c5eddd9e46289e6ac27a70dafd /llvm/lib/MC/MCContext.cpp | |
parent | e3959de26867d65410d4d5e1fc8c9c8f5bb2951a (diff) | |
download | bcm5719-llvm-fdce82a814c05b1f89ae50c494845b27ec043891.tar.gz bcm5719-llvm-fdce82a814c05b1f89ae50c494845b27ec043891.zip |
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
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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<unsigned> MCContext::getDwarfFile(StringRef Directory, MD5::MD5Result *Checksum, Optional<StringRef> 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<unsigned> 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; |