[llvm] r176733 - Disable statistics on Release builds and move tests that depend on -stats.

Nick Lewycky nicholas at mxc.ca
Fri Mar 8 18:58:35 PST 2013


Jan Wen Voung wrote:
> Author: jvoung
> Date: Fri Mar  8 16:56:31 2013
> New Revision: 176733
>
> URL: http://llvm.org/viewvc/llvm-project?rev=176733&view=rev
> Log:
> Disable statistics on Release builds and move tests that depend on -stats.
>
> Summary:
> Statistics are still available in Release+Asserts (any +Asserts builds),
> and stats can also be turned on with LLVM_ENABLE_STATS.
>
> Move some of the FastISel stats that were moved under DEBUG()
> back out of DEBUG(), since stats are disabled across the board now.
>
> Many tests depend on grepping "-stats" output.  Move those into
> a orig_dir/Stats/. so that they can be marked as unsupported
> when building without statistics.
>
> Differential Revision: http://llvm-reviews.chandlerc.com/D486

> Modified: llvm/trunk/include/llvm/ADT/Statistic.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Statistic.h?rev=176733&r1=176732&r2=176733&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/Statistic.h (original)
> +++ llvm/trunk/include/llvm/ADT/Statistic.h Fri Mar  8 16:56:31 2013
> @@ -51,7 +51,9 @@ public:
>
>     // Allow use of this class as the value itself.
>     operator unsigned() const { return Value; }
> -  const Statistic&operator=(unsigned Val) {
> +
> +#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
> +   const Statistic&operator=(unsigned Val) {
>       Value = Val;
>       return init();
>     }

How does LLVM_ENABLE_STATS get defined? It isn't mentioned in 
config.h.in or config.h.cmake, and even if it were, Statistic.h doesn't 
include config.h.

Nick



More information about the llvm-commits mailing list