From 7a73b80b9052136c8cd2234eb3433a07df7cf38e Mon Sep 17 00:00:00 2001 From: John Criswell Date: Mon, 30 Jun 2003 21:59:07 +0000 Subject: Merged in autoconf branch. This provides configuration via the autoconf system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Timer.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib/Support/Timer.cpp') diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 96b63f1e94..79d4c1cfe8 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -4,15 +4,16 @@ // //===----------------------------------------------------------------------===// +#include "Config/malloc.h" + #include "Support/Timer.h" #include "Support/CommandLine.h" -#include -#include -#include -#ifndef __FreeBSD__ -#include -#endif // __FreeBSD__ -#include + +#include "Config/sys/resource.h" +#include "Config/sys/time.h" +#include "Config/unistd.h" +#include "Config/malloc.h" +#include "Config/stdio.h" #include #include #include @@ -21,10 +22,12 @@ std::string LibSupportInfoOutputFilename; namespace { +#ifdef HAVE_MALLINFO cl::opt TrackSpace("track-memory", cl::desc("Enable -time-passes memory " "tracking (this may be slow)"), cl::Hidden); +#endif cl::opt 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; } -- cgit v1.2.3-18-g5258