summaryrefslogtreecommitdiff
path: root/libc/src/__support/threads/thread.cpp
diff options
context:
space:
mode:
authorSchrodinger ZHU Yifan <yifanzhu@rochester.edu>2024-08-02 13:11:17 -0700
committerGitHub <noreply@github.com>2024-08-02 13:11:17 -0700
commit4ac24b388a5d812c57d50ed8ce336f1d516450cc (patch)
treee9678444274021c814703018a31aa9e9f4b4f2f2 /libc/src/__support/threads/thread.cpp
parent858bea86be709ec84757d98da16fbf3a05579b76 (diff)
[libc] inline thread self (#101739)
The codegen for non-inlined version is "quite ugly" as it emits some checks to make sure the initialization routine is properly executed because the compiler does not see how the TLS object is initialized. This leads to some `callq 0x0` junk in the final outputs. For codegen details, see https://godbolt.org/z/rb5qYj3vY.
Diffstat (limited to 'libc/src/__support/threads/thread.cpp')
-rw-r--r--libc/src/__support/threads/thread.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/libc/src/__support/threads/thread.cpp b/libc/src/__support/threads/thread.cpp
index 886281e0d50f..dad4f75f092e 100644
--- a/libc/src/__support/threads/thread.cpp
+++ b/libc/src/__support/threads/thread.cpp
@@ -17,9 +17,6 @@
#include "src/__support/macros/attributes.h"
namespace LIBC_NAMESPACE_DECL {
-
-LIBC_THREAD_LOCAL Thread self;
-
namespace {
using AtExitCallback = void(void *);