public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* potiential problems with parm decls.
@ 2007-08-01 14:16 Kenneth Zadeck
  2007-08-01 17:23 ` Mark Mitchell
  0 siblings, 1 reply; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-01 14:16 UTC (permalink / raw)
  To: Mark Mitchell, gcc-patches

Mark,

How are you (we) handling PARM_DECLS?
Honza has informed my that the PARM_DECLS in the function's
DECL_ARGUMENTS needs to be "==" to the set of PARM_DECLS accessed in the
function.

How are you setting DECL_ARGUMENTS for functions?

Am I supposed to be building this for the functions that I am
processing?  If so, what about the functions that i am not processing?
Otherwise, i think that we are going to need something like lto_parm_ref
and lto_resolve_parm_ref.

Kenny





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: potiential problems with parm decls.
  2007-08-01 14:16 potiential problems with parm decls Kenneth Zadeck
@ 2007-08-01 17:23 ` Mark Mitchell
  2007-08-01 17:34   ` Kenneth Zadeck
  2007-08-01 20:44   ` [lto] PATCH COMMITTED " Kenneth Zadeck
  0 siblings, 2 replies; 13+ messages in thread
From: Mark Mitchell @ 2007-08-01 17:23 UTC (permalink / raw)
  To: Kenneth Zadeck; +Cc: gcc-patches

Kenneth Zadeck wrote:

> How are you (we) handling PARM_DECLS?
> Honza has informed my that the PARM_DECLS in the function's
> DECL_ARGUMENTS needs to be "==" to the set of PARM_DECLS accessed in the
> function.

The code I wrote doesn't set DECL_ARGUMENTS, on the theory that
parameters are essentially local variables.  I think it would be best if
you set these up because the only information I have is types, and that
may not be enough.  But, if that's impractical, then I will see what I
can do.

Also as for:

> Mark claims that everything on his end should work except for static
> initializers so we may be ready for some larger scale testing as soon as
> the above bug is tracked down.

It's more that I don't know what else is broken, rather than that I
think it's all perfect. :-)  I don't want to give the impression I think
it's all in tip-top shape.

Also, with respect to static initializers, I think I can make it work in
the direction I started, but if you think it's easy to serialize
initializers using your existing machinery, that might be an easier
path.  How hard would it be to leverage your serialization code to put
static initializers for variables in their own sections, so that the
initializer for "i" would be in some ".lto.i" section in the same way
that the body of "f" is in ".lto.f"?  I'm happy to work on this; I'm
just looking for some guidance as to what you think about it.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: potiential problems with parm decls.
  2007-08-01 17:23 ` Mark Mitchell
@ 2007-08-01 17:34   ` Kenneth Zadeck
  2007-08-02  0:43     ` Mark Mitchell
  2007-08-01 20:44   ` [lto] PATCH COMMITTED " Kenneth Zadeck
  1 sibling, 1 reply; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-01 17:34 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

Mark Mitchell wrote:
> Kenneth Zadeck wrote:
>
>   
>> How are you (we) handling PARM_DECLS?
>> Honza has informed my that the PARM_DECLS in the function's
>> DECL_ARGUMENTS needs to be "==" to the set of PARM_DECLS accessed in the
>> function.
>>     
>
> The code I wrote doesn't set DECL_ARGUMENTS, on the theory that
> parameters are essentially local variables.  I think it would be best if
> you set these up because the only information I have is types, and that
> may not be enough.  But, if that's impractical, then I will see what I
> can do.
>
> Also as for:
>
>   
How do you represent the function_decls for the functions that do not
have bodies?  Do these have parm_decls in them, or only a list of
types?  If they have parm_decls, i could see a problem.  If they only
have types, then there is no problem with me doing the parm decls for
the functions i see.


>> Mark claims that everything on his end should work except for static
>> initializers so we may be ready for some larger scale testing as soon as
>> the above bug is tracked down.
>>     
>
> It's more that I don't know what else is broken, rather than that I
> think it's all perfect. :-)  I don't want to give the impression I think
> it's all in tip-top shape.
>   
That is certainly true for my code as well.
> Also, with respect to static initializers, I think I can make it work in
> the direction I started, but if you think it's easy to serialize
> initializers using your existing machinery, that might be an easier
> path.  How hard would it be to leverage your serialization code to put
> static initializers for variables in their own sections, so that the
> initializer for "i" would be in some ".lto.i" section in the same way
> that the body of "f" is in ".lto.f"?  I'm happy to work on this; I'm
> just looking for some guidance as to what you think about it.
>
> Thanks,
>
>   
My only concern here is that you said at the summit that these were not
in gimple.  If they are in gimple, then it should not be a big deal for
me to co-opt the existing machinery to put each of them in its own
section. 


Kenny

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [lto] PATCH COMMITTED Re: potiential problems with parm decls.
  2007-08-01 17:23 ` Mark Mitchell
  2007-08-01 17:34   ` Kenneth Zadeck
@ 2007-08-01 20:44   ` Kenneth Zadeck
  2007-08-01 22:12     ` Tom Tromey
  1 sibling, 1 reply; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-01 20:44 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches, Hubicha, Jan

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

Mark Mitchell wrote:
> Kenneth Zadeck wrote:
>
>   
>> How are you (we) handling PARM_DECLS?
>> Honza has informed my that the PARM_DECLS in the function's
>> DECL_ARGUMENTS needs to be "==" to the set of PARM_DECLS accessed in the
>> function.
>>     
>
> The code I wrote doesn't set DECL_ARGUMENTS, on the theory that
> parameters are essentially local variables.  I think it would be best if
> you set these up because the only information I have is types, and that
> may not be enough.  But, if that's impractical, then I will see what I
> can do.
>
> Also as for:
>
>   
As Honsa predicted, the problem was not setting DECL_ARGUMENTS.  This
patch serializes and reconstitutes this tree.  Also, some useless
debugging was removed.

2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-function-out.c (produce_asm): Remove old debugging code.
    (output_function): Serialize DECL_ARGUMENTS.
2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-read.c (input_globals): Remove debugging.
    (input_function): Set DECL_ARGUMENTS.

Committed as revision 127138.

Kenny

