diff options
| author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-12 19:41:30 +0000 |
|---|---|---|
| committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-12 19:41:30 +0000 |
| commit | c3e4ce9b56611a173152f336c6873caa009e242b (patch) | |
| tree | 230a45b12a0aeb61272c4410e2c6679f2e10e469 /gcc/cppexp.c | |
| parent | 826eefff40054441d90f7a2f506973f983f82e49 (diff) | |
| download | ppe42-gcc-c3e4ce9b56611a173152f336c6873caa009e242b.tar.gz ppe42-gcc-c3e4ce9b56611a173152f336c6873caa009e242b.zip | |
* cppexp.c (LOGICAL): Delete macro.
(_cpp_parse_expr): Do not use UNARY for unary +. Implement ||
and && directly.
* cpphash.c (HASHSIZE): Increase to 4096.
(struct hashdummy): Add hash field.
(eq_HASHNODE): Compare unreduced hashes, then lengths, then
the string values using memcmp.
(cpp_lookup): Set dummy.hash.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34994 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppexp.c')
| -rw-r--r-- | gcc/cppexp.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c index e8ee20e978e..5f141e2c5c0 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -706,10 +706,6 @@ op_to_prio[] = top->value = OP v2; \ top->unsignedp = unsigned2; \ top->flags |= HAVE_VALUE; -#define LOGICAL(OP, NEG) \ - top->value = v1 OP v2; \ - top->unsignedp = 0; \ - if (NEG v1) skip_evaluation--; #define SHIFT(PSH, MSH) \ if (skip_evaluation) \ break; \ @@ -834,15 +830,18 @@ _cpp_parse_expr (pfile) case CPP_AND: BITWISE(&); break; case CPP_XOR: BITWISE(^); break; case CPP_OR: BITWISE(|); break; - case CPP_AND_AND: LOGICAL(&&,!); break; - case CPP_OR_OR: LOGICAL(||,); break; case CPP_LSHIFT: SHIFT(left_shift, right_shift); break; case CPP_RSHIFT: SHIFT(right_shift, left_shift); break; case CPP_PLUS: if (!(top->flags & HAVE_VALUE)) { - UNARY(/* + */); /* K+R C doesn't like unary + */ + /* Can't use UNARY(+) because K+R C did not have unary + plus. Can't use UNARY() because some compilers object + to the empty argument. */ + top->value = v2; + top->unsignedp = unsigned2; + top->flags |= HAVE_VALUE; } else { @@ -908,6 +907,16 @@ _cpp_parse_expr (pfile) } break; + case CPP_OR_OR: + top->value = v1 || v2; + top->unsignedp = 0; + if (v1) skip_evaluation--; + break; + case CPP_AND_AND: + top->value = v1 && v2; + top->unsignedp = 0; + if (!v1) skip_evaluation--; + break; case CPP_COMMA: if (CPP_PEDANTIC (pfile)) cpp_pedwarn (pfile, "comma operator in operand of #if"); |

