From cc7344aae353493758a02a43d8c125ebfe500176 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Thu, 14 Jun 2018 13:38:20 +0000 Subject: [DWARFv5] Tolerate files not all having an MD5 checksum. In some cases, for example when compiling a preprocessed file, the front-end is not able to provide an MD5 checksum for all files. When that happens, omit the MD5 checksums from the final DWARF, because DWARF doesn't have a way to indicate that some but not all files have a checksum. When assembling a .s file, and some but not all .file directives provide an MD5 checksum, issue a warning and don't emit MD5 into the DWARF. Fixes PR37623. Differential Revision: https://reviews.llvm.org/D48135 llvm-svn: 334710 --- llvm/lib/MC/MCAsmStreamer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/MC/MCAsmStreamer.cpp') diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index d07f3cac410..681e7e482e7 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -1171,6 +1171,9 @@ void MCAsmStreamer::emitDwarfFile0Directive(StringRef Directory, // .file 0 is new for DWARF v5. if (getContext().getDwarfVersion() < 5) return; + // Inform MCDwarf about the root file. + getContext().setMCLineTableRootFile(CUID, Directory, Filename, Checksum, + Source); SmallString<128> Str; raw_svector_ostream OS1(Str); -- cgit v1.2.3