aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Support/DebugCounter.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index e4345e5..8e9dc29 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -162,8 +162,9 @@ public:
protected:
unsigned addCounter(const std::string &Name, const std::string &Desc) {
unsigned Result = RegisteredCounters.insert(Name);
- Counters[Result] = {};
- Counters[Result].Desc = Desc;
+ auto &C = Counters[Result];
+ C = {};
+ C.Desc = Desc;
return Result;
}
// Struct to store counter info.