[msan] Change the way origin ids are built.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 3 Dec 2014 13:58:40 +0000 (13:58 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 3 Dec 2014 13:58:40 +0000 (13:58 +0000)
commit7395cae005886f4ed15713e45d7acfd2c3f33593
tree70321c6ff166c47d856150f3199dfe862d2450c8
parent4cf0c18a5b6cb3594649f864026f3da050b0d88c
[msan] Change the way origin ids are built.

Previously, all origin ids were "chained" origins, i.e values of
ChainedOriginDepot. This added a level of indirection for simple
stack and heap allocation, which were represented as chains of
length 1. This costs both RAM and CPU, but provides a joined 2**29
origin id space. It also made function (any instrumented function)
entry non-async-signal-safe, but that does not really matter because
memory stores in track-origins=2 mode are not async-signal-safe anyway.

With this change, the type of the origin is encoded in origin id.
See comment in msan_origin.h for more details. This reduces chained and stack
origin id range to 2**28 each, but leaves extra 2**31 for heap origins.

This change should not have any user-visible effects.

llvm-svn: 223233
compiler-rt/lib/msan/msan.cc
compiler-rt/lib/msan/msan_allocator.cc
compiler-rt/lib/msan/msan_chained_origin_depot.cc
compiler-rt/lib/msan/msan_interceptors.cc
compiler-rt/lib/msan/msan_origin.h
compiler-rt/lib/msan/msan_report.cc