OSDN Git Service

DebugCounter: Initialize skip to 0, not -1
authorDaniel Berlin <dberlin@dberlin.org>
Sat, 4 Mar 2017 14:08:47 +0000 (14:08 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sat, 4 Mar 2017 14:08:47 +0000 (14:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296971 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/DebugCounter.cpp

index a746852..29dae8a 100644 (file)
@@ -81,7 +81,7 @@ void DebugCounter::push_back(const std::string &Val) {
       return;
     }
 
-    auto Res = Counters.insert({CounterID, {-1, -1}});
+    auto Res = Counters.insert({CounterID, {0, -1}});
     Res.first->second.first = CounterVal;
   } else if (CounterPair.first.endswith("-count")) {
     auto CounterName = CounterPair.first.drop_back(6);
@@ -92,7 +92,7 @@ void DebugCounter::push_back(const std::string &Val) {
       return;
     }
 
-    auto Res = Counters.insert({CounterID, {-1, -1}});
+    auto Res = Counters.insert({CounterID, {0, -1}});
     Res.first->second.second = CounterVal;
   } else {
     errs() << "DebugCounter Error: " << CounterPair.first