[llvm-commits] [llvm] r76182 - /llvm/trunk/include/llvm/Support/Debug.h

Daniel Dunbar daniel at zuster.org
Fri Jul 17 10:08:31 PDT 2009


This adds a static variable in every file which includes Debug.h, and
seems like a bad idea. I don't really understand why it needs to be an
lvalue, but if it does, could it at least hide behind a
getNullOutputStream function, or so?

 - Daniel

On Fri, Jul 17, 2009 at 8:56 AM, David Greene<greened at obbligato.org> wrote:
> Author: greened
> Date: Fri Jul 17 10:55:53 2009
> New Revision: 76182
>
> URL: http://llvm.org/viewvc/llvm-project?rev=76182&view=rev
> Log:
>
> Make DOUT an lvalue in release mode so that developers may use DOUT in
> their code in release mode.  This helps to debug release-mode problems.
>
> Modified:
>    llvm/trunk/include/llvm/Support/Debug.h
>
> Modified: llvm/trunk/include/llvm/Support/Debug.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Debug.h?rev=76182&r1=76181&r2=76182&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/Debug.h (original)
> +++ llvm/trunk/include/llvm/Support/Debug.h Fri Jul 17 10:55:53 2009
> @@ -68,7 +68,8 @@
>  OStream &getErrorOutputStream(const char *DebugType);
>
>  #ifdef NDEBUG
> -#define DOUT llvm::OStream(0)
> +static llvm::OStream NullStream(0);
> +#define DOUT llvm::NullStream
>  #else
>  #define DOUT llvm::getErrorOutputStream(DEBUG_TYPE)
>  #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