Skip to content

Commit

Permalink
[NFC][sanitizer] Simplify ifdef
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Sep 15, 2024
1 parent 7005772 commit c21909a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,10 @@ void InitTlsSize() {
((void (*)(size_t *, size_t *))get_tls_static_info)(&g_tls_size, &tls_align);
# endif
}
# else
void InitTlsSize() {}
# endif // SANITIZER_GLIBC && !SANITIZER_GO

// On glibc x86_64, ThreadDescriptorSize() needs to be precise due to the usage
// of g_tls_size. On other targets, ThreadDescriptorSize() is only used by lsan
// to get the pointer to thread-specific data keys in the thread control block.
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS) && \
!SANITIZER_ANDROID && !SANITIZER_GO
// sizeof(struct pthread) from glibc.
static atomic_uintptr_t thread_descriptor_size;

Expand Down Expand Up @@ -465,8 +460,9 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,
*addr = ranges[l].begin;
*size = ranges[r - 1].end - ranges[l].begin;
}
# endif // (x86_64 || i386 || mips || ...) && (SANITIZER_FREEBSD ||
// SANITIZER_LINUX) && !SANITIZER_ANDROID && !SANITIZER_GO
# else
void InitTlsSize() {}
# endif // SANITIZER_GLIBC && !SANITIZER_GO

# if SANITIZER_NETBSD
static struct tls_tcb *ThreadSelfTlsTcb() {
Expand Down

0 comments on commit c21909a

Please sign in to comment.