mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -40,7 +40,9 @@ namespace llvm { extern raw_ostream *CreateInfoOutputFile(); }
|
||||
/// what they did.
|
||||
///
|
||||
static cl::opt<bool>
|
||||
Enabled("stats", cl::desc("Enable statistics output from program"));
|
||||
Enabled(
|
||||
"stats",
|
||||
cl::desc("Enable statistics output from program (available with Asserts)"));
|
||||
|
||||
|
||||
namespace {
|
||||
@@ -142,6 +144,7 @@ void llvm::PrintStatistics(raw_ostream &OS) {
|
||||
}
|
||||
|
||||
void llvm::PrintStatistics() {
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
|
||||
StatisticInfo &Stats = *StatInfo;
|
||||
|
||||
// Statistics not enabled?
|
||||
@@ -151,4 +154,17 @@ void llvm::PrintStatistics() {
|
||||
raw_ostream &OutStream = *CreateInfoOutputFile();
|
||||
PrintStatistics(OutStream);
|
||||
delete &OutStream; // Close the file.
|
||||
#else
|
||||
// Check if the -stats option is set instead of checking
|
||||
// !Stats.Stats.empty(). In release builds, Statistics operators
|
||||
// do nothing, so stats are never Registered.
|
||||
if (Enabled) {
|
||||
// Get the stream to write to.
|
||||
raw_ostream &OutStream = *CreateInfoOutputFile();
|
||||
OutStream << "Statistics are disabled. "
|
||||
<< "Build with asserts or with -DLLVM_ENABLE_STATS\n";
|
||||
OutStream.flush();
|
||||
delete &OutStream; // Close the file.
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user