[libc] Make the errno macro resolve to the thread local variable directly.
authorSiva Chandra Reddy <sivachandra@google.com>
Thu, 3 Mar 2022 10:25:35 +0000 (10:25 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Fri, 4 Mar 2022 17:29:49 +0000 (17:29 +0000)
commitdd33f9cdef9f6209aa34713e1417f4a2e24e5ca6
tree359a66607a5bdff22f635914d11e09cd405d5606
parentfa8293bbc760ca3df27d30327dca94d903106d80
[libc] Make the errno macro resolve to the thread local variable directly.

With modern architectures having a thread pointer and language supporting
thread locals, there is no reason to use a function intermediary to access
the thread local errno value.

The entrypoint corresponding to errno has been replaced with an object
library as there is no formal entrypoint for errno anymore.

Reviewed By: jeffbailey, michaelrj

Differential Revision: https://reviews.llvm.org/D120920
28 files changed:
libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/include/__llvm-libc-common.h
libc/spec/llvm_libc_ext.td
libc/src/__support/CMakeLists.txt
libc/src/__support/FPUtil/CMakeLists.txt
libc/src/__support/File/CMakeLists.txt
libc/src/errno/CMakeLists.txt
libc/src/errno/__errno_location.cpp [deleted file]
libc/src/errno/__errno_location.h [deleted file]
libc/src/errno/errno.cpp [new file with mode: 0644]
libc/src/errno/llvmlibc_errno.h
libc/src/fcntl/linux/CMakeLists.txt
libc/src/math/generic/CMakeLists.txt
libc/src/signal/linux/CMakeLists.txt
libc/src/sys/mman/linux/CMakeLists.txt
libc/src/sys/stat/linux/CMakeLists.txt
libc/src/threads/linux/CMakeLists.txt
libc/src/time/CMakeLists.txt
libc/src/unistd/linux/CMakeLists.txt
libc/test/loader/linux/CMakeLists.txt
libc/test/src/__support/File/CMakeLists.txt
libc/test/src/errno/CMakeLists.txt
libc/test/src/math/CMakeLists.txt
libc/test/src/signal/CMakeLists.txt
libc/test/src/sys/mman/linux/CMakeLists.txt
libc/test/src/threads/CMakeLists.txt