projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Eliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.
[oota-llvm.git]
/
include
/
llvm
/
ADT
/
Statistic.h
diff --git
a/include/llvm/ADT/Statistic.h
b/include/llvm/ADT/Statistic.h
index 9bbda986a819e9becf1cf082a4d84f3615f68f59..b54d10b9dd334d0317054f81c82c3504a3517007 100644
(file)
--- a/
include/llvm/ADT/Statistic.h
+++ b/
include/llvm/ADT/Statistic.h
@@
-27,6
+27,7
@@
#define LLVM_ADT_STATISTIC_H
#include "llvm/Support/Atomic.h"
#define LLVM_ADT_STATISTIC_H
#include "llvm/Support/Atomic.h"
+#include "llvm/Support/Valgrind.h"
namespace llvm {
class raw_ostream;
namespace llvm {
class raw_ostream;
@@
-84,11
+85,13
@@
public:
}
const Statistic &operator+=(const unsigned &V) {
}
const Statistic &operator+=(const unsigned &V) {
+ if (!V) return *this;
sys::AtomicAdd(&Value, V);
return init();
}
const Statistic &operator-=(const unsigned &V) {
sys::AtomicAdd(&Value, V);
return init();
}
const Statistic &operator-=(const unsigned &V) {
+ if (!V) return *this;
sys::AtomicAdd(&Value, -V);
return init();
}
sys::AtomicAdd(&Value, -V);
return init();
}
@@
-108,6
+111,7
@@
protected:
bool tmp = Initialized;
sys::MemoryFence();
if (!tmp) RegisterStatistic();
bool tmp = Initialized;
sys::MemoryFence();
if (!tmp) RegisterStatistic();
+ TsanHappensAfter(this);
return *this;
}
void RegisterStatistic();
return *this;
}
void RegisterStatistic();