[compiler-rt] f1b9245 - tsan: fix GCC warnings
Martin Liska via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 01:23:01 PDT 2022
Author: Martin Liska
Date: 2022-05-04T10:22:03+02:00
New Revision: f1b9245199f3457a4d06d32d1bc6e44573c166e3
URL: https://github.com/llvm/llvm-project/commit/f1b9245199f3457a4d06d32d1bc6e44573c166e3
DIFF: https://github.com/llvm/llvm-project/commit/f1b9245199f3457a4d06d32d1bc6e44573c166e3.diff
LOG: 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
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_shadow.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_shadow.h b/compiler-rt/lib/tsan/rtl/tsan_shadow.h
index 843573ecf5d30..b222acf9e6c51 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
More information about the llvm-commits
mailing list