<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 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">Hear hear. This has been on our backlog for like 5 years.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></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 #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-commits [mailto:llvm-commits-bounces@lists.llvm.org]
<b>On Behalf Of </b>Eric Christopher via llvm-commits<br>
<b>Sent:</b> Tuesday, May 24, 2016 3:19 PM<br>
<b>To:</b> David Blaikie; llvm-commits@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm] r270613 - DWARF: Omit DW_AT_APPLE attributes (except ObjC ones) when not targeting LLDB<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Awesome, thanks for doing this Dave. It kept slipping off my radar :)<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-eric<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, May 24, 2016 at 2:25 PM David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.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">Author: dblaikie<br>
Date: Tue May 24 16:19:28 2016<br>
New Revision: 270613<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=270613&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=270613&view=rev</a><br>
Log:<br>
DWARF: Omit DW_AT_APPLE attributes (except ObjC ones) when not targeting LLDB<br>
<br>
These attributes aren't used by other debuggers (& may be confused with<br>
other DWARF extensions) so they just waste space (about 1.5% on .dwo<br>
file size on a random large program I tested).<br>
<br>
We could remove the ObjC property ones too, but I figured they were<br>
probably more necessary when trying to understand ObjC (I could be wrong<br>
though) & so any debugger interested in working with ObjC would use<br>
them, perhaps? (also, there are some legacy tests in Clang that test for<br>
them - making it one of those annoying cross-project commits and/or<br>
cleanup to refactor those tests)<br>
<br>
Modified:<br>
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=270613&r1=270612&r2=270613&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=270613&r1=270612&r2=270613&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue May 24 16:19:28 2016<br>
@@ -287,7 +287,8 @@ DIE &DwarfCompileUnit::updateSubprogramS<br>
DIE *SPDie = getOrCreateSubprogramDIE(SP, includeMinimalInlineScopes());<br>
<br>
attachLowHighPC(*SPDie, Asm->getFunctionBegin(), Asm->getFunctionEnd());<br>
- if (!DD->getCurrentFunction()->getTarget().Options.DisableFramePointerElim(<br>
+ if (DD->useAppleExtensionAttributes() &&<br>
+ !DD->getCurrentFunction()->getTarget().Options.DisableFramePointerElim(<br>
*DD->getCurrentFunction()))<br>
addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr);<br>
<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=270613&r1=270612&r2=270613&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=270613&r1=270612&r2=270613&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue May 24 16:19:28 2016<br>
@@ -234,6 +234,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo<br>
else<br>
HasDwarfAccelTables = DwarfAccelTables == Enable;<br>
<br>
+ HasAppleExtensionAttributes = tuneForLLDB();<br>
+<br>
// Handle split DWARF. Off by default for now.<br>
if (SplitDwarf == Default)<br>
HasSplitDwarf = false;<br>
@@ -419,16 +421,18 @@ DwarfDebug::constructDwarfCompileUnit(co<br>
addGnuPubAttributes(NewCU, Die);<br>
}<br>
<br>
- if (DIUnit->isOptimized())<br>
- NewCU.addFlag(Die, dwarf::DW_AT_APPLE_optimized);<br>
-<br>
- StringRef Flags = DIUnit->getFlags();<br>
- if (!Flags.empty())<br>
- NewCU.addString(Die, dwarf::DW_AT_APPLE_flags, Flags);<br>
-<br>
- if (unsigned RVer = DIUnit->getRuntimeVersion())<br>
- NewCU.addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,<br>
- dwarf::DW_FORM_data1, RVer);<br>
+ if (useAppleExtensionAttributes()) {<br>
+ if (DIUnit->isOptimized())<br>
+ NewCU.addFlag(Die, dwarf::DW_AT_APPLE_optimized);<br>
+<br>
+ StringRef Flags = DIUnit->getFlags();<br>
+ if (!Flags.empty())<br>
+ NewCU.addString(Die, dwarf::DW_AT_APPLE_flags, Flags);<br>
+<br>
+ if (unsigned RVer = DIUnit->getRuntimeVersion())<br>
+ NewCU.addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,<br>
+ dwarf::DW_FORM_data1, RVer);<br>
+ }<br>
<br>
if (useSplitDwarf())<br>
NewCU.initSection(Asm->getObjFileLowering().getDwarfInfoDWOSection());<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=270613&r1=270612&r2=270613&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=270613&r1=270612&r2=270613&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue May 24 16:19:28 2016<br>
@@ -260,6 +260,7 @@ class DwarfDebug : public DebugHandlerBa<br>
/// DWARF5 Experimental Options<br>
/// @{<br>
bool HasDwarfAccelTables;<br>
+ bool HasAppleExtensionAttributes;<br>
bool HasSplitDwarf;<br>
<br>
/// Separated Dwarf Variables<br>
@@ -505,6 +506,10 @@ public:<br>
/// use to accelerate lookup.<br>
bool useDwarfAccelTables() const { return HasDwarfAccelTables; }<br>
<br>
+ bool useAppleExtensionAttributes() const {<br>
+ return HasAppleExtensionAttributes;<br>
+ }<br>
+<br>
/// Returns whether or not to change the current debug info for the<br>
/// split dwarf proposal support.<br>
bool useSplitDwarf() const { return HasSplitDwarf; }<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=270613&r1=270612&r2=270613&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=270613&r1=270612&r2=270613&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue May 24 16:19:28 2016<br>
@@ -1244,11 +1244,13 @@ void DwarfUnit::applySubprogramAttribute<br>
if (!SP->isLocalToUnit())<br>
addFlag(SPDie, dwarf::DW_AT_external);<br>
<br>
- if (SP->isOptimized())<br>
- addFlag(SPDie, dwarf::DW_AT_APPLE_optimized);<br>
+ if (DD->useAppleExtensionAttributes()) {<br>
+ if (SP->isOptimized())<br>
+ addFlag(SPDie, dwarf::DW_AT_APPLE_optimized);<br>
<br>
- if (unsigned isa = Asm->getISAEncoding())<br>
- addUInt(SPDie, dwarf::DW_AT_APPLE_isa, dwarf::DW_FORM_flag, isa);<br>
+ if (unsigned isa = Asm->getISAEncoding())<br>
+ addUInt(SPDie, dwarf::DW_AT_APPLE_isa, dwarf::DW_FORM_flag, isa);<br>
+ }<br>
<br>
if (SP->isLValueReference())<br>
addFlag(SPDie, dwarf::DW_AT_reference);<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll?rev=270613&r1=270612&r2=270613&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll?rev=270613&r1=270612&r2=270613&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/2010-04-19-FramePtr.ll Tue May 24 16:19:28 2016<br>
@@ -1,7 +1,9 @@<br>
-; RUN: %llc_dwarf -asm-verbose -O1 -o %t < %s<br>
-; RUN: grep DW_AT_APPLE_omit_frame_ptr %t<br>
-; RUN: %llc_dwarf -disable-fp-elim -asm-verbose -O1 -o %t < %s<br>
-; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t<br>
+; RUN: %llc_dwarf -debugger-tune=lldb -asm-verbose -O1 -o - < %s | FileCheck %s<br>
+; RUN: %llc_dwarf -debugger-tune=gdb -asm-verbose -O1 -o - < %s | FileCheck %s --check-prefix=DISABLE<br>
+; RUN: %llc_dwarf -disable-fp-elim -debugger-tune=lldb -asm-verbose -O1 -o - < %s | FileCheck %s --check-prefix=DISABLE<br>
+<br>
+; CHECK: DW_AT_APPLE_omit_frame_ptr<br>
+; DISABLE-NOT: DW_AT_APPLE_omit_frame_ptr<br>
<br>
<br>
define i32 @foo() nounwind ssp !dbg !1 {<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>