Hi Richard.

I'm chasing my tail here looking at an LTO + debug problem, and for the life of me I can't figure out how all this partition business affects a symbol's `analyzed' bit. Anyways... the documentation for all these functions is wrong.

Can you look at this patch and tell me if it makes sense? I feel a bit uneasy committing under the obvious rule, since I don't entirely understand the partitioning thing.

Would anyone mind me fixing this on mainline?  It's just a comment fix.

Also, since you seem to understand all this best, can you suggest some better wording for the lto_encoder_entry comments?

/* Entry of LTO symtab encoder.  */
struct lto_encoder_entry
{
  symtab_node *node;
  /* Is the node in this partition (i.e. ltrans of this partition will
     be responsible for outputting it)? */
  unsigned int in_partition:1;
  /* Do we encode body in this partition?  */
  unsigned int body:1;
  /* Do we encode initializer in this partition?
     For example the readonly variable initializers are encoded to aid
     constant folding even if they are not in the partition.  */
  unsigned int initializer:1;
};

Whenever I get to the LTO part of this project, I promise to start documenting things better. This whole thing is a mystery.

Thanks.
Aldy
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bddb9a8..68f8042 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-13  Aldy Hernandez  <al...@redhat.com>
+
+       * lto-cgraph: Update function comments for
+       lto_symtab_encoder_encode_*.
+
 2014-12-20  Martin Uecker <uec...@eecs.berkeley.edu>
 
        * doc/invoke.texi: Document -Wdiscarded-array-qualifiers.
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index cf92892..0b9d945 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -187,7 +187,7 @@ lto_symtab_encoder_delete_node (lto_symtab_encoder_t 
encoder,
 }
 
 
-/* Return TRUE if we should encode initializer of NODE (if any).  */
+/* Return TRUE if we should encode the body of NODE (if any).  */
 
 bool
 lto_symtab_encoder_encode_body_p (lto_symtab_encoder_t encoder,
@@ -197,7 +197,7 @@ lto_symtab_encoder_encode_body_p (lto_symtab_encoder_t 
encoder,
   return encoder->nodes[index].body;
 }
 
-/* Return TRUE if we should encode body of NODE (if any).  */
+/* Specify that we encode the body of NODE in this partition.  */
 
 static void
 lto_set_symtab_encoder_encode_body (lto_symtab_encoder_t encoder,
@@ -220,7 +220,7 @@ lto_symtab_encoder_encode_initializer_p 
(lto_symtab_encoder_t encoder,
   return encoder->nodes[index].initializer;
 }
 
-/* Return TRUE if we should encode initializer of NODE (if any).  */
+/* Specify that we should encode initializer of NODE (if any).  */
 
 static void
 lto_set_symtab_encoder_encode_initializer (lto_symtab_encoder_t encoder,
@@ -230,7 +230,7 @@ lto_set_symtab_encoder_encode_initializer 
(lto_symtab_encoder_t encoder,
   encoder->nodes[index].initializer = true;
 }
 
-/* Return TRUE if we should encode initializer of NODE (if any).  */
+/* Return TRUE if NODE is in this partition.  */
 
 bool
 lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t encoder,
@@ -242,7 +242,7 @@ lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t 
encoder,
   return encoder->nodes[index].in_partition;
 }
 
-/* Return TRUE if we should encode body of NODE (if any).  */
+/* Specify that NODE is in this partition.  */
 
 void
 lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t encoder,

Reply via email to