diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 10:49:27 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2012-11-28 10:49:27 +0000 |
| commit | 00e4604d6b8cdb436882349aad0519e16c556eb6 (patch) | |
| tree | 0311324c9547f548992facaa2fb5dc44e1835cb7 /compiler-rt/lib/tsan/rtl/tsan_rtl.h | |
| parent | 2429b027703b96e99a275d71ed75fde6492bb779 (diff) | |
| download | bcm5719-llvm-00e4604d6b8cdb436882349aad0519e16c556eb6.tar.gz bcm5719-llvm-00e4604d6b8cdb436882349aad0519e16c556eb6.zip | |
tsan: change fast state layout in preparation to dynamic traces
llvm-svn: 168784
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.h')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.h | 12 |
1 files changed, 6 insertions, 6 deletions
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_; }; |

