This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix GCC warnings
ClosedPublic

Authored by marxin on May 3 2022, 1:12 AM.

Details

Summary

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]

Diff Detail

Event Timeline

marxin created this revision.May 3 2022, 1:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 1:12 AM
marxin requested review of this revision.May 3 2022, 1:12 AM
dvyukov added inline comments.May 3 2022, 2:19 AM
compiler-rt/lib/tsan/rtl/tsan_shadow.h
91–97

This implicitly hardcodes that kAccessWrite==0. While it's unlikely to change, it's possible.
I think it will be cleaner with:

if (part_.is_atomic_)
  *typ |= kAccessAtomic;
marxin updated this revision to Diff 426621.May 3 2022, 2:43 AM

V2 of the patch.

marxin marked an inline comment as done.May 3 2022, 2:44 AM
dvyukov accepted this revision.May 3 2022, 3:49 AM
This revision is now accepted and ready to land.May 3 2022, 3:49 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 1:23 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript