diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Support/DebugCounter.cpp | 19 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp index 4a439746541..5a9cecfc56d 100644 --- a/llvm/lib/Support/DebugCounter.cpp +++ b/llvm/lib/Support/DebugCounter.cpp @@ -66,7 +66,7 @@ void DebugCounter::push_back(const std::string &Val) { } // Now we have counter=value. // First, process value. - long CounterVal; + int64_t CounterVal; if (CounterPair.second.getAsInteger(0, CounterVal)) { errs() << "DebugCounter Error: " << CounterPair.second << " is not a number\n"; @@ -76,26 +76,24 @@ void DebugCounter::push_back(const std::string &Val) { // add it to the counter values. if (CounterPair.first.endswith("-skip")) { auto CounterName = CounterPair.first.drop_back(5); - unsigned CounterID = RegisteredCounters.idFor(CounterName); + unsigned CounterID = getCounterId(CounterName); if (!CounterID) { errs() << "DebugCounter Error: " << CounterName << " is not a registered counter\n"; return; } - - auto Res = Counters.insert({CounterID, {0, -1}}); - Res.first->second.first = CounterVal; + Counters[CounterID].Skip = CounterVal; + Counters[CounterID].IsSet = true; } else if (CounterPair.first.endswith("-count")) { auto CounterName = CounterPair.first.drop_back(6); - unsigned CounterID = RegisteredCounters.idFor(CounterName); + unsigned CounterID = getCounterId(CounterName); if (!CounterID) { errs() << "DebugCounter Error: " << CounterName << " is not a registered counter\n"; return; } - - auto Res = Counters.insert({CounterID, {0, -1}}); - Res.first->second.second = CounterVal; + Counters[CounterID].StopAfter = CounterVal; + Counters[CounterID].IsSet = true; } else { errs() << "DebugCounter Error: " << CounterPair.first << " does not end with -skip or -count\n"; @@ -106,7 +104,8 @@ void DebugCounter::print(raw_ostream &OS) const { OS << "Counters and values:\n"; for (const auto &KV : Counters) OS << left_justify(RegisteredCounters[KV.first], 32) << ": {" - << KV.second.first << "," << KV.second.second << "}\n"; + << KV.second.Count << "," << KV.second.Skip << "," + << KV.second.StopAfter << "}\n"; } LLVM_DUMP_METHOD void DebugCounter::dump() const { diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index 994d0d212cf..2eb887c986b 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -861,7 +861,7 @@ private: // Debug counter info. When verifying, we have to reset the value numbering // debug counter to the same state it started in to get the same results. - std::pair<int, int> StartingVNCounter; + int64_t StartingVNCounter; }; } // end anonymous namespace |