[msan] Fix bad interaction between with-calls mode and chained origin tracking.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 25 Jun 2014 14:41:57 +0000 (14:41 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 25 Jun 2014 14:41:57 +0000 (14:41 +0000)
commitb163f0276f19ec207b3dafba398b0f273787c570
tree6611a5e0b812c63ea917412dadf412f9400eb048
parenta8acef6c6845920c557ac0d302fe4974ffe9ff44
[msan] Fix bad interaction between with-calls mode and chained origin tracking.

Origin history should only be recorded for uninitialized values, because it is
meaningless otherwise. This change moves __msan_chain_origin to the runtime
library side and makes it conditional on the corresponding shadow value.

Previous code was correct, but _very_ inefficient.

llvm-svn: 211700
compiler-rt/lib/msan/msan.cc
compiler-rt/test/msan/chained_origin.cc
compiler-rt/test/msan/chained_origin_limits.cc
compiler-rt/test/msan/chained_origin_memcpy.cc
compiler-rt/test/msan/chained_origin_with_signals.cc
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll