X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FStatistic.cpp;h=f6645c6ae401132d93e7e12a2b15c7c6fcec1031;hb=8f77daef04355c00b78b645f5aae5694e7a8b631;hp=b6c75c2adee49e5048bf8d27ead48b5f3144801a;hpb=96ef1b90c8f3a6649993bb7ab10db3510f12e80a;p=oota-llvm.git diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp index b6c75c2adee..f6645c6ae40 100644 --- a/lib/Support/Statistic.cpp +++ b/lib/Support/Statistic.cpp @@ -18,6 +18,7 @@ #include "Support/CommandLine.h" #include #include +#include bool DebugFlag; // DebugFlag - Exported boolean set by the -debug option @@ -29,10 +30,13 @@ unsigned StatisticBase::NumStats = 0; static cl::opt Enabled("stats", cl::desc("Enable statistics output from program")); +#ifndef NDEBUG // -debug - Command line option to enable the DEBUG statements in the passes. +// This flag may only be enabled in debug builds. static cl::opt Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag)); +#endif struct StatRecord { std::string Value; @@ -70,8 +74,10 @@ void StatisticBase::destroy() const { // Figure out how long the biggest Value and Name fields are... unsigned MaxNameLen = 0, MaxValLen = 0; for (unsigned i = 0, e = AccumStats->size(); i != e; ++i) { - MaxValLen = std::max(MaxValLen, (*AccumStats)[i].Value.length()); - MaxNameLen = std::max(MaxNameLen, std::strlen((*AccumStats)[i].Name)); + MaxValLen = std::max(MaxValLen, + (unsigned)(*AccumStats)[i].Value.length()); + MaxNameLen = std::max(MaxNameLen, + (unsigned)std::strlen((*AccumStats)[i].Name)); } // Sort the fields...