[-- Attachment #2: decl_arguments1.diff --]
[-- Type: text/x-patch, Size: 2266 bytes --]

Index: lto-function-out.c
===================================================================
--- lto-function-out.c	(revision 127125)
+++ lto-function-out.c	(working copy)
@@ -1773,12 +1773,6 @@ produce_asm (struct output_block *ob, tr
   /* Write the global type references.  */
   for (index = 0; VEC_iterate(tree, ob->types, index, type); index++)
     {
-      fprintf (stderr, "type %d = ", index);
-      print_generic_expr (stderr, type, TDF_VOPS|TDF_UID);
-      fprintf (stderr, "\n");
-      print_node (stderr, "", type, 0);
-      fprintf (stderr, "\n\n");
-
       lto_type_ref (type, &out_ref);
       dw2_asm_output_data (8, out_ref.section, " ");
       dw2_asm_output_delta (8, out_ref.label,
@@ -1965,6 +1959,13 @@ output_function (tree function)
   /* Output any exception-handling regions.  */
   output_eh_regions (ob, fn);
 
+  /* Output the argument array.  */
+  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
+  if (DECL_ARGUMENTS (function))
+    output_expr_operand (ob, DECL_ARGUMENTS (function));
+  else
+    output_zero (ob);
+    
   /* Output the code for the function.  */
   FOR_ALL_BB_FN (bb, fn)
     output_bb (ob, bb, fn);
Index: lto/lto-read.c
===================================================================
--- lto/lto-read.c	(revision 127125)
+++ lto/lto-read.c	(working copy)
@@ -919,16 +919,7 @@ input_globals (struct lto_function_heade
 	= lto_resolve_var_ref (fd, context, &in_var_decls[i]);
 
   for (i=0; i<header->num_types; i++)
-    {
-      fun_in->types[i]
-	= lto_resolve_type_ref (fd, context, &in_types[i]);
-      
-      fprintf (stderr, "type %d = ", i);
-      print_generic_expr (stderr, fun_in->types[i], TDF_VOPS|TDF_UID);
-      fprintf (stderr, "\n");
-      print_node (stderr, "", fun_in->types[i], 0);
-      fprintf (stderr, "\n\n");
-    }
+    fun_in->types[i] = lto_resolve_type_ref (fd, context, &in_types[i]);
 }
 
 
@@ -1307,6 +1298,13 @@ input_function (tree fn_decl, struct fun
 
   input_eh_regions (ib, fn, fun_in);
 
+  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
+  tag = input_record_start (ib);
+  if (tag)
+    DECL_ARGUMENTS (fn_decl) = input_expr_operand (ib, fun_in, fn, tag);
+  else
+    DECL_ARGUMENTS (fn_decl) = NULL;
+
   tag = input_record_start (ib);
   while (tag)
     {

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [lto] PATCH COMMITTED Re: potiential problems with parm decls.
  2007-08-01 20:44   ` [lto] PATCH COMMITTED " Kenneth Zadeck
@ 2007-08-01 22:12     ` Tom Tromey
  2007-08-01 22:36       ` Kenneth Zadeck
  2007-08-02  1:06       ` [lto] PATCH COMMITTED to fix missing semicolons Kenneth Zadeck
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Tromey @ 2007-08-01 22:12 UTC (permalink / raw)
  To: Kenneth Zadeck; +Cc: Mark Mitchell, gcc-patches, Hubicha, Jan

>>>>> "KZ" == Kenneth Zadeck <zadeck@naturalbridge.com> writes:

KZ> +  /* Output the argument array.  */
KZ> +  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")

I find it a little strange to see function-like macro invocations with
no terminating ";".

In addition to looking strange, this upsets Emacs; it may be odd but
GNU-style indentation is partially defined as "whatever makes Emacs do
the right thing".

Tom

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [lto] PATCH COMMITTED Re: potiential problems with parm decls.
  2007-08-01 22:12     ` Tom Tromey
@ 2007-08-01 22:36       ` Kenneth Zadeck
  2007-08-02  1:06       ` [lto] PATCH COMMITTED to fix missing semicolons Kenneth Zadeck
  1 sibling, 0 replies; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-01 22:36 UTC (permalink / raw)
  To: tromey; +Cc: Mark Mitchell, gcc-patches, Hubicha, Jan

Tom Tromey wrote:
>>>>>> "KZ" == Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>>>>>>             
>
> KZ> +  /* Output the argument array.  */
> KZ> +  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
>
> I find it a little strange to see function-like macro invocations with
> no terminating ";".
>
> In addition to looking strange, this upsets Emacs; it may be odd but
> GNU-style indentation is partially defined as "whatever makes Emacs do
> the right thing".
>
> Tom
>   
I do not disagree with you.  the problem is that i am not really that
sophisticated a user of c macros and i do not know how to make it work
if you put the semicolons in. 

The problem is that if you turn off the lto debugging, these macros
become the empty string and you are left with a hanging semicolon.

if you or anyone else has a better way to do this, i am happy to change it.
I am a little tired of emacs moving the next stmt around also. 

Kenny

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: potiential problems with parm decls.
  2007-08-01 17:34   ` Kenneth Zadeck
@ 2007-08-02  0:43     ` Mark Mitchell
  2007-08-02  1:10       ` Kenneth Zadeck
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Mitchell @ 2007-08-02  0:43 UTC (permalink / raw)
  To: Kenneth Zadeck; +Cc: gcc-patches

Kenneth Zadeck wrote:

> My only concern here is that you said at the summit that these were not
> in gimple.  If they are in gimple, then it should not be a big deal for
> me to co-opt the existing machinery to put each of them in its own
> section. 

I'm not sure "being GIMPLE" has meaning in this context; they're just
data.  The expressions are all constants, like "3", "&foo", or "&foo +
1".  These can be arranged in aggregates; you can have a CONSTRUCTOR
whose elements are "3" and "&foo", for example.  Will that work?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [lto] PATCH COMMITTED to fix missing semicolons.
  2007-08-01 22:12     ` Tom Tromey
  2007-08-01 22:36       ` Kenneth Zadeck
@ 2007-08-02  1:06       ` Kenneth Zadeck
  2007-08-02  1:16         ` David Daney
  1 sibling, 1 reply; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-02  1:06 UTC (permalink / raw)
  To: tromey; +Cc: Mark Mitchell, gcc-patches, Hubicha, Jan

[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

Tom Tromey wrote:
>>>>>> "KZ" == Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>>>>>>             
>
> KZ> +  /* Output the argument array.  */
> KZ> +  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
>
> I find it a little strange to see function-like macro invocations with
> no terminating ";".
>
> In addition to looking strange, this upsets Emacs; it may be odd but
> GNU-style indentation is partially defined as "whatever makes Emacs do
> the right thing".
>
> Tom
>   
I figured out how to do this.

committed as revision 127145.

kenny

2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-read.c (input_uleb128, input_string_internal, input_real,
    input_integer, input_record_start, input_list, get_type_ref,
    input_flags, input_expr_operand, input_expr_operand,
    input_expr_operand, input_local_vars, input_cfg, input_phi,
    input_ssa_names, input_bb, input_function): Added semicolons.

2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-function-out.c (output_1_stream, output_zero,
    output_sleb128_stream, output_string, output_real, output_integer,
    output_tree_flags, output_type_ref, output_record_start,
    output_tree_list, output_eh_cleanup, output_eh_try,
    output_eh_catch, output_eh_allowed, output_eh_must_not_throw,
    output_eh_regions, output_constructor, output_expr_operand,
    output_local_vars, output_cfg, output_phi, output_bb,
    output_function): Added semicolons.
    * lto-tags.h (LTO_DEBUG_INDENT, LTO_DEBUG_INDENT_TOKEN,
    LTO_DEBUG_INTEGER, LTO_DEBUG_STRING, LTO_DEBUG_TOKEN,
    LTO_DEBUG_UNDENT, LTO_DEBUG_WIDE): Changed to support semicolon
    after macro call.
    (useless_function): New function.
   


[-- Attachment #2: semicolon1.diff --]
[-- Type: text/x-patch, Size: 20759 bytes --]

Index: lto-function-out.c
===================================================================
--- lto-function-out.c	(revision 127138)
+++ lto-function-out.c	(working copy)
@@ -376,7 +376,7 @@ output_1_stream (struct output_stream *o
 static void
 output_zero (struct output_block *ob)
 {
-  LTO_DEBUG_WIDE ("U", 0)
+  LTO_DEBUG_WIDE ("U", 0);
   output_1_stream (ob->main_stream, 0);
 }
 
@@ -386,7 +386,7 @@ output_zero (struct output_block *ob)
 static void
 output_uleb128_stream (struct output_stream *obs, unsigned HOST_WIDE_INT work)
 {
-  LTO_DEBUG_WIDE ("U", work)
+  LTO_DEBUG_WIDE ("U", work);
   do
     {
       unsigned int byte = (work & 0x7f);
@@ -417,7 +417,7 @@ static void
 output_sleb128_stream (struct output_stream *obs, HOST_WIDE_INT work)
 {
   int more, byte;
-  LTO_DEBUG_WIDE ("S", work)
+  LTO_DEBUG_WIDE ("S", work);
   do
     {
       byte = (work & 0x7f);
@@ -484,9 +484,9 @@ output_string (struct output_block *ob, 
 	 occurence of this string or not.  Thus, we simulate the same
 	 debugging info as would be output as if this was a new
 	 string.  */
-      LTO_DEBUG_WIDE ("U", old_slot->slot_num)
+      LTO_DEBUG_WIDE ("U", old_slot->slot_num);
     }
-  LTO_DEBUG_STRING (string, len)
+  LTO_DEBUG_STRING (string, len);
 }
 
 
@@ -498,7 +498,7 @@ output_real (struct output_block *ob, tr
   static char real_buffer[1000];
   const REAL_VALUE_TYPE *r = &TREE_REAL_CST (t);
 
-  LTO_DEBUG_TOKEN ("real")
+  LTO_DEBUG_TOKEN ("real");
   real_to_hexadecimal (real_buffer, r, 1000, 0, 1);
   output_string (ob, ob->main_stream, real_buffer, strlen (real_buffer));
 }
@@ -526,7 +526,7 @@ output_integer (struct output_block *ob,
       return;
     }
 
-  LTO_DEBUG_INTEGER ("SS", high, low)
+  LTO_DEBUG_INTEGER ("SS", high, low);
 
   /* This is just a copy of the output_sleb128 code with extra
      operations to transfer the low 7 bits of the high value to the
@@ -603,7 +603,7 @@ output_tree_flags (struct output_block *
 
   if (code == 0 || TEST_BIT (lto_flags_needed_for, code))
     {
-      LTO_DEBUG_TOKEN ("flags")
+      LTO_DEBUG_TOKEN ("flags");
 
 #define START_CLASS_SWITCH()              \
   {                                       \
@@ -681,14 +681,14 @@ output_tree_flags (struct output_block *
       output_uleb128 (ob, flags);
       if (file_to_write)
 	{
-	  LTO_DEBUG_TOKEN ("file")
-	    output_string (ob, ob->main_stream, 
-			   file_to_write, strlen (file_to_write));
+	  LTO_DEBUG_TOKEN ("file");
+	  output_string (ob, ob->main_stream, 
+			 file_to_write, strlen (file_to_write));
 	}
       if (line_to_write != -1)
 	{
-	  LTO_DEBUG_TOKEN ("line")
-	    output_uleb128 (ob, line_to_write);
+	  LTO_DEBUG_TOKEN ("line");
+	  output_uleb128 (ob, line_to_write);
 	}
     }
 }
@@ -703,7 +703,7 @@ output_type_ref (struct output_block *ob
 {
   bool new;
 
-  LTO_DEBUG_TOKEN ("type")
+  LTO_DEBUG_TOKEN ("type");
   new = output_decl_index (ob->main_stream, ob->type_hash_table,
 			   &ob->next_type_index, node);
 
@@ -770,7 +770,7 @@ output_record_start (struct output_block
 		     tree value, unsigned int tag)
 {
   output_1_stream (ob->main_stream, tag);
-  LTO_DEBUG_INDENT (tag)
+  LTO_DEBUG_INDENT (tag);
   if (expr)
     {
       enum tree_code code = TREE_CODE (expr);
@@ -824,7 +824,7 @@ output_tree_list (struct output_block *o
       for (tl = list; tl; tl = TREE_CHAIN (tl))
 	if (TREE_VALUE (tl) != NULL_TREE)
 	  output_expr_operand (ob, TREE_VALUE (tl));
-      LTO_DEBUG_UNDENT ()
+      LTO_DEBUG_UNDENT ();
     }
   else
     output_zero (ob);
@@ -850,7 +850,7 @@ output_eh_cleanup (void *obv,
   output_sleb128 (ob, prev_try);
   if (!has_peer)
     output_zero (ob);
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -875,7 +875,7 @@ output_eh_try (void *obv,
   output_sleb128 (ob, last_catch);
   if (!has_peer)
     output_zero (ob);
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -901,7 +901,7 @@ output_eh_catch (void *obv,
   output_type_list (ob, type_list);
   if (!has_peer)
     output_zero (ob);
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 /* Output an eh_allowed_exceptions region with REGION_NUMBER.
@@ -923,7 +923,7 @@ output_eh_allowed (void *obv,
   output_type_list (ob, type_list);
   if (!has_peer)
     output_zero (ob);
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -945,7 +945,7 @@ output_eh_must_not_throw (void *obv,
   output_sleb128 (ob, region_number);
   if (!has_peer)
     output_zero (ob);
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -963,7 +963,7 @@ output_eh_regions (struct output_block *
 			 output_eh_catch,
 			 output_eh_allowed,
 			 output_eh_must_not_throw);
-      LTO_DEBUG_UNDENT ()
+      LTO_DEBUG_UNDENT ();
     }
   /* The 0 either terminates the record or indicates that there are no
      eh_records at all.  */
@@ -993,14 +993,14 @@ output_constructor (struct output_block 
 	  output_integer (ob, TREE_OPERAND (purpose, 0));
 	  output_type_ref (ob, TREE_OPERAND (purpose, 1));
 	  output_integer (ob, TREE_OPERAND (purpose, 1));
-	  LTO_DEBUG_UNDENT ()
+	  LTO_DEBUG_UNDENT ();
 	}
 
       switch (TREE_CODE (value))
 	{
 	case CONSTRUCTOR:
 	  output_constructor (ob, value);
-	  LTO_DEBUG_UNDENT ()
+	  LTO_DEBUG_UNDENT ();
 	  break;
 	case INTEGER_CST:
 	case REAL_CST:
@@ -1290,7 +1290,7 @@ output_expr_operand (struct output_block
 	    for (tl = ASM_INPUTS (expr); tl; tl = TREE_CHAIN (tl))
 	      output_expr_operand (ob, TREE_VALUE (tl));
 	    output_zero (ob);
-	    LTO_DEBUG_UNDENT ()
+	    LTO_DEBUG_UNDENT ();
 	  }
 	if (ASM_OUTPUTS (expr) != NULL_TREE)
 	  {
@@ -1300,7 +1300,7 @@ output_expr_operand (struct output_block
 	    for (tl = ASM_OUTPUTS (expr); tl; tl = TREE_CHAIN (tl))
 	      output_expr_operand (ob, TREE_VALUE (tl));
 	    output_zero (ob);
-	    LTO_DEBUG_UNDENT ()
+	    LTO_DEBUG_UNDENT ();
 	  }
 	if (ASM_CLOBBERS (expr) != NULL_TREE)
 	  {
@@ -1310,7 +1310,7 @@ output_expr_operand (struct output_block
 	    for (tl = ASM_CLOBBERS (expr); tl; tl = TREE_CHAIN (tl))
 	      output_expr_operand (ob, TREE_VALUE (tl));
 	    output_zero (ob);
-	    LTO_DEBUG_UNDENT ()
+	    LTO_DEBUG_UNDENT ();
 	  }
       }
       break;
@@ -1414,7 +1414,7 @@ output_expr_operand (struct output_block
       gcc_unreachable ();
     }
 
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -1481,15 +1481,15 @@ output_local_vars (struct output_block *
 	output_type_ref (ob, DECL_ARG_TYPE (decl));
       
       output_tree_flags (ob, 0, decl);
-      LTO_DEBUG_TOKEN ("align")
+      LTO_DEBUG_TOKEN ("align");
       output_uleb128 (ob, DECL_ALIGN (decl));
 
       /* Put out the subtrees.  */
-      LTO_DEBUG_TOKEN ("size")
+      LTO_DEBUG_TOKEN ("size");
       output_expr_operand (ob, DECL_SIZE (decl));
       if (DECL_ATTRIBUTES (decl)!= NULL_TREE)
 	{
-	  LTO_DEBUG_TOKEN ("attributes")
+	  LTO_DEBUG_TOKEN ("attributes");
 	  output_tree_list (ob, DECL_ATTRIBUTES (decl),
 			    LTO_attribute_list);
 	}
@@ -1500,7 +1500,7 @@ output_local_vars (struct output_block *
       if (DECL_ABSTRACT_ORIGIN (decl) != NULL_TREE)
 	output_expr_operand (ob, DECL_ABSTRACT_ORIGIN (decl));
 
-      LTO_DEBUG_UNDENT()
+      LTO_DEBUG_UNDENT();
     }
 
   ob->main_stream = tmp_stream;
@@ -1569,7 +1569,7 @@ output_cfg (struct output_block *ob, str
   ob->main_stream = ob->cfg_stream;
 
   /* Output the number of the highest basic block.  */
-  LTO_DEBUG_TOKEN ("lastbb")
+  LTO_DEBUG_TOKEN ("lastbb");
   output_uleb128 (ob, last_basic_block_for_function(fn));
 
   FOR_ALL_BB_FN (bb, fn)
@@ -1577,22 +1577,22 @@ output_cfg (struct output_block *ob, str
       edge_iterator ei;
       edge e;
 
-      LTO_DEBUG_TOKEN ("bbindex")
+      LTO_DEBUG_TOKEN ("bbindex");
       output_sleb128 (ob, bb->index);
 
       /* Output the successors and the edge flags.  */
-      LTO_DEBUG_TOKEN ("edgecount")
+      LTO_DEBUG_TOKEN ("edgecount");
       output_uleb128 (ob, EDGE_COUNT (bb->succs));
       FOR_EACH_EDGE (e, ei, bb->succs)
 	{
-	  LTO_DEBUG_TOKEN ("dest")
+	  LTO_DEBUG_TOKEN ("dest");
 	  output_uleb128 (ob, e->dest->index);
-	  LTO_DEBUG_TOKEN ("eflags")
+	  LTO_DEBUG_TOKEN ("eflags");
 	  output_uleb128 (ob, e->flags);
 	}
     }
 
-  LTO_DEBUG_TOKEN ("bbindex")
+  LTO_DEBUG_TOKEN ("bbindex");
   output_sleb128 (ob, -1);
   ob->main_stream = tmp_stream;
 }
@@ -1614,7 +1614,7 @@ output_phi (struct output_block *ob, tre
       output_expr_operand (ob, PHI_ARG_DEF (expr, i));
       output_uleb128 (ob, PHI_ARG_EDGE (expr, i)->src->index);
     }
-  LTO_DEBUG_UNDENT ()
+  LTO_DEBUG_UNDENT ();
 }
 
 
@@ -1629,7 +1629,7 @@ output_bb (struct output_block *ob, basi
 		       (!bsi_end_p (bsi)) || phi_nodes (bb) ? LTO_bb1 : LTO_bb0);
 
   /* The index of the basic block.  */
-  LTO_DEBUG_TOKEN ("bbindex")
+  LTO_DEBUG_TOKEN ("bbindex");
   output_uleb128 (ob, bb->index);
 
   if ((!bsi_end_p (bsi)) || phi_nodes (bb))
@@ -1643,7 +1643,7 @@ output_bb (struct output_block *ob, basi
 	{
 	  tree stmt = bsi_stmt (bsi);
 	
-	  LTO_DEBUG_INDENT_TOKEN ("stmt")
+	  LTO_DEBUG_INDENT_TOKEN ("stmt");
 	  output_expr_operand (ob, stmt);
 	
 	  /* We only need to set the region number of the tree that
@@ -1664,20 +1664,20 @@ output_bb (struct output_block *ob, basi
 	    }
 	}
 
-      LTO_DEBUG_INDENT_TOKEN ("stmt")
+      LTO_DEBUG_INDENT_TOKEN ("stmt");
       output_zero (ob);
 
       for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
 	{
-	  LTO_DEBUG_INDENT_TOKEN ("phi")
+	  LTO_DEBUG_INDENT_TOKEN ("phi");
 	  output_phi (ob, phi);
 	}
 
-      LTO_DEBUG_INDENT_TOKEN ("phi")
+      LTO_DEBUG_INDENT_TOKEN ("phi");
       output_zero (ob);
     }
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
 
 #ifdef LTO_STREAM_DEBUGGING
   gcc_assert (lto_debug_context.indent == 1);
@@ -1960,7 +1960,7 @@ output_function (tree function)
   output_eh_regions (ob, fn);
 
   /* Output the argument array.  */
-  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
+  LTO_DEBUG_INDENT_TOKEN ("decl_arguments");
   if (DECL_ARGUMENTS (function))
     output_expr_operand (ob, DECL_ARGUMENTS (function));
   else
@@ -1972,7 +1972,7 @@ output_function (tree function)
 
   /* The terminator for this function.  */
   output_zero (ob);
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
 
   LTO_SET_DEBUGGING_STREAM (debug_label_stream, label_data)
   output_named_labels (ob);
Index: lto-tags.h
===================================================================
--- lto-tags.h	(revision 127125)
+++ lto-tags.h	(working copy)
@@ -479,19 +479,19 @@ void lto_static_init (void);
 
 #ifdef LTO_STREAM_DEBUGGING
 #define LTO_DEBUG_INDENT(tag) \
-  lto_debug_indent (&lto_debug_context, tag);
+  lto_debug_indent (&lto_debug_context, tag)
 #define LTO_DEBUG_INDENT_TOKEN(value) \
-  lto_debug_indent_token (&lto_debug_context, value);
+  lto_debug_indent_token (&lto_debug_context, value)
 #define LTO_DEBUG_INTEGER(tag,high,low) \
-  lto_debug_integer (&lto_debug_context, tag, high, low);
+  lto_debug_integer (&lto_debug_context, tag, high, low)
 #define LTO_DEBUG_STRING(value,len) \
-  lto_debug_string (&lto_debug_context, value, len);
+  lto_debug_string (&lto_debug_context, value, len)
 #define LTO_DEBUG_TOKEN(value) \
-  lto_debug_token (&lto_debug_context, value);
+  lto_debug_token (&lto_debug_context, value)
 #define LTO_DEBUG_UNDENT() \
-  lto_debug_undent (&lto_debug_context);
+  lto_debug_undent (&lto_debug_context)
 #define LTO_DEBUG_WIDE(tag,value) \
-  lto_debug_wide (&lto_debug_context, tag, value);
+  lto_debug_wide (&lto_debug_context, tag, value)
 
 struct lto_debug_context;
 
@@ -520,13 +520,18 @@ extern void lto_debug_undent (struct lto
 extern void lto_debug_wide (struct lto_debug_context *, const char *, HOST_WIDE_INT);
 
 #else
-#define LTO_DEBUG_INDENT(tag)
-#define LTO_DEBUG_INDENT_TOKEN(value)
-#define LTO_DEBUG_INTEGER(tag,high,low)
-#define LTO_DEBUG_STRING(value,len)
-#define LTO_DEBUG_TOKEN(value)
-#define LTO_DEBUG_UNDENT()
-#define LTO_DEBUG_WIDE(tag,value)
+#define LTO_DEBUG_INDENT(tag) useless_function ()
+#define LTO_DEBUG_INDENT_TOKEN(value) useless_function ()
+#define LTO_DEBUG_INTEGER(tag,high,low) useless_function ()
+#define LTO_DEBUG_STRING(value,len) useless_function ()
+#define LTO_DEBUG_TOKEN(value) useless_function ()
+#define LTO_DEBUG_UNDENT() useless_function ()
+#define LTO_DEBUG_WIDE(tag,value) useless_function ()
 #endif
 
+static inline void
+useless_function (void)
+{
+}
+
 #endif /* lto-tags.h */
Index: lto/lto-read.c
===================================================================
--- lto/lto-read.c	(revision 127138)
+++ lto/lto-read.c	(working copy)
@@ -119,7 +119,7 @@ input_uleb128 (struct input_block *ib)
       shift += 7;
       if ((byte & 0x80) == 0)
 	{
-	  LTO_DEBUG_WIDE ("U", result)
+	  LTO_DEBUG_WIDE ("U", result);
 	  return result;
 	}
     }
@@ -145,7 +145,7 @@ input_sleb128 (struct input_block *ib)
 	  if ((shift < HOST_BITS_PER_INT) && (byte & 0x40))
 	    result |= - (1 << shift);
 
-	  LTO_DEBUG_WIDE ("S", result)
+	  LTO_DEBUG_WIDE ("S", result);
 	  return result;
 	}
     }
@@ -167,7 +167,7 @@ input_string_internal (struct fun_in *fu
   gcc_assert (str_tab.p + len <= fun_in->strings_len);
 
   result = (const char *)(fun_in->strings + str_tab.p);
-  LTO_DEBUG_STRING (result, len)
+  LTO_DEBUG_STRING (result, len);
   return result;
 }
 
@@ -192,7 +192,7 @@ input_real (struct fun_in *fun_in, unsig
   const char * str = input_string_internal (fun_in, loc, &len); 
   REAL_VALUE_TYPE value;
 
-  LTO_DEBUG_TOKEN ("real")
+  LTO_DEBUG_TOKEN ("real");
 
   real_from_string (&value, str);
   return build_real (type, value);
@@ -244,9 +244,9 @@ input_integer (struct input_block *ib, t
 	  /* Have to match the quick out in the lto writer.  */
 	  if (((high == -1) && (low < 0))
 	      || ((high == 0) && (low >= 0)))
-	    LTO_DEBUG_WIDE ("S", low)
+	    LTO_DEBUG_WIDE ("S", low);
 	  else 
-	    LTO_DEBUG_INTEGER ("SS", high, low)
+	    LTO_DEBUG_INTEGER ("SS", high, low);
 #endif	  
 	  return build_int_cst_wide (type, low, high);
 	}
@@ -263,9 +263,9 @@ input_record_start (struct input_block *
 
 #ifdef LTO_STREAM_DEBUGGING
   if (tag)
-    LTO_DEBUG_INDENT (tag)
+    LTO_DEBUG_INDENT (tag);
   else
-    LTO_DEBUG_WIDE ("U", 0)
+    LTO_DEBUG_WIDE ("U", 0);
 #endif    
   return tag;
 } 
@@ -292,7 +292,7 @@ input_list (struct input_block *ib, stru
 	}
     }
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
   return first;
 }
 
@@ -317,7 +317,7 @@ get_type_ref (struct fun_in *fun_in, str
 {
   int index;
 
-  LTO_DEBUG_TOKEN ("type")
+  LTO_DEBUG_TOKEN ("type");
   index = input_uleb128 (ib);
   return fun_in->types[index];
 }
@@ -393,7 +393,7 @@ input_flags (struct input_block *ib, enu
 
   if (TEST_BIT (lto_flags_needed_for, code))
     {
-      LTO_DEBUG_TOKEN ("flags")
+      LTO_DEBUG_TOKEN ("flags");
       flags = input_uleb128 (ib);
     }
   else
@@ -428,12 +428,12 @@ input_expr_operand (struct input_block *
       if (flags & 0x2)
 	{
 	  unsigned int len;
-	  LTO_DEBUG_TOKEN ("file")
+	  LTO_DEBUG_TOKEN ("file");
 	  new_file = input_string_internal (fun_in, input_uleb128 (ib), &len);
 	}
       if (flags & 0x1)
 	{
-	  LTO_DEBUG_TOKEN ("line")
+	  LTO_DEBUG_TOKEN ("line");
 	  new_line = input_uleb128 (ib);
 	}
     }
@@ -561,7 +561,7 @@ input_expr_operand (struct input_block *
 		    purpose = NULL_TREE;
 		    i++;
 		  }
-		LTO_DEBUG_UNDENT()
+		LTO_DEBUG_UNDENT();
 	      }
 	  }
 	result = build_constructor (type, vec);
@@ -873,7 +873,7 @@ input_expr_operand (struct input_block *
       gcc_unreachable ();
     }
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
   if (flags)
     process_flags (result, flags);
   return result;
@@ -1003,31 +1003,31 @@ input_local_vars (struct fun_in *fun_in,
       if (!is_var)
 	DECL_ARG_TYPE (result) = get_type_ref (fun_in, ib);
 
-      LTO_DEBUG_TOKEN ("flags")
+      LTO_DEBUG_TOKEN ("flags");
       flags = input_uleb128 (ib);
 
       /* FIXME: Need to figure out how to set the line number.  */
       if (flags & 0x2)
 	{
 	  unsigned int len;
-	  LTO_DEBUG_TOKEN ("file")
+	  LTO_DEBUG_TOKEN ("file");
 	  new_file = input_string_internal (fun_in, input_uleb128 (ib), &len);
 	}
       if (flags & 0x1)
 	{
-	  LTO_DEBUG_TOKEN ("line")
+	  LTO_DEBUG_TOKEN ("line");
 	  new_line = input_uleb128 (ib);
 	}
 
-      LTO_DEBUG_TOKEN ("align")
+      LTO_DEBUG_TOKEN ("align");
       DECL_ALIGN (result) = input_uleb128 (ib);
-      LTO_DEBUG_TOKEN ("size")
+      LTO_DEBUG_TOKEN ("size");
       DECL_SIZE (result) 
 	= input_expr_operand (ib, fun_in, fn, input_record_start (ib));
 
       if (variant & 0x1)
 	{
-	  LTO_DEBUG_TOKEN ("attributes")
+	  LTO_DEBUG_TOKEN ("attributes");
           DECL_ATTRIBUTES (result) 
 	    = input_expr_operand (ib, fun_in, fn, input_record_start (ib));
 	}
@@ -1043,7 +1043,7 @@ input_local_vars (struct fun_in *fun_in,
 	  = input_expr_operand (ib, fun_in, fn, input_record_start (ib));
 
       process_flags (result, flags);
-      LTO_DEBUG_UNDENT()
+      LTO_DEBUG_UNDENT();
     }
 }
 
@@ -1087,7 +1087,7 @@ input_cfg (struct input_block *ib, struc
 
   init_flow (fn);
 
-  LTO_DEBUG_TOKEN ("lastbb")
+  LTO_DEBUG_TOKEN ("lastbb");
   bb_count = input_uleb128 (ib);
 
   profile_status_for_function (fn) = PROFILE_ABSENT;
@@ -1114,7 +1114,7 @@ input_cfg (struct input_block *ib, struc
   SET_BASIC_BLOCK_FOR_FUNCTION (fn, EXIT_BLOCK, 
 		   EXIT_BLOCK_PTR_FOR_FUNCTION (fn));
 
-  LTO_DEBUG_TOKEN ("bbindex")
+  LTO_DEBUG_TOKEN ("bbindex");
   index = input_sleb128 (ib);
   while (index != -1)
     {
@@ -1124,23 +1124,28 @@ input_cfg (struct input_block *ib, struc
       if (bb == NULL)
 	bb = make_new_block (fn, index);
 
-      LTO_DEBUG_TOKEN ("edgecount")
+      LTO_DEBUG_TOKEN ("edgecount");
       edge_count = input_uleb128 (ib);
 
       /* Connect up the cfg.  */
       for (i = 0; i < edge_count; i++)
 	{
-	  LTO_DEBUG_TOKEN ("dest")
-	    unsigned int dest_index = input_uleb128 (ib);
-	  LTO_DEBUG_TOKEN ("eflags")
-	    unsigned int edge_flags = input_uleb128 (ib);
-	  basic_block dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index);
+	  unsigned int dest_index;
+	  unsigned int edge_flags;
+	  basic_block dest;
+
+	  LTO_DEBUG_TOKEN ("dest");
+	  dest_index = input_uleb128 (ib);
+	  LTO_DEBUG_TOKEN ("eflags");
+	  edge_flags = input_uleb128 (ib);
+	  dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index);
+
 	  if (dest == NULL) 
 	    dest = make_new_block (fn, dest_index);
 	  make_edge (bb, dest, edge_flags);
 	}
 
-      LTO_DEBUG_TOKEN ("bbindex")
+      LTO_DEBUG_TOKEN ("bbindex");
       index = input_sleb128 (ib);
     }
 
@@ -1198,7 +1203,7 @@ input_phi (struct input_block *ib, basic
   if (flags)
     process_flags (result, flags);
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
 
   return result;
 }
@@ -1229,7 +1234,7 @@ input_ssa_names (struct fun_in *fun_in, 
       name = input_expr_operand (ib, fun_in, fn, input_record_start (ib));
       ssa_name = make_ssa_name (name, build_empty_stmt ());
 
-      LTO_DEBUG_TOKEN ("flags")
+      LTO_DEBUG_TOKEN ("flags");
       flags = input_uleb128 (ib);
       process_flags (ssa_name, flags);
 
@@ -1248,39 +1253,39 @@ input_bb (struct input_block *ib, unsign
   basic_block bb;
   block_stmt_iterator bsi;
 
-  LTO_DEBUG_TOKEN ("bbindex")
+  LTO_DEBUG_TOKEN ("bbindex");
   index = input_uleb128 (ib);
   bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
 
   /* LTO_bb1 has stmts, LTO_bb0 does not.  */
   if (tag == LTO_bb0)
     {
-      LTO_DEBUG_UNDENT()
+      LTO_DEBUG_UNDENT();
       return;
     }
 
   bsi = bsi_start (bb);
-  LTO_DEBUG_INDENT_TOKEN ("stmt")
+  LTO_DEBUG_INDENT_TOKEN ("stmt");
   tag = input_record_start (ib);
   while (tag)
     {
       tree stmt = input_expr_operand (ib, fun_in, fn, tag);
       bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
-      LTO_DEBUG_INDENT_TOKEN ("stmt")
+      LTO_DEBUG_INDENT_TOKEN ("stmt");
       tag = input_record_start (ib);
       /* FIXME, add code to handle the exception.  */
     }
 
-  LTO_DEBUG_INDENT_TOKEN ("phi")
+  LTO_DEBUG_INDENT_TOKEN ("phi");
   tag = input_record_start (ib);
   while (tag)
     {
       input_phi (ib, bb, fun_in, fn);
-      LTO_DEBUG_INDENT_TOKEN ("phi")
+      LTO_DEBUG_INDENT_TOKEN ("phi");
       tag = input_record_start (ib);
     }
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
 }
 
 
@@ -1298,7 +1303,7 @@ input_function (tree fn_decl, struct fun
 
   input_eh_regions (ib, fn, fun_in);
 
-  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
+  LTO_DEBUG_INDENT_TOKEN ("decl_arguments");
   tag = input_record_start (ib);
   if (tag)
     DECL_ARGUMENTS (fn_decl) = input_expr_operand (ib, fun_in, fn, tag);
@@ -1312,7 +1317,7 @@ input_function (tree fn_decl, struct fun
       tag = input_record_start (ib);
     }
 
-  LTO_DEBUG_UNDENT()
+  LTO_DEBUG_UNDENT();
 }
 
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: potiential problems with parm decls.
  2007-08-02  0:43     ` Mark Mitchell
@ 2007-08-02  1:10       ` Kenneth Zadeck
  2007-08-02  2:50         ` Mark Mitchell
  0 siblings, 1 reply; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-02  1:10 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

Mark Mitchell wrote:
> Kenneth Zadeck wrote:
>
>   
>> My only concern here is that you said at the summit that these were not
>> in gimple.  If they are in gimple, then it should not be a big deal for
>> me to co-opt the existing machinery to put each of them in its own
>> section. 
>>     
>
> I'm not sure "being GIMPLE" has meaning in this context; they're just
> data.  The expressions are all constants, like "3", "&foo", or "&foo +
> 1".  These can be arranged in aggregates; you can have a CONSTRUCTOR
> whose elements are "3" and "&foo", for example.  Will that work?
>
> Thanks,
>
>   
i think that the short answer is that they are not gimple.

I have a way to put out counted strings.  I assume that each of these is
just an list (or array) of counted strings.  If that is all, (i.e. there
is not any deeper structure) then I can look into it. 

Give me some pointers so i can figure out the datastructures i need to
walk and rebuild.

kenny.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [lto] PATCH COMMITTED to fix missing semicolons.
  2007-08-02  1:06       ` [lto] PATCH COMMITTED to fix missing semicolons Kenneth Zadeck
@ 2007-08-02  1:16         ` David Daney
  2007-08-02  1:49           ` Andrew Pinski
  0 siblings, 1 reply; 13+ messages in thread
From: David Daney @ 2007-08-02  1:16 UTC (permalink / raw)
  To: Kenneth Zadeck; +Cc: tromey, Mark Mitchell, gcc-patches, Hubicha, Jan

Kenneth Zadeck wrote:
> Tom Tromey wrote:
>>>>>>> "KZ" == Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>>>>>>>             
>> KZ> +  /* Output the argument array.  */
>> KZ> +  LTO_DEBUG_INDENT_TOKEN ("decl_arguments")
>>
>> I find it a little strange to see function-like macro invocations with
>> no terminating ";".
>>
>> In addition to looking strange, this upsets Emacs; it may be odd but
>> GNU-style indentation is partially defined as "whatever makes Emacs do
>> the right thing".
>>
>> Tom
>>   
> I figured out how to do this.
> 
> committed as revision 127145.
> 
>  #else
> -#define LTO_DEBUG_INDENT(tag)
> -#define LTO_DEBUG_INDENT_TOKEN(value)
> -#define LTO_DEBUG_INTEGER(tag,high,low)
> -#define LTO_DEBUG_STRING(value,len)
> -#define LTO_DEBUG_TOKEN(value)
> -#define LTO_DEBUG_UNDENT()
> -#define LTO_DEBUG_WIDE(tag,value)
> +#define LTO_DEBUG_INDENT(tag) useless_function ()

Perhaps:

#define LTO_DEBUG_INDENT(tag) do {} while(0)

David Daney

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [lto] PATCH COMMITTED to fix missing semicolons.
  2007-08-02  1:16         ` David Daney
@ 2007-08-02  1:49           ` Andrew Pinski
  2007-08-02 16:42             ` Kenneth Zadeck
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Pinski @ 2007-08-02  1:49 UTC (permalink / raw)
  To: David Daney
  Cc: Kenneth Zadeck, tromey, Mark Mitchell, gcc-patches, Hubicha, Jan

On 8/1/07, David Daney <ddaney@avtrex.com> wrote:
> #define LTO_DEBUG_INDENT(tag) do {} while(0)

or
(void)0

Both will force required semicolons and not allow assignments after it.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: potiential problems with parm decls.
  2007-08-02  1:10       ` Kenneth Zadeck
@ 2007-08-02  2:50         ` Mark Mitchell
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Mitchell @ 2007-08-02  2:50 UTC (permalink / raw)
  To: Kenneth Zadeck; +Cc: gcc-patches

Kenneth Zadeck wrote:

> I have a way to put out counted strings.  I assume that each of these is
> just an list (or array) of counted strings.  If that is all, (i.e. there
> is not any deeper structure) then I can look into it. 

No, they are CONSTRUCTOR trees, whose CONSTRUCTOR_ELEMENTS are also
trees, like INTEGER_CSTs or STRING_CSTs.  I'd imagine that since you
have routines to write out trees, recursively, these should be pretty
easy; at worst, we'd have to add support for CONSTRUCTOR, if you don't
already have it.

Does that sound right to you?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [lto] PATCH COMMITTED to fix missing semicolons.
  2007-08-02  1:49           ` Andrew Pinski
@ 2007-08-02 16:42             ` Kenneth Zadeck
  0 siblings, 0 replies; 13+ messages in thread
From: Kenneth Zadeck @ 2007-08-02 16:42 UTC (permalink / raw)
  To: Andrew Pinski
  Cc: David Daney, tromey, Mark Mitchell, gcc-patches, Hubicha, Jan

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

Andrew Pinski wrote:
> On 8/1/07, David Daney <ddaney@avtrex.com> wrote:
>   
>> #define LTO_DEBUG_INDENT(tag) do {} while(0)
>>     
>
> or
> (void)0
>
> Both will force required semicolons and not allow assignments after it.
>
> Thanks,
> Andrew Pinski
>   
done.

2007-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>
        * lto-tags.h (LTO_DEBUG_INDENT, LTO_DEBUG_INDENT_TOKEN,
    LTO_DEBUG_INTEGER, LTO_DEBUG_STRING, LTO_DEBUG_TOKEN,
    LTO_DEBUG_UNDENT, LTO_DEBUG_WIDE): Change "useless_function ()" to
    "(void)0"
    (useless_function): Removed.

2007-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-read.c (lto_read_function_body): Moved declaration of fn
    outside of ifdef.
   

committed as revision 127165

Kenny

[-- Attachment #2: semicolon2.diff --]
[-- Type: text/x-patch, Size: 1931 bytes --]

Index: lto-tags.h
===================================================================
--- lto-tags.h	(revision 127145)
+++ lto-tags.h	(working copy)
@@ -520,18 +520,13 @@ extern void lto_debug_undent (struct lto
 extern void lto_debug_wide (struct lto_debug_context *, const char *, HOST_WIDE_INT);
 
 #else
-#define LTO_DEBUG_INDENT(tag) useless_function ()
-#define LTO_DEBUG_INDENT_TOKEN(value) useless_function ()
-#define LTO_DEBUG_INTEGER(tag,high,low) useless_function ()
-#define LTO_DEBUG_STRING(value,len) useless_function ()
-#define LTO_DEBUG_TOKEN(value) useless_function ()
-#define LTO_DEBUG_UNDENT() useless_function ()
-#define LTO_DEBUG_WIDE(tag,value) useless_function ()
+#define LTO_DEBUG_INDENT(tag) (void)0
+#define LTO_DEBUG_INDENT_TOKEN(value) (void)0
+#define LTO_DEBUG_INTEGER(tag,high,low) (void)0
+#define LTO_DEBUG_STRING(value,len) (void)0
+#define LTO_DEBUG_TOKEN(value) (void)0
+#define LTO_DEBUG_UNDENT() (void)0
+#define LTO_DEBUG_WIDE(tag,value) (void)0
 #endif
 
-static inline void
-useless_function (void)
-{
-}
-
 #endif /* lto-tags.h */
Index: lto/lto-read.c
===================================================================
--- lto/lto-read.c	(revision 127145)
+++ lto/lto-read.c	(working copy)
@@ -1433,6 +1433,8 @@ lto_read_function_body (lto_info_fd *fd,
   struct lto_function_header * header 
     = (struct lto_function_header *) data;
   struct fun_in fun_in;
+  struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
+
   int32_t fields_offset = sizeof (struct lto_function_header); 
   int32_t fns_offset 
     = fields_offset + (header->num_field_decls * sizeof (lto_ref));
@@ -1468,8 +1470,6 @@ lto_read_function_body (lto_info_fd *fd,
   struct input_block debug_main 
     = {data + debug_main_offset, 0, header->debug_main_size};
 
-  struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
-
   lto_debug_context.out = debug_out_fun;
   lto_debug_context.indent = 0;
 #endif

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-08-02 16:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01 14:16 potiential problems with parm decls Kenneth Zadeck
2007-08-01 17:23 ` Mark Mitchell
2007-08-01 17:34   ` Kenneth Zadeck
2007-08-02  0:43     ` Mark Mitchell
2007-08-02  1:10       ` Kenneth Zadeck
2007-08-02  2:50         ` Mark Mitchell
2007-08-01 20:44   ` [lto] PATCH COMMITTED " Kenneth Zadeck
2007-08-01 22:12     ` Tom Tromey
2007-08-01 22:36       ` Kenneth Zadeck
2007-08-02  1:06       ` [lto] PATCH COMMITTED to fix missing semicolons Kenneth Zadeck
2007-08-02  1:16         ` David Daney
2007-08-02  1:49           ` Andrew Pinski
2007-08-02 16:42             ` Kenneth Zadeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).