#include "Support/CommandLine.h"
#include <iostream>
#include <sstream>
+#include <algorithm>
bool DebugFlag; // DebugFlag - Exported boolean set by the -debug option
static cl::opt<bool>
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<bool, true>
Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
cl::location(DebugFlag));
+#endif
struct StatRecord {
std::string Value;
// 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...