mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
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. llvm-svn: 141574
This commit is contained in:
parent
fe8c38a61e
commit
4c8a7dc833
@ -84,11 +84,13 @@ public:
|
||||
}
|
||||
|
||||
const Statistic &operator+=(const unsigned &V) {
|
||||
if (!V) return *this;
|
||||
sys::AtomicAdd(&Value, V);
|
||||
return init();
|
||||
}
|
||||
|
||||
const Statistic &operator-=(const unsigned &V) {
|
||||
if (!V) return *this;
|
||||
sys::AtomicAdd(&Value, -V);
|
||||
return init();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user