This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Adds __throw_system_error overload.
ClosedPublic

Authored by Mordante on Jul 22 2023, 2:39 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG3c28ce6bec76: [libc++] Adds __throw_system_error overload.
Summary

This was mention in D150044 and D154995 that this would be useful.
This addresses the last review coment of D150044.

Diff Detail

Event Timeline

Mordante created this revision.Jul 22 2023, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2023, 2:39 AM
Mordante updated this revision to Diff 543167.Jul 22 2023, 4:17 AM

Update ABI lists and enable entire CI.

Mordante updated this revision to Diff 543177.Jul 22 2023, 6:44 AM

CI fixes.

Mordante published this revision for review.Jul 22 2023, 9:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2023, 9:25 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added inline comments.
libcxx/src/system_error.cpp
285

I think we should try to avoid adding this to the dylib, since otherwise we need to introduce a new availability macro just for this function. I would just define it in the headers.

Mordante marked an inline comment as done.Aug 23 2023, 8:45 AM
Mordante updated this revision to Diff 552739.Aug 23 2023, 8:46 AM

Rebased and addresses review comments.

ldionne accepted this revision.Aug 29 2023, 9:01 AM
This revision is now accepted and ready to land.Aug 29 2023, 9:01 AM
This revision was automatically updated to reflect the committed changes.

It looks like this change is a likely root cause for a size regression on Fuchsia. In particular, Fuchsia maintains a hermetic -fno-exceptions multilib of libc++.a that is statically linked into other binaries/libraries. Previously, the no-exceptions version of this code didn't depend on the error code or category libraries, but this change seems to bring them into the link unnecessarily. Would it be possible to revert this or to fix it forward to keep the no-exception case separate from these routines?