[compiler-rt] c21909a - [NFC][sanitizer] Simplify ifdef
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 14 19:13:37 PDT 2024
Author: Vitaly Buka
Date: 2024-09-14T19:12:42-07:00
New Revision: c21909a530f438bcc942c11e6d7b875bb28a028a
URL: https://github.com/llvm/llvm-project/commit/c21909a530f438bcc942c11e6d7b875bb28a028a
DIFF: https://github.com/llvm/llvm-project/commit/c21909a530f438bcc942c11e6d7b875bb28a028a.diff
LOG: [NFC][sanitizer] Simplify ifdef
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index c3c717bbdbe4c9..55889ae1222ad8 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -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;
@@ -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() {
More information about the llvm-commits
mailing list