From 00e4604d6b8cdb436882349aad0519e16c556eb6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 28 Nov 2012 10:49:27 +0000 Subject: tsan: change fast state layout in preparation to dynamic traces llvm-svn: 168784 --- compiler-rt/lib/tsan/rtl/tsan_rtl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.h') diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/compiler-rt/lib/tsan/rtl/tsan_rtl.h index d3052cf0b53..9bc2a76369b 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.h +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.h @@ -70,18 +70,18 @@ void TsanCheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2); // FastState (from most significant bit): -// unused : 1 +// ignore : 1 // tid : kTidBits // epoch : kClkBits // unused : - -// ignore_bit : 1 class FastState { public: FastState(u64 tid, u64 epoch) { x_ = tid << kTidShift; x_ |= epoch << kClkShift; - DCHECK(tid == this->tid()); - DCHECK(epoch == this->epoch()); + DCHECK_EQ(tid, this->tid()); + DCHECK_EQ(epoch, this->epoch()); + DCHECK_EQ(GetIgnoreBit(), false); } explicit FastState(u64 x) @@ -111,13 +111,13 @@ class FastState { void SetIgnoreBit() { x_ |= kIgnoreBit; } void ClearIgnoreBit() { x_ &= ~kIgnoreBit; } - bool GetIgnoreBit() const { return x_ & kIgnoreBit; } + bool GetIgnoreBit() const { return (s64)x_ < 0; } private: friend class Shadow; static const int kTidShift = 64 - kTidBits - 1; static const int kClkShift = kTidShift - kClkBits; - static const u64 kIgnoreBit = 1ull; + static const u64 kIgnoreBit = 1ull << 63; static const u64 kFreedBit = 1ull << 63; u64 x_; }; -- cgit v1.2.3