summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Statistic.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-12-05 23:07:05 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-12-05 23:07:05 +0000
commit897a57ecdaee7cbc0c45414ec8b5df733d0c46ac (patch)
tree21b00968102cf02c5501e972229c124065ec2c82 /llvm/lib/Support/Statistic.cpp
parentdb66ed0e4cabe111f11732240e72bfdf650edefe (diff)
downloadbcm5719-llvm-897a57ecdaee7cbc0c45414ec8b5df733d0c46ac.tar.gz
bcm5719-llvm-897a57ecdaee7cbc0c45414ec8b5df733d0c46ac.zip
Silence tsan false-positives (tsan can't track things which are only safe due to
memory fences) in statistics registration, which works the same way that ManagedStatic registration does. llvm-svn: 145869
Diffstat (limited to 'llvm/lib/Support/Statistic.cpp')
-rw-r--r--llvm/lib/Support/Statistic.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/Statistic.cpp b/llvm/lib/Support/Statistic.cpp
index 04a44a0f711..d8a6ad35ba9 100644
--- a/llvm/lib/Support/Statistic.cpp
+++ b/llvm/lib/Support/Statistic.cpp
@@ -73,9 +73,12 @@ void Statistic::RegisterStatistic() {
if (Enabled)
StatInfo->addStatistic(this);
+ TsanHappensBefore(this);
sys::MemoryFence();
// Remember we have been registered.
+ TsanIgnoreWritesBegin();
Initialized = true;
+ TsanIgnoreWritesEnd();
}
}
OpenPOWER on IntegriCloud