forked from OSchip/llvm-project
parent
6efa201f7f
commit
5092a6de8e
|
@ -199,7 +199,7 @@ void Timer::addPeakMemoryMeasurement() {
|
||||||
|
|
||||||
|
|
||||||
static void printVal(double Val, double Total, raw_ostream &OS) {
|
static void printVal(double Val, double Total, raw_ostream &OS) {
|
||||||
if (Total < 1e-7) // Avoid dividing by zero...
|
if (Total < 1e-7) // Avoid dividing by zero.
|
||||||
OS << " ----- ";
|
OS << " ----- ";
|
||||||
else {
|
else {
|
||||||
OS << " " << format("%7.4f", Val) << " (";
|
OS << " " << format("%7.4f", Val) << " (";
|
||||||
|
@ -285,7 +285,7 @@ NamedRegionTimer::NamedRegionTimer(const std::string &Name,
|
||||||
// TimerGroup Implementation
|
// TimerGroup Implementation
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
|
// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
|
||||||
raw_ostream *
|
raw_ostream *
|
||||||
llvm::GetLibSupportInfoOutputFile() {
|
llvm::GetLibSupportInfoOutputFile() {
|
||||||
std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
|
std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
|
||||||
|
@ -324,14 +324,14 @@ void TimerGroup::removeTimer() {
|
||||||
raw_ostream *OutStream = GetLibSupportInfoOutputFile();
|
raw_ostream *OutStream = GetLibSupportInfoOutputFile();
|
||||||
|
|
||||||
++NumTimers;
|
++NumTimers;
|
||||||
{ // Scope to contain Total timer... don't allow total timer to drop us to
|
{ // Scope to contain Total timer: don't allow total timer to drop us to
|
||||||
// zero timers...
|
// zero timers.
|
||||||
Timer Total("TOTAL");
|
Timer Total("TOTAL");
|
||||||
|
|
||||||
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
||||||
Total.sum(TimersToPrint[i]);
|
Total.sum(TimersToPrint[i]);
|
||||||
|
|
||||||
// Print out timing header...
|
// Print out timing header.
|
||||||
*OutStream << "===" << std::string(73, '-') << "===\n"
|
*OutStream << "===" << std::string(73, '-') << "===\n"
|
||||||
<< std::string(Padding, ' ') << Name << "\n"
|
<< std::string(Padding, ' ') << Name << "\n"
|
||||||
<< "===" << std::string(73, '-')
|
<< "===" << std::string(73, '-')
|
||||||
|
@ -361,7 +361,7 @@ void TimerGroup::removeTimer() {
|
||||||
*OutStream << " -PeakMem-";
|
*OutStream << " -PeakMem-";
|
||||||
*OutStream << " --- Name ---\n";
|
*OutStream << " --- Name ---\n";
|
||||||
|
|
||||||
// Loop through all of the timing data, printing it out...
|
// Loop through all of the timing data, printing it out.
|
||||||
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
||||||
TimersToPrint[i].print(Total, *OutStream);
|
TimersToPrint[i].print(Total, *OutStream);
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ void TimerGroup::removeTimer() {
|
||||||
TimersToPrint.clear();
|
TimersToPrint.clear();
|
||||||
|
|
||||||
if (OutStream != &errs() && OutStream != &outs() && OutStream != &dbgs())
|
if (OutStream != &errs() && OutStream != &outs() && OutStream != &dbgs())
|
||||||
delete OutStream; // Close the file...
|
delete OutStream; // Close the file.
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimerGroup::addTimer() {
|
void TimerGroup::addTimer() {
|
||||||
|
|
Loading…
Reference in New Issue