This is an archive of the discontinued LLVM Phabricator instance.

tsan: introduce RawShadow type
ClosedPublic

Authored by dvyukov on Aug 4 2021, 10:21 AM.

Details

Summary

Currently we hardcode u64 type for shadow everywhere
and do lots of uptr<->u64* casts. It makes it hard to
change u64 to another type (e.g. u32) and makes it easy
to introduce bugs.
Introduce RawShadow type and use it in MemToShadow, ShadowToMem,
IsShadowMem and throughout the code base as u64 replacement.
This makes it possible to change u64 to something else in future
and generally improves static typing.

Depends on D107481.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 4 2021, 10:21 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 10:21 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Aug 4 2021, 11:15 AM
vitalybuka added inline comments.
compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cpp
67

IsAligned?

This revision is now accepted and ready to land.Aug 4 2021, 11:15 AM
dvyukov updated this revision to Diff 364411.Aug 5 2021, 4:19 AM

use IsAligned

dvyukov marked an inline comment as done.Aug 5 2021, 4:22 AM
dvyukov updated this revision to Diff 364414.Aug 5 2021, 4:30 AM

fix build (s/CHECK_EQ/CHECK/)

This revision was landed with ongoing or failed builds.Aug 5 2021, 4:37 AM
This revision was automatically updated to reflect the committed changes.