tsan: introduce Tid and StackID typedefs
authorDmitry Vyukov <dvyukov@google.com>
Fri, 30 Jul 2021 11:50:15 +0000 (13:50 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Sat, 31 Jul 2021 07:05:31 +0000 (09:05 +0200)
commit103d075b05d1b1b70c317e662b1c31f836fcff20
tree862f88e0e4f3175509e01754bb140c01550033e9
parent3ea3b6b2d411e1507a5a81d29d2ae5de11555202
tsan: introduce Tid and StackID typedefs

Currently we inconsistently use u32 and int for thread ids,
there are also "unique tid" and "os tid" and just lots of other
things identified by integers.
Additionally new tsan runtime will introduce yet another
thread identifier that is very different from current tids.
Similarly for stack IDs, it's easy to confuse u32 with other
integer identifiers. And when a function accepts u32 or a struct
contains u32 field, it's not always clear what it is.

Add Tid and StackID typedefs to make it clear what is what.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107152
16 files changed:
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/lib/tsan/go/tsan_go.cpp
compiler-rt/lib/tsan/rtl/tsan_fd.cpp
compiler-rt/lib/tsan/rtl/tsan_fd.h
compiler-rt/lib/tsan/rtl/tsan_ignoreset.cpp
compiler-rt/lib/tsan/rtl/tsan_ignoreset.h
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
compiler-rt/lib/tsan/rtl/tsan_report.cpp
compiler-rt/lib/tsan/rtl/tsan_report.h
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.h
compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
compiler-rt/lib/tsan/rtl/tsan_sync.h