This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [debug-early] do not add location info/etc to abstract instances


On 10/02/14 08:53, Jason Merrill wrote:
On 09/30/2014 02:43 PM, Aldy Hernandez wrote:
+  if (parm_die
+      /* Make sure the function to which this parameter belongs to is
+     not an abstract instance.  If it is, we can't reuse anything.
+     We must create a new DW_TAG_formal_parameter with a
+     corresponding DW_AT_abstract_origin.  */
+      && !get_AT (context_die, DW_AT_abstract_origin))

Can we use the same test here that we do later in this function, namely
origin && origin != node?

Actually yes. But I think you mean "!origin", for the parm_die==true case anyhow. So something like the following (as in the attached patch):

  /* If we have a previously generated DIE, use it, unless this is an
     abstract instance (origin != NULL), in which case we need a new
     DIE with a corresponding DW_AT_abstract_origin.  */
  bool reusing_die;
  if (parm_die && origin == NULL)
    reusing_die = true;
  else
    {
      parm_die = new_die (DW_TAG_formal_parameter, context_die, node);
      reusing_die = false;
    }


-  if (origin != NULL && origin != decl)
+  if (origin != NULL && (origin != decl || old_die))

Don't we want to go back to "if (origin != NULL)" here too?

Sure.

If you are ok with this incremental patch, I will push it to the branch.

Thanks for your comments.
Aldy

Attachment: curr
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]