diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-10-21 21:32:15 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-10-21 21:32:15 +0000 |
commit | 0df6c2c74ea954f8e2a0ccdb85770f2f52d4942c (patch) | |
tree | 852039142cb685177a7091771c1ef660c48a85e7 /gcc/java | |
parent | 77b1a9217b8359f417c7e090e857c464d2e8778a (diff) | |
download | gcc-0df6c2c74ea954f8e2a0ccdb85770f2f52d4942c.zip gcc-0df6c2c74ea954f8e2a0ccdb85770f2f52d4942c.tar.gz gcc-0df6c2c74ea954f8e2a0ccdb85770f2f52d4942c.tar.bz2 |
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/java/gjavah.c | 7 | ||||
-rw-r--r-- | gcc/java/lex.c | 4 | ||||
-rw-r--r-- | gcc/java/lex.h | 18 | ||||
-rw-r--r-- | gcc/java/mangle_name.c | 10 |
5 files changed, 23 insertions, 26 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 7f8e1e3..33afaae 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,13 @@ +2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * gjavah.c (jni_print_char, decode_signature_piece): Use + safe-ctype macros and/or fold extra calls into fewer ones. + * lex.c (java_read_unicode, java_lex): Likewise. + * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT, + JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise. + * mangle_name.c (append_unicode_mangled_name, + unicode_mangling_length): Likewise. + 2001-10-17 Richard Henderson <rth@redhat.com> * Make-lang.in (java/lang.o): Depend on langhooks.h. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index d340e66..d4de85b 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -287,9 +287,7 @@ jni_print_char (stream, ch) fputs ("_3", stream); else if (ch == '/') fputs ("_", stream); - else if ((ch >= '0' && ch <= '9') - || (ch >= 'a' && ch <= 'z') - || (ch >= 'A' && ch <= 'Z')) + else if (ISXDIGIT (ch)) fputc (ch, stream); else { @@ -975,8 +973,7 @@ decode_signature_piece (stream, signature, limit, need_space) array_loop: for (signature++; (signature < limit - && *signature >= '0' - && *signature <= '9'); signature++) + && ISDIGIT (*signature)); signature++) ; switch (*signature) { diff --git a/gcc/java/lex.c b/gcc/java/lex.c index c2c4634..6422f95 100644 --- a/gcc/java/lex.c +++ b/gcc/java/lex.c @@ -562,7 +562,7 @@ java_read_unicode (lex, unicode_escape_p) { if ((c = java_read_char (lex)) == UEOF) return UEOF; - if (c >= '0' && c <= '9') + if (ISDIGIT (c)) unicode |= (unicode_t)((c-'0') << shift); else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift); @@ -1058,7 +1058,7 @@ java_lex (java_lval) { /* We store in a string (in case it turns out to be a FP) and in PARTS if we have to process a integer literal. */ - int numeric = (RANGE (c, '0', '9') ? c-'0' : 10 +(c|0x20)-'a'); + int numeric = (ISDIGIT (c) ? c-'0' : 10 +(c|0x20)-'a'); int count; /* Remember when we find a valid hexadecimal digit */ diff --git a/gcc/java/lex.h b/gcc/java/lex.h index ef9e6e4..a458926 100644 --- a/gcc/java/lex.h +++ b/gcc/java/lex.h @@ -250,33 +250,25 @@ extern void java_destroy_lexer PARAMS ((java_lexer *)); #define RANGE(c, l, h) (((c) >= l && (c) <= h)) #define JAVA_WHITE_SPACE_P(c) (c == ' ' || c == '\t' || c == '\f') #define JAVA_START_CHAR_P(c) ((c < 128 \ - && (RANGE (c, 'A', 'Z') \ - || RANGE (c, 'a', 'z') \ - || c == '_' \ - || c == '$')) \ + && (ISIDST (c) || c == '$')) \ || (c >= 128 && java_start_char_p (c))) #define JAVA_PART_CHAR_P(c) ((c < 128 \ - && (RANGE (c, 'A', 'Z') \ - || RANGE (c, 'a', 'z') \ - || RANGE (c, '0', '9') \ - || c == '_' \ + && (ISIDNUM (c) \ || c == '$' \ || c == 0x0000 \ || RANGE (c, 0x01, 0x08) \ || RANGE (c, 0x0e, 0x1b) \ || c == 0x7f)) \ || (c >= 128 && java_part_char_p (c))) -#define JAVA_ASCII_DIGIT(c) RANGE (c, '0', '9') +#define JAVA_ASCII_DIGIT(c) ISDIGIT (c) #define JAVA_ASCII_OCTDIGIT(c) RANGE (c, '0', '7') -#define JAVA_ASCII_HEXDIGIT(c) (RANGE (c, '0', '9') || \ - RANGE (c, 'a', 'f') || \ - RANGE (c, 'A', 'F')) +#define JAVA_ASCII_HEXDIGIT(c) ISXDIGIT (c) #define JAVA_ASCII_FPCHAR(c) (RANGE (c, 'd', 'f') || RANGE (c, 'D', 'F') || \ c == '.' || JAVA_ASCII_DIGIT (c)) #define JAVA_FP_SUFFIX(c) (c == 'D' || c == 'd' || c == 'f' || c == 'F') #define JAVA_FP_EXP(c) (c == 'E' || c == 'F') #define JAVA_FP_PM(c) (c == '-' || c == '+') -#define JAVA_ASCII_LETTER(c) (RANGE (c, 'a', 'z') || RANGE (c, 'A', 'Z')) +#define JAVA_ASCII_LETTER(c) ISALPHA (c) /* Constants */ #define JAVA_READ_BUFFER 256 diff --git a/gcc/java/mangle_name.c b/gcc/java/mangle_name.c index 101dee7..4846db6 100644 --- a/gcc/java/mangle_name.c +++ b/gcc/java/mangle_name.c @@ -87,12 +87,11 @@ append_unicode_mangled_name (name, len) { int ch = UTF8_GET(ptr, limit); - if ((ch >= '0' && ch <= '9') + if ((ISALNUM (ch) && ch != 'U') #ifndef NO_DOLLAR_IN_LABEL || ch == '$' #endif - || (ch >= 'a' && ch <= 'z') - || (ch >= 'A' && ch <= 'Z' && ch != 'U')) + ) obstack_1grow (mangle_obstack, ch); /* Everything else needs encoding */ else @@ -149,12 +148,11 @@ unicode_mangling_length (name, len) if (ch < 0) error ("internal error - invalid Utf8 name"); - if ((ch >= '0' && ch <= '9') + if ((ISALNUM (ch) && ch != 'U') #ifndef NO_DOLLAR_IN_LABEL || ch == '$' #endif - || (ch >= 'a' && ch <= 'z') - || (ch >= 'A' && ch <= 'Z' && ch != 'U')) + ) num_chars++; /* Everything else needs encoding */ else |