summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorAli Tamur <tamur@google.com>2019-03-26 20:05:27 +0000
committerAli Tamur <tamur@google.com>2019-03-26 20:05:27 +0000
commit02e96648d75bcd04ad8b4a9e976c8ff8d1a9419e (patch)
treee353f6e7d239fcf8401a7ea35bf4415cc68f7c60 /llvm/lib/MC/MCContext.cpp
parentcea954802817b60e16f89044a9f3ba29cea3a443 (diff)
downloadbcm5719-llvm-02e96648d75bcd04ad8b4a9e976c8ff8d1a9419e.tar.gz
bcm5719-llvm-02e96648d75bcd04ad8b4a9e976c8ff8d1a9419e.zip
Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5.""
This reverts commit rL357020. The commit broke the test llvm/test/tools/llvm-objdump/embedded-source.test on some builds including clang-ppc64be-linux-multistage, clang-s390x-linux, clang-with-lto-ubuntu, clang-x64-windows-msvc, llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast (and others). llvm-svn: 357026
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp5
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;
OpenPOWER on IntegriCloud