diff options
author | Martin Liska <mliska@suse.cz> | 2022-05-03 11:09:07 +0300 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-05-04 11:22:03 +0300 |
commit | f1b9245199f3457a4d06d32d1bc6e44573c166e3 (patch) | |
tree | 43002dea474f7726f914ba5726c0e0967a4f0db6 /compiler-rt | |
parent | b34ea97f557165011e21ecd934d23f3f8461ffdb (diff) |
tsan: fix GCC warnings
Fixes:
tsan/tsan_shadow.h:93:32: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
tsan/tsan_shadow.h:94:44: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
Differential Revision: https://reviews.llvm.org/D124828
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_shadow.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_shadow.h b/compiler-rt/lib/tsan/rtl/tsan_shadow.h index 843573ecf5d3..b222acf9e6c5 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_shadow.h +++ b/compiler-rt/lib/tsan/rtl/tsan_shadow.h @@ -88,10 +88,13 @@ class Shadow { if (size) *size = part_.access_ == kFreeAccess ? kShadowCell : __builtin_popcount(part_.access_); - if (typ) - *typ = (part_.is_read_ ? kAccessRead : kAccessWrite) | - (part_.is_atomic_ ? kAccessAtomic : 0) | - (part_.access_ == kFreeAccess ? kAccessFree : 0); + if (typ) { + *typ = part_.is_read_ ? kAccessRead : kAccessWrite; + if (part_.is_atomic_) + *typ |= kAccessAtomic; + if (part_.access_ == kFreeAccess) + *typ |= kAccessFree; + } } ALWAYS_INLINE |