summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
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
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')
-rw-r--r--llvm/lib/MC/MCContext.cpp5
-rw-r--r--llvm/lib/MC/MCDwarf.cpp11
2 files changed, 2 insertions, 14 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;
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 73b4d4bcd19..83b6b4f1aa3 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -542,15 +542,6 @@ Expected<unsigned> MCDwarfLineTable::tryGetFile(StringRef &Directory,
return Header.tryGetFile(Directory, FileName, Checksum, Source, FileNumber);
}
-bool isRootFile(const MCDwarfFile &RootFile, StringRef &Directory,
- StringRef &FileName, MD5::MD5Result *Checksum) {
- if (RootFile.Name.empty() || RootFile.Name != FileName.data())
- return false;
- if (!RootFile.Checksum)
- return !Checksum;
- return *RootFile.Checksum == *Checksum;
-}
-
Expected<unsigned>
MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
StringRef &FileName,
@@ -570,8 +561,6 @@ MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
trackMD5Usage(Checksum);
HasSource = (Source != None);
}
- if (isRootFile(RootFile, Directory, FileName, Checksum) && DwarfVersion >= 5)
- return 0;
if (FileNumber == 0) {
// File numbers start with 1 and/or after any file numbers
// allocated by inline-assembler .file directives.
OpenPOWER on IntegriCloud