[llvm] 20e9fc5 - [MCDwarf] Delete unneeded DW_AT_prototyped for DW_TAG_label

Robinson, Paul via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 12:52:08 PDT 2020


FTR, the absence of an attribute from a list in Appendix A does not mean it’s forbidden; just that it’s not usual.
The argument that neither gdb nor lldb look for it is more compelling, as well as observing that the flag was invariably zero.
(I have no objection to its removal.)
--paulr

From: Fāng-ruì Sòng <maskray at google.com>
Sent: Tuesday, May 26, 2020 5:53 PM
To: David Blaikie <dblaikie at gmail.com>
Cc: Fangrui Song <llvmlistbot at llvm.org>; Robinson, Paul <paul.robinson at sony.com>; llvm-commits <llvm-commits at lists.llvm.org>; Adrian Prantl <aprantl at apple.com>
Subject: Re: [llvm] 20e9fc5 - [MCDwarf] Delete unneeded DW_AT_prototyped for DW_TAG_label

DWARF v5 Appendix A. Attributes by Tag (Informative) does not say DW_AT_prototyped is applicable for DW_TAG_label.
I have checked that neither gdb nor lldb reads DW_AT_prototyped.
So I deleted DW_AT_prototyped.

(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.)

On Tue, May 26, 2020 at 2:28 PM Adrian Prantl <aprantl at apple.com<mailto:aprantl at apple.com>> wrote:
I think I replied a little too early. This *is* MCDwarf.cpp so my comment doesn't really add any new information.
To actually contribute something useful, it looks like your hunch was correct:

commit f7d77069ca47cab8f629e1cbe71265f035281329
Author: Kevin Enderby <enderby at apple.com<mailto:enderby at apple.com>>
Date:   Tue Jan 10 21:12:34 2012 +0000

    This is the matching change for the data structure name changes for the
    functional change in r147860 to use DW_TAG_label's instead TAG_subprogram's.
    This only changes names and updates comments.  No functional change.


    llvm-svn: 147877




On May 26, 2020, at 2:09 PM, David Blaikie <dblaikie at gmail.com<mailto:dblaikie at gmail.com>> wrote:



On Tue, May 26, 2020 at 2:02 PM Adrian Prantl <aprantl at apple.com<mailto:aprantl at apple.com>> wrote:
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).

Not sure I follow your comment, sorry - could you rephrase/describe your perspective in more detail?


-- adrian


On May 26, 2020, at 1:57 PM, David Blaikie <dblaikie at gmail.com<mailto:dblaikie at gmail.com>> wrote:

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?

On Mon, May 25, 2020 at 3:00 PM Fangrui Song via llvm-commits <llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>> wrote:

Author: Fangrui Song
Date: 2020-05-24T22:24:24-07:00
New Revision: 20e9fc55feb58dd1f766a494c530684011291ff3

URL: https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3<https://urldefense.com/v3/__https:/github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3__;!!JmoZiZGBv3RvKRSx!oFY6rn6q7NLaL_YAxDThAs3yQWxPJ2yZAjofKkDP62ej1h-xh78EGsykA1fF5ewvZQ$>
DIFF: https://github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3.diff<https://urldefense.com/v3/__https:/github.com/llvm/llvm-project/commit/20e9fc55feb58dd1f766a494c530684011291ff3.diff__;!!JmoZiZGBv3RvKRSx!oFY6rn6q7NLaL_YAxDThAs3yQWxPJ2yZAjofKkDP62ej1h-xh78EGsykA1d1z55HUg$>

LOG: [MCDwarf] Delete unneeded DW_AT_prototyped for DW_TAG_label

Added:


Modified:
    llvm/lib/MC/MCDwarf.cpp
    llvm/test/MC/MachO/gen-dwarf.s

Removed:



################################################################################
diff  --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 0b7fc4554018..71b8f0e28e1c 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -846,7 +846,6 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {
   EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4);
   EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4);
   EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr);
-  EmitAbbrev(MCOS, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag);
   EmitAbbrev(MCOS, 0, 0);

   // DW_TAG_unspecified_parameters DIE abbrev (3).
@@ -1087,9 +1086,6 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
                                              MCSymbolRefExpr::VK_None, context);
     MCOS->emitValue(AT_low_pc, AddrSize);

-    // DW_AT_prototyped, a one byte flag value of 0 saying we have no prototype.
-    MCOS->emitInt8(0);
-
     // The DW_TAG_unspecified_parameters DIE abbrev (3).
     MCOS->emitULEB128IntValue(3);


diff  --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s
index 6d39d278e818..58f8a7ccf899 100644
--- a/llvm/test/MC/MachO/gen-dwarf.s
+++ b/llvm/test/MC/MachO/gen-dwarf.s
@@ -30,7 +30,6 @@ _x:   .long 1
 // CHECK:      DW_AT_decl_file DW_FORM_data4
 // CHECK:      DW_AT_decl_line DW_FORM_data4
 // CHECK:      DW_AT_low_pc    DW_FORM_addr
-// CHECK:      DW_AT_prototyped        DW_FORM_flag

 // CHECK: [3] DW_TAG_unspecified_parameters    DW_CHILDREN_no

@@ -53,7 +52,6 @@ _x:   .long 1
 // CHECK:      DW_AT_decl_file ([[FILE:%22.*gen-dwarf.s%22]])
 // CHECK:      DW_AT_decl_line (5)
 // CHECK:      DW_AT_low_pc (0x0000000000000000)
-// CHECK:      DW_AT_prototyped (0x00)

 // CHECK:      DW_TAG_unspecified_parameters

@@ -64,7 +62,6 @@ _x:   .long 1
 // CHECK:      DW_AT_decl_file ([[FILE]])
 // CHECK:      DW_AT_decl_line (9)
 // CHECK:      DW_AT_low_pc (0x0000000000000007)
-// CHECK:      DW_AT_prototyped (0x00)

 // CHECK:      DW_TAG_unspecified_parameters

@@ -75,7 +72,6 @@ _x:   .long 1
 // CHECK:      DW_AT_decl_file ([[FILE]])
 // CHECK:      DW_AT_decl_line (10)
 // CHECK:      DW_AT_low_pc (0x0000000000000007)
-// CHECK:      DW_AT_prototyped (0x00)

 // CHECK:      DW_TAG_unspecified_parameters




_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits__;!!JmoZiZGBv3RvKRSx!oFY6rn6q7NLaL_YAxDThAs3yQWxPJ2yZAjofKkDP62ej1h-xh78EGsykA1dGGL2dAQ$>




--
宋方睿
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/ad4697e3/attachment.html>


More information about the llvm-commits mailing list