This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix regex_traits<T>::char_class_type for Android.
AbandonedPublic

Authored by danalbert on Jul 23 2014, 4:50 PM.

Details

Summary

Android can't use ctype_base::mask for its char_class_type because the bionic ctype implementation comes from openbsd, which uses an 8-bit ctype mask which isn't large enough to encode the standard ctypes and __regex_word.

This change depends on http://reviews.llvm.org/D4642.

Diff Detail

Event Timeline

danalbert updated this revision to Diff 11827.Jul 23 2014, 4:50 PM
danalbert retitled this revision from to [libcxx] Fix regex_traits<T>::char_class_type for Android..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added reviewers: mclow.lists, EricWF.
danalbert added a subscriber: Unknown Object (MLST).

@danalbert what's the status of this patch?

We've applied it to our tree, but it doesn't exist in SVN. I uploaded here because I wasn't sure if this was the kind of change we want, or if it's considered "just and android hack" and should only live in our tree. We'd obviously like to keep any differences between us and upstream as small as possible (ideally zero). Any thoughts?

include/regex
966

This change is something that very few implementations would need afaik. We definitely need it for Android, and it will be needed for OpenBSD if that support ever gets added. I don't know about musl/newlib/uclibc.

972

This, OTOH, is something that I'm surprised wasn't needed by other implementations. Does every other libc skip 0x80 when representing character classes in ctype?

danalbert abandoned this revision.Sep 6 2014, 8:45 PM

I'm going to just fix the ctype table in Android for future versions. Having the 8-bit mask type is causing enough issues that it makes more sense to just change bionic.

The per-implementation of __regex_word will still be needed (and likely is currently needed for other implementations).