This is an archive of the discontinued LLVM Phabricator instance.

[libc] move stdlib and stdio to new errno pattern
ClosedPublic

Authored by michaelrj on Mar 2 2023, 2:24 PM.

Diff Detail

Event Timeline

michaelrj created this revision.Mar 2 2023, 2:24 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 2 2023, 2:24 PM
michaelrj requested review of this revision.Mar 2 2023, 2:24 PM
michaelrj updated this revision to Diff 501994.Mar 2 2023, 2:37 PM

also fix tests

A general comment: If a function is just using the symbolic error values like EINVAL, it can still include <errno.h> directly. Only those places where the errno is updated/read need to include src/errno/errno.h and depend on libc.src.errno.errno.

libc/src/stdio/CMakeLists.txt
28

I think you should add a new dep on libc.src.errno.errno for all of these targets?

michaelrj updated this revision to Diff 502012.Mar 2 2023, 3:17 PM
michaelrj marked an inline comment as done.

While we could include <errno.h> from those targets, I think it's easier to read if all of the files include the same target.

sivachandra accepted this revision.Mar 2 2023, 3:58 PM
sivachandra added inline comments.
libc/src/__support/StringUtil/CMakeLists.txt
18

Add the dep on libc.src.errno.errno.

libc/src/__support/threads/linux/thread.cpp
18

A corresponding dep should be added?

This revision is now accepted and ready to land.Mar 2 2023, 3:58 PM
michaelrj updated this revision to Diff 502196.Mar 3 2023, 11:14 AM
michaelrj marked 2 inline comments as done.

address final comments before landing

This revision was landed with ongoing or failed builds.Mar 3 2023, 11:15 AM
This revision was automatically updated to reflect the committed changes.