Skip to content

[libc] Make char parsing code encoding independent #109841

Closed
@michaelrj-google

Description

@michaelrj-google

What: Some of our string parsing code assumes ASCII, for example the string to integer code: https://github.com/llvm/llvm-project/blob/main/libc/src/__support/str_to_integer.h#L37 We should move this to be encoding independant, likely using switch statements.

Why change it: Easier support for non-ASCII character encodings (e.g. wide character, EBCDIC).

Will be bad for performance: No, it might actually be better. Clang is very good at optimizing this sort of switch statement: https://godbolt.org/z/qvrebqvvr

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions