llvm.org GIT mirror llvm / 8cc4769
Allow stat += 0 without activating the stat. For me, this is a nice convenience. We generally want grep to match stats output only when the event has occurred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141574 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
1 changed file(s) with 2 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8383 }
8484
8585 const Statistic &operator+=(const unsigned &V) {
86 if (!V) return *this;
8687 sys::AtomicAdd(&Value, V);
8788 return init();
8889 }
8990
9091 const Statistic &operator-=(const unsigned &V) {
92 if (!V) return *this;
9193 sys::AtomicAdd(&Value, -V);
9294 return init();
9395 }