Move valid caller-pc checks out of platform-specific checks
authorFrancis Ricci <francisjricci@gmail.com>
Wed, 19 Apr 2017 14:00:35 +0000 (14:00 +0000)
committerFrancis Ricci <francisjricci@gmail.com>
Wed, 19 Apr 2017 14:00:35 +0000 (14:00 +0000)
commit2096fa4bf9b288072134879e1426ac31e4c5c47b
tree90cce5ddc84b9e789efff817dda8504a82dcdaa8
parent8ea76fa9b4503847aa0bd784d2a26df5d3429aea
Move valid caller-pc checks out of platform-specific checks

Summary:
ProcessPlatformSpecificAllocations for linux leak sanitizer iterated over
memory chunks and ran two checks concurrently:
1) Ensured the pc was valid
2) Checked whether it was a linker allocation

All platforms will need the valid pc check, so it is moved out of the platform-
specific file. To prevent code and logic duplication, the linker allocation
check is moved as well, with the name of the linker supplied by the platform-specific
module. In cases where we don't need to check for linker allocations (ie Darwin),
this name will be a nullptr, and we'll only run the caller pc checks.

Reviewers: kubamracek, alekseyshl, kcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32130

llvm-svn: 300690
compiler-rt/lib/lsan/lsan_common.cc
compiler-rt/lib/lsan/lsan_common.h
compiler-rt/lib/lsan/lsan_common_linux.cc
compiler-rt/lib/lsan/lsan_common_mac.cc