From a7d0ccfe7fdb7d67fa4d0397aea2cd319e18d3d5 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 7 Aug 2010 13:27:41 +0000 Subject: [PATCH] Roll back my last two commits, valgrind complains. llvm-svn: 110518 --- llvm/include/llvm/Support/Timer.h | 3 ++- llvm/lib/Support/Timer.cpp | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h index a5a33ba32405..f959136f86a0 100644 --- a/llvm/include/llvm/Support/Timer.h +++ b/llvm/include/llvm/Support/Timer.h @@ -18,6 +18,7 @@ #include "llvm/System/DataTypes.h" #include "llvm/ADT/StringRef.h" #include +#include #include #include @@ -164,7 +165,7 @@ struct NamedRegionTimer : public TimeRegion { class TimerGroup { std::string Name; Timer *FirstTimer; // First timer in the group. - std::vector > TimersToPrint; + std::vector > TimersToPrint; TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's. TimerGroup(const TimerGroup &TG); // DO NOT IMPLEMENT diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index bf4595484981..44ee1777cb57 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -20,7 +20,6 @@ #include "llvm/System/Mutex.h" #include "llvm/System/Process.h" #include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" using namespace llvm; @@ -316,8 +315,8 @@ void TimerGroup::addTimer(Timer &T) { void TimerGroup::PrintQueuedTimers(raw_ostream &OS) { // Sort the timers in descending order by amount of time taken. - array_pod_sort(TimersToPrint.begin(), TimersToPrint.end()); - + std::sort(TimersToPrint.begin(), TimersToPrint.end()); + TimeRecord Total; for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i) Total += TimersToPrint[i].first;