Commit Graph

7 Commits

Author SHA1 Message Date
Michael Jones
9b8a64b88d [libc] add noexcept to external function headers
To improve code generation for C++ code that directly includes our
headers, the external function definitions will now be marked noexcept.
This may not be necessary for the internal definitions since we build
with the -fno-exceptions flag.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D141095
2023-01-06 11:43:43 -08:00
Siva Chandra Reddy
dd33f9cdef [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
2022-03-04 17:29:49 +00:00
Siva Chandra Reddy
32a50c6b93 [libc][NFC] Add a static assert for futex size. 2022-03-01 22:56:56 +00:00
Siva Chandra Reddy
1137255585 [libc] Add a class "Atomic" as a simple equivalent of std::atomic.
Only the methods currently required by the libc have been added.
Most of the existing uses of atomic operations have been switched over
to this new class. A future change will clean up the rest of uses.

This change now allows building mutex and condition variable code with a
C++ compiler which does not have stdatomic.h, for example g++.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D120642
2022-02-28 23:51:44 +00:00
Paula Toth
66d00feb18 [libc][NFC] Make all top of file comments consistent.
Summary:
Made all header files consistent based of this documentation: https://llvm.org/docs/CodingStandards.html#file-headers.
And did the same for all source files top of file comments.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra, abrachet

Subscribers: MaskRay, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D77533
2020-04-08 10:18:37 -07:00
Alex Brachet
a499d68056 [libc] Create abort and _Exit
This revision creates abort and _Exit implementations

Differential Revision: https://reviews.llvm.org/D74949
2020-03-05 14:21:18 -05:00
Siva Chandra
4380647e79 Add few docs and implementation of strcpy and strcat.
Summary:
This patch illustrates some of the features like modularity we want
in the new libc. Few other ideas like different kinds of testing, redirectors
etc are not yet present.

Reviewers: dlj, hfinkel, theraven, jfb, alexshap, jdoerfert

Subscribers: mgorny, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 373764
2019-10-04 17:30:54 +00:00