<div dir="ltr">DWARF v5 Appendix A. Attributes by Tag (Informative) does not say DW_AT_prototyped is applicable for DW_TAG_label.<br><div>I have checked that neither gdb nor lldb reads DW_AT_prototyped.</div><div>So I deleted DW_AT_prototyped.</div><div><br></div><div>(I have also checked GNU as' behavior: it generates a single DW_TAG_compile_unit, There is no DW_TAG_label. However, I guess there might be some low value having DW_TAG_label.)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 26, 2020 at 2:28 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">I think I replied a little too early. This *is* MCDwarf.cpp so my comment doesn't really add any new information.<div>To actually contribute something useful, it looks like your hunch was correct:</div><div><br></div><div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(170,171,37)"><span style="font-variant-ligatures:no-common-ligatures">commit f7d77069ca47cab8f629e1cbe71265f035281329</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Author: Kevin Enderby <<a href="mailto:enderby@apple.com" target="_blank">enderby@apple.com</a>></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Date: Tue Jan 10 21:12:34 2012 +0000</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> This is the matching change for the data structure name changes for the</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> functional change in r147860 to use DW_TAG_</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(255,255,255);background-color:rgb(0,0,0)">label</span><span style="font-variant-ligatures:no-common-ligatures">'s instead TAG_subprogram's.</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> This only changes names and updates comments. No functional change.</span></div><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"> </span><br></p><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> llvm-svn: 147877</span></div></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><div><br><blockquote type="cite"><div>On May 26, 2020, at 2:09 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 26, 2020 at 2:02 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Prior to the patch that added DW_TAG_label for C labels inside of functions, I have only seen DW_TAG_label inside object files compiled from assembler. I guess there that makes the same amount of sense (though I probably would have left it unspecified).</div></blockquote><div><br></div><div>Not sure I follow your comment, sorry - could you rephrase/describe your perspective in more detail?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div><div>-- adrian<br><div><br><blockquote type="cite"><div>On May 26, 2020, at 1:57 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Any sense of the history of this? I'm guessing at some point these were emitted as subprograms rather than labels, and as subprograms it made sense to include teh prototyped=false attribute? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 25, 2020 at 3:00 PM Fangrui Song via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Fangrui Song<br>
Date: 2020-05-24T22:24:24-07:00<br>
New Revision: 20e9fc55feb58dd1f766a494c530684011291ff3<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3.diff</a><br>
<br>
LOG: [MCDwarf] Delete unneeded DW_AT_prototyped for DW_TAG_label<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
llvm/lib/MC/MCDwarf.cpp<br>
llvm/test/MC/MachO/gen-dwarf.s<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp<br>
index 0b7fc4554018..71b8f0e28e1c 100644<br>
--- a/llvm/lib/MC/MCDwarf.cpp<br>
+++ b/llvm/lib/MC/MCDwarf.cpp<br>
@@ -846,7 +846,6 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {<br>
EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4);<br>
EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4);<br>
EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr);<br>
- EmitAbbrev(MCOS, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag);<br>
EmitAbbrev(MCOS, 0, 0);<br>
<br>
// DW_TAG_unspecified_parameters DIE abbrev (3).<br>
@@ -1087,9 +1086,6 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,<br>
MCSymbolRefExpr::VK_None, context);<br>
MCOS->emitValue(AT_low_pc, AddrSize);<br>
<br>
- // DW_AT_prototyped, a one byte flag value of 0 saying we have no prototype.<br>
- MCOS->emitInt8(0);<br>
-<br>
// The DW_TAG_unspecified_parameters DIE abbrev (3).<br>
MCOS->emitULEB128IntValue(3);<br>
<br>
<br>
diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s<br>
index 6d39d278e818..58f8a7ccf899 100644<br>
--- a/llvm/test/MC/MachO/gen-dwarf.s<br>
+++ b/llvm/test/MC/MachO/gen-dwarf.s<br>
@@ -30,7 +30,6 @@ _x: .long 1<br>
// CHECK: DW_AT_decl_file DW_FORM_data4<br>
// CHECK: DW_AT_decl_line DW_FORM_data4<br>
// CHECK: DW_AT_low_pc DW_FORM_addr<br>
-// CHECK: DW_AT_prototyped DW_FORM_flag<br>
<br>
// CHECK: [3] DW_TAG_unspecified_parameters DW_CHILDREN_no<br>
<br>
@@ -53,7 +52,6 @@ _x: .long 1<br>
// CHECK: DW_AT_decl_file ([[FILE:".*gen-dwarf.s"]])<br>
// CHECK: DW_AT_decl_line (5)<br>
// CHECK: DW_AT_low_pc (0x0000000000000000)<br>
-// CHECK: DW_AT_prototyped (0x00)<br>
<br>
// CHECK: DW_TAG_unspecified_parameters<br>
<br>
@@ -64,7 +62,6 @@ _x: .long 1<br>
// CHECK: DW_AT_decl_file ([[FILE]])<br>
// CHECK: DW_AT_decl_line (9)<br>
// CHECK: DW_AT_low_pc (0x0000000000000007)<br>
-// CHECK: DW_AT_prototyped (0x00)<br>
<br>
// CHECK: DW_TAG_unspecified_parameters<br>
<br>
@@ -75,7 +72,6 @@ _x: .long 1<br>
// CHECK: DW_AT_decl_file ([[FILE]])<br>
// CHECK: DW_AT_decl_line (10)<br>
// CHECK: DW_AT_low_pc (0x0000000000000007)<br>
-// CHECK: DW_AT_prototyped (0x00)<br>
<br>
// CHECK: DW_TAG_unspecified_parameters<br>
<br>
<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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div></div>
</div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">宋方睿</div></div>