A reference to the Timer's name is safe, it outlives the contents of the vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-08-07 13:07:57 +00:00
parent 933b16e665
commit 0055fac724

View File

@ -18,7 +18,6 @@
#include "llvm/System/DataTypes.h"
#include "llvm/ADT/StringRef.h"
#include <cassert>
#include <string>
#include <vector>
#include <utility>
@ -165,7 +164,7 @@ struct NamedRegionTimer : public TimeRegion {
class TimerGroup {
std::string Name;
Timer *FirstTimer; // First timer in the group.
std::vector<std::pair<TimeRecord, std::string> > TimersToPrint;
std::vector<std::pair<TimeRecord, StringRef> > TimersToPrint;
TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's.
TimerGroup(const TimerGroup &TG); // DO NOT IMPLEMENT