diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/Support/DebugCounter.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/lib/Support/DebugCounter.cpp')
-rw-r--r-- | llvm/lib/Support/DebugCounter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp index 1e3ec300964ca..8c579f395282e 100644 --- a/llvm/lib/Support/DebugCounter.cpp +++ b/llvm/lib/Support/DebugCounter.cpp @@ -31,7 +31,7 @@ private: // width, so we do the same. Option::printHelpStr(HelpStr, GlobalWidth, ArgStr.size() + 6); const auto &CounterInstance = DebugCounter::instance(); - for (auto Name : CounterInstance) { + for (const auto &Name : CounterInstance) { const auto Info = CounterInstance.getCounterInfo(CounterInstance.getCounterId(Name)); size_t NumSpaces = GlobalWidth - Info.first.size() - 8; @@ -85,7 +85,7 @@ 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 = getCounterId(CounterName); + unsigned CounterID = getCounterId(std::string(CounterName)); if (!CounterID) { errs() << "DebugCounter Error: " << CounterName << " is not a registered counter\n"; @@ -98,7 +98,7 @@ void DebugCounter::push_back(const std::string &Val) { Counter.IsSet = true; } else if (CounterPair.first.endswith("-count")) { auto CounterName = CounterPair.first.drop_back(6); - unsigned CounterID = getCounterId(CounterName); + unsigned CounterID = getCounterId(std::string(CounterName)); if (!CounterID) { errs() << "DebugCounter Error: " << CounterName << " is not a registered counter\n"; @@ -123,7 +123,7 @@ void DebugCounter::print(raw_ostream &OS) const { auto &Us = instance(); OS << "Counters and values:\n"; for (auto &CounterName : CounterNames) { - unsigned CounterID = getCounterId(CounterName); + unsigned CounterID = getCounterId(std::string(CounterName)); OS << left_justify(RegisteredCounters[CounterID], 32) << ": {" << Us.Counters[CounterID].Count << "," << Us.Counters[CounterID].Skip << "," << Us.Counters[CounterID].StopAfter << "}\n"; |