aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-14 21:27:33 +0000
committerChris Lattner <sabre@nondot.org>2003-12-14 21:27:33 +0000
commitb6d465f8131f5fb0b8e565685fb3395ed9aecbdb (patch)
tree47d8b54dbffc2606282a35c3ad02436e2dab5c99 /lib/Support/Timer.cpp
parent721b4e5715d97dedce0a4f0206c7d8c0b5af9ca3 (diff)
downloadexternal_llvm-b6d465f8131f5fb0b8e565685fb3395ed9aecbdb.zip
external_llvm-b6d465f8131f5fb0b8e565685fb3395ed9aecbdb.tar.gz
external_llvm-b6d465f8131f5fb0b8e565685fb3395ed9aecbdb.tar.bz2
Finegrainify namespacification
Make the Timer code give correct user/system/user+system times when -track-memory is enabled git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Timer.cpp')
-rw-r--r--lib/Support/Timer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index d14a225..5d493b8 100644
--- a/lib/Support/Timer.cpp
+++ b/lib/Support/Timer.cpp
@@ -22,8 +22,10 @@
#include <functional>
#include <fstream>
#include <map>
+using namespace llvm;
-namespace llvm {
+// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
+namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); }
// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
// of constructor/destructor ordering being unspecified by C++. Basically the
@@ -122,9 +124,9 @@ static TimeRecord getTimeRecord(bool Start) {
gettimeofday(&T, 0);
if (!Start) {
- MemUsed = getMemUsage();
if (getrusage(RUSAGE_SELF, &RU))
perror("getrusage call failed: -time-passes info incorrect!");
+ MemUsed = getMemUsage();
}
TimeRecord Result;
@@ -268,7 +270,7 @@ void Timer::print(const Timer &Total, std::ostream &OS) {
// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
std::ostream *
-GetLibSupportInfoOutputFile() {
+llvm::GetLibSupportInfoOutputFile() {
std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
if (LibSupportInfoOutputFilename.empty())
return &std::cerr;
@@ -353,4 +355,3 @@ void TimerGroup::removeTimer() {
}
}
-} // End llvm namespace