<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 12, 2018, at 4:54 PM, Robinson, Paul <<a href="mailto:paul.robinson@sony.com" class="">paul.robinson@sony.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Looks like that was building r322394, should already be fixed in r322400. Let me know if it isn't.</span></div></div></div></blockquote>It isn't. This is a build for r322400: <a href="http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/45623/console" class="">http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/45623/console</a></div><div>It's been red since r322394.</div><div><br class=""></div><div>Michael<br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">--paulr<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><a name="_MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></a></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><b class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif;" class="">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a> [<a href="mailto:mzolotukhin@apple.com" class="">mailto:mzolotukhin@apple.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, January 12, 2018 4:40 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Robinson, Paul<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm] r322391 - [DWARFv5] CodeGen support for MD5 file checksums<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">Hi,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">This broke green dragon build [1]. Could you please take a look?<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">Thanks,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">Michael<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">[1] <a href="http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/45621/consoleFull#-144947796949ba4694-19c4-4d7e-bec5-911270d8a58c" style="color: purple; text-decoration: underline;" class="">http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/45621/consoleFull#-144947796949ba4694-19c4-4d7e-bec5-911270d8a58c</a><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><br class=""><br class=""><o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">On Jan 12, 2018, at 11:17 AM, Paul Robinson via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">llvm-commits@lists.llvm.org</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;" class="">Author: probinson<br class="">Date: Fri Jan 12 11:17:50 2018<br class="">New Revision: 322391<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=322391&view=rev" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project?rev=322391&view=rev</a><br class="">Log:<br class="">[DWARFv5] CodeGen support for MD5 file checksums<br class=""><br class="">Pass MD5 checksums through from IR to assembly/object files.<br class="">After this, getting Clang to compute the MD5 should be the last step<br class="">to supporting MD5 in the DWARF v5 line table header.<br class=""><br class="">Differential Revision:<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D41926" style="color: purple; text-decoration: underline;" class="">https://reviews.llvm.org/D41926</a><br class=""><br class="">Added:<br class=""> llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll<br class="">Modified:<br class=""> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class=""> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br class=""> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br class=""> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br class=""> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h<br class=""> llvm/trunk/lib/MC/MCAsmStreamer.cpp<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Jan 12 11:17:50 2018<br class="">@@ -94,17 +94,17 @@ void DwarfCompileUnit::addLocalLabelAddr<br class=""> DIEInteger(0));<br class="">}<br class=""><br class="">-unsigned DwarfCompileUnit::getOrCreateSourceID(StringRef FileName,<br class="">- StringRef DirName,<br class="">- MD5::MD5Result *Checksum) {<br class="">+unsigned DwarfCompileUnit::getOrCreateSourceID(const DIFile *File) {<br class=""> // If we print assembly, we can't separate .file entries according to<br class=""> // compile units. Thus all files will belong to the default compile unit.<br class=""><br class=""> // FIXME: add a better feature test than hasRawTextSupport. Even better,<br class=""> // extend .file to support this.<br class="">+ unsigned CUID = Asm->OutStreamer->hasRawTextSupport() ? 0 : getUniqueID();<br class="">+ if (!File)<br class="">+ return Asm->OutStreamer->EmitDwarfFileDirective(0, "", "", nullptr, CUID);<br class=""> return Asm->OutStreamer->EmitDwarfFileDirective(<br class="">- 0, DirName, FileName, Checksum,<br class="">- Asm->OutStreamer->hasRawTextSupport() ? 0 : getUniqueID());<br class="">+ 0, File->getDirectory(), File->getFilename(), getMD5AsBytes(File), CUID);<br class="">}<br class=""><br class="">DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(<br class="">@@ -444,7 +444,7 @@ DIE *DwarfCompileUnit::constructInlinedS<br class=""> // Add the call site information to the DIE.<br class=""> const DILocation *IA = Scope->getInlinedAt();<br class=""> addUInt(*ScopeDIE, dwarf::DW_AT_call_file, None,<br class="">- getOrCreateSourceID(IA->getFilename(), IA->getDirectory(), nullptr));<br class="">+ getOrCreateSourceID(IA->getFile()));<br class=""> addUInt(*ScopeDIE, dwarf::DW_AT_call_line, None, IA->getLine());<br class=""> if (IA->getDiscriminator() && DD->getDwarfVersion() >= 4)<br class=""> addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, None,<br class="">@@ -688,9 +688,7 @@ DIE *DwarfCompileUnit::constructImported<br class=""> else<br class=""> EntityDie = getDIE(Entity);<br class=""> assert(EntityDie);<br class="">- auto *File = Module->getFile();<br class="">- addSourceLine(*IMDie, Module->getLine(), File ? File->getFilename() : "",<br class="">- File ? File->getDirectory() : "");<br class="">+ addSourceLine(*IMDie, Module->getLine(), Module->getFile());<br class=""> addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie);<br class=""> StringRef Name = Module->getName();<br class=""> if (!Name.empty())<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Fri Jan 12 11:17:50 2018<br class="">@@ -141,8 +141,7 @@ public:<br class=""><br class=""> DwarfCompileUnit &getCU() override { return *this; }<br class=""><br class="">- unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName,<br class="">- MD5::MD5Result *Checksum) override;<br class="">+ unsigned getOrCreateSourceID(const DIFile *File) override;<br class=""><br class=""> void addImportedEntity(const DIImportedEntity* IE) {<br class=""> DIScope *Scope = IE->getScope();<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jan 12 11:17:50 2018<br class="">@@ -1366,19 +1366,17 @@ void DwarfDebug::endFunctionImpl(const M<br class="">void DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S,<br class=""> unsigned Flags) {<br class=""> StringRef Fn;<br class="">- StringRef Dir;<br class=""> unsigned Src = 1;<br class=""> unsigned Discriminator = 0;<br class=""> if (auto *Scope = cast_or_null<DIScope>(S)) {<br class=""> Fn = Scope->getFilename();<br class="">- Dir = Scope->getDirectory();<br class=""> if (Line != 0 && getDwarfVersion() >= 4)<br class=""> if (auto *LBF = dyn_cast<DILexicalBlockFile>(Scope))<br class=""> Discriminator = LBF->getDiscriminator();<br class=""><br class=""> unsigned CUID = Asm->OutStreamer->getContext().getDwarfCompileUnitID();<br class=""> Src = static_cast<DwarfCompileUnit &>(*InfoHolder.getUnits()[CUID])<br class="">- .getOrCreateSourceID(Fn, Dir, nullptr);<br class="">+ .getOrCreateSourceID(Scope->getFile());<br class=""> }<br class=""> Asm->OutStreamer->EmitDwarfLocDirective(Src, Line, Col, Flags, 0,<br class=""> Discriminator, Fn);<br class="">@@ -1973,11 +1971,7 @@ void DwarfDebug::emitMacroFile(DIMacroFi<br class=""> assert(F.getMacinfoType() == dwarf::DW_MACINFO_start_file);<br class=""> Asm->EmitULEB128(dwarf::DW_MACINFO_start_file);<br class=""> Asm->EmitULEB128(F.getLine());<br class="">- DIFile *File = F.getFile();<br class="">- unsigned FID =<br class="">- U.getOrCreateSourceID(File->getFilename(), File->getDirectory(),<br class="">- nullptr); // FIXME: MD5?<br class="">- Asm->EmitULEB128(FID);<br class="">+ Asm->EmitULEB128(U.getOrCreateSourceID(F.getFile()));<br class=""> handleMacroNodes(F.getElements(), U);<br class=""> Asm->EmitULEB128(dwarf::DW_MACINFO_end_file);<br class="">}<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Jan 12 11:17:50 2018<br class="">@@ -19,6 +19,7 @@<br class="">#include "llvm/ADT/APFloat.h"<br class="">#include "llvm/ADT/APInt.h"<br class="">#include "llvm/ADT/None.h"<br class="">+#include "llvm/ADT/StringExtras.h"<br class="">#include "llvm/ADT/iterator_range.h"<br class="">#include "llvm/CodeGen/MachineFunction.h"<br class="">#include "llvm/CodeGen/MachineOperand.h"<br class="">@@ -30,6 +31,7 @@<br class="">#include "llvm/IR/GlobalValue.h"<br class="">#include "llvm/IR/Metadata.h"<br class="">#include "llvm/MC/MCAsmInfo.h"<br class="">+#include "llvm/MC/MCContext.h"<br class="">#include "llvm/MC/MCDwarf.h"<br class="">#include "llvm/MC/MCSection.h"<br class="">#include "llvm/MC/MCStreamer.h"<br class="">@@ -263,12 +265,25 @@ void DwarfUnit::addSectionOffset(DIE &Di<br class=""> addUInt(Die, Attribute, dwarf::DW_FORM_data4, Integer);<br class="">}<br class=""><br class="">-unsigned DwarfTypeUnit::getOrCreateSourceID(StringRef FileName,<br class="">- StringRef DirName,<br class="">- MD5::MD5Result *Checksum) {<br class="">+MD5::MD5Result *DwarfUnit::getMD5AsBytes(const DIFile *File) {<br class="">+ assert(File);<br class="">+ if (File->getChecksumKind() != DIFile::CSK_MD5)<br class="">+ return nullptr;<br class="">+<br class="">+ // Convert the string checksum to an MD5Result for the streamer.<br class="">+ // The verifier validates the checksum so we assume it's okay.<br class="">+ // An MD5 checksum is 16 bytes.<br class="">+ std::string Checksum = fromHex(File->getChecksum());<br class="">+ void *CKMem = Asm->OutStreamer->getContext().allocate(16, 1);<br class="">+ memcpy(CKMem, Checksum.data(), 16);<br class="">+ return reinterpret_cast<MD5::MD5Result *>(CKMem);<br class="">+}<br class="">+<br class="">+unsigned DwarfTypeUnit::getOrCreateSourceID(const DIFile *File) {<br class=""> return SplitLineTable<br class="">- ? SplitLineTable->getFile(DirName, FileName, Checksum)<br class="">- : getCU().getOrCreateSourceID(FileName, DirName, Checksum);<br class="">+ ? SplitLineTable->getFile(File->getDirectory(),<br class="">+ File->getFilename(), getMD5AsBytes(File))<br class="">+ : getCU().getOrCreateSourceID(File);<br class="">}<br class=""><br class="">void DwarfUnit::addOpAddress(DIELoc &Die, const MCSymbol *Sym) {<br class="">@@ -338,12 +353,11 @@ void DwarfUnit::addBlock(DIE &Die, dwarf<br class=""> Die.addValue(DIEValueAllocator, Attribute, Block->BestForm(), Block);<br class="">}<br class=""><br class="">-void DwarfUnit::addSourceLine(DIE &Die, unsigned Line, StringRef File,<br class="">- StringRef Directory) {<br class="">+void DwarfUnit::addSourceLine(DIE &Die, unsigned Line, const DIFile *File) {<br class=""> if (Line == 0)<br class=""> return;<br class=""><br class="">- unsigned FileID = getOrCreateSourceID(File, Directory, nullptr);<br class="">+ unsigned FileID = getOrCreateSourceID(File);<br class=""> assert(FileID && "Invalid file id");<br class=""> addUInt(Die, dwarf::DW_AT_decl_file, None, FileID);<br class=""> addUInt(Die, dwarf::DW_AT_decl_line, None, Line);<br class="">@@ -352,32 +366,31 @@ void DwarfUnit::addSourceLine(DIE &Die,<br class="">void DwarfUnit::addSourceLine(DIE &Die, const DILocalVariable *V) {<br class=""> assert(V);<br class=""><br class="">- addSourceLine(Die, V->getLine(), V->getScope()->getFilename(),<br class="">- V->getScope()->getDirectory());<br class="">+ addSourceLine(Die, V->getLine(), V->getFile());<br class="">}<br class=""><br class="">void DwarfUnit::addSourceLine(DIE &Die, const DIGlobalVariable *G) {<br class=""> assert(G);<br class=""><br class="">- addSourceLine(Die, G->getLine(), G->getFilename(), G->getDirectory());<br class="">+ addSourceLine(Die, G->getLine(), G->getFile());<br class="">}<br class=""><br class="">void DwarfUnit::addSourceLine(DIE &Die, const DISubprogram *SP) {<br class=""> assert(SP);<br class=""><br class="">- addSourceLine(Die, SP->getLine(), SP->getFilename(), SP->getDirectory());<br class="">+ addSourceLine(Die, SP->getLine(), SP->getFile());<br class="">}<br class=""><br class="">void DwarfUnit::addSourceLine(DIE &Die, const DIType *Ty) {<br class=""> assert(Ty);<br class=""><br class="">- addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());<br class="">+ addSourceLine(Die, Ty->getLine(), Ty->getFile());<br class="">}<br class=""><br class="">void DwarfUnit::addSourceLine(DIE &Die, const DIObjCProperty *Ty) {<br class=""> assert(Ty);<br class=""><br class="">- addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());<br class="">+ addSourceLine(Die, Ty->getLine(), Ty->getFile());<br class="">}<br class=""><br class="">/* Byref variables, in Blocks, are declared by the programmer as "SomeType<br class="">@@ -1164,10 +1177,8 @@ bool DwarfUnit::applySubprogramDefinitio<br class=""> // Look at the Decl's linkage name only if we emitted it.<br class=""> if (DD->useAllLinkageNames())<br class=""> DeclLinkageName = SPDecl->getLinkageName();<br class="">- unsigned DeclID = getOrCreateSourceID(SPDecl->getFilename(),<br class="">- SPDecl->getDirectory(), nullptr);<br class="">- unsigned DefID =<br class="">- getOrCreateSourceID(SP->getFilename(), SP->getDirectory(), nullptr);<br class="">+ unsigned DeclID = getOrCreateSourceID(SPDecl->getFile());<br class="">+ unsigned DefID = getOrCreateSourceID(SP->getFile());<br class=""> if (DeclID != DefID)<br class=""> addUInt(SPDie, dwarf::DW_AT_decl_file, None, DefID);<br class=""><br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)<br class="">+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Fri Jan 12 11:17:50 2018<br class="">@@ -207,8 +207,7 @@ public:<br class=""> void addBlock(DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block);<br class=""><br class=""> /// Add location information to specified debug information entry.<br class="">- void addSourceLine(DIE &Die, unsigned Line, StringRef File,<br class="">- StringRef Directory);<br class="">+ void addSourceLine(DIE &Die, unsigned Line, const DIFile *File);<br class=""> void addSourceLine(DIE &Die, const DILocalVariable *V);<br class=""> void addSourceLine(DIE &Die, const DIGlobalVariable *G);<br class=""> void addSourceLine(DIE &Die, const DISubprogram *SP);<br class="">@@ -306,10 +305,13 @@ protected:<br class=""> /// Create new static data member DIE.<br class=""> DIE *getOrCreateStaticMemberDIE(const DIDerivedType *DT);<br class=""><br class="">- /// Look up the source ID with the given directory and source file names. If<br class="">- /// none currently exists, create a new ID and insert it in the line table.<br class="">- virtual unsigned getOrCreateSourceID(StringRef File, StringRef Directory,<br class="">- MD5::MD5Result *Checksum) = 0;<br class="">+ /// Look up the source ID for the given file. If none currently exists,<br class="">+ /// create a new ID and insert it in the line table.<br class="">+ virtual unsigned getOrCreateSourceID(const DIFile *File) = 0;<br class="">+<br class="">+ /// If the \p File has an MD5 checksum, return it as an MD5Result<br class="">+ /// allocated in the MCContext.<br class="">+ MD5::MD5Result *getMD5AsBytes(const DIFile *File);<br class=""><br class=""> /// Look in the DwarfDebug map for the MDNode that corresponds to the<br class=""> /// reference.<br class="">@@ -359,8 +361,7 @@ class DwarfTypeUnit final : public Dwarf<br class=""> DwarfCompileUnit &CU;<br class=""> MCDwarfDwoLineTable *SplitLineTable;<br class=""><br class="">- unsigned getOrCreateSourceID(StringRef File, StringRef Directory,<br class="">- MD5::MD5Result *Checksum) override;<br class="">+ unsigned getOrCreateSourceID(const DIFile *File) override;<br class=""> bool isDwoUnit() const override;<br class=""><br class="">public:<br class=""><br class="">Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=322391&r1=322390&r2=322391&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=322391&r1=322390&r2=322391&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)<br class="">+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Fri Jan 12 11:17:50 2018<br class="">@@ -1109,6 +1109,10 @@ unsigned MCAsmStreamer::EmitDwarfFileDir<br class=""> OS1 << ' ';<br class=""> }<br class=""> PrintQuotedString(Filename, OS1);<br class="">+ if (Checksum) {<br class="">+ OS1 << " md5 ";<br class="">+ PrintQuotedString(Checksum->digest(), OS1);<br class="">+ }<br class=""> if (MCTargetStreamer *TS = getTargetStreamer()) {<br class=""> TS->emitDwarfFileDirective(OS1.str());<br class=""> } else {<br class=""><br class="">Added: llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll?rev=322391&view=auto" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll?rev=322391&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll (added)<br class="">+++ llvm/trunk/test/CodeGen/Generic/dwarf-md5.ll Fri Jan 12 11:17:50 2018<br class="">@@ -0,0 +1,49 @@<br class="">+; MD5 checksums provided by IR should be passed through to asm.<br class="">+; They'll be emitted to an object file only for DWARF 5 or later.<br class="">+<br class="">+; REQUIRES: object-emission<br class="">+; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM<br class="">+; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM<br class="">+; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s<br class="">+; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ-4<br class="">+; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s<br class="">+; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefix=OBJ-5<br class="">+<br class="">+; FIXME: Need to convey the MD5 for the primary source file.<br class="">+; ASM: .file "t.c"{{$}}<br class="">+; ASM: .file 1 "./t1.h" md5 "11111111111111111111111111111111"<br class="">+; ASM: .file 2 "./t2.h" md5 "22222222222222222222222222222222"<br class="">+<br class="">+; OBJ-4: Dir Mod Time File Len File Name<br class="">+; OBJ-4: file_names[ 1] 1 0x00000000 0x00000000 t1.h<br class="">+; OBJ-4: file_names[ 2] 1 0x00000000 0x00000000 t2.h<br class="">+<br class="">+; OBJ-5: Dir MD5 Checksum File Name<br class="">+; OBJ-5: file_names[ 1] 1 11111111111111111111111111111111 t1.h<br class="">+; OBJ-5: file_names[ 2] 1 22222222222222222222222222222222 t2.h<br class="">+<br class="">+; ModuleID = 't.c'<br class="">+source_filename = "t.c"<br class="">+<br class="">+@t1 = global i32 1, align 4, !dbg !0<br class="">+@t2 = global i32 0, align 4, !dbg !6<br class="">+<br class="">+!llvm.dbg.cu = !{!2}<br class="">+!llvm.module.flags = !{!11, !12, !13}<br class="">+!llvm.ident = !{!14}<br class="">+<br class="">+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())<br class="">+!1 = distinct !DIGlobalVariable(name: "t1", scope: !2, file: !10, line: 1, type: !9, isLocal: false, isDefinition: true)<br class="">+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 322159)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)<br class="">+!3 = !DIFile(filename: "t.c", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "00000000000000000000000000000000")<br class="">+!4 = !{}<br class="">+!5 = !{!0, !6}<br class="">+!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())<br class="">+!7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true)<br class="">+!8 = !DIFile(filename: "./t2.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "22222222222222222222222222222222")<br class="">+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br class="">+!10 = !DIFile(filename: "./t1.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "11111111111111111111111111111111")<br class="">+!11 = !{i32 2, !"Dwarf Version", i32 4}<br class="">+!12 = !{i32 2, !"Debug Info Version", i32 3}<br class="">+!13 = !{i32 1, !"wchar_size", i32 4}<br class="">+!14 = !{!"clang version 7.0.0 (trunk 322159)"}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="color: purple; text-decoration: underline;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></div></div></div></div></div></div></div></blockquote></div><br class=""></body></html>