[llvm-commits] [llvm] r99842 - /llvm/trunk/lib/Support/Timer.cpp
Chris Lattner
sabre at nondot.org
Mon Mar 29 14:34:06 PDT 2010
Author: lattner
Date: Mon Mar 29 16:34:06 2010
New Revision: 99842
URL: http://llvm.org/viewvc/llvm-project?rev=99842&view=rev
Log:
move a function into a more logical place in the file
Modified:
llvm/trunk/lib/Support/Timer.cpp
Modified: llvm/trunk/lib/Support/Timer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=99842&r1=99841&r2=99842&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Timer.cpp (original)
+++ llvm/trunk/lib/Support/Timer.cpp Mon Mar 29 16:34:06 2010
@@ -52,6 +52,27 @@
cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
}
+// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
+raw_ostream *llvm::GetLibSupportInfoOutputFile() {
+ std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
+ if (LibSupportInfoOutputFilename.empty())
+ return &errs();
+ if (LibSupportInfoOutputFilename == "-")
+ return &outs();
+
+ std::string Error;
+ raw_ostream *Result = new raw_fd_ostream(LibSupportInfoOutputFilename.c_str(),
+ Error, raw_fd_ostream::F_Append);
+ if (Error.empty())
+ return Result;
+
+ errs() << "Error opening info-output-file '"
+ << LibSupportInfoOutputFilename << " for appending!\n";
+ delete Result;
+ return &errs();
+}
+
+
static TimerGroup *DefaultTimerGroup = 0;
static TimerGroup *getDefaultTimerGroup() {
TimerGroup *tmp = DefaultTimerGroup;
@@ -271,27 +292,6 @@
// TimerGroup Implementation
//===----------------------------------------------------------------------===//
-// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
-raw_ostream *llvm::GetLibSupportInfoOutputFile() {
- std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
- if (LibSupportInfoOutputFilename.empty())
- return &errs();
- if (LibSupportInfoOutputFilename == "-")
- return &outs();
-
- std::string Error;
- raw_ostream *Result = new raw_fd_ostream(LibSupportInfoOutputFilename.c_str(),
- Error, raw_fd_ostream::F_Append);
- if (Error.empty())
- return Result;
-
- errs() << "Error opening info-output-file '"
- << LibSupportInfoOutputFilename << " for appending!\n";
- delete Result;
- return &errs();
-}
-
-
void TimerGroup::removeTimer() {
sys::SmartScopedLock<true> L(*TimerLock);
if (--NumTimers != 0 || TimersToPrint.empty())
@@ -326,7 +326,6 @@
// TOTAL line to make the percentages make sense.
if (this != DefaultTimerGroup) {
*OutStream << " Total Execution Time: ";
-
*OutStream << format("%5.4f", Total.getProcessTime()) << " seconds (";
*OutStream << format("%5.4f", Total.getWallTime()) << " wall clock)\n";
}
More information about the llvm-commits
mailing list