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: [lto] PATCH COMMITTED to fix missing semicolons.


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
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

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