This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Improve no wide characters configuration.
ClosedPublic

Authored by Mordante on Nov 3 2021, 11:36 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG5de4864f74bd: [libc++] Improve no wide characters configuration.
Summary

When wide characters are supported libc++ manually translates a
narrow non-breaking space and a non-breaking space to a space.
This behaviour wasn't available when wide characters were disabled.
This enables an emulation for that configuration.

Updating the libc++ Docker image to Ubuntu Focal caused some breakage.
This was temporary disabled in D112737. This re-enables four of these
tests.

Diff Detail

Event Timeline

Mordante requested review of this revision.Nov 3 2021, 11:36 AM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2021, 11:36 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Nov 3 2021, 2:34 PM

Awesome, thanks a lot for looking into it!

libcxx/src/locale.cpp
4607–4613

This appears to be the same as the checked_string_to_char_convert function above -- could we hoist it out of the #if to avoid duplication?

This revision is now accepted and ready to land.Nov 3 2021, 2:34 PM
Mordante updated this revision to Diff 384800.Nov 4 2021, 10:23 AM

Addresses review comment.

Mordante marked an inline comment as done.Nov 4 2021, 10:26 AM

Thanks for the review. I'll give it another CI run before committing.

libcxx/src/locale.cpp
4546

Note I could have used an #else here. But since this #ifdef isn't related to the #ifndef above using an #else feels wrong.

4607–4613

I was doubting between an #else in the original function or a copy. I now switched to the #else which addresses your issue.

This revision was automatically updated to reflect the committed changes.
Mordante marked an inline comment as done.