[llvm-commits] [vmkit] r48943 - /vmkit/trunk/include/debug.h

Bill Wendling isanbard at gmail.com
Sat Mar 29 10:52:19 PDT 2008


The rest of LLVM by convention outputs its debugging info to stderr  
instead of stdout. One if the benefits of stderr is that it doesn't  
buffer the stream so there is no need for an explicit flush call.

That said, it's up to you which one you use.

-bw

On Mar 29, 2008, at 6:58 AM, Nicolas Geoffray  
<nicolas.geoffray at lip6.fr> wrote:

> Author: geoffray
> Date: Sat Mar 29 06:58:26 2008
> New Revision: 48943
>
> URL: http://llvm.org/viewvc/llvm-project?rev=48943&view=rev
> Log:
> Use printf directly instead of sys_printf
>
>
> Modified:
>    vmkit/trunk/include/debug.h
>
> Modified: vmkit/trunk/include/debug.h
> URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/debug.h?rev=48943&r1=48942&r2=48943&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- vmkit/trunk/include/debug.h (original)
> +++ vmkit/trunk/include/debug.h Sat Mar 29 06:58:26 2008
> @@ -49,16 +49,16 @@
>   #ifdef WITH_COLOR
>     #define PRINT_DEBUG(symb, level, color, fmt, args...) \
>       if (symb > level) { \
> -          sys_printf("%s%s%s", ESC, color, END); \
> -          sys_printf(fmt, ##args); \
> -          sys_printf("%s%s%s", ESC, COLOR_NORMAL, END); \
> -          sys_fflush(stdout); \
> +          printf("%s%s%s", ESC, color, END); \
> +          printf(fmt, ##args); \
> +          printf("%s%s%s", ESC, COLOR_NORMAL, END); \
> +          fflush(stdout); \
>       }
>   #else
>     #define PRINT_DEBUG(symb, level, color, fmt, args...) \
>       if (symb > level) { \
> -        sys_printf(fmt, ##args); \
> -        sys_fflush(stdout); \
> +        printf(fmt, ##args); \
> +        fflush(stdout); \
>       }
>   #endif
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list