[Patch] libc++: Add a default rune table

Dan Albert danalbert at google.com
Wed Dec 10 10:56:25 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21506

Yep, this is what I had in mind, just kept forgetting to do it.

If we decide we want to move all of the code over to using this table, I
think this is fine as is. If not, we should probably move the table out of
the function and into src/support/classic_table.cpp.

Moving the whole of our code over to a new table is really a decision for
mclow, but sgtm.

On Wed, Dec 10, 2014 at 8:58 AM, Ed Schouten <ed at 80386.nl> wrote:

> Hi Jonathan,
>
> Thanks for the quick response!
>
> 2014-12-10 15:46 GMT+01:00 Jonathan Roelofs <jonathan at codesourcery.com>:
> > Dan, didn't you file a PR saying that libc++ should just have its own
> table,
> > and use that for everything?
>
> That would be nice! One of the things we could then consider doing, is
> declaring the table as having 256 elements. Right now we have quite a
> lot of functions in libc++ that do something like:
>
> bool isalpha(char c) {
>   return isascii(c) ? (classic_table[c] & alpha) != 0 : false;
> }
>
> The problem with this approach is that isascii() is an obsolete X/Open
> system interfaces function.
>
> The code could be changed to manually test whether the value is <=
> 127, but if the classic_table would grow to 256, there shouldn't even
> be a reason to do the bounds checking.
>
> Thoughts?
>
> --
> Ed Schouten <ed at 80386.nl>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141210/0a4b26e0/attachment.html>


More information about the cfe-commits mailing list