[PATCH] Pull Lexer's CharInfo table out for general use throughout Clang
Joerg Sonnenberger
joerg at britannica.bec.de
Mon Feb 4 03:59:50 PST 2013
On Fri, Feb 01, 2013 at 04:36:32PM -0800, Jordan Rose wrote:
> +/// Returns true if this is an ASCII character.
> +LLVM_ATTRIBUTE_ALWAYS_INLINE
> +static inline bool isASCII(char c) {
> + return static_cast<signed char>(c) >= 0;
> +}
I'd make this an explicit c >= 0 && c <= 127 test. Just for the strange
platforms with CHAR_BITS > 8.
Joerg
More information about the cfe-commits
mailing list