A reference to the Timer's name is safe, it outlives the contents of the vector.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 7 Aug 2010 13:07:57 +0000 (13:07 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 7 Aug 2010 13:07:57 +0000 (13:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110517 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Timer.h

index f959136f86a03b8a661a73fc7a8a996bd211077a..a5a33ba32405c6034bfea457a5bc23186eaa22f6 100644 (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