diff options
author | John Criswell <criswell@uiuc.edu> | 2003-06-30 21:59:07 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2003-06-30 21:59:07 +0000 |
commit | 3ef61afb76ed32e53fae736883996353b3fb90ee (patch) | |
tree | 41855d87265fc9b572f4c540910d63e55ad54094 /llvm/lib/Support/Timer.cpp | |
parent | 53426e6526efd0273213c881622c23c23af3449c (diff) | |
download | llvm-3ef61afb76ed32e53fae736883996353b3fb90ee.zip llvm-3ef61afb76ed32e53fae736883996353b3fb90ee.tar.gz llvm-3ef61afb76ed32e53fae736883996353b3fb90ee.tar.bz2 |
Merged in autoconf branch. This provides configuration via the autoconf
system.
llvm-svn: 7014
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 96b63f1..79d4c1c 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -4,15 +4,16 @@ // //===----------------------------------------------------------------------===// +#include "Config/malloc.h" + #include "Support/Timer.h" #include "Support/CommandLine.h" -#include <sys/resource.h> -#include <sys/time.h> -#include <unistd.h> -#ifndef __FreeBSD__ -#include <malloc.h> -#endif // __FreeBSD__ -#include <stdio.h> + +#include "Config/sys/resource.h" +#include "Config/sys/time.h" +#include "Config/unistd.h" +#include "Config/malloc.h" +#include "Config/stdio.h" #include <iostream> #include <algorithm> #include <functional> @@ -21,10 +22,12 @@ std::string LibSupportInfoOutputFilename; namespace { +#ifdef HAVE_MALLINFO cl::opt<bool> TrackSpace("track-memory", cl::desc("Enable -time-passes memory " "tracking (this may be slow)"), cl::Hidden); +#endif cl::opt<std::string, true> InfoOutputFilename("info-output-file", @@ -76,12 +79,12 @@ Timer::~Timer() { } static long getMemUsage() { -#ifndef __FreeBSD__ +#ifdef HAVE_MALLINFO if (TrackSpace) { struct mallinfo MI = mallinfo(); return MI.uordblks/*+MI.hblkhd*/; } -#endif // __FreeBSD__ +#endif return 0; } |