<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>The resulting breakage is only to the feature that’s new as of r294231, or does it impact more than that? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Could we do this partial revert first and then in a subsequent commit add the code to support both use cases?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>-Brian<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> David Blaikie [mailto:dblaikie@gmail.com] <br><b>Sent:</b> Monday, April 10, 2017 3:53 PM<br><b>To:</b> reviews+D31905+public+410e06a7b468ba68@reviews.llvm.org; bcain@codeaurora.org; sque@google.com; echristo@gmail.com<br><b>Cc:</b> llvm-commits@lists.llvm.org<br><b>Subject:</b> Re: [PATCH] D31905: Exit early from start line search for FunctionNameKind::None<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>I would guess this would then cause the line to not be retrieved when it might be desired? But I haven't thought about it too hard (hopefully Simon can chime in).<br><br>If that's the case & the existing functionality needs to be preserved, then maybe two functions will be needed or some other way to communicate "actually I don't need the line" (pass it by pointer instead of reference - null pointer indicates "not needed")<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Mon, Apr 10, 2017 at 1:46 PM Brian Cain via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal style='margin-bottom:12.0pt'>bcain created this revision.<br><br><a href="https://reviews.llvm.org/rL294231" target="_blank">https://reviews.llvm.org/rL294231</a> introduced a regression -- memory consumption for llvm-objdump during disassembly of ~500MB hexagon elf file was ~1.5GiB higher after that commit.<br><br>This change restores the previous behavior -- exit the search early for FunctionNameKind::None, saving some memory allocation.<br><br><br>Repository:<br> rL LLVM<br><br><a href="https://reviews.llvm.org/D31905" target="_blank">https://reviews.llvm.org/D31905</a><br><br>Files:<br> lib/DebugInfo/DWARF/DWARFContext.cpp<br><br><br>Index: lib/DebugInfo/DWARF/DWARFContext.cpp<br>===================================================================<br>--- lib/DebugInfo/DWARF/DWARFContext.cpp<br>+++ lib/DebugInfo/DWARF/DWARFContext.cpp<br>@@ -466,6 +466,9 @@<br> FunctionNameKind Kind,<br> std::string &FunctionName,<br> uint32_t &StartLine) {<br>+ if (Kind == FunctionNameKind::None)<br>+ return false;<br>+<br> // The address may correspond to instruction in some inlined function,<br> // so we have to build the chain of inlined functions and take the<br> // name of the topmost function in it.<br>@@ -477,7 +480,7 @@<br> const DWARFDie &DIE = InlinedChain[0];<br> bool FoundResult = false;<br> const char *Name = nullptr;<br>- if (Kind != FunctionNameKind::None && (Name = DIE.getSubroutineName(Kind))) {<br>+ if ((Name = DIE.getSubroutineName(Kind))) {<br> FunctionName = Name;<br> FoundResult = true;<br> }<br><br><o:p></o:p></p></blockquote></div></div></div></body></html>