projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Allow stat += 0 without activating the stat.
[oota-llvm.git]
/
include
/
llvm
/
ADT
/
Statistic.h
diff --git
a/include/llvm/ADT/Statistic.h
b/include/llvm/ADT/Statistic.h
index 9bbda986a819e9becf1cf082a4d84f3615f68f59..b8a1a2f5c4e8fcd610dacb4a305e5b34a62b8ea3 100644
(file)
--- a/
include/llvm/ADT/Statistic.h
+++ b/
include/llvm/ADT/Statistic.h
@@
-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();
}