[llvm] r340104 - [DebugCounters] don't do redundant map lookups; NFC
George Burgess IV via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 17 15:34:04 PDT 2018
Author: gbiv
Date: Fri Aug 17 15:34:04 2018
New Revision: 340104
URL: http://llvm.org/viewvc/llvm-project?rev=340104&view=rev
Log:
[DebugCounters] don't do redundant map lookups; NFC
Modified:
llvm/trunk/lib/Support/DebugCounter.cpp
Modified: llvm/trunk/lib/Support/DebugCounter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/DebugCounter.cpp?rev=340104&r1=340103&r2=340104&view=diff
==============================================================================
--- llvm/trunk/lib/Support/DebugCounter.cpp (original)
+++ llvm/trunk/lib/Support/DebugCounter.cpp Fri Aug 17 15:34:04 2018
@@ -83,8 +83,10 @@ void DebugCounter::push_back(const std::
return;
}
enableAllCounters();
- Counters[CounterID].Skip = CounterVal;
- Counters[CounterID].IsSet = true;
+
+ CounterInfo &Counter = Counters[CounterID];
+ Counter.Skip = CounterVal;
+ Counter.IsSet = true;
} else if (CounterPair.first.endswith("-count")) {
auto CounterName = CounterPair.first.drop_back(6);
unsigned CounterID = getCounterId(CounterName);
@@ -94,8 +96,10 @@ void DebugCounter::push_back(const std::
return;
}
enableAllCounters();
- Counters[CounterID].StopAfter = CounterVal;
- Counters[CounterID].IsSet = true;
+
+ CounterInfo &Counter = Counters[CounterID];
+ Counter.StopAfter = CounterVal;
+ Counter.IsSet = true;
} else {
errs() << "DebugCounter Error: " << CounterPair.first
<< " does not end with -skip or -count\n";
More information about the llvm-commits
mailing